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, xmlChar *name ATTRIBUTE_UNUSED) { 741 } 742 743 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) { 744 if (no == 0) return(test_xmlHashDeallocator); 745 return(NULL); 746 } 747 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 748 } 749 750 751 static void desret_int(int val ATTRIBUTE_UNUSED) { 752 } 753 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) { 754 } 755 static void desret_long(long val ATTRIBUTE_UNUSED) { 756 } 757 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) { 758 } 759 static void desret_double(double val ATTRIBUTE_UNUSED) { 760 } 761 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) { 762 } 763 #if 0 764 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) { 765 } 766 #endif 767 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) { 768 } 769 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) { 770 } 771 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) { 772 } 773 static void desret_xmlChar_ptr(xmlChar *val) { 774 if (val != NULL) 775 xmlFree(val); 776 } 777 static void desret_xmlDocPtr(xmlDocPtr val) { 778 if (val != api_doc) 779 xmlFreeDoc(val); 780 } 781 static void desret_xmlDictPtr(xmlDictPtr val) { 782 xmlDictFree(val); 783 } 784 #ifdef LIBXML_OUTPUT_ENABLED 785 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) { 786 xmlOutputBufferClose(val); 787 } 788 #endif 789 #ifdef LIBXML_READER_ENABLED 790 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) { 791 xmlFreeTextReader(val); 792 } 793 #endif 794 static void desret_xmlNodePtr(xmlNodePtr val) { 795 if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) { 796 xmlUnlinkNode(val); 797 xmlFreeNode(val); 798 } 799 } 800 static void desret_xmlAttrPtr(xmlAttrPtr val) { 801 if (val != NULL) { 802 xmlUnlinkNode((xmlNodePtr) val); 803 xmlFreeNode((xmlNodePtr) val); 804 } 805 } 806 static void desret_xmlEntityPtr(xmlEntityPtr val) { 807 if (val != NULL) { 808 xmlUnlinkNode((xmlNodePtr) val); 809 xmlFreeNode((xmlNodePtr) val); 810 } 811 } 812 static void desret_xmlElementPtr(xmlElementPtr val) { 813 if (val != NULL) { 814 xmlUnlinkNode((xmlNodePtr) val); 815 } 816 } 817 static void desret_xmlAttributePtr(xmlAttributePtr val) { 818 if (val != NULL) { 819 xmlUnlinkNode((xmlNodePtr) val); 820 } 821 } 822 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) { 823 } 824 static void desret_xmlDtdPtr(xmlDtdPtr val) { 825 desret_xmlNodePtr((xmlNodePtr)val); 826 } 827 #ifdef LIBXML_XPATH_ENABLED 828 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) { 829 xmlXPathFreeObject(val); 830 } 831 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) { 832 xmlXPathFreeNodeSet(val); 833 } 834 #endif 835 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) { 836 xmlFreeParserCtxt(val); 837 } 838 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) { 839 xmlFreeParserInputBuffer(val); 840 } 841 static void desret_xmlParserInputPtr(xmlParserInputPtr val) { 842 xmlFreeInputStream(val); 843 } 844 #ifdef LIBXML_WRITER_ENABLED 845 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) { 846 xmlFreeTextWriter(val); 847 } 848 #endif 849 static void desret_xmlBufferPtr(xmlBufferPtr val) { 850 xmlBufferFree(val); 851 } 852 #ifdef LIBXML_SCHEMAS_ENABLED 853 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) { 854 xmlSchemaFreeParserCtxt(val); 855 } 856 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) { 857 } 858 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) { 859 xmlRelaxNGFreeParserCtxt(val); 860 } 861 #endif 862 #ifdef LIBXML_HTML_ENABLED 863 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) { 864 } 865 #endif 866 #ifdef LIBXML_HTTP_ENABLED 867 static void desret_xmlNanoHTTPCtxtPtr(void *val) { 868 xmlNanoHTTPClose(val); 869 } 870 #endif 871 #ifdef LIBXML_FTP_ENABLED 872 static void desret_xmlNanoFTPCtxtPtr(void *val) { 873 xmlNanoFTPClose(val); 874 } 875 #endif 876 /* cut and pasted from autogenerated to avoid troubles */ 877 #define gen_nb_const_xmlChar_ptr_ptr 1 878 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 879 return(NULL); 880 } 881 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 882 } 883 884 #define gen_nb_unsigned_char_ptr 1 885 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 886 return(NULL); 887 } 888 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 889 } 890 891 #define gen_nb_const_unsigned_char_ptr 1 892 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 893 return(NULL); 894 } 895 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 896 } 897 898 #ifdef LIBXML_HTML_ENABLED 899 #define gen_nb_const_htmlNodePtr 1 900 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 901 return(NULL); 902 } 903 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 904 } 905 #endif 906 907 #ifdef LIBXML_HTML_ENABLED 908 #define gen_nb_htmlDocPtr 3 909 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 910 if (no == 0) return(htmlNewDoc(NULL, NULL)); 911 if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0)); 912 return(NULL); 913 } 914 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 915 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) 916 xmlFreeDoc(val); 917 } 918 static void desret_htmlDocPtr(htmlDocPtr val) { 919 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) 920 xmlFreeDoc(val); 921 } 922 #define gen_nb_htmlParserCtxtPtr 3 923 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 924 if (no == 0) return(xmlNewParserCtxt()); 925 if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7)); 926 return(NULL); 927 } 928 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 929 if (val != NULL) 930 htmlFreeParserCtxt(val); 931 } 932 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) { 933 if (val != NULL) 934 htmlFreeParserCtxt(val); 935 } 936 #endif 937 938 #ifdef LIBXML_XPATH_ENABLED 939 #define gen_nb_xmlNodeSetPtr 1 940 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 941 return(NULL); 942 } 943 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 944 } 945 #endif 946 947 #ifdef LIBXML_DEBUG_ENABLED 948 #ifdef LIBXML_XPATH_ENABLED 949 #define gen_nb_xmlShellCtxtPtr 1 950 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 951 return(NULL); 952 } 953 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 954 } 955 #endif 956 #endif 957 958 #ifdef LIBXML_PATTERN_ENABLED 959 #define gen_nb_xmlPatternPtr 1 960 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 961 return(NULL); 962 } 963 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 964 } 965 #endif 966 967 #define gen_nb_xmlElementContentPtr 1 968 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 969 return(NULL); 970 } 971 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) { 972 if (val != NULL) 973 xmlFreeElementContent(val); 974 } 975 static void desret_xmlElementContentPtr(xmlElementContentPtr val) { 976 if (val != NULL) 977 xmlFreeElementContent(val); 978 } 979 980 #define gen_nb_xmlParserNodeInfoSeqPtr 1 981 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 982 return(NULL); 983 } 984 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 985 } 986 987 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) { 988 } 989 990 #define gen_nb_void_ptr_ptr 1 991 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 992 return(NULL); 993 } 994 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 995 } 996 997 /************************************************************************ 998 * * 999 * WARNING: end of the manually maintained part of the test code * 1000 * do not remove or alter the CUT HERE line * 1001 * * 1002 ************************************************************************/ 1003 1004 /* CUT HERE: everything below that line is generated */ 1005 #ifdef LIBXML_HTML_ENABLED 1006 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) { 1007 } 1008 1009 #endif 1010 1011 #define gen_nb_xmlAttributeDefault 4 1012 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) { 1013 if (no == 1) return(XML_ATTRIBUTE_FIXED); 1014 if (no == 2) return(XML_ATTRIBUTE_IMPLIED); 1015 if (no == 3) return(XML_ATTRIBUTE_NONE); 1016 if (no == 4) return(XML_ATTRIBUTE_REQUIRED); 1017 return(0); 1018 } 1019 1020 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1021 } 1022 1023 #define gen_nb_xmlAttributeType 4 1024 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) { 1025 if (no == 1) return(XML_ATTRIBUTE_CDATA); 1026 if (no == 2) return(XML_ATTRIBUTE_ENTITIES); 1027 if (no == 3) return(XML_ATTRIBUTE_ENTITY); 1028 if (no == 4) return(XML_ATTRIBUTE_ENUMERATION); 1029 return(0); 1030 } 1031 1032 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1033 } 1034 1035 #define gen_nb_xmlBufferAllocationScheme 4 1036 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) { 1037 if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED); 1038 if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT); 1039 if (no == 3) return(XML_BUFFER_ALLOC_EXACT); 1040 if (no == 4) return(XML_BUFFER_ALLOC_HYBRID); 1041 return(0); 1042 } 1043 1044 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1045 } 1046 1047 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) { 1048 } 1049 1050 #ifdef LIBXML_CATALOG_ENABLED 1051 #define gen_nb_xmlCatalogAllow 4 1052 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) { 1053 if (no == 1) return(XML_CATA_ALLOW_ALL); 1054 if (no == 2) return(XML_CATA_ALLOW_DOCUMENT); 1055 if (no == 3) return(XML_CATA_ALLOW_GLOBAL); 1056 if (no == 4) return(XML_CATA_ALLOW_NONE); 1057 return(0); 1058 } 1059 1060 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1061 } 1062 1063 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) { 1064 } 1065 1066 #endif 1067 1068 #ifdef LIBXML_CATALOG_ENABLED 1069 #define gen_nb_xmlCatalogPrefer 3 1070 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) { 1071 if (no == 1) return(XML_CATA_PREFER_NONE); 1072 if (no == 2) return(XML_CATA_PREFER_PUBLIC); 1073 if (no == 3) return(XML_CATA_PREFER_SYSTEM); 1074 return(0); 1075 } 1076 1077 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1078 } 1079 1080 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) { 1081 } 1082 1083 #endif 1084 1085 #define gen_nb_xmlElementContentType 4 1086 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) { 1087 if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT); 1088 if (no == 2) return(XML_ELEMENT_CONTENT_OR); 1089 if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA); 1090 if (no == 4) return(XML_ELEMENT_CONTENT_SEQ); 1091 return(0); 1092 } 1093 1094 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1095 } 1096 1097 #define gen_nb_xmlElementTypeVal 4 1098 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) { 1099 if (no == 1) return(XML_ELEMENT_TYPE_ANY); 1100 if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT); 1101 if (no == 3) return(XML_ELEMENT_TYPE_EMPTY); 1102 if (no == 4) return(XML_ELEMENT_TYPE_MIXED); 1103 return(0); 1104 } 1105 1106 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1107 } 1108 1109 #define gen_nb_xmlFeature 4 1110 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) { 1111 if (no == 1) return(XML_WITH_AUTOMATA); 1112 if (no == 2) return(XML_WITH_C14N); 1113 if (no == 3) return(XML_WITH_CATALOG); 1114 if (no == 4) return(XML_WITH_DEBUG); 1115 return(0); 1116 } 1117 1118 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1119 } 1120 1121 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { 1122 } 1123 1124 #ifdef LIBXML_SCHEMAS_ENABLED 1125 #define gen_nb_xmlSchemaValType 4 1126 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) { 1127 if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE); 1128 if (no == 2) return(XML_SCHEMAS_ANYTYPE); 1129 if (no == 3) return(XML_SCHEMAS_ANYURI); 1130 if (no == 4) return(XML_SCHEMAS_BASE64BINARY); 1131 return(0); 1132 } 1133 1134 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1135 } 1136 1137 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) { 1138 } 1139 1140 #endif 1141 1142 #ifdef LIBXML_SCHEMAS_ENABLED 1143 #define gen_nb_xmlSchemaWhitespaceValueType 4 1144 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) { 1145 if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE); 1146 if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE); 1147 if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE); 1148 if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN); 1149 return(0); 1150 } 1151 1152 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1153 } 1154 1155 #endif 1156 1157 #include <libxml/HTMLparser.h> 1158 #include <libxml/HTMLtree.h> 1159 #include <libxml/SAX2.h> 1160 #include <libxml/c14n.h> 1161 #include <libxml/catalog.h> 1162 #include <libxml/chvalid.h> 1163 #include <libxml/debugXML.h> 1164 #include <libxml/dict.h> 1165 #include <libxml/encoding.h> 1166 #include <libxml/entities.h> 1167 #include <libxml/hash.h> 1168 #include <libxml/list.h> 1169 #include <libxml/nanoftp.h> 1170 #include <libxml/nanohttp.h> 1171 #include <libxml/parser.h> 1172 #include <libxml/parserInternals.h> 1173 #include <libxml/pattern.h> 1174 #include <libxml/relaxng.h> 1175 #include <libxml/schemasInternals.h> 1176 #include <libxml/schematron.h> 1177 #include <libxml/tree.h> 1178 #include <libxml/uri.h> 1179 #include <libxml/valid.h> 1180 #include <libxml/xinclude.h> 1181 #include <libxml/xmlIO.h> 1182 #include <libxml/xmlautomata.h> 1183 #include <libxml/xmlerror.h> 1184 #include <libxml/xmlmodule.h> 1185 #include <libxml/xmlreader.h> 1186 #include <libxml/xmlregexp.h> 1187 #include <libxml/xmlsave.h> 1188 #include <libxml/xmlschemas.h> 1189 #include <libxml/xmlschemastypes.h> 1190 #include <libxml/xmlstring.h> 1191 #include <libxml/xmlunicode.h> 1192 #include <libxml/xmlwriter.h> 1193 #include <libxml/xpath.h> 1194 #include <libxml/xpathInternals.h> 1195 #include <libxml/xpointer.h> 1196 static int test_HTMLparser(void); 1197 static int test_HTMLtree(void); 1198 static int test_SAX2(void); 1199 static int test_c14n(void); 1200 static int test_catalog(void); 1201 static int test_chvalid(void); 1202 static int test_debugXML(void); 1203 static int test_dict(void); 1204 static int test_encoding(void); 1205 static int test_entities(void); 1206 static int test_hash(void); 1207 static int test_list(void); 1208 static int test_nanoftp(void); 1209 static int test_nanohttp(void); 1210 static int test_parser(void); 1211 static int test_parserInternals(void); 1212 static int test_pattern(void); 1213 static int test_relaxng(void); 1214 static int test_schemasInternals(void); 1215 static int test_schematron(void); 1216 static int test_tree(void); 1217 static int test_uri(void); 1218 static int test_valid(void); 1219 static int test_xinclude(void); 1220 static int test_xmlIO(void); 1221 static int test_xmlautomata(void); 1222 static int test_xmlerror(void); 1223 static int test_xmlmodule(void); 1224 static int test_xmlreader(void); 1225 static int test_xmlregexp(void); 1226 static int test_xmlsave(void); 1227 static int test_xmlschemas(void); 1228 static int test_xmlschemastypes(void); 1229 static int test_xmlstring(void); 1230 static int test_xmlunicode(void); 1231 static int test_xmlwriter(void); 1232 static int test_xpath(void); 1233 static int test_xpathInternals(void); 1234 static int test_xpointer(void); 1235 1236 /** 1237 * testlibxml2: 1238 * 1239 * Main entry point of the tester for the full libxml2 module, 1240 * it calls all the tester entry point for each module. 1241 * 1242 * Returns the number of error found 1243 */ 1244 static int 1245 testlibxml2(void) 1246 { 1247 int test_ret = 0; 1248 1249 test_ret += test_HTMLparser(); 1250 test_ret += test_HTMLtree(); 1251 test_ret += test_SAX2(); 1252 test_ret += test_c14n(); 1253 test_ret += test_catalog(); 1254 test_ret += test_chvalid(); 1255 test_ret += test_debugXML(); 1256 test_ret += test_dict(); 1257 test_ret += test_encoding(); 1258 test_ret += test_entities(); 1259 test_ret += test_hash(); 1260 test_ret += test_list(); 1261 test_ret += test_nanoftp(); 1262 test_ret += test_nanohttp(); 1263 test_ret += test_parser(); 1264 test_ret += test_parserInternals(); 1265 test_ret += test_pattern(); 1266 test_ret += test_relaxng(); 1267 test_ret += test_schemasInternals(); 1268 test_ret += test_schematron(); 1269 test_ret += test_tree(); 1270 test_ret += test_uri(); 1271 test_ret += test_valid(); 1272 test_ret += test_xinclude(); 1273 test_ret += test_xmlIO(); 1274 test_ret += test_xmlautomata(); 1275 test_ret += test_xmlerror(); 1276 test_ret += test_xmlmodule(); 1277 test_ret += test_xmlreader(); 1278 test_ret += test_xmlregexp(); 1279 test_ret += test_xmlsave(); 1280 test_ret += test_xmlschemas(); 1281 test_ret += test_xmlschemastypes(); 1282 test_ret += test_xmlstring(); 1283 test_ret += test_xmlunicode(); 1284 test_ret += test_xmlwriter(); 1285 test_ret += test_xpath(); 1286 test_ret += test_xpathInternals(); 1287 test_ret += test_xpointer(); 1288 1289 printf("Total: %d functions, %d tests, %d errors\n", 1290 function_tests, call_tests, test_ret); 1291 return(test_ret); 1292 } 1293 1294 1295 static int 1296 test_UTF8ToHtml(void) { 1297 int test_ret = 0; 1298 1299 #if defined(LIBXML_HTML_ENABLED) 1300 int mem_base; 1301 int ret_val; 1302 unsigned char * out; /* a pointer to an array of bytes to store the result */ 1303 int n_out; 1304 int * outlen; /* the length of @out */ 1305 int n_outlen; 1306 unsigned char * in; /* a pointer to an array of UTF-8 chars */ 1307 int n_in; 1308 int * inlen; /* the length of @in */ 1309 int n_inlen; 1310 1311 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 1312 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 1313 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 1314 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 1315 mem_base = xmlMemBlocks(); 1316 out = gen_unsigned_char_ptr(n_out, 0); 1317 outlen = gen_int_ptr(n_outlen, 1); 1318 in = gen_const_unsigned_char_ptr(n_in, 2); 1319 inlen = gen_int_ptr(n_inlen, 3); 1320 1321 ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen); 1322 desret_int(ret_val); 1323 call_tests++; 1324 des_unsigned_char_ptr(n_out, out, 0); 1325 des_int_ptr(n_outlen, outlen, 1); 1326 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 1327 des_int_ptr(n_inlen, inlen, 3); 1328 xmlResetLastError(); 1329 if (mem_base != xmlMemBlocks()) { 1330 printf("Leak of %d blocks found in UTF8ToHtml", 1331 xmlMemBlocks() - mem_base); 1332 test_ret++; 1333 printf(" %d", n_out); 1334 printf(" %d", n_outlen); 1335 printf(" %d", n_in); 1336 printf(" %d", n_inlen); 1337 printf("\n"); 1338 } 1339 } 1340 } 1341 } 1342 } 1343 function_tests++; 1344 #endif 1345 1346 return(test_ret); 1347 } 1348 1349 #ifdef LIBXML_HTML_ENABLED 1350 1351 #define gen_nb_const_htmlElemDesc_ptr 1 1352 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1353 return(NULL); 1354 } 1355 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1356 } 1357 #endif 1358 1359 1360 static int 1361 test_htmlAttrAllowed(void) { 1362 int test_ret = 0; 1363 1364 #if defined(LIBXML_HTML_ENABLED) 1365 int mem_base; 1366 htmlStatus ret_val; 1367 htmlElemDesc * elt; /* HTML element */ 1368 int n_elt; 1369 xmlChar * attr; /* HTML attribute */ 1370 int n_attr; 1371 int legacy; /* whether to allow deprecated attributes */ 1372 int n_legacy; 1373 1374 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) { 1375 for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) { 1376 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) { 1377 mem_base = xmlMemBlocks(); 1378 elt = gen_const_htmlElemDesc_ptr(n_elt, 0); 1379 attr = gen_const_xmlChar_ptr(n_attr, 1); 1380 legacy = gen_int(n_legacy, 2); 1381 1382 ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy); 1383 desret_htmlStatus(ret_val); 1384 call_tests++; 1385 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0); 1386 des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1); 1387 des_int(n_legacy, legacy, 2); 1388 xmlResetLastError(); 1389 if (mem_base != xmlMemBlocks()) { 1390 printf("Leak of %d blocks found in htmlAttrAllowed", 1391 xmlMemBlocks() - mem_base); 1392 test_ret++; 1393 printf(" %d", n_elt); 1394 printf(" %d", n_attr); 1395 printf(" %d", n_legacy); 1396 printf("\n"); 1397 } 1398 } 1399 } 1400 } 1401 function_tests++; 1402 #endif 1403 1404 return(test_ret); 1405 } 1406 1407 #ifdef LIBXML_HTML_ENABLED 1408 1409 #define gen_nb_htmlNodePtr 1 1410 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1411 return(NULL); 1412 } 1413 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1414 } 1415 #endif 1416 1417 1418 static int 1419 test_htmlAutoCloseTag(void) { 1420 int test_ret = 0; 1421 1422 #if defined(LIBXML_HTML_ENABLED) 1423 int mem_base; 1424 int ret_val; 1425 htmlDocPtr doc; /* the HTML document */ 1426 int n_doc; 1427 xmlChar * name; /* The tag name */ 1428 int n_name; 1429 htmlNodePtr elem; /* the HTML element */ 1430 int n_elem; 1431 1432 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 1433 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 1434 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) { 1435 mem_base = xmlMemBlocks(); 1436 doc = gen_htmlDocPtr(n_doc, 0); 1437 name = gen_const_xmlChar_ptr(n_name, 1); 1438 elem = gen_htmlNodePtr(n_elem, 2); 1439 1440 ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem); 1441 desret_int(ret_val); 1442 call_tests++; 1443 des_htmlDocPtr(n_doc, doc, 0); 1444 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 1445 des_htmlNodePtr(n_elem, elem, 2); 1446 xmlResetLastError(); 1447 if (mem_base != xmlMemBlocks()) { 1448 printf("Leak of %d blocks found in htmlAutoCloseTag", 1449 xmlMemBlocks() - mem_base); 1450 test_ret++; 1451 printf(" %d", n_doc); 1452 printf(" %d", n_name); 1453 printf(" %d", n_elem); 1454 printf("\n"); 1455 } 1456 } 1457 } 1458 } 1459 function_tests++; 1460 #endif 1461 1462 return(test_ret); 1463 } 1464 1465 1466 static int 1467 test_htmlCreateMemoryParserCtxt(void) { 1468 int test_ret = 0; 1469 1470 #if defined(LIBXML_HTML_ENABLED) 1471 int mem_base; 1472 htmlParserCtxtPtr ret_val; 1473 char * buffer; /* a pointer to a char array */ 1474 int n_buffer; 1475 int size; /* the size of the array */ 1476 int n_size; 1477 1478 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 1479 for (n_size = 0;n_size < gen_nb_int;n_size++) { 1480 mem_base = xmlMemBlocks(); 1481 buffer = gen_const_char_ptr(n_buffer, 0); 1482 size = gen_int(n_size, 1); 1483 1484 ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size); 1485 desret_htmlParserCtxtPtr(ret_val); 1486 call_tests++; 1487 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 1488 des_int(n_size, size, 1); 1489 xmlResetLastError(); 1490 if (mem_base != xmlMemBlocks()) { 1491 printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt", 1492 xmlMemBlocks() - mem_base); 1493 test_ret++; 1494 printf(" %d", n_buffer); 1495 printf(" %d", n_size); 1496 printf("\n"); 1497 } 1498 } 1499 } 1500 function_tests++; 1501 #endif 1502 1503 return(test_ret); 1504 } 1505 1506 #ifdef LIBXML_HTML_ENABLED 1507 1508 #define gen_nb_htmlSAXHandlerPtr 1 1509 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1510 return(NULL); 1511 } 1512 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1513 } 1514 #endif 1515 1516 1517 static int 1518 test_htmlCreatePushParserCtxt(void) { 1519 int test_ret = 0; 1520 1521 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) 1522 int mem_base; 1523 htmlParserCtxtPtr ret_val; 1524 htmlSAXHandlerPtr sax; /* a SAX handler */ 1525 int n_sax; 1526 void * user_data; /* The user data returned on SAX callbacks */ 1527 int n_user_data; 1528 char * chunk; /* a pointer to an array of chars */ 1529 int n_chunk; 1530 int size; /* number of chars in the array */ 1531 int n_size; 1532 const char * filename; /* an optional file name or URI */ 1533 int n_filename; 1534 xmlCharEncoding enc; /* an optional encoding */ 1535 int n_enc; 1536 1537 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { 1538 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 1539 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 1540 for (n_size = 0;n_size < gen_nb_int;n_size++) { 1541 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 1542 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 1543 mem_base = xmlMemBlocks(); 1544 sax = gen_htmlSAXHandlerPtr(n_sax, 0); 1545 user_data = gen_userdata(n_user_data, 1); 1546 chunk = gen_const_char_ptr(n_chunk, 2); 1547 size = gen_int(n_size, 3); 1548 filename = gen_fileoutput(n_filename, 4); 1549 enc = gen_xmlCharEncoding(n_enc, 5); 1550 1551 ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc); 1552 desret_htmlParserCtxtPtr(ret_val); 1553 call_tests++; 1554 des_htmlSAXHandlerPtr(n_sax, sax, 0); 1555 des_userdata(n_user_data, user_data, 1); 1556 des_const_char_ptr(n_chunk, (const char *)chunk, 2); 1557 des_int(n_size, size, 3); 1558 des_fileoutput(n_filename, filename, 4); 1559 des_xmlCharEncoding(n_enc, enc, 5); 1560 xmlResetLastError(); 1561 if (mem_base != xmlMemBlocks()) { 1562 printf("Leak of %d blocks found in htmlCreatePushParserCtxt", 1563 xmlMemBlocks() - mem_base); 1564 test_ret++; 1565 printf(" %d", n_sax); 1566 printf(" %d", n_user_data); 1567 printf(" %d", n_chunk); 1568 printf(" %d", n_size); 1569 printf(" %d", n_filename); 1570 printf(" %d", n_enc); 1571 printf("\n"); 1572 } 1573 } 1574 } 1575 } 1576 } 1577 } 1578 } 1579 function_tests++; 1580 #endif 1581 1582 return(test_ret); 1583 } 1584 1585 1586 static int 1587 test_htmlCtxtReadDoc(void) { 1588 int test_ret = 0; 1589 1590 #if defined(LIBXML_HTML_ENABLED) 1591 int mem_base; 1592 htmlDocPtr ret_val; 1593 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1594 int n_ctxt; 1595 xmlChar * cur; /* a pointer to a zero terminated string */ 1596 int n_cur; 1597 const char * URL; /* the base URL to use for the document */ 1598 int n_URL; 1599 char * encoding; /* the document encoding, or NULL */ 1600 int n_encoding; 1601 int options; /* a combination of htmlParserOption(s) */ 1602 int n_options; 1603 1604 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1605 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 1606 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 1607 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 1608 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1609 mem_base = xmlMemBlocks(); 1610 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1611 cur = gen_const_xmlChar_ptr(n_cur, 1); 1612 URL = gen_filepath(n_URL, 2); 1613 encoding = gen_const_char_ptr(n_encoding, 3); 1614 options = gen_int(n_options, 4); 1615 1616 ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options); 1617 desret_htmlDocPtr(ret_val); 1618 call_tests++; 1619 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1620 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 1621 des_filepath(n_URL, URL, 2); 1622 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 1623 des_int(n_options, options, 4); 1624 xmlResetLastError(); 1625 if (mem_base != xmlMemBlocks()) { 1626 printf("Leak of %d blocks found in htmlCtxtReadDoc", 1627 xmlMemBlocks() - mem_base); 1628 test_ret++; 1629 printf(" %d", n_ctxt); 1630 printf(" %d", n_cur); 1631 printf(" %d", n_URL); 1632 printf(" %d", n_encoding); 1633 printf(" %d", n_options); 1634 printf("\n"); 1635 } 1636 } 1637 } 1638 } 1639 } 1640 } 1641 function_tests++; 1642 #endif 1643 1644 return(test_ret); 1645 } 1646 1647 1648 static int 1649 test_htmlCtxtReadFile(void) { 1650 int test_ret = 0; 1651 1652 #if defined(LIBXML_HTML_ENABLED) 1653 htmlDocPtr ret_val; 1654 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1655 int n_ctxt; 1656 const char * filename; /* a file or URL */ 1657 int n_filename; 1658 char * encoding; /* the document encoding, or NULL */ 1659 int n_encoding; 1660 int options; /* a combination of htmlParserOption(s) */ 1661 int n_options; 1662 1663 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1664 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 1665 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 1666 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1667 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1668 filename = gen_filepath(n_filename, 1); 1669 encoding = gen_const_char_ptr(n_encoding, 2); 1670 options = gen_int(n_options, 3); 1671 1672 ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options); 1673 desret_htmlDocPtr(ret_val); 1674 call_tests++; 1675 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1676 des_filepath(n_filename, filename, 1); 1677 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 1678 des_int(n_options, options, 3); 1679 xmlResetLastError(); 1680 } 1681 } 1682 } 1683 } 1684 function_tests++; 1685 #endif 1686 1687 return(test_ret); 1688 } 1689 1690 1691 static int 1692 test_htmlCtxtReadMemory(void) { 1693 int test_ret = 0; 1694 1695 #if defined(LIBXML_HTML_ENABLED) 1696 int mem_base; 1697 htmlDocPtr ret_val; 1698 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1699 int n_ctxt; 1700 char * buffer; /* a pointer to a char array */ 1701 int n_buffer; 1702 int size; /* the size of the array */ 1703 int n_size; 1704 const char * URL; /* the base URL to use for the document */ 1705 int n_URL; 1706 char * encoding; /* the document encoding, or NULL */ 1707 int n_encoding; 1708 int options; /* a combination of htmlParserOption(s) */ 1709 int n_options; 1710 1711 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1712 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 1713 for (n_size = 0;n_size < gen_nb_int;n_size++) { 1714 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 1715 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 1716 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1717 mem_base = xmlMemBlocks(); 1718 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1719 buffer = gen_const_char_ptr(n_buffer, 1); 1720 size = gen_int(n_size, 2); 1721 URL = gen_filepath(n_URL, 3); 1722 encoding = gen_const_char_ptr(n_encoding, 4); 1723 options = gen_int(n_options, 5); 1724 1725 ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options); 1726 desret_htmlDocPtr(ret_val); 1727 call_tests++; 1728 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1729 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 1730 des_int(n_size, size, 2); 1731 des_filepath(n_URL, URL, 3); 1732 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 1733 des_int(n_options, options, 5); 1734 xmlResetLastError(); 1735 if (mem_base != xmlMemBlocks()) { 1736 printf("Leak of %d blocks found in htmlCtxtReadMemory", 1737 xmlMemBlocks() - mem_base); 1738 test_ret++; 1739 printf(" %d", n_ctxt); 1740 printf(" %d", n_buffer); 1741 printf(" %d", n_size); 1742 printf(" %d", n_URL); 1743 printf(" %d", n_encoding); 1744 printf(" %d", n_options); 1745 printf("\n"); 1746 } 1747 } 1748 } 1749 } 1750 } 1751 } 1752 } 1753 function_tests++; 1754 #endif 1755 1756 return(test_ret); 1757 } 1758 1759 1760 static int 1761 test_htmlCtxtReset(void) { 1762 int test_ret = 0; 1763 1764 #if defined(LIBXML_HTML_ENABLED) 1765 int mem_base; 1766 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1767 int n_ctxt; 1768 1769 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1770 mem_base = xmlMemBlocks(); 1771 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1772 1773 htmlCtxtReset(ctxt); 1774 call_tests++; 1775 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1776 xmlResetLastError(); 1777 if (mem_base != xmlMemBlocks()) { 1778 printf("Leak of %d blocks found in htmlCtxtReset", 1779 xmlMemBlocks() - mem_base); 1780 test_ret++; 1781 printf(" %d", n_ctxt); 1782 printf("\n"); 1783 } 1784 } 1785 function_tests++; 1786 #endif 1787 1788 return(test_ret); 1789 } 1790 1791 1792 static int 1793 test_htmlCtxtUseOptions(void) { 1794 int test_ret = 0; 1795 1796 #if defined(LIBXML_HTML_ENABLED) 1797 int mem_base; 1798 int ret_val; 1799 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1800 int n_ctxt; 1801 int options; /* a combination of htmlParserOption(s) */ 1802 int n_options; 1803 1804 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1805 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1806 mem_base = xmlMemBlocks(); 1807 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1808 options = gen_int(n_options, 1); 1809 1810 ret_val = htmlCtxtUseOptions(ctxt, options); 1811 desret_int(ret_val); 1812 call_tests++; 1813 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1814 des_int(n_options, options, 1); 1815 xmlResetLastError(); 1816 if (mem_base != xmlMemBlocks()) { 1817 printf("Leak of %d blocks found in htmlCtxtUseOptions", 1818 xmlMemBlocks() - mem_base); 1819 test_ret++; 1820 printf(" %d", n_ctxt); 1821 printf(" %d", n_options); 1822 printf("\n"); 1823 } 1824 } 1825 } 1826 function_tests++; 1827 #endif 1828 1829 return(test_ret); 1830 } 1831 1832 1833 static int 1834 test_htmlElementAllowedHere(void) { 1835 int test_ret = 0; 1836 1837 #if defined(LIBXML_HTML_ENABLED) 1838 int mem_base; 1839 int ret_val; 1840 htmlElemDesc * parent; /* HTML parent element */ 1841 int n_parent; 1842 xmlChar * elt; /* HTML element */ 1843 int n_elt; 1844 1845 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) { 1846 for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) { 1847 mem_base = xmlMemBlocks(); 1848 parent = gen_const_htmlElemDesc_ptr(n_parent, 0); 1849 elt = gen_const_xmlChar_ptr(n_elt, 1); 1850 1851 ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt); 1852 desret_int(ret_val); 1853 call_tests++; 1854 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0); 1855 des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1); 1856 xmlResetLastError(); 1857 if (mem_base != xmlMemBlocks()) { 1858 printf("Leak of %d blocks found in htmlElementAllowedHere", 1859 xmlMemBlocks() - mem_base); 1860 test_ret++; 1861 printf(" %d", n_parent); 1862 printf(" %d", n_elt); 1863 printf("\n"); 1864 } 1865 } 1866 } 1867 function_tests++; 1868 #endif 1869 1870 return(test_ret); 1871 } 1872 1873 1874 static int 1875 test_htmlElementStatusHere(void) { 1876 int test_ret = 0; 1877 1878 #if defined(LIBXML_HTML_ENABLED) 1879 int mem_base; 1880 htmlStatus ret_val; 1881 htmlElemDesc * parent; /* HTML parent element */ 1882 int n_parent; 1883 htmlElemDesc * elt; /* HTML element */ 1884 int n_elt; 1885 1886 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) { 1887 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) { 1888 mem_base = xmlMemBlocks(); 1889 parent = gen_const_htmlElemDesc_ptr(n_parent, 0); 1890 elt = gen_const_htmlElemDesc_ptr(n_elt, 1); 1891 1892 ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt); 1893 desret_htmlStatus(ret_val); 1894 call_tests++; 1895 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0); 1896 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1); 1897 xmlResetLastError(); 1898 if (mem_base != xmlMemBlocks()) { 1899 printf("Leak of %d blocks found in htmlElementStatusHere", 1900 xmlMemBlocks() - mem_base); 1901 test_ret++; 1902 printf(" %d", n_parent); 1903 printf(" %d", n_elt); 1904 printf("\n"); 1905 } 1906 } 1907 } 1908 function_tests++; 1909 #endif 1910 1911 return(test_ret); 1912 } 1913 1914 1915 static int 1916 test_htmlEncodeEntities(void) { 1917 int test_ret = 0; 1918 1919 #if defined(LIBXML_HTML_ENABLED) 1920 int mem_base; 1921 int ret_val; 1922 unsigned char * out; /* a pointer to an array of bytes to store the result */ 1923 int n_out; 1924 int * outlen; /* the length of @out */ 1925 int n_outlen; 1926 unsigned char * in; /* a pointer to an array of UTF-8 chars */ 1927 int n_in; 1928 int * inlen; /* the length of @in */ 1929 int n_inlen; 1930 int quoteChar; /* the quote character to escape (' or ") or zero. */ 1931 int n_quoteChar; 1932 1933 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 1934 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 1935 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 1936 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 1937 for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) { 1938 mem_base = xmlMemBlocks(); 1939 out = gen_unsigned_char_ptr(n_out, 0); 1940 outlen = gen_int_ptr(n_outlen, 1); 1941 in = gen_const_unsigned_char_ptr(n_in, 2); 1942 inlen = gen_int_ptr(n_inlen, 3); 1943 quoteChar = gen_int(n_quoteChar, 4); 1944 1945 ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar); 1946 desret_int(ret_val); 1947 call_tests++; 1948 des_unsigned_char_ptr(n_out, out, 0); 1949 des_int_ptr(n_outlen, outlen, 1); 1950 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 1951 des_int_ptr(n_inlen, inlen, 3); 1952 des_int(n_quoteChar, quoteChar, 4); 1953 xmlResetLastError(); 1954 if (mem_base != xmlMemBlocks()) { 1955 printf("Leak of %d blocks found in htmlEncodeEntities", 1956 xmlMemBlocks() - mem_base); 1957 test_ret++; 1958 printf(" %d", n_out); 1959 printf(" %d", n_outlen); 1960 printf(" %d", n_in); 1961 printf(" %d", n_inlen); 1962 printf(" %d", n_quoteChar); 1963 printf("\n"); 1964 } 1965 } 1966 } 1967 } 1968 } 1969 } 1970 function_tests++; 1971 #endif 1972 1973 return(test_ret); 1974 } 1975 1976 1977 static int 1978 test_htmlEntityLookup(void) { 1979 int test_ret = 0; 1980 1981 #if defined(LIBXML_HTML_ENABLED) 1982 int mem_base; 1983 const htmlEntityDesc * ret_val; 1984 xmlChar * name; /* the entity name */ 1985 int n_name; 1986 1987 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 1988 mem_base = xmlMemBlocks(); 1989 name = gen_const_xmlChar_ptr(n_name, 0); 1990 1991 ret_val = htmlEntityLookup((const xmlChar *)name); 1992 desret_const_htmlEntityDesc_ptr(ret_val); 1993 call_tests++; 1994 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 1995 xmlResetLastError(); 1996 if (mem_base != xmlMemBlocks()) { 1997 printf("Leak of %d blocks found in htmlEntityLookup", 1998 xmlMemBlocks() - mem_base); 1999 test_ret++; 2000 printf(" %d", n_name); 2001 printf("\n"); 2002 } 2003 } 2004 function_tests++; 2005 #endif 2006 2007 return(test_ret); 2008 } 2009 2010 2011 static int 2012 test_htmlEntityValueLookup(void) { 2013 int test_ret = 0; 2014 2015 #if defined(LIBXML_HTML_ENABLED) 2016 int mem_base; 2017 const htmlEntityDesc * ret_val; 2018 unsigned int value; /* the entity's unicode value */ 2019 int n_value; 2020 2021 for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) { 2022 mem_base = xmlMemBlocks(); 2023 value = gen_unsigned_int(n_value, 0); 2024 2025 ret_val = htmlEntityValueLookup(value); 2026 desret_const_htmlEntityDesc_ptr(ret_val); 2027 call_tests++; 2028 des_unsigned_int(n_value, value, 0); 2029 xmlResetLastError(); 2030 if (mem_base != xmlMemBlocks()) { 2031 printf("Leak of %d blocks found in htmlEntityValueLookup", 2032 xmlMemBlocks() - mem_base); 2033 test_ret++; 2034 printf(" %d", n_value); 2035 printf("\n"); 2036 } 2037 } 2038 function_tests++; 2039 #endif 2040 2041 return(test_ret); 2042 } 2043 2044 2045 static int 2046 test_htmlHandleOmittedElem(void) { 2047 int test_ret = 0; 2048 2049 #if defined(LIBXML_HTML_ENABLED) 2050 int mem_base; 2051 int ret_val; 2052 int val; /* int 0 or 1 */ 2053 int n_val; 2054 2055 for (n_val = 0;n_val < gen_nb_int;n_val++) { 2056 mem_base = xmlMemBlocks(); 2057 val = gen_int(n_val, 0); 2058 2059 ret_val = htmlHandleOmittedElem(val); 2060 desret_int(ret_val); 2061 call_tests++; 2062 des_int(n_val, val, 0); 2063 xmlResetLastError(); 2064 if (mem_base != xmlMemBlocks()) { 2065 printf("Leak of %d blocks found in htmlHandleOmittedElem", 2066 xmlMemBlocks() - mem_base); 2067 test_ret++; 2068 printf(" %d", n_val); 2069 printf("\n"); 2070 } 2071 } 2072 function_tests++; 2073 #endif 2074 2075 return(test_ret); 2076 } 2077 2078 2079 static int 2080 test_htmlIsAutoClosed(void) { 2081 int test_ret = 0; 2082 2083 #if defined(LIBXML_HTML_ENABLED) 2084 int mem_base; 2085 int ret_val; 2086 htmlDocPtr doc; /* the HTML document */ 2087 int n_doc; 2088 htmlNodePtr elem; /* the HTML element */ 2089 int n_elem; 2090 2091 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 2092 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) { 2093 mem_base = xmlMemBlocks(); 2094 doc = gen_htmlDocPtr(n_doc, 0); 2095 elem = gen_htmlNodePtr(n_elem, 1); 2096 2097 ret_val = htmlIsAutoClosed(doc, elem); 2098 desret_int(ret_val); 2099 call_tests++; 2100 des_htmlDocPtr(n_doc, doc, 0); 2101 des_htmlNodePtr(n_elem, elem, 1); 2102 xmlResetLastError(); 2103 if (mem_base != xmlMemBlocks()) { 2104 printf("Leak of %d blocks found in htmlIsAutoClosed", 2105 xmlMemBlocks() - mem_base); 2106 test_ret++; 2107 printf(" %d", n_doc); 2108 printf(" %d", n_elem); 2109 printf("\n"); 2110 } 2111 } 2112 } 2113 function_tests++; 2114 #endif 2115 2116 return(test_ret); 2117 } 2118 2119 2120 static int 2121 test_htmlIsScriptAttribute(void) { 2122 int test_ret = 0; 2123 2124 #if defined(LIBXML_HTML_ENABLED) 2125 int mem_base; 2126 int ret_val; 2127 xmlChar * name; /* an attribute name */ 2128 int n_name; 2129 2130 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 2131 mem_base = xmlMemBlocks(); 2132 name = gen_const_xmlChar_ptr(n_name, 0); 2133 2134 ret_val = htmlIsScriptAttribute((const xmlChar *)name); 2135 desret_int(ret_val); 2136 call_tests++; 2137 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 2138 xmlResetLastError(); 2139 if (mem_base != xmlMemBlocks()) { 2140 printf("Leak of %d blocks found in htmlIsScriptAttribute", 2141 xmlMemBlocks() - mem_base); 2142 test_ret++; 2143 printf(" %d", n_name); 2144 printf("\n"); 2145 } 2146 } 2147 function_tests++; 2148 #endif 2149 2150 return(test_ret); 2151 } 2152 2153 2154 static int 2155 test_htmlNewParserCtxt(void) { 2156 int test_ret = 0; 2157 2158 #if defined(LIBXML_HTML_ENABLED) 2159 int mem_base; 2160 htmlParserCtxtPtr ret_val; 2161 2162 mem_base = xmlMemBlocks(); 2163 2164 ret_val = htmlNewParserCtxt(); 2165 desret_htmlParserCtxtPtr(ret_val); 2166 call_tests++; 2167 xmlResetLastError(); 2168 if (mem_base != xmlMemBlocks()) { 2169 printf("Leak of %d blocks found in htmlNewParserCtxt", 2170 xmlMemBlocks() - mem_base); 2171 test_ret++; 2172 printf("\n"); 2173 } 2174 function_tests++; 2175 #endif 2176 2177 return(test_ret); 2178 } 2179 2180 2181 static int 2182 test_htmlNodeStatus(void) { 2183 int test_ret = 0; 2184 2185 #if defined(LIBXML_HTML_ENABLED) 2186 int mem_base; 2187 htmlStatus ret_val; 2188 htmlNodePtr node; /* an htmlNodePtr in a tree */ 2189 int n_node; 2190 int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */ 2191 int n_legacy; 2192 2193 for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) { 2194 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) { 2195 mem_base = xmlMemBlocks(); 2196 node = gen_const_htmlNodePtr(n_node, 0); 2197 legacy = gen_int(n_legacy, 1); 2198 2199 ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy); 2200 desret_htmlStatus(ret_val); 2201 call_tests++; 2202 des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0); 2203 des_int(n_legacy, legacy, 1); 2204 xmlResetLastError(); 2205 if (mem_base != xmlMemBlocks()) { 2206 printf("Leak of %d blocks found in htmlNodeStatus", 2207 xmlMemBlocks() - mem_base); 2208 test_ret++; 2209 printf(" %d", n_node); 2210 printf(" %d", n_legacy); 2211 printf("\n"); 2212 } 2213 } 2214 } 2215 function_tests++; 2216 #endif 2217 2218 return(test_ret); 2219 } 2220 2221 2222 static int 2223 test_htmlParseCharRef(void) { 2224 int test_ret = 0; 2225 2226 #if defined(LIBXML_HTML_ENABLED) 2227 int mem_base; 2228 int ret_val; 2229 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2230 int n_ctxt; 2231 2232 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2233 mem_base = xmlMemBlocks(); 2234 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2235 2236 ret_val = htmlParseCharRef(ctxt); 2237 desret_int(ret_val); 2238 call_tests++; 2239 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2240 xmlResetLastError(); 2241 if (mem_base != xmlMemBlocks()) { 2242 printf("Leak of %d blocks found in htmlParseCharRef", 2243 xmlMemBlocks() - mem_base); 2244 test_ret++; 2245 printf(" %d", n_ctxt); 2246 printf("\n"); 2247 } 2248 } 2249 function_tests++; 2250 #endif 2251 2252 return(test_ret); 2253 } 2254 2255 2256 static int 2257 test_htmlParseChunk(void) { 2258 int test_ret = 0; 2259 2260 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) 2261 int mem_base; 2262 int ret_val; 2263 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2264 int n_ctxt; 2265 char * chunk; /* an char array */ 2266 int n_chunk; 2267 int size; /* the size in byte of the chunk */ 2268 int n_size; 2269 int terminate; /* last chunk indicator */ 2270 int n_terminate; 2271 2272 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2273 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 2274 for (n_size = 0;n_size < gen_nb_int;n_size++) { 2275 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { 2276 mem_base = xmlMemBlocks(); 2277 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2278 chunk = gen_const_char_ptr(n_chunk, 1); 2279 size = gen_int(n_size, 2); 2280 terminate = gen_int(n_terminate, 3); 2281 2282 ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate); 2283 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 2284 desret_int(ret_val); 2285 call_tests++; 2286 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2287 des_const_char_ptr(n_chunk, (const char *)chunk, 1); 2288 des_int(n_size, size, 2); 2289 des_int(n_terminate, terminate, 3); 2290 xmlResetLastError(); 2291 if (mem_base != xmlMemBlocks()) { 2292 printf("Leak of %d blocks found in htmlParseChunk", 2293 xmlMemBlocks() - mem_base); 2294 test_ret++; 2295 printf(" %d", n_ctxt); 2296 printf(" %d", n_chunk); 2297 printf(" %d", n_size); 2298 printf(" %d", n_terminate); 2299 printf("\n"); 2300 } 2301 } 2302 } 2303 } 2304 } 2305 function_tests++; 2306 #endif 2307 2308 return(test_ret); 2309 } 2310 2311 2312 static int 2313 test_htmlParseDoc(void) { 2314 int test_ret = 0; 2315 2316 #if defined(LIBXML_HTML_ENABLED) 2317 int mem_base; 2318 htmlDocPtr ret_val; 2319 xmlChar * cur; /* a pointer to an array of xmlChar */ 2320 int n_cur; 2321 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2322 int n_encoding; 2323 2324 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { 2325 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2326 mem_base = xmlMemBlocks(); 2327 cur = gen_xmlChar_ptr(n_cur, 0); 2328 encoding = gen_const_char_ptr(n_encoding, 1); 2329 2330 ret_val = htmlParseDoc(cur, (const char *)encoding); 2331 desret_htmlDocPtr(ret_val); 2332 call_tests++; 2333 des_xmlChar_ptr(n_cur, cur, 0); 2334 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2335 xmlResetLastError(); 2336 if (mem_base != xmlMemBlocks()) { 2337 printf("Leak of %d blocks found in htmlParseDoc", 2338 xmlMemBlocks() - mem_base); 2339 test_ret++; 2340 printf(" %d", n_cur); 2341 printf(" %d", n_encoding); 2342 printf("\n"); 2343 } 2344 } 2345 } 2346 function_tests++; 2347 #endif 2348 2349 return(test_ret); 2350 } 2351 2352 2353 static int 2354 test_htmlParseDocument(void) { 2355 int test_ret = 0; 2356 2357 #if defined(LIBXML_HTML_ENABLED) 2358 int mem_base; 2359 int ret_val; 2360 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2361 int n_ctxt; 2362 2363 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2364 mem_base = xmlMemBlocks(); 2365 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2366 2367 ret_val = htmlParseDocument(ctxt); 2368 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 2369 desret_int(ret_val); 2370 call_tests++; 2371 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2372 xmlResetLastError(); 2373 if (mem_base != xmlMemBlocks()) { 2374 printf("Leak of %d blocks found in htmlParseDocument", 2375 xmlMemBlocks() - mem_base); 2376 test_ret++; 2377 printf(" %d", n_ctxt); 2378 printf("\n"); 2379 } 2380 } 2381 function_tests++; 2382 #endif 2383 2384 return(test_ret); 2385 } 2386 2387 2388 static int 2389 test_htmlParseElement(void) { 2390 int test_ret = 0; 2391 2392 #if defined(LIBXML_HTML_ENABLED) 2393 int mem_base; 2394 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2395 int n_ctxt; 2396 2397 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2398 mem_base = xmlMemBlocks(); 2399 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2400 2401 htmlParseElement(ctxt); 2402 call_tests++; 2403 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2404 xmlResetLastError(); 2405 if (mem_base != xmlMemBlocks()) { 2406 printf("Leak of %d blocks found in htmlParseElement", 2407 xmlMemBlocks() - mem_base); 2408 test_ret++; 2409 printf(" %d", n_ctxt); 2410 printf("\n"); 2411 } 2412 } 2413 function_tests++; 2414 #endif 2415 2416 return(test_ret); 2417 } 2418 2419 2420 static int 2421 test_htmlParseEntityRef(void) { 2422 int test_ret = 0; 2423 2424 #if defined(LIBXML_HTML_ENABLED) 2425 int mem_base; 2426 const htmlEntityDesc * ret_val; 2427 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2428 int n_ctxt; 2429 xmlChar ** str; /* location to store the entity name */ 2430 int n_str; 2431 2432 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2433 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) { 2434 mem_base = xmlMemBlocks(); 2435 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2436 str = gen_const_xmlChar_ptr_ptr(n_str, 1); 2437 2438 ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str); 2439 desret_const_htmlEntityDesc_ptr(ret_val); 2440 call_tests++; 2441 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2442 des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1); 2443 xmlResetLastError(); 2444 if (mem_base != xmlMemBlocks()) { 2445 printf("Leak of %d blocks found in htmlParseEntityRef", 2446 xmlMemBlocks() - mem_base); 2447 test_ret++; 2448 printf(" %d", n_ctxt); 2449 printf(" %d", n_str); 2450 printf("\n"); 2451 } 2452 } 2453 } 2454 function_tests++; 2455 #endif 2456 2457 return(test_ret); 2458 } 2459 2460 2461 static int 2462 test_htmlParseFile(void) { 2463 int test_ret = 0; 2464 2465 #if defined(LIBXML_HTML_ENABLED) 2466 htmlDocPtr ret_val; 2467 const char * filename; /* the filename */ 2468 int n_filename; 2469 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2470 int n_encoding; 2471 2472 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 2473 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2474 filename = gen_filepath(n_filename, 0); 2475 encoding = gen_const_char_ptr(n_encoding, 1); 2476 2477 ret_val = htmlParseFile(filename, (const char *)encoding); 2478 desret_htmlDocPtr(ret_val); 2479 call_tests++; 2480 des_filepath(n_filename, filename, 0); 2481 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2482 xmlResetLastError(); 2483 } 2484 } 2485 function_tests++; 2486 #endif 2487 2488 return(test_ret); 2489 } 2490 2491 2492 static int 2493 test_htmlReadDoc(void) { 2494 int test_ret = 0; 2495 2496 #if defined(LIBXML_HTML_ENABLED) 2497 int mem_base; 2498 htmlDocPtr ret_val; 2499 xmlChar * cur; /* a pointer to a zero terminated string */ 2500 int n_cur; 2501 const char * URL; /* the base URL to use for the document */ 2502 int n_URL; 2503 char * encoding; /* the document encoding, or NULL */ 2504 int n_encoding; 2505 int options; /* a combination of htmlParserOption(s) */ 2506 int n_options; 2507 2508 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 2509 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 2510 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2511 for (n_options = 0;n_options < gen_nb_int;n_options++) { 2512 mem_base = xmlMemBlocks(); 2513 cur = gen_const_xmlChar_ptr(n_cur, 0); 2514 URL = gen_filepath(n_URL, 1); 2515 encoding = gen_const_char_ptr(n_encoding, 2); 2516 options = gen_int(n_options, 3); 2517 2518 ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options); 2519 desret_htmlDocPtr(ret_val); 2520 call_tests++; 2521 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 2522 des_filepath(n_URL, URL, 1); 2523 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 2524 des_int(n_options, options, 3); 2525 xmlResetLastError(); 2526 if (mem_base != xmlMemBlocks()) { 2527 printf("Leak of %d blocks found in htmlReadDoc", 2528 xmlMemBlocks() - mem_base); 2529 test_ret++; 2530 printf(" %d", n_cur); 2531 printf(" %d", n_URL); 2532 printf(" %d", n_encoding); 2533 printf(" %d", n_options); 2534 printf("\n"); 2535 } 2536 } 2537 } 2538 } 2539 } 2540 function_tests++; 2541 #endif 2542 2543 return(test_ret); 2544 } 2545 2546 2547 static int 2548 test_htmlReadFile(void) { 2549 int test_ret = 0; 2550 2551 #if defined(LIBXML_HTML_ENABLED) 2552 int mem_base; 2553 htmlDocPtr ret_val; 2554 const char * filename; /* a file or URL */ 2555 int n_filename; 2556 char * encoding; /* the document encoding, or NULL */ 2557 int n_encoding; 2558 int options; /* a combination of htmlParserOption(s) */ 2559 int n_options; 2560 2561 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 2562 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2563 for (n_options = 0;n_options < gen_nb_int;n_options++) { 2564 mem_base = xmlMemBlocks(); 2565 filename = gen_filepath(n_filename, 0); 2566 encoding = gen_const_char_ptr(n_encoding, 1); 2567 options = gen_int(n_options, 2); 2568 2569 ret_val = htmlReadFile(filename, (const char *)encoding, options); 2570 desret_htmlDocPtr(ret_val); 2571 call_tests++; 2572 des_filepath(n_filename, filename, 0); 2573 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2574 des_int(n_options, options, 2); 2575 xmlResetLastError(); 2576 if (mem_base != xmlMemBlocks()) { 2577 printf("Leak of %d blocks found in htmlReadFile", 2578 xmlMemBlocks() - mem_base); 2579 test_ret++; 2580 printf(" %d", n_filename); 2581 printf(" %d", n_encoding); 2582 printf(" %d", n_options); 2583 printf("\n"); 2584 } 2585 } 2586 } 2587 } 2588 function_tests++; 2589 #endif 2590 2591 return(test_ret); 2592 } 2593 2594 2595 static int 2596 test_htmlReadMemory(void) { 2597 int test_ret = 0; 2598 2599 #if defined(LIBXML_HTML_ENABLED) 2600 int mem_base; 2601 htmlDocPtr ret_val; 2602 char * buffer; /* a pointer to a char array */ 2603 int n_buffer; 2604 int size; /* the size of the array */ 2605 int n_size; 2606 const char * URL; /* the base URL to use for the document */ 2607 int n_URL; 2608 char * encoding; /* the document encoding, or NULL */ 2609 int n_encoding; 2610 int options; /* a combination of htmlParserOption(s) */ 2611 int n_options; 2612 2613 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 2614 for (n_size = 0;n_size < gen_nb_int;n_size++) { 2615 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 2616 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2617 for (n_options = 0;n_options < gen_nb_int;n_options++) { 2618 mem_base = xmlMemBlocks(); 2619 buffer = gen_const_char_ptr(n_buffer, 0); 2620 size = gen_int(n_size, 1); 2621 URL = gen_filepath(n_URL, 2); 2622 encoding = gen_const_char_ptr(n_encoding, 3); 2623 options = gen_int(n_options, 4); 2624 2625 ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options); 2626 desret_htmlDocPtr(ret_val); 2627 call_tests++; 2628 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 2629 des_int(n_size, size, 1); 2630 des_filepath(n_URL, URL, 2); 2631 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 2632 des_int(n_options, options, 4); 2633 xmlResetLastError(); 2634 if (mem_base != xmlMemBlocks()) { 2635 printf("Leak of %d blocks found in htmlReadMemory", 2636 xmlMemBlocks() - mem_base); 2637 test_ret++; 2638 printf(" %d", n_buffer); 2639 printf(" %d", n_size); 2640 printf(" %d", n_URL); 2641 printf(" %d", n_encoding); 2642 printf(" %d", n_options); 2643 printf("\n"); 2644 } 2645 } 2646 } 2647 } 2648 } 2649 } 2650 function_tests++; 2651 #endif 2652 2653 return(test_ret); 2654 } 2655 2656 2657 static int 2658 test_htmlSAXParseDoc(void) { 2659 int test_ret = 0; 2660 2661 #if defined(LIBXML_HTML_ENABLED) 2662 int mem_base; 2663 htmlDocPtr ret_val; 2664 xmlChar * cur; /* a pointer to an array of xmlChar */ 2665 int n_cur; 2666 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2667 int n_encoding; 2668 htmlSAXHandlerPtr sax; /* the SAX handler block */ 2669 int n_sax; 2670 void * userData; /* if using SAX, this pointer will be provided on callbacks. */ 2671 int n_userData; 2672 2673 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { 2674 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2675 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { 2676 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) { 2677 mem_base = xmlMemBlocks(); 2678 cur = gen_xmlChar_ptr(n_cur, 0); 2679 encoding = gen_const_char_ptr(n_encoding, 1); 2680 sax = gen_htmlSAXHandlerPtr(n_sax, 2); 2681 userData = gen_userdata(n_userData, 3); 2682 2683 ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData); 2684 desret_htmlDocPtr(ret_val); 2685 call_tests++; 2686 des_xmlChar_ptr(n_cur, cur, 0); 2687 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2688 des_htmlSAXHandlerPtr(n_sax, sax, 2); 2689 des_userdata(n_userData, userData, 3); 2690 xmlResetLastError(); 2691 if (mem_base != xmlMemBlocks()) { 2692 printf("Leak of %d blocks found in htmlSAXParseDoc", 2693 xmlMemBlocks() - mem_base); 2694 test_ret++; 2695 printf(" %d", n_cur); 2696 printf(" %d", n_encoding); 2697 printf(" %d", n_sax); 2698 printf(" %d", n_userData); 2699 printf("\n"); 2700 } 2701 } 2702 } 2703 } 2704 } 2705 function_tests++; 2706 #endif 2707 2708 return(test_ret); 2709 } 2710 2711 2712 static int 2713 test_htmlSAXParseFile(void) { 2714 int test_ret = 0; 2715 2716 #if defined(LIBXML_HTML_ENABLED) 2717 int mem_base; 2718 htmlDocPtr ret_val; 2719 const char * filename; /* the filename */ 2720 int n_filename; 2721 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2722 int n_encoding; 2723 htmlSAXHandlerPtr sax; /* the SAX handler block */ 2724 int n_sax; 2725 void * userData; /* if using SAX, this pointer will be provided on callbacks. */ 2726 int n_userData; 2727 2728 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 2729 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2730 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { 2731 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) { 2732 mem_base = xmlMemBlocks(); 2733 filename = gen_filepath(n_filename, 0); 2734 encoding = gen_const_char_ptr(n_encoding, 1); 2735 sax = gen_htmlSAXHandlerPtr(n_sax, 2); 2736 userData = gen_userdata(n_userData, 3); 2737 2738 ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData); 2739 desret_htmlDocPtr(ret_val); 2740 call_tests++; 2741 des_filepath(n_filename, filename, 0); 2742 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2743 des_htmlSAXHandlerPtr(n_sax, sax, 2); 2744 des_userdata(n_userData, userData, 3); 2745 xmlResetLastError(); 2746 if (mem_base != xmlMemBlocks()) { 2747 printf("Leak of %d blocks found in htmlSAXParseFile", 2748 xmlMemBlocks() - mem_base); 2749 test_ret++; 2750 printf(" %d", n_filename); 2751 printf(" %d", n_encoding); 2752 printf(" %d", n_sax); 2753 printf(" %d", n_userData); 2754 printf("\n"); 2755 } 2756 } 2757 } 2758 } 2759 } 2760 function_tests++; 2761 #endif 2762 2763 return(test_ret); 2764 } 2765 2766 2767 static int 2768 test_htmlTagLookup(void) { 2769 int test_ret = 0; 2770 2771 2772 /* missing type support */ 2773 return(test_ret); 2774 } 2775 2776 static int 2777 test_HTMLparser(void) { 2778 int test_ret = 0; 2779 2780 if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n"); 2781 test_ret += test_UTF8ToHtml(); 2782 test_ret += test_htmlAttrAllowed(); 2783 test_ret += test_htmlAutoCloseTag(); 2784 test_ret += test_htmlCreateMemoryParserCtxt(); 2785 test_ret += test_htmlCreatePushParserCtxt(); 2786 test_ret += test_htmlCtxtReadDoc(); 2787 test_ret += test_htmlCtxtReadFile(); 2788 test_ret += test_htmlCtxtReadMemory(); 2789 test_ret += test_htmlCtxtReset(); 2790 test_ret += test_htmlCtxtUseOptions(); 2791 test_ret += test_htmlElementAllowedHere(); 2792 test_ret += test_htmlElementStatusHere(); 2793 test_ret += test_htmlEncodeEntities(); 2794 test_ret += test_htmlEntityLookup(); 2795 test_ret += test_htmlEntityValueLookup(); 2796 test_ret += test_htmlHandleOmittedElem(); 2797 test_ret += test_htmlIsAutoClosed(); 2798 test_ret += test_htmlIsScriptAttribute(); 2799 test_ret += test_htmlNewParserCtxt(); 2800 test_ret += test_htmlNodeStatus(); 2801 test_ret += test_htmlParseCharRef(); 2802 test_ret += test_htmlParseChunk(); 2803 test_ret += test_htmlParseDoc(); 2804 test_ret += test_htmlParseDocument(); 2805 test_ret += test_htmlParseElement(); 2806 test_ret += test_htmlParseEntityRef(); 2807 test_ret += test_htmlParseFile(); 2808 test_ret += test_htmlReadDoc(); 2809 test_ret += test_htmlReadFile(); 2810 test_ret += test_htmlReadMemory(); 2811 test_ret += test_htmlSAXParseDoc(); 2812 test_ret += test_htmlSAXParseFile(); 2813 test_ret += test_htmlTagLookup(); 2814 2815 if (test_ret != 0) 2816 printf("Module HTMLparser: %d errors\n", test_ret); 2817 return(test_ret); 2818 } 2819 2820 static int 2821 test_htmlDocContentDumpFormatOutput(void) { 2822 int test_ret = 0; 2823 2824 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2825 int mem_base; 2826 xmlOutputBufferPtr buf; /* the HTML buffer output */ 2827 int n_buf; 2828 xmlDocPtr cur; /* the document */ 2829 int n_cur; 2830 char * encoding; /* the encoding string */ 2831 int n_encoding; 2832 int format; /* should formatting spaces been added */ 2833 int n_format; 2834 2835 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 2836 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2837 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2838 for (n_format = 0;n_format < gen_nb_int;n_format++) { 2839 mem_base = xmlMemBlocks(); 2840 buf = gen_xmlOutputBufferPtr(n_buf, 0); 2841 cur = gen_xmlDocPtr(n_cur, 1); 2842 encoding = gen_const_char_ptr(n_encoding, 2); 2843 format = gen_int(n_format, 3); 2844 2845 htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format); 2846 call_tests++; 2847 des_xmlOutputBufferPtr(n_buf, buf, 0); 2848 des_xmlDocPtr(n_cur, cur, 1); 2849 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 2850 des_int(n_format, format, 3); 2851 xmlResetLastError(); 2852 if (mem_base != xmlMemBlocks()) { 2853 printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput", 2854 xmlMemBlocks() - mem_base); 2855 test_ret++; 2856 printf(" %d", n_buf); 2857 printf(" %d", n_cur); 2858 printf(" %d", n_encoding); 2859 printf(" %d", n_format); 2860 printf("\n"); 2861 } 2862 } 2863 } 2864 } 2865 } 2866 function_tests++; 2867 #endif 2868 2869 return(test_ret); 2870 } 2871 2872 2873 static int 2874 test_htmlDocContentDumpOutput(void) { 2875 int test_ret = 0; 2876 2877 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2878 int mem_base; 2879 xmlOutputBufferPtr buf; /* the HTML buffer output */ 2880 int n_buf; 2881 xmlDocPtr cur; /* the document */ 2882 int n_cur; 2883 char * encoding; /* the encoding string */ 2884 int n_encoding; 2885 2886 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 2887 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2888 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2889 mem_base = xmlMemBlocks(); 2890 buf = gen_xmlOutputBufferPtr(n_buf, 0); 2891 cur = gen_xmlDocPtr(n_cur, 1); 2892 encoding = gen_const_char_ptr(n_encoding, 2); 2893 2894 htmlDocContentDumpOutput(buf, cur, (const char *)encoding); 2895 call_tests++; 2896 des_xmlOutputBufferPtr(n_buf, buf, 0); 2897 des_xmlDocPtr(n_cur, cur, 1); 2898 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 2899 xmlResetLastError(); 2900 if (mem_base != xmlMemBlocks()) { 2901 printf("Leak of %d blocks found in htmlDocContentDumpOutput", 2902 xmlMemBlocks() - mem_base); 2903 test_ret++; 2904 printf(" %d", n_buf); 2905 printf(" %d", n_cur); 2906 printf(" %d", n_encoding); 2907 printf("\n"); 2908 } 2909 } 2910 } 2911 } 2912 function_tests++; 2913 #endif 2914 2915 return(test_ret); 2916 } 2917 2918 2919 static int 2920 test_htmlDocDump(void) { 2921 int test_ret = 0; 2922 2923 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2924 int mem_base; 2925 int ret_val; 2926 FILE * f; /* the FILE* */ 2927 int n_f; 2928 xmlDocPtr cur; /* the document */ 2929 int n_cur; 2930 2931 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 2932 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2933 mem_base = xmlMemBlocks(); 2934 f = gen_FILE_ptr(n_f, 0); 2935 cur = gen_xmlDocPtr(n_cur, 1); 2936 2937 ret_val = htmlDocDump(f, cur); 2938 desret_int(ret_val); 2939 call_tests++; 2940 des_FILE_ptr(n_f, f, 0); 2941 des_xmlDocPtr(n_cur, cur, 1); 2942 xmlResetLastError(); 2943 if (mem_base != xmlMemBlocks()) { 2944 printf("Leak of %d blocks found in htmlDocDump", 2945 xmlMemBlocks() - mem_base); 2946 test_ret++; 2947 printf(" %d", n_f); 2948 printf(" %d", n_cur); 2949 printf("\n"); 2950 } 2951 } 2952 } 2953 function_tests++; 2954 #endif 2955 2956 return(test_ret); 2957 } 2958 2959 2960 #define gen_nb_xmlChar_ptr_ptr 1 2961 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 2962 return(NULL); 2963 } 2964 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 2965 } 2966 2967 static int 2968 test_htmlDocDumpMemory(void) { 2969 int test_ret = 0; 2970 2971 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2972 int mem_base; 2973 xmlDocPtr cur; /* the document */ 2974 int n_cur; 2975 xmlChar ** mem; /* OUT: the memory pointer */ 2976 int n_mem; 2977 int * size; /* OUT: the memory length */ 2978 int n_size; 2979 2980 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2981 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 2982 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 2983 mem_base = xmlMemBlocks(); 2984 cur = gen_xmlDocPtr(n_cur, 0); 2985 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 2986 size = gen_int_ptr(n_size, 2); 2987 2988 htmlDocDumpMemory(cur, mem, size); 2989 call_tests++; 2990 des_xmlDocPtr(n_cur, cur, 0); 2991 des_xmlChar_ptr_ptr(n_mem, mem, 1); 2992 des_int_ptr(n_size, size, 2); 2993 xmlResetLastError(); 2994 if (mem_base != xmlMemBlocks()) { 2995 printf("Leak of %d blocks found in htmlDocDumpMemory", 2996 xmlMemBlocks() - mem_base); 2997 test_ret++; 2998 printf(" %d", n_cur); 2999 printf(" %d", n_mem); 3000 printf(" %d", n_size); 3001 printf("\n"); 3002 } 3003 } 3004 } 3005 } 3006 function_tests++; 3007 #endif 3008 3009 return(test_ret); 3010 } 3011 3012 3013 static int 3014 test_htmlDocDumpMemoryFormat(void) { 3015 int test_ret = 0; 3016 3017 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3018 int mem_base; 3019 xmlDocPtr cur; /* the document */ 3020 int n_cur; 3021 xmlChar ** mem; /* OUT: the memory pointer */ 3022 int n_mem; 3023 int * size; /* OUT: the memory length */ 3024 int n_size; 3025 int format; /* should formatting spaces been added */ 3026 int n_format; 3027 3028 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3029 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 3030 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 3031 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3032 mem_base = xmlMemBlocks(); 3033 cur = gen_xmlDocPtr(n_cur, 0); 3034 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 3035 size = gen_int_ptr(n_size, 2); 3036 format = gen_int(n_format, 3); 3037 3038 htmlDocDumpMemoryFormat(cur, mem, size, format); 3039 call_tests++; 3040 des_xmlDocPtr(n_cur, cur, 0); 3041 des_xmlChar_ptr_ptr(n_mem, mem, 1); 3042 des_int_ptr(n_size, size, 2); 3043 des_int(n_format, format, 3); 3044 xmlResetLastError(); 3045 if (mem_base != xmlMemBlocks()) { 3046 printf("Leak of %d blocks found in htmlDocDumpMemoryFormat", 3047 xmlMemBlocks() - mem_base); 3048 test_ret++; 3049 printf(" %d", n_cur); 3050 printf(" %d", n_mem); 3051 printf(" %d", n_size); 3052 printf(" %d", n_format); 3053 printf("\n"); 3054 } 3055 } 3056 } 3057 } 3058 } 3059 function_tests++; 3060 #endif 3061 3062 return(test_ret); 3063 } 3064 3065 3066 static int 3067 test_htmlGetMetaEncoding(void) { 3068 int test_ret = 0; 3069 3070 #if defined(LIBXML_HTML_ENABLED) 3071 int mem_base; 3072 const xmlChar * ret_val; 3073 htmlDocPtr doc; /* the document */ 3074 int n_doc; 3075 3076 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 3077 mem_base = xmlMemBlocks(); 3078 doc = gen_htmlDocPtr(n_doc, 0); 3079 3080 ret_val = htmlGetMetaEncoding(doc); 3081 desret_const_xmlChar_ptr(ret_val); 3082 call_tests++; 3083 des_htmlDocPtr(n_doc, doc, 0); 3084 xmlResetLastError(); 3085 if (mem_base != xmlMemBlocks()) { 3086 printf("Leak of %d blocks found in htmlGetMetaEncoding", 3087 xmlMemBlocks() - mem_base); 3088 test_ret++; 3089 printf(" %d", n_doc); 3090 printf("\n"); 3091 } 3092 } 3093 function_tests++; 3094 #endif 3095 3096 return(test_ret); 3097 } 3098 3099 3100 static int 3101 test_htmlIsBooleanAttr(void) { 3102 int test_ret = 0; 3103 3104 #if defined(LIBXML_HTML_ENABLED) 3105 int mem_base; 3106 int ret_val; 3107 xmlChar * name; /* the name of the attribute to check */ 3108 int n_name; 3109 3110 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 3111 mem_base = xmlMemBlocks(); 3112 name = gen_const_xmlChar_ptr(n_name, 0); 3113 3114 ret_val = htmlIsBooleanAttr((const xmlChar *)name); 3115 desret_int(ret_val); 3116 call_tests++; 3117 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 3118 xmlResetLastError(); 3119 if (mem_base != xmlMemBlocks()) { 3120 printf("Leak of %d blocks found in htmlIsBooleanAttr", 3121 xmlMemBlocks() - mem_base); 3122 test_ret++; 3123 printf(" %d", n_name); 3124 printf("\n"); 3125 } 3126 } 3127 function_tests++; 3128 #endif 3129 3130 return(test_ret); 3131 } 3132 3133 3134 static int 3135 test_htmlNewDoc(void) { 3136 int test_ret = 0; 3137 3138 #if defined(LIBXML_HTML_ENABLED) 3139 int mem_base; 3140 htmlDocPtr ret_val; 3141 xmlChar * URI; /* URI for the dtd, or NULL */ 3142 int n_URI; 3143 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ 3144 int n_ExternalID; 3145 3146 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 3147 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 3148 mem_base = xmlMemBlocks(); 3149 URI = gen_const_xmlChar_ptr(n_URI, 0); 3150 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); 3151 3152 ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID); 3153 desret_htmlDocPtr(ret_val); 3154 call_tests++; 3155 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 3156 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); 3157 xmlResetLastError(); 3158 if (mem_base != xmlMemBlocks()) { 3159 printf("Leak of %d blocks found in htmlNewDoc", 3160 xmlMemBlocks() - mem_base); 3161 test_ret++; 3162 printf(" %d", n_URI); 3163 printf(" %d", n_ExternalID); 3164 printf("\n"); 3165 } 3166 } 3167 } 3168 function_tests++; 3169 #endif 3170 3171 return(test_ret); 3172 } 3173 3174 3175 static int 3176 test_htmlNewDocNoDtD(void) { 3177 int test_ret = 0; 3178 3179 #if defined(LIBXML_HTML_ENABLED) 3180 int mem_base; 3181 htmlDocPtr ret_val; 3182 xmlChar * URI; /* URI for the dtd, or NULL */ 3183 int n_URI; 3184 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ 3185 int n_ExternalID; 3186 3187 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 3188 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 3189 mem_base = xmlMemBlocks(); 3190 URI = gen_const_xmlChar_ptr(n_URI, 0); 3191 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); 3192 3193 ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID); 3194 desret_htmlDocPtr(ret_val); 3195 call_tests++; 3196 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 3197 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); 3198 xmlResetLastError(); 3199 if (mem_base != xmlMemBlocks()) { 3200 printf("Leak of %d blocks found in htmlNewDocNoDtD", 3201 xmlMemBlocks() - mem_base); 3202 test_ret++; 3203 printf(" %d", n_URI); 3204 printf(" %d", n_ExternalID); 3205 printf("\n"); 3206 } 3207 } 3208 } 3209 function_tests++; 3210 #endif 3211 3212 return(test_ret); 3213 } 3214 3215 3216 static int 3217 test_htmlNodeDump(void) { 3218 int test_ret = 0; 3219 3220 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3221 int mem_base; 3222 int ret_val; 3223 xmlBufferPtr buf; /* the HTML buffer output */ 3224 int n_buf; 3225 xmlDocPtr doc; /* the document */ 3226 int n_doc; 3227 xmlNodePtr cur; /* the current node */ 3228 int n_cur; 3229 3230 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 3231 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3232 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3233 mem_base = xmlMemBlocks(); 3234 buf = gen_xmlBufferPtr(n_buf, 0); 3235 doc = gen_xmlDocPtr(n_doc, 1); 3236 cur = gen_xmlNodePtr(n_cur, 2); 3237 3238 ret_val = htmlNodeDump(buf, doc, cur); 3239 desret_int(ret_val); 3240 call_tests++; 3241 des_xmlBufferPtr(n_buf, buf, 0); 3242 des_xmlDocPtr(n_doc, doc, 1); 3243 des_xmlNodePtr(n_cur, cur, 2); 3244 xmlResetLastError(); 3245 if (mem_base != xmlMemBlocks()) { 3246 printf("Leak of %d blocks found in htmlNodeDump", 3247 xmlMemBlocks() - mem_base); 3248 test_ret++; 3249 printf(" %d", n_buf); 3250 printf(" %d", n_doc); 3251 printf(" %d", n_cur); 3252 printf("\n"); 3253 } 3254 } 3255 } 3256 } 3257 function_tests++; 3258 #endif 3259 3260 return(test_ret); 3261 } 3262 3263 3264 static int 3265 test_htmlNodeDumpFile(void) { 3266 int test_ret = 0; 3267 3268 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3269 int mem_base; 3270 FILE * out; /* the FILE pointer */ 3271 int n_out; 3272 xmlDocPtr doc; /* the document */ 3273 int n_doc; 3274 xmlNodePtr cur; /* the current node */ 3275 int n_cur; 3276 3277 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 3278 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3279 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3280 mem_base = xmlMemBlocks(); 3281 out = gen_FILE_ptr(n_out, 0); 3282 doc = gen_xmlDocPtr(n_doc, 1); 3283 cur = gen_xmlNodePtr(n_cur, 2); 3284 3285 htmlNodeDumpFile(out, doc, cur); 3286 call_tests++; 3287 des_FILE_ptr(n_out, out, 0); 3288 des_xmlDocPtr(n_doc, doc, 1); 3289 des_xmlNodePtr(n_cur, cur, 2); 3290 xmlResetLastError(); 3291 if (mem_base != xmlMemBlocks()) { 3292 printf("Leak of %d blocks found in htmlNodeDumpFile", 3293 xmlMemBlocks() - mem_base); 3294 test_ret++; 3295 printf(" %d", n_out); 3296 printf(" %d", n_doc); 3297 printf(" %d", n_cur); 3298 printf("\n"); 3299 } 3300 } 3301 } 3302 } 3303 function_tests++; 3304 #endif 3305 3306 return(test_ret); 3307 } 3308 3309 3310 static int 3311 test_htmlNodeDumpFileFormat(void) { 3312 int test_ret = 0; 3313 3314 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3315 int mem_base; 3316 int ret_val; 3317 FILE * out; /* the FILE pointer */ 3318 int n_out; 3319 xmlDocPtr doc; /* the document */ 3320 int n_doc; 3321 xmlNodePtr cur; /* the current node */ 3322 int n_cur; 3323 char * encoding; /* the document encoding */ 3324 int n_encoding; 3325 int format; /* should formatting spaces been added */ 3326 int n_format; 3327 3328 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 3329 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3330 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3331 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3332 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3333 mem_base = xmlMemBlocks(); 3334 out = gen_FILE_ptr(n_out, 0); 3335 doc = gen_xmlDocPtr(n_doc, 1); 3336 cur = gen_xmlNodePtr(n_cur, 2); 3337 encoding = gen_const_char_ptr(n_encoding, 3); 3338 format = gen_int(n_format, 4); 3339 3340 ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format); 3341 desret_int(ret_val); 3342 call_tests++; 3343 des_FILE_ptr(n_out, out, 0); 3344 des_xmlDocPtr(n_doc, doc, 1); 3345 des_xmlNodePtr(n_cur, cur, 2); 3346 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 3347 des_int(n_format, format, 4); 3348 xmlResetLastError(); 3349 if (mem_base != xmlMemBlocks()) { 3350 printf("Leak of %d blocks found in htmlNodeDumpFileFormat", 3351 xmlMemBlocks() - mem_base); 3352 test_ret++; 3353 printf(" %d", n_out); 3354 printf(" %d", n_doc); 3355 printf(" %d", n_cur); 3356 printf(" %d", n_encoding); 3357 printf(" %d", n_format); 3358 printf("\n"); 3359 } 3360 } 3361 } 3362 } 3363 } 3364 } 3365 function_tests++; 3366 #endif 3367 3368 return(test_ret); 3369 } 3370 3371 3372 static int 3373 test_htmlNodeDumpFormatOutput(void) { 3374 int test_ret = 0; 3375 3376 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3377 int mem_base; 3378 xmlOutputBufferPtr buf; /* the HTML buffer output */ 3379 int n_buf; 3380 xmlDocPtr doc; /* the document */ 3381 int n_doc; 3382 xmlNodePtr cur; /* the current node */ 3383 int n_cur; 3384 char * encoding; /* the encoding string */ 3385 int n_encoding; 3386 int format; /* should formatting spaces been added */ 3387 int n_format; 3388 3389 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 3390 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3391 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3392 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3393 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3394 mem_base = xmlMemBlocks(); 3395 buf = gen_xmlOutputBufferPtr(n_buf, 0); 3396 doc = gen_xmlDocPtr(n_doc, 1); 3397 cur = gen_xmlNodePtr(n_cur, 2); 3398 encoding = gen_const_char_ptr(n_encoding, 3); 3399 format = gen_int(n_format, 4); 3400 3401 htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format); 3402 call_tests++; 3403 des_xmlOutputBufferPtr(n_buf, buf, 0); 3404 des_xmlDocPtr(n_doc, doc, 1); 3405 des_xmlNodePtr(n_cur, cur, 2); 3406 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 3407 des_int(n_format, format, 4); 3408 xmlResetLastError(); 3409 if (mem_base != xmlMemBlocks()) { 3410 printf("Leak of %d blocks found in htmlNodeDumpFormatOutput", 3411 xmlMemBlocks() - mem_base); 3412 test_ret++; 3413 printf(" %d", n_buf); 3414 printf(" %d", n_doc); 3415 printf(" %d", n_cur); 3416 printf(" %d", n_encoding); 3417 printf(" %d", n_format); 3418 printf("\n"); 3419 } 3420 } 3421 } 3422 } 3423 } 3424 } 3425 function_tests++; 3426 #endif 3427 3428 return(test_ret); 3429 } 3430 3431 3432 static int 3433 test_htmlNodeDumpOutput(void) { 3434 int test_ret = 0; 3435 3436 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3437 int mem_base; 3438 xmlOutputBufferPtr buf; /* the HTML buffer output */ 3439 int n_buf; 3440 xmlDocPtr doc; /* the document */ 3441 int n_doc; 3442 xmlNodePtr cur; /* the current node */ 3443 int n_cur; 3444 char * encoding; /* the encoding string */ 3445 int n_encoding; 3446 3447 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 3448 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3449 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3450 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3451 mem_base = xmlMemBlocks(); 3452 buf = gen_xmlOutputBufferPtr(n_buf, 0); 3453 doc = gen_xmlDocPtr(n_doc, 1); 3454 cur = gen_xmlNodePtr(n_cur, 2); 3455 encoding = gen_const_char_ptr(n_encoding, 3); 3456 3457 htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding); 3458 call_tests++; 3459 des_xmlOutputBufferPtr(n_buf, buf, 0); 3460 des_xmlDocPtr(n_doc, doc, 1); 3461 des_xmlNodePtr(n_cur, cur, 2); 3462 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 3463 xmlResetLastError(); 3464 if (mem_base != xmlMemBlocks()) { 3465 printf("Leak of %d blocks found in htmlNodeDumpOutput", 3466 xmlMemBlocks() - mem_base); 3467 test_ret++; 3468 printf(" %d", n_buf); 3469 printf(" %d", n_doc); 3470 printf(" %d", n_cur); 3471 printf(" %d", n_encoding); 3472 printf("\n"); 3473 } 3474 } 3475 } 3476 } 3477 } 3478 function_tests++; 3479 #endif 3480 3481 return(test_ret); 3482 } 3483 3484 3485 static int 3486 test_htmlSaveFile(void) { 3487 int test_ret = 0; 3488 3489 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3490 int mem_base; 3491 int ret_val; 3492 const char * filename; /* the filename (or URL) */ 3493 int n_filename; 3494 xmlDocPtr cur; /* the document */ 3495 int n_cur; 3496 3497 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 3498 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3499 mem_base = xmlMemBlocks(); 3500 filename = gen_fileoutput(n_filename, 0); 3501 cur = gen_xmlDocPtr(n_cur, 1); 3502 3503 ret_val = htmlSaveFile(filename, cur); 3504 desret_int(ret_val); 3505 call_tests++; 3506 des_fileoutput(n_filename, filename, 0); 3507 des_xmlDocPtr(n_cur, cur, 1); 3508 xmlResetLastError(); 3509 if (mem_base != xmlMemBlocks()) { 3510 printf("Leak of %d blocks found in htmlSaveFile", 3511 xmlMemBlocks() - mem_base); 3512 test_ret++; 3513 printf(" %d", n_filename); 3514 printf(" %d", n_cur); 3515 printf("\n"); 3516 } 3517 } 3518 } 3519 function_tests++; 3520 #endif 3521 3522 return(test_ret); 3523 } 3524 3525 3526 static int 3527 test_htmlSaveFileEnc(void) { 3528 int test_ret = 0; 3529 3530 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3531 int mem_base; 3532 int ret_val; 3533 const char * filename; /* the filename */ 3534 int n_filename; 3535 xmlDocPtr cur; /* the document */ 3536 int n_cur; 3537 char * encoding; /* the document encoding */ 3538 int n_encoding; 3539 3540 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 3541 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3542 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3543 mem_base = xmlMemBlocks(); 3544 filename = gen_fileoutput(n_filename, 0); 3545 cur = gen_xmlDocPtr(n_cur, 1); 3546 encoding = gen_const_char_ptr(n_encoding, 2); 3547 3548 ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding); 3549 desret_int(ret_val); 3550 call_tests++; 3551 des_fileoutput(n_filename, filename, 0); 3552 des_xmlDocPtr(n_cur, cur, 1); 3553 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 3554 xmlResetLastError(); 3555 if (mem_base != xmlMemBlocks()) { 3556 printf("Leak of %d blocks found in htmlSaveFileEnc", 3557 xmlMemBlocks() - mem_base); 3558 test_ret++; 3559 printf(" %d", n_filename); 3560 printf(" %d", n_cur); 3561 printf(" %d", n_encoding); 3562 printf("\n"); 3563 } 3564 } 3565 } 3566 } 3567 function_tests++; 3568 #endif 3569 3570 return(test_ret); 3571 } 3572 3573 3574 static int 3575 test_htmlSaveFileFormat(void) { 3576 int test_ret = 0; 3577 3578 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3579 int mem_base; 3580 int ret_val; 3581 const char * filename; /* the filename */ 3582 int n_filename; 3583 xmlDocPtr cur; /* the document */ 3584 int n_cur; 3585 char * encoding; /* the document encoding */ 3586 int n_encoding; 3587 int format; /* should formatting spaces been added */ 3588 int n_format; 3589 3590 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 3591 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3592 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3593 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3594 mem_base = xmlMemBlocks(); 3595 filename = gen_fileoutput(n_filename, 0); 3596 cur = gen_xmlDocPtr(n_cur, 1); 3597 encoding = gen_const_char_ptr(n_encoding, 2); 3598 format = gen_int(n_format, 3); 3599 3600 ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format); 3601 desret_int(ret_val); 3602 call_tests++; 3603 des_fileoutput(n_filename, filename, 0); 3604 des_xmlDocPtr(n_cur, cur, 1); 3605 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 3606 des_int(n_format, format, 3); 3607 xmlResetLastError(); 3608 if (mem_base != xmlMemBlocks()) { 3609 printf("Leak of %d blocks found in htmlSaveFileFormat", 3610 xmlMemBlocks() - mem_base); 3611 test_ret++; 3612 printf(" %d", n_filename); 3613 printf(" %d", n_cur); 3614 printf(" %d", n_encoding); 3615 printf(" %d", n_format); 3616 printf("\n"); 3617 } 3618 } 3619 } 3620 } 3621 } 3622 function_tests++; 3623 #endif 3624 3625 return(test_ret); 3626 } 3627 3628 3629 static int 3630 test_htmlSetMetaEncoding(void) { 3631 int test_ret = 0; 3632 3633 #if defined(LIBXML_HTML_ENABLED) 3634 int mem_base; 3635 int ret_val; 3636 htmlDocPtr doc; /* the document */ 3637 int n_doc; 3638 xmlChar * encoding; /* the encoding string */ 3639 int n_encoding; 3640 3641 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 3642 for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) { 3643 mem_base = xmlMemBlocks(); 3644 doc = gen_htmlDocPtr(n_doc, 0); 3645 encoding = gen_const_xmlChar_ptr(n_encoding, 1); 3646 3647 ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding); 3648 desret_int(ret_val); 3649 call_tests++; 3650 des_htmlDocPtr(n_doc, doc, 0); 3651 des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1); 3652 xmlResetLastError(); 3653 if (mem_base != xmlMemBlocks()) { 3654 printf("Leak of %d blocks found in htmlSetMetaEncoding", 3655 xmlMemBlocks() - mem_base); 3656 test_ret++; 3657 printf(" %d", n_doc); 3658 printf(" %d", n_encoding); 3659 printf("\n"); 3660 } 3661 } 3662 } 3663 function_tests++; 3664 #endif 3665 3666 return(test_ret); 3667 } 3668 3669 static int 3670 test_HTMLtree(void) { 3671 int test_ret = 0; 3672 3673 if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n"); 3674 test_ret += test_htmlDocContentDumpFormatOutput(); 3675 test_ret += test_htmlDocContentDumpOutput(); 3676 test_ret += test_htmlDocDump(); 3677 test_ret += test_htmlDocDumpMemory(); 3678 test_ret += test_htmlDocDumpMemoryFormat(); 3679 test_ret += test_htmlGetMetaEncoding(); 3680 test_ret += test_htmlIsBooleanAttr(); 3681 test_ret += test_htmlNewDoc(); 3682 test_ret += test_htmlNewDocNoDtD(); 3683 test_ret += test_htmlNodeDump(); 3684 test_ret += test_htmlNodeDumpFile(); 3685 test_ret += test_htmlNodeDumpFileFormat(); 3686 test_ret += test_htmlNodeDumpFormatOutput(); 3687 test_ret += test_htmlNodeDumpOutput(); 3688 test_ret += test_htmlSaveFile(); 3689 test_ret += test_htmlSaveFileEnc(); 3690 test_ret += test_htmlSaveFileFormat(); 3691 test_ret += test_htmlSetMetaEncoding(); 3692 3693 if (test_ret != 0) 3694 printf("Module HTMLtree: %d errors\n", test_ret); 3695 return(test_ret); 3696 } 3697 3698 static int 3699 test_docbDefaultSAXHandlerInit(void) { 3700 int test_ret = 0; 3701 3702 #if defined(LIBXML_DOCB_ENABLED) 3703 #ifdef LIBXML_DOCB_ENABLED 3704 int mem_base; 3705 3706 mem_base = xmlMemBlocks(); 3707 3708 docbDefaultSAXHandlerInit(); 3709 call_tests++; 3710 xmlResetLastError(); 3711 if (mem_base != xmlMemBlocks()) { 3712 printf("Leak of %d blocks found in docbDefaultSAXHandlerInit", 3713 xmlMemBlocks() - mem_base); 3714 test_ret++; 3715 printf("\n"); 3716 } 3717 function_tests++; 3718 #endif 3719 #endif 3720 3721 return(test_ret); 3722 } 3723 3724 3725 static int 3726 test_htmlDefaultSAXHandlerInit(void) { 3727 int test_ret = 0; 3728 3729 #if defined(LIBXML_HTML_ENABLED) 3730 #ifdef LIBXML_HTML_ENABLED 3731 int mem_base; 3732 3733 mem_base = xmlMemBlocks(); 3734 3735 htmlDefaultSAXHandlerInit(); 3736 call_tests++; 3737 xmlResetLastError(); 3738 if (mem_base != xmlMemBlocks()) { 3739 printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit", 3740 xmlMemBlocks() - mem_base); 3741 test_ret++; 3742 printf("\n"); 3743 } 3744 function_tests++; 3745 #endif 3746 #endif 3747 3748 return(test_ret); 3749 } 3750 3751 3752 static int 3753 test_xmlDefaultSAXHandlerInit(void) { 3754 int test_ret = 0; 3755 3756 int mem_base; 3757 3758 mem_base = xmlMemBlocks(); 3759 3760 xmlDefaultSAXHandlerInit(); 3761 call_tests++; 3762 xmlResetLastError(); 3763 if (mem_base != xmlMemBlocks()) { 3764 printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit", 3765 xmlMemBlocks() - mem_base); 3766 test_ret++; 3767 printf("\n"); 3768 } 3769 function_tests++; 3770 3771 return(test_ret); 3772 } 3773 3774 3775 #define gen_nb_xmlEnumerationPtr 1 3776 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 3777 return(NULL); 3778 } 3779 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 3780 } 3781 3782 static int 3783 test_xmlSAX2AttributeDecl(void) { 3784 int test_ret = 0; 3785 3786 int mem_base; 3787 void * ctx; /* the user data (XML parser context) */ 3788 int n_ctx; 3789 xmlChar * elem; /* the name of the element */ 3790 int n_elem; 3791 xmlChar * fullname; /* the attribute name */ 3792 int n_fullname; 3793 int type; /* the attribute type */ 3794 int n_type; 3795 int def; /* the type of default value */ 3796 int n_def; 3797 xmlChar * defaultValue; /* the attribute default value */ 3798 int n_defaultValue; 3799 xmlEnumerationPtr tree; /* the tree of enumerated value set */ 3800 int n_tree; 3801 3802 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3803 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 3804 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) { 3805 for (n_type = 0;n_type < gen_nb_int;n_type++) { 3806 for (n_def = 0;n_def < gen_nb_int;n_def++) { 3807 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) { 3808 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) { 3809 mem_base = xmlMemBlocks(); 3810 ctx = gen_void_ptr(n_ctx, 0); 3811 elem = gen_const_xmlChar_ptr(n_elem, 1); 3812 fullname = gen_const_xmlChar_ptr(n_fullname, 2); 3813 type = gen_int(n_type, 3); 3814 def = gen_int(n_def, 4); 3815 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5); 3816 tree = gen_xmlEnumerationPtr(n_tree, 6); 3817 3818 xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree); 3819 call_tests++; 3820 des_void_ptr(n_ctx, ctx, 0); 3821 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); 3822 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2); 3823 des_int(n_type, type, 3); 3824 des_int(n_def, def, 4); 3825 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5); 3826 des_xmlEnumerationPtr(n_tree, tree, 6); 3827 xmlResetLastError(); 3828 if (mem_base != xmlMemBlocks()) { 3829 printf("Leak of %d blocks found in xmlSAX2AttributeDecl", 3830 xmlMemBlocks() - mem_base); 3831 test_ret++; 3832 printf(" %d", n_ctx); 3833 printf(" %d", n_elem); 3834 printf(" %d", n_fullname); 3835 printf(" %d", n_type); 3836 printf(" %d", n_def); 3837 printf(" %d", n_defaultValue); 3838 printf(" %d", n_tree); 3839 printf("\n"); 3840 } 3841 } 3842 } 3843 } 3844 } 3845 } 3846 } 3847 } 3848 function_tests++; 3849 3850 return(test_ret); 3851 } 3852 3853 3854 static int 3855 test_xmlSAX2CDataBlock(void) { 3856 int test_ret = 0; 3857 3858 int mem_base; 3859 void * ctx; /* the user data (XML parser context) */ 3860 int n_ctx; 3861 xmlChar * value; /* The pcdata content */ 3862 int n_value; 3863 int len; /* the block length */ 3864 int n_len; 3865 3866 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3867 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 3868 for (n_len = 0;n_len < gen_nb_int;n_len++) { 3869 mem_base = xmlMemBlocks(); 3870 ctx = gen_void_ptr(n_ctx, 0); 3871 value = gen_const_xmlChar_ptr(n_value, 1); 3872 len = gen_int(n_len, 2); 3873 3874 xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len); 3875 call_tests++; 3876 des_void_ptr(n_ctx, ctx, 0); 3877 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 3878 des_int(n_len, len, 2); 3879 xmlResetLastError(); 3880 if (mem_base != xmlMemBlocks()) { 3881 printf("Leak of %d blocks found in xmlSAX2CDataBlock", 3882 xmlMemBlocks() - mem_base); 3883 test_ret++; 3884 printf(" %d", n_ctx); 3885 printf(" %d", n_value); 3886 printf(" %d", n_len); 3887 printf("\n"); 3888 } 3889 } 3890 } 3891 } 3892 function_tests++; 3893 3894 return(test_ret); 3895 } 3896 3897 3898 static int 3899 test_xmlSAX2Characters(void) { 3900 int test_ret = 0; 3901 3902 int mem_base; 3903 void * ctx; /* the user data (XML parser context) */ 3904 int n_ctx; 3905 xmlChar * ch; /* a xmlChar string */ 3906 int n_ch; 3907 int len; /* the number of xmlChar */ 3908 int n_len; 3909 3910 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3911 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) { 3912 for (n_len = 0;n_len < gen_nb_int;n_len++) { 3913 mem_base = xmlMemBlocks(); 3914 ctx = gen_void_ptr(n_ctx, 0); 3915 ch = gen_const_xmlChar_ptr(n_ch, 1); 3916 len = gen_int(n_len, 2); 3917 3918 xmlSAX2Characters(ctx, (const xmlChar *)ch, len); 3919 call_tests++; 3920 des_void_ptr(n_ctx, ctx, 0); 3921 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1); 3922 des_int(n_len, len, 2); 3923 xmlResetLastError(); 3924 if (mem_base != xmlMemBlocks()) { 3925 printf("Leak of %d blocks found in xmlSAX2Characters", 3926 xmlMemBlocks() - mem_base); 3927 test_ret++; 3928 printf(" %d", n_ctx); 3929 printf(" %d", n_ch); 3930 printf(" %d", n_len); 3931 printf("\n"); 3932 } 3933 } 3934 } 3935 } 3936 function_tests++; 3937 3938 return(test_ret); 3939 } 3940 3941 3942 static int 3943 test_xmlSAX2Comment(void) { 3944 int test_ret = 0; 3945 3946 int mem_base; 3947 void * ctx; /* the user data (XML parser context) */ 3948 int n_ctx; 3949 xmlChar * value; /* the xmlSAX2Comment content */ 3950 int n_value; 3951 3952 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3953 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 3954 mem_base = xmlMemBlocks(); 3955 ctx = gen_void_ptr(n_ctx, 0); 3956 value = gen_const_xmlChar_ptr(n_value, 1); 3957 3958 xmlSAX2Comment(ctx, (const xmlChar *)value); 3959 call_tests++; 3960 des_void_ptr(n_ctx, ctx, 0); 3961 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 3962 xmlResetLastError(); 3963 if (mem_base != xmlMemBlocks()) { 3964 printf("Leak of %d blocks found in xmlSAX2Comment", 3965 xmlMemBlocks() - mem_base); 3966 test_ret++; 3967 printf(" %d", n_ctx); 3968 printf(" %d", n_value); 3969 printf("\n"); 3970 } 3971 } 3972 } 3973 function_tests++; 3974 3975 return(test_ret); 3976 } 3977 3978 3979 static int 3980 test_xmlSAX2ElementDecl(void) { 3981 int test_ret = 0; 3982 3983 int mem_base; 3984 void * ctx; /* the user data (XML parser context) */ 3985 int n_ctx; 3986 xmlChar * name; /* the element name */ 3987 int n_name; 3988 int type; /* the element type */ 3989 int n_type; 3990 xmlElementContentPtr content; /* the element value tree */ 3991 int n_content; 3992 3993 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3994 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 3995 for (n_type = 0;n_type < gen_nb_int;n_type++) { 3996 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 3997 mem_base = xmlMemBlocks(); 3998 ctx = gen_void_ptr(n_ctx, 0); 3999 name = gen_const_xmlChar_ptr(n_name, 1); 4000 type = gen_int(n_type, 2); 4001 content = gen_xmlElementContentPtr(n_content, 3); 4002 4003 xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content); 4004 call_tests++; 4005 des_void_ptr(n_ctx, ctx, 0); 4006 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4007 des_int(n_type, type, 2); 4008 des_xmlElementContentPtr(n_content, content, 3); 4009 xmlResetLastError(); 4010 if (mem_base != xmlMemBlocks()) { 4011 printf("Leak of %d blocks found in xmlSAX2ElementDecl", 4012 xmlMemBlocks() - mem_base); 4013 test_ret++; 4014 printf(" %d", n_ctx); 4015 printf(" %d", n_name); 4016 printf(" %d", n_type); 4017 printf(" %d", n_content); 4018 printf("\n"); 4019 } 4020 } 4021 } 4022 } 4023 } 4024 function_tests++; 4025 4026 return(test_ret); 4027 } 4028 4029 4030 static int 4031 test_xmlSAX2EndDocument(void) { 4032 int test_ret = 0; 4033 4034 int mem_base; 4035 void * ctx; /* the user data (XML parser context) */ 4036 int n_ctx; 4037 4038 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4039 mem_base = xmlMemBlocks(); 4040 ctx = gen_void_ptr(n_ctx, 0); 4041 4042 xmlSAX2EndDocument(ctx); 4043 call_tests++; 4044 des_void_ptr(n_ctx, ctx, 0); 4045 xmlResetLastError(); 4046 if (mem_base != xmlMemBlocks()) { 4047 printf("Leak of %d blocks found in xmlSAX2EndDocument", 4048 xmlMemBlocks() - mem_base); 4049 test_ret++; 4050 printf(" %d", n_ctx); 4051 printf("\n"); 4052 } 4053 } 4054 function_tests++; 4055 4056 return(test_ret); 4057 } 4058 4059 4060 static int 4061 test_xmlSAX2EndElement(void) { 4062 int test_ret = 0; 4063 4064 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) 4065 #ifdef LIBXML_SAX1_ENABLED 4066 int mem_base; 4067 void * ctx; /* the user data (XML parser context) */ 4068 int n_ctx; 4069 xmlChar * name; /* The element name */ 4070 int n_name; 4071 4072 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4073 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4074 mem_base = xmlMemBlocks(); 4075 ctx = gen_void_ptr(n_ctx, 0); 4076 name = gen_const_xmlChar_ptr(n_name, 1); 4077 4078 xmlSAX2EndElement(ctx, (const xmlChar *)name); 4079 call_tests++; 4080 des_void_ptr(n_ctx, ctx, 0); 4081 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4082 xmlResetLastError(); 4083 if (mem_base != xmlMemBlocks()) { 4084 printf("Leak of %d blocks found in xmlSAX2EndElement", 4085 xmlMemBlocks() - mem_base); 4086 test_ret++; 4087 printf(" %d", n_ctx); 4088 printf(" %d", n_name); 4089 printf("\n"); 4090 } 4091 } 4092 } 4093 function_tests++; 4094 #endif 4095 #endif 4096 4097 return(test_ret); 4098 } 4099 4100 4101 static int 4102 test_xmlSAX2EndElementNs(void) { 4103 int test_ret = 0; 4104 4105 int mem_base; 4106 void * ctx; /* the user data (XML parser context) */ 4107 int n_ctx; 4108 xmlChar * localname; /* the local name of the element */ 4109 int n_localname; 4110 xmlChar * prefix; /* the element namespace prefix if available */ 4111 int n_prefix; 4112 xmlChar * URI; /* the element namespace name if available */ 4113 int n_URI; 4114 4115 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4116 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) { 4117 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 4118 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 4119 mem_base = xmlMemBlocks(); 4120 ctx = gen_void_ptr(n_ctx, 0); 4121 localname = gen_const_xmlChar_ptr(n_localname, 1); 4122 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 4123 URI = gen_const_xmlChar_ptr(n_URI, 3); 4124 4125 xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI); 4126 call_tests++; 4127 des_void_ptr(n_ctx, ctx, 0); 4128 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1); 4129 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 4130 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3); 4131 xmlResetLastError(); 4132 if (mem_base != xmlMemBlocks()) { 4133 printf("Leak of %d blocks found in xmlSAX2EndElementNs", 4134 xmlMemBlocks() - mem_base); 4135 test_ret++; 4136 printf(" %d", n_ctx); 4137 printf(" %d", n_localname); 4138 printf(" %d", n_prefix); 4139 printf(" %d", n_URI); 4140 printf("\n"); 4141 } 4142 } 4143 } 4144 } 4145 } 4146 function_tests++; 4147 4148 return(test_ret); 4149 } 4150 4151 4152 static int 4153 test_xmlSAX2EntityDecl(void) { 4154 int test_ret = 0; 4155 4156 int mem_base; 4157 void * ctx; /* the user data (XML parser context) */ 4158 int n_ctx; 4159 xmlChar * name; /* the entity name */ 4160 int n_name; 4161 int type; /* the entity type */ 4162 int n_type; 4163 xmlChar * publicId; /* The public ID of the entity */ 4164 int n_publicId; 4165 xmlChar * systemId; /* The system ID of the entity */ 4166 int n_systemId; 4167 xmlChar * content; /* the entity value (without processing). */ 4168 int n_content; 4169 4170 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4171 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4172 for (n_type = 0;n_type < gen_nb_int;n_type++) { 4173 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 4174 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 4175 for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) { 4176 mem_base = xmlMemBlocks(); 4177 ctx = gen_void_ptr(n_ctx, 0); 4178 name = gen_const_xmlChar_ptr(n_name, 1); 4179 type = gen_int(n_type, 2); 4180 publicId = gen_const_xmlChar_ptr(n_publicId, 3); 4181 systemId = gen_const_xmlChar_ptr(n_systemId, 4); 4182 content = gen_xmlChar_ptr(n_content, 5); 4183 4184 xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content); 4185 call_tests++; 4186 des_void_ptr(n_ctx, ctx, 0); 4187 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4188 des_int(n_type, type, 2); 4189 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3); 4190 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4); 4191 des_xmlChar_ptr(n_content, content, 5); 4192 xmlResetLastError(); 4193 if (mem_base != xmlMemBlocks()) { 4194 printf("Leak of %d blocks found in xmlSAX2EntityDecl", 4195 xmlMemBlocks() - mem_base); 4196 test_ret++; 4197 printf(" %d", n_ctx); 4198 printf(" %d", n_name); 4199 printf(" %d", n_type); 4200 printf(" %d", n_publicId); 4201 printf(" %d", n_systemId); 4202 printf(" %d", n_content); 4203 printf("\n"); 4204 } 4205 } 4206 } 4207 } 4208 } 4209 } 4210 } 4211 function_tests++; 4212 4213 return(test_ret); 4214 } 4215 4216 4217 static int 4218 test_xmlSAX2ExternalSubset(void) { 4219 int test_ret = 0; 4220 4221 int mem_base; 4222 void * ctx; /* the user data (XML parser context) */ 4223 int n_ctx; 4224 xmlChar * name; /* the root element name */ 4225 int n_name; 4226 xmlChar * ExternalID; /* the external ID */ 4227 int n_ExternalID; 4228 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */ 4229 int n_SystemID; 4230 4231 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4232 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4233 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 4234 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 4235 mem_base = xmlMemBlocks(); 4236 ctx = gen_void_ptr(n_ctx, 0); 4237 name = gen_const_xmlChar_ptr(n_name, 1); 4238 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 4239 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 4240 4241 xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 4242 call_tests++; 4243 des_void_ptr(n_ctx, ctx, 0); 4244 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4245 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 4246 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 4247 xmlResetLastError(); 4248 if (mem_base != xmlMemBlocks()) { 4249 printf("Leak of %d blocks found in xmlSAX2ExternalSubset", 4250 xmlMemBlocks() - mem_base); 4251 test_ret++; 4252 printf(" %d", n_ctx); 4253 printf(" %d", n_name); 4254 printf(" %d", n_ExternalID); 4255 printf(" %d", n_SystemID); 4256 printf("\n"); 4257 } 4258 } 4259 } 4260 } 4261 } 4262 function_tests++; 4263 4264 return(test_ret); 4265 } 4266 4267 4268 static int 4269 test_xmlSAX2GetColumnNumber(void) { 4270 int test_ret = 0; 4271 4272 int mem_base; 4273 int ret_val; 4274 void * ctx; /* the user data (XML parser context) */ 4275 int n_ctx; 4276 4277 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4278 mem_base = xmlMemBlocks(); 4279 ctx = gen_void_ptr(n_ctx, 0); 4280 4281 ret_val = xmlSAX2GetColumnNumber(ctx); 4282 desret_int(ret_val); 4283 call_tests++; 4284 des_void_ptr(n_ctx, ctx, 0); 4285 xmlResetLastError(); 4286 if (mem_base != xmlMemBlocks()) { 4287 printf("Leak of %d blocks found in xmlSAX2GetColumnNumber", 4288 xmlMemBlocks() - mem_base); 4289 test_ret++; 4290 printf(" %d", n_ctx); 4291 printf("\n"); 4292 } 4293 } 4294 function_tests++; 4295 4296 return(test_ret); 4297 } 4298 4299 4300 static int 4301 test_xmlSAX2GetEntity(void) { 4302 int test_ret = 0; 4303 4304 int mem_base; 4305 xmlEntityPtr ret_val; 4306 void * ctx; /* the user data (XML parser context) */ 4307 int n_ctx; 4308 xmlChar * name; /* The entity name */ 4309 int n_name; 4310 4311 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4312 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4313 mem_base = xmlMemBlocks(); 4314 ctx = gen_void_ptr(n_ctx, 0); 4315 name = gen_const_xmlChar_ptr(n_name, 1); 4316 4317 ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name); 4318 desret_xmlEntityPtr(ret_val); 4319 call_tests++; 4320 des_void_ptr(n_ctx, ctx, 0); 4321 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4322 xmlResetLastError(); 4323 if (mem_base != xmlMemBlocks()) { 4324 printf("Leak of %d blocks found in xmlSAX2GetEntity", 4325 xmlMemBlocks() - mem_base); 4326 test_ret++; 4327 printf(" %d", n_ctx); 4328 printf(" %d", n_name); 4329 printf("\n"); 4330 } 4331 } 4332 } 4333 function_tests++; 4334 4335 return(test_ret); 4336 } 4337 4338 4339 static int 4340 test_xmlSAX2GetLineNumber(void) { 4341 int test_ret = 0; 4342 4343 int mem_base; 4344 int ret_val; 4345 void * ctx; /* the user data (XML parser context) */ 4346 int n_ctx; 4347 4348 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4349 mem_base = xmlMemBlocks(); 4350 ctx = gen_void_ptr(n_ctx, 0); 4351 4352 ret_val = xmlSAX2GetLineNumber(ctx); 4353 desret_int(ret_val); 4354 call_tests++; 4355 des_void_ptr(n_ctx, ctx, 0); 4356 xmlResetLastError(); 4357 if (mem_base != xmlMemBlocks()) { 4358 printf("Leak of %d blocks found in xmlSAX2GetLineNumber", 4359 xmlMemBlocks() - mem_base); 4360 test_ret++; 4361 printf(" %d", n_ctx); 4362 printf("\n"); 4363 } 4364 } 4365 function_tests++; 4366 4367 return(test_ret); 4368 } 4369 4370 4371 static int 4372 test_xmlSAX2GetParameterEntity(void) { 4373 int test_ret = 0; 4374 4375 int mem_base; 4376 xmlEntityPtr ret_val; 4377 void * ctx; /* the user data (XML parser context) */ 4378 int n_ctx; 4379 xmlChar * name; /* The entity name */ 4380 int n_name; 4381 4382 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4383 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4384 mem_base = xmlMemBlocks(); 4385 ctx = gen_void_ptr(n_ctx, 0); 4386 name = gen_const_xmlChar_ptr(n_name, 1); 4387 4388 ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name); 4389 desret_xmlEntityPtr(ret_val); 4390 call_tests++; 4391 des_void_ptr(n_ctx, ctx, 0); 4392 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4393 xmlResetLastError(); 4394 if (mem_base != xmlMemBlocks()) { 4395 printf("Leak of %d blocks found in xmlSAX2GetParameterEntity", 4396 xmlMemBlocks() - mem_base); 4397 test_ret++; 4398 printf(" %d", n_ctx); 4399 printf(" %d", n_name); 4400 printf("\n"); 4401 } 4402 } 4403 } 4404 function_tests++; 4405 4406 return(test_ret); 4407 } 4408 4409 4410 static int 4411 test_xmlSAX2GetPublicId(void) { 4412 int test_ret = 0; 4413 4414 int mem_base; 4415 const xmlChar * ret_val; 4416 void * ctx; /* the user data (XML parser context) */ 4417 int n_ctx; 4418 4419 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4420 mem_base = xmlMemBlocks(); 4421 ctx = gen_void_ptr(n_ctx, 0); 4422 4423 ret_val = xmlSAX2GetPublicId(ctx); 4424 desret_const_xmlChar_ptr(ret_val); 4425 call_tests++; 4426 des_void_ptr(n_ctx, ctx, 0); 4427 xmlResetLastError(); 4428 if (mem_base != xmlMemBlocks()) { 4429 printf("Leak of %d blocks found in xmlSAX2GetPublicId", 4430 xmlMemBlocks() - mem_base); 4431 test_ret++; 4432 printf(" %d", n_ctx); 4433 printf("\n"); 4434 } 4435 } 4436 function_tests++; 4437 4438 return(test_ret); 4439 } 4440 4441 4442 static int 4443 test_xmlSAX2GetSystemId(void) { 4444 int test_ret = 0; 4445 4446 int mem_base; 4447 const xmlChar * ret_val; 4448 void * ctx; /* the user data (XML parser context) */ 4449 int n_ctx; 4450 4451 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4452 mem_base = xmlMemBlocks(); 4453 ctx = gen_void_ptr(n_ctx, 0); 4454 4455 ret_val = xmlSAX2GetSystemId(ctx); 4456 desret_const_xmlChar_ptr(ret_val); 4457 call_tests++; 4458 des_void_ptr(n_ctx, ctx, 0); 4459 xmlResetLastError(); 4460 if (mem_base != xmlMemBlocks()) { 4461 printf("Leak of %d blocks found in xmlSAX2GetSystemId", 4462 xmlMemBlocks() - mem_base); 4463 test_ret++; 4464 printf(" %d", n_ctx); 4465 printf("\n"); 4466 } 4467 } 4468 function_tests++; 4469 4470 return(test_ret); 4471 } 4472 4473 4474 static int 4475 test_xmlSAX2HasExternalSubset(void) { 4476 int test_ret = 0; 4477 4478 int mem_base; 4479 int ret_val; 4480 void * ctx; /* the user data (XML parser context) */ 4481 int n_ctx; 4482 4483 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4484 mem_base = xmlMemBlocks(); 4485 ctx = gen_void_ptr(n_ctx, 0); 4486 4487 ret_val = xmlSAX2HasExternalSubset(ctx); 4488 desret_int(ret_val); 4489 call_tests++; 4490 des_void_ptr(n_ctx, ctx, 0); 4491 xmlResetLastError(); 4492 if (mem_base != xmlMemBlocks()) { 4493 printf("Leak of %d blocks found in xmlSAX2HasExternalSubset", 4494 xmlMemBlocks() - mem_base); 4495 test_ret++; 4496 printf(" %d", n_ctx); 4497 printf("\n"); 4498 } 4499 } 4500 function_tests++; 4501 4502 return(test_ret); 4503 } 4504 4505 4506 static int 4507 test_xmlSAX2HasInternalSubset(void) { 4508 int test_ret = 0; 4509 4510 int mem_base; 4511 int ret_val; 4512 void * ctx; /* the user data (XML parser context) */ 4513 int n_ctx; 4514 4515 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4516 mem_base = xmlMemBlocks(); 4517 ctx = gen_void_ptr(n_ctx, 0); 4518 4519 ret_val = xmlSAX2HasInternalSubset(ctx); 4520 desret_int(ret_val); 4521 call_tests++; 4522 des_void_ptr(n_ctx, ctx, 0); 4523 xmlResetLastError(); 4524 if (mem_base != xmlMemBlocks()) { 4525 printf("Leak of %d blocks found in xmlSAX2HasInternalSubset", 4526 xmlMemBlocks() - mem_base); 4527 test_ret++; 4528 printf(" %d", n_ctx); 4529 printf("\n"); 4530 } 4531 } 4532 function_tests++; 4533 4534 return(test_ret); 4535 } 4536 4537 4538 static int 4539 test_xmlSAX2IgnorableWhitespace(void) { 4540 int test_ret = 0; 4541 4542 int mem_base; 4543 void * ctx; /* the user data (XML parser context) */ 4544 int n_ctx; 4545 xmlChar * ch; /* a xmlChar string */ 4546 int n_ch; 4547 int len; /* the number of xmlChar */ 4548 int n_len; 4549 4550 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4551 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) { 4552 for (n_len = 0;n_len < gen_nb_int;n_len++) { 4553 mem_base = xmlMemBlocks(); 4554 ctx = gen_void_ptr(n_ctx, 0); 4555 ch = gen_const_xmlChar_ptr(n_ch, 1); 4556 len = gen_int(n_len, 2); 4557 4558 xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len); 4559 call_tests++; 4560 des_void_ptr(n_ctx, ctx, 0); 4561 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1); 4562 des_int(n_len, len, 2); 4563 xmlResetLastError(); 4564 if (mem_base != xmlMemBlocks()) { 4565 printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace", 4566 xmlMemBlocks() - mem_base); 4567 test_ret++; 4568 printf(" %d", n_ctx); 4569 printf(" %d", n_ch); 4570 printf(" %d", n_len); 4571 printf("\n"); 4572 } 4573 } 4574 } 4575 } 4576 function_tests++; 4577 4578 return(test_ret); 4579 } 4580 4581 4582 #define gen_nb_xmlSAXHandler_ptr 1 4583 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4584 return(NULL); 4585 } 4586 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4587 } 4588 4589 static int 4590 test_xmlSAX2InitDefaultSAXHandler(void) { 4591 int test_ret = 0; 4592 4593 int mem_base; 4594 xmlSAXHandler * hdlr; /* the SAX handler */ 4595 int n_hdlr; 4596 int warning; /* flag if non-zero sets the handler warning procedure */ 4597 int n_warning; 4598 4599 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 4600 for (n_warning = 0;n_warning < gen_nb_int;n_warning++) { 4601 mem_base = xmlMemBlocks(); 4602 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 4603 warning = gen_int(n_warning, 1); 4604 4605 xmlSAX2InitDefaultSAXHandler(hdlr, warning); 4606 call_tests++; 4607 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 4608 des_int(n_warning, warning, 1); 4609 xmlResetLastError(); 4610 if (mem_base != xmlMemBlocks()) { 4611 printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler", 4612 xmlMemBlocks() - mem_base); 4613 test_ret++; 4614 printf(" %d", n_hdlr); 4615 printf(" %d", n_warning); 4616 printf("\n"); 4617 } 4618 } 4619 } 4620 function_tests++; 4621 4622 return(test_ret); 4623 } 4624 4625 4626 static int 4627 test_xmlSAX2InitDocbDefaultSAXHandler(void) { 4628 int test_ret = 0; 4629 4630 #if defined(LIBXML_DOCB_ENABLED) 4631 int mem_base; 4632 xmlSAXHandler * hdlr; /* the SAX handler */ 4633 int n_hdlr; 4634 4635 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 4636 mem_base = xmlMemBlocks(); 4637 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 4638 4639 xmlSAX2InitDocbDefaultSAXHandler(hdlr); 4640 call_tests++; 4641 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 4642 xmlResetLastError(); 4643 if (mem_base != xmlMemBlocks()) { 4644 printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler", 4645 xmlMemBlocks() - mem_base); 4646 test_ret++; 4647 printf(" %d", n_hdlr); 4648 printf("\n"); 4649 } 4650 } 4651 function_tests++; 4652 #endif 4653 4654 return(test_ret); 4655 } 4656 4657 4658 static int 4659 test_xmlSAX2InitHtmlDefaultSAXHandler(void) { 4660 int test_ret = 0; 4661 4662 #if defined(LIBXML_HTML_ENABLED) 4663 int mem_base; 4664 xmlSAXHandler * hdlr; /* the SAX handler */ 4665 int n_hdlr; 4666 4667 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 4668 mem_base = xmlMemBlocks(); 4669 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 4670 4671 xmlSAX2InitHtmlDefaultSAXHandler(hdlr); 4672 call_tests++; 4673 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 4674 xmlResetLastError(); 4675 if (mem_base != xmlMemBlocks()) { 4676 printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler", 4677 xmlMemBlocks() - mem_base); 4678 test_ret++; 4679 printf(" %d", n_hdlr); 4680 printf("\n"); 4681 } 4682 } 4683 function_tests++; 4684 #endif 4685 4686 return(test_ret); 4687 } 4688 4689 4690 static int 4691 test_xmlSAX2InternalSubset(void) { 4692 int test_ret = 0; 4693 4694 int mem_base; 4695 void * ctx; /* the user data (XML parser context) */ 4696 int n_ctx; 4697 xmlChar * name; /* the root element name */ 4698 int n_name; 4699 xmlChar * ExternalID; /* the external ID */ 4700 int n_ExternalID; 4701 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */ 4702 int n_SystemID; 4703 4704 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4705 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4706 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 4707 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 4708 mem_base = xmlMemBlocks(); 4709 ctx = gen_void_ptr(n_ctx, 0); 4710 name = gen_const_xmlChar_ptr(n_name, 1); 4711 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 4712 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 4713 4714 xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 4715 call_tests++; 4716 des_void_ptr(n_ctx, ctx, 0); 4717 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4718 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 4719 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 4720 xmlResetLastError(); 4721 if (mem_base != xmlMemBlocks()) { 4722 printf("Leak of %d blocks found in xmlSAX2InternalSubset", 4723 xmlMemBlocks() - mem_base); 4724 test_ret++; 4725 printf(" %d", n_ctx); 4726 printf(" %d", n_name); 4727 printf(" %d", n_ExternalID); 4728 printf(" %d", n_SystemID); 4729 printf("\n"); 4730 } 4731 } 4732 } 4733 } 4734 } 4735 function_tests++; 4736 4737 return(test_ret); 4738 } 4739 4740 4741 static int 4742 test_xmlSAX2IsStandalone(void) { 4743 int test_ret = 0; 4744 4745 int mem_base; 4746 int ret_val; 4747 void * ctx; /* the user data (XML parser context) */ 4748 int n_ctx; 4749 4750 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4751 mem_base = xmlMemBlocks(); 4752 ctx = gen_void_ptr(n_ctx, 0); 4753 4754 ret_val = xmlSAX2IsStandalone(ctx); 4755 desret_int(ret_val); 4756 call_tests++; 4757 des_void_ptr(n_ctx, ctx, 0); 4758 xmlResetLastError(); 4759 if (mem_base != xmlMemBlocks()) { 4760 printf("Leak of %d blocks found in xmlSAX2IsStandalone", 4761 xmlMemBlocks() - mem_base); 4762 test_ret++; 4763 printf(" %d", n_ctx); 4764 printf("\n"); 4765 } 4766 } 4767 function_tests++; 4768 4769 return(test_ret); 4770 } 4771 4772 4773 static int 4774 test_xmlSAX2NotationDecl(void) { 4775 int test_ret = 0; 4776 4777 int mem_base; 4778 void * ctx; /* the user data (XML parser context) */ 4779 int n_ctx; 4780 xmlChar * name; /* The name of the notation */ 4781 int n_name; 4782 xmlChar * publicId; /* The public ID of the entity */ 4783 int n_publicId; 4784 xmlChar * systemId; /* The system ID of the entity */ 4785 int n_systemId; 4786 4787 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4788 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4789 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 4790 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 4791 mem_base = xmlMemBlocks(); 4792 ctx = gen_void_ptr(n_ctx, 0); 4793 name = gen_const_xmlChar_ptr(n_name, 1); 4794 publicId = gen_const_xmlChar_ptr(n_publicId, 2); 4795 systemId = gen_const_xmlChar_ptr(n_systemId, 3); 4796 4797 xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId); 4798 call_tests++; 4799 des_void_ptr(n_ctx, ctx, 0); 4800 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4801 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2); 4802 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3); 4803 xmlResetLastError(); 4804 if (mem_base != xmlMemBlocks()) { 4805 printf("Leak of %d blocks found in xmlSAX2NotationDecl", 4806 xmlMemBlocks() - mem_base); 4807 test_ret++; 4808 printf(" %d", n_ctx); 4809 printf(" %d", n_name); 4810 printf(" %d", n_publicId); 4811 printf(" %d", n_systemId); 4812 printf("\n"); 4813 } 4814 } 4815 } 4816 } 4817 } 4818 function_tests++; 4819 4820 return(test_ret); 4821 } 4822 4823 4824 static int 4825 test_xmlSAX2ProcessingInstruction(void) { 4826 int test_ret = 0; 4827 4828 int mem_base; 4829 void * ctx; /* the user data (XML parser context) */ 4830 int n_ctx; 4831 xmlChar * target; /* the target name */ 4832 int n_target; 4833 xmlChar * data; /* the PI data's */ 4834 int n_data; 4835 4836 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4837 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { 4838 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { 4839 mem_base = xmlMemBlocks(); 4840 ctx = gen_void_ptr(n_ctx, 0); 4841 target = gen_const_xmlChar_ptr(n_target, 1); 4842 data = gen_const_xmlChar_ptr(n_data, 2); 4843 4844 xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data); 4845 call_tests++; 4846 des_void_ptr(n_ctx, ctx, 0); 4847 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1); 4848 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2); 4849 xmlResetLastError(); 4850 if (mem_base != xmlMemBlocks()) { 4851 printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction", 4852 xmlMemBlocks() - mem_base); 4853 test_ret++; 4854 printf(" %d", n_ctx); 4855 printf(" %d", n_target); 4856 printf(" %d", n_data); 4857 printf("\n"); 4858 } 4859 } 4860 } 4861 } 4862 function_tests++; 4863 4864 return(test_ret); 4865 } 4866 4867 4868 static int 4869 test_xmlSAX2Reference(void) { 4870 int test_ret = 0; 4871 4872 int mem_base; 4873 void * ctx; /* the user data (XML parser context) */ 4874 int n_ctx; 4875 xmlChar * name; /* The entity name */ 4876 int n_name; 4877 4878 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4879 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4880 mem_base = xmlMemBlocks(); 4881 ctx = gen_void_ptr(n_ctx, 0); 4882 name = gen_const_xmlChar_ptr(n_name, 1); 4883 4884 xmlSAX2Reference(ctx, (const xmlChar *)name); 4885 call_tests++; 4886 des_void_ptr(n_ctx, ctx, 0); 4887 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4888 xmlResetLastError(); 4889 if (mem_base != xmlMemBlocks()) { 4890 printf("Leak of %d blocks found in xmlSAX2Reference", 4891 xmlMemBlocks() - mem_base); 4892 test_ret++; 4893 printf(" %d", n_ctx); 4894 printf(" %d", n_name); 4895 printf("\n"); 4896 } 4897 } 4898 } 4899 function_tests++; 4900 4901 return(test_ret); 4902 } 4903 4904 4905 static int 4906 test_xmlSAX2ResolveEntity(void) { 4907 int test_ret = 0; 4908 4909 int mem_base; 4910 xmlParserInputPtr ret_val; 4911 void * ctx; /* the user data (XML parser context) */ 4912 int n_ctx; 4913 xmlChar * publicId; /* The public ID of the entity */ 4914 int n_publicId; 4915 xmlChar * systemId; /* The system ID of the entity */ 4916 int n_systemId; 4917 4918 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4919 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 4920 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 4921 mem_base = xmlMemBlocks(); 4922 ctx = gen_void_ptr(n_ctx, 0); 4923 publicId = gen_const_xmlChar_ptr(n_publicId, 1); 4924 systemId = gen_const_xmlChar_ptr(n_systemId, 2); 4925 4926 ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId); 4927 desret_xmlParserInputPtr(ret_val); 4928 call_tests++; 4929 des_void_ptr(n_ctx, ctx, 0); 4930 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1); 4931 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2); 4932 xmlResetLastError(); 4933 if (mem_base != xmlMemBlocks()) { 4934 printf("Leak of %d blocks found in xmlSAX2ResolveEntity", 4935 xmlMemBlocks() - mem_base); 4936 test_ret++; 4937 printf(" %d", n_ctx); 4938 printf(" %d", n_publicId); 4939 printf(" %d", n_systemId); 4940 printf("\n"); 4941 } 4942 } 4943 } 4944 } 4945 function_tests++; 4946 4947 return(test_ret); 4948 } 4949 4950 4951 #define gen_nb_xmlSAXLocatorPtr 1 4952 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4953 return(NULL); 4954 } 4955 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4956 } 4957 4958 static int 4959 test_xmlSAX2SetDocumentLocator(void) { 4960 int test_ret = 0; 4961 4962 int mem_base; 4963 void * ctx; /* the user data (XML parser context) */ 4964 int n_ctx; 4965 xmlSAXLocatorPtr loc; /* A SAX Locator */ 4966 int n_loc; 4967 4968 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4969 for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) { 4970 mem_base = xmlMemBlocks(); 4971 ctx = gen_void_ptr(n_ctx, 0); 4972 loc = gen_xmlSAXLocatorPtr(n_loc, 1); 4973 4974 xmlSAX2SetDocumentLocator(ctx, loc); 4975 call_tests++; 4976 des_void_ptr(n_ctx, ctx, 0); 4977 des_xmlSAXLocatorPtr(n_loc, loc, 1); 4978 xmlResetLastError(); 4979 if (mem_base != xmlMemBlocks()) { 4980 printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator", 4981 xmlMemBlocks() - mem_base); 4982 test_ret++; 4983 printf(" %d", n_ctx); 4984 printf(" %d", n_loc); 4985 printf("\n"); 4986 } 4987 } 4988 } 4989 function_tests++; 4990 4991 return(test_ret); 4992 } 4993 4994 4995 static int 4996 test_xmlSAX2StartDocument(void) { 4997 int test_ret = 0; 4998 4999 int mem_base; 5000 void * ctx; /* the user data (XML parser context) */ 5001 int n_ctx; 5002 5003 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5004 mem_base = xmlMemBlocks(); 5005 ctx = gen_void_ptr(n_ctx, 0); 5006 5007 xmlSAX2StartDocument(ctx); 5008 call_tests++; 5009 des_void_ptr(n_ctx, ctx, 0); 5010 xmlResetLastError(); 5011 if (mem_base != xmlMemBlocks()) { 5012 printf("Leak of %d blocks found in xmlSAX2StartDocument", 5013 xmlMemBlocks() - mem_base); 5014 test_ret++; 5015 printf(" %d", n_ctx); 5016 printf("\n"); 5017 } 5018 } 5019 function_tests++; 5020 5021 return(test_ret); 5022 } 5023 5024 5025 static int 5026 test_xmlSAX2StartElement(void) { 5027 int test_ret = 0; 5028 5029 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) 5030 #ifdef LIBXML_SAX1_ENABLED 5031 int mem_base; 5032 void * ctx; /* the user data (XML parser context) */ 5033 int n_ctx; 5034 xmlChar * fullname; /* The element name, including namespace prefix */ 5035 int n_fullname; 5036 xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */ 5037 int n_atts; 5038 5039 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5040 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) { 5041 for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) { 5042 mem_base = xmlMemBlocks(); 5043 ctx = gen_void_ptr(n_ctx, 0); 5044 fullname = gen_const_xmlChar_ptr(n_fullname, 1); 5045 atts = gen_const_xmlChar_ptr_ptr(n_atts, 2); 5046 5047 xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts); 5048 call_tests++; 5049 des_void_ptr(n_ctx, ctx, 0); 5050 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1); 5051 des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2); 5052 xmlResetLastError(); 5053 if (mem_base != xmlMemBlocks()) { 5054 printf("Leak of %d blocks found in xmlSAX2StartElement", 5055 xmlMemBlocks() - mem_base); 5056 test_ret++; 5057 printf(" %d", n_ctx); 5058 printf(" %d", n_fullname); 5059 printf(" %d", n_atts); 5060 printf("\n"); 5061 } 5062 } 5063 } 5064 } 5065 function_tests++; 5066 #endif 5067 #endif 5068 5069 return(test_ret); 5070 } 5071 5072 5073 static int 5074 test_xmlSAX2StartElementNs(void) { 5075 int test_ret = 0; 5076 5077 int mem_base; 5078 void * ctx; /* the user data (XML parser context) */ 5079 int n_ctx; 5080 xmlChar * localname; /* the local name of the element */ 5081 int n_localname; 5082 xmlChar * prefix; /* the element namespace prefix if available */ 5083 int n_prefix; 5084 xmlChar * URI; /* the element namespace name if available */ 5085 int n_URI; 5086 int nb_namespaces; /* number of namespace definitions on that node */ 5087 int n_nb_namespaces; 5088 xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */ 5089 int n_namespaces; 5090 int nb_attributes; /* the number of attributes on that node */ 5091 int n_nb_attributes; 5092 int nb_defaulted; /* the number of defaulted attributes. */ 5093 int n_nb_defaulted; 5094 xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */ 5095 int n_attributes; 5096 5097 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5098 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) { 5099 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 5100 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 5101 for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) { 5102 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) { 5103 for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) { 5104 for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) { 5105 for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) { 5106 mem_base = xmlMemBlocks(); 5107 ctx = gen_void_ptr(n_ctx, 0); 5108 localname = gen_const_xmlChar_ptr(n_localname, 1); 5109 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 5110 URI = gen_const_xmlChar_ptr(n_URI, 3); 5111 nb_namespaces = gen_int(n_nb_namespaces, 4); 5112 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5); 5113 nb_attributes = gen_int(n_nb_attributes, 6); 5114 nb_defaulted = gen_int(n_nb_defaulted, 7); 5115 attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8); 5116 5117 xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes); 5118 call_tests++; 5119 des_void_ptr(n_ctx, ctx, 0); 5120 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1); 5121 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 5122 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3); 5123 des_int(n_nb_namespaces, nb_namespaces, 4); 5124 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5); 5125 des_int(n_nb_attributes, nb_attributes, 6); 5126 des_int(n_nb_defaulted, nb_defaulted, 7); 5127 des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8); 5128 xmlResetLastError(); 5129 if (mem_base != xmlMemBlocks()) { 5130 printf("Leak of %d blocks found in xmlSAX2StartElementNs", 5131 xmlMemBlocks() - mem_base); 5132 test_ret++; 5133 printf(" %d", n_ctx); 5134 printf(" %d", n_localname); 5135 printf(" %d", n_prefix); 5136 printf(" %d", n_URI); 5137 printf(" %d", n_nb_namespaces); 5138 printf(" %d", n_namespaces); 5139 printf(" %d", n_nb_attributes); 5140 printf(" %d", n_nb_defaulted); 5141 printf(" %d", n_attributes); 5142 printf("\n"); 5143 } 5144 } 5145 } 5146 } 5147 } 5148 } 5149 } 5150 } 5151 } 5152 } 5153 function_tests++; 5154 5155 return(test_ret); 5156 } 5157 5158 5159 static int 5160 test_xmlSAX2UnparsedEntityDecl(void) { 5161 int test_ret = 0; 5162 5163 int mem_base; 5164 void * ctx; /* the user data (XML parser context) */ 5165 int n_ctx; 5166 xmlChar * name; /* The name of the entity */ 5167 int n_name; 5168 xmlChar * publicId; /* The public ID of the entity */ 5169 int n_publicId; 5170 xmlChar * systemId; /* The system ID of the entity */ 5171 int n_systemId; 5172 xmlChar * notationName; /* the name of the notation */ 5173 int n_notationName; 5174 5175 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 5177 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 5178 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 5179 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { 5180 mem_base = xmlMemBlocks(); 5181 ctx = gen_void_ptr(n_ctx, 0); 5182 name = gen_const_xmlChar_ptr(n_name, 1); 5183 publicId = gen_const_xmlChar_ptr(n_publicId, 2); 5184 systemId = gen_const_xmlChar_ptr(n_systemId, 3); 5185 notationName = gen_const_xmlChar_ptr(n_notationName, 4); 5186 5187 xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName); 5188 call_tests++; 5189 des_void_ptr(n_ctx, ctx, 0); 5190 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 5191 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2); 5192 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3); 5193 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4); 5194 xmlResetLastError(); 5195 if (mem_base != xmlMemBlocks()) { 5196 printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl", 5197 xmlMemBlocks() - mem_base); 5198 test_ret++; 5199 printf(" %d", n_ctx); 5200 printf(" %d", n_name); 5201 printf(" %d", n_publicId); 5202 printf(" %d", n_systemId); 5203 printf(" %d", n_notationName); 5204 printf("\n"); 5205 } 5206 } 5207 } 5208 } 5209 } 5210 } 5211 function_tests++; 5212 5213 return(test_ret); 5214 } 5215 5216 5217 static int 5218 test_xmlSAXDefaultVersion(void) { 5219 int test_ret = 0; 5220 5221 #if defined(LIBXML_SAX1_ENABLED) 5222 #ifdef LIBXML_SAX1_ENABLED 5223 int mem_base; 5224 int ret_val; 5225 int version; /* the version, 1 or 2 */ 5226 int n_version; 5227 5228 for (n_version = 0;n_version < gen_nb_int;n_version++) { 5229 mem_base = xmlMemBlocks(); 5230 version = gen_int(n_version, 0); 5231 5232 ret_val = xmlSAXDefaultVersion(version); 5233 desret_int(ret_val); 5234 call_tests++; 5235 des_int(n_version, version, 0); 5236 xmlResetLastError(); 5237 if (mem_base != xmlMemBlocks()) { 5238 printf("Leak of %d blocks found in xmlSAXDefaultVersion", 5239 xmlMemBlocks() - mem_base); 5240 test_ret++; 5241 printf(" %d", n_version); 5242 printf("\n"); 5243 } 5244 } 5245 function_tests++; 5246 #endif 5247 #endif 5248 5249 return(test_ret); 5250 } 5251 5252 5253 static int 5254 test_xmlSAXVersion(void) { 5255 int test_ret = 0; 5256 5257 int mem_base; 5258 int ret_val; 5259 xmlSAXHandler * hdlr; /* the SAX handler */ 5260 int n_hdlr; 5261 int version; /* the version, 1 or 2 */ 5262 int n_version; 5263 5264 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 5265 for (n_version = 0;n_version < gen_nb_int;n_version++) { 5266 mem_base = xmlMemBlocks(); 5267 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 5268 version = gen_int(n_version, 1); 5269 5270 ret_val = xmlSAXVersion(hdlr, version); 5271 desret_int(ret_val); 5272 call_tests++; 5273 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 5274 des_int(n_version, version, 1); 5275 xmlResetLastError(); 5276 if (mem_base != xmlMemBlocks()) { 5277 printf("Leak of %d blocks found in xmlSAXVersion", 5278 xmlMemBlocks() - mem_base); 5279 test_ret++; 5280 printf(" %d", n_hdlr); 5281 printf(" %d", n_version); 5282 printf("\n"); 5283 } 5284 } 5285 } 5286 function_tests++; 5287 5288 return(test_ret); 5289 } 5290 5291 static int 5292 test_SAX2(void) { 5293 int test_ret = 0; 5294 5295 if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n"); 5296 test_ret += test_docbDefaultSAXHandlerInit(); 5297 test_ret += test_htmlDefaultSAXHandlerInit(); 5298 test_ret += test_xmlDefaultSAXHandlerInit(); 5299 test_ret += test_xmlSAX2AttributeDecl(); 5300 test_ret += test_xmlSAX2CDataBlock(); 5301 test_ret += test_xmlSAX2Characters(); 5302 test_ret += test_xmlSAX2Comment(); 5303 test_ret += test_xmlSAX2ElementDecl(); 5304 test_ret += test_xmlSAX2EndDocument(); 5305 test_ret += test_xmlSAX2EndElement(); 5306 test_ret += test_xmlSAX2EndElementNs(); 5307 test_ret += test_xmlSAX2EntityDecl(); 5308 test_ret += test_xmlSAX2ExternalSubset(); 5309 test_ret += test_xmlSAX2GetColumnNumber(); 5310 test_ret += test_xmlSAX2GetEntity(); 5311 test_ret += test_xmlSAX2GetLineNumber(); 5312 test_ret += test_xmlSAX2GetParameterEntity(); 5313 test_ret += test_xmlSAX2GetPublicId(); 5314 test_ret += test_xmlSAX2GetSystemId(); 5315 test_ret += test_xmlSAX2HasExternalSubset(); 5316 test_ret += test_xmlSAX2HasInternalSubset(); 5317 test_ret += test_xmlSAX2IgnorableWhitespace(); 5318 test_ret += test_xmlSAX2InitDefaultSAXHandler(); 5319 test_ret += test_xmlSAX2InitDocbDefaultSAXHandler(); 5320 test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler(); 5321 test_ret += test_xmlSAX2InternalSubset(); 5322 test_ret += test_xmlSAX2IsStandalone(); 5323 test_ret += test_xmlSAX2NotationDecl(); 5324 test_ret += test_xmlSAX2ProcessingInstruction(); 5325 test_ret += test_xmlSAX2Reference(); 5326 test_ret += test_xmlSAX2ResolveEntity(); 5327 test_ret += test_xmlSAX2SetDocumentLocator(); 5328 test_ret += test_xmlSAX2StartDocument(); 5329 test_ret += test_xmlSAX2StartElement(); 5330 test_ret += test_xmlSAX2StartElementNs(); 5331 test_ret += test_xmlSAX2UnparsedEntityDecl(); 5332 test_ret += test_xmlSAXDefaultVersion(); 5333 test_ret += test_xmlSAXVersion(); 5334 5335 if (test_ret != 0) 5336 printf("Module SAX2: %d errors\n", test_ret); 5337 return(test_ret); 5338 } 5339 5340 static int 5341 test_xmlC14NDocDumpMemory(void) { 5342 int test_ret = 0; 5343 5344 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5345 int mem_base; 5346 int ret_val; 5347 xmlDocPtr doc; /* the XML document for canonization */ 5348 int n_doc; 5349 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ 5350 int n_nodes; 5351 int mode; /* the c14n mode (see @xmlC14NMode) */ 5352 int n_mode; 5353 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) */ 5354 int n_inclusive_ns_prefixes; 5355 int with_comments; /* include comments in the result (!=0) or not (==0) */ 5356 int n_with_comments; 5357 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 */ 5358 int n_doc_txt_ptr; 5359 5360 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 5361 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { 5362 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 5363 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { 5364 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { 5365 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { 5366 mem_base = xmlMemBlocks(); 5367 doc = gen_xmlDocPtr(n_doc, 0); 5368 nodes = gen_xmlNodeSetPtr(n_nodes, 1); 5369 mode = gen_int(n_mode, 2); 5370 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); 5371 with_comments = gen_int(n_with_comments, 4); 5372 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5); 5373 5374 ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr); 5375 desret_int(ret_val); 5376 call_tests++; 5377 des_xmlDocPtr(n_doc, doc, 0); 5378 des_xmlNodeSetPtr(n_nodes, nodes, 1); 5379 des_int(n_mode, mode, 2); 5380 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); 5381 des_int(n_with_comments, with_comments, 4); 5382 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5); 5383 xmlResetLastError(); 5384 if (mem_base != xmlMemBlocks()) { 5385 printf("Leak of %d blocks found in xmlC14NDocDumpMemory", 5386 xmlMemBlocks() - mem_base); 5387 test_ret++; 5388 printf(" %d", n_doc); 5389 printf(" %d", n_nodes); 5390 printf(" %d", n_mode); 5391 printf(" %d", n_inclusive_ns_prefixes); 5392 printf(" %d", n_with_comments); 5393 printf(" %d", n_doc_txt_ptr); 5394 printf("\n"); 5395 } 5396 } 5397 } 5398 } 5399 } 5400 } 5401 } 5402 function_tests++; 5403 #endif 5404 5405 return(test_ret); 5406 } 5407 5408 5409 static int 5410 test_xmlC14NDocSave(void) { 5411 int test_ret = 0; 5412 5413 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5414 int mem_base; 5415 int ret_val; 5416 xmlDocPtr doc; /* the XML document for canonization */ 5417 int n_doc; 5418 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ 5419 int n_nodes; 5420 int mode; /* the c14n mode (see @xmlC14NMode) */ 5421 int n_mode; 5422 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) */ 5423 int n_inclusive_ns_prefixes; 5424 int with_comments; /* include comments in the result (!=0) or not (==0) */ 5425 int n_with_comments; 5426 const char * filename; /* the filename to store canonical XML image */ 5427 int n_filename; 5428 int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */ 5429 int n_compression; 5430 5431 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 5432 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { 5433 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 5434 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { 5435 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { 5436 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 5437 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { 5438 mem_base = xmlMemBlocks(); 5439 doc = gen_xmlDocPtr(n_doc, 0); 5440 nodes = gen_xmlNodeSetPtr(n_nodes, 1); 5441 mode = gen_int(n_mode, 2); 5442 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); 5443 with_comments = gen_int(n_with_comments, 4); 5444 filename = gen_fileoutput(n_filename, 5); 5445 compression = gen_int(n_compression, 6); 5446 5447 ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression); 5448 desret_int(ret_val); 5449 call_tests++; 5450 des_xmlDocPtr(n_doc, doc, 0); 5451 des_xmlNodeSetPtr(n_nodes, nodes, 1); 5452 des_int(n_mode, mode, 2); 5453 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); 5454 des_int(n_with_comments, with_comments, 4); 5455 des_fileoutput(n_filename, filename, 5); 5456 des_int(n_compression, compression, 6); 5457 xmlResetLastError(); 5458 if (mem_base != xmlMemBlocks()) { 5459 printf("Leak of %d blocks found in xmlC14NDocSave", 5460 xmlMemBlocks() - mem_base); 5461 test_ret++; 5462 printf(" %d", n_doc); 5463 printf(" %d", n_nodes); 5464 printf(" %d", n_mode); 5465 printf(" %d", n_inclusive_ns_prefixes); 5466 printf(" %d", n_with_comments); 5467 printf(" %d", n_filename); 5468 printf(" %d", n_compression); 5469 printf("\n"); 5470 } 5471 } 5472 } 5473 } 5474 } 5475 } 5476 } 5477 } 5478 function_tests++; 5479 #endif 5480 5481 return(test_ret); 5482 } 5483 5484 5485 static int 5486 test_xmlC14NDocSaveTo(void) { 5487 int test_ret = 0; 5488 5489 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5490 int mem_base; 5491 int ret_val; 5492 xmlDocPtr doc; /* the XML document for canonization */ 5493 int n_doc; 5494 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ 5495 int n_nodes; 5496 int mode; /* the c14n mode (see @xmlC14NMode) */ 5497 int n_mode; 5498 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) */ 5499 int n_inclusive_ns_prefixes; 5500 int with_comments; /* include comments in the result (!=0) or not (==0) */ 5501 int n_with_comments; 5502 xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */ 5503 int n_buf; 5504 5505 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 5506 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { 5507 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 5508 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { 5509 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { 5510 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 5511 mem_base = xmlMemBlocks(); 5512 doc = gen_xmlDocPtr(n_doc, 0); 5513 nodes = gen_xmlNodeSetPtr(n_nodes, 1); 5514 mode = gen_int(n_mode, 2); 5515 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); 5516 with_comments = gen_int(n_with_comments, 4); 5517 buf = gen_xmlOutputBufferPtr(n_buf, 5); 5518 5519 ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf); 5520 desret_int(ret_val); 5521 call_tests++; 5522 des_xmlDocPtr(n_doc, doc, 0); 5523 des_xmlNodeSetPtr(n_nodes, nodes, 1); 5524 des_int(n_mode, mode, 2); 5525 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); 5526 des_int(n_with_comments, with_comments, 4); 5527 des_xmlOutputBufferPtr(n_buf, buf, 5); 5528 xmlResetLastError(); 5529 if (mem_base != xmlMemBlocks()) { 5530 printf("Leak of %d blocks found in xmlC14NDocSaveTo", 5531 xmlMemBlocks() - mem_base); 5532 test_ret++; 5533 printf(" %d", n_doc); 5534 printf(" %d", n_nodes); 5535 printf(" %d", n_mode); 5536 printf(" %d", n_inclusive_ns_prefixes); 5537 printf(" %d", n_with_comments); 5538 printf(" %d", n_buf); 5539 printf("\n"); 5540 } 5541 } 5542 } 5543 } 5544 } 5545 } 5546 } 5547 function_tests++; 5548 #endif 5549 5550 return(test_ret); 5551 } 5552 5553 5554 static int 5555 test_xmlC14NExecute(void) { 5556 int test_ret = 0; 5557 5558 5559 /* missing type support */ 5560 return(test_ret); 5561 } 5562 5563 static int 5564 test_c14n(void) { 5565 int test_ret = 0; 5566 5567 if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n"); 5568 test_ret += test_xmlC14NDocDumpMemory(); 5569 test_ret += test_xmlC14NDocSave(); 5570 test_ret += test_xmlC14NDocSaveTo(); 5571 test_ret += test_xmlC14NExecute(); 5572 5573 if (test_ret != 0) 5574 printf("Module c14n: %d errors\n", test_ret); 5575 return(test_ret); 5576 } 5577 #ifdef LIBXML_CATALOG_ENABLED 5578 5579 #define gen_nb_xmlCatalogPtr 1 5580 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 5581 return(NULL); 5582 } 5583 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 5584 } 5585 #endif 5586 5587 5588 static int 5589 test_xmlACatalogAdd(void) { 5590 int test_ret = 0; 5591 5592 #if defined(LIBXML_CATALOG_ENABLED) 5593 int mem_base; 5594 int ret_val; 5595 xmlCatalogPtr catal; /* a Catalog */ 5596 int n_catal; 5597 xmlChar * type; /* the type of record to add to the catalog */ 5598 int n_type; 5599 xmlChar * orig; /* the system, public or prefix to match */ 5600 int n_orig; 5601 xmlChar * replace; /* the replacement value for the match */ 5602 int n_replace; 5603 5604 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5605 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { 5606 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { 5607 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { 5608 mem_base = xmlMemBlocks(); 5609 catal = gen_xmlCatalogPtr(n_catal, 0); 5610 type = gen_const_xmlChar_ptr(n_type, 1); 5611 orig = gen_const_xmlChar_ptr(n_orig, 2); 5612 replace = gen_const_xmlChar_ptr(n_replace, 3); 5613 5614 ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace); 5615 desret_int(ret_val); 5616 call_tests++; 5617 des_xmlCatalogPtr(n_catal, catal, 0); 5618 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1); 5619 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2); 5620 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3); 5621 xmlResetLastError(); 5622 if (mem_base != xmlMemBlocks()) { 5623 printf("Leak of %d blocks found in xmlACatalogAdd", 5624 xmlMemBlocks() - mem_base); 5625 test_ret++; 5626 printf(" %d", n_catal); 5627 printf(" %d", n_type); 5628 printf(" %d", n_orig); 5629 printf(" %d", n_replace); 5630 printf("\n"); 5631 } 5632 } 5633 } 5634 } 5635 } 5636 function_tests++; 5637 #endif 5638 5639 return(test_ret); 5640 } 5641 5642 5643 static int 5644 test_xmlACatalogDump(void) { 5645 int test_ret = 0; 5646 5647 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5648 int mem_base; 5649 xmlCatalogPtr catal; /* a Catalog */ 5650 int n_catal; 5651 FILE * out; /* the file. */ 5652 int n_out; 5653 5654 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5655 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 5656 mem_base = xmlMemBlocks(); 5657 catal = gen_xmlCatalogPtr(n_catal, 0); 5658 out = gen_FILE_ptr(n_out, 1); 5659 5660 xmlACatalogDump(catal, out); 5661 call_tests++; 5662 des_xmlCatalogPtr(n_catal, catal, 0); 5663 des_FILE_ptr(n_out, out, 1); 5664 xmlResetLastError(); 5665 if (mem_base != xmlMemBlocks()) { 5666 printf("Leak of %d blocks found in xmlACatalogDump", 5667 xmlMemBlocks() - mem_base); 5668 test_ret++; 5669 printf(" %d", n_catal); 5670 printf(" %d", n_out); 5671 printf("\n"); 5672 } 5673 } 5674 } 5675 function_tests++; 5676 #endif 5677 5678 return(test_ret); 5679 } 5680 5681 5682 static int 5683 test_xmlACatalogRemove(void) { 5684 int test_ret = 0; 5685 5686 #if defined(LIBXML_CATALOG_ENABLED) 5687 int mem_base; 5688 int ret_val; 5689 xmlCatalogPtr catal; /* a Catalog */ 5690 int n_catal; 5691 xmlChar * value; /* the value to remove */ 5692 int n_value; 5693 5694 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5695 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 5696 mem_base = xmlMemBlocks(); 5697 catal = gen_xmlCatalogPtr(n_catal, 0); 5698 value = gen_const_xmlChar_ptr(n_value, 1); 5699 5700 ret_val = xmlACatalogRemove(catal, (const xmlChar *)value); 5701 desret_int(ret_val); 5702 call_tests++; 5703 des_xmlCatalogPtr(n_catal, catal, 0); 5704 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 5705 xmlResetLastError(); 5706 if (mem_base != xmlMemBlocks()) { 5707 printf("Leak of %d blocks found in xmlACatalogRemove", 5708 xmlMemBlocks() - mem_base); 5709 test_ret++; 5710 printf(" %d", n_catal); 5711 printf(" %d", n_value); 5712 printf("\n"); 5713 } 5714 } 5715 } 5716 function_tests++; 5717 #endif 5718 5719 return(test_ret); 5720 } 5721 5722 5723 static int 5724 test_xmlACatalogResolve(void) { 5725 int test_ret = 0; 5726 5727 #if defined(LIBXML_CATALOG_ENABLED) 5728 int mem_base; 5729 xmlChar * ret_val; 5730 xmlCatalogPtr catal; /* a Catalog */ 5731 int n_catal; 5732 xmlChar * pubID; /* the public ID string */ 5733 int n_pubID; 5734 xmlChar * sysID; /* the system ID string */ 5735 int n_sysID; 5736 5737 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5738 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 5739 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 5740 mem_base = xmlMemBlocks(); 5741 catal = gen_xmlCatalogPtr(n_catal, 0); 5742 pubID = gen_const_xmlChar_ptr(n_pubID, 1); 5743 sysID = gen_const_xmlChar_ptr(n_sysID, 2); 5744 5745 ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID); 5746 desret_xmlChar_ptr(ret_val); 5747 call_tests++; 5748 des_xmlCatalogPtr(n_catal, catal, 0); 5749 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); 5750 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2); 5751 xmlResetLastError(); 5752 if (mem_base != xmlMemBlocks()) { 5753 printf("Leak of %d blocks found in xmlACatalogResolve", 5754 xmlMemBlocks() - mem_base); 5755 test_ret++; 5756 printf(" %d", n_catal); 5757 printf(" %d", n_pubID); 5758 printf(" %d", n_sysID); 5759 printf("\n"); 5760 } 5761 } 5762 } 5763 } 5764 function_tests++; 5765 #endif 5766 5767 return(test_ret); 5768 } 5769 5770 5771 static int 5772 test_xmlACatalogResolvePublic(void) { 5773 int test_ret = 0; 5774 5775 #if defined(LIBXML_CATALOG_ENABLED) 5776 int mem_base; 5777 xmlChar * ret_val; 5778 xmlCatalogPtr catal; /* a Catalog */ 5779 int n_catal; 5780 xmlChar * pubID; /* the public ID string */ 5781 int n_pubID; 5782 5783 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5784 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 5785 mem_base = xmlMemBlocks(); 5786 catal = gen_xmlCatalogPtr(n_catal, 0); 5787 pubID = gen_const_xmlChar_ptr(n_pubID, 1); 5788 5789 ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID); 5790 desret_xmlChar_ptr(ret_val); 5791 call_tests++; 5792 des_xmlCatalogPtr(n_catal, catal, 0); 5793 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); 5794 xmlResetLastError(); 5795 if (mem_base != xmlMemBlocks()) { 5796 printf("Leak of %d blocks found in xmlACatalogResolvePublic", 5797 xmlMemBlocks() - mem_base); 5798 test_ret++; 5799 printf(" %d", n_catal); 5800 printf(" %d", n_pubID); 5801 printf("\n"); 5802 } 5803 } 5804 } 5805 function_tests++; 5806 #endif 5807 5808 return(test_ret); 5809 } 5810 5811 5812 static int 5813 test_xmlACatalogResolveSystem(void) { 5814 int test_ret = 0; 5815 5816 #if defined(LIBXML_CATALOG_ENABLED) 5817 int mem_base; 5818 xmlChar * ret_val; 5819 xmlCatalogPtr catal; /* a Catalog */ 5820 int n_catal; 5821 xmlChar * sysID; /* the system ID string */ 5822 int n_sysID; 5823 5824 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5825 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 5826 mem_base = xmlMemBlocks(); 5827 catal = gen_xmlCatalogPtr(n_catal, 0); 5828 sysID = gen_const_xmlChar_ptr(n_sysID, 1); 5829 5830 ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID); 5831 desret_xmlChar_ptr(ret_val); 5832 call_tests++; 5833 des_xmlCatalogPtr(n_catal, catal, 0); 5834 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1); 5835 xmlResetLastError(); 5836 if (mem_base != xmlMemBlocks()) { 5837 printf("Leak of %d blocks found in xmlACatalogResolveSystem", 5838 xmlMemBlocks() - mem_base); 5839 test_ret++; 5840 printf(" %d", n_catal); 5841 printf(" %d", n_sysID); 5842 printf("\n"); 5843 } 5844 } 5845 } 5846 function_tests++; 5847 #endif 5848 5849 return(test_ret); 5850 } 5851 5852 5853 static int 5854 test_xmlACatalogResolveURI(void) { 5855 int test_ret = 0; 5856 5857 #if defined(LIBXML_CATALOG_ENABLED) 5858 int mem_base; 5859 xmlChar * ret_val; 5860 xmlCatalogPtr catal; /* a Catalog */ 5861 int n_catal; 5862 xmlChar * URI; /* the URI */ 5863 int n_URI; 5864 5865 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5866 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 5867 mem_base = xmlMemBlocks(); 5868 catal = gen_xmlCatalogPtr(n_catal, 0); 5869 URI = gen_const_xmlChar_ptr(n_URI, 1); 5870 5871 ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI); 5872 desret_xmlChar_ptr(ret_val); 5873 call_tests++; 5874 des_xmlCatalogPtr(n_catal, catal, 0); 5875 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1); 5876 xmlResetLastError(); 5877 if (mem_base != xmlMemBlocks()) { 5878 printf("Leak of %d blocks found in xmlACatalogResolveURI", 5879 xmlMemBlocks() - mem_base); 5880 test_ret++; 5881 printf(" %d", n_catal); 5882 printf(" %d", n_URI); 5883 printf("\n"); 5884 } 5885 } 5886 } 5887 function_tests++; 5888 #endif 5889 5890 return(test_ret); 5891 } 5892 5893 5894 static int 5895 test_xmlCatalogAdd(void) { 5896 int test_ret = 0; 5897 5898 #if defined(LIBXML_CATALOG_ENABLED) 5899 int mem_base; 5900 int ret_val; 5901 xmlChar * type; /* the type of record to add to the catalog */ 5902 int n_type; 5903 xmlChar * orig; /* the system, public or prefix to match */ 5904 int n_orig; 5905 xmlChar * replace; /* the replacement value for the match */ 5906 int n_replace; 5907 5908 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { 5909 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { 5910 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { 5911 mem_base = xmlMemBlocks(); 5912 type = gen_const_xmlChar_ptr(n_type, 0); 5913 orig = gen_const_xmlChar_ptr(n_orig, 1); 5914 replace = gen_const_xmlChar_ptr(n_replace, 2); 5915 5916 ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace); 5917 desret_int(ret_val); 5918 call_tests++; 5919 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0); 5920 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1); 5921 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2); 5922 xmlResetLastError(); 5923 if (mem_base != xmlMemBlocks()) { 5924 printf("Leak of %d blocks found in xmlCatalogAdd", 5925 xmlMemBlocks() - mem_base); 5926 test_ret++; 5927 printf(" %d", n_type); 5928 printf(" %d", n_orig); 5929 printf(" %d", n_replace); 5930 printf("\n"); 5931 } 5932 } 5933 } 5934 } 5935 function_tests++; 5936 #endif 5937 5938 return(test_ret); 5939 } 5940 5941 5942 static int 5943 test_xmlCatalogCleanup(void) { 5944 int test_ret = 0; 5945 5946 #if defined(LIBXML_CATALOG_ENABLED) 5947 5948 5949 xmlCatalogCleanup(); 5950 call_tests++; 5951 xmlResetLastError(); 5952 function_tests++; 5953 #endif 5954 5955 return(test_ret); 5956 } 5957 5958 5959 static int 5960 test_xmlCatalogConvert(void) { 5961 int test_ret = 0; 5962 5963 #if defined(LIBXML_CATALOG_ENABLED) 5964 int ret_val; 5965 5966 5967 ret_val = xmlCatalogConvert(); 5968 desret_int(ret_val); 5969 call_tests++; 5970 xmlResetLastError(); 5971 function_tests++; 5972 #endif 5973 5974 return(test_ret); 5975 } 5976 5977 5978 static int 5979 test_xmlCatalogDump(void) { 5980 int test_ret = 0; 5981 5982 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5983 int mem_base; 5984 FILE * out; /* the file. */ 5985 int n_out; 5986 5987 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 5988 mem_base = xmlMemBlocks(); 5989 out = gen_FILE_ptr(n_out, 0); 5990 5991 xmlCatalogDump(out); 5992 call_tests++; 5993 des_FILE_ptr(n_out, out, 0); 5994 xmlResetLastError(); 5995 if (mem_base != xmlMemBlocks()) { 5996 printf("Leak of %d blocks found in xmlCatalogDump", 5997 xmlMemBlocks() - mem_base); 5998 test_ret++; 5999 printf(" %d", n_out); 6000 printf("\n"); 6001 } 6002 } 6003 function_tests++; 6004 #endif 6005 6006 return(test_ret); 6007 } 6008 6009 6010 static int 6011 test_xmlCatalogGetDefaults(void) { 6012 int test_ret = 0; 6013 6014 #if defined(LIBXML_CATALOG_ENABLED) 6015 int mem_base; 6016 xmlCatalogAllow ret_val; 6017 6018 mem_base = xmlMemBlocks(); 6019 6020 ret_val = xmlCatalogGetDefaults(); 6021 desret_xmlCatalogAllow(ret_val); 6022 call_tests++; 6023 xmlResetLastError(); 6024 if (mem_base != xmlMemBlocks()) { 6025 printf("Leak of %d blocks found in xmlCatalogGetDefaults", 6026 xmlMemBlocks() - mem_base); 6027 test_ret++; 6028 printf("\n"); 6029 } 6030 function_tests++; 6031 #endif 6032 6033 return(test_ret); 6034 } 6035 6036 6037 static int 6038 test_xmlCatalogIsEmpty(void) { 6039 int test_ret = 0; 6040 6041 #if defined(LIBXML_CATALOG_ENABLED) 6042 int mem_base; 6043 int ret_val; 6044 xmlCatalogPtr catal; /* should this create an SGML catalog */ 6045 int n_catal; 6046 6047 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 6048 mem_base = xmlMemBlocks(); 6049 catal = gen_xmlCatalogPtr(n_catal, 0); 6050 6051 ret_val = xmlCatalogIsEmpty(catal); 6052 desret_int(ret_val); 6053 call_tests++; 6054 des_xmlCatalogPtr(n_catal, catal, 0); 6055 xmlResetLastError(); 6056 if (mem_base != xmlMemBlocks()) { 6057 printf("Leak of %d blocks found in xmlCatalogIsEmpty", 6058 xmlMemBlocks() - mem_base); 6059 test_ret++; 6060 printf(" %d", n_catal); 6061 printf("\n"); 6062 } 6063 } 6064 function_tests++; 6065 #endif 6066 6067 return(test_ret); 6068 } 6069 6070 6071 static int 6072 test_xmlCatalogLocalResolve(void) { 6073 int test_ret = 0; 6074 6075 #if defined(LIBXML_CATALOG_ENABLED) 6076 int mem_base; 6077 xmlChar * ret_val; 6078 void * catalogs; /* a document's list of catalogs */ 6079 int n_catalogs; 6080 xmlChar * pubID; /* the public ID string */ 6081 int n_pubID; 6082 xmlChar * sysID; /* the system ID string */ 6083 int n_sysID; 6084 6085 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) { 6086 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 6087 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 6088 mem_base = xmlMemBlocks(); 6089 catalogs = gen_void_ptr(n_catalogs, 0); 6090 pubID = gen_const_xmlChar_ptr(n_pubID, 1); 6091 sysID = gen_const_xmlChar_ptr(n_sysID, 2); 6092 6093 ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID); 6094 desret_xmlChar_ptr(ret_val); 6095 call_tests++; 6096 des_void_ptr(n_catalogs, catalogs, 0); 6097 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); 6098 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2); 6099 xmlResetLastError(); 6100 if (mem_base != xmlMemBlocks()) { 6101 printf("Leak of %d blocks found in xmlCatalogLocalResolve", 6102 xmlMemBlocks() - mem_base); 6103 test_ret++; 6104 printf(" %d", n_catalogs); 6105 printf(" %d", n_pubID); 6106 printf(" %d", n_sysID); 6107 printf("\n"); 6108 } 6109 } 6110 } 6111 } 6112 function_tests++; 6113 #endif 6114 6115 return(test_ret); 6116 } 6117 6118 6119 static int 6120 test_xmlCatalogLocalResolveURI(void) { 6121 int test_ret = 0; 6122 6123 #if defined(LIBXML_CATALOG_ENABLED) 6124 int mem_base; 6125 xmlChar * ret_val; 6126 void * catalogs; /* a document's list of catalogs */ 6127 int n_catalogs; 6128 xmlChar * URI; /* the URI */ 6129 int n_URI; 6130 6131 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) { 6132 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 6133 mem_base = xmlMemBlocks(); 6134 catalogs = gen_void_ptr(n_catalogs, 0); 6135 URI = gen_const_xmlChar_ptr(n_URI, 1); 6136 6137 ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI); 6138 desret_xmlChar_ptr(ret_val); 6139 call_tests++; 6140 des_void_ptr(n_catalogs, catalogs, 0); 6141 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1); 6142 xmlResetLastError(); 6143 if (mem_base != xmlMemBlocks()) { 6144 printf("Leak of %d blocks found in xmlCatalogLocalResolveURI", 6145 xmlMemBlocks() - mem_base); 6146 test_ret++; 6147 printf(" %d", n_catalogs); 6148 printf(" %d", n_URI); 6149 printf("\n"); 6150 } 6151 } 6152 } 6153 function_tests++; 6154 #endif 6155 6156 return(test_ret); 6157 } 6158 6159 6160 static int 6161 test_xmlCatalogRemove(void) { 6162 int test_ret = 0; 6163 6164 #if defined(LIBXML_CATALOG_ENABLED) 6165 int ret_val; 6166 xmlChar * value; /* the value to remove */ 6167 int n_value; 6168 6169 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 6170 value = gen_const_xmlChar_ptr(n_value, 0); 6171 6172 ret_val = xmlCatalogRemove((const xmlChar *)value); 6173 desret_int(ret_val); 6174 call_tests++; 6175 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 6176 xmlResetLastError(); 6177 } 6178 function_tests++; 6179 #endif 6180 6181 return(test_ret); 6182 } 6183 6184 6185 static int 6186 test_xmlCatalogResolve(void) { 6187 int test_ret = 0; 6188 6189 #if defined(LIBXML_CATALOG_ENABLED) 6190 xmlChar * ret_val; 6191 xmlChar * pubID; /* the public ID string */ 6192 int n_pubID; 6193 xmlChar * sysID; /* the system ID string */ 6194 int n_sysID; 6195 6196 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 6197 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 6198 pubID = gen_const_xmlChar_ptr(n_pubID, 0); 6199 sysID = gen_const_xmlChar_ptr(n_sysID, 1); 6200 6201 ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID); 6202 desret_xmlChar_ptr(ret_val); 6203 call_tests++; 6204 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0); 6205 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1); 6206 xmlResetLastError(); 6207 } 6208 } 6209 function_tests++; 6210 #endif 6211 6212 return(test_ret); 6213 } 6214 6215 6216 static int 6217 test_xmlCatalogResolvePublic(void) { 6218 int test_ret = 0; 6219 6220 #if defined(LIBXML_CATALOG_ENABLED) 6221 int mem_base; 6222 xmlChar * ret_val; 6223 xmlChar * pubID; /* the public ID string */ 6224 int n_pubID; 6225 6226 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 6227 mem_base = xmlMemBlocks(); 6228 pubID = gen_const_xmlChar_ptr(n_pubID, 0); 6229 6230 ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID); 6231 desret_xmlChar_ptr(ret_val); 6232 call_tests++; 6233 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0); 6234 xmlResetLastError(); 6235 if (mem_base != xmlMemBlocks()) { 6236 printf("Leak of %d blocks found in xmlCatalogResolvePublic", 6237 xmlMemBlocks() - mem_base); 6238 test_ret++; 6239 printf(" %d", n_pubID); 6240 printf("\n"); 6241 } 6242 } 6243 function_tests++; 6244 #endif 6245 6246 return(test_ret); 6247 } 6248 6249 6250 static int 6251 test_xmlCatalogResolveSystem(void) { 6252 int test_ret = 0; 6253 6254 #if defined(LIBXML_CATALOG_ENABLED) 6255 int mem_base; 6256 xmlChar * ret_val; 6257 xmlChar * sysID; /* the system ID string */ 6258 int n_sysID; 6259 6260 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 6261 mem_base = xmlMemBlocks(); 6262 sysID = gen_const_xmlChar_ptr(n_sysID, 0); 6263 6264 ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID); 6265 desret_xmlChar_ptr(ret_val); 6266 call_tests++; 6267 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0); 6268 xmlResetLastError(); 6269 if (mem_base != xmlMemBlocks()) { 6270 printf("Leak of %d blocks found in xmlCatalogResolveSystem", 6271 xmlMemBlocks() - mem_base); 6272 test_ret++; 6273 printf(" %d", n_sysID); 6274 printf("\n"); 6275 } 6276 } 6277 function_tests++; 6278 #endif 6279 6280 return(test_ret); 6281 } 6282 6283 6284 static int 6285 test_xmlCatalogResolveURI(void) { 6286 int test_ret = 0; 6287 6288 #if defined(LIBXML_CATALOG_ENABLED) 6289 int mem_base; 6290 xmlChar * ret_val; 6291 xmlChar * URI; /* the URI */ 6292 int n_URI; 6293 6294 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 6295 mem_base = xmlMemBlocks(); 6296 URI = gen_const_xmlChar_ptr(n_URI, 0); 6297 6298 ret_val = xmlCatalogResolveURI((const xmlChar *)URI); 6299 desret_xmlChar_ptr(ret_val); 6300 call_tests++; 6301 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 6302 xmlResetLastError(); 6303 if (mem_base != xmlMemBlocks()) { 6304 printf("Leak of %d blocks found in xmlCatalogResolveURI", 6305 xmlMemBlocks() - mem_base); 6306 test_ret++; 6307 printf(" %d", n_URI); 6308 printf("\n"); 6309 } 6310 } 6311 function_tests++; 6312 #endif 6313 6314 return(test_ret); 6315 } 6316 6317 6318 static int 6319 test_xmlCatalogSetDefaultPrefer(void) { 6320 int test_ret = 0; 6321 6322 #if defined(LIBXML_CATALOG_ENABLED) 6323 int mem_base; 6324 xmlCatalogPrefer ret_val; 6325 xmlCatalogPrefer prefer; /* the default preference for delegation */ 6326 int n_prefer; 6327 6328 for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) { 6329 mem_base = xmlMemBlocks(); 6330 prefer = gen_xmlCatalogPrefer(n_prefer, 0); 6331 6332 ret_val = xmlCatalogSetDefaultPrefer(prefer); 6333 desret_xmlCatalogPrefer(ret_val); 6334 call_tests++; 6335 des_xmlCatalogPrefer(n_prefer, prefer, 0); 6336 xmlResetLastError(); 6337 if (mem_base != xmlMemBlocks()) { 6338 printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer", 6339 xmlMemBlocks() - mem_base); 6340 test_ret++; 6341 printf(" %d", n_prefer); 6342 printf("\n"); 6343 } 6344 } 6345 function_tests++; 6346 #endif 6347 6348 return(test_ret); 6349 } 6350 6351 6352 static int 6353 test_xmlCatalogSetDefaults(void) { 6354 int test_ret = 0; 6355 6356 #if defined(LIBXML_CATALOG_ENABLED) 6357 int mem_base; 6358 xmlCatalogAllow allow; /* what catalogs should be accepted */ 6359 int n_allow; 6360 6361 for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) { 6362 mem_base = xmlMemBlocks(); 6363 allow = gen_xmlCatalogAllow(n_allow, 0); 6364 6365 xmlCatalogSetDefaults(allow); 6366 call_tests++; 6367 des_xmlCatalogAllow(n_allow, allow, 0); 6368 xmlResetLastError(); 6369 if (mem_base != xmlMemBlocks()) { 6370 printf("Leak of %d blocks found in xmlCatalogSetDefaults", 6371 xmlMemBlocks() - mem_base); 6372 test_ret++; 6373 printf(" %d", n_allow); 6374 printf("\n"); 6375 } 6376 } 6377 function_tests++; 6378 #endif 6379 6380 return(test_ret); 6381 } 6382 6383 6384 static int 6385 test_xmlConvertSGMLCatalog(void) { 6386 int test_ret = 0; 6387 6388 #if defined(LIBXML_CATALOG_ENABLED) 6389 int mem_base; 6390 int ret_val; 6391 xmlCatalogPtr catal; /* the catalog */ 6392 int n_catal; 6393 6394 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 6395 mem_base = xmlMemBlocks(); 6396 catal = gen_xmlCatalogPtr(n_catal, 0); 6397 6398 ret_val = xmlConvertSGMLCatalog(catal); 6399 desret_int(ret_val); 6400 call_tests++; 6401 des_xmlCatalogPtr(n_catal, catal, 0); 6402 xmlResetLastError(); 6403 if (mem_base != xmlMemBlocks()) { 6404 printf("Leak of %d blocks found in xmlConvertSGMLCatalog", 6405 xmlMemBlocks() - mem_base); 6406 test_ret++; 6407 printf(" %d", n_catal); 6408 printf("\n"); 6409 } 6410 } 6411 function_tests++; 6412 #endif 6413 6414 return(test_ret); 6415 } 6416 6417 6418 static int 6419 test_xmlInitializeCatalog(void) { 6420 int test_ret = 0; 6421 6422 #if defined(LIBXML_CATALOG_ENABLED) 6423 int mem_base; 6424 6425 mem_base = xmlMemBlocks(); 6426 6427 xmlInitializeCatalog(); 6428 call_tests++; 6429 xmlResetLastError(); 6430 if (mem_base != xmlMemBlocks()) { 6431 printf("Leak of %d blocks found in xmlInitializeCatalog", 6432 xmlMemBlocks() - mem_base); 6433 test_ret++; 6434 printf("\n"); 6435 } 6436 function_tests++; 6437 #endif 6438 6439 return(test_ret); 6440 } 6441 6442 6443 static int 6444 test_xmlLoadACatalog(void) { 6445 int test_ret = 0; 6446 6447 6448 /* missing type support */ 6449 return(test_ret); 6450 } 6451 6452 6453 static int 6454 test_xmlLoadCatalog(void) { 6455 int test_ret = 0; 6456 6457 #if defined(LIBXML_CATALOG_ENABLED) 6458 int ret_val; 6459 const char * filename; /* a file path */ 6460 int n_filename; 6461 6462 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 6463 filename = gen_filepath(n_filename, 0); 6464 6465 ret_val = xmlLoadCatalog(filename); 6466 desret_int(ret_val); 6467 call_tests++; 6468 des_filepath(n_filename, filename, 0); 6469 xmlResetLastError(); 6470 } 6471 function_tests++; 6472 #endif 6473 6474 return(test_ret); 6475 } 6476 6477 6478 static int 6479 test_xmlLoadCatalogs(void) { 6480 int test_ret = 0; 6481 6482 #if defined(LIBXML_CATALOG_ENABLED) 6483 char * pathss; /* a list of directories separated by a colon or a space. */ 6484 int n_pathss; 6485 6486 for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) { 6487 pathss = gen_const_char_ptr(n_pathss, 0); 6488 6489 xmlLoadCatalogs((const char *)pathss); 6490 call_tests++; 6491 des_const_char_ptr(n_pathss, (const char *)pathss, 0); 6492 xmlResetLastError(); 6493 } 6494 function_tests++; 6495 #endif 6496 6497 return(test_ret); 6498 } 6499 6500 6501 static int 6502 test_xmlLoadSGMLSuperCatalog(void) { 6503 int test_ret = 0; 6504 6505 6506 /* missing type support */ 6507 return(test_ret); 6508 } 6509 6510 6511 static int 6512 test_xmlNewCatalog(void) { 6513 int test_ret = 0; 6514 6515 6516 /* missing type support */ 6517 return(test_ret); 6518 } 6519 6520 6521 static int 6522 test_xmlParseCatalogFile(void) { 6523 int test_ret = 0; 6524 6525 #if defined(LIBXML_CATALOG_ENABLED) 6526 int mem_base; 6527 xmlDocPtr ret_val; 6528 const char * filename; /* the filename */ 6529 int n_filename; 6530 6531 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 6532 mem_base = xmlMemBlocks(); 6533 filename = gen_filepath(n_filename, 0); 6534 6535 ret_val = xmlParseCatalogFile(filename); 6536 desret_xmlDocPtr(ret_val); 6537 call_tests++; 6538 des_filepath(n_filename, filename, 0); 6539 xmlResetLastError(); 6540 if (mem_base != xmlMemBlocks()) { 6541 printf("Leak of %d blocks found in xmlParseCatalogFile", 6542 xmlMemBlocks() - mem_base); 6543 test_ret++; 6544 printf(" %d", n_filename); 6545 printf("\n"); 6546 } 6547 } 6548 function_tests++; 6549 #endif 6550 6551 return(test_ret); 6552 } 6553 6554 static int 6555 test_catalog(void) { 6556 int test_ret = 0; 6557 6558 if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n"); 6559 test_ret += test_xmlACatalogAdd(); 6560 test_ret += test_xmlACatalogDump(); 6561 test_ret += test_xmlACatalogRemove(); 6562 test_ret += test_xmlACatalogResolve(); 6563 test_ret += test_xmlACatalogResolvePublic(); 6564 test_ret += test_xmlACatalogResolveSystem(); 6565 test_ret += test_xmlACatalogResolveURI(); 6566 test_ret += test_xmlCatalogAdd(); 6567 test_ret += test_xmlCatalogCleanup(); 6568 test_ret += test_xmlCatalogConvert(); 6569 test_ret += test_xmlCatalogDump(); 6570 test_ret += test_xmlCatalogGetDefaults(); 6571 test_ret += test_xmlCatalogIsEmpty(); 6572 test_ret += test_xmlCatalogLocalResolve(); 6573 test_ret += test_xmlCatalogLocalResolveURI(); 6574 test_ret += test_xmlCatalogRemove(); 6575 test_ret += test_xmlCatalogResolve(); 6576 test_ret += test_xmlCatalogResolvePublic(); 6577 test_ret += test_xmlCatalogResolveSystem(); 6578 test_ret += test_xmlCatalogResolveURI(); 6579 test_ret += test_xmlCatalogSetDefaultPrefer(); 6580 test_ret += test_xmlCatalogSetDefaults(); 6581 test_ret += test_xmlConvertSGMLCatalog(); 6582 test_ret += test_xmlInitializeCatalog(); 6583 test_ret += test_xmlLoadACatalog(); 6584 test_ret += test_xmlLoadCatalog(); 6585 test_ret += test_xmlLoadCatalogs(); 6586 test_ret += test_xmlLoadSGMLSuperCatalog(); 6587 test_ret += test_xmlNewCatalog(); 6588 test_ret += test_xmlParseCatalogFile(); 6589 6590 if (test_ret != 0) 6591 printf("Module catalog: %d errors\n", test_ret); 6592 return(test_ret); 6593 } 6594 6595 #define gen_nb_const_xmlChRangeGroup_ptr 1 6596 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 6597 return(NULL); 6598 } 6599 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 6600 } 6601 6602 static int 6603 test_xmlCharInRange(void) { 6604 int test_ret = 0; 6605 6606 int mem_base; 6607 int ret_val; 6608 unsigned int val; /* character to be validated */ 6609 int n_val; 6610 xmlChRangeGroup * rptr; /* pointer to range to be used to validate */ 6611 int n_rptr; 6612 6613 for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) { 6614 for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) { 6615 mem_base = xmlMemBlocks(); 6616 val = gen_unsigned_int(n_val, 0); 6617 rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1); 6618 6619 ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr); 6620 desret_int(ret_val); 6621 call_tests++; 6622 des_unsigned_int(n_val, val, 0); 6623 des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1); 6624 xmlResetLastError(); 6625 if (mem_base != xmlMemBlocks()) { 6626 printf("Leak of %d blocks found in xmlCharInRange", 6627 xmlMemBlocks() - mem_base); 6628 test_ret++; 6629 printf(" %d", n_val); 6630 printf(" %d", n_rptr); 6631 printf("\n"); 6632 } 6633 } 6634 } 6635 function_tests++; 6636 6637 return(test_ret); 6638 } 6639 6640 6641 static int 6642 test_xmlIsBaseChar(void) { 6643 int test_ret = 0; 6644 6645 int mem_base; 6646 int ret_val; 6647 unsigned int ch; /* character to validate */ 6648 int n_ch; 6649 6650 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6651 mem_base = xmlMemBlocks(); 6652 ch = gen_unsigned_int(n_ch, 0); 6653 6654 ret_val = xmlIsBaseChar(ch); 6655 desret_int(ret_val); 6656 call_tests++; 6657 des_unsigned_int(n_ch, ch, 0); 6658 xmlResetLastError(); 6659 if (mem_base != xmlMemBlocks()) { 6660 printf("Leak of %d blocks found in xmlIsBaseChar", 6661 xmlMemBlocks() - mem_base); 6662 test_ret++; 6663 printf(" %d", n_ch); 6664 printf("\n"); 6665 } 6666 } 6667 function_tests++; 6668 6669 return(test_ret); 6670 } 6671 6672 6673 static int 6674 test_xmlIsBlank(void) { 6675 int test_ret = 0; 6676 6677 int mem_base; 6678 int ret_val; 6679 unsigned int ch; /* character to validate */ 6680 int n_ch; 6681 6682 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6683 mem_base = xmlMemBlocks(); 6684 ch = gen_unsigned_int(n_ch, 0); 6685 6686 ret_val = xmlIsBlank(ch); 6687 desret_int(ret_val); 6688 call_tests++; 6689 des_unsigned_int(n_ch, ch, 0); 6690 xmlResetLastError(); 6691 if (mem_base != xmlMemBlocks()) { 6692 printf("Leak of %d blocks found in xmlIsBlank", 6693 xmlMemBlocks() - mem_base); 6694 test_ret++; 6695 printf(" %d", n_ch); 6696 printf("\n"); 6697 } 6698 } 6699 function_tests++; 6700 6701 return(test_ret); 6702 } 6703 6704 6705 static int 6706 test_xmlIsChar(void) { 6707 int test_ret = 0; 6708 6709 int mem_base; 6710 int ret_val; 6711 unsigned int ch; /* character to validate */ 6712 int n_ch; 6713 6714 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6715 mem_base = xmlMemBlocks(); 6716 ch = gen_unsigned_int(n_ch, 0); 6717 6718 ret_val = xmlIsChar(ch); 6719 desret_int(ret_val); 6720 call_tests++; 6721 des_unsigned_int(n_ch, ch, 0); 6722 xmlResetLastError(); 6723 if (mem_base != xmlMemBlocks()) { 6724 printf("Leak of %d blocks found in xmlIsChar", 6725 xmlMemBlocks() - mem_base); 6726 test_ret++; 6727 printf(" %d", n_ch); 6728 printf("\n"); 6729 } 6730 } 6731 function_tests++; 6732 6733 return(test_ret); 6734 } 6735 6736 6737 static int 6738 test_xmlIsCombining(void) { 6739 int test_ret = 0; 6740 6741 int mem_base; 6742 int ret_val; 6743 unsigned int ch; /* character to validate */ 6744 int n_ch; 6745 6746 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6747 mem_base = xmlMemBlocks(); 6748 ch = gen_unsigned_int(n_ch, 0); 6749 6750 ret_val = xmlIsCombining(ch); 6751 desret_int(ret_val); 6752 call_tests++; 6753 des_unsigned_int(n_ch, ch, 0); 6754 xmlResetLastError(); 6755 if (mem_base != xmlMemBlocks()) { 6756 printf("Leak of %d blocks found in xmlIsCombining", 6757 xmlMemBlocks() - mem_base); 6758 test_ret++; 6759 printf(" %d", n_ch); 6760 printf("\n"); 6761 } 6762 } 6763 function_tests++; 6764 6765 return(test_ret); 6766 } 6767 6768 6769 static int 6770 test_xmlIsDigit(void) { 6771 int test_ret = 0; 6772 6773 int mem_base; 6774 int ret_val; 6775 unsigned int ch; /* character to validate */ 6776 int n_ch; 6777 6778 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6779 mem_base = xmlMemBlocks(); 6780 ch = gen_unsigned_int(n_ch, 0); 6781 6782 ret_val = xmlIsDigit(ch); 6783 desret_int(ret_val); 6784 call_tests++; 6785 des_unsigned_int(n_ch, ch, 0); 6786 xmlResetLastError(); 6787 if (mem_base != xmlMemBlocks()) { 6788 printf("Leak of %d blocks found in xmlIsDigit", 6789 xmlMemBlocks() - mem_base); 6790 test_ret++; 6791 printf(" %d", n_ch); 6792 printf("\n"); 6793 } 6794 } 6795 function_tests++; 6796 6797 return(test_ret); 6798 } 6799 6800 6801 static int 6802 test_xmlIsExtender(void) { 6803 int test_ret = 0; 6804 6805 int mem_base; 6806 int ret_val; 6807 unsigned int ch; /* character to validate */ 6808 int n_ch; 6809 6810 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6811 mem_base = xmlMemBlocks(); 6812 ch = gen_unsigned_int(n_ch, 0); 6813 6814 ret_val = xmlIsExtender(ch); 6815 desret_int(ret_val); 6816 call_tests++; 6817 des_unsigned_int(n_ch, ch, 0); 6818 xmlResetLastError(); 6819 if (mem_base != xmlMemBlocks()) { 6820 printf("Leak of %d blocks found in xmlIsExtender", 6821 xmlMemBlocks() - mem_base); 6822 test_ret++; 6823 printf(" %d", n_ch); 6824 printf("\n"); 6825 } 6826 } 6827 function_tests++; 6828 6829 return(test_ret); 6830 } 6831 6832 6833 static int 6834 test_xmlIsIdeographic(void) { 6835 int test_ret = 0; 6836 6837 int mem_base; 6838 int ret_val; 6839 unsigned int ch; /* character to validate */ 6840 int n_ch; 6841 6842 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6843 mem_base = xmlMemBlocks(); 6844 ch = gen_unsigned_int(n_ch, 0); 6845 6846 ret_val = xmlIsIdeographic(ch); 6847 desret_int(ret_val); 6848 call_tests++; 6849 des_unsigned_int(n_ch, ch, 0); 6850 xmlResetLastError(); 6851 if (mem_base != xmlMemBlocks()) { 6852 printf("Leak of %d blocks found in xmlIsIdeographic", 6853 xmlMemBlocks() - mem_base); 6854 test_ret++; 6855 printf(" %d", n_ch); 6856 printf("\n"); 6857 } 6858 } 6859 function_tests++; 6860 6861 return(test_ret); 6862 } 6863 6864 6865 static int 6866 test_xmlIsPubidChar(void) { 6867 int test_ret = 0; 6868 6869 int mem_base; 6870 int ret_val; 6871 unsigned int ch; /* character to validate */ 6872 int n_ch; 6873 6874 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6875 mem_base = xmlMemBlocks(); 6876 ch = gen_unsigned_int(n_ch, 0); 6877 6878 ret_val = xmlIsPubidChar(ch); 6879 desret_int(ret_val); 6880 call_tests++; 6881 des_unsigned_int(n_ch, ch, 0); 6882 xmlResetLastError(); 6883 if (mem_base != xmlMemBlocks()) { 6884 printf("Leak of %d blocks found in xmlIsPubidChar", 6885 xmlMemBlocks() - mem_base); 6886 test_ret++; 6887 printf(" %d", n_ch); 6888 printf("\n"); 6889 } 6890 } 6891 function_tests++; 6892 6893 return(test_ret); 6894 } 6895 6896 static int 6897 test_chvalid(void) { 6898 int test_ret = 0; 6899 6900 if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n"); 6901 test_ret += test_xmlCharInRange(); 6902 test_ret += test_xmlIsBaseChar(); 6903 test_ret += test_xmlIsBlank(); 6904 test_ret += test_xmlIsChar(); 6905 test_ret += test_xmlIsCombining(); 6906 test_ret += test_xmlIsDigit(); 6907 test_ret += test_xmlIsExtender(); 6908 test_ret += test_xmlIsIdeographic(); 6909 test_ret += test_xmlIsPubidChar(); 6910 6911 if (test_ret != 0) 6912 printf("Module chvalid: %d errors\n", test_ret); 6913 return(test_ret); 6914 } 6915 6916 static int 6917 test_xmlBoolToText(void) { 6918 int test_ret = 0; 6919 6920 #if defined(LIBXML_DEBUG_ENABLED) 6921 int mem_base; 6922 const char * ret_val; 6923 int boolval; /* a bool to turn into text */ 6924 int n_boolval; 6925 6926 for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) { 6927 mem_base = xmlMemBlocks(); 6928 boolval = gen_int(n_boolval, 0); 6929 6930 ret_val = xmlBoolToText(boolval); 6931 desret_const_char_ptr(ret_val); 6932 call_tests++; 6933 des_int(n_boolval, boolval, 0); 6934 xmlResetLastError(); 6935 if (mem_base != xmlMemBlocks()) { 6936 printf("Leak of %d blocks found in xmlBoolToText", 6937 xmlMemBlocks() - mem_base); 6938 test_ret++; 6939 printf(" %d", n_boolval); 6940 printf("\n"); 6941 } 6942 } 6943 function_tests++; 6944 #endif 6945 6946 return(test_ret); 6947 } 6948 6949 6950 static int 6951 test_xmlDebugCheckDocument(void) { 6952 int test_ret = 0; 6953 6954 #if defined(LIBXML_DEBUG_ENABLED) 6955 int mem_base; 6956 int ret_val; 6957 FILE * output; /* the FILE * for the output */ 6958 int n_output; 6959 xmlDocPtr doc; /* the document */ 6960 int n_doc; 6961 6962 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 6963 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 6964 mem_base = xmlMemBlocks(); 6965 output = gen_debug_FILE_ptr(n_output, 0); 6966 doc = gen_xmlDocPtr(n_doc, 1); 6967 6968 ret_val = xmlDebugCheckDocument(output, doc); 6969 desret_int(ret_val); 6970 call_tests++; 6971 des_debug_FILE_ptr(n_output, output, 0); 6972 des_xmlDocPtr(n_doc, doc, 1); 6973 xmlResetLastError(); 6974 if (mem_base != xmlMemBlocks()) { 6975 printf("Leak of %d blocks found in xmlDebugCheckDocument", 6976 xmlMemBlocks() - mem_base); 6977 test_ret++; 6978 printf(" %d", n_output); 6979 printf(" %d", n_doc); 6980 printf("\n"); 6981 } 6982 } 6983 } 6984 function_tests++; 6985 #endif 6986 6987 return(test_ret); 6988 } 6989 6990 6991 static int 6992 test_xmlDebugDumpAttr(void) { 6993 int test_ret = 0; 6994 6995 #if defined(LIBXML_DEBUG_ENABLED) 6996 int mem_base; 6997 FILE * output; /* the FILE * for the output */ 6998 int n_output; 6999 xmlAttrPtr attr; /* the attribute */ 7000 int n_attr; 7001 int depth; /* the indentation level. */ 7002 int n_depth; 7003 7004 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7005 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 7006 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7007 mem_base = xmlMemBlocks(); 7008 output = gen_debug_FILE_ptr(n_output, 0); 7009 attr = gen_xmlAttrPtr(n_attr, 1); 7010 depth = gen_int(n_depth, 2); 7011 7012 xmlDebugDumpAttr(output, attr, depth); 7013 call_tests++; 7014 des_debug_FILE_ptr(n_output, output, 0); 7015 des_xmlAttrPtr(n_attr, attr, 1); 7016 des_int(n_depth, depth, 2); 7017 xmlResetLastError(); 7018 if (mem_base != xmlMemBlocks()) { 7019 printf("Leak of %d blocks found in xmlDebugDumpAttr", 7020 xmlMemBlocks() - mem_base); 7021 test_ret++; 7022 printf(" %d", n_output); 7023 printf(" %d", n_attr); 7024 printf(" %d", n_depth); 7025 printf("\n"); 7026 } 7027 } 7028 } 7029 } 7030 function_tests++; 7031 #endif 7032 7033 return(test_ret); 7034 } 7035 7036 7037 static int 7038 test_xmlDebugDumpAttrList(void) { 7039 int test_ret = 0; 7040 7041 #if defined(LIBXML_DEBUG_ENABLED) 7042 int mem_base; 7043 FILE * output; /* the FILE * for the output */ 7044 int n_output; 7045 xmlAttrPtr attr; /* the attribute list */ 7046 int n_attr; 7047 int depth; /* the indentation level. */ 7048 int n_depth; 7049 7050 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7051 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 7052 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7053 mem_base = xmlMemBlocks(); 7054 output = gen_debug_FILE_ptr(n_output, 0); 7055 attr = gen_xmlAttrPtr(n_attr, 1); 7056 depth = gen_int(n_depth, 2); 7057 7058 xmlDebugDumpAttrList(output, attr, depth); 7059 call_tests++; 7060 des_debug_FILE_ptr(n_output, output, 0); 7061 des_xmlAttrPtr(n_attr, attr, 1); 7062 des_int(n_depth, depth, 2); 7063 xmlResetLastError(); 7064 if (mem_base != xmlMemBlocks()) { 7065 printf("Leak of %d blocks found in xmlDebugDumpAttrList", 7066 xmlMemBlocks() - mem_base); 7067 test_ret++; 7068 printf(" %d", n_output); 7069 printf(" %d", n_attr); 7070 printf(" %d", n_depth); 7071 printf("\n"); 7072 } 7073 } 7074 } 7075 } 7076 function_tests++; 7077 #endif 7078 7079 return(test_ret); 7080 } 7081 7082 7083 static int 7084 test_xmlDebugDumpDTD(void) { 7085 int test_ret = 0; 7086 7087 #if defined(LIBXML_DEBUG_ENABLED) 7088 int mem_base; 7089 FILE * output; /* the FILE * for the output */ 7090 int n_output; 7091 xmlDtdPtr dtd; /* the DTD */ 7092 int n_dtd; 7093 7094 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7095 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 7096 mem_base = xmlMemBlocks(); 7097 output = gen_debug_FILE_ptr(n_output, 0); 7098 dtd = gen_xmlDtdPtr(n_dtd, 1); 7099 7100 xmlDebugDumpDTD(output, dtd); 7101 call_tests++; 7102 des_debug_FILE_ptr(n_output, output, 0); 7103 des_xmlDtdPtr(n_dtd, dtd, 1); 7104 xmlResetLastError(); 7105 if (mem_base != xmlMemBlocks()) { 7106 printf("Leak of %d blocks found in xmlDebugDumpDTD", 7107 xmlMemBlocks() - mem_base); 7108 test_ret++; 7109 printf(" %d", n_output); 7110 printf(" %d", n_dtd); 7111 printf("\n"); 7112 } 7113 } 7114 } 7115 function_tests++; 7116 #endif 7117 7118 return(test_ret); 7119 } 7120 7121 7122 static int 7123 test_xmlDebugDumpDocument(void) { 7124 int test_ret = 0; 7125 7126 #if defined(LIBXML_DEBUG_ENABLED) 7127 int mem_base; 7128 FILE * output; /* the FILE * for the output */ 7129 int n_output; 7130 xmlDocPtr doc; /* the document */ 7131 int n_doc; 7132 7133 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7134 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 7135 mem_base = xmlMemBlocks(); 7136 output = gen_debug_FILE_ptr(n_output, 0); 7137 doc = gen_xmlDocPtr(n_doc, 1); 7138 7139 xmlDebugDumpDocument(output, doc); 7140 call_tests++; 7141 des_debug_FILE_ptr(n_output, output, 0); 7142 des_xmlDocPtr(n_doc, doc, 1); 7143 xmlResetLastError(); 7144 if (mem_base != xmlMemBlocks()) { 7145 printf("Leak of %d blocks found in xmlDebugDumpDocument", 7146 xmlMemBlocks() - mem_base); 7147 test_ret++; 7148 printf(" %d", n_output); 7149 printf(" %d", n_doc); 7150 printf("\n"); 7151 } 7152 } 7153 } 7154 function_tests++; 7155 #endif 7156 7157 return(test_ret); 7158 } 7159 7160 7161 static int 7162 test_xmlDebugDumpDocumentHead(void) { 7163 int test_ret = 0; 7164 7165 #if defined(LIBXML_DEBUG_ENABLED) 7166 int mem_base; 7167 FILE * output; /* the FILE * for the output */ 7168 int n_output; 7169 xmlDocPtr doc; /* the document */ 7170 int n_doc; 7171 7172 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7173 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 7174 mem_base = xmlMemBlocks(); 7175 output = gen_debug_FILE_ptr(n_output, 0); 7176 doc = gen_xmlDocPtr(n_doc, 1); 7177 7178 xmlDebugDumpDocumentHead(output, doc); 7179 call_tests++; 7180 des_debug_FILE_ptr(n_output, output, 0); 7181 des_xmlDocPtr(n_doc, doc, 1); 7182 xmlResetLastError(); 7183 if (mem_base != xmlMemBlocks()) { 7184 printf("Leak of %d blocks found in xmlDebugDumpDocumentHead", 7185 xmlMemBlocks() - mem_base); 7186 test_ret++; 7187 printf(" %d", n_output); 7188 printf(" %d", n_doc); 7189 printf("\n"); 7190 } 7191 } 7192 } 7193 function_tests++; 7194 #endif 7195 7196 return(test_ret); 7197 } 7198 7199 7200 static int 7201 test_xmlDebugDumpEntities(void) { 7202 int test_ret = 0; 7203 7204 #if defined(LIBXML_DEBUG_ENABLED) 7205 int mem_base; 7206 FILE * output; /* the FILE * for the output */ 7207 int n_output; 7208 xmlDocPtr doc; /* the document */ 7209 int n_doc; 7210 7211 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7212 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 7213 mem_base = xmlMemBlocks(); 7214 output = gen_debug_FILE_ptr(n_output, 0); 7215 doc = gen_xmlDocPtr(n_doc, 1); 7216 7217 xmlDebugDumpEntities(output, doc); 7218 call_tests++; 7219 des_debug_FILE_ptr(n_output, output, 0); 7220 des_xmlDocPtr(n_doc, doc, 1); 7221 xmlResetLastError(); 7222 if (mem_base != xmlMemBlocks()) { 7223 printf("Leak of %d blocks found in xmlDebugDumpEntities", 7224 xmlMemBlocks() - mem_base); 7225 test_ret++; 7226 printf(" %d", n_output); 7227 printf(" %d", n_doc); 7228 printf("\n"); 7229 } 7230 } 7231 } 7232 function_tests++; 7233 #endif 7234 7235 return(test_ret); 7236 } 7237 7238 7239 static int 7240 test_xmlDebugDumpNode(void) { 7241 int test_ret = 0; 7242 7243 #if defined(LIBXML_DEBUG_ENABLED) 7244 int mem_base; 7245 FILE * output; /* the FILE * for the output */ 7246 int n_output; 7247 xmlNodePtr node; /* the node */ 7248 int n_node; 7249 int depth; /* the indentation level. */ 7250 int n_depth; 7251 7252 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7253 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7254 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7255 mem_base = xmlMemBlocks(); 7256 output = gen_debug_FILE_ptr(n_output, 0); 7257 node = gen_xmlNodePtr(n_node, 1); 7258 depth = gen_int(n_depth, 2); 7259 7260 xmlDebugDumpNode(output, node, depth); 7261 call_tests++; 7262 des_debug_FILE_ptr(n_output, output, 0); 7263 des_xmlNodePtr(n_node, node, 1); 7264 des_int(n_depth, depth, 2); 7265 xmlResetLastError(); 7266 if (mem_base != xmlMemBlocks()) { 7267 printf("Leak of %d blocks found in xmlDebugDumpNode", 7268 xmlMemBlocks() - mem_base); 7269 test_ret++; 7270 printf(" %d", n_output); 7271 printf(" %d", n_node); 7272 printf(" %d", n_depth); 7273 printf("\n"); 7274 } 7275 } 7276 } 7277 } 7278 function_tests++; 7279 #endif 7280 7281 return(test_ret); 7282 } 7283 7284 7285 static int 7286 test_xmlDebugDumpNodeList(void) { 7287 int test_ret = 0; 7288 7289 #if defined(LIBXML_DEBUG_ENABLED) 7290 int mem_base; 7291 FILE * output; /* the FILE * for the output */ 7292 int n_output; 7293 xmlNodePtr node; /* the node list */ 7294 int n_node; 7295 int depth; /* the indentation level. */ 7296 int n_depth; 7297 7298 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7299 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7300 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7301 mem_base = xmlMemBlocks(); 7302 output = gen_debug_FILE_ptr(n_output, 0); 7303 node = gen_xmlNodePtr(n_node, 1); 7304 depth = gen_int(n_depth, 2); 7305 7306 xmlDebugDumpNodeList(output, node, depth); 7307 call_tests++; 7308 des_debug_FILE_ptr(n_output, output, 0); 7309 des_xmlNodePtr(n_node, node, 1); 7310 des_int(n_depth, depth, 2); 7311 xmlResetLastError(); 7312 if (mem_base != xmlMemBlocks()) { 7313 printf("Leak of %d blocks found in xmlDebugDumpNodeList", 7314 xmlMemBlocks() - mem_base); 7315 test_ret++; 7316 printf(" %d", n_output); 7317 printf(" %d", n_node); 7318 printf(" %d", n_depth); 7319 printf("\n"); 7320 } 7321 } 7322 } 7323 } 7324 function_tests++; 7325 #endif 7326 7327 return(test_ret); 7328 } 7329 7330 7331 static int 7332 test_xmlDebugDumpOneNode(void) { 7333 int test_ret = 0; 7334 7335 #if defined(LIBXML_DEBUG_ENABLED) 7336 int mem_base; 7337 FILE * output; /* the FILE * for the output */ 7338 int n_output; 7339 xmlNodePtr node; /* the node */ 7340 int n_node; 7341 int depth; /* the indentation level. */ 7342 int n_depth; 7343 7344 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7345 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7346 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7347 mem_base = xmlMemBlocks(); 7348 output = gen_debug_FILE_ptr(n_output, 0); 7349 node = gen_xmlNodePtr(n_node, 1); 7350 depth = gen_int(n_depth, 2); 7351 7352 xmlDebugDumpOneNode(output, node, depth); 7353 call_tests++; 7354 des_debug_FILE_ptr(n_output, output, 0); 7355 des_xmlNodePtr(n_node, node, 1); 7356 des_int(n_depth, depth, 2); 7357 xmlResetLastError(); 7358 if (mem_base != xmlMemBlocks()) { 7359 printf("Leak of %d blocks found in xmlDebugDumpOneNode", 7360 xmlMemBlocks() - mem_base); 7361 test_ret++; 7362 printf(" %d", n_output); 7363 printf(" %d", n_node); 7364 printf(" %d", n_depth); 7365 printf("\n"); 7366 } 7367 } 7368 } 7369 } 7370 function_tests++; 7371 #endif 7372 7373 return(test_ret); 7374 } 7375 7376 7377 static int 7378 test_xmlDebugDumpString(void) { 7379 int test_ret = 0; 7380 7381 #if defined(LIBXML_DEBUG_ENABLED) 7382 int mem_base; 7383 FILE * output; /* the FILE * for the output */ 7384 int n_output; 7385 xmlChar * str; /* the string */ 7386 int n_str; 7387 7388 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7389 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 7390 mem_base = xmlMemBlocks(); 7391 output = gen_debug_FILE_ptr(n_output, 0); 7392 str = gen_const_xmlChar_ptr(n_str, 1); 7393 7394 xmlDebugDumpString(output, (const xmlChar *)str); 7395 call_tests++; 7396 des_debug_FILE_ptr(n_output, output, 0); 7397 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 7398 xmlResetLastError(); 7399 if (mem_base != xmlMemBlocks()) { 7400 printf("Leak of %d blocks found in xmlDebugDumpString", 7401 xmlMemBlocks() - mem_base); 7402 test_ret++; 7403 printf(" %d", n_output); 7404 printf(" %d", n_str); 7405 printf("\n"); 7406 } 7407 } 7408 } 7409 function_tests++; 7410 #endif 7411 7412 return(test_ret); 7413 } 7414 7415 7416 static int 7417 test_xmlLsCountNode(void) { 7418 int test_ret = 0; 7419 7420 #if defined(LIBXML_DEBUG_ENABLED) 7421 int mem_base; 7422 int ret_val; 7423 xmlNodePtr node; /* the node to count */ 7424 int n_node; 7425 7426 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7427 mem_base = xmlMemBlocks(); 7428 node = gen_xmlNodePtr(n_node, 0); 7429 7430 ret_val = xmlLsCountNode(node); 7431 desret_int(ret_val); 7432 call_tests++; 7433 des_xmlNodePtr(n_node, node, 0); 7434 xmlResetLastError(); 7435 if (mem_base != xmlMemBlocks()) { 7436 printf("Leak of %d blocks found in xmlLsCountNode", 7437 xmlMemBlocks() - mem_base); 7438 test_ret++; 7439 printf(" %d", n_node); 7440 printf("\n"); 7441 } 7442 } 7443 function_tests++; 7444 #endif 7445 7446 return(test_ret); 7447 } 7448 7449 7450 static int 7451 test_xmlLsOneNode(void) { 7452 int test_ret = 0; 7453 7454 #if defined(LIBXML_DEBUG_ENABLED) 7455 int mem_base; 7456 FILE * output; /* the FILE * for the output */ 7457 int n_output; 7458 xmlNodePtr node; /* the node to dump */ 7459 int n_node; 7460 7461 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7462 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7463 mem_base = xmlMemBlocks(); 7464 output = gen_debug_FILE_ptr(n_output, 0); 7465 node = gen_xmlNodePtr(n_node, 1); 7466 7467 xmlLsOneNode(output, node); 7468 call_tests++; 7469 des_debug_FILE_ptr(n_output, output, 0); 7470 des_xmlNodePtr(n_node, node, 1); 7471 xmlResetLastError(); 7472 if (mem_base != xmlMemBlocks()) { 7473 printf("Leak of %d blocks found in xmlLsOneNode", 7474 xmlMemBlocks() - mem_base); 7475 test_ret++; 7476 printf(" %d", n_output); 7477 printf(" %d", n_node); 7478 printf("\n"); 7479 } 7480 } 7481 } 7482 function_tests++; 7483 #endif 7484 7485 return(test_ret); 7486 } 7487 7488 7489 #define gen_nb_char_ptr 1 7490 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 7491 return(NULL); 7492 } 7493 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 7494 } 7495 7496 static int 7497 test_xmlShell(void) { 7498 int test_ret = 0; 7499 7500 7501 /* missing type support */ 7502 return(test_ret); 7503 } 7504 7505 7506 static int 7507 test_xmlShellBase(void) { 7508 int test_ret = 0; 7509 7510 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7511 int mem_base; 7512 int ret_val; 7513 xmlShellCtxtPtr ctxt; /* the shell context */ 7514 int n_ctxt; 7515 char * arg; /* unused */ 7516 int n_arg; 7517 xmlNodePtr node; /* a node */ 7518 int n_node; 7519 xmlNodePtr node2; /* unused */ 7520 int n_node2; 7521 7522 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7523 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7524 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7525 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7526 mem_base = xmlMemBlocks(); 7527 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7528 arg = gen_char_ptr(n_arg, 1); 7529 node = gen_xmlNodePtr(n_node, 2); 7530 node2 = gen_xmlNodePtr(n_node2, 3); 7531 7532 ret_val = xmlShellBase(ctxt, arg, node, node2); 7533 desret_int(ret_val); 7534 call_tests++; 7535 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7536 des_char_ptr(n_arg, arg, 1); 7537 des_xmlNodePtr(n_node, node, 2); 7538 des_xmlNodePtr(n_node2, node2, 3); 7539 xmlResetLastError(); 7540 if (mem_base != xmlMemBlocks()) { 7541 printf("Leak of %d blocks found in xmlShellBase", 7542 xmlMemBlocks() - mem_base); 7543 test_ret++; 7544 printf(" %d", n_ctxt); 7545 printf(" %d", n_arg); 7546 printf(" %d", n_node); 7547 printf(" %d", n_node2); 7548 printf("\n"); 7549 } 7550 } 7551 } 7552 } 7553 } 7554 function_tests++; 7555 #endif 7556 7557 return(test_ret); 7558 } 7559 7560 7561 static int 7562 test_xmlShellCat(void) { 7563 int test_ret = 0; 7564 7565 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 7566 int mem_base; 7567 int ret_val; 7568 xmlShellCtxtPtr ctxt; /* the shell context */ 7569 int n_ctxt; 7570 char * arg; /* unused */ 7571 int n_arg; 7572 xmlNodePtr node; /* a node */ 7573 int n_node; 7574 xmlNodePtr node2; /* unused */ 7575 int n_node2; 7576 7577 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7578 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7579 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7580 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7581 mem_base = xmlMemBlocks(); 7582 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7583 arg = gen_char_ptr(n_arg, 1); 7584 node = gen_xmlNodePtr(n_node, 2); 7585 node2 = gen_xmlNodePtr(n_node2, 3); 7586 7587 ret_val = xmlShellCat(ctxt, arg, node, node2); 7588 desret_int(ret_val); 7589 call_tests++; 7590 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7591 des_char_ptr(n_arg, arg, 1); 7592 des_xmlNodePtr(n_node, node, 2); 7593 des_xmlNodePtr(n_node2, node2, 3); 7594 xmlResetLastError(); 7595 if (mem_base != xmlMemBlocks()) { 7596 printf("Leak of %d blocks found in xmlShellCat", 7597 xmlMemBlocks() - mem_base); 7598 test_ret++; 7599 printf(" %d", n_ctxt); 7600 printf(" %d", n_arg); 7601 printf(" %d", n_node); 7602 printf(" %d", n_node2); 7603 printf("\n"); 7604 } 7605 } 7606 } 7607 } 7608 } 7609 function_tests++; 7610 #endif 7611 7612 return(test_ret); 7613 } 7614 7615 7616 static int 7617 test_xmlShellDir(void) { 7618 int test_ret = 0; 7619 7620 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7621 int mem_base; 7622 int ret_val; 7623 xmlShellCtxtPtr ctxt; /* the shell context */ 7624 int n_ctxt; 7625 char * arg; /* unused */ 7626 int n_arg; 7627 xmlNodePtr node; /* a node */ 7628 int n_node; 7629 xmlNodePtr node2; /* unused */ 7630 int n_node2; 7631 7632 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7633 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7634 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7635 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7636 mem_base = xmlMemBlocks(); 7637 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7638 arg = gen_char_ptr(n_arg, 1); 7639 node = gen_xmlNodePtr(n_node, 2); 7640 node2 = gen_xmlNodePtr(n_node2, 3); 7641 7642 ret_val = xmlShellDir(ctxt, arg, node, node2); 7643 desret_int(ret_val); 7644 call_tests++; 7645 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7646 des_char_ptr(n_arg, arg, 1); 7647 des_xmlNodePtr(n_node, node, 2); 7648 des_xmlNodePtr(n_node2, node2, 3); 7649 xmlResetLastError(); 7650 if (mem_base != xmlMemBlocks()) { 7651 printf("Leak of %d blocks found in xmlShellDir", 7652 xmlMemBlocks() - mem_base); 7653 test_ret++; 7654 printf(" %d", n_ctxt); 7655 printf(" %d", n_arg); 7656 printf(" %d", n_node); 7657 printf(" %d", n_node2); 7658 printf("\n"); 7659 } 7660 } 7661 } 7662 } 7663 } 7664 function_tests++; 7665 #endif 7666 7667 return(test_ret); 7668 } 7669 7670 7671 static int 7672 test_xmlShellDu(void) { 7673 int test_ret = 0; 7674 7675 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7676 int mem_base; 7677 int ret_val; 7678 xmlShellCtxtPtr ctxt; /* the shell context */ 7679 int n_ctxt; 7680 char * arg; /* unused */ 7681 int n_arg; 7682 xmlNodePtr tree; /* a node defining a subtree */ 7683 int n_tree; 7684 xmlNodePtr node2; /* unused */ 7685 int n_node2; 7686 7687 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7688 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7689 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 7690 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7691 mem_base = xmlMemBlocks(); 7692 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7693 arg = gen_char_ptr(n_arg, 1); 7694 tree = gen_xmlNodePtr(n_tree, 2); 7695 node2 = gen_xmlNodePtr(n_node2, 3); 7696 7697 ret_val = xmlShellDu(ctxt, arg, tree, node2); 7698 desret_int(ret_val); 7699 call_tests++; 7700 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7701 des_char_ptr(n_arg, arg, 1); 7702 des_xmlNodePtr(n_tree, tree, 2); 7703 des_xmlNodePtr(n_node2, node2, 3); 7704 xmlResetLastError(); 7705 if (mem_base != xmlMemBlocks()) { 7706 printf("Leak of %d blocks found in xmlShellDu", 7707 xmlMemBlocks() - mem_base); 7708 test_ret++; 7709 printf(" %d", n_ctxt); 7710 printf(" %d", n_arg); 7711 printf(" %d", n_tree); 7712 printf(" %d", n_node2); 7713 printf("\n"); 7714 } 7715 } 7716 } 7717 } 7718 } 7719 function_tests++; 7720 #endif 7721 7722 return(test_ret); 7723 } 7724 7725 7726 static int 7727 test_xmlShellList(void) { 7728 int test_ret = 0; 7729 7730 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7731 int mem_base; 7732 int ret_val; 7733 xmlShellCtxtPtr ctxt; /* the shell context */ 7734 int n_ctxt; 7735 char * arg; /* unused */ 7736 int n_arg; 7737 xmlNodePtr node; /* a node */ 7738 int n_node; 7739 xmlNodePtr node2; /* unused */ 7740 int n_node2; 7741 7742 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7743 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7744 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7745 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7746 mem_base = xmlMemBlocks(); 7747 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7748 arg = gen_char_ptr(n_arg, 1); 7749 node = gen_xmlNodePtr(n_node, 2); 7750 node2 = gen_xmlNodePtr(n_node2, 3); 7751 7752 ret_val = xmlShellList(ctxt, arg, node, node2); 7753 desret_int(ret_val); 7754 call_tests++; 7755 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7756 des_char_ptr(n_arg, arg, 1); 7757 des_xmlNodePtr(n_node, node, 2); 7758 des_xmlNodePtr(n_node2, node2, 3); 7759 xmlResetLastError(); 7760 if (mem_base != xmlMemBlocks()) { 7761 printf("Leak of %d blocks found in xmlShellList", 7762 xmlMemBlocks() - mem_base); 7763 test_ret++; 7764 printf(" %d", n_ctxt); 7765 printf(" %d", n_arg); 7766 printf(" %d", n_node); 7767 printf(" %d", n_node2); 7768 printf("\n"); 7769 } 7770 } 7771 } 7772 } 7773 } 7774 function_tests++; 7775 #endif 7776 7777 return(test_ret); 7778 } 7779 7780 7781 static int 7782 test_xmlShellLoad(void) { 7783 int test_ret = 0; 7784 7785 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7786 int mem_base; 7787 int ret_val; 7788 xmlShellCtxtPtr ctxt; /* the shell context */ 7789 int n_ctxt; 7790 char * filename; /* the file name */ 7791 int n_filename; 7792 xmlNodePtr node; /* unused */ 7793 int n_node; 7794 xmlNodePtr node2; /* unused */ 7795 int n_node2; 7796 7797 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7798 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { 7799 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7800 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7801 mem_base = xmlMemBlocks(); 7802 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7803 filename = gen_char_ptr(n_filename, 1); 7804 node = gen_xmlNodePtr(n_node, 2); 7805 node2 = gen_xmlNodePtr(n_node2, 3); 7806 7807 ret_val = xmlShellLoad(ctxt, filename, node, node2); 7808 desret_int(ret_val); 7809 call_tests++; 7810 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7811 des_char_ptr(n_filename, filename, 1); 7812 des_xmlNodePtr(n_node, node, 2); 7813 des_xmlNodePtr(n_node2, node2, 3); 7814 xmlResetLastError(); 7815 if (mem_base != xmlMemBlocks()) { 7816 printf("Leak of %d blocks found in xmlShellLoad", 7817 xmlMemBlocks() - mem_base); 7818 test_ret++; 7819 printf(" %d", n_ctxt); 7820 printf(" %d", n_filename); 7821 printf(" %d", n_node); 7822 printf(" %d", n_node2); 7823 printf("\n"); 7824 } 7825 } 7826 } 7827 } 7828 } 7829 function_tests++; 7830 #endif 7831 7832 return(test_ret); 7833 } 7834 7835 7836 static int 7837 test_xmlShellPrintXPathResult(void) { 7838 int test_ret = 0; 7839 7840 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7841 int mem_base; 7842 xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */ 7843 int n_list; 7844 7845 for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) { 7846 mem_base = xmlMemBlocks(); 7847 list = gen_xmlXPathObjectPtr(n_list, 0); 7848 7849 xmlShellPrintXPathResult(list); 7850 call_tests++; 7851 des_xmlXPathObjectPtr(n_list, list, 0); 7852 xmlResetLastError(); 7853 if (mem_base != xmlMemBlocks()) { 7854 printf("Leak of %d blocks found in xmlShellPrintXPathResult", 7855 xmlMemBlocks() - mem_base); 7856 test_ret++; 7857 printf(" %d", n_list); 7858 printf("\n"); 7859 } 7860 } 7861 function_tests++; 7862 #endif 7863 7864 return(test_ret); 7865 } 7866 7867 7868 static int 7869 test_xmlShellPwd(void) { 7870 int test_ret = 0; 7871 7872 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7873 int mem_base; 7874 int ret_val; 7875 xmlShellCtxtPtr ctxt; /* the shell context */ 7876 int n_ctxt; 7877 char * buffer; /* the output buffer */ 7878 int n_buffer; 7879 xmlNodePtr node; /* a node */ 7880 int n_node; 7881 xmlNodePtr node2; /* unused */ 7882 int n_node2; 7883 7884 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7885 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 7886 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7887 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7888 mem_base = xmlMemBlocks(); 7889 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7890 buffer = gen_char_ptr(n_buffer, 1); 7891 node = gen_xmlNodePtr(n_node, 2); 7892 node2 = gen_xmlNodePtr(n_node2, 3); 7893 7894 ret_val = xmlShellPwd(ctxt, buffer, node, node2); 7895 desret_int(ret_val); 7896 call_tests++; 7897 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7898 des_char_ptr(n_buffer, buffer, 1); 7899 des_xmlNodePtr(n_node, node, 2); 7900 des_xmlNodePtr(n_node2, node2, 3); 7901 xmlResetLastError(); 7902 if (mem_base != xmlMemBlocks()) { 7903 printf("Leak of %d blocks found in xmlShellPwd", 7904 xmlMemBlocks() - mem_base); 7905 test_ret++; 7906 printf(" %d", n_ctxt); 7907 printf(" %d", n_buffer); 7908 printf(" %d", n_node); 7909 printf(" %d", n_node2); 7910 printf("\n"); 7911 } 7912 } 7913 } 7914 } 7915 } 7916 function_tests++; 7917 #endif 7918 7919 return(test_ret); 7920 } 7921 7922 7923 static int 7924 test_xmlShellSave(void) { 7925 int test_ret = 0; 7926 7927 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 7928 int mem_base; 7929 int ret_val; 7930 xmlShellCtxtPtr ctxt; /* the shell context */ 7931 int n_ctxt; 7932 char * filename; /* the file name (optional) */ 7933 int n_filename; 7934 xmlNodePtr node; /* unused */ 7935 int n_node; 7936 xmlNodePtr node2; /* unused */ 7937 int n_node2; 7938 7939 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7940 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { 7941 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7942 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7943 mem_base = xmlMemBlocks(); 7944 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7945 filename = gen_char_ptr(n_filename, 1); 7946 node = gen_xmlNodePtr(n_node, 2); 7947 node2 = gen_xmlNodePtr(n_node2, 3); 7948 7949 ret_val = xmlShellSave(ctxt, filename, node, node2); 7950 desret_int(ret_val); 7951 call_tests++; 7952 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7953 des_char_ptr(n_filename, filename, 1); 7954 des_xmlNodePtr(n_node, node, 2); 7955 des_xmlNodePtr(n_node2, node2, 3); 7956 xmlResetLastError(); 7957 if (mem_base != xmlMemBlocks()) { 7958 printf("Leak of %d blocks found in xmlShellSave", 7959 xmlMemBlocks() - mem_base); 7960 test_ret++; 7961 printf(" %d", n_ctxt); 7962 printf(" %d", n_filename); 7963 printf(" %d", n_node); 7964 printf(" %d", n_node2); 7965 printf("\n"); 7966 } 7967 } 7968 } 7969 } 7970 } 7971 function_tests++; 7972 #endif 7973 7974 return(test_ret); 7975 } 7976 7977 7978 static int 7979 test_xmlShellValidate(void) { 7980 int test_ret = 0; 7981 7982 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED) 7983 int mem_base; 7984 int ret_val; 7985 xmlShellCtxtPtr ctxt; /* the shell context */ 7986 int n_ctxt; 7987 char * dtd; /* the DTD URI (optional) */ 7988 int n_dtd; 7989 xmlNodePtr node; /* unused */ 7990 int n_node; 7991 xmlNodePtr node2; /* unused */ 7992 int n_node2; 7993 7994 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7995 for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) { 7996 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7997 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7998 mem_base = xmlMemBlocks(); 7999 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 8000 dtd = gen_char_ptr(n_dtd, 1); 8001 node = gen_xmlNodePtr(n_node, 2); 8002 node2 = gen_xmlNodePtr(n_node2, 3); 8003 8004 ret_val = xmlShellValidate(ctxt, dtd, node, node2); 8005 desret_int(ret_val); 8006 call_tests++; 8007 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 8008 des_char_ptr(n_dtd, dtd, 1); 8009 des_xmlNodePtr(n_node, node, 2); 8010 des_xmlNodePtr(n_node2, node2, 3); 8011 xmlResetLastError(); 8012 if (mem_base != xmlMemBlocks()) { 8013 printf("Leak of %d blocks found in xmlShellValidate", 8014 xmlMemBlocks() - mem_base); 8015 test_ret++; 8016 printf(" %d", n_ctxt); 8017 printf(" %d", n_dtd); 8018 printf(" %d", n_node); 8019 printf(" %d", n_node2); 8020 printf("\n"); 8021 } 8022 } 8023 } 8024 } 8025 } 8026 function_tests++; 8027 #endif 8028 8029 return(test_ret); 8030 } 8031 8032 8033 static int 8034 test_xmlShellWrite(void) { 8035 int test_ret = 0; 8036 8037 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 8038 int mem_base; 8039 int ret_val; 8040 xmlShellCtxtPtr ctxt; /* the shell context */ 8041 int n_ctxt; 8042 char * filename; /* the file name */ 8043 int n_filename; 8044 xmlNodePtr node; /* a node in the tree */ 8045 int n_node; 8046 xmlNodePtr node2; /* unused */ 8047 int n_node2; 8048 8049 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 8050 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { 8051 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 8052 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 8053 mem_base = xmlMemBlocks(); 8054 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 8055 filename = gen_char_ptr(n_filename, 1); 8056 node = gen_xmlNodePtr(n_node, 2); 8057 node2 = gen_xmlNodePtr(n_node2, 3); 8058 8059 ret_val = xmlShellWrite(ctxt, filename, node, node2); 8060 desret_int(ret_val); 8061 call_tests++; 8062 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 8063 des_char_ptr(n_filename, filename, 1); 8064 des_xmlNodePtr(n_node, node, 2); 8065 des_xmlNodePtr(n_node2, node2, 3); 8066 xmlResetLastError(); 8067 if (mem_base != xmlMemBlocks()) { 8068 printf("Leak of %d blocks found in xmlShellWrite", 8069 xmlMemBlocks() - mem_base); 8070 test_ret++; 8071 printf(" %d", n_ctxt); 8072 printf(" %d", n_filename); 8073 printf(" %d", n_node); 8074 printf(" %d", n_node2); 8075 printf("\n"); 8076 } 8077 } 8078 } 8079 } 8080 } 8081 function_tests++; 8082 #endif 8083 8084 return(test_ret); 8085 } 8086 8087 static int 8088 test_debugXML(void) { 8089 int test_ret = 0; 8090 8091 if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n"); 8092 test_ret += test_xmlBoolToText(); 8093 test_ret += test_xmlDebugCheckDocument(); 8094 test_ret += test_xmlDebugDumpAttr(); 8095 test_ret += test_xmlDebugDumpAttrList(); 8096 test_ret += test_xmlDebugDumpDTD(); 8097 test_ret += test_xmlDebugDumpDocument(); 8098 test_ret += test_xmlDebugDumpDocumentHead(); 8099 test_ret += test_xmlDebugDumpEntities(); 8100 test_ret += test_xmlDebugDumpNode(); 8101 test_ret += test_xmlDebugDumpNodeList(); 8102 test_ret += test_xmlDebugDumpOneNode(); 8103 test_ret += test_xmlDebugDumpString(); 8104 test_ret += test_xmlLsCountNode(); 8105 test_ret += test_xmlLsOneNode(); 8106 test_ret += test_xmlShell(); 8107 test_ret += test_xmlShellBase(); 8108 test_ret += test_xmlShellCat(); 8109 test_ret += test_xmlShellDir(); 8110 test_ret += test_xmlShellDu(); 8111 test_ret += test_xmlShellList(); 8112 test_ret += test_xmlShellLoad(); 8113 test_ret += test_xmlShellPrintXPathResult(); 8114 test_ret += test_xmlShellPwd(); 8115 test_ret += test_xmlShellSave(); 8116 test_ret += test_xmlShellValidate(); 8117 test_ret += test_xmlShellWrite(); 8118 8119 if (test_ret != 0) 8120 printf("Module debugXML: %d errors\n", test_ret); 8121 return(test_ret); 8122 } 8123 8124 static int 8125 test_xmlDictCleanup(void) { 8126 int test_ret = 0; 8127 8128 int mem_base; 8129 8130 mem_base = xmlMemBlocks(); 8131 8132 xmlDictCleanup(); 8133 call_tests++; 8134 xmlResetLastError(); 8135 if (mem_base != xmlMemBlocks()) { 8136 printf("Leak of %d blocks found in xmlDictCleanup", 8137 xmlMemBlocks() - mem_base); 8138 test_ret++; 8139 printf("\n"); 8140 } 8141 function_tests++; 8142 8143 return(test_ret); 8144 } 8145 8146 8147 static int 8148 test_xmlDictCreate(void) { 8149 int test_ret = 0; 8150 8151 int mem_base; 8152 xmlDictPtr ret_val; 8153 8154 mem_base = xmlMemBlocks(); 8155 8156 ret_val = xmlDictCreate(); 8157 desret_xmlDictPtr(ret_val); 8158 call_tests++; 8159 xmlResetLastError(); 8160 if (mem_base != xmlMemBlocks()) { 8161 printf("Leak of %d blocks found in xmlDictCreate", 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_xmlDictCreateSub(void) { 8174 int test_ret = 0; 8175 8176 int mem_base; 8177 xmlDictPtr ret_val; 8178 xmlDictPtr sub; /* an existing dictionnary */ 8179 int n_sub; 8180 8181 for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) { 8182 mem_base = xmlMemBlocks(); 8183 sub = gen_xmlDictPtr(n_sub, 0); 8184 8185 ret_val = xmlDictCreateSub(sub); 8186 desret_xmlDictPtr(ret_val); 8187 call_tests++; 8188 des_xmlDictPtr(n_sub, sub, 0); 8189 xmlResetLastError(); 8190 if (mem_base != xmlMemBlocks()) { 8191 printf("Leak of %d blocks found in xmlDictCreateSub", 8192 xmlMemBlocks() - mem_base); 8193 test_ret++; 8194 printf(" %d", n_sub); 8195 printf("\n"); 8196 } 8197 } 8198 function_tests++; 8199 8200 return(test_ret); 8201 } 8202 8203 8204 static int 8205 test_xmlDictExists(void) { 8206 int test_ret = 0; 8207 8208 int mem_base; 8209 const xmlChar * ret_val; 8210 xmlDictPtr dict; /* the dictionnary */ 8211 int n_dict; 8212 xmlChar * name; /* the name of the userdata */ 8213 int n_name; 8214 int len; /* the length of the name, if -1 it is recomputed */ 8215 int n_len; 8216 8217 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8218 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 8219 for (n_len = 0;n_len < gen_nb_int;n_len++) { 8220 mem_base = xmlMemBlocks(); 8221 dict = gen_xmlDictPtr(n_dict, 0); 8222 name = gen_const_xmlChar_ptr(n_name, 1); 8223 len = gen_int(n_len, 2); 8224 8225 ret_val = xmlDictExists(dict, (const xmlChar *)name, len); 8226 desret_const_xmlChar_ptr(ret_val); 8227 call_tests++; 8228 des_xmlDictPtr(n_dict, dict, 0); 8229 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 8230 des_int(n_len, len, 2); 8231 xmlResetLastError(); 8232 if (mem_base != xmlMemBlocks()) { 8233 printf("Leak of %d blocks found in xmlDictExists", 8234 xmlMemBlocks() - mem_base); 8235 test_ret++; 8236 printf(" %d", n_dict); 8237 printf(" %d", n_name); 8238 printf(" %d", n_len); 8239 printf("\n"); 8240 } 8241 } 8242 } 8243 } 8244 function_tests++; 8245 8246 return(test_ret); 8247 } 8248 8249 8250 static int 8251 test_xmlDictGetUsage(void) { 8252 int test_ret = 0; 8253 8254 8255 /* missing type support */ 8256 return(test_ret); 8257 } 8258 8259 8260 static int 8261 test_xmlDictLookup(void) { 8262 int test_ret = 0; 8263 8264 int mem_base; 8265 const xmlChar * ret_val; 8266 xmlDictPtr dict; /* the dictionnary */ 8267 int n_dict; 8268 xmlChar * name; /* the name of the userdata */ 8269 int n_name; 8270 int len; /* the length of the name, if -1 it is recomputed */ 8271 int n_len; 8272 8273 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8274 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 8275 for (n_len = 0;n_len < gen_nb_int;n_len++) { 8276 mem_base = xmlMemBlocks(); 8277 dict = gen_xmlDictPtr(n_dict, 0); 8278 name = gen_const_xmlChar_ptr(n_name, 1); 8279 len = gen_int(n_len, 2); 8280 8281 ret_val = xmlDictLookup(dict, (const xmlChar *)name, len); 8282 desret_const_xmlChar_ptr(ret_val); 8283 call_tests++; 8284 des_xmlDictPtr(n_dict, dict, 0); 8285 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 8286 des_int(n_len, len, 2); 8287 xmlResetLastError(); 8288 if (mem_base != xmlMemBlocks()) { 8289 printf("Leak of %d blocks found in xmlDictLookup", 8290 xmlMemBlocks() - mem_base); 8291 test_ret++; 8292 printf(" %d", n_dict); 8293 printf(" %d", n_name); 8294 printf(" %d", n_len); 8295 printf("\n"); 8296 } 8297 } 8298 } 8299 } 8300 function_tests++; 8301 8302 return(test_ret); 8303 } 8304 8305 8306 static int 8307 test_xmlDictOwns(void) { 8308 int test_ret = 0; 8309 8310 int mem_base; 8311 int ret_val; 8312 xmlDictPtr dict; /* the dictionnary */ 8313 int n_dict; 8314 xmlChar * str; /* the string */ 8315 int n_str; 8316 8317 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8318 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 8319 mem_base = xmlMemBlocks(); 8320 dict = gen_xmlDictPtr(n_dict, 0); 8321 str = gen_const_xmlChar_ptr(n_str, 1); 8322 8323 ret_val = xmlDictOwns(dict, (const xmlChar *)str); 8324 desret_int(ret_val); 8325 call_tests++; 8326 des_xmlDictPtr(n_dict, dict, 0); 8327 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 8328 xmlResetLastError(); 8329 if (mem_base != xmlMemBlocks()) { 8330 printf("Leak of %d blocks found in xmlDictOwns", 8331 xmlMemBlocks() - mem_base); 8332 test_ret++; 8333 printf(" %d", n_dict); 8334 printf(" %d", n_str); 8335 printf("\n"); 8336 } 8337 } 8338 } 8339 function_tests++; 8340 8341 return(test_ret); 8342 } 8343 8344 8345 static int 8346 test_xmlDictQLookup(void) { 8347 int test_ret = 0; 8348 8349 int mem_base; 8350 const xmlChar * ret_val; 8351 xmlDictPtr dict; /* the dictionnary */ 8352 int n_dict; 8353 xmlChar * prefix; /* the prefix */ 8354 int n_prefix; 8355 xmlChar * name; /* the name */ 8356 int n_name; 8357 8358 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8359 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 8360 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 8361 mem_base = xmlMemBlocks(); 8362 dict = gen_xmlDictPtr(n_dict, 0); 8363 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 8364 name = gen_const_xmlChar_ptr(n_name, 2); 8365 8366 ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name); 8367 desret_const_xmlChar_ptr(ret_val); 8368 call_tests++; 8369 des_xmlDictPtr(n_dict, dict, 0); 8370 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 8371 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 8372 xmlResetLastError(); 8373 if (mem_base != xmlMemBlocks()) { 8374 printf("Leak of %d blocks found in xmlDictQLookup", 8375 xmlMemBlocks() - mem_base); 8376 test_ret++; 8377 printf(" %d", n_dict); 8378 printf(" %d", n_prefix); 8379 printf(" %d", n_name); 8380 printf("\n"); 8381 } 8382 } 8383 } 8384 } 8385 function_tests++; 8386 8387 return(test_ret); 8388 } 8389 8390 8391 static int 8392 test_xmlDictReference(void) { 8393 int test_ret = 0; 8394 8395 int mem_base; 8396 int ret_val; 8397 xmlDictPtr dict; /* the dictionnary */ 8398 int n_dict; 8399 8400 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8401 mem_base = xmlMemBlocks(); 8402 dict = gen_xmlDictPtr(n_dict, 0); 8403 8404 ret_val = xmlDictReference(dict); 8405 xmlDictFree(dict); 8406 desret_int(ret_val); 8407 call_tests++; 8408 des_xmlDictPtr(n_dict, dict, 0); 8409 xmlResetLastError(); 8410 if (mem_base != xmlMemBlocks()) { 8411 printf("Leak of %d blocks found in xmlDictReference", 8412 xmlMemBlocks() - mem_base); 8413 test_ret++; 8414 printf(" %d", n_dict); 8415 printf("\n"); 8416 } 8417 } 8418 function_tests++; 8419 8420 return(test_ret); 8421 } 8422 8423 8424 static int 8425 test_xmlDictSetLimit(void) { 8426 int test_ret = 0; 8427 8428 8429 /* missing type support */ 8430 return(test_ret); 8431 } 8432 8433 8434 static int 8435 test_xmlDictSize(void) { 8436 int test_ret = 0; 8437 8438 int mem_base; 8439 int ret_val; 8440 xmlDictPtr dict; /* the dictionnary */ 8441 int n_dict; 8442 8443 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8444 mem_base = xmlMemBlocks(); 8445 dict = gen_xmlDictPtr(n_dict, 0); 8446 8447 ret_val = xmlDictSize(dict); 8448 desret_int(ret_val); 8449 call_tests++; 8450 des_xmlDictPtr(n_dict, dict, 0); 8451 xmlResetLastError(); 8452 if (mem_base != xmlMemBlocks()) { 8453 printf("Leak of %d blocks found in xmlDictSize", 8454 xmlMemBlocks() - mem_base); 8455 test_ret++; 8456 printf(" %d", n_dict); 8457 printf("\n"); 8458 } 8459 } 8460 function_tests++; 8461 8462 return(test_ret); 8463 } 8464 8465 8466 static int 8467 test_xmlInitializeDict(void) { 8468 int test_ret = 0; 8469 8470 int mem_base; 8471 int ret_val; 8472 8473 mem_base = xmlMemBlocks(); 8474 8475 ret_val = xmlInitializeDict(); 8476 desret_int(ret_val); 8477 call_tests++; 8478 xmlResetLastError(); 8479 if (mem_base != xmlMemBlocks()) { 8480 printf("Leak of %d blocks found in xmlInitializeDict", 8481 xmlMemBlocks() - mem_base); 8482 test_ret++; 8483 printf("\n"); 8484 } 8485 function_tests++; 8486 8487 return(test_ret); 8488 } 8489 8490 static int 8491 test_dict(void) { 8492 int test_ret = 0; 8493 8494 if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n"); 8495 test_ret += test_xmlDictCleanup(); 8496 test_ret += test_xmlDictCreate(); 8497 test_ret += test_xmlDictCreateSub(); 8498 test_ret += test_xmlDictExists(); 8499 test_ret += test_xmlDictGetUsage(); 8500 test_ret += test_xmlDictLookup(); 8501 test_ret += test_xmlDictOwns(); 8502 test_ret += test_xmlDictQLookup(); 8503 test_ret += test_xmlDictReference(); 8504 test_ret += test_xmlDictSetLimit(); 8505 test_ret += test_xmlDictSize(); 8506 test_ret += test_xmlInitializeDict(); 8507 8508 if (test_ret != 0) 8509 printf("Module dict: %d errors\n", test_ret); 8510 return(test_ret); 8511 } 8512 8513 static int 8514 test_UTF8Toisolat1(void) { 8515 int test_ret = 0; 8516 8517 #if defined(LIBXML_OUTPUT_ENABLED) 8518 #ifdef LIBXML_OUTPUT_ENABLED 8519 int mem_base; 8520 int ret_val; 8521 unsigned char * out; /* a pointer to an array of bytes to store the result */ 8522 int n_out; 8523 int * outlen; /* the length of @out */ 8524 int n_outlen; 8525 unsigned char * in; /* a pointer to an array of UTF-8 chars */ 8526 int n_in; 8527 int * inlen; /* the length of @in */ 8528 int n_inlen; 8529 8530 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 8531 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 8532 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 8533 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 8534 mem_base = xmlMemBlocks(); 8535 out = gen_unsigned_char_ptr(n_out, 0); 8536 outlen = gen_int_ptr(n_outlen, 1); 8537 in = gen_const_unsigned_char_ptr(n_in, 2); 8538 inlen = gen_int_ptr(n_inlen, 3); 8539 8540 ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen); 8541 desret_int(ret_val); 8542 call_tests++; 8543 des_unsigned_char_ptr(n_out, out, 0); 8544 des_int_ptr(n_outlen, outlen, 1); 8545 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 8546 des_int_ptr(n_inlen, inlen, 3); 8547 xmlResetLastError(); 8548 if (mem_base != xmlMemBlocks()) { 8549 printf("Leak of %d blocks found in UTF8Toisolat1", 8550 xmlMemBlocks() - mem_base); 8551 test_ret++; 8552 printf(" %d", n_out); 8553 printf(" %d", n_outlen); 8554 printf(" %d", n_in); 8555 printf(" %d", n_inlen); 8556 printf("\n"); 8557 } 8558 } 8559 } 8560 } 8561 } 8562 function_tests++; 8563 #endif 8564 #endif 8565 8566 return(test_ret); 8567 } 8568 8569 8570 static int 8571 test_isolat1ToUTF8(void) { 8572 int test_ret = 0; 8573 8574 int mem_base; 8575 int ret_val; 8576 unsigned char * out; /* a pointer to an array of bytes to store the result */ 8577 int n_out; 8578 int * outlen; /* the length of @out */ 8579 int n_outlen; 8580 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */ 8581 int n_in; 8582 int * inlen; /* the length of @in */ 8583 int n_inlen; 8584 8585 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 8586 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 8587 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 8588 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 8589 mem_base = xmlMemBlocks(); 8590 out = gen_unsigned_char_ptr(n_out, 0); 8591 outlen = gen_int_ptr(n_outlen, 1); 8592 in = gen_const_unsigned_char_ptr(n_in, 2); 8593 inlen = gen_int_ptr(n_inlen, 3); 8594 8595 ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen); 8596 desret_int(ret_val); 8597 call_tests++; 8598 des_unsigned_char_ptr(n_out, out, 0); 8599 des_int_ptr(n_outlen, outlen, 1); 8600 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 8601 des_int_ptr(n_inlen, inlen, 3); 8602 xmlResetLastError(); 8603 if (mem_base != xmlMemBlocks()) { 8604 printf("Leak of %d blocks found in isolat1ToUTF8", 8605 xmlMemBlocks() - mem_base); 8606 test_ret++; 8607 printf(" %d", n_out); 8608 printf(" %d", n_outlen); 8609 printf(" %d", n_in); 8610 printf(" %d", n_inlen); 8611 printf("\n"); 8612 } 8613 } 8614 } 8615 } 8616 } 8617 function_tests++; 8618 8619 return(test_ret); 8620 } 8621 8622 8623 static int 8624 test_xmlAddEncodingAlias(void) { 8625 int test_ret = 0; 8626 8627 int ret_val; 8628 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ 8629 int n_name; 8630 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ 8631 int n_alias; 8632 8633 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 8634 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { 8635 name = gen_const_char_ptr(n_name, 0); 8636 alias = gen_const_char_ptr(n_alias, 1); 8637 8638 ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias); 8639 desret_int(ret_val); 8640 call_tests++; 8641 des_const_char_ptr(n_name, (const char *)name, 0); 8642 des_const_char_ptr(n_alias, (const char *)alias, 1); 8643 xmlResetLastError(); 8644 } 8645 } 8646 function_tests++; 8647 8648 return(test_ret); 8649 } 8650 8651 8652 #define gen_nb_xmlCharEncodingHandler_ptr 1 8653 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 8654 return(NULL); 8655 } 8656 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 8657 } 8658 8659 static int 8660 test_xmlCharEncCloseFunc(void) { 8661 int test_ret = 0; 8662 8663 int mem_base; 8664 int ret_val; 8665 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ 8666 int n_handler; 8667 8668 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8669 mem_base = xmlMemBlocks(); 8670 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8671 8672 ret_val = xmlCharEncCloseFunc(handler); 8673 desret_int(ret_val); 8674 call_tests++; 8675 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8676 xmlResetLastError(); 8677 if (mem_base != xmlMemBlocks()) { 8678 printf("Leak of %d blocks found in xmlCharEncCloseFunc", 8679 xmlMemBlocks() - mem_base); 8680 test_ret++; 8681 printf(" %d", n_handler); 8682 printf("\n"); 8683 } 8684 } 8685 function_tests++; 8686 8687 return(test_ret); 8688 } 8689 8690 8691 static int 8692 test_xmlCharEncFirstLine(void) { 8693 int test_ret = 0; 8694 8695 int mem_base; 8696 int ret_val; 8697 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ 8698 int n_handler; 8699 xmlBufferPtr out; /* an xmlBuffer for the output. */ 8700 int n_out; 8701 xmlBufferPtr in; /* an xmlBuffer for the input */ 8702 int n_in; 8703 8704 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8705 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { 8706 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { 8707 mem_base = xmlMemBlocks(); 8708 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8709 out = gen_xmlBufferPtr(n_out, 1); 8710 in = gen_xmlBufferPtr(n_in, 2); 8711 8712 ret_val = xmlCharEncFirstLine(handler, out, in); 8713 desret_int(ret_val); 8714 call_tests++; 8715 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8716 des_xmlBufferPtr(n_out, out, 1); 8717 des_xmlBufferPtr(n_in, in, 2); 8718 xmlResetLastError(); 8719 if (mem_base != xmlMemBlocks()) { 8720 printf("Leak of %d blocks found in xmlCharEncFirstLine", 8721 xmlMemBlocks() - mem_base); 8722 test_ret++; 8723 printf(" %d", n_handler); 8724 printf(" %d", n_out); 8725 printf(" %d", n_in); 8726 printf("\n"); 8727 } 8728 } 8729 } 8730 } 8731 function_tests++; 8732 8733 return(test_ret); 8734 } 8735 8736 8737 static int 8738 test_xmlCharEncInFunc(void) { 8739 int test_ret = 0; 8740 8741 int mem_base; 8742 int ret_val; 8743 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */ 8744 int n_handler; 8745 xmlBufferPtr out; /* an xmlBuffer for the output. */ 8746 int n_out; 8747 xmlBufferPtr in; /* an xmlBuffer for the input */ 8748 int n_in; 8749 8750 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8751 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { 8752 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { 8753 mem_base = xmlMemBlocks(); 8754 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8755 out = gen_xmlBufferPtr(n_out, 1); 8756 in = gen_xmlBufferPtr(n_in, 2); 8757 8758 ret_val = xmlCharEncInFunc(handler, out, in); 8759 desret_int(ret_val); 8760 call_tests++; 8761 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8762 des_xmlBufferPtr(n_out, out, 1); 8763 des_xmlBufferPtr(n_in, in, 2); 8764 xmlResetLastError(); 8765 if (mem_base != xmlMemBlocks()) { 8766 printf("Leak of %d blocks found in xmlCharEncInFunc", 8767 xmlMemBlocks() - mem_base); 8768 test_ret++; 8769 printf(" %d", n_handler); 8770 printf(" %d", n_out); 8771 printf(" %d", n_in); 8772 printf("\n"); 8773 } 8774 } 8775 } 8776 } 8777 function_tests++; 8778 8779 return(test_ret); 8780 } 8781 8782 8783 static int 8784 test_xmlCharEncOutFunc(void) { 8785 int test_ret = 0; 8786 8787 int mem_base; 8788 int ret_val; 8789 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ 8790 int n_handler; 8791 xmlBufferPtr out; /* an xmlBuffer for the output. */ 8792 int n_out; 8793 xmlBufferPtr in; /* an xmlBuffer for the input */ 8794 int n_in; 8795 8796 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8797 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { 8798 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { 8799 mem_base = xmlMemBlocks(); 8800 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8801 out = gen_xmlBufferPtr(n_out, 1); 8802 in = gen_xmlBufferPtr(n_in, 2); 8803 8804 ret_val = xmlCharEncOutFunc(handler, out, in); 8805 desret_int(ret_val); 8806 call_tests++; 8807 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8808 des_xmlBufferPtr(n_out, out, 1); 8809 des_xmlBufferPtr(n_in, in, 2); 8810 xmlResetLastError(); 8811 if (mem_base != xmlMemBlocks()) { 8812 printf("Leak of %d blocks found in xmlCharEncOutFunc", 8813 xmlMemBlocks() - mem_base); 8814 test_ret++; 8815 printf(" %d", n_handler); 8816 printf(" %d", n_out); 8817 printf(" %d", n_in); 8818 printf("\n"); 8819 } 8820 } 8821 } 8822 } 8823 function_tests++; 8824 8825 return(test_ret); 8826 } 8827 8828 8829 static int 8830 test_xmlCleanupCharEncodingHandlers(void) { 8831 int test_ret = 0; 8832 8833 8834 8835 xmlCleanupCharEncodingHandlers(); 8836 call_tests++; 8837 xmlResetLastError(); 8838 function_tests++; 8839 8840 return(test_ret); 8841 } 8842 8843 8844 static int 8845 test_xmlCleanupEncodingAliases(void) { 8846 int test_ret = 0; 8847 8848 int mem_base; 8849 8850 mem_base = xmlMemBlocks(); 8851 8852 xmlCleanupEncodingAliases(); 8853 call_tests++; 8854 xmlResetLastError(); 8855 if (mem_base != xmlMemBlocks()) { 8856 printf("Leak of %d blocks found in xmlCleanupEncodingAliases", 8857 xmlMemBlocks() - mem_base); 8858 test_ret++; 8859 printf("\n"); 8860 } 8861 function_tests++; 8862 8863 return(test_ret); 8864 } 8865 8866 8867 static int 8868 test_xmlDelEncodingAlias(void) { 8869 int test_ret = 0; 8870 8871 int mem_base; 8872 int ret_val; 8873 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ 8874 int n_alias; 8875 8876 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { 8877 mem_base = xmlMemBlocks(); 8878 alias = gen_const_char_ptr(n_alias, 0); 8879 8880 ret_val = xmlDelEncodingAlias((const char *)alias); 8881 desret_int(ret_val); 8882 call_tests++; 8883 des_const_char_ptr(n_alias, (const char *)alias, 0); 8884 xmlResetLastError(); 8885 if (mem_base != xmlMemBlocks()) { 8886 printf("Leak of %d blocks found in xmlDelEncodingAlias", 8887 xmlMemBlocks() - mem_base); 8888 test_ret++; 8889 printf(" %d", n_alias); 8890 printf("\n"); 8891 } 8892 } 8893 function_tests++; 8894 8895 return(test_ret); 8896 } 8897 8898 8899 static int 8900 test_xmlDetectCharEncoding(void) { 8901 int test_ret = 0; 8902 8903 int mem_base; 8904 xmlCharEncoding ret_val; 8905 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). */ 8906 int n_in; 8907 int len; /* pointer to the length of the buffer */ 8908 int n_len; 8909 8910 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 8911 for (n_len = 0;n_len < gen_nb_int;n_len++) { 8912 mem_base = xmlMemBlocks(); 8913 in = gen_const_unsigned_char_ptr(n_in, 0); 8914 len = gen_int(n_len, 1); 8915 8916 ret_val = xmlDetectCharEncoding((const unsigned char *)in, len); 8917 desret_xmlCharEncoding(ret_val); 8918 call_tests++; 8919 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0); 8920 des_int(n_len, len, 1); 8921 xmlResetLastError(); 8922 if (mem_base != xmlMemBlocks()) { 8923 printf("Leak of %d blocks found in xmlDetectCharEncoding", 8924 xmlMemBlocks() - mem_base); 8925 test_ret++; 8926 printf(" %d", n_in); 8927 printf(" %d", n_len); 8928 printf("\n"); 8929 } 8930 } 8931 } 8932 function_tests++; 8933 8934 return(test_ret); 8935 } 8936 8937 8938 static int 8939 test_xmlFindCharEncodingHandler(void) { 8940 int test_ret = 0; 8941 8942 8943 /* missing type support */ 8944 return(test_ret); 8945 } 8946 8947 8948 static int 8949 test_xmlGetCharEncodingHandler(void) { 8950 int test_ret = 0; 8951 8952 8953 /* missing type support */ 8954 return(test_ret); 8955 } 8956 8957 8958 static int 8959 test_xmlGetCharEncodingName(void) { 8960 int test_ret = 0; 8961 8962 int mem_base; 8963 const char * ret_val; 8964 xmlCharEncoding enc; /* the encoding */ 8965 int n_enc; 8966 8967 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 8968 mem_base = xmlMemBlocks(); 8969 enc = gen_xmlCharEncoding(n_enc, 0); 8970 8971 ret_val = xmlGetCharEncodingName(enc); 8972 desret_const_char_ptr(ret_val); 8973 call_tests++; 8974 des_xmlCharEncoding(n_enc, enc, 0); 8975 xmlResetLastError(); 8976 if (mem_base != xmlMemBlocks()) { 8977 printf("Leak of %d blocks found in xmlGetCharEncodingName", 8978 xmlMemBlocks() - mem_base); 8979 test_ret++; 8980 printf(" %d", n_enc); 8981 printf("\n"); 8982 } 8983 } 8984 function_tests++; 8985 8986 return(test_ret); 8987 } 8988 8989 8990 static int 8991 test_xmlGetEncodingAlias(void) { 8992 int test_ret = 0; 8993 8994 int mem_base; 8995 const char * ret_val; 8996 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ 8997 int n_alias; 8998 8999 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { 9000 mem_base = xmlMemBlocks(); 9001 alias = gen_const_char_ptr(n_alias, 0); 9002 9003 ret_val = xmlGetEncodingAlias((const char *)alias); 9004 desret_const_char_ptr(ret_val); 9005 call_tests++; 9006 des_const_char_ptr(n_alias, (const char *)alias, 0); 9007 xmlResetLastError(); 9008 if (mem_base != xmlMemBlocks()) { 9009 printf("Leak of %d blocks found in xmlGetEncodingAlias", 9010 xmlMemBlocks() - mem_base); 9011 test_ret++; 9012 printf(" %d", n_alias); 9013 printf("\n"); 9014 } 9015 } 9016 function_tests++; 9017 9018 return(test_ret); 9019 } 9020 9021 9022 static int 9023 test_xmlInitCharEncodingHandlers(void) { 9024 int test_ret = 0; 9025 9026 9027 9028 xmlInitCharEncodingHandlers(); 9029 call_tests++; 9030 xmlResetLastError(); 9031 function_tests++; 9032 9033 return(test_ret); 9034 } 9035 9036 9037 static int 9038 test_xmlNewCharEncodingHandler(void) { 9039 int test_ret = 0; 9040 9041 9042 /* missing type support */ 9043 return(test_ret); 9044 } 9045 9046 9047 static int 9048 test_xmlParseCharEncoding(void) { 9049 int test_ret = 0; 9050 9051 int mem_base; 9052 xmlCharEncoding ret_val; 9053 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ 9054 int n_name; 9055 9056 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 9057 mem_base = xmlMemBlocks(); 9058 name = gen_const_char_ptr(n_name, 0); 9059 9060 ret_val = xmlParseCharEncoding((const char *)name); 9061 desret_xmlCharEncoding(ret_val); 9062 call_tests++; 9063 des_const_char_ptr(n_name, (const char *)name, 0); 9064 xmlResetLastError(); 9065 if (mem_base != xmlMemBlocks()) { 9066 printf("Leak of %d blocks found in xmlParseCharEncoding", 9067 xmlMemBlocks() - mem_base); 9068 test_ret++; 9069 printf(" %d", n_name); 9070 printf("\n"); 9071 } 9072 } 9073 function_tests++; 9074 9075 return(test_ret); 9076 } 9077 9078 9079 #define gen_nb_xmlCharEncodingHandlerPtr 1 9080 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9081 return(NULL); 9082 } 9083 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9084 } 9085 9086 static int 9087 test_xmlRegisterCharEncodingHandler(void) { 9088 int test_ret = 0; 9089 9090 int mem_base; 9091 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */ 9092 int n_handler; 9093 9094 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { 9095 mem_base = xmlMemBlocks(); 9096 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0); 9097 9098 xmlRegisterCharEncodingHandler(handler); 9099 call_tests++; 9100 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0); 9101 xmlResetLastError(); 9102 if (mem_base != xmlMemBlocks()) { 9103 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler", 9104 xmlMemBlocks() - mem_base); 9105 test_ret++; 9106 printf(" %d", n_handler); 9107 printf("\n"); 9108 } 9109 } 9110 function_tests++; 9111 9112 return(test_ret); 9113 } 9114 9115 static int 9116 test_encoding(void) { 9117 int test_ret = 0; 9118 9119 if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n"); 9120 test_ret += test_UTF8Toisolat1(); 9121 test_ret += test_isolat1ToUTF8(); 9122 test_ret += test_xmlAddEncodingAlias(); 9123 test_ret += test_xmlCharEncCloseFunc(); 9124 test_ret += test_xmlCharEncFirstLine(); 9125 test_ret += test_xmlCharEncInFunc(); 9126 test_ret += test_xmlCharEncOutFunc(); 9127 test_ret += test_xmlCleanupCharEncodingHandlers(); 9128 test_ret += test_xmlCleanupEncodingAliases(); 9129 test_ret += test_xmlDelEncodingAlias(); 9130 test_ret += test_xmlDetectCharEncoding(); 9131 test_ret += test_xmlFindCharEncodingHandler(); 9132 test_ret += test_xmlGetCharEncodingHandler(); 9133 test_ret += test_xmlGetCharEncodingName(); 9134 test_ret += test_xmlGetEncodingAlias(); 9135 test_ret += test_xmlInitCharEncodingHandlers(); 9136 test_ret += test_xmlNewCharEncodingHandler(); 9137 test_ret += test_xmlParseCharEncoding(); 9138 test_ret += test_xmlRegisterCharEncodingHandler(); 9139 9140 if (test_ret != 0) 9141 printf("Module encoding: %d errors\n", test_ret); 9142 return(test_ret); 9143 } 9144 9145 static int 9146 test_xmlAddDocEntity(void) { 9147 int test_ret = 0; 9148 9149 int mem_base; 9150 xmlEntityPtr ret_val; 9151 xmlDocPtr doc; /* the document */ 9152 int n_doc; 9153 xmlChar * name; /* the entity name */ 9154 int n_name; 9155 int type; /* the entity type XML_xxx_yyy_ENTITY */ 9156 int n_type; 9157 xmlChar * ExternalID; /* the entity external ID if available */ 9158 int n_ExternalID; 9159 xmlChar * SystemID; /* the entity system ID if available */ 9160 int n_SystemID; 9161 xmlChar * content; /* the entity content */ 9162 int n_content; 9163 9164 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9165 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9166 for (n_type = 0;n_type < gen_nb_int;n_type++) { 9167 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 9168 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 9169 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 9170 mem_base = xmlMemBlocks(); 9171 doc = gen_xmlDocPtr(n_doc, 0); 9172 name = gen_const_xmlChar_ptr(n_name, 1); 9173 type = gen_int(n_type, 2); 9174 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); 9175 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); 9176 content = gen_const_xmlChar_ptr(n_content, 5); 9177 9178 ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); 9179 desret_xmlEntityPtr(ret_val); 9180 call_tests++; 9181 des_xmlDocPtr(n_doc, doc, 0); 9182 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9183 des_int(n_type, type, 2); 9184 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); 9185 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); 9186 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); 9187 xmlResetLastError(); 9188 if (mem_base != xmlMemBlocks()) { 9189 printf("Leak of %d blocks found in xmlAddDocEntity", 9190 xmlMemBlocks() - mem_base); 9191 test_ret++; 9192 printf(" %d", n_doc); 9193 printf(" %d", n_name); 9194 printf(" %d", n_type); 9195 printf(" %d", n_ExternalID); 9196 printf(" %d", n_SystemID); 9197 printf(" %d", n_content); 9198 printf("\n"); 9199 } 9200 } 9201 } 9202 } 9203 } 9204 } 9205 } 9206 function_tests++; 9207 9208 return(test_ret); 9209 } 9210 9211 9212 static int 9213 test_xmlAddDtdEntity(void) { 9214 int test_ret = 0; 9215 9216 int mem_base; 9217 xmlEntityPtr ret_val; 9218 xmlDocPtr doc; /* the document */ 9219 int n_doc; 9220 xmlChar * name; /* the entity name */ 9221 int n_name; 9222 int type; /* the entity type XML_xxx_yyy_ENTITY */ 9223 int n_type; 9224 xmlChar * ExternalID; /* the entity external ID if available */ 9225 int n_ExternalID; 9226 xmlChar * SystemID; /* the entity system ID if available */ 9227 int n_SystemID; 9228 xmlChar * content; /* the entity content */ 9229 int n_content; 9230 9231 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9232 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9233 for (n_type = 0;n_type < gen_nb_int;n_type++) { 9234 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 9235 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 9236 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 9237 mem_base = xmlMemBlocks(); 9238 doc = gen_xmlDocPtr(n_doc, 0); 9239 name = gen_const_xmlChar_ptr(n_name, 1); 9240 type = gen_int(n_type, 2); 9241 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); 9242 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); 9243 content = gen_const_xmlChar_ptr(n_content, 5); 9244 9245 ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); 9246 desret_xmlEntityPtr(ret_val); 9247 call_tests++; 9248 des_xmlDocPtr(n_doc, doc, 0); 9249 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9250 des_int(n_type, type, 2); 9251 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); 9252 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); 9253 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); 9254 xmlResetLastError(); 9255 if (mem_base != xmlMemBlocks()) { 9256 printf("Leak of %d blocks found in xmlAddDtdEntity", 9257 xmlMemBlocks() - mem_base); 9258 test_ret++; 9259 printf(" %d", n_doc); 9260 printf(" %d", n_name); 9261 printf(" %d", n_type); 9262 printf(" %d", n_ExternalID); 9263 printf(" %d", n_SystemID); 9264 printf(" %d", n_content); 9265 printf("\n"); 9266 } 9267 } 9268 } 9269 } 9270 } 9271 } 9272 } 9273 function_tests++; 9274 9275 return(test_ret); 9276 } 9277 9278 9279 static int 9280 test_xmlCleanupPredefinedEntities(void) { 9281 int test_ret = 0; 9282 9283 #if defined(LIBXML_LEGACY_ENABLED) 9284 #ifdef LIBXML_LEGACY_ENABLED 9285 int mem_base; 9286 9287 mem_base = xmlMemBlocks(); 9288 9289 xmlCleanupPredefinedEntities(); 9290 call_tests++; 9291 xmlResetLastError(); 9292 if (mem_base != xmlMemBlocks()) { 9293 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities", 9294 xmlMemBlocks() - mem_base); 9295 test_ret++; 9296 printf("\n"); 9297 } 9298 function_tests++; 9299 #endif 9300 #endif 9301 9302 return(test_ret); 9303 } 9304 9305 9306 #define gen_nb_xmlEntitiesTablePtr 1 9307 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9308 return(NULL); 9309 } 9310 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9311 } 9312 9313 static int 9314 test_xmlCopyEntitiesTable(void) { 9315 int test_ret = 0; 9316 9317 9318 /* missing type support */ 9319 return(test_ret); 9320 } 9321 9322 9323 static int 9324 test_xmlCreateEntitiesTable(void) { 9325 int test_ret = 0; 9326 9327 9328 /* missing type support */ 9329 return(test_ret); 9330 } 9331 9332 9333 static int 9334 test_xmlDumpEntitiesTable(void) { 9335 int test_ret = 0; 9336 9337 #if defined(LIBXML_OUTPUT_ENABLED) 9338 int mem_base; 9339 xmlBufferPtr buf; /* An XML buffer. */ 9340 int n_buf; 9341 xmlEntitiesTablePtr table; /* An entity table */ 9342 int n_table; 9343 9344 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 9345 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) { 9346 mem_base = xmlMemBlocks(); 9347 buf = gen_xmlBufferPtr(n_buf, 0); 9348 table = gen_xmlEntitiesTablePtr(n_table, 1); 9349 9350 xmlDumpEntitiesTable(buf, table); 9351 call_tests++; 9352 des_xmlBufferPtr(n_buf, buf, 0); 9353 des_xmlEntitiesTablePtr(n_table, table, 1); 9354 xmlResetLastError(); 9355 if (mem_base != xmlMemBlocks()) { 9356 printf("Leak of %d blocks found in xmlDumpEntitiesTable", 9357 xmlMemBlocks() - mem_base); 9358 test_ret++; 9359 printf(" %d", n_buf); 9360 printf(" %d", n_table); 9361 printf("\n"); 9362 } 9363 } 9364 } 9365 function_tests++; 9366 #endif 9367 9368 return(test_ret); 9369 } 9370 9371 9372 #define gen_nb_xmlEntityPtr 1 9373 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9374 return(NULL); 9375 } 9376 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9377 } 9378 9379 static int 9380 test_xmlDumpEntityDecl(void) { 9381 int test_ret = 0; 9382 9383 #if defined(LIBXML_OUTPUT_ENABLED) 9384 int mem_base; 9385 xmlBufferPtr buf; /* An XML buffer. */ 9386 int n_buf; 9387 xmlEntityPtr ent; /* An entity table */ 9388 int n_ent; 9389 9390 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 9391 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) { 9392 mem_base = xmlMemBlocks(); 9393 buf = gen_xmlBufferPtr(n_buf, 0); 9394 ent = gen_xmlEntityPtr(n_ent, 1); 9395 9396 xmlDumpEntityDecl(buf, ent); 9397 call_tests++; 9398 des_xmlBufferPtr(n_buf, buf, 0); 9399 des_xmlEntityPtr(n_ent, ent, 1); 9400 xmlResetLastError(); 9401 if (mem_base != xmlMemBlocks()) { 9402 printf("Leak of %d blocks found in xmlDumpEntityDecl", 9403 xmlMemBlocks() - mem_base); 9404 test_ret++; 9405 printf(" %d", n_buf); 9406 printf(" %d", n_ent); 9407 printf("\n"); 9408 } 9409 } 9410 } 9411 function_tests++; 9412 #endif 9413 9414 return(test_ret); 9415 } 9416 9417 9418 static int 9419 test_xmlEncodeEntitiesReentrant(void) { 9420 int test_ret = 0; 9421 9422 int mem_base; 9423 xmlChar * ret_val; 9424 xmlDocPtr doc; /* the document containing the string */ 9425 int n_doc; 9426 xmlChar * input; /* A string to convert to XML. */ 9427 int n_input; 9428 9429 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9430 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { 9431 mem_base = xmlMemBlocks(); 9432 doc = gen_xmlDocPtr(n_doc, 0); 9433 input = gen_const_xmlChar_ptr(n_input, 1); 9434 9435 ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input); 9436 desret_xmlChar_ptr(ret_val); 9437 call_tests++; 9438 des_xmlDocPtr(n_doc, doc, 0); 9439 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1); 9440 xmlResetLastError(); 9441 if (mem_base != xmlMemBlocks()) { 9442 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant", 9443 xmlMemBlocks() - mem_base); 9444 test_ret++; 9445 printf(" %d", n_doc); 9446 printf(" %d", n_input); 9447 printf("\n"); 9448 } 9449 } 9450 } 9451 function_tests++; 9452 9453 return(test_ret); 9454 } 9455 9456 9457 #define gen_nb_const_xmlDoc_ptr 1 9458 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9459 return(NULL); 9460 } 9461 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9462 } 9463 9464 static int 9465 test_xmlEncodeSpecialChars(void) { 9466 int test_ret = 0; 9467 9468 int mem_base; 9469 xmlChar * ret_val; 9470 xmlDoc * doc; /* the document containing the string */ 9471 int n_doc; 9472 xmlChar * input; /* A string to convert to XML. */ 9473 int n_input; 9474 9475 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 9476 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { 9477 mem_base = xmlMemBlocks(); 9478 doc = gen_const_xmlDoc_ptr(n_doc, 0); 9479 input = gen_const_xmlChar_ptr(n_input, 1); 9480 9481 ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input); 9482 desret_xmlChar_ptr(ret_val); 9483 call_tests++; 9484 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 9485 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1); 9486 xmlResetLastError(); 9487 if (mem_base != xmlMemBlocks()) { 9488 printf("Leak of %d blocks found in xmlEncodeSpecialChars", 9489 xmlMemBlocks() - mem_base); 9490 test_ret++; 9491 printf(" %d", n_doc); 9492 printf(" %d", n_input); 9493 printf("\n"); 9494 } 9495 } 9496 } 9497 function_tests++; 9498 9499 return(test_ret); 9500 } 9501 9502 9503 static int 9504 test_xmlGetDocEntity(void) { 9505 int test_ret = 0; 9506 9507 int mem_base; 9508 xmlEntityPtr ret_val; 9509 xmlDoc * doc; /* the document referencing the entity */ 9510 int n_doc; 9511 xmlChar * name; /* the entity name */ 9512 int n_name; 9513 9514 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 9515 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9516 mem_base = xmlMemBlocks(); 9517 doc = gen_const_xmlDoc_ptr(n_doc, 0); 9518 name = gen_const_xmlChar_ptr(n_name, 1); 9519 9520 ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name); 9521 desret_xmlEntityPtr(ret_val); 9522 call_tests++; 9523 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 9524 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9525 xmlResetLastError(); 9526 if (mem_base != xmlMemBlocks()) { 9527 printf("Leak of %d blocks found in xmlGetDocEntity", 9528 xmlMemBlocks() - mem_base); 9529 test_ret++; 9530 printf(" %d", n_doc); 9531 printf(" %d", n_name); 9532 printf("\n"); 9533 } 9534 } 9535 } 9536 function_tests++; 9537 9538 return(test_ret); 9539 } 9540 9541 9542 static int 9543 test_xmlGetDtdEntity(void) { 9544 int test_ret = 0; 9545 9546 int mem_base; 9547 xmlEntityPtr ret_val; 9548 xmlDocPtr doc; /* the document referencing the entity */ 9549 int n_doc; 9550 xmlChar * name; /* the entity name */ 9551 int n_name; 9552 9553 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9554 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9555 mem_base = xmlMemBlocks(); 9556 doc = gen_xmlDocPtr(n_doc, 0); 9557 name = gen_const_xmlChar_ptr(n_name, 1); 9558 9559 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name); 9560 desret_xmlEntityPtr(ret_val); 9561 call_tests++; 9562 des_xmlDocPtr(n_doc, doc, 0); 9563 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9564 xmlResetLastError(); 9565 if (mem_base != xmlMemBlocks()) { 9566 printf("Leak of %d blocks found in xmlGetDtdEntity", 9567 xmlMemBlocks() - mem_base); 9568 test_ret++; 9569 printf(" %d", n_doc); 9570 printf(" %d", n_name); 9571 printf("\n"); 9572 } 9573 } 9574 } 9575 function_tests++; 9576 9577 return(test_ret); 9578 } 9579 9580 9581 static int 9582 test_xmlGetParameterEntity(void) { 9583 int test_ret = 0; 9584 9585 int mem_base; 9586 xmlEntityPtr ret_val; 9587 xmlDocPtr doc; /* the document referencing the entity */ 9588 int n_doc; 9589 xmlChar * name; /* the entity name */ 9590 int n_name; 9591 9592 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9593 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9594 mem_base = xmlMemBlocks(); 9595 doc = gen_xmlDocPtr(n_doc, 0); 9596 name = gen_const_xmlChar_ptr(n_name, 1); 9597 9598 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name); 9599 desret_xmlEntityPtr(ret_val); 9600 call_tests++; 9601 des_xmlDocPtr(n_doc, doc, 0); 9602 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9603 xmlResetLastError(); 9604 if (mem_base != xmlMemBlocks()) { 9605 printf("Leak of %d blocks found in xmlGetParameterEntity", 9606 xmlMemBlocks() - mem_base); 9607 test_ret++; 9608 printf(" %d", n_doc); 9609 printf(" %d", n_name); 9610 printf("\n"); 9611 } 9612 } 9613 } 9614 function_tests++; 9615 9616 return(test_ret); 9617 } 9618 9619 9620 static int 9621 test_xmlGetPredefinedEntity(void) { 9622 int test_ret = 0; 9623 9624 int mem_base; 9625 xmlEntityPtr ret_val; 9626 xmlChar * name; /* the entity name */ 9627 int n_name; 9628 9629 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9630 mem_base = xmlMemBlocks(); 9631 name = gen_const_xmlChar_ptr(n_name, 0); 9632 9633 ret_val = xmlGetPredefinedEntity((const xmlChar *)name); 9634 desret_xmlEntityPtr(ret_val); 9635 call_tests++; 9636 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 9637 xmlResetLastError(); 9638 if (mem_base != xmlMemBlocks()) { 9639 printf("Leak of %d blocks found in xmlGetPredefinedEntity", 9640 xmlMemBlocks() - mem_base); 9641 test_ret++; 9642 printf(" %d", n_name); 9643 printf("\n"); 9644 } 9645 } 9646 function_tests++; 9647 9648 return(test_ret); 9649 } 9650 9651 9652 static int 9653 test_xmlInitializePredefinedEntities(void) { 9654 int test_ret = 0; 9655 9656 #if defined(LIBXML_LEGACY_ENABLED) 9657 #ifdef LIBXML_LEGACY_ENABLED 9658 int mem_base; 9659 9660 mem_base = xmlMemBlocks(); 9661 9662 xmlInitializePredefinedEntities(); 9663 call_tests++; 9664 xmlResetLastError(); 9665 if (mem_base != xmlMemBlocks()) { 9666 printf("Leak of %d blocks found in xmlInitializePredefinedEntities", 9667 xmlMemBlocks() - mem_base); 9668 test_ret++; 9669 printf("\n"); 9670 } 9671 function_tests++; 9672 #endif 9673 #endif 9674 9675 return(test_ret); 9676 } 9677 9678 9679 static int 9680 test_xmlNewEntity(void) { 9681 int test_ret = 0; 9682 9683 int mem_base; 9684 xmlEntityPtr ret_val; 9685 xmlDocPtr doc; /* the document */ 9686 int n_doc; 9687 xmlChar * name; /* the entity name */ 9688 int n_name; 9689 int type; /* the entity type XML_xxx_yyy_ENTITY */ 9690 int n_type; 9691 xmlChar * ExternalID; /* the entity external ID if available */ 9692 int n_ExternalID; 9693 xmlChar * SystemID; /* the entity system ID if available */ 9694 int n_SystemID; 9695 xmlChar * content; /* the entity content */ 9696 int n_content; 9697 9698 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9699 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9700 for (n_type = 0;n_type < gen_nb_int;n_type++) { 9701 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 9702 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 9703 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 9704 mem_base = xmlMemBlocks(); 9705 doc = gen_xmlDocPtr(n_doc, 0); 9706 name = gen_const_xmlChar_ptr(n_name, 1); 9707 type = gen_int(n_type, 2); 9708 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); 9709 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); 9710 content = gen_const_xmlChar_ptr(n_content, 5); 9711 9712 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); 9713 desret_xmlEntityPtr(ret_val); 9714 call_tests++; 9715 des_xmlDocPtr(n_doc, doc, 0); 9716 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9717 des_int(n_type, type, 2); 9718 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); 9719 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); 9720 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); 9721 xmlResetLastError(); 9722 if (mem_base != xmlMemBlocks()) { 9723 printf("Leak of %d blocks found in xmlNewEntity", 9724 xmlMemBlocks() - mem_base); 9725 test_ret++; 9726 printf(" %d", n_doc); 9727 printf(" %d", n_name); 9728 printf(" %d", n_type); 9729 printf(" %d", n_ExternalID); 9730 printf(" %d", n_SystemID); 9731 printf(" %d", n_content); 9732 printf("\n"); 9733 } 9734 } 9735 } 9736 } 9737 } 9738 } 9739 } 9740 function_tests++; 9741 9742 return(test_ret); 9743 } 9744 9745 static int 9746 test_entities(void) { 9747 int test_ret = 0; 9748 9749 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n"); 9750 test_ret += test_xmlAddDocEntity(); 9751 test_ret += test_xmlAddDtdEntity(); 9752 test_ret += test_xmlCleanupPredefinedEntities(); 9753 test_ret += test_xmlCopyEntitiesTable(); 9754 test_ret += test_xmlCreateEntitiesTable(); 9755 test_ret += test_xmlDumpEntitiesTable(); 9756 test_ret += test_xmlDumpEntityDecl(); 9757 test_ret += test_xmlEncodeEntitiesReentrant(); 9758 test_ret += test_xmlEncodeSpecialChars(); 9759 test_ret += test_xmlGetDocEntity(); 9760 test_ret += test_xmlGetDtdEntity(); 9761 test_ret += test_xmlGetParameterEntity(); 9762 test_ret += test_xmlGetPredefinedEntity(); 9763 test_ret += test_xmlInitializePredefinedEntities(); 9764 test_ret += test_xmlNewEntity(); 9765 9766 if (test_ret != 0) 9767 printf("Module entities: %d errors\n", test_ret); 9768 return(test_ret); 9769 } 9770 9771 static int 9772 test_xmlHashAddEntry(void) { 9773 int test_ret = 0; 9774 9775 int mem_base; 9776 int ret_val; 9777 xmlHashTablePtr table; /* the hash table */ 9778 int n_table; 9779 xmlChar * name; /* the name of the userdata */ 9780 int n_name; 9781 void * userdata; /* a pointer to the userdata */ 9782 int n_userdata; 9783 9784 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9785 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9786 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 9787 mem_base = xmlMemBlocks(); 9788 table = gen_xmlHashTablePtr(n_table, 0); 9789 name = gen_const_xmlChar_ptr(n_name, 1); 9790 userdata = gen_userdata(n_userdata, 2); 9791 9792 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata); 9793 desret_int(ret_val); 9794 call_tests++; 9795 des_xmlHashTablePtr(n_table, table, 0); 9796 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9797 des_userdata(n_userdata, userdata, 2); 9798 xmlResetLastError(); 9799 if (mem_base != xmlMemBlocks()) { 9800 printf("Leak of %d blocks found in xmlHashAddEntry", 9801 xmlMemBlocks() - mem_base); 9802 test_ret++; 9803 printf(" %d", n_table); 9804 printf(" %d", n_name); 9805 printf(" %d", n_userdata); 9806 printf("\n"); 9807 } 9808 } 9809 } 9810 } 9811 function_tests++; 9812 9813 return(test_ret); 9814 } 9815 9816 9817 static int 9818 test_xmlHashAddEntry2(void) { 9819 int test_ret = 0; 9820 9821 int mem_base; 9822 int ret_val; 9823 xmlHashTablePtr table; /* the hash table */ 9824 int n_table; 9825 xmlChar * name; /* the name of the userdata */ 9826 int n_name; 9827 xmlChar * name2; /* a second name of the userdata */ 9828 int n_name2; 9829 void * userdata; /* a pointer to the userdata */ 9830 int n_userdata; 9831 9832 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9833 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9834 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 9835 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 9836 mem_base = xmlMemBlocks(); 9837 table = gen_xmlHashTablePtr(n_table, 0); 9838 name = gen_const_xmlChar_ptr(n_name, 1); 9839 name2 = gen_const_xmlChar_ptr(n_name2, 2); 9840 userdata = gen_userdata(n_userdata, 3); 9841 9842 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata); 9843 desret_int(ret_val); 9844 call_tests++; 9845 des_xmlHashTablePtr(n_table, table, 0); 9846 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9847 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 9848 des_userdata(n_userdata, userdata, 3); 9849 xmlResetLastError(); 9850 if (mem_base != xmlMemBlocks()) { 9851 printf("Leak of %d blocks found in xmlHashAddEntry2", 9852 xmlMemBlocks() - mem_base); 9853 test_ret++; 9854 printf(" %d", n_table); 9855 printf(" %d", n_name); 9856 printf(" %d", n_name2); 9857 printf(" %d", n_userdata); 9858 printf("\n"); 9859 } 9860 } 9861 } 9862 } 9863 } 9864 function_tests++; 9865 9866 return(test_ret); 9867 } 9868 9869 9870 static int 9871 test_xmlHashAddEntry3(void) { 9872 int test_ret = 0; 9873 9874 int mem_base; 9875 int ret_val; 9876 xmlHashTablePtr table; /* the hash table */ 9877 int n_table; 9878 xmlChar * name; /* the name of the userdata */ 9879 int n_name; 9880 xmlChar * name2; /* a second name of the userdata */ 9881 int n_name2; 9882 xmlChar * name3; /* a third name of the userdata */ 9883 int n_name3; 9884 void * userdata; /* a pointer to the userdata */ 9885 int n_userdata; 9886 9887 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9888 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9889 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 9890 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 9891 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 9892 mem_base = xmlMemBlocks(); 9893 table = gen_xmlHashTablePtr(n_table, 0); 9894 name = gen_const_xmlChar_ptr(n_name, 1); 9895 name2 = gen_const_xmlChar_ptr(n_name2, 2); 9896 name3 = gen_const_xmlChar_ptr(n_name3, 3); 9897 userdata = gen_userdata(n_userdata, 4); 9898 9899 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata); 9900 desret_int(ret_val); 9901 call_tests++; 9902 des_xmlHashTablePtr(n_table, table, 0); 9903 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9904 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 9905 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 9906 des_userdata(n_userdata, userdata, 4); 9907 xmlResetLastError(); 9908 if (mem_base != xmlMemBlocks()) { 9909 printf("Leak of %d blocks found in xmlHashAddEntry3", 9910 xmlMemBlocks() - mem_base); 9911 test_ret++; 9912 printf(" %d", n_table); 9913 printf(" %d", n_name); 9914 printf(" %d", n_name2); 9915 printf(" %d", n_name3); 9916 printf(" %d", n_userdata); 9917 printf("\n"); 9918 } 9919 } 9920 } 9921 } 9922 } 9923 } 9924 function_tests++; 9925 9926 return(test_ret); 9927 } 9928 9929 9930 static int 9931 test_xmlHashCopy(void) { 9932 int test_ret = 0; 9933 9934 9935 /* missing type support */ 9936 return(test_ret); 9937 } 9938 9939 9940 static int 9941 test_xmlHashCreate(void) { 9942 int test_ret = 0; 9943 9944 9945 /* missing type support */ 9946 return(test_ret); 9947 } 9948 9949 9950 static int 9951 test_xmlHashCreateDict(void) { 9952 int test_ret = 0; 9953 9954 9955 /* missing type support */ 9956 return(test_ret); 9957 } 9958 9959 9960 static int 9961 test_xmlHashLookup(void) { 9962 int test_ret = 0; 9963 9964 int mem_base; 9965 void * ret_val; 9966 xmlHashTablePtr table; /* the hash table */ 9967 int n_table; 9968 xmlChar * name; /* the name of the userdata */ 9969 int n_name; 9970 9971 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9972 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9973 mem_base = xmlMemBlocks(); 9974 table = gen_xmlHashTablePtr(n_table, 0); 9975 name = gen_const_xmlChar_ptr(n_name, 1); 9976 9977 ret_val = xmlHashLookup(table, (const xmlChar *)name); 9978 desret_void_ptr(ret_val); 9979 call_tests++; 9980 des_xmlHashTablePtr(n_table, table, 0); 9981 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9982 xmlResetLastError(); 9983 if (mem_base != xmlMemBlocks()) { 9984 printf("Leak of %d blocks found in xmlHashLookup", 9985 xmlMemBlocks() - mem_base); 9986 test_ret++; 9987 printf(" %d", n_table); 9988 printf(" %d", n_name); 9989 printf("\n"); 9990 } 9991 } 9992 } 9993 function_tests++; 9994 9995 return(test_ret); 9996 } 9997 9998 9999 static int 10000 test_xmlHashLookup2(void) { 10001 int test_ret = 0; 10002 10003 int mem_base; 10004 void * ret_val; 10005 xmlHashTablePtr table; /* the hash table */ 10006 int n_table; 10007 xmlChar * name; /* the name of the userdata */ 10008 int n_name; 10009 xmlChar * name2; /* a second name of the userdata */ 10010 int n_name2; 10011 10012 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10013 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10014 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10015 mem_base = xmlMemBlocks(); 10016 table = gen_xmlHashTablePtr(n_table, 0); 10017 name = gen_const_xmlChar_ptr(n_name, 1); 10018 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10019 10020 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2); 10021 desret_void_ptr(ret_val); 10022 call_tests++; 10023 des_xmlHashTablePtr(n_table, table, 0); 10024 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10025 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10026 xmlResetLastError(); 10027 if (mem_base != xmlMemBlocks()) { 10028 printf("Leak of %d blocks found in xmlHashLookup2", 10029 xmlMemBlocks() - mem_base); 10030 test_ret++; 10031 printf(" %d", n_table); 10032 printf(" %d", n_name); 10033 printf(" %d", n_name2); 10034 printf("\n"); 10035 } 10036 } 10037 } 10038 } 10039 function_tests++; 10040 10041 return(test_ret); 10042 } 10043 10044 10045 static int 10046 test_xmlHashLookup3(void) { 10047 int test_ret = 0; 10048 10049 int mem_base; 10050 void * ret_val; 10051 xmlHashTablePtr table; /* the hash table */ 10052 int n_table; 10053 xmlChar * name; /* the name of the userdata */ 10054 int n_name; 10055 xmlChar * name2; /* a second name of the userdata */ 10056 int n_name2; 10057 xmlChar * name3; /* a third name of the userdata */ 10058 int n_name3; 10059 10060 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10061 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10062 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10063 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10064 mem_base = xmlMemBlocks(); 10065 table = gen_xmlHashTablePtr(n_table, 0); 10066 name = gen_const_xmlChar_ptr(n_name, 1); 10067 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10068 name3 = gen_const_xmlChar_ptr(n_name3, 3); 10069 10070 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3); 10071 desret_void_ptr(ret_val); 10072 call_tests++; 10073 des_xmlHashTablePtr(n_table, table, 0); 10074 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10075 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10076 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 10077 xmlResetLastError(); 10078 if (mem_base != xmlMemBlocks()) { 10079 printf("Leak of %d blocks found in xmlHashLookup3", 10080 xmlMemBlocks() - mem_base); 10081 test_ret++; 10082 printf(" %d", n_table); 10083 printf(" %d", n_name); 10084 printf(" %d", n_name2); 10085 printf(" %d", n_name3); 10086 printf("\n"); 10087 } 10088 } 10089 } 10090 } 10091 } 10092 function_tests++; 10093 10094 return(test_ret); 10095 } 10096 10097 10098 static int 10099 test_xmlHashQLookup(void) { 10100 int test_ret = 0; 10101 10102 int mem_base; 10103 void * ret_val; 10104 xmlHashTablePtr table; /* the hash table */ 10105 int n_table; 10106 xmlChar * prefix; /* the prefix of the userdata */ 10107 int n_prefix; 10108 xmlChar * name; /* the name of the userdata */ 10109 int n_name; 10110 10111 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10112 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 10113 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10114 mem_base = xmlMemBlocks(); 10115 table = gen_xmlHashTablePtr(n_table, 0); 10116 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 10117 name = gen_const_xmlChar_ptr(n_name, 2); 10118 10119 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name); 10120 desret_void_ptr(ret_val); 10121 call_tests++; 10122 des_xmlHashTablePtr(n_table, table, 0); 10123 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 10124 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 10125 xmlResetLastError(); 10126 if (mem_base != xmlMemBlocks()) { 10127 printf("Leak of %d blocks found in xmlHashQLookup", 10128 xmlMemBlocks() - mem_base); 10129 test_ret++; 10130 printf(" %d", n_table); 10131 printf(" %d", n_prefix); 10132 printf(" %d", n_name); 10133 printf("\n"); 10134 } 10135 } 10136 } 10137 } 10138 function_tests++; 10139 10140 return(test_ret); 10141 } 10142 10143 10144 static int 10145 test_xmlHashQLookup2(void) { 10146 int test_ret = 0; 10147 10148 int mem_base; 10149 void * ret_val; 10150 xmlHashTablePtr table; /* the hash table */ 10151 int n_table; 10152 xmlChar * prefix; /* the prefix of the userdata */ 10153 int n_prefix; 10154 xmlChar * name; /* the name of the userdata */ 10155 int n_name; 10156 xmlChar * prefix2; /* the second prefix of the userdata */ 10157 int n_prefix2; 10158 xmlChar * name2; /* a second name of the userdata */ 10159 int n_name2; 10160 10161 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10162 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 10163 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10164 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) { 10165 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10166 mem_base = xmlMemBlocks(); 10167 table = gen_xmlHashTablePtr(n_table, 0); 10168 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 10169 name = gen_const_xmlChar_ptr(n_name, 2); 10170 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3); 10171 name2 = gen_const_xmlChar_ptr(n_name2, 4); 10172 10173 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2); 10174 desret_void_ptr(ret_val); 10175 call_tests++; 10176 des_xmlHashTablePtr(n_table, table, 0); 10177 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 10178 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 10179 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3); 10180 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4); 10181 xmlResetLastError(); 10182 if (mem_base != xmlMemBlocks()) { 10183 printf("Leak of %d blocks found in xmlHashQLookup2", 10184 xmlMemBlocks() - mem_base); 10185 test_ret++; 10186 printf(" %d", n_table); 10187 printf(" %d", n_prefix); 10188 printf(" %d", n_name); 10189 printf(" %d", n_prefix2); 10190 printf(" %d", n_name2); 10191 printf("\n"); 10192 } 10193 } 10194 } 10195 } 10196 } 10197 } 10198 function_tests++; 10199 10200 return(test_ret); 10201 } 10202 10203 10204 static int 10205 test_xmlHashQLookup3(void) { 10206 int test_ret = 0; 10207 10208 int mem_base; 10209 void * ret_val; 10210 xmlHashTablePtr table; /* the hash table */ 10211 int n_table; 10212 xmlChar * prefix; /* the prefix of the userdata */ 10213 int n_prefix; 10214 xmlChar * name; /* the name of the userdata */ 10215 int n_name; 10216 xmlChar * prefix2; /* the second prefix of the userdata */ 10217 int n_prefix2; 10218 xmlChar * name2; /* a second name of the userdata */ 10219 int n_name2; 10220 xmlChar * prefix3; /* the third prefix of the userdata */ 10221 int n_prefix3; 10222 xmlChar * name3; /* a third name of the userdata */ 10223 int n_name3; 10224 10225 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10226 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 10227 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10228 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) { 10229 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10230 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) { 10231 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10232 mem_base = xmlMemBlocks(); 10233 table = gen_xmlHashTablePtr(n_table, 0); 10234 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 10235 name = gen_const_xmlChar_ptr(n_name, 2); 10236 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3); 10237 name2 = gen_const_xmlChar_ptr(n_name2, 4); 10238 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5); 10239 name3 = gen_const_xmlChar_ptr(n_name3, 6); 10240 10241 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3); 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 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5); 10250 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6); 10251 xmlResetLastError(); 10252 if (mem_base != xmlMemBlocks()) { 10253 printf("Leak of %d blocks found in xmlHashQLookup3", 10254 xmlMemBlocks() - mem_base); 10255 test_ret++; 10256 printf(" %d", n_table); 10257 printf(" %d", n_prefix); 10258 printf(" %d", n_name); 10259 printf(" %d", n_prefix2); 10260 printf(" %d", n_name2); 10261 printf(" %d", n_prefix3); 10262 printf(" %d", n_name3); 10263 printf("\n"); 10264 } 10265 } 10266 } 10267 } 10268 } 10269 } 10270 } 10271 } 10272 function_tests++; 10273 10274 return(test_ret); 10275 } 10276 10277 10278 static int 10279 test_xmlHashRemoveEntry(void) { 10280 int test_ret = 0; 10281 10282 int mem_base; 10283 int ret_val; 10284 xmlHashTablePtr table; /* the hash table */ 10285 int n_table; 10286 xmlChar * name; /* the name of the userdata */ 10287 int n_name; 10288 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ 10289 int n_f; 10290 10291 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10292 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10293 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10294 mem_base = xmlMemBlocks(); 10295 table = gen_xmlHashTablePtr(n_table, 0); 10296 name = gen_const_xmlChar_ptr(n_name, 1); 10297 f = gen_xmlHashDeallocator(n_f, 2); 10298 10299 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f); 10300 desret_int(ret_val); 10301 call_tests++; 10302 des_xmlHashTablePtr(n_table, table, 0); 10303 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10304 des_xmlHashDeallocator(n_f, f, 2); 10305 xmlResetLastError(); 10306 if (mem_base != xmlMemBlocks()) { 10307 printf("Leak of %d blocks found in xmlHashRemoveEntry", 10308 xmlMemBlocks() - mem_base); 10309 test_ret++; 10310 printf(" %d", n_table); 10311 printf(" %d", n_name); 10312 printf(" %d", n_f); 10313 printf("\n"); 10314 } 10315 } 10316 } 10317 } 10318 function_tests++; 10319 10320 return(test_ret); 10321 } 10322 10323 10324 static int 10325 test_xmlHashRemoveEntry2(void) { 10326 int test_ret = 0; 10327 10328 int mem_base; 10329 int ret_val; 10330 xmlHashTablePtr table; /* the hash table */ 10331 int n_table; 10332 xmlChar * name; /* the name of the userdata */ 10333 int n_name; 10334 xmlChar * name2; /* a second name of the userdata */ 10335 int n_name2; 10336 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ 10337 int n_f; 10338 10339 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10340 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10341 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10342 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10343 mem_base = xmlMemBlocks(); 10344 table = gen_xmlHashTablePtr(n_table, 0); 10345 name = gen_const_xmlChar_ptr(n_name, 1); 10346 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10347 f = gen_xmlHashDeallocator(n_f, 3); 10348 10349 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f); 10350 desret_int(ret_val); 10351 call_tests++; 10352 des_xmlHashTablePtr(n_table, table, 0); 10353 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10354 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10355 des_xmlHashDeallocator(n_f, f, 3); 10356 xmlResetLastError(); 10357 if (mem_base != xmlMemBlocks()) { 10358 printf("Leak of %d blocks found in xmlHashRemoveEntry2", 10359 xmlMemBlocks() - mem_base); 10360 test_ret++; 10361 printf(" %d", n_table); 10362 printf(" %d", n_name); 10363 printf(" %d", n_name2); 10364 printf(" %d", n_f); 10365 printf("\n"); 10366 } 10367 } 10368 } 10369 } 10370 } 10371 function_tests++; 10372 10373 return(test_ret); 10374 } 10375 10376 10377 static int 10378 test_xmlHashRemoveEntry3(void) { 10379 int test_ret = 0; 10380 10381 int mem_base; 10382 int ret_val; 10383 xmlHashTablePtr table; /* the hash table */ 10384 int n_table; 10385 xmlChar * name; /* the name of the userdata */ 10386 int n_name; 10387 xmlChar * name2; /* a second name of the userdata */ 10388 int n_name2; 10389 xmlChar * name3; /* a third name of the userdata */ 10390 int n_name3; 10391 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ 10392 int n_f; 10393 10394 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10395 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10396 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10397 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10398 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10399 mem_base = xmlMemBlocks(); 10400 table = gen_xmlHashTablePtr(n_table, 0); 10401 name = gen_const_xmlChar_ptr(n_name, 1); 10402 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10403 name3 = gen_const_xmlChar_ptr(n_name3, 3); 10404 f = gen_xmlHashDeallocator(n_f, 4); 10405 10406 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f); 10407 desret_int(ret_val); 10408 call_tests++; 10409 des_xmlHashTablePtr(n_table, table, 0); 10410 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10411 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10412 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 10413 des_xmlHashDeallocator(n_f, f, 4); 10414 xmlResetLastError(); 10415 if (mem_base != xmlMemBlocks()) { 10416 printf("Leak of %d blocks found in xmlHashRemoveEntry3", 10417 xmlMemBlocks() - mem_base); 10418 test_ret++; 10419 printf(" %d", n_table); 10420 printf(" %d", n_name); 10421 printf(" %d", n_name2); 10422 printf(" %d", n_name3); 10423 printf(" %d", n_f); 10424 printf("\n"); 10425 } 10426 } 10427 } 10428 } 10429 } 10430 } 10431 function_tests++; 10432 10433 return(test_ret); 10434 } 10435 10436 10437 static int 10438 test_xmlHashScan(void) { 10439 int test_ret = 0; 10440 10441 10442 /* missing type support */ 10443 return(test_ret); 10444 } 10445 10446 10447 static int 10448 test_xmlHashScan3(void) { 10449 int test_ret = 0; 10450 10451 10452 /* missing type support */ 10453 return(test_ret); 10454 } 10455 10456 10457 static int 10458 test_xmlHashScanFull(void) { 10459 int test_ret = 0; 10460 10461 10462 /* missing type support */ 10463 return(test_ret); 10464 } 10465 10466 10467 static int 10468 test_xmlHashScanFull3(void) { 10469 int test_ret = 0; 10470 10471 10472 /* missing type support */ 10473 return(test_ret); 10474 } 10475 10476 10477 static int 10478 test_xmlHashSize(void) { 10479 int test_ret = 0; 10480 10481 int mem_base; 10482 int ret_val; 10483 xmlHashTablePtr table; /* the hash table */ 10484 int n_table; 10485 10486 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10487 mem_base = xmlMemBlocks(); 10488 table = gen_xmlHashTablePtr(n_table, 0); 10489 10490 ret_val = xmlHashSize(table); 10491 desret_int(ret_val); 10492 call_tests++; 10493 des_xmlHashTablePtr(n_table, table, 0); 10494 xmlResetLastError(); 10495 if (mem_base != xmlMemBlocks()) { 10496 printf("Leak of %d blocks found in xmlHashSize", 10497 xmlMemBlocks() - mem_base); 10498 test_ret++; 10499 printf(" %d", n_table); 10500 printf("\n"); 10501 } 10502 } 10503 function_tests++; 10504 10505 return(test_ret); 10506 } 10507 10508 10509 static int 10510 test_xmlHashUpdateEntry(void) { 10511 int test_ret = 0; 10512 10513 int mem_base; 10514 int ret_val; 10515 xmlHashTablePtr table; /* the hash table */ 10516 int n_table; 10517 xmlChar * name; /* the name of the userdata */ 10518 int n_name; 10519 void * userdata; /* a pointer to the userdata */ 10520 int n_userdata; 10521 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ 10522 int n_f; 10523 10524 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10525 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10526 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 10527 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10528 mem_base = xmlMemBlocks(); 10529 table = gen_xmlHashTablePtr(n_table, 0); 10530 name = gen_const_xmlChar_ptr(n_name, 1); 10531 userdata = gen_userdata(n_userdata, 2); 10532 f = gen_xmlHashDeallocator(n_f, 3); 10533 10534 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f); 10535 desret_int(ret_val); 10536 call_tests++; 10537 des_xmlHashTablePtr(n_table, table, 0); 10538 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10539 des_userdata(n_userdata, userdata, 2); 10540 des_xmlHashDeallocator(n_f, f, 3); 10541 xmlResetLastError(); 10542 if (mem_base != xmlMemBlocks()) { 10543 printf("Leak of %d blocks found in xmlHashUpdateEntry", 10544 xmlMemBlocks() - mem_base); 10545 test_ret++; 10546 printf(" %d", n_table); 10547 printf(" %d", n_name); 10548 printf(" %d", n_userdata); 10549 printf(" %d", n_f); 10550 printf("\n"); 10551 } 10552 } 10553 } 10554 } 10555 } 10556 function_tests++; 10557 10558 return(test_ret); 10559 } 10560 10561 10562 static int 10563 test_xmlHashUpdateEntry2(void) { 10564 int test_ret = 0; 10565 10566 int mem_base; 10567 int ret_val; 10568 xmlHashTablePtr table; /* the hash table */ 10569 int n_table; 10570 xmlChar * name; /* the name of the userdata */ 10571 int n_name; 10572 xmlChar * name2; /* a second name of the userdata */ 10573 int n_name2; 10574 void * userdata; /* a pointer to the userdata */ 10575 int n_userdata; 10576 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ 10577 int n_f; 10578 10579 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10580 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10581 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10582 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 10583 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10584 mem_base = xmlMemBlocks(); 10585 table = gen_xmlHashTablePtr(n_table, 0); 10586 name = gen_const_xmlChar_ptr(n_name, 1); 10587 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10588 userdata = gen_userdata(n_userdata, 3); 10589 f = gen_xmlHashDeallocator(n_f, 4); 10590 10591 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f); 10592 desret_int(ret_val); 10593 call_tests++; 10594 des_xmlHashTablePtr(n_table, table, 0); 10595 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10596 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10597 des_userdata(n_userdata, userdata, 3); 10598 des_xmlHashDeallocator(n_f, f, 4); 10599 xmlResetLastError(); 10600 if (mem_base != xmlMemBlocks()) { 10601 printf("Leak of %d blocks found in xmlHashUpdateEntry2", 10602 xmlMemBlocks() - mem_base); 10603 test_ret++; 10604 printf(" %d", n_table); 10605 printf(" %d", n_name); 10606 printf(" %d", n_name2); 10607 printf(" %d", n_userdata); 10608 printf(" %d", n_f); 10609 printf("\n"); 10610 } 10611 } 10612 } 10613 } 10614 } 10615 } 10616 function_tests++; 10617 10618 return(test_ret); 10619 } 10620 10621 10622 static int 10623 test_xmlHashUpdateEntry3(void) { 10624 int test_ret = 0; 10625 10626 int mem_base; 10627 int ret_val; 10628 xmlHashTablePtr table; /* the hash table */ 10629 int n_table; 10630 xmlChar * name; /* the name of the userdata */ 10631 int n_name; 10632 xmlChar * name2; /* a second name of the userdata */ 10633 int n_name2; 10634 xmlChar * name3; /* a third name of the userdata */ 10635 int n_name3; 10636 void * userdata; /* a pointer to the userdata */ 10637 int n_userdata; 10638 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ 10639 int n_f; 10640 10641 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10642 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10643 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10644 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10645 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 10646 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10647 mem_base = xmlMemBlocks(); 10648 table = gen_xmlHashTablePtr(n_table, 0); 10649 name = gen_const_xmlChar_ptr(n_name, 1); 10650 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10651 name3 = gen_const_xmlChar_ptr(n_name3, 3); 10652 userdata = gen_userdata(n_userdata, 4); 10653 f = gen_xmlHashDeallocator(n_f, 5); 10654 10655 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f); 10656 desret_int(ret_val); 10657 call_tests++; 10658 des_xmlHashTablePtr(n_table, table, 0); 10659 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10660 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10661 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 10662 des_userdata(n_userdata, userdata, 4); 10663 des_xmlHashDeallocator(n_f, f, 5); 10664 xmlResetLastError(); 10665 if (mem_base != xmlMemBlocks()) { 10666 printf("Leak of %d blocks found in xmlHashUpdateEntry3", 10667 xmlMemBlocks() - mem_base); 10668 test_ret++; 10669 printf(" %d", n_table); 10670 printf(" %d", n_name); 10671 printf(" %d", n_name2); 10672 printf(" %d", n_name3); 10673 printf(" %d", n_userdata); 10674 printf(" %d", n_f); 10675 printf("\n"); 10676 } 10677 } 10678 } 10679 } 10680 } 10681 } 10682 } 10683 function_tests++; 10684 10685 return(test_ret); 10686 } 10687 10688 static int 10689 test_hash(void) { 10690 int test_ret = 0; 10691 10692 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n"); 10693 test_ret += test_xmlHashAddEntry(); 10694 test_ret += test_xmlHashAddEntry2(); 10695 test_ret += test_xmlHashAddEntry3(); 10696 test_ret += test_xmlHashCopy(); 10697 test_ret += test_xmlHashCreate(); 10698 test_ret += test_xmlHashCreateDict(); 10699 test_ret += test_xmlHashLookup(); 10700 test_ret += test_xmlHashLookup2(); 10701 test_ret += test_xmlHashLookup3(); 10702 test_ret += test_xmlHashQLookup(); 10703 test_ret += test_xmlHashQLookup2(); 10704 test_ret += test_xmlHashQLookup3(); 10705 test_ret += test_xmlHashRemoveEntry(); 10706 test_ret += test_xmlHashRemoveEntry2(); 10707 test_ret += test_xmlHashRemoveEntry3(); 10708 test_ret += test_xmlHashScan(); 10709 test_ret += test_xmlHashScan3(); 10710 test_ret += test_xmlHashScanFull(); 10711 test_ret += test_xmlHashScanFull3(); 10712 test_ret += test_xmlHashSize(); 10713 test_ret += test_xmlHashUpdateEntry(); 10714 test_ret += test_xmlHashUpdateEntry2(); 10715 test_ret += test_xmlHashUpdateEntry3(); 10716 10717 if (test_ret != 0) 10718 printf("Module hash: %d errors\n", test_ret); 10719 return(test_ret); 10720 } 10721 10722 #define gen_nb_xmlLinkPtr 1 10723 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10724 return(NULL); 10725 } 10726 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10727 } 10728 10729 static int 10730 test_xmlLinkGetData(void) { 10731 int test_ret = 0; 10732 10733 int mem_base; 10734 void * ret_val; 10735 xmlLinkPtr lk; /* a link */ 10736 int n_lk; 10737 10738 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) { 10739 mem_base = xmlMemBlocks(); 10740 lk = gen_xmlLinkPtr(n_lk, 0); 10741 10742 ret_val = xmlLinkGetData(lk); 10743 desret_void_ptr(ret_val); 10744 call_tests++; 10745 des_xmlLinkPtr(n_lk, lk, 0); 10746 xmlResetLastError(); 10747 if (mem_base != xmlMemBlocks()) { 10748 printf("Leak of %d blocks found in xmlLinkGetData", 10749 xmlMemBlocks() - mem_base); 10750 test_ret++; 10751 printf(" %d", n_lk); 10752 printf("\n"); 10753 } 10754 } 10755 function_tests++; 10756 10757 return(test_ret); 10758 } 10759 10760 10761 static int 10762 test_xmlListAppend(void) { 10763 int test_ret = 0; 10764 10765 int mem_base; 10766 int ret_val; 10767 xmlListPtr l; /* a list */ 10768 int n_l; 10769 void * data; /* the data */ 10770 int n_data; 10771 10772 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10773 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 10774 mem_base = xmlMemBlocks(); 10775 l = gen_xmlListPtr(n_l, 0); 10776 data = gen_userdata(n_data, 1); 10777 10778 ret_val = xmlListAppend(l, data); 10779 desret_int(ret_val); 10780 call_tests++; 10781 des_xmlListPtr(n_l, l, 0); 10782 des_userdata(n_data, data, 1); 10783 xmlResetLastError(); 10784 if (mem_base != xmlMemBlocks()) { 10785 printf("Leak of %d blocks found in xmlListAppend", 10786 xmlMemBlocks() - mem_base); 10787 test_ret++; 10788 printf(" %d", n_l); 10789 printf(" %d", n_data); 10790 printf("\n"); 10791 } 10792 } 10793 } 10794 function_tests++; 10795 10796 return(test_ret); 10797 } 10798 10799 10800 static int 10801 test_xmlListClear(void) { 10802 int test_ret = 0; 10803 10804 int mem_base; 10805 xmlListPtr l; /* a list */ 10806 int n_l; 10807 10808 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10809 mem_base = xmlMemBlocks(); 10810 l = gen_xmlListPtr(n_l, 0); 10811 10812 xmlListClear(l); 10813 call_tests++; 10814 des_xmlListPtr(n_l, l, 0); 10815 xmlResetLastError(); 10816 if (mem_base != xmlMemBlocks()) { 10817 printf("Leak of %d blocks found in xmlListClear", 10818 xmlMemBlocks() - mem_base); 10819 test_ret++; 10820 printf(" %d", n_l); 10821 printf("\n"); 10822 } 10823 } 10824 function_tests++; 10825 10826 return(test_ret); 10827 } 10828 10829 10830 #define gen_nb_const_xmlListPtr 1 10831 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10832 return(NULL); 10833 } 10834 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10835 } 10836 10837 static int 10838 test_xmlListCopy(void) { 10839 int test_ret = 0; 10840 10841 int mem_base; 10842 int ret_val; 10843 xmlListPtr cur; /* the new list */ 10844 int n_cur; 10845 xmlListPtr old; /* the old list */ 10846 int n_old; 10847 10848 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) { 10849 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) { 10850 mem_base = xmlMemBlocks(); 10851 cur = gen_xmlListPtr(n_cur, 0); 10852 old = gen_const_xmlListPtr(n_old, 1); 10853 10854 ret_val = xmlListCopy(cur, (const xmlListPtr)old); 10855 desret_int(ret_val); 10856 call_tests++; 10857 des_xmlListPtr(n_cur, cur, 0); 10858 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1); 10859 xmlResetLastError(); 10860 if (mem_base != xmlMemBlocks()) { 10861 printf("Leak of %d blocks found in xmlListCopy", 10862 xmlMemBlocks() - mem_base); 10863 test_ret++; 10864 printf(" %d", n_cur); 10865 printf(" %d", n_old); 10866 printf("\n"); 10867 } 10868 } 10869 } 10870 function_tests++; 10871 10872 return(test_ret); 10873 } 10874 10875 10876 static int 10877 test_xmlListCreate(void) { 10878 int test_ret = 0; 10879 10880 10881 /* missing type support */ 10882 return(test_ret); 10883 } 10884 10885 10886 static int 10887 test_xmlListDup(void) { 10888 int test_ret = 0; 10889 10890 10891 /* missing type support */ 10892 return(test_ret); 10893 } 10894 10895 10896 static int 10897 test_xmlListEmpty(void) { 10898 int test_ret = 0; 10899 10900 int mem_base; 10901 int ret_val; 10902 xmlListPtr l; /* a list */ 10903 int n_l; 10904 10905 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10906 mem_base = xmlMemBlocks(); 10907 l = gen_xmlListPtr(n_l, 0); 10908 10909 ret_val = xmlListEmpty(l); 10910 desret_int(ret_val); 10911 call_tests++; 10912 des_xmlListPtr(n_l, l, 0); 10913 xmlResetLastError(); 10914 if (mem_base != xmlMemBlocks()) { 10915 printf("Leak of %d blocks found in xmlListEmpty", 10916 xmlMemBlocks() - mem_base); 10917 test_ret++; 10918 printf(" %d", n_l); 10919 printf("\n"); 10920 } 10921 } 10922 function_tests++; 10923 10924 return(test_ret); 10925 } 10926 10927 10928 static int 10929 test_xmlListEnd(void) { 10930 int test_ret = 0; 10931 10932 10933 /* missing type support */ 10934 return(test_ret); 10935 } 10936 10937 10938 static int 10939 test_xmlListFront(void) { 10940 int test_ret = 0; 10941 10942 10943 /* missing type support */ 10944 return(test_ret); 10945 } 10946 10947 10948 static int 10949 test_xmlListInsert(void) { 10950 int test_ret = 0; 10951 10952 int mem_base; 10953 int ret_val; 10954 xmlListPtr l; /* a list */ 10955 int n_l; 10956 void * data; /* the data */ 10957 int n_data; 10958 10959 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10960 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 10961 mem_base = xmlMemBlocks(); 10962 l = gen_xmlListPtr(n_l, 0); 10963 data = gen_userdata(n_data, 1); 10964 10965 ret_val = xmlListInsert(l, data); 10966 desret_int(ret_val); 10967 call_tests++; 10968 des_xmlListPtr(n_l, l, 0); 10969 des_userdata(n_data, data, 1); 10970 xmlResetLastError(); 10971 if (mem_base != xmlMemBlocks()) { 10972 printf("Leak of %d blocks found in xmlListInsert", 10973 xmlMemBlocks() - mem_base); 10974 test_ret++; 10975 printf(" %d", n_l); 10976 printf(" %d", n_data); 10977 printf("\n"); 10978 } 10979 } 10980 } 10981 function_tests++; 10982 10983 return(test_ret); 10984 } 10985 10986 10987 static int 10988 test_xmlListMerge(void) { 10989 int test_ret = 0; 10990 10991 int mem_base; 10992 xmlListPtr l1; /* the original list */ 10993 int n_l1; 10994 xmlListPtr l2; /* the new list */ 10995 int n_l2; 10996 10997 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) { 10998 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) { 10999 mem_base = xmlMemBlocks(); 11000 l1 = gen_xmlListPtr(n_l1, 0); 11001 l2 = gen_xmlListPtr(n_l2, 1); 11002 11003 xmlListMerge(l1, l2); 11004 call_tests++; 11005 des_xmlListPtr(n_l1, l1, 0); 11006 des_xmlListPtr(n_l2, l2, 1); 11007 xmlResetLastError(); 11008 if (mem_base != xmlMemBlocks()) { 11009 printf("Leak of %d blocks found in xmlListMerge", 11010 xmlMemBlocks() - mem_base); 11011 test_ret++; 11012 printf(" %d", n_l1); 11013 printf(" %d", n_l2); 11014 printf("\n"); 11015 } 11016 } 11017 } 11018 function_tests++; 11019 11020 return(test_ret); 11021 } 11022 11023 11024 static int 11025 test_xmlListPopBack(void) { 11026 int test_ret = 0; 11027 11028 int mem_base; 11029 xmlListPtr l; /* a list */ 11030 int n_l; 11031 11032 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11033 mem_base = xmlMemBlocks(); 11034 l = gen_xmlListPtr(n_l, 0); 11035 11036 xmlListPopBack(l); 11037 call_tests++; 11038 des_xmlListPtr(n_l, l, 0); 11039 xmlResetLastError(); 11040 if (mem_base != xmlMemBlocks()) { 11041 printf("Leak of %d blocks found in xmlListPopBack", 11042 xmlMemBlocks() - mem_base); 11043 test_ret++; 11044 printf(" %d", n_l); 11045 printf("\n"); 11046 } 11047 } 11048 function_tests++; 11049 11050 return(test_ret); 11051 } 11052 11053 11054 static int 11055 test_xmlListPopFront(void) { 11056 int test_ret = 0; 11057 11058 int mem_base; 11059 xmlListPtr l; /* a list */ 11060 int n_l; 11061 11062 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11063 mem_base = xmlMemBlocks(); 11064 l = gen_xmlListPtr(n_l, 0); 11065 11066 xmlListPopFront(l); 11067 call_tests++; 11068 des_xmlListPtr(n_l, l, 0); 11069 xmlResetLastError(); 11070 if (mem_base != xmlMemBlocks()) { 11071 printf("Leak of %d blocks found in xmlListPopFront", 11072 xmlMemBlocks() - mem_base); 11073 test_ret++; 11074 printf(" %d", n_l); 11075 printf("\n"); 11076 } 11077 } 11078 function_tests++; 11079 11080 return(test_ret); 11081 } 11082 11083 11084 static int 11085 test_xmlListPushBack(void) { 11086 int test_ret = 0; 11087 11088 int mem_base; 11089 int ret_val; 11090 xmlListPtr l; /* a list */ 11091 int n_l; 11092 void * data; /* new data */ 11093 int n_data; 11094 11095 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11096 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11097 mem_base = xmlMemBlocks(); 11098 l = gen_xmlListPtr(n_l, 0); 11099 data = gen_userdata(n_data, 1); 11100 11101 ret_val = xmlListPushBack(l, data); 11102 desret_int(ret_val); 11103 call_tests++; 11104 des_xmlListPtr(n_l, l, 0); 11105 des_userdata(n_data, data, 1); 11106 xmlResetLastError(); 11107 if (mem_base != xmlMemBlocks()) { 11108 printf("Leak of %d blocks found in xmlListPushBack", 11109 xmlMemBlocks() - mem_base); 11110 test_ret++; 11111 printf(" %d", n_l); 11112 printf(" %d", n_data); 11113 printf("\n"); 11114 } 11115 } 11116 } 11117 function_tests++; 11118 11119 return(test_ret); 11120 } 11121 11122 11123 static int 11124 test_xmlListPushFront(void) { 11125 int test_ret = 0; 11126 11127 int mem_base; 11128 int ret_val; 11129 xmlListPtr l; /* a list */ 11130 int n_l; 11131 void * data; /* new data */ 11132 int n_data; 11133 11134 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11135 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11136 mem_base = xmlMemBlocks(); 11137 l = gen_xmlListPtr(n_l, 0); 11138 data = gen_userdata(n_data, 1); 11139 11140 ret_val = xmlListPushFront(l, data); 11141 desret_int(ret_val); 11142 call_tests++; 11143 des_xmlListPtr(n_l, l, 0); 11144 des_userdata(n_data, data, 1); 11145 xmlResetLastError(); 11146 if (mem_base != xmlMemBlocks()) { 11147 printf("Leak of %d blocks found in xmlListPushFront", 11148 xmlMemBlocks() - mem_base); 11149 test_ret++; 11150 printf(" %d", n_l); 11151 printf(" %d", n_data); 11152 printf("\n"); 11153 } 11154 } 11155 } 11156 function_tests++; 11157 11158 return(test_ret); 11159 } 11160 11161 11162 static int 11163 test_xmlListRemoveAll(void) { 11164 int test_ret = 0; 11165 11166 int mem_base; 11167 int ret_val; 11168 xmlListPtr l; /* a list */ 11169 int n_l; 11170 void * data; /* list data */ 11171 int n_data; 11172 11173 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11174 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11175 mem_base = xmlMemBlocks(); 11176 l = gen_xmlListPtr(n_l, 0); 11177 data = gen_userdata(n_data, 1); 11178 11179 ret_val = xmlListRemoveAll(l, data); 11180 desret_int(ret_val); 11181 call_tests++; 11182 des_xmlListPtr(n_l, l, 0); 11183 des_userdata(n_data, data, 1); 11184 xmlResetLastError(); 11185 if (mem_base != xmlMemBlocks()) { 11186 printf("Leak of %d blocks found in xmlListRemoveAll", 11187 xmlMemBlocks() - mem_base); 11188 test_ret++; 11189 printf(" %d", n_l); 11190 printf(" %d", n_data); 11191 printf("\n"); 11192 } 11193 } 11194 } 11195 function_tests++; 11196 11197 return(test_ret); 11198 } 11199 11200 11201 static int 11202 test_xmlListRemoveFirst(void) { 11203 int test_ret = 0; 11204 11205 int mem_base; 11206 int ret_val; 11207 xmlListPtr l; /* a list */ 11208 int n_l; 11209 void * data; /* list data */ 11210 int n_data; 11211 11212 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11213 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11214 mem_base = xmlMemBlocks(); 11215 l = gen_xmlListPtr(n_l, 0); 11216 data = gen_userdata(n_data, 1); 11217 11218 ret_val = xmlListRemoveFirst(l, data); 11219 desret_int(ret_val); 11220 call_tests++; 11221 des_xmlListPtr(n_l, l, 0); 11222 des_userdata(n_data, data, 1); 11223 xmlResetLastError(); 11224 if (mem_base != xmlMemBlocks()) { 11225 printf("Leak of %d blocks found in xmlListRemoveFirst", 11226 xmlMemBlocks() - mem_base); 11227 test_ret++; 11228 printf(" %d", n_l); 11229 printf(" %d", n_data); 11230 printf("\n"); 11231 } 11232 } 11233 } 11234 function_tests++; 11235 11236 return(test_ret); 11237 } 11238 11239 11240 static int 11241 test_xmlListRemoveLast(void) { 11242 int test_ret = 0; 11243 11244 int mem_base; 11245 int ret_val; 11246 xmlListPtr l; /* a list */ 11247 int n_l; 11248 void * data; /* list data */ 11249 int n_data; 11250 11251 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11252 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11253 mem_base = xmlMemBlocks(); 11254 l = gen_xmlListPtr(n_l, 0); 11255 data = gen_userdata(n_data, 1); 11256 11257 ret_val = xmlListRemoveLast(l, data); 11258 desret_int(ret_val); 11259 call_tests++; 11260 des_xmlListPtr(n_l, l, 0); 11261 des_userdata(n_data, data, 1); 11262 xmlResetLastError(); 11263 if (mem_base != xmlMemBlocks()) { 11264 printf("Leak of %d blocks found in xmlListRemoveLast", 11265 xmlMemBlocks() - mem_base); 11266 test_ret++; 11267 printf(" %d", n_l); 11268 printf(" %d", n_data); 11269 printf("\n"); 11270 } 11271 } 11272 } 11273 function_tests++; 11274 11275 return(test_ret); 11276 } 11277 11278 11279 static int 11280 test_xmlListReverse(void) { 11281 int test_ret = 0; 11282 11283 int mem_base; 11284 xmlListPtr l; /* a list */ 11285 int n_l; 11286 11287 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11288 mem_base = xmlMemBlocks(); 11289 l = gen_xmlListPtr(n_l, 0); 11290 11291 xmlListReverse(l); 11292 call_tests++; 11293 des_xmlListPtr(n_l, l, 0); 11294 xmlResetLastError(); 11295 if (mem_base != xmlMemBlocks()) { 11296 printf("Leak of %d blocks found in xmlListReverse", 11297 xmlMemBlocks() - mem_base); 11298 test_ret++; 11299 printf(" %d", n_l); 11300 printf("\n"); 11301 } 11302 } 11303 function_tests++; 11304 11305 return(test_ret); 11306 } 11307 11308 11309 static int 11310 test_xmlListReverseSearch(void) { 11311 int test_ret = 0; 11312 11313 int mem_base; 11314 void * ret_val; 11315 xmlListPtr l; /* a list */ 11316 int n_l; 11317 void * data; /* a search value */ 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 = xmlListReverseSearch(l, data); 11327 desret_void_ptr(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 xmlListReverseSearch", 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_xmlListReverseWalk(void) { 11350 int test_ret = 0; 11351 11352 11353 /* missing type support */ 11354 return(test_ret); 11355 } 11356 11357 11358 static int 11359 test_xmlListSearch(void) { 11360 int test_ret = 0; 11361 11362 int mem_base; 11363 void * ret_val; 11364 xmlListPtr l; /* a list */ 11365 int n_l; 11366 void * data; /* a search value */ 11367 int n_data; 11368 11369 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11370 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11371 mem_base = xmlMemBlocks(); 11372 l = gen_xmlListPtr(n_l, 0); 11373 data = gen_userdata(n_data, 1); 11374 11375 ret_val = xmlListSearch(l, data); 11376 desret_void_ptr(ret_val); 11377 call_tests++; 11378 des_xmlListPtr(n_l, l, 0); 11379 des_userdata(n_data, data, 1); 11380 xmlResetLastError(); 11381 if (mem_base != xmlMemBlocks()) { 11382 printf("Leak of %d blocks found in xmlListSearch", 11383 xmlMemBlocks() - mem_base); 11384 test_ret++; 11385 printf(" %d", n_l); 11386 printf(" %d", n_data); 11387 printf("\n"); 11388 } 11389 } 11390 } 11391 function_tests++; 11392 11393 return(test_ret); 11394 } 11395 11396 11397 static int 11398 test_xmlListSize(void) { 11399 int test_ret = 0; 11400 11401 int mem_base; 11402 int ret_val; 11403 xmlListPtr l; /* a list */ 11404 int n_l; 11405 11406 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11407 mem_base = xmlMemBlocks(); 11408 l = gen_xmlListPtr(n_l, 0); 11409 11410 ret_val = xmlListSize(l); 11411 desret_int(ret_val); 11412 call_tests++; 11413 des_xmlListPtr(n_l, l, 0); 11414 xmlResetLastError(); 11415 if (mem_base != xmlMemBlocks()) { 11416 printf("Leak of %d blocks found in xmlListSize", 11417 xmlMemBlocks() - mem_base); 11418 test_ret++; 11419 printf(" %d", n_l); 11420 printf("\n"); 11421 } 11422 } 11423 function_tests++; 11424 11425 return(test_ret); 11426 } 11427 11428 11429 static int 11430 test_xmlListSort(void) { 11431 int test_ret = 0; 11432 11433 int mem_base; 11434 xmlListPtr l; /* a list */ 11435 int n_l; 11436 11437 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11438 mem_base = xmlMemBlocks(); 11439 l = gen_xmlListPtr(n_l, 0); 11440 11441 xmlListSort(l); 11442 call_tests++; 11443 des_xmlListPtr(n_l, l, 0); 11444 xmlResetLastError(); 11445 if (mem_base != xmlMemBlocks()) { 11446 printf("Leak of %d blocks found in xmlListSort", 11447 xmlMemBlocks() - mem_base); 11448 test_ret++; 11449 printf(" %d", n_l); 11450 printf("\n"); 11451 } 11452 } 11453 function_tests++; 11454 11455 return(test_ret); 11456 } 11457 11458 11459 static int 11460 test_xmlListWalk(void) { 11461 int test_ret = 0; 11462 11463 11464 /* missing type support */ 11465 return(test_ret); 11466 } 11467 11468 static int 11469 test_list(void) { 11470 int test_ret = 0; 11471 11472 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n"); 11473 test_ret += test_xmlLinkGetData(); 11474 test_ret += test_xmlListAppend(); 11475 test_ret += test_xmlListClear(); 11476 test_ret += test_xmlListCopy(); 11477 test_ret += test_xmlListCreate(); 11478 test_ret += test_xmlListDup(); 11479 test_ret += test_xmlListEmpty(); 11480 test_ret += test_xmlListEnd(); 11481 test_ret += test_xmlListFront(); 11482 test_ret += test_xmlListInsert(); 11483 test_ret += test_xmlListMerge(); 11484 test_ret += test_xmlListPopBack(); 11485 test_ret += test_xmlListPopFront(); 11486 test_ret += test_xmlListPushBack(); 11487 test_ret += test_xmlListPushFront(); 11488 test_ret += test_xmlListRemoveAll(); 11489 test_ret += test_xmlListRemoveFirst(); 11490 test_ret += test_xmlListRemoveLast(); 11491 test_ret += test_xmlListReverse(); 11492 test_ret += test_xmlListReverseSearch(); 11493 test_ret += test_xmlListReverseWalk(); 11494 test_ret += test_xmlListSearch(); 11495 test_ret += test_xmlListSize(); 11496 test_ret += test_xmlListSort(); 11497 test_ret += test_xmlListWalk(); 11498 11499 if (test_ret != 0) 11500 printf("Module list: %d errors\n", test_ret); 11501 return(test_ret); 11502 } 11503 11504 static int 11505 test_xmlNanoFTPCheckResponse(void) { 11506 int test_ret = 0; 11507 11508 #if defined(LIBXML_FTP_ENABLED) 11509 int mem_base; 11510 int ret_val; 11511 void * ctx; /* an FTP context */ 11512 int n_ctx; 11513 11514 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11515 mem_base = xmlMemBlocks(); 11516 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11517 11518 ret_val = xmlNanoFTPCheckResponse(ctx); 11519 desret_int(ret_val); 11520 call_tests++; 11521 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11522 xmlResetLastError(); 11523 if (mem_base != xmlMemBlocks()) { 11524 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse", 11525 xmlMemBlocks() - mem_base); 11526 test_ret++; 11527 printf(" %d", n_ctx); 11528 printf("\n"); 11529 } 11530 } 11531 function_tests++; 11532 #endif 11533 11534 return(test_ret); 11535 } 11536 11537 11538 static int 11539 test_xmlNanoFTPCleanup(void) { 11540 int test_ret = 0; 11541 11542 #if defined(LIBXML_FTP_ENABLED) 11543 int mem_base; 11544 11545 mem_base = xmlMemBlocks(); 11546 11547 xmlNanoFTPCleanup(); 11548 call_tests++; 11549 xmlResetLastError(); 11550 if (mem_base != xmlMemBlocks()) { 11551 printf("Leak of %d blocks found in xmlNanoFTPCleanup", 11552 xmlMemBlocks() - mem_base); 11553 test_ret++; 11554 printf("\n"); 11555 } 11556 function_tests++; 11557 #endif 11558 11559 return(test_ret); 11560 } 11561 11562 11563 static int 11564 test_xmlNanoFTPCloseConnection(void) { 11565 int test_ret = 0; 11566 11567 #if defined(LIBXML_FTP_ENABLED) 11568 int mem_base; 11569 int ret_val; 11570 void * ctx; /* an FTP context */ 11571 int n_ctx; 11572 11573 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11574 mem_base = xmlMemBlocks(); 11575 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11576 11577 ret_val = xmlNanoFTPCloseConnection(ctx); 11578 desret_int(ret_val); 11579 call_tests++; 11580 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11581 xmlResetLastError(); 11582 if (mem_base != xmlMemBlocks()) { 11583 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection", 11584 xmlMemBlocks() - mem_base); 11585 test_ret++; 11586 printf(" %d", n_ctx); 11587 printf("\n"); 11588 } 11589 } 11590 function_tests++; 11591 #endif 11592 11593 return(test_ret); 11594 } 11595 11596 11597 static int 11598 test_xmlNanoFTPCwd(void) { 11599 int test_ret = 0; 11600 11601 #if defined(LIBXML_FTP_ENABLED) 11602 int mem_base; 11603 int ret_val; 11604 void * ctx; /* an FTP context */ 11605 int n_ctx; 11606 char * directory; /* a directory on the server */ 11607 int n_directory; 11608 11609 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11610 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) { 11611 mem_base = xmlMemBlocks(); 11612 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11613 directory = gen_const_char_ptr(n_directory, 1); 11614 11615 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory); 11616 desret_int(ret_val); 11617 call_tests++; 11618 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11619 des_const_char_ptr(n_directory, (const char *)directory, 1); 11620 xmlResetLastError(); 11621 if (mem_base != xmlMemBlocks()) { 11622 printf("Leak of %d blocks found in xmlNanoFTPCwd", 11623 xmlMemBlocks() - mem_base); 11624 test_ret++; 11625 printf(" %d", n_ctx); 11626 printf(" %d", n_directory); 11627 printf("\n"); 11628 } 11629 } 11630 } 11631 function_tests++; 11632 #endif 11633 11634 return(test_ret); 11635 } 11636 11637 11638 static int 11639 test_xmlNanoFTPDele(void) { 11640 int test_ret = 0; 11641 11642 #if defined(LIBXML_FTP_ENABLED) 11643 int mem_base; 11644 int ret_val; 11645 void * ctx; /* an FTP context */ 11646 int n_ctx; 11647 const char * file; /* a file or directory on the server */ 11648 int n_file; 11649 11650 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11651 for (n_file = 0;n_file < gen_nb_filepath;n_file++) { 11652 mem_base = xmlMemBlocks(); 11653 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11654 file = gen_filepath(n_file, 1); 11655 11656 ret_val = xmlNanoFTPDele(ctx, file); 11657 desret_int(ret_val); 11658 call_tests++; 11659 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11660 des_filepath(n_file, file, 1); 11661 xmlResetLastError(); 11662 if (mem_base != xmlMemBlocks()) { 11663 printf("Leak of %d blocks found in xmlNanoFTPDele", 11664 xmlMemBlocks() - mem_base); 11665 test_ret++; 11666 printf(" %d", n_ctx); 11667 printf(" %d", n_file); 11668 printf("\n"); 11669 } 11670 } 11671 } 11672 function_tests++; 11673 #endif 11674 11675 return(test_ret); 11676 } 11677 11678 11679 static int 11680 test_xmlNanoFTPGet(void) { 11681 int test_ret = 0; 11682 11683 11684 /* missing type support */ 11685 return(test_ret); 11686 } 11687 11688 11689 static int 11690 test_xmlNanoFTPGetConnection(void) { 11691 int test_ret = 0; 11692 11693 11694 /* missing type support */ 11695 return(test_ret); 11696 } 11697 11698 11699 static int 11700 test_xmlNanoFTPGetResponse(void) { 11701 int test_ret = 0; 11702 11703 #if defined(LIBXML_FTP_ENABLED) 11704 int mem_base; 11705 int ret_val; 11706 void * ctx; /* an FTP context */ 11707 int n_ctx; 11708 11709 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11710 mem_base = xmlMemBlocks(); 11711 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11712 11713 ret_val = xmlNanoFTPGetResponse(ctx); 11714 desret_int(ret_val); 11715 call_tests++; 11716 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11717 xmlResetLastError(); 11718 if (mem_base != xmlMemBlocks()) { 11719 printf("Leak of %d blocks found in xmlNanoFTPGetResponse", 11720 xmlMemBlocks() - mem_base); 11721 test_ret++; 11722 printf(" %d", n_ctx); 11723 printf("\n"); 11724 } 11725 } 11726 function_tests++; 11727 #endif 11728 11729 return(test_ret); 11730 } 11731 11732 11733 static int 11734 test_xmlNanoFTPGetSocket(void) { 11735 int test_ret = 0; 11736 11737 11738 /* missing type support */ 11739 return(test_ret); 11740 } 11741 11742 11743 static int 11744 test_xmlNanoFTPInit(void) { 11745 int test_ret = 0; 11746 11747 #if defined(LIBXML_FTP_ENABLED) 11748 int mem_base; 11749 11750 mem_base = xmlMemBlocks(); 11751 11752 xmlNanoFTPInit(); 11753 call_tests++; 11754 xmlResetLastError(); 11755 if (mem_base != xmlMemBlocks()) { 11756 printf("Leak of %d blocks found in xmlNanoFTPInit", 11757 xmlMemBlocks() - mem_base); 11758 test_ret++; 11759 printf("\n"); 11760 } 11761 function_tests++; 11762 #endif 11763 11764 return(test_ret); 11765 } 11766 11767 11768 static int 11769 test_xmlNanoFTPList(void) { 11770 int test_ret = 0; 11771 11772 11773 /* missing type support */ 11774 return(test_ret); 11775 } 11776 11777 11778 static int 11779 test_xmlNanoFTPNewCtxt(void) { 11780 int test_ret = 0; 11781 11782 #if defined(LIBXML_FTP_ENABLED) 11783 int mem_base; 11784 void * ret_val; 11785 const char * URL; /* The URL used to initialize the context */ 11786 int n_URL; 11787 11788 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 11789 mem_base = xmlMemBlocks(); 11790 URL = gen_filepath(n_URL, 0); 11791 11792 ret_val = xmlNanoFTPNewCtxt(URL); 11793 desret_xmlNanoFTPCtxtPtr(ret_val); 11794 call_tests++; 11795 des_filepath(n_URL, URL, 0); 11796 xmlResetLastError(); 11797 if (mem_base != xmlMemBlocks()) { 11798 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt", 11799 xmlMemBlocks() - mem_base); 11800 test_ret++; 11801 printf(" %d", n_URL); 11802 printf("\n"); 11803 } 11804 } 11805 function_tests++; 11806 #endif 11807 11808 return(test_ret); 11809 } 11810 11811 11812 static int 11813 test_xmlNanoFTPOpen(void) { 11814 int test_ret = 0; 11815 11816 #if defined(LIBXML_FTP_ENABLED) 11817 int mem_base; 11818 void * ret_val; 11819 const char * URL; /* the URL to the resource */ 11820 int n_URL; 11821 11822 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 11823 mem_base = xmlMemBlocks(); 11824 URL = gen_filepath(n_URL, 0); 11825 11826 ret_val = xmlNanoFTPOpen(URL); 11827 desret_xmlNanoFTPCtxtPtr(ret_val); 11828 call_tests++; 11829 des_filepath(n_URL, URL, 0); 11830 xmlResetLastError(); 11831 if (mem_base != xmlMemBlocks()) { 11832 printf("Leak of %d blocks found in xmlNanoFTPOpen", 11833 xmlMemBlocks() - mem_base); 11834 test_ret++; 11835 printf(" %d", n_URL); 11836 printf("\n"); 11837 } 11838 } 11839 function_tests++; 11840 #endif 11841 11842 return(test_ret); 11843 } 11844 11845 11846 static int 11847 test_xmlNanoFTPProxy(void) { 11848 int test_ret = 0; 11849 11850 #if defined(LIBXML_FTP_ENABLED) 11851 char * host; /* the proxy host name */ 11852 int n_host; 11853 int port; /* the proxy port */ 11854 int n_port; 11855 char * user; /* the proxy user name */ 11856 int n_user; 11857 char * passwd; /* the proxy password */ 11858 int n_passwd; 11859 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */ 11860 int n_type; 11861 11862 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) { 11863 for (n_port = 0;n_port < gen_nb_int;n_port++) { 11864 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) { 11865 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) { 11866 for (n_type = 0;n_type < gen_nb_int;n_type++) { 11867 host = gen_const_char_ptr(n_host, 0); 11868 port = gen_int(n_port, 1); 11869 user = gen_const_char_ptr(n_user, 2); 11870 passwd = gen_const_char_ptr(n_passwd, 3); 11871 type = gen_int(n_type, 4); 11872 11873 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type); 11874 call_tests++; 11875 des_const_char_ptr(n_host, (const char *)host, 0); 11876 des_int(n_port, port, 1); 11877 des_const_char_ptr(n_user, (const char *)user, 2); 11878 des_const_char_ptr(n_passwd, (const char *)passwd, 3); 11879 des_int(n_type, type, 4); 11880 xmlResetLastError(); 11881 } 11882 } 11883 } 11884 } 11885 } 11886 function_tests++; 11887 #endif 11888 11889 return(test_ret); 11890 } 11891 11892 11893 static int 11894 test_xmlNanoFTPQuit(void) { 11895 int test_ret = 0; 11896 11897 #if defined(LIBXML_FTP_ENABLED) 11898 int mem_base; 11899 int ret_val; 11900 void * ctx; /* an FTP context */ 11901 int n_ctx; 11902 11903 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11904 mem_base = xmlMemBlocks(); 11905 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11906 11907 ret_val = xmlNanoFTPQuit(ctx); 11908 desret_int(ret_val); 11909 call_tests++; 11910 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11911 xmlResetLastError(); 11912 if (mem_base != xmlMemBlocks()) { 11913 printf("Leak of %d blocks found in xmlNanoFTPQuit", 11914 xmlMemBlocks() - mem_base); 11915 test_ret++; 11916 printf(" %d", n_ctx); 11917 printf("\n"); 11918 } 11919 } 11920 function_tests++; 11921 #endif 11922 11923 return(test_ret); 11924 } 11925 11926 11927 static int 11928 test_xmlNanoFTPRead(void) { 11929 int test_ret = 0; 11930 11931 #if defined(LIBXML_FTP_ENABLED) 11932 int mem_base; 11933 int ret_val; 11934 void * ctx; /* the FTP context */ 11935 int n_ctx; 11936 void * dest; /* a buffer */ 11937 int n_dest; 11938 int len; /* the buffer length */ 11939 int n_len; 11940 11941 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11942 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) { 11943 for (n_len = 0;n_len < gen_nb_int;n_len++) { 11944 mem_base = xmlMemBlocks(); 11945 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11946 dest = gen_void_ptr(n_dest, 1); 11947 len = gen_int(n_len, 2); 11948 11949 ret_val = xmlNanoFTPRead(ctx, dest, len); 11950 desret_int(ret_val); 11951 call_tests++; 11952 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11953 des_void_ptr(n_dest, dest, 1); 11954 des_int(n_len, len, 2); 11955 xmlResetLastError(); 11956 if (mem_base != xmlMemBlocks()) { 11957 printf("Leak of %d blocks found in xmlNanoFTPRead", 11958 xmlMemBlocks() - mem_base); 11959 test_ret++; 11960 printf(" %d", n_ctx); 11961 printf(" %d", n_dest); 11962 printf(" %d", n_len); 11963 printf("\n"); 11964 } 11965 } 11966 } 11967 } 11968 function_tests++; 11969 #endif 11970 11971 return(test_ret); 11972 } 11973 11974 11975 static int 11976 test_xmlNanoFTPScanProxy(void) { 11977 int test_ret = 0; 11978 11979 #if defined(LIBXML_FTP_ENABLED) 11980 const char * URL; /* The proxy URL used to initialize the proxy context */ 11981 int n_URL; 11982 11983 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 11984 URL = gen_filepath(n_URL, 0); 11985 11986 xmlNanoFTPScanProxy(URL); 11987 call_tests++; 11988 des_filepath(n_URL, URL, 0); 11989 xmlResetLastError(); 11990 } 11991 function_tests++; 11992 #endif 11993 11994 return(test_ret); 11995 } 11996 11997 11998 static int 11999 test_xmlNanoFTPUpdateURL(void) { 12000 int test_ret = 0; 12001 12002 #if defined(LIBXML_FTP_ENABLED) 12003 int mem_base; 12004 int ret_val; 12005 void * ctx; /* an FTP context */ 12006 int n_ctx; 12007 const char * URL; /* The URL used to update the context */ 12008 int n_URL; 12009 12010 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 12011 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12012 mem_base = xmlMemBlocks(); 12013 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 12014 URL = gen_filepath(n_URL, 1); 12015 12016 ret_val = xmlNanoFTPUpdateURL(ctx, URL); 12017 desret_int(ret_val); 12018 call_tests++; 12019 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 12020 des_filepath(n_URL, URL, 1); 12021 xmlResetLastError(); 12022 if (mem_base != xmlMemBlocks()) { 12023 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL", 12024 xmlMemBlocks() - mem_base); 12025 test_ret++; 12026 printf(" %d", n_ctx); 12027 printf(" %d", n_URL); 12028 printf("\n"); 12029 } 12030 } 12031 } 12032 function_tests++; 12033 #endif 12034 12035 return(test_ret); 12036 } 12037 12038 static int 12039 test_nanoftp(void) { 12040 int test_ret = 0; 12041 12042 if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n"); 12043 test_ret += test_xmlNanoFTPCheckResponse(); 12044 test_ret += test_xmlNanoFTPCleanup(); 12045 test_ret += test_xmlNanoFTPCloseConnection(); 12046 test_ret += test_xmlNanoFTPCwd(); 12047 test_ret += test_xmlNanoFTPDele(); 12048 test_ret += test_xmlNanoFTPGet(); 12049 test_ret += test_xmlNanoFTPGetConnection(); 12050 test_ret += test_xmlNanoFTPGetResponse(); 12051 test_ret += test_xmlNanoFTPGetSocket(); 12052 test_ret += test_xmlNanoFTPInit(); 12053 test_ret += test_xmlNanoFTPList(); 12054 test_ret += test_xmlNanoFTPNewCtxt(); 12055 test_ret += test_xmlNanoFTPOpen(); 12056 test_ret += test_xmlNanoFTPProxy(); 12057 test_ret += test_xmlNanoFTPQuit(); 12058 test_ret += test_xmlNanoFTPRead(); 12059 test_ret += test_xmlNanoFTPScanProxy(); 12060 test_ret += test_xmlNanoFTPUpdateURL(); 12061 12062 if (test_ret != 0) 12063 printf("Module nanoftp: %d errors\n", test_ret); 12064 return(test_ret); 12065 } 12066 12067 static int 12068 test_xmlNanoHTTPAuthHeader(void) { 12069 int test_ret = 0; 12070 12071 #if defined(LIBXML_HTTP_ENABLED) 12072 int mem_base; 12073 const char * ret_val; 12074 void * ctx; /* the HTTP context */ 12075 int n_ctx; 12076 12077 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12078 mem_base = xmlMemBlocks(); 12079 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12080 12081 ret_val = xmlNanoHTTPAuthHeader(ctx); 12082 desret_const_char_ptr(ret_val); 12083 call_tests++; 12084 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12085 xmlResetLastError(); 12086 if (mem_base != xmlMemBlocks()) { 12087 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader", 12088 xmlMemBlocks() - mem_base); 12089 test_ret++; 12090 printf(" %d", n_ctx); 12091 printf("\n"); 12092 } 12093 } 12094 function_tests++; 12095 #endif 12096 12097 return(test_ret); 12098 } 12099 12100 12101 static int 12102 test_xmlNanoHTTPCleanup(void) { 12103 int test_ret = 0; 12104 12105 #if defined(LIBXML_HTTP_ENABLED) 12106 int mem_base; 12107 12108 mem_base = xmlMemBlocks(); 12109 12110 xmlNanoHTTPCleanup(); 12111 call_tests++; 12112 xmlResetLastError(); 12113 if (mem_base != xmlMemBlocks()) { 12114 printf("Leak of %d blocks found in xmlNanoHTTPCleanup", 12115 xmlMemBlocks() - mem_base); 12116 test_ret++; 12117 printf("\n"); 12118 } 12119 function_tests++; 12120 #endif 12121 12122 return(test_ret); 12123 } 12124 12125 12126 static int 12127 test_xmlNanoHTTPContentLength(void) { 12128 int test_ret = 0; 12129 12130 #if defined(LIBXML_HTTP_ENABLED) 12131 int mem_base; 12132 int ret_val; 12133 void * ctx; /* the HTTP context */ 12134 int n_ctx; 12135 12136 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12137 mem_base = xmlMemBlocks(); 12138 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12139 12140 ret_val = xmlNanoHTTPContentLength(ctx); 12141 desret_int(ret_val); 12142 call_tests++; 12143 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12144 xmlResetLastError(); 12145 if (mem_base != xmlMemBlocks()) { 12146 printf("Leak of %d blocks found in xmlNanoHTTPContentLength", 12147 xmlMemBlocks() - mem_base); 12148 test_ret++; 12149 printf(" %d", n_ctx); 12150 printf("\n"); 12151 } 12152 } 12153 function_tests++; 12154 #endif 12155 12156 return(test_ret); 12157 } 12158 12159 12160 static int 12161 test_xmlNanoHTTPEncoding(void) { 12162 int test_ret = 0; 12163 12164 #if defined(LIBXML_HTTP_ENABLED) 12165 int mem_base; 12166 const char * ret_val; 12167 void * ctx; /* the HTTP context */ 12168 int n_ctx; 12169 12170 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12171 mem_base = xmlMemBlocks(); 12172 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12173 12174 ret_val = xmlNanoHTTPEncoding(ctx); 12175 desret_const_char_ptr(ret_val); 12176 call_tests++; 12177 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12178 xmlResetLastError(); 12179 if (mem_base != xmlMemBlocks()) { 12180 printf("Leak of %d blocks found in xmlNanoHTTPEncoding", 12181 xmlMemBlocks() - mem_base); 12182 test_ret++; 12183 printf(" %d", n_ctx); 12184 printf("\n"); 12185 } 12186 } 12187 function_tests++; 12188 #endif 12189 12190 return(test_ret); 12191 } 12192 12193 12194 #define gen_nb_char_ptr_ptr 1 12195 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 12196 return(NULL); 12197 } 12198 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 12199 } 12200 12201 static int 12202 test_xmlNanoHTTPFetch(void) { 12203 int test_ret = 0; 12204 12205 #if defined(LIBXML_HTTP_ENABLED) 12206 int mem_base; 12207 int ret_val; 12208 const char * URL; /* The URL to load */ 12209 int n_URL; 12210 const char * filename; /* the filename where the content should be saved */ 12211 int n_filename; 12212 char ** contentType; /* if available the Content-Type information will be returned at that location */ 12213 int n_contentType; 12214 12215 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) { 12216 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 12217 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { 12218 mem_base = xmlMemBlocks(); 12219 URL = gen_fileoutput(n_URL, 0); 12220 filename = gen_fileoutput(n_filename, 1); 12221 contentType = gen_char_ptr_ptr(n_contentType, 2); 12222 12223 ret_val = xmlNanoHTTPFetch(URL, filename, contentType); 12224 desret_int(ret_val); 12225 call_tests++; 12226 des_fileoutput(n_URL, URL, 0); 12227 des_fileoutput(n_filename, filename, 1); 12228 des_char_ptr_ptr(n_contentType, contentType, 2); 12229 xmlResetLastError(); 12230 if (mem_base != xmlMemBlocks()) { 12231 printf("Leak of %d blocks found in xmlNanoHTTPFetch", 12232 xmlMemBlocks() - mem_base); 12233 test_ret++; 12234 printf(" %d", n_URL); 12235 printf(" %d", n_filename); 12236 printf(" %d", n_contentType); 12237 printf("\n"); 12238 } 12239 } 12240 } 12241 } 12242 function_tests++; 12243 #endif 12244 12245 return(test_ret); 12246 } 12247 12248 12249 static int 12250 test_xmlNanoHTTPInit(void) { 12251 int test_ret = 0; 12252 12253 #if defined(LIBXML_HTTP_ENABLED) 12254 int mem_base; 12255 12256 mem_base = xmlMemBlocks(); 12257 12258 xmlNanoHTTPInit(); 12259 call_tests++; 12260 xmlResetLastError(); 12261 if (mem_base != xmlMemBlocks()) { 12262 printf("Leak of %d blocks found in xmlNanoHTTPInit", 12263 xmlMemBlocks() - mem_base); 12264 test_ret++; 12265 printf("\n"); 12266 } 12267 function_tests++; 12268 #endif 12269 12270 return(test_ret); 12271 } 12272 12273 12274 static int 12275 test_xmlNanoHTTPMimeType(void) { 12276 int test_ret = 0; 12277 12278 #if defined(LIBXML_HTTP_ENABLED) 12279 int mem_base; 12280 const char * ret_val; 12281 void * ctx; /* the HTTP context */ 12282 int n_ctx; 12283 12284 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12285 mem_base = xmlMemBlocks(); 12286 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12287 12288 ret_val = xmlNanoHTTPMimeType(ctx); 12289 desret_const_char_ptr(ret_val); 12290 call_tests++; 12291 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12292 xmlResetLastError(); 12293 if (mem_base != xmlMemBlocks()) { 12294 printf("Leak of %d blocks found in xmlNanoHTTPMimeType", 12295 xmlMemBlocks() - mem_base); 12296 test_ret++; 12297 printf(" %d", n_ctx); 12298 printf("\n"); 12299 } 12300 } 12301 function_tests++; 12302 #endif 12303 12304 return(test_ret); 12305 } 12306 12307 12308 static int 12309 test_xmlNanoHTTPOpen(void) { 12310 int test_ret = 0; 12311 12312 #if defined(LIBXML_HTTP_ENABLED) 12313 int mem_base; 12314 void * ret_val; 12315 const char * URL; /* The URL to load */ 12316 int n_URL; 12317 char ** contentType; /* if available the Content-Type information will be returned at that location */ 12318 int n_contentType; 12319 12320 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12321 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { 12322 mem_base = xmlMemBlocks(); 12323 URL = gen_filepath(n_URL, 0); 12324 contentType = gen_char_ptr_ptr(n_contentType, 1); 12325 12326 ret_val = xmlNanoHTTPOpen(URL, contentType); 12327 desret_xmlNanoHTTPCtxtPtr(ret_val); 12328 call_tests++; 12329 des_filepath(n_URL, URL, 0); 12330 des_char_ptr_ptr(n_contentType, contentType, 1); 12331 xmlResetLastError(); 12332 if (mem_base != xmlMemBlocks()) { 12333 printf("Leak of %d blocks found in xmlNanoHTTPOpen", 12334 xmlMemBlocks() - mem_base); 12335 test_ret++; 12336 printf(" %d", n_URL); 12337 printf(" %d", n_contentType); 12338 printf("\n"); 12339 } 12340 } 12341 } 12342 function_tests++; 12343 #endif 12344 12345 return(test_ret); 12346 } 12347 12348 12349 static int 12350 test_xmlNanoHTTPOpenRedir(void) { 12351 int test_ret = 0; 12352 12353 #if defined(LIBXML_HTTP_ENABLED) 12354 int mem_base; 12355 void * ret_val; 12356 const char * URL; /* The URL to load */ 12357 int n_URL; 12358 char ** contentType; /* if available the Content-Type information will be returned at that location */ 12359 int n_contentType; 12360 char ** redir; /* if available the redirected URL will be returned */ 12361 int n_redir; 12362 12363 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12364 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { 12365 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) { 12366 mem_base = xmlMemBlocks(); 12367 URL = gen_filepath(n_URL, 0); 12368 contentType = gen_char_ptr_ptr(n_contentType, 1); 12369 redir = gen_char_ptr_ptr(n_redir, 2); 12370 12371 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir); 12372 desret_xmlNanoHTTPCtxtPtr(ret_val); 12373 call_tests++; 12374 des_filepath(n_URL, URL, 0); 12375 des_char_ptr_ptr(n_contentType, contentType, 1); 12376 des_char_ptr_ptr(n_redir, redir, 2); 12377 xmlResetLastError(); 12378 if (mem_base != xmlMemBlocks()) { 12379 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir", 12380 xmlMemBlocks() - mem_base); 12381 test_ret++; 12382 printf(" %d", n_URL); 12383 printf(" %d", n_contentType); 12384 printf(" %d", n_redir); 12385 printf("\n"); 12386 } 12387 } 12388 } 12389 } 12390 function_tests++; 12391 #endif 12392 12393 return(test_ret); 12394 } 12395 12396 12397 static int 12398 test_xmlNanoHTTPRead(void) { 12399 int test_ret = 0; 12400 12401 #if defined(LIBXML_HTTP_ENABLED) 12402 int mem_base; 12403 int ret_val; 12404 void * ctx; /* the HTTP context */ 12405 int n_ctx; 12406 void * dest; /* a buffer */ 12407 int n_dest; 12408 int len; /* the buffer length */ 12409 int n_len; 12410 12411 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12412 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) { 12413 for (n_len = 0;n_len < gen_nb_int;n_len++) { 12414 mem_base = xmlMemBlocks(); 12415 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12416 dest = gen_void_ptr(n_dest, 1); 12417 len = gen_int(n_len, 2); 12418 12419 ret_val = xmlNanoHTTPRead(ctx, dest, len); 12420 desret_int(ret_val); 12421 call_tests++; 12422 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12423 des_void_ptr(n_dest, dest, 1); 12424 des_int(n_len, len, 2); 12425 xmlResetLastError(); 12426 if (mem_base != xmlMemBlocks()) { 12427 printf("Leak of %d blocks found in xmlNanoHTTPRead", 12428 xmlMemBlocks() - mem_base); 12429 test_ret++; 12430 printf(" %d", n_ctx); 12431 printf(" %d", n_dest); 12432 printf(" %d", n_len); 12433 printf("\n"); 12434 } 12435 } 12436 } 12437 } 12438 function_tests++; 12439 #endif 12440 12441 return(test_ret); 12442 } 12443 12444 12445 static int 12446 test_xmlNanoHTTPRedir(void) { 12447 int test_ret = 0; 12448 12449 12450 /* missing type support */ 12451 return(test_ret); 12452 } 12453 12454 12455 static int 12456 test_xmlNanoHTTPReturnCode(void) { 12457 int test_ret = 0; 12458 12459 #if defined(LIBXML_HTTP_ENABLED) 12460 int mem_base; 12461 int ret_val; 12462 void * ctx; /* the HTTP context */ 12463 int n_ctx; 12464 12465 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12466 mem_base = xmlMemBlocks(); 12467 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12468 12469 ret_val = xmlNanoHTTPReturnCode(ctx); 12470 desret_int(ret_val); 12471 call_tests++; 12472 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12473 xmlResetLastError(); 12474 if (mem_base != xmlMemBlocks()) { 12475 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode", 12476 xmlMemBlocks() - mem_base); 12477 test_ret++; 12478 printf(" %d", n_ctx); 12479 printf("\n"); 12480 } 12481 } 12482 function_tests++; 12483 #endif 12484 12485 return(test_ret); 12486 } 12487 12488 12489 static int 12490 test_xmlNanoHTTPSave(void) { 12491 int test_ret = 0; 12492 12493 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 12494 int mem_base; 12495 int ret_val; 12496 void * ctxt; /* the HTTP context */ 12497 int n_ctxt; 12498 const char * filename; /* the filename where the content should be saved */ 12499 int n_filename; 12500 12501 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) { 12502 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 12503 mem_base = xmlMemBlocks(); 12504 ctxt = gen_void_ptr(n_ctxt, 0); 12505 filename = gen_fileoutput(n_filename, 1); 12506 12507 ret_val = xmlNanoHTTPSave(ctxt, filename); 12508 desret_int(ret_val); 12509 call_tests++; 12510 des_void_ptr(n_ctxt, ctxt, 0); 12511 des_fileoutput(n_filename, filename, 1); 12512 xmlResetLastError(); 12513 if (mem_base != xmlMemBlocks()) { 12514 printf("Leak of %d blocks found in xmlNanoHTTPSave", 12515 xmlMemBlocks() - mem_base); 12516 test_ret++; 12517 printf(" %d", n_ctxt); 12518 printf(" %d", n_filename); 12519 printf("\n"); 12520 } 12521 } 12522 } 12523 function_tests++; 12524 #endif 12525 12526 return(test_ret); 12527 } 12528 12529 12530 static int 12531 test_xmlNanoHTTPScanProxy(void) { 12532 int test_ret = 0; 12533 12534 #if defined(LIBXML_HTTP_ENABLED) 12535 const char * URL; /* The proxy URL used to initialize the proxy context */ 12536 int n_URL; 12537 12538 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12539 URL = gen_filepath(n_URL, 0); 12540 12541 xmlNanoHTTPScanProxy(URL); 12542 call_tests++; 12543 des_filepath(n_URL, URL, 0); 12544 xmlResetLastError(); 12545 } 12546 function_tests++; 12547 #endif 12548 12549 return(test_ret); 12550 } 12551 12552 static int 12553 test_nanohttp(void) { 12554 int test_ret = 0; 12555 12556 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n"); 12557 test_ret += test_xmlNanoHTTPAuthHeader(); 12558 test_ret += test_xmlNanoHTTPCleanup(); 12559 test_ret += test_xmlNanoHTTPContentLength(); 12560 test_ret += test_xmlNanoHTTPEncoding(); 12561 test_ret += test_xmlNanoHTTPFetch(); 12562 test_ret += test_xmlNanoHTTPInit(); 12563 test_ret += test_xmlNanoHTTPMimeType(); 12564 test_ret += test_xmlNanoHTTPOpen(); 12565 test_ret += test_xmlNanoHTTPOpenRedir(); 12566 test_ret += test_xmlNanoHTTPRead(); 12567 test_ret += test_xmlNanoHTTPRedir(); 12568 test_ret += test_xmlNanoHTTPReturnCode(); 12569 test_ret += test_xmlNanoHTTPSave(); 12570 test_ret += test_xmlNanoHTTPScanProxy(); 12571 12572 if (test_ret != 0) 12573 printf("Module nanohttp: %d errors\n", test_ret); 12574 return(test_ret); 12575 } 12576 12577 static int 12578 test_xmlByteConsumed(void) { 12579 int test_ret = 0; 12580 12581 int mem_base; 12582 long ret_val; 12583 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12584 int n_ctxt; 12585 12586 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12587 mem_base = xmlMemBlocks(); 12588 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12589 12590 ret_val = xmlByteConsumed(ctxt); 12591 desret_long(ret_val); 12592 call_tests++; 12593 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12594 xmlResetLastError(); 12595 if (mem_base != xmlMemBlocks()) { 12596 printf("Leak of %d blocks found in xmlByteConsumed", 12597 xmlMemBlocks() - mem_base); 12598 test_ret++; 12599 printf(" %d", n_ctxt); 12600 printf("\n"); 12601 } 12602 } 12603 function_tests++; 12604 12605 return(test_ret); 12606 } 12607 12608 12609 static int 12610 test_xmlClearNodeInfoSeq(void) { 12611 int test_ret = 0; 12612 12613 int mem_base; 12614 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ 12615 int n_seq; 12616 12617 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) { 12618 mem_base = xmlMemBlocks(); 12619 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0); 12620 12621 xmlClearNodeInfoSeq(seq); 12622 call_tests++; 12623 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0); 12624 xmlResetLastError(); 12625 if (mem_base != xmlMemBlocks()) { 12626 printf("Leak of %d blocks found in xmlClearNodeInfoSeq", 12627 xmlMemBlocks() - mem_base); 12628 test_ret++; 12629 printf(" %d", n_seq); 12630 printf("\n"); 12631 } 12632 } 12633 function_tests++; 12634 12635 return(test_ret); 12636 } 12637 12638 12639 static int 12640 test_xmlClearParserCtxt(void) { 12641 int test_ret = 0; 12642 12643 int mem_base; 12644 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12645 int n_ctxt; 12646 12647 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12648 mem_base = xmlMemBlocks(); 12649 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12650 12651 xmlClearParserCtxt(ctxt); 12652 call_tests++; 12653 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12654 xmlResetLastError(); 12655 if (mem_base != xmlMemBlocks()) { 12656 printf("Leak of %d blocks found in xmlClearParserCtxt", 12657 xmlMemBlocks() - mem_base); 12658 test_ret++; 12659 printf(" %d", n_ctxt); 12660 printf("\n"); 12661 } 12662 } 12663 function_tests++; 12664 12665 return(test_ret); 12666 } 12667 12668 12669 static int 12670 test_xmlCreateDocParserCtxt(void) { 12671 int test_ret = 0; 12672 12673 int mem_base; 12674 xmlParserCtxtPtr ret_val; 12675 xmlChar * cur; /* a pointer to an array of xmlChar */ 12676 int n_cur; 12677 12678 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 12679 mem_base = xmlMemBlocks(); 12680 cur = gen_const_xmlChar_ptr(n_cur, 0); 12681 12682 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur); 12683 desret_xmlParserCtxtPtr(ret_val); 12684 call_tests++; 12685 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 12686 xmlResetLastError(); 12687 if (mem_base != xmlMemBlocks()) { 12688 printf("Leak of %d blocks found in xmlCreateDocParserCtxt", 12689 xmlMemBlocks() - mem_base); 12690 test_ret++; 12691 printf(" %d", n_cur); 12692 printf("\n"); 12693 } 12694 } 12695 function_tests++; 12696 12697 return(test_ret); 12698 } 12699 12700 12701 static int 12702 test_xmlCreatePushParserCtxt(void) { 12703 int test_ret = 0; 12704 12705 #if defined(LIBXML_PUSH_ENABLED) 12706 int mem_base; 12707 xmlParserCtxtPtr ret_val; 12708 xmlSAXHandlerPtr sax; /* a SAX handler */ 12709 int n_sax; 12710 void * user_data; /* The user data returned on SAX callbacks */ 12711 int n_user_data; 12712 char * chunk; /* a pointer to an array of chars */ 12713 int n_chunk; 12714 int size; /* number of chars in the array */ 12715 int n_size; 12716 const char * filename; /* an optional file name or URI */ 12717 int n_filename; 12718 12719 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 12720 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 12721 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 12722 for (n_size = 0;n_size < gen_nb_int;n_size++) { 12723 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 12724 mem_base = xmlMemBlocks(); 12725 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 12726 user_data = gen_userdata(n_user_data, 1); 12727 chunk = gen_const_char_ptr(n_chunk, 2); 12728 size = gen_int(n_size, 3); 12729 filename = gen_fileoutput(n_filename, 4); 12730 12731 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename); 12732 desret_xmlParserCtxtPtr(ret_val); 12733 call_tests++; 12734 des_xmlSAXHandlerPtr(n_sax, sax, 0); 12735 des_userdata(n_user_data, user_data, 1); 12736 des_const_char_ptr(n_chunk, (const char *)chunk, 2); 12737 des_int(n_size, size, 3); 12738 des_fileoutput(n_filename, filename, 4); 12739 xmlResetLastError(); 12740 if (mem_base != xmlMemBlocks()) { 12741 printf("Leak of %d blocks found in xmlCreatePushParserCtxt", 12742 xmlMemBlocks() - mem_base); 12743 test_ret++; 12744 printf(" %d", n_sax); 12745 printf(" %d", n_user_data); 12746 printf(" %d", n_chunk); 12747 printf(" %d", n_size); 12748 printf(" %d", n_filename); 12749 printf("\n"); 12750 } 12751 } 12752 } 12753 } 12754 } 12755 } 12756 function_tests++; 12757 #endif 12758 12759 return(test_ret); 12760 } 12761 12762 12763 static int 12764 test_xmlCtxtReadDoc(void) { 12765 int test_ret = 0; 12766 12767 int mem_base; 12768 xmlDocPtr ret_val; 12769 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12770 int n_ctxt; 12771 xmlChar * cur; /* a pointer to a zero terminated string */ 12772 int n_cur; 12773 const char * URL; /* the base URL to use for the document */ 12774 int n_URL; 12775 char * encoding; /* the document encoding, or NULL */ 12776 int n_encoding; 12777 int options; /* a combination of xmlParserOption */ 12778 int n_options; 12779 12780 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12781 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 12782 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12783 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12784 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 12785 mem_base = xmlMemBlocks(); 12786 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12787 cur = gen_const_xmlChar_ptr(n_cur, 1); 12788 URL = gen_filepath(n_URL, 2); 12789 encoding = gen_const_char_ptr(n_encoding, 3); 12790 options = gen_parseroptions(n_options, 4); 12791 12792 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options); 12793 desret_xmlDocPtr(ret_val); 12794 call_tests++; 12795 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12796 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 12797 des_filepath(n_URL, URL, 2); 12798 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 12799 des_parseroptions(n_options, options, 4); 12800 xmlResetLastError(); 12801 if (mem_base != xmlMemBlocks()) { 12802 printf("Leak of %d blocks found in xmlCtxtReadDoc", 12803 xmlMemBlocks() - mem_base); 12804 test_ret++; 12805 printf(" %d", n_ctxt); 12806 printf(" %d", n_cur); 12807 printf(" %d", n_URL); 12808 printf(" %d", n_encoding); 12809 printf(" %d", n_options); 12810 printf("\n"); 12811 } 12812 } 12813 } 12814 } 12815 } 12816 } 12817 function_tests++; 12818 12819 return(test_ret); 12820 } 12821 12822 12823 static int 12824 test_xmlCtxtReadFile(void) { 12825 int test_ret = 0; 12826 12827 int mem_base; 12828 xmlDocPtr ret_val; 12829 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12830 int n_ctxt; 12831 const char * filename; /* a file or URL */ 12832 int n_filename; 12833 char * encoding; /* the document encoding, or NULL */ 12834 int n_encoding; 12835 int options; /* a combination of xmlParserOption */ 12836 int n_options; 12837 12838 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12839 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 12840 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12841 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 12842 mem_base = xmlMemBlocks(); 12843 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12844 filename = gen_filepath(n_filename, 1); 12845 encoding = gen_const_char_ptr(n_encoding, 2); 12846 options = gen_parseroptions(n_options, 3); 12847 12848 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options); 12849 desret_xmlDocPtr(ret_val); 12850 call_tests++; 12851 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12852 des_filepath(n_filename, filename, 1); 12853 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 12854 des_parseroptions(n_options, options, 3); 12855 xmlResetLastError(); 12856 if (mem_base != xmlMemBlocks()) { 12857 printf("Leak of %d blocks found in xmlCtxtReadFile", 12858 xmlMemBlocks() - mem_base); 12859 test_ret++; 12860 printf(" %d", n_ctxt); 12861 printf(" %d", n_filename); 12862 printf(" %d", n_encoding); 12863 printf(" %d", n_options); 12864 printf("\n"); 12865 } 12866 } 12867 } 12868 } 12869 } 12870 function_tests++; 12871 12872 return(test_ret); 12873 } 12874 12875 12876 static int 12877 test_xmlCtxtReadMemory(void) { 12878 int test_ret = 0; 12879 12880 int mem_base; 12881 xmlDocPtr ret_val; 12882 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12883 int n_ctxt; 12884 char * buffer; /* a pointer to a char array */ 12885 int n_buffer; 12886 int size; /* the size of the array */ 12887 int n_size; 12888 const char * URL; /* the base URL to use for the document */ 12889 int n_URL; 12890 char * encoding; /* the document encoding, or NULL */ 12891 int n_encoding; 12892 int options; /* a combination of xmlParserOption */ 12893 int n_options; 12894 12895 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12896 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 12897 for (n_size = 0;n_size < gen_nb_int;n_size++) { 12898 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12899 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12900 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 12901 mem_base = xmlMemBlocks(); 12902 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12903 buffer = gen_const_char_ptr(n_buffer, 1); 12904 size = gen_int(n_size, 2); 12905 URL = gen_filepath(n_URL, 3); 12906 encoding = gen_const_char_ptr(n_encoding, 4); 12907 options = gen_parseroptions(n_options, 5); 12908 12909 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options); 12910 desret_xmlDocPtr(ret_val); 12911 call_tests++; 12912 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12913 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 12914 des_int(n_size, size, 2); 12915 des_filepath(n_URL, URL, 3); 12916 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 12917 des_parseroptions(n_options, options, 5); 12918 xmlResetLastError(); 12919 if (mem_base != xmlMemBlocks()) { 12920 printf("Leak of %d blocks found in xmlCtxtReadMemory", 12921 xmlMemBlocks() - mem_base); 12922 test_ret++; 12923 printf(" %d", n_ctxt); 12924 printf(" %d", n_buffer); 12925 printf(" %d", n_size); 12926 printf(" %d", n_URL); 12927 printf(" %d", n_encoding); 12928 printf(" %d", n_options); 12929 printf("\n"); 12930 } 12931 } 12932 } 12933 } 12934 } 12935 } 12936 } 12937 function_tests++; 12938 12939 return(test_ret); 12940 } 12941 12942 12943 static int 12944 test_xmlCtxtReset(void) { 12945 int test_ret = 0; 12946 12947 int mem_base; 12948 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12949 int n_ctxt; 12950 12951 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12952 mem_base = xmlMemBlocks(); 12953 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12954 12955 xmlCtxtReset(ctxt); 12956 call_tests++; 12957 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12958 xmlResetLastError(); 12959 if (mem_base != xmlMemBlocks()) { 12960 printf("Leak of %d blocks found in xmlCtxtReset", 12961 xmlMemBlocks() - mem_base); 12962 test_ret++; 12963 printf(" %d", n_ctxt); 12964 printf("\n"); 12965 } 12966 } 12967 function_tests++; 12968 12969 return(test_ret); 12970 } 12971 12972 12973 static int 12974 test_xmlCtxtResetPush(void) { 12975 int test_ret = 0; 12976 12977 int mem_base; 12978 int ret_val; 12979 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12980 int n_ctxt; 12981 char * chunk; /* a pointer to an array of chars */ 12982 int n_chunk; 12983 int size; /* number of chars in the array */ 12984 int n_size; 12985 const char * filename; /* an optional file name or URI */ 12986 int n_filename; 12987 char * encoding; /* the document encoding, or NULL */ 12988 int n_encoding; 12989 12990 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12991 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 12992 for (n_size = 0;n_size < gen_nb_int;n_size++) { 12993 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 12994 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12995 mem_base = xmlMemBlocks(); 12996 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12997 chunk = gen_const_char_ptr(n_chunk, 1); 12998 size = gen_int(n_size, 2); 12999 filename = gen_filepath(n_filename, 3); 13000 encoding = gen_const_char_ptr(n_encoding, 4); 13001 13002 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding); 13003 desret_int(ret_val); 13004 call_tests++; 13005 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13006 des_const_char_ptr(n_chunk, (const char *)chunk, 1); 13007 des_int(n_size, size, 2); 13008 des_filepath(n_filename, filename, 3); 13009 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 13010 xmlResetLastError(); 13011 if (mem_base != xmlMemBlocks()) { 13012 printf("Leak of %d blocks found in xmlCtxtResetPush", 13013 xmlMemBlocks() - mem_base); 13014 test_ret++; 13015 printf(" %d", n_ctxt); 13016 printf(" %d", n_chunk); 13017 printf(" %d", n_size); 13018 printf(" %d", n_filename); 13019 printf(" %d", n_encoding); 13020 printf("\n"); 13021 } 13022 } 13023 } 13024 } 13025 } 13026 } 13027 function_tests++; 13028 13029 return(test_ret); 13030 } 13031 13032 13033 static int 13034 test_xmlCtxtUseOptions(void) { 13035 int test_ret = 0; 13036 13037 int mem_base; 13038 int ret_val; 13039 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13040 int n_ctxt; 13041 int options; /* a combination of xmlParserOption */ 13042 int n_options; 13043 13044 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13045 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 13046 mem_base = xmlMemBlocks(); 13047 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13048 options = gen_parseroptions(n_options, 1); 13049 13050 ret_val = xmlCtxtUseOptions(ctxt, options); 13051 desret_int(ret_val); 13052 call_tests++; 13053 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13054 des_parseroptions(n_options, options, 1); 13055 xmlResetLastError(); 13056 if (mem_base != xmlMemBlocks()) { 13057 printf("Leak of %d blocks found in xmlCtxtUseOptions", 13058 xmlMemBlocks() - mem_base); 13059 test_ret++; 13060 printf(" %d", n_ctxt); 13061 printf(" %d", n_options); 13062 printf("\n"); 13063 } 13064 } 13065 } 13066 function_tests++; 13067 13068 return(test_ret); 13069 } 13070 13071 13072 static int 13073 test_xmlGetExternalEntityLoader(void) { 13074 int test_ret = 0; 13075 13076 13077 /* missing type support */ 13078 return(test_ret); 13079 } 13080 13081 13082 static int 13083 test_xmlGetFeature(void) { 13084 int test_ret = 0; 13085 13086 #if defined(LIBXML_LEGACY_ENABLED) 13087 #ifdef LIBXML_LEGACY_ENABLED 13088 int mem_base; 13089 int ret_val; 13090 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ 13091 int n_ctxt; 13092 char * name; /* the feature name */ 13093 int n_name; 13094 void * result; /* location to store the result */ 13095 int n_result; 13096 13097 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13098 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 13099 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) { 13100 mem_base = xmlMemBlocks(); 13101 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13102 name = gen_const_char_ptr(n_name, 1); 13103 result = gen_void_ptr(n_result, 2); 13104 13105 ret_val = xmlGetFeature(ctxt, (const char *)name, result); 13106 desret_int(ret_val); 13107 call_tests++; 13108 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13109 des_const_char_ptr(n_name, (const char *)name, 1); 13110 des_void_ptr(n_result, result, 2); 13111 xmlResetLastError(); 13112 if (mem_base != xmlMemBlocks()) { 13113 printf("Leak of %d blocks found in xmlGetFeature", 13114 xmlMemBlocks() - mem_base); 13115 test_ret++; 13116 printf(" %d", n_ctxt); 13117 printf(" %d", n_name); 13118 printf(" %d", n_result); 13119 printf("\n"); 13120 } 13121 } 13122 } 13123 } 13124 function_tests++; 13125 #endif 13126 #endif 13127 13128 return(test_ret); 13129 } 13130 13131 13132 #define gen_nb_const_char_ptr_ptr 1 13133 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13134 return(NULL); 13135 } 13136 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13137 } 13138 13139 static int 13140 test_xmlGetFeaturesList(void) { 13141 int test_ret = 0; 13142 13143 #if defined(LIBXML_LEGACY_ENABLED) 13144 #ifdef LIBXML_LEGACY_ENABLED 13145 int mem_base; 13146 int ret_val; 13147 int * len; /* the length of the features name array (input/output) */ 13148 int n_len; 13149 char ** result; /* an array of string to be filled with the features name. */ 13150 int n_result; 13151 13152 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 13153 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) { 13154 mem_base = xmlMemBlocks(); 13155 len = gen_int_ptr(n_len, 0); 13156 result = gen_const_char_ptr_ptr(n_result, 1); 13157 13158 ret_val = xmlGetFeaturesList(len, (const char **)result); 13159 desret_int(ret_val); 13160 call_tests++; 13161 des_int_ptr(n_len, len, 0); 13162 des_const_char_ptr_ptr(n_result, (const char **)result, 1); 13163 xmlResetLastError(); 13164 if (mem_base != xmlMemBlocks()) { 13165 printf("Leak of %d blocks found in xmlGetFeaturesList", 13166 xmlMemBlocks() - mem_base); 13167 test_ret++; 13168 printf(" %d", n_len); 13169 printf(" %d", n_result); 13170 printf("\n"); 13171 } 13172 } 13173 } 13174 function_tests++; 13175 #endif 13176 #endif 13177 13178 return(test_ret); 13179 } 13180 13181 13182 static int 13183 test_xmlHasFeature(void) { 13184 int test_ret = 0; 13185 13186 int mem_base; 13187 int ret_val; 13188 xmlFeature feature; /* the feature to be examined */ 13189 int n_feature; 13190 13191 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) { 13192 mem_base = xmlMemBlocks(); 13193 feature = gen_xmlFeature(n_feature, 0); 13194 13195 ret_val = xmlHasFeature(feature); 13196 desret_int(ret_val); 13197 call_tests++; 13198 des_xmlFeature(n_feature, feature, 0); 13199 xmlResetLastError(); 13200 if (mem_base != xmlMemBlocks()) { 13201 printf("Leak of %d blocks found in xmlHasFeature", 13202 xmlMemBlocks() - mem_base); 13203 test_ret++; 13204 printf(" %d", n_feature); 13205 printf("\n"); 13206 } 13207 } 13208 function_tests++; 13209 13210 return(test_ret); 13211 } 13212 13213 13214 static int 13215 test_xmlIOParseDTD(void) { 13216 int test_ret = 0; 13217 13218 #if defined(LIBXML_VALID_ENABLED) 13219 #ifdef LIBXML_VALID_ENABLED 13220 xmlDtdPtr ret_val; 13221 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */ 13222 int n_sax; 13223 xmlParserInputBufferPtr input; /* an Input Buffer */ 13224 int n_input; 13225 xmlCharEncoding enc; /* the charset encoding if known */ 13226 int n_enc; 13227 13228 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 13229 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 13230 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 13231 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 13232 input = gen_xmlParserInputBufferPtr(n_input, 1); 13233 enc = gen_xmlCharEncoding(n_enc, 2); 13234 13235 ret_val = xmlIOParseDTD(sax, input, enc); 13236 input = NULL; 13237 desret_xmlDtdPtr(ret_val); 13238 call_tests++; 13239 des_xmlSAXHandlerPtr(n_sax, sax, 0); 13240 des_xmlParserInputBufferPtr(n_input, input, 1); 13241 des_xmlCharEncoding(n_enc, enc, 2); 13242 xmlResetLastError(); 13243 } 13244 } 13245 } 13246 function_tests++; 13247 #endif 13248 #endif 13249 13250 return(test_ret); 13251 } 13252 13253 13254 static int 13255 test_xmlInitNodeInfoSeq(void) { 13256 int test_ret = 0; 13257 13258 int mem_base; 13259 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ 13260 int n_seq; 13261 13262 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) { 13263 mem_base = xmlMemBlocks(); 13264 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0); 13265 13266 xmlInitNodeInfoSeq(seq); 13267 call_tests++; 13268 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0); 13269 xmlResetLastError(); 13270 if (mem_base != xmlMemBlocks()) { 13271 printf("Leak of %d blocks found in xmlInitNodeInfoSeq", 13272 xmlMemBlocks() - mem_base); 13273 test_ret++; 13274 printf(" %d", n_seq); 13275 printf("\n"); 13276 } 13277 } 13278 function_tests++; 13279 13280 return(test_ret); 13281 } 13282 13283 13284 static int 13285 test_xmlInitParser(void) { 13286 int test_ret = 0; 13287 13288 int mem_base; 13289 13290 mem_base = xmlMemBlocks(); 13291 13292 xmlInitParser(); 13293 call_tests++; 13294 xmlResetLastError(); 13295 if (mem_base != xmlMemBlocks()) { 13296 printf("Leak of %d blocks found in xmlInitParser", 13297 xmlMemBlocks() - mem_base); 13298 test_ret++; 13299 printf("\n"); 13300 } 13301 function_tests++; 13302 13303 return(test_ret); 13304 } 13305 13306 13307 static int 13308 test_xmlInitParserCtxt(void) { 13309 int test_ret = 0; 13310 13311 int mem_base; 13312 int ret_val; 13313 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13314 int n_ctxt; 13315 13316 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13317 mem_base = xmlMemBlocks(); 13318 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13319 13320 ret_val = xmlInitParserCtxt(ctxt); 13321 desret_int(ret_val); 13322 call_tests++; 13323 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13324 xmlResetLastError(); 13325 if (mem_base != xmlMemBlocks()) { 13326 printf("Leak of %d blocks found in xmlInitParserCtxt", 13327 xmlMemBlocks() - mem_base); 13328 test_ret++; 13329 printf(" %d", n_ctxt); 13330 printf("\n"); 13331 } 13332 } 13333 function_tests++; 13334 13335 return(test_ret); 13336 } 13337 13338 13339 static int 13340 test_xmlKeepBlanksDefault(void) { 13341 int test_ret = 0; 13342 13343 int mem_base; 13344 int ret_val; 13345 int val; /* int 0 or 1 */ 13346 int n_val; 13347 13348 for (n_val = 0;n_val < gen_nb_int;n_val++) { 13349 mem_base = xmlMemBlocks(); 13350 val = gen_int(n_val, 0); 13351 13352 ret_val = xmlKeepBlanksDefault(val); 13353 desret_int(ret_val); 13354 call_tests++; 13355 des_int(n_val, val, 0); 13356 xmlResetLastError(); 13357 if (mem_base != xmlMemBlocks()) { 13358 printf("Leak of %d blocks found in xmlKeepBlanksDefault", 13359 xmlMemBlocks() - mem_base); 13360 test_ret++; 13361 printf(" %d", n_val); 13362 printf("\n"); 13363 } 13364 } 13365 function_tests++; 13366 13367 return(test_ret); 13368 } 13369 13370 13371 static int 13372 test_xmlLineNumbersDefault(void) { 13373 int test_ret = 0; 13374 13375 int mem_base; 13376 int ret_val; 13377 int val; /* int 0 or 1 */ 13378 int n_val; 13379 13380 for (n_val = 0;n_val < gen_nb_int;n_val++) { 13381 mem_base = xmlMemBlocks(); 13382 val = gen_int(n_val, 0); 13383 13384 ret_val = xmlLineNumbersDefault(val); 13385 desret_int(ret_val); 13386 call_tests++; 13387 des_int(n_val, val, 0); 13388 xmlResetLastError(); 13389 if (mem_base != xmlMemBlocks()) { 13390 printf("Leak of %d blocks found in xmlLineNumbersDefault", 13391 xmlMemBlocks() - mem_base); 13392 test_ret++; 13393 printf(" %d", n_val); 13394 printf("\n"); 13395 } 13396 } 13397 function_tests++; 13398 13399 return(test_ret); 13400 } 13401 13402 13403 static int 13404 test_xmlLoadExternalEntity(void) { 13405 int test_ret = 0; 13406 13407 int mem_base; 13408 xmlParserInputPtr ret_val; 13409 const char * URL; /* the URL for the entity to load */ 13410 int n_URL; 13411 char * ID; /* the Public ID for the entity to load */ 13412 int n_ID; 13413 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */ 13414 int n_ctxt; 13415 13416 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 13417 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) { 13418 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13419 mem_base = xmlMemBlocks(); 13420 URL = gen_filepath(n_URL, 0); 13421 ID = gen_const_char_ptr(n_ID, 1); 13422 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2); 13423 13424 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt); 13425 desret_xmlParserInputPtr(ret_val); 13426 call_tests++; 13427 des_filepath(n_URL, URL, 0); 13428 des_const_char_ptr(n_ID, (const char *)ID, 1); 13429 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2); 13430 xmlResetLastError(); 13431 if (mem_base != xmlMemBlocks()) { 13432 printf("Leak of %d blocks found in xmlLoadExternalEntity", 13433 xmlMemBlocks() - mem_base); 13434 test_ret++; 13435 printf(" %d", n_URL); 13436 printf(" %d", n_ID); 13437 printf(" %d", n_ctxt); 13438 printf("\n"); 13439 } 13440 } 13441 } 13442 } 13443 function_tests++; 13444 13445 return(test_ret); 13446 } 13447 13448 13449 static int 13450 test_xmlNewIOInputStream(void) { 13451 int test_ret = 0; 13452 13453 int mem_base; 13454 xmlParserInputPtr ret_val; 13455 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13456 int n_ctxt; 13457 xmlParserInputBufferPtr input; /* an I/O Input */ 13458 int n_input; 13459 xmlCharEncoding enc; /* the charset encoding if known */ 13460 int n_enc; 13461 13462 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13463 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 13464 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 13465 mem_base = xmlMemBlocks(); 13466 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13467 input = gen_xmlParserInputBufferPtr(n_input, 1); 13468 enc = gen_xmlCharEncoding(n_enc, 2); 13469 13470 ret_val = xmlNewIOInputStream(ctxt, input, enc); 13471 if (ret_val != NULL) input = NULL; 13472 desret_xmlParserInputPtr(ret_val); 13473 call_tests++; 13474 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13475 des_xmlParserInputBufferPtr(n_input, input, 1); 13476 des_xmlCharEncoding(n_enc, enc, 2); 13477 xmlResetLastError(); 13478 if (mem_base != xmlMemBlocks()) { 13479 printf("Leak of %d blocks found in xmlNewIOInputStream", 13480 xmlMemBlocks() - mem_base); 13481 test_ret++; 13482 printf(" %d", n_ctxt); 13483 printf(" %d", n_input); 13484 printf(" %d", n_enc); 13485 printf("\n"); 13486 } 13487 } 13488 } 13489 } 13490 function_tests++; 13491 13492 return(test_ret); 13493 } 13494 13495 13496 static int 13497 test_xmlNewParserCtxt(void) { 13498 int test_ret = 0; 13499 13500 int mem_base; 13501 xmlParserCtxtPtr ret_val; 13502 13503 mem_base = xmlMemBlocks(); 13504 13505 ret_val = xmlNewParserCtxt(); 13506 desret_xmlParserCtxtPtr(ret_val); 13507 call_tests++; 13508 xmlResetLastError(); 13509 if (mem_base != xmlMemBlocks()) { 13510 printf("Leak of %d blocks found in xmlNewParserCtxt", 13511 xmlMemBlocks() - mem_base); 13512 test_ret++; 13513 printf("\n"); 13514 } 13515 function_tests++; 13516 13517 return(test_ret); 13518 } 13519 13520 13521 #define gen_nb_xmlNodePtr_ptr 1 13522 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13523 return(NULL); 13524 } 13525 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13526 } 13527 13528 static int 13529 test_xmlParseBalancedChunkMemory(void) { 13530 int test_ret = 0; 13531 13532 #if defined(LIBXML_SAX1_ENABLED) 13533 #ifdef LIBXML_SAX1_ENABLED 13534 int mem_base; 13535 int ret_val; 13536 xmlDocPtr doc; /* the document the chunk pertains to */ 13537 int n_doc; 13538 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ 13539 int n_sax; 13540 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ 13541 int n_user_data; 13542 int depth; /* Used for loop detection, use 0 */ 13543 int n_depth; 13544 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */ 13545 int n_string; 13546 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13547 int n_lst; 13548 13549 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 13550 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 13551 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 13552 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 13553 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 13554 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 13555 mem_base = xmlMemBlocks(); 13556 doc = gen_xmlDocPtr(n_doc, 0); 13557 sax = gen_xmlSAXHandlerPtr(n_sax, 1); 13558 user_data = gen_userdata(n_user_data, 2); 13559 depth = gen_int(n_depth, 3); 13560 string = gen_const_xmlChar_ptr(n_string, 4); 13561 lst = gen_xmlNodePtr_ptr(n_lst, 5); 13562 13563 #ifdef LIBXML_SAX1_ENABLED 13564 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 13565 #endif 13566 13567 13568 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst); 13569 desret_int(ret_val); 13570 call_tests++; 13571 des_xmlDocPtr(n_doc, doc, 0); 13572 des_xmlSAXHandlerPtr(n_sax, sax, 1); 13573 des_userdata(n_user_data, user_data, 2); 13574 des_int(n_depth, depth, 3); 13575 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4); 13576 des_xmlNodePtr_ptr(n_lst, lst, 5); 13577 xmlResetLastError(); 13578 if (mem_base != xmlMemBlocks()) { 13579 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory", 13580 xmlMemBlocks() - mem_base); 13581 test_ret++; 13582 printf(" %d", n_doc); 13583 printf(" %d", n_sax); 13584 printf(" %d", n_user_data); 13585 printf(" %d", n_depth); 13586 printf(" %d", n_string); 13587 printf(" %d", n_lst); 13588 printf("\n"); 13589 } 13590 } 13591 } 13592 } 13593 } 13594 } 13595 } 13596 function_tests++; 13597 #endif 13598 #endif 13599 13600 return(test_ret); 13601 } 13602 13603 13604 static int 13605 test_xmlParseBalancedChunkMemoryRecover(void) { 13606 int test_ret = 0; 13607 13608 #if defined(LIBXML_SAX1_ENABLED) 13609 #ifdef LIBXML_SAX1_ENABLED 13610 int mem_base; 13611 int ret_val; 13612 xmlDocPtr doc; /* the document the chunk pertains to */ 13613 int n_doc; 13614 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ 13615 int n_sax; 13616 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ 13617 int n_user_data; 13618 int depth; /* Used for loop detection, use 0 */ 13619 int n_depth; 13620 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */ 13621 int n_string; 13622 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13623 int n_lst; 13624 int recover; /* return nodes even if the data is broken (use 0) */ 13625 int n_recover; 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 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) { 13634 mem_base = xmlMemBlocks(); 13635 doc = gen_xmlDocPtr(n_doc, 0); 13636 sax = gen_xmlSAXHandlerPtr(n_sax, 1); 13637 user_data = gen_userdata(n_user_data, 2); 13638 depth = gen_int(n_depth, 3); 13639 string = gen_const_xmlChar_ptr(n_string, 4); 13640 lst = gen_xmlNodePtr_ptr(n_lst, 5); 13641 recover = gen_int(n_recover, 6); 13642 13643 #ifdef LIBXML_SAX1_ENABLED 13644 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 13645 #endif 13646 13647 13648 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover); 13649 desret_int(ret_val); 13650 call_tests++; 13651 des_xmlDocPtr(n_doc, doc, 0); 13652 des_xmlSAXHandlerPtr(n_sax, sax, 1); 13653 des_userdata(n_user_data, user_data, 2); 13654 des_int(n_depth, depth, 3); 13655 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4); 13656 des_xmlNodePtr_ptr(n_lst, lst, 5); 13657 des_int(n_recover, recover, 6); 13658 xmlResetLastError(); 13659 if (mem_base != xmlMemBlocks()) { 13660 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover", 13661 xmlMemBlocks() - mem_base); 13662 test_ret++; 13663 printf(" %d", n_doc); 13664 printf(" %d", n_sax); 13665 printf(" %d", n_user_data); 13666 printf(" %d", n_depth); 13667 printf(" %d", n_string); 13668 printf(" %d", n_lst); 13669 printf(" %d", n_recover); 13670 printf("\n"); 13671 } 13672 } 13673 } 13674 } 13675 } 13676 } 13677 } 13678 } 13679 function_tests++; 13680 #endif 13681 #endif 13682 13683 return(test_ret); 13684 } 13685 13686 13687 static int 13688 test_xmlParseChunk(void) { 13689 int test_ret = 0; 13690 13691 #if defined(LIBXML_PUSH_ENABLED) 13692 int mem_base; 13693 int ret_val; 13694 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13695 int n_ctxt; 13696 char * chunk; /* an char array */ 13697 int n_chunk; 13698 int size; /* the size in byte of the chunk */ 13699 int n_size; 13700 int terminate; /* last chunk indicator */ 13701 int n_terminate; 13702 13703 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13704 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 13705 for (n_size = 0;n_size < gen_nb_int;n_size++) { 13706 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { 13707 mem_base = xmlMemBlocks(); 13708 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13709 chunk = gen_const_char_ptr(n_chunk, 1); 13710 size = gen_int(n_size, 2); 13711 terminate = gen_int(n_terminate, 3); 13712 13713 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate); 13714 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 13715 desret_int(ret_val); 13716 call_tests++; 13717 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13718 des_const_char_ptr(n_chunk, (const char *)chunk, 1); 13719 des_int(n_size, size, 2); 13720 des_int(n_terminate, terminate, 3); 13721 xmlResetLastError(); 13722 if (mem_base != xmlMemBlocks()) { 13723 printf("Leak of %d blocks found in xmlParseChunk", 13724 xmlMemBlocks() - mem_base); 13725 test_ret++; 13726 printf(" %d", n_ctxt); 13727 printf(" %d", n_chunk); 13728 printf(" %d", n_size); 13729 printf(" %d", n_terminate); 13730 printf("\n"); 13731 } 13732 } 13733 } 13734 } 13735 } 13736 function_tests++; 13737 #endif 13738 13739 return(test_ret); 13740 } 13741 13742 13743 static int 13744 test_xmlParseCtxtExternalEntity(void) { 13745 int test_ret = 0; 13746 13747 int mem_base; 13748 int ret_val; 13749 xmlParserCtxtPtr ctx; /* the existing parsing context */ 13750 int n_ctx; 13751 xmlChar * URL; /* the URL for the entity to load */ 13752 int n_URL; 13753 xmlChar * ID; /* the System ID for the entity to load */ 13754 int n_ID; 13755 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13756 int n_lst; 13757 13758 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) { 13759 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { 13760 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 13761 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 13762 mem_base = xmlMemBlocks(); 13763 ctx = gen_xmlParserCtxtPtr(n_ctx, 0); 13764 URL = gen_const_xmlChar_ptr(n_URL, 1); 13765 ID = gen_const_xmlChar_ptr(n_ID, 2); 13766 lst = gen_xmlNodePtr_ptr(n_lst, 3); 13767 13768 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst); 13769 desret_int(ret_val); 13770 call_tests++; 13771 des_xmlParserCtxtPtr(n_ctx, ctx, 0); 13772 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1); 13773 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2); 13774 des_xmlNodePtr_ptr(n_lst, lst, 3); 13775 xmlResetLastError(); 13776 if (mem_base != xmlMemBlocks()) { 13777 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity", 13778 xmlMemBlocks() - mem_base); 13779 test_ret++; 13780 printf(" %d", n_ctx); 13781 printf(" %d", n_URL); 13782 printf(" %d", n_ID); 13783 printf(" %d", n_lst); 13784 printf("\n"); 13785 } 13786 } 13787 } 13788 } 13789 } 13790 function_tests++; 13791 13792 return(test_ret); 13793 } 13794 13795 13796 static int 13797 test_xmlParseDTD(void) { 13798 int test_ret = 0; 13799 13800 #if defined(LIBXML_VALID_ENABLED) 13801 #ifdef LIBXML_VALID_ENABLED 13802 int mem_base; 13803 xmlDtdPtr ret_val; 13804 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */ 13805 int n_ExternalID; 13806 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */ 13807 int n_SystemID; 13808 13809 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 13810 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 13811 mem_base = xmlMemBlocks(); 13812 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0); 13813 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1); 13814 13815 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID); 13816 desret_xmlDtdPtr(ret_val); 13817 call_tests++; 13818 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0); 13819 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1); 13820 xmlResetLastError(); 13821 if (mem_base != xmlMemBlocks()) { 13822 printf("Leak of %d blocks found in xmlParseDTD", 13823 xmlMemBlocks() - mem_base); 13824 test_ret++; 13825 printf(" %d", n_ExternalID); 13826 printf(" %d", n_SystemID); 13827 printf("\n"); 13828 } 13829 } 13830 } 13831 function_tests++; 13832 #endif 13833 #endif 13834 13835 return(test_ret); 13836 } 13837 13838 13839 static int 13840 test_xmlParseDoc(void) { 13841 int test_ret = 0; 13842 13843 #if defined(LIBXML_SAX1_ENABLED) 13844 #ifdef LIBXML_SAX1_ENABLED 13845 int mem_base; 13846 xmlDocPtr ret_val; 13847 xmlChar * cur; /* a pointer to an array of xmlChar */ 13848 int n_cur; 13849 13850 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 13851 mem_base = xmlMemBlocks(); 13852 cur = gen_const_xmlChar_ptr(n_cur, 0); 13853 13854 ret_val = xmlParseDoc((const xmlChar *)cur); 13855 desret_xmlDocPtr(ret_val); 13856 call_tests++; 13857 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 13858 xmlResetLastError(); 13859 if (mem_base != xmlMemBlocks()) { 13860 printf("Leak of %d blocks found in xmlParseDoc", 13861 xmlMemBlocks() - mem_base); 13862 test_ret++; 13863 printf(" %d", n_cur); 13864 printf("\n"); 13865 } 13866 } 13867 function_tests++; 13868 #endif 13869 #endif 13870 13871 return(test_ret); 13872 } 13873 13874 13875 static int 13876 test_xmlParseDocument(void) { 13877 int test_ret = 0; 13878 13879 int mem_base; 13880 int ret_val; 13881 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13882 int n_ctxt; 13883 13884 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13885 mem_base = xmlMemBlocks(); 13886 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13887 13888 ret_val = xmlParseDocument(ctxt); 13889 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 13890 desret_int(ret_val); 13891 call_tests++; 13892 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13893 xmlResetLastError(); 13894 if (mem_base != xmlMemBlocks()) { 13895 printf("Leak of %d blocks found in xmlParseDocument", 13896 xmlMemBlocks() - mem_base); 13897 test_ret++; 13898 printf(" %d", n_ctxt); 13899 printf("\n"); 13900 } 13901 } 13902 function_tests++; 13903 13904 return(test_ret); 13905 } 13906 13907 13908 static int 13909 test_xmlParseEntity(void) { 13910 int test_ret = 0; 13911 13912 #if defined(LIBXML_SAX1_ENABLED) 13913 #ifdef LIBXML_SAX1_ENABLED 13914 int mem_base; 13915 xmlDocPtr ret_val; 13916 const char * filename; /* the filename */ 13917 int n_filename; 13918 13919 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 13920 mem_base = xmlMemBlocks(); 13921 filename = gen_filepath(n_filename, 0); 13922 13923 ret_val = xmlParseEntity(filename); 13924 desret_xmlDocPtr(ret_val); 13925 call_tests++; 13926 des_filepath(n_filename, filename, 0); 13927 xmlResetLastError(); 13928 if (mem_base != xmlMemBlocks()) { 13929 printf("Leak of %d blocks found in xmlParseEntity", 13930 xmlMemBlocks() - mem_base); 13931 test_ret++; 13932 printf(" %d", n_filename); 13933 printf("\n"); 13934 } 13935 } 13936 function_tests++; 13937 #endif 13938 #endif 13939 13940 return(test_ret); 13941 } 13942 13943 13944 static int 13945 test_xmlParseExtParsedEnt(void) { 13946 int test_ret = 0; 13947 13948 int mem_base; 13949 int ret_val; 13950 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13951 int n_ctxt; 13952 13953 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13954 mem_base = xmlMemBlocks(); 13955 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13956 13957 ret_val = xmlParseExtParsedEnt(ctxt); 13958 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 13959 desret_int(ret_val); 13960 call_tests++; 13961 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13962 xmlResetLastError(); 13963 if (mem_base != xmlMemBlocks()) { 13964 printf("Leak of %d blocks found in xmlParseExtParsedEnt", 13965 xmlMemBlocks() - mem_base); 13966 test_ret++; 13967 printf(" %d", n_ctxt); 13968 printf("\n"); 13969 } 13970 } 13971 function_tests++; 13972 13973 return(test_ret); 13974 } 13975 13976 13977 static int 13978 test_xmlParseExternalEntity(void) { 13979 int test_ret = 0; 13980 13981 #if defined(LIBXML_SAX1_ENABLED) 13982 #ifdef LIBXML_SAX1_ENABLED 13983 int mem_base; 13984 int ret_val; 13985 xmlDocPtr doc; /* the document the chunk pertains to */ 13986 int n_doc; 13987 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ 13988 int n_sax; 13989 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ 13990 int n_user_data; 13991 int depth; /* Used for loop detection, use 0 */ 13992 int n_depth; 13993 xmlChar * URL; /* the URL for the entity to load */ 13994 int n_URL; 13995 xmlChar * ID; /* the System ID for the entity to load */ 13996 int n_ID; 13997 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13998 int n_lst; 13999 14000 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 14001 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14002 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 14003 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 14004 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { 14005 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 14006 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 14007 mem_base = xmlMemBlocks(); 14008 doc = gen_xmlDocPtr(n_doc, 0); 14009 sax = gen_xmlSAXHandlerPtr(n_sax, 1); 14010 user_data = gen_userdata(n_user_data, 2); 14011 depth = gen_int(n_depth, 3); 14012 URL = gen_const_xmlChar_ptr(n_URL, 4); 14013 ID = gen_const_xmlChar_ptr(n_ID, 5); 14014 lst = gen_xmlNodePtr_ptr(n_lst, 6); 14015 14016 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst); 14017 desret_int(ret_val); 14018 call_tests++; 14019 des_xmlDocPtr(n_doc, doc, 0); 14020 des_xmlSAXHandlerPtr(n_sax, sax, 1); 14021 des_userdata(n_user_data, user_data, 2); 14022 des_int(n_depth, depth, 3); 14023 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4); 14024 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5); 14025 des_xmlNodePtr_ptr(n_lst, lst, 6); 14026 xmlResetLastError(); 14027 if (mem_base != xmlMemBlocks()) { 14028 printf("Leak of %d blocks found in xmlParseExternalEntity", 14029 xmlMemBlocks() - mem_base); 14030 test_ret++; 14031 printf(" %d", n_doc); 14032 printf(" %d", n_sax); 14033 printf(" %d", n_user_data); 14034 printf(" %d", n_depth); 14035 printf(" %d", n_URL); 14036 printf(" %d", n_ID); 14037 printf(" %d", n_lst); 14038 printf("\n"); 14039 } 14040 } 14041 } 14042 } 14043 } 14044 } 14045 } 14046 } 14047 function_tests++; 14048 #endif 14049 #endif 14050 14051 return(test_ret); 14052 } 14053 14054 14055 static int 14056 test_xmlParseFile(void) { 14057 int test_ret = 0; 14058 14059 #if defined(LIBXML_SAX1_ENABLED) 14060 #ifdef LIBXML_SAX1_ENABLED 14061 int mem_base; 14062 xmlDocPtr ret_val; 14063 const char * filename; /* the filename */ 14064 int n_filename; 14065 14066 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14067 mem_base = xmlMemBlocks(); 14068 filename = gen_filepath(n_filename, 0); 14069 14070 ret_val = xmlParseFile(filename); 14071 desret_xmlDocPtr(ret_val); 14072 call_tests++; 14073 des_filepath(n_filename, filename, 0); 14074 xmlResetLastError(); 14075 if (mem_base != xmlMemBlocks()) { 14076 printf("Leak of %d blocks found in xmlParseFile", 14077 xmlMemBlocks() - mem_base); 14078 test_ret++; 14079 printf(" %d", n_filename); 14080 printf("\n"); 14081 } 14082 } 14083 function_tests++; 14084 #endif 14085 #endif 14086 14087 return(test_ret); 14088 } 14089 14090 14091 static int 14092 test_xmlParseInNodeContext(void) { 14093 int test_ret = 0; 14094 14095 int mem_base; 14096 xmlParserErrors ret_val; 14097 xmlNodePtr node; /* the context node */ 14098 int n_node; 14099 char * data; /* the input string */ 14100 int n_data; 14101 int datalen; /* the input string length in bytes */ 14102 int n_datalen; 14103 int options; /* a combination of xmlParserOption */ 14104 int n_options; 14105 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 14106 int n_lst; 14107 14108 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 14109 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { 14110 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) { 14111 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14112 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 14113 mem_base = xmlMemBlocks(); 14114 node = gen_xmlNodePtr(n_node, 0); 14115 data = gen_const_char_ptr(n_data, 1); 14116 datalen = gen_int(n_datalen, 2); 14117 options = gen_parseroptions(n_options, 3); 14118 lst = gen_xmlNodePtr_ptr(n_lst, 4); 14119 14120 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst); 14121 desret_xmlParserErrors(ret_val); 14122 call_tests++; 14123 des_xmlNodePtr(n_node, node, 0); 14124 des_const_char_ptr(n_data, (const char *)data, 1); 14125 des_int(n_datalen, datalen, 2); 14126 des_parseroptions(n_options, options, 3); 14127 des_xmlNodePtr_ptr(n_lst, lst, 4); 14128 xmlResetLastError(); 14129 if (mem_base != xmlMemBlocks()) { 14130 printf("Leak of %d blocks found in xmlParseInNodeContext", 14131 xmlMemBlocks() - mem_base); 14132 test_ret++; 14133 printf(" %d", n_node); 14134 printf(" %d", n_data); 14135 printf(" %d", n_datalen); 14136 printf(" %d", n_options); 14137 printf(" %d", n_lst); 14138 printf("\n"); 14139 } 14140 } 14141 } 14142 } 14143 } 14144 } 14145 function_tests++; 14146 14147 return(test_ret); 14148 } 14149 14150 14151 static int 14152 test_xmlParseMemory(void) { 14153 int test_ret = 0; 14154 14155 #if defined(LIBXML_SAX1_ENABLED) 14156 #ifdef LIBXML_SAX1_ENABLED 14157 int mem_base; 14158 xmlDocPtr ret_val; 14159 char * buffer; /* an pointer to a char array */ 14160 int n_buffer; 14161 int size; /* the size of the array */ 14162 int n_size; 14163 14164 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14165 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14166 mem_base = xmlMemBlocks(); 14167 buffer = gen_const_char_ptr(n_buffer, 0); 14168 size = gen_int(n_size, 1); 14169 14170 ret_val = xmlParseMemory((const char *)buffer, size); 14171 desret_xmlDocPtr(ret_val); 14172 call_tests++; 14173 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 14174 des_int(n_size, size, 1); 14175 xmlResetLastError(); 14176 if (mem_base != xmlMemBlocks()) { 14177 printf("Leak of %d blocks found in xmlParseMemory", 14178 xmlMemBlocks() - mem_base); 14179 test_ret++; 14180 printf(" %d", n_buffer); 14181 printf(" %d", n_size); 14182 printf("\n"); 14183 } 14184 } 14185 } 14186 function_tests++; 14187 #endif 14188 #endif 14189 14190 return(test_ret); 14191 } 14192 14193 14194 #define gen_nb_const_xmlParserNodeInfoPtr 1 14195 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14196 return(NULL); 14197 } 14198 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14199 } 14200 14201 static int 14202 test_xmlParserAddNodeInfo(void) { 14203 int test_ret = 0; 14204 14205 int mem_base; 14206 xmlParserCtxtPtr ctxt; /* an XML parser context */ 14207 int n_ctxt; 14208 xmlParserNodeInfoPtr info; /* a node info sequence pointer */ 14209 int n_info; 14210 14211 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 14212 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) { 14213 mem_base = xmlMemBlocks(); 14214 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 14215 info = gen_const_xmlParserNodeInfoPtr(n_info, 1); 14216 14217 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info); 14218 call_tests++; 14219 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 14220 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1); 14221 xmlResetLastError(); 14222 if (mem_base != xmlMemBlocks()) { 14223 printf("Leak of %d blocks found in xmlParserAddNodeInfo", 14224 xmlMemBlocks() - mem_base); 14225 test_ret++; 14226 printf(" %d", n_ctxt); 14227 printf(" %d", n_info); 14228 printf("\n"); 14229 } 14230 } 14231 } 14232 function_tests++; 14233 14234 return(test_ret); 14235 } 14236 14237 14238 #define gen_nb_const_xmlParserCtxtPtr 1 14239 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14240 return(NULL); 14241 } 14242 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14243 } 14244 14245 #define gen_nb_const_xmlNodePtr 1 14246 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14247 return(NULL); 14248 } 14249 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14250 } 14251 14252 static int 14253 test_xmlParserFindNodeInfo(void) { 14254 int test_ret = 0; 14255 14256 int mem_base; 14257 const xmlParserNodeInfo * ret_val; 14258 xmlParserCtxtPtr ctx; /* an XML parser context */ 14259 int n_ctx; 14260 xmlNodePtr node; /* an XML node within the tree */ 14261 int n_node; 14262 14263 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) { 14264 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 14265 mem_base = xmlMemBlocks(); 14266 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0); 14267 node = gen_const_xmlNodePtr(n_node, 1); 14268 14269 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node); 14270 desret_const_xmlParserNodeInfo_ptr(ret_val); 14271 call_tests++; 14272 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0); 14273 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); 14274 xmlResetLastError(); 14275 if (mem_base != xmlMemBlocks()) { 14276 printf("Leak of %d blocks found in xmlParserFindNodeInfo", 14277 xmlMemBlocks() - mem_base); 14278 test_ret++; 14279 printf(" %d", n_ctx); 14280 printf(" %d", n_node); 14281 printf("\n"); 14282 } 14283 } 14284 } 14285 function_tests++; 14286 14287 return(test_ret); 14288 } 14289 14290 14291 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1 14292 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14293 return(NULL); 14294 } 14295 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14296 } 14297 14298 static int 14299 test_xmlParserFindNodeInfoIndex(void) { 14300 int test_ret = 0; 14301 14302 int mem_base; 14303 unsigned long ret_val; 14304 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ 14305 int n_seq; 14306 xmlNodePtr node; /* an XML node pointer */ 14307 int n_node; 14308 14309 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) { 14310 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 14311 mem_base = xmlMemBlocks(); 14312 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0); 14313 node = gen_const_xmlNodePtr(n_node, 1); 14314 14315 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node); 14316 desret_unsigned_long(ret_val); 14317 call_tests++; 14318 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0); 14319 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); 14320 xmlResetLastError(); 14321 if (mem_base != xmlMemBlocks()) { 14322 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex", 14323 xmlMemBlocks() - mem_base); 14324 test_ret++; 14325 printf(" %d", n_seq); 14326 printf(" %d", n_node); 14327 printf("\n"); 14328 } 14329 } 14330 } 14331 function_tests++; 14332 14333 return(test_ret); 14334 } 14335 14336 14337 #define gen_nb_xmlParserInputPtr 1 14338 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14339 return(NULL); 14340 } 14341 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14342 } 14343 14344 static int 14345 test_xmlParserInputGrow(void) { 14346 int test_ret = 0; 14347 14348 int mem_base; 14349 int ret_val; 14350 xmlParserInputPtr in; /* an XML parser input */ 14351 int n_in; 14352 int len; /* an indicative size for the lookahead */ 14353 int n_len; 14354 14355 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { 14356 for (n_len = 0;n_len < gen_nb_int;n_len++) { 14357 mem_base = xmlMemBlocks(); 14358 in = gen_xmlParserInputPtr(n_in, 0); 14359 len = gen_int(n_len, 1); 14360 14361 ret_val = xmlParserInputGrow(in, len); 14362 desret_int(ret_val); 14363 call_tests++; 14364 des_xmlParserInputPtr(n_in, in, 0); 14365 des_int(n_len, len, 1); 14366 xmlResetLastError(); 14367 if (mem_base != xmlMemBlocks()) { 14368 printf("Leak of %d blocks found in xmlParserInputGrow", 14369 xmlMemBlocks() - mem_base); 14370 test_ret++; 14371 printf(" %d", n_in); 14372 printf(" %d", n_len); 14373 printf("\n"); 14374 } 14375 } 14376 } 14377 function_tests++; 14378 14379 return(test_ret); 14380 } 14381 14382 14383 static int 14384 test_xmlParserInputRead(void) { 14385 int test_ret = 0; 14386 14387 int mem_base; 14388 int ret_val; 14389 xmlParserInputPtr in; /* an XML parser input */ 14390 int n_in; 14391 int len; /* an indicative size for the lookahead */ 14392 int n_len; 14393 14394 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { 14395 for (n_len = 0;n_len < gen_nb_int;n_len++) { 14396 mem_base = xmlMemBlocks(); 14397 in = gen_xmlParserInputPtr(n_in, 0); 14398 len = gen_int(n_len, 1); 14399 14400 ret_val = xmlParserInputRead(in, len); 14401 desret_int(ret_val); 14402 call_tests++; 14403 des_xmlParserInputPtr(n_in, in, 0); 14404 des_int(n_len, len, 1); 14405 xmlResetLastError(); 14406 if (mem_base != xmlMemBlocks()) { 14407 printf("Leak of %d blocks found in xmlParserInputRead", 14408 xmlMemBlocks() - mem_base); 14409 test_ret++; 14410 printf(" %d", n_in); 14411 printf(" %d", n_len); 14412 printf("\n"); 14413 } 14414 } 14415 } 14416 function_tests++; 14417 14418 return(test_ret); 14419 } 14420 14421 14422 static int 14423 test_xmlPedanticParserDefault(void) { 14424 int test_ret = 0; 14425 14426 int mem_base; 14427 int ret_val; 14428 int val; /* int 0 or 1 */ 14429 int n_val; 14430 14431 for (n_val = 0;n_val < gen_nb_int;n_val++) { 14432 mem_base = xmlMemBlocks(); 14433 val = gen_int(n_val, 0); 14434 14435 ret_val = xmlPedanticParserDefault(val); 14436 desret_int(ret_val); 14437 call_tests++; 14438 des_int(n_val, val, 0); 14439 xmlResetLastError(); 14440 if (mem_base != xmlMemBlocks()) { 14441 printf("Leak of %d blocks found in xmlPedanticParserDefault", 14442 xmlMemBlocks() - mem_base); 14443 test_ret++; 14444 printf(" %d", n_val); 14445 printf("\n"); 14446 } 14447 } 14448 function_tests++; 14449 14450 return(test_ret); 14451 } 14452 14453 14454 static int 14455 test_xmlReadDoc(void) { 14456 int test_ret = 0; 14457 14458 int mem_base; 14459 xmlDocPtr ret_val; 14460 xmlChar * cur; /* a pointer to a zero terminated string */ 14461 int n_cur; 14462 const char * URL; /* the base URL to use for the document */ 14463 int n_URL; 14464 char * encoding; /* the document encoding, or NULL */ 14465 int n_encoding; 14466 int options; /* a combination of xmlParserOption */ 14467 int n_options; 14468 14469 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 14470 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 14471 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 14472 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14473 mem_base = xmlMemBlocks(); 14474 cur = gen_const_xmlChar_ptr(n_cur, 0); 14475 URL = gen_filepath(n_URL, 1); 14476 encoding = gen_const_char_ptr(n_encoding, 2); 14477 options = gen_parseroptions(n_options, 3); 14478 14479 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options); 14480 desret_xmlDocPtr(ret_val); 14481 call_tests++; 14482 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 14483 des_filepath(n_URL, URL, 1); 14484 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 14485 des_parseroptions(n_options, options, 3); 14486 xmlResetLastError(); 14487 if (mem_base != xmlMemBlocks()) { 14488 printf("Leak of %d blocks found in xmlReadDoc", 14489 xmlMemBlocks() - mem_base); 14490 test_ret++; 14491 printf(" %d", n_cur); 14492 printf(" %d", n_URL); 14493 printf(" %d", n_encoding); 14494 printf(" %d", n_options); 14495 printf("\n"); 14496 } 14497 } 14498 } 14499 } 14500 } 14501 function_tests++; 14502 14503 return(test_ret); 14504 } 14505 14506 14507 static int 14508 test_xmlReadFile(void) { 14509 int test_ret = 0; 14510 14511 int mem_base; 14512 xmlDocPtr ret_val; 14513 const char * filename; /* a file or URL */ 14514 int n_filename; 14515 char * encoding; /* the document encoding, or NULL */ 14516 int n_encoding; 14517 int options; /* a combination of xmlParserOption */ 14518 int n_options; 14519 14520 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14521 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 14522 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14523 mem_base = xmlMemBlocks(); 14524 filename = gen_filepath(n_filename, 0); 14525 encoding = gen_const_char_ptr(n_encoding, 1); 14526 options = gen_parseroptions(n_options, 2); 14527 14528 ret_val = xmlReadFile(filename, (const char *)encoding, options); 14529 desret_xmlDocPtr(ret_val); 14530 call_tests++; 14531 des_filepath(n_filename, filename, 0); 14532 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 14533 des_parseroptions(n_options, options, 2); 14534 xmlResetLastError(); 14535 if (mem_base != xmlMemBlocks()) { 14536 printf("Leak of %d blocks found in xmlReadFile", 14537 xmlMemBlocks() - mem_base); 14538 test_ret++; 14539 printf(" %d", n_filename); 14540 printf(" %d", n_encoding); 14541 printf(" %d", n_options); 14542 printf("\n"); 14543 } 14544 } 14545 } 14546 } 14547 function_tests++; 14548 14549 return(test_ret); 14550 } 14551 14552 14553 static int 14554 test_xmlReadMemory(void) { 14555 int test_ret = 0; 14556 14557 int mem_base; 14558 xmlDocPtr ret_val; 14559 char * buffer; /* a pointer to a char array */ 14560 int n_buffer; 14561 int size; /* the size of the array */ 14562 int n_size; 14563 const char * URL; /* the base URL to use for the document */ 14564 int n_URL; 14565 char * encoding; /* the document encoding, or NULL */ 14566 int n_encoding; 14567 int options; /* a combination of xmlParserOption */ 14568 int n_options; 14569 14570 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14571 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14572 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 14573 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 14574 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14575 mem_base = xmlMemBlocks(); 14576 buffer = gen_const_char_ptr(n_buffer, 0); 14577 size = gen_int(n_size, 1); 14578 URL = gen_filepath(n_URL, 2); 14579 encoding = gen_const_char_ptr(n_encoding, 3); 14580 options = gen_parseroptions(n_options, 4); 14581 14582 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options); 14583 desret_xmlDocPtr(ret_val); 14584 call_tests++; 14585 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 14586 des_int(n_size, size, 1); 14587 des_filepath(n_URL, URL, 2); 14588 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 14589 des_parseroptions(n_options, options, 4); 14590 xmlResetLastError(); 14591 if (mem_base != xmlMemBlocks()) { 14592 printf("Leak of %d blocks found in xmlReadMemory", 14593 xmlMemBlocks() - mem_base); 14594 test_ret++; 14595 printf(" %d", n_buffer); 14596 printf(" %d", n_size); 14597 printf(" %d", n_URL); 14598 printf(" %d", n_encoding); 14599 printf(" %d", n_options); 14600 printf("\n"); 14601 } 14602 } 14603 } 14604 } 14605 } 14606 } 14607 function_tests++; 14608 14609 return(test_ret); 14610 } 14611 14612 14613 static int 14614 test_xmlRecoverDoc(void) { 14615 int test_ret = 0; 14616 14617 #if defined(LIBXML_SAX1_ENABLED) 14618 #ifdef LIBXML_SAX1_ENABLED 14619 int mem_base; 14620 xmlDocPtr ret_val; 14621 xmlChar * cur; /* a pointer to an array of xmlChar */ 14622 int n_cur; 14623 14624 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 14625 mem_base = xmlMemBlocks(); 14626 cur = gen_const_xmlChar_ptr(n_cur, 0); 14627 14628 ret_val = xmlRecoverDoc((const xmlChar *)cur); 14629 desret_xmlDocPtr(ret_val); 14630 call_tests++; 14631 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 14632 xmlResetLastError(); 14633 if (mem_base != xmlMemBlocks()) { 14634 printf("Leak of %d blocks found in xmlRecoverDoc", 14635 xmlMemBlocks() - mem_base); 14636 test_ret++; 14637 printf(" %d", n_cur); 14638 printf("\n"); 14639 } 14640 } 14641 function_tests++; 14642 #endif 14643 #endif 14644 14645 return(test_ret); 14646 } 14647 14648 14649 static int 14650 test_xmlRecoverFile(void) { 14651 int test_ret = 0; 14652 14653 #if defined(LIBXML_SAX1_ENABLED) 14654 #ifdef LIBXML_SAX1_ENABLED 14655 int mem_base; 14656 xmlDocPtr ret_val; 14657 const char * filename; /* the filename */ 14658 int n_filename; 14659 14660 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14661 mem_base = xmlMemBlocks(); 14662 filename = gen_filepath(n_filename, 0); 14663 14664 ret_val = xmlRecoverFile(filename); 14665 desret_xmlDocPtr(ret_val); 14666 call_tests++; 14667 des_filepath(n_filename, filename, 0); 14668 xmlResetLastError(); 14669 if (mem_base != xmlMemBlocks()) { 14670 printf("Leak of %d blocks found in xmlRecoverFile", 14671 xmlMemBlocks() - mem_base); 14672 test_ret++; 14673 printf(" %d", n_filename); 14674 printf("\n"); 14675 } 14676 } 14677 function_tests++; 14678 #endif 14679 #endif 14680 14681 return(test_ret); 14682 } 14683 14684 14685 static int 14686 test_xmlRecoverMemory(void) { 14687 int test_ret = 0; 14688 14689 #if defined(LIBXML_SAX1_ENABLED) 14690 #ifdef LIBXML_SAX1_ENABLED 14691 int mem_base; 14692 xmlDocPtr ret_val; 14693 char * buffer; /* an pointer to a char array */ 14694 int n_buffer; 14695 int size; /* the size of the array */ 14696 int n_size; 14697 14698 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14699 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14700 mem_base = xmlMemBlocks(); 14701 buffer = gen_const_char_ptr(n_buffer, 0); 14702 size = gen_int(n_size, 1); 14703 14704 ret_val = xmlRecoverMemory((const char *)buffer, size); 14705 desret_xmlDocPtr(ret_val); 14706 call_tests++; 14707 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 14708 des_int(n_size, size, 1); 14709 xmlResetLastError(); 14710 if (mem_base != xmlMemBlocks()) { 14711 printf("Leak of %d blocks found in xmlRecoverMemory", 14712 xmlMemBlocks() - mem_base); 14713 test_ret++; 14714 printf(" %d", n_buffer); 14715 printf(" %d", n_size); 14716 printf("\n"); 14717 } 14718 } 14719 } 14720 function_tests++; 14721 #endif 14722 #endif 14723 14724 return(test_ret); 14725 } 14726 14727 14728 static int 14729 test_xmlSAXParseDTD(void) { 14730 int test_ret = 0; 14731 14732 #if defined(LIBXML_VALID_ENABLED) 14733 #ifdef LIBXML_SAX1_ENABLED 14734 int mem_base; 14735 xmlDtdPtr ret_val; 14736 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14737 int n_sax; 14738 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */ 14739 int n_ExternalID; 14740 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */ 14741 int n_SystemID; 14742 14743 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14744 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 14745 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 14746 mem_base = xmlMemBlocks(); 14747 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14748 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); 14749 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2); 14750 14751 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 14752 desret_xmlDtdPtr(ret_val); 14753 call_tests++; 14754 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14755 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); 14756 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2); 14757 xmlResetLastError(); 14758 if (mem_base != xmlMemBlocks()) { 14759 printf("Leak of %d blocks found in xmlSAXParseDTD", 14760 xmlMemBlocks() - mem_base); 14761 test_ret++; 14762 printf(" %d", n_sax); 14763 printf(" %d", n_ExternalID); 14764 printf(" %d", n_SystemID); 14765 printf("\n"); 14766 } 14767 } 14768 } 14769 } 14770 function_tests++; 14771 #endif 14772 #endif 14773 14774 return(test_ret); 14775 } 14776 14777 14778 static int 14779 test_xmlSAXParseDoc(void) { 14780 int test_ret = 0; 14781 14782 #if defined(LIBXML_SAX1_ENABLED) 14783 #ifdef LIBXML_SAX1_ENABLED 14784 int mem_base; 14785 xmlDocPtr ret_val; 14786 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14787 int n_sax; 14788 xmlChar * cur; /* a pointer to an array of xmlChar */ 14789 int n_cur; 14790 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 14791 int n_recovery; 14792 14793 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14794 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 14795 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14796 mem_base = xmlMemBlocks(); 14797 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14798 cur = gen_const_xmlChar_ptr(n_cur, 1); 14799 recovery = gen_int(n_recovery, 2); 14800 14801 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery); 14802 desret_xmlDocPtr(ret_val); 14803 call_tests++; 14804 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14805 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 14806 des_int(n_recovery, recovery, 2); 14807 xmlResetLastError(); 14808 if (mem_base != xmlMemBlocks()) { 14809 printf("Leak of %d blocks found in xmlSAXParseDoc", 14810 xmlMemBlocks() - mem_base); 14811 test_ret++; 14812 printf(" %d", n_sax); 14813 printf(" %d", n_cur); 14814 printf(" %d", n_recovery); 14815 printf("\n"); 14816 } 14817 } 14818 } 14819 } 14820 function_tests++; 14821 #endif 14822 #endif 14823 14824 return(test_ret); 14825 } 14826 14827 14828 static int 14829 test_xmlSAXParseEntity(void) { 14830 int test_ret = 0; 14831 14832 #if defined(LIBXML_SAX1_ENABLED) 14833 #ifdef LIBXML_SAX1_ENABLED 14834 int mem_base; 14835 xmlDocPtr ret_val; 14836 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14837 int n_sax; 14838 const char * filename; /* the filename */ 14839 int n_filename; 14840 14841 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14842 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14843 mem_base = xmlMemBlocks(); 14844 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14845 filename = gen_filepath(n_filename, 1); 14846 14847 ret_val = xmlSAXParseEntity(sax, filename); 14848 desret_xmlDocPtr(ret_val); 14849 call_tests++; 14850 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14851 des_filepath(n_filename, filename, 1); 14852 xmlResetLastError(); 14853 if (mem_base != xmlMemBlocks()) { 14854 printf("Leak of %d blocks found in xmlSAXParseEntity", 14855 xmlMemBlocks() - mem_base); 14856 test_ret++; 14857 printf(" %d", n_sax); 14858 printf(" %d", n_filename); 14859 printf("\n"); 14860 } 14861 } 14862 } 14863 function_tests++; 14864 #endif 14865 #endif 14866 14867 return(test_ret); 14868 } 14869 14870 14871 static int 14872 test_xmlSAXParseFile(void) { 14873 int test_ret = 0; 14874 14875 #if defined(LIBXML_SAX1_ENABLED) 14876 #ifdef LIBXML_SAX1_ENABLED 14877 int mem_base; 14878 xmlDocPtr ret_val; 14879 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14880 int n_sax; 14881 const char * filename; /* the filename */ 14882 int n_filename; 14883 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 14884 int n_recovery; 14885 14886 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14887 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14888 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14889 mem_base = xmlMemBlocks(); 14890 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14891 filename = gen_filepath(n_filename, 1); 14892 recovery = gen_int(n_recovery, 2); 14893 14894 ret_val = xmlSAXParseFile(sax, filename, recovery); 14895 desret_xmlDocPtr(ret_val); 14896 call_tests++; 14897 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14898 des_filepath(n_filename, filename, 1); 14899 des_int(n_recovery, recovery, 2); 14900 xmlResetLastError(); 14901 if (mem_base != xmlMemBlocks()) { 14902 printf("Leak of %d blocks found in xmlSAXParseFile", 14903 xmlMemBlocks() - mem_base); 14904 test_ret++; 14905 printf(" %d", n_sax); 14906 printf(" %d", n_filename); 14907 printf(" %d", n_recovery); 14908 printf("\n"); 14909 } 14910 } 14911 } 14912 } 14913 function_tests++; 14914 #endif 14915 #endif 14916 14917 return(test_ret); 14918 } 14919 14920 14921 static int 14922 test_xmlSAXParseFileWithData(void) { 14923 int test_ret = 0; 14924 14925 #if defined(LIBXML_SAX1_ENABLED) 14926 #ifdef LIBXML_SAX1_ENABLED 14927 int mem_base; 14928 xmlDocPtr ret_val; 14929 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14930 int n_sax; 14931 const char * filename; /* the filename */ 14932 int n_filename; 14933 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 14934 int n_recovery; 14935 void * data; /* the userdata */ 14936 int n_data; 14937 14938 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14939 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14940 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14941 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 14942 mem_base = xmlMemBlocks(); 14943 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14944 filename = gen_filepath(n_filename, 1); 14945 recovery = gen_int(n_recovery, 2); 14946 data = gen_userdata(n_data, 3); 14947 14948 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data); 14949 desret_xmlDocPtr(ret_val); 14950 call_tests++; 14951 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14952 des_filepath(n_filename, filename, 1); 14953 des_int(n_recovery, recovery, 2); 14954 des_userdata(n_data, data, 3); 14955 xmlResetLastError(); 14956 if (mem_base != xmlMemBlocks()) { 14957 printf("Leak of %d blocks found in xmlSAXParseFileWithData", 14958 xmlMemBlocks() - mem_base); 14959 test_ret++; 14960 printf(" %d", n_sax); 14961 printf(" %d", n_filename); 14962 printf(" %d", n_recovery); 14963 printf(" %d", n_data); 14964 printf("\n"); 14965 } 14966 } 14967 } 14968 } 14969 } 14970 function_tests++; 14971 #endif 14972 #endif 14973 14974 return(test_ret); 14975 } 14976 14977 14978 static int 14979 test_xmlSAXParseMemory(void) { 14980 int test_ret = 0; 14981 14982 #if defined(LIBXML_SAX1_ENABLED) 14983 #ifdef LIBXML_SAX1_ENABLED 14984 int mem_base; 14985 xmlDocPtr ret_val; 14986 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14987 int n_sax; 14988 char * buffer; /* an pointer to a char array */ 14989 int n_buffer; 14990 int size; /* the size of the array */ 14991 int n_size; 14992 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */ 14993 int n_recovery; 14994 14995 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14996 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14997 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14998 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14999 mem_base = xmlMemBlocks(); 15000 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15001 buffer = gen_const_char_ptr(n_buffer, 1); 15002 size = gen_int(n_size, 2); 15003 recovery = gen_int(n_recovery, 3); 15004 15005 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery); 15006 desret_xmlDocPtr(ret_val); 15007 call_tests++; 15008 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15009 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 15010 des_int(n_size, size, 2); 15011 des_int(n_recovery, recovery, 3); 15012 xmlResetLastError(); 15013 if (mem_base != xmlMemBlocks()) { 15014 printf("Leak of %d blocks found in xmlSAXParseMemory", 15015 xmlMemBlocks() - mem_base); 15016 test_ret++; 15017 printf(" %d", n_sax); 15018 printf(" %d", n_buffer); 15019 printf(" %d", n_size); 15020 printf(" %d", n_recovery); 15021 printf("\n"); 15022 } 15023 } 15024 } 15025 } 15026 } 15027 function_tests++; 15028 #endif 15029 #endif 15030 15031 return(test_ret); 15032 } 15033 15034 15035 static int 15036 test_xmlSAXParseMemoryWithData(void) { 15037 int test_ret = 0; 15038 15039 #if defined(LIBXML_SAX1_ENABLED) 15040 #ifdef LIBXML_SAX1_ENABLED 15041 int mem_base; 15042 xmlDocPtr ret_val; 15043 xmlSAXHandlerPtr sax; /* the SAX handler block */ 15044 int n_sax; 15045 char * buffer; /* an pointer to a char array */ 15046 int n_buffer; 15047 int size; /* the size of the array */ 15048 int n_size; 15049 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 15050 int n_recovery; 15051 void * data; /* the userdata */ 15052 int n_data; 15053 15054 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15055 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15056 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15057 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 15058 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 15059 mem_base = xmlMemBlocks(); 15060 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15061 buffer = gen_const_char_ptr(n_buffer, 1); 15062 size = gen_int(n_size, 2); 15063 recovery = gen_int(n_recovery, 3); 15064 data = gen_userdata(n_data, 4); 15065 15066 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data); 15067 desret_xmlDocPtr(ret_val); 15068 call_tests++; 15069 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15070 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 15071 des_int(n_size, size, 2); 15072 des_int(n_recovery, recovery, 3); 15073 des_userdata(n_data, data, 4); 15074 xmlResetLastError(); 15075 if (mem_base != xmlMemBlocks()) { 15076 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData", 15077 xmlMemBlocks() - mem_base); 15078 test_ret++; 15079 printf(" %d", n_sax); 15080 printf(" %d", n_buffer); 15081 printf(" %d", n_size); 15082 printf(" %d", n_recovery); 15083 printf(" %d", n_data); 15084 printf("\n"); 15085 } 15086 } 15087 } 15088 } 15089 } 15090 } 15091 function_tests++; 15092 #endif 15093 #endif 15094 15095 return(test_ret); 15096 } 15097 15098 15099 static int 15100 test_xmlSAXUserParseFile(void) { 15101 int test_ret = 0; 15102 15103 #if defined(LIBXML_SAX1_ENABLED) 15104 #ifdef LIBXML_SAX1_ENABLED 15105 int mem_base; 15106 int ret_val; 15107 xmlSAXHandlerPtr sax; /* a SAX handler */ 15108 int n_sax; 15109 void * user_data; /* The user data returned on SAX callbacks */ 15110 int n_user_data; 15111 const char * filename; /* a file name */ 15112 int n_filename; 15113 15114 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15115 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 15116 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 15117 mem_base = xmlMemBlocks(); 15118 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15119 user_data = gen_userdata(n_user_data, 1); 15120 filename = gen_filepath(n_filename, 2); 15121 15122 #ifdef LIBXML_SAX1_ENABLED 15123 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 15124 #endif 15125 15126 15127 ret_val = xmlSAXUserParseFile(sax, user_data, filename); 15128 desret_int(ret_val); 15129 call_tests++; 15130 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15131 des_userdata(n_user_data, user_data, 1); 15132 des_filepath(n_filename, filename, 2); 15133 xmlResetLastError(); 15134 if (mem_base != xmlMemBlocks()) { 15135 printf("Leak of %d blocks found in xmlSAXUserParseFile", 15136 xmlMemBlocks() - mem_base); 15137 test_ret++; 15138 printf(" %d", n_sax); 15139 printf(" %d", n_user_data); 15140 printf(" %d", n_filename); 15141 printf("\n"); 15142 } 15143 } 15144 } 15145 } 15146 function_tests++; 15147 #endif 15148 #endif 15149 15150 return(test_ret); 15151 } 15152 15153 15154 static int 15155 test_xmlSAXUserParseMemory(void) { 15156 int test_ret = 0; 15157 15158 #if defined(LIBXML_SAX1_ENABLED) 15159 #ifdef LIBXML_SAX1_ENABLED 15160 int mem_base; 15161 int ret_val; 15162 xmlSAXHandlerPtr sax; /* a SAX handler */ 15163 int n_sax; 15164 void * user_data; /* The user data returned on SAX callbacks */ 15165 int n_user_data; 15166 char * buffer; /* an in-memory XML document input */ 15167 int n_buffer; 15168 int size; /* the length of the XML document in bytes */ 15169 int n_size; 15170 15171 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15172 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 15173 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15174 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15175 mem_base = xmlMemBlocks(); 15176 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15177 user_data = gen_userdata(n_user_data, 1); 15178 buffer = gen_const_char_ptr(n_buffer, 2); 15179 size = gen_int(n_size, 3); 15180 15181 #ifdef LIBXML_SAX1_ENABLED 15182 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 15183 #endif 15184 15185 15186 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size); 15187 desret_int(ret_val); 15188 call_tests++; 15189 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15190 des_userdata(n_user_data, user_data, 1); 15191 des_const_char_ptr(n_buffer, (const char *)buffer, 2); 15192 des_int(n_size, size, 3); 15193 xmlResetLastError(); 15194 if (mem_base != xmlMemBlocks()) { 15195 printf("Leak of %d blocks found in xmlSAXUserParseMemory", 15196 xmlMemBlocks() - mem_base); 15197 test_ret++; 15198 printf(" %d", n_sax); 15199 printf(" %d", n_user_data); 15200 printf(" %d", n_buffer); 15201 printf(" %d", n_size); 15202 printf("\n"); 15203 } 15204 } 15205 } 15206 } 15207 } 15208 function_tests++; 15209 #endif 15210 #endif 15211 15212 return(test_ret); 15213 } 15214 15215 15216 static int 15217 test_xmlSetExternalEntityLoader(void) { 15218 int test_ret = 0; 15219 15220 15221 /* missing type support */ 15222 return(test_ret); 15223 } 15224 15225 15226 static int 15227 test_xmlSetFeature(void) { 15228 int test_ret = 0; 15229 15230 #if defined(LIBXML_LEGACY_ENABLED) 15231 #ifdef LIBXML_LEGACY_ENABLED 15232 int mem_base; 15233 int ret_val; 15234 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ 15235 int n_ctxt; 15236 char * name; /* the feature name */ 15237 int n_name; 15238 void * value; /* pointer to the location of the new value */ 15239 int n_value; 15240 15241 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15242 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 15243 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) { 15244 mem_base = xmlMemBlocks(); 15245 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15246 name = gen_const_char_ptr(n_name, 1); 15247 value = gen_void_ptr(n_value, 2); 15248 15249 ret_val = xmlSetFeature(ctxt, (const char *)name, value); 15250 desret_int(ret_val); 15251 call_tests++; 15252 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15253 des_const_char_ptr(n_name, (const char *)name, 1); 15254 des_void_ptr(n_value, value, 2); 15255 xmlResetLastError(); 15256 if (mem_base != xmlMemBlocks()) { 15257 printf("Leak of %d blocks found in xmlSetFeature", 15258 xmlMemBlocks() - mem_base); 15259 test_ret++; 15260 printf(" %d", n_ctxt); 15261 printf(" %d", n_name); 15262 printf(" %d", n_value); 15263 printf("\n"); 15264 } 15265 } 15266 } 15267 } 15268 function_tests++; 15269 #endif 15270 #endif 15271 15272 return(test_ret); 15273 } 15274 15275 15276 static int 15277 test_xmlSetupParserForBuffer(void) { 15278 int test_ret = 0; 15279 15280 #if defined(LIBXML_SAX1_ENABLED) 15281 #ifdef LIBXML_SAX1_ENABLED 15282 int mem_base; 15283 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15284 int n_ctxt; 15285 xmlChar * buffer; /* a xmlChar * buffer */ 15286 int n_buffer; 15287 const char * filename; /* a file name */ 15288 int n_filename; 15289 15290 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15291 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { 15292 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 15293 mem_base = xmlMemBlocks(); 15294 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15295 buffer = gen_const_xmlChar_ptr(n_buffer, 1); 15296 filename = gen_filepath(n_filename, 2); 15297 15298 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename); 15299 call_tests++; 15300 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15301 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1); 15302 des_filepath(n_filename, filename, 2); 15303 xmlResetLastError(); 15304 if (mem_base != xmlMemBlocks()) { 15305 printf("Leak of %d blocks found in xmlSetupParserForBuffer", 15306 xmlMemBlocks() - mem_base); 15307 test_ret++; 15308 printf(" %d", n_ctxt); 15309 printf(" %d", n_buffer); 15310 printf(" %d", n_filename); 15311 printf("\n"); 15312 } 15313 } 15314 } 15315 } 15316 function_tests++; 15317 #endif 15318 #endif 15319 15320 return(test_ret); 15321 } 15322 15323 15324 static int 15325 test_xmlStopParser(void) { 15326 int test_ret = 0; 15327 15328 #ifdef LIBXML_PUSH_ENABLED 15329 int mem_base; 15330 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15331 int n_ctxt; 15332 15333 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15334 mem_base = xmlMemBlocks(); 15335 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15336 15337 xmlStopParser(ctxt); 15338 call_tests++; 15339 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15340 xmlResetLastError(); 15341 if (mem_base != xmlMemBlocks()) { 15342 printf("Leak of %d blocks found in xmlStopParser", 15343 xmlMemBlocks() - mem_base); 15344 test_ret++; 15345 printf(" %d", n_ctxt); 15346 printf("\n"); 15347 } 15348 } 15349 function_tests++; 15350 #endif 15351 15352 return(test_ret); 15353 } 15354 15355 15356 static int 15357 test_xmlSubstituteEntitiesDefault(void) { 15358 int test_ret = 0; 15359 15360 int mem_base; 15361 int ret_val; 15362 int val; /* int 0 or 1 */ 15363 int n_val; 15364 15365 for (n_val = 0;n_val < gen_nb_int;n_val++) { 15366 mem_base = xmlMemBlocks(); 15367 val = gen_int(n_val, 0); 15368 15369 ret_val = xmlSubstituteEntitiesDefault(val); 15370 desret_int(ret_val); 15371 call_tests++; 15372 des_int(n_val, val, 0); 15373 xmlResetLastError(); 15374 if (mem_base != xmlMemBlocks()) { 15375 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault", 15376 xmlMemBlocks() - mem_base); 15377 test_ret++; 15378 printf(" %d", n_val); 15379 printf("\n"); 15380 } 15381 } 15382 function_tests++; 15383 15384 return(test_ret); 15385 } 15386 15387 static int 15388 test_parser(void) { 15389 int test_ret = 0; 15390 15391 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n"); 15392 test_ret += test_xmlByteConsumed(); 15393 test_ret += test_xmlClearNodeInfoSeq(); 15394 test_ret += test_xmlClearParserCtxt(); 15395 test_ret += test_xmlCreateDocParserCtxt(); 15396 test_ret += test_xmlCreatePushParserCtxt(); 15397 test_ret += test_xmlCtxtReadDoc(); 15398 test_ret += test_xmlCtxtReadFile(); 15399 test_ret += test_xmlCtxtReadMemory(); 15400 test_ret += test_xmlCtxtReset(); 15401 test_ret += test_xmlCtxtResetPush(); 15402 test_ret += test_xmlCtxtUseOptions(); 15403 test_ret += test_xmlGetExternalEntityLoader(); 15404 test_ret += test_xmlGetFeature(); 15405 test_ret += test_xmlGetFeaturesList(); 15406 test_ret += test_xmlHasFeature(); 15407 test_ret += test_xmlIOParseDTD(); 15408 test_ret += test_xmlInitNodeInfoSeq(); 15409 test_ret += test_xmlInitParser(); 15410 test_ret += test_xmlInitParserCtxt(); 15411 test_ret += test_xmlKeepBlanksDefault(); 15412 test_ret += test_xmlLineNumbersDefault(); 15413 test_ret += test_xmlLoadExternalEntity(); 15414 test_ret += test_xmlNewIOInputStream(); 15415 test_ret += test_xmlNewParserCtxt(); 15416 test_ret += test_xmlParseBalancedChunkMemory(); 15417 test_ret += test_xmlParseBalancedChunkMemoryRecover(); 15418 test_ret += test_xmlParseChunk(); 15419 test_ret += test_xmlParseCtxtExternalEntity(); 15420 test_ret += test_xmlParseDTD(); 15421 test_ret += test_xmlParseDoc(); 15422 test_ret += test_xmlParseDocument(); 15423 test_ret += test_xmlParseEntity(); 15424 test_ret += test_xmlParseExtParsedEnt(); 15425 test_ret += test_xmlParseExternalEntity(); 15426 test_ret += test_xmlParseFile(); 15427 test_ret += test_xmlParseInNodeContext(); 15428 test_ret += test_xmlParseMemory(); 15429 test_ret += test_xmlParserAddNodeInfo(); 15430 test_ret += test_xmlParserFindNodeInfo(); 15431 test_ret += test_xmlParserFindNodeInfoIndex(); 15432 test_ret += test_xmlParserInputGrow(); 15433 test_ret += test_xmlParserInputRead(); 15434 test_ret += test_xmlPedanticParserDefault(); 15435 test_ret += test_xmlReadDoc(); 15436 test_ret += test_xmlReadFile(); 15437 test_ret += test_xmlReadMemory(); 15438 test_ret += test_xmlRecoverDoc(); 15439 test_ret += test_xmlRecoverFile(); 15440 test_ret += test_xmlRecoverMemory(); 15441 test_ret += test_xmlSAXParseDTD(); 15442 test_ret += test_xmlSAXParseDoc(); 15443 test_ret += test_xmlSAXParseEntity(); 15444 test_ret += test_xmlSAXParseFile(); 15445 test_ret += test_xmlSAXParseFileWithData(); 15446 test_ret += test_xmlSAXParseMemory(); 15447 test_ret += test_xmlSAXParseMemoryWithData(); 15448 test_ret += test_xmlSAXUserParseFile(); 15449 test_ret += test_xmlSAXUserParseMemory(); 15450 test_ret += test_xmlSetExternalEntityLoader(); 15451 test_ret += test_xmlSetFeature(); 15452 test_ret += test_xmlSetupParserForBuffer(); 15453 test_ret += test_xmlStopParser(); 15454 test_ret += test_xmlSubstituteEntitiesDefault(); 15455 15456 if (test_ret != 0) 15457 printf("Module parser: %d errors\n", test_ret); 15458 return(test_ret); 15459 } 15460 15461 static int 15462 test_htmlCreateFileParserCtxt(void) { 15463 int test_ret = 0; 15464 15465 #if defined(LIBXML_HTML_ENABLED) 15466 int mem_base; 15467 htmlParserCtxtPtr ret_val; 15468 const char * filename; /* the filename */ 15469 int n_filename; 15470 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 15471 int n_encoding; 15472 15473 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 15474 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 15475 mem_base = xmlMemBlocks(); 15476 filename = gen_fileoutput(n_filename, 0); 15477 encoding = gen_const_char_ptr(n_encoding, 1); 15478 15479 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding); 15480 desret_htmlParserCtxtPtr(ret_val); 15481 call_tests++; 15482 des_fileoutput(n_filename, filename, 0); 15483 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 15484 xmlResetLastError(); 15485 if (mem_base != xmlMemBlocks()) { 15486 printf("Leak of %d blocks found in htmlCreateFileParserCtxt", 15487 xmlMemBlocks() - mem_base); 15488 test_ret++; 15489 printf(" %d", n_filename); 15490 printf(" %d", n_encoding); 15491 printf("\n"); 15492 } 15493 } 15494 } 15495 function_tests++; 15496 #endif 15497 15498 return(test_ret); 15499 } 15500 15501 15502 static int 15503 test_htmlInitAutoClose(void) { 15504 int test_ret = 0; 15505 15506 #if defined(LIBXML_HTML_ENABLED) 15507 int mem_base; 15508 15509 mem_base = xmlMemBlocks(); 15510 15511 htmlInitAutoClose(); 15512 call_tests++; 15513 xmlResetLastError(); 15514 if (mem_base != xmlMemBlocks()) { 15515 printf("Leak of %d blocks found in htmlInitAutoClose", 15516 xmlMemBlocks() - mem_base); 15517 test_ret++; 15518 printf("\n"); 15519 } 15520 function_tests++; 15521 #endif 15522 15523 return(test_ret); 15524 } 15525 15526 15527 static int 15528 test_inputPop(void) { 15529 int test_ret = 0; 15530 15531 int mem_base; 15532 xmlParserInputPtr ret_val; 15533 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15534 int n_ctxt; 15535 15536 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15537 mem_base = xmlMemBlocks(); 15538 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15539 15540 ret_val = inputPop(ctxt); 15541 desret_xmlParserInputPtr(ret_val); 15542 call_tests++; 15543 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15544 xmlResetLastError(); 15545 if (mem_base != xmlMemBlocks()) { 15546 printf("Leak of %d blocks found in inputPop", 15547 xmlMemBlocks() - mem_base); 15548 test_ret++; 15549 printf(" %d", n_ctxt); 15550 printf("\n"); 15551 } 15552 } 15553 function_tests++; 15554 15555 return(test_ret); 15556 } 15557 15558 15559 static int 15560 test_inputPush(void) { 15561 int test_ret = 0; 15562 15563 int mem_base; 15564 int ret_val; 15565 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15566 int n_ctxt; 15567 xmlParserInputPtr value; /* the parser input */ 15568 int n_value; 15569 15570 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15571 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) { 15572 mem_base = xmlMemBlocks(); 15573 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15574 value = gen_xmlParserInputPtr(n_value, 1); 15575 15576 ret_val = inputPush(ctxt, value); 15577 desret_int(ret_val); 15578 call_tests++; 15579 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15580 des_xmlParserInputPtr(n_value, value, 1); 15581 xmlResetLastError(); 15582 if (mem_base != xmlMemBlocks()) { 15583 printf("Leak of %d blocks found in inputPush", 15584 xmlMemBlocks() - mem_base); 15585 test_ret++; 15586 printf(" %d", n_ctxt); 15587 printf(" %d", n_value); 15588 printf("\n"); 15589 } 15590 } 15591 } 15592 function_tests++; 15593 15594 return(test_ret); 15595 } 15596 15597 15598 static int 15599 test_namePop(void) { 15600 int test_ret = 0; 15601 15602 int mem_base; 15603 const xmlChar * ret_val; 15604 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15605 int n_ctxt; 15606 15607 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15608 mem_base = xmlMemBlocks(); 15609 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15610 15611 ret_val = namePop(ctxt); 15612 desret_const_xmlChar_ptr(ret_val); 15613 call_tests++; 15614 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15615 xmlResetLastError(); 15616 if (mem_base != xmlMemBlocks()) { 15617 printf("Leak of %d blocks found in namePop", 15618 xmlMemBlocks() - mem_base); 15619 test_ret++; 15620 printf(" %d", n_ctxt); 15621 printf("\n"); 15622 } 15623 } 15624 function_tests++; 15625 15626 return(test_ret); 15627 } 15628 15629 15630 static int 15631 test_namePush(void) { 15632 int test_ret = 0; 15633 15634 int mem_base; 15635 int ret_val; 15636 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15637 int n_ctxt; 15638 xmlChar * value; /* the element name */ 15639 int n_value; 15640 15641 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15642 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 15643 mem_base = xmlMemBlocks(); 15644 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15645 value = gen_const_xmlChar_ptr(n_value, 1); 15646 15647 ret_val = namePush(ctxt, (const xmlChar *)value); 15648 desret_int(ret_val); 15649 call_tests++; 15650 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15651 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 15652 xmlResetLastError(); 15653 if (mem_base != xmlMemBlocks()) { 15654 printf("Leak of %d blocks found in namePush", 15655 xmlMemBlocks() - mem_base); 15656 test_ret++; 15657 printf(" %d", n_ctxt); 15658 printf(" %d", n_value); 15659 printf("\n"); 15660 } 15661 } 15662 } 15663 function_tests++; 15664 15665 return(test_ret); 15666 } 15667 15668 15669 static int 15670 test_nodePop(void) { 15671 int test_ret = 0; 15672 15673 int mem_base; 15674 xmlNodePtr ret_val; 15675 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15676 int n_ctxt; 15677 15678 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15679 mem_base = xmlMemBlocks(); 15680 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15681 15682 ret_val = nodePop(ctxt); 15683 desret_xmlNodePtr(ret_val); 15684 call_tests++; 15685 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15686 xmlResetLastError(); 15687 if (mem_base != xmlMemBlocks()) { 15688 printf("Leak of %d blocks found in nodePop", 15689 xmlMemBlocks() - mem_base); 15690 test_ret++; 15691 printf(" %d", n_ctxt); 15692 printf("\n"); 15693 } 15694 } 15695 function_tests++; 15696 15697 return(test_ret); 15698 } 15699 15700 15701 static int 15702 test_nodePush(void) { 15703 int test_ret = 0; 15704 15705 int mem_base; 15706 int ret_val; 15707 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15708 int n_ctxt; 15709 xmlNodePtr value; /* the element node */ 15710 int n_value; 15711 15712 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15713 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) { 15714 mem_base = xmlMemBlocks(); 15715 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15716 value = gen_xmlNodePtr(n_value, 1); 15717 15718 ret_val = nodePush(ctxt, value); 15719 desret_int(ret_val); 15720 call_tests++; 15721 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15722 des_xmlNodePtr(n_value, value, 1); 15723 xmlResetLastError(); 15724 if (mem_base != xmlMemBlocks()) { 15725 printf("Leak of %d blocks found in nodePush", 15726 xmlMemBlocks() - mem_base); 15727 test_ret++; 15728 printf(" %d", n_ctxt); 15729 printf(" %d", n_value); 15730 printf("\n"); 15731 } 15732 } 15733 } 15734 function_tests++; 15735 15736 return(test_ret); 15737 } 15738 15739 15740 static int 15741 test_xmlCheckLanguageID(void) { 15742 int test_ret = 0; 15743 15744 int mem_base; 15745 int ret_val; 15746 xmlChar * lang; /* pointer to the string value */ 15747 int n_lang; 15748 15749 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { 15750 mem_base = xmlMemBlocks(); 15751 lang = gen_const_xmlChar_ptr(n_lang, 0); 15752 15753 ret_val = xmlCheckLanguageID((const xmlChar *)lang); 15754 desret_int(ret_val); 15755 call_tests++; 15756 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0); 15757 xmlResetLastError(); 15758 if (mem_base != xmlMemBlocks()) { 15759 printf("Leak of %d blocks found in xmlCheckLanguageID", 15760 xmlMemBlocks() - mem_base); 15761 test_ret++; 15762 printf(" %d", n_lang); 15763 printf("\n"); 15764 } 15765 } 15766 function_tests++; 15767 15768 return(test_ret); 15769 } 15770 15771 15772 static int 15773 test_xmlCopyChar(void) { 15774 int test_ret = 0; 15775 15776 int mem_base; 15777 int ret_val; 15778 int len; /* Ignored, compatibility */ 15779 int n_len; 15780 xmlChar * out; /* pointer to an array of xmlChar */ 15781 int n_out; 15782 int val; /* the char value */ 15783 int n_val; 15784 15785 for (n_len = 0;n_len < gen_nb_int;n_len++) { 15786 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) { 15787 for (n_val = 0;n_val < gen_nb_int;n_val++) { 15788 mem_base = xmlMemBlocks(); 15789 len = gen_int(n_len, 0); 15790 out = gen_xmlChar_ptr(n_out, 1); 15791 val = gen_int(n_val, 2); 15792 15793 ret_val = xmlCopyChar(len, out, val); 15794 desret_int(ret_val); 15795 call_tests++; 15796 des_int(n_len, len, 0); 15797 des_xmlChar_ptr(n_out, out, 1); 15798 des_int(n_val, val, 2); 15799 xmlResetLastError(); 15800 if (mem_base != xmlMemBlocks()) { 15801 printf("Leak of %d blocks found in xmlCopyChar", 15802 xmlMemBlocks() - mem_base); 15803 test_ret++; 15804 printf(" %d", n_len); 15805 printf(" %d", n_out); 15806 printf(" %d", n_val); 15807 printf("\n"); 15808 } 15809 } 15810 } 15811 } 15812 function_tests++; 15813 15814 return(test_ret); 15815 } 15816 15817 15818 static int 15819 test_xmlCopyCharMultiByte(void) { 15820 int test_ret = 0; 15821 15822 int mem_base; 15823 int ret_val; 15824 xmlChar * out; /* pointer to an array of xmlChar */ 15825 int n_out; 15826 int val; /* the char value */ 15827 int n_val; 15828 15829 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) { 15830 for (n_val = 0;n_val < gen_nb_int;n_val++) { 15831 mem_base = xmlMemBlocks(); 15832 out = gen_xmlChar_ptr(n_out, 0); 15833 val = gen_int(n_val, 1); 15834 15835 ret_val = xmlCopyCharMultiByte(out, val); 15836 desret_int(ret_val); 15837 call_tests++; 15838 des_xmlChar_ptr(n_out, out, 0); 15839 des_int(n_val, val, 1); 15840 xmlResetLastError(); 15841 if (mem_base != xmlMemBlocks()) { 15842 printf("Leak of %d blocks found in xmlCopyCharMultiByte", 15843 xmlMemBlocks() - mem_base); 15844 test_ret++; 15845 printf(" %d", n_out); 15846 printf(" %d", n_val); 15847 printf("\n"); 15848 } 15849 } 15850 } 15851 function_tests++; 15852 15853 return(test_ret); 15854 } 15855 15856 15857 static int 15858 test_xmlCreateEntityParserCtxt(void) { 15859 int test_ret = 0; 15860 15861 int mem_base; 15862 xmlParserCtxtPtr ret_val; 15863 xmlChar * URL; /* the entity URL */ 15864 int n_URL; 15865 xmlChar * ID; /* the entity PUBLIC ID */ 15866 int n_ID; 15867 xmlChar * base; /* a possible base for the target URI */ 15868 int n_base; 15869 15870 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { 15871 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 15872 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { 15873 mem_base = xmlMemBlocks(); 15874 URL = gen_const_xmlChar_ptr(n_URL, 0); 15875 ID = gen_const_xmlChar_ptr(n_ID, 1); 15876 base = gen_const_xmlChar_ptr(n_base, 2); 15877 15878 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base); 15879 desret_xmlParserCtxtPtr(ret_val); 15880 call_tests++; 15881 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0); 15882 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1); 15883 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2); 15884 xmlResetLastError(); 15885 if (mem_base != xmlMemBlocks()) { 15886 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt", 15887 xmlMemBlocks() - mem_base); 15888 test_ret++; 15889 printf(" %d", n_URL); 15890 printf(" %d", n_ID); 15891 printf(" %d", n_base); 15892 printf("\n"); 15893 } 15894 } 15895 } 15896 } 15897 function_tests++; 15898 15899 return(test_ret); 15900 } 15901 15902 15903 static int 15904 test_xmlCreateFileParserCtxt(void) { 15905 int test_ret = 0; 15906 15907 int mem_base; 15908 xmlParserCtxtPtr ret_val; 15909 const char * filename; /* the filename */ 15910 int n_filename; 15911 15912 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 15913 mem_base = xmlMemBlocks(); 15914 filename = gen_fileoutput(n_filename, 0); 15915 15916 ret_val = xmlCreateFileParserCtxt(filename); 15917 desret_xmlParserCtxtPtr(ret_val); 15918 call_tests++; 15919 des_fileoutput(n_filename, filename, 0); 15920 xmlResetLastError(); 15921 if (mem_base != xmlMemBlocks()) { 15922 printf("Leak of %d blocks found in xmlCreateFileParserCtxt", 15923 xmlMemBlocks() - mem_base); 15924 test_ret++; 15925 printf(" %d", n_filename); 15926 printf("\n"); 15927 } 15928 } 15929 function_tests++; 15930 15931 return(test_ret); 15932 } 15933 15934 15935 static int 15936 test_xmlCreateMemoryParserCtxt(void) { 15937 int test_ret = 0; 15938 15939 int mem_base; 15940 xmlParserCtxtPtr ret_val; 15941 char * buffer; /* a pointer to a char array */ 15942 int n_buffer; 15943 int size; /* the size of the array */ 15944 int n_size; 15945 15946 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15947 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15948 mem_base = xmlMemBlocks(); 15949 buffer = gen_const_char_ptr(n_buffer, 0); 15950 size = gen_int(n_size, 1); 15951 15952 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size); 15953 desret_xmlParserCtxtPtr(ret_val); 15954 call_tests++; 15955 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 15956 des_int(n_size, size, 1); 15957 xmlResetLastError(); 15958 if (mem_base != xmlMemBlocks()) { 15959 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt", 15960 xmlMemBlocks() - mem_base); 15961 test_ret++; 15962 printf(" %d", n_buffer); 15963 printf(" %d", n_size); 15964 printf("\n"); 15965 } 15966 } 15967 } 15968 function_tests++; 15969 15970 return(test_ret); 15971 } 15972 15973 15974 static int 15975 test_xmlCreateURLParserCtxt(void) { 15976 int test_ret = 0; 15977 15978 int mem_base; 15979 xmlParserCtxtPtr ret_val; 15980 const char * filename; /* the filename or URL */ 15981 int n_filename; 15982 int options; /* a combination of xmlParserOption */ 15983 int n_options; 15984 15985 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 15986 for (n_options = 0;n_options < gen_nb_int;n_options++) { 15987 mem_base = xmlMemBlocks(); 15988 filename = gen_fileoutput(n_filename, 0); 15989 options = gen_int(n_options, 1); 15990 15991 ret_val = xmlCreateURLParserCtxt(filename, options); 15992 desret_xmlParserCtxtPtr(ret_val); 15993 call_tests++; 15994 des_fileoutput(n_filename, filename, 0); 15995 des_int(n_options, options, 1); 15996 xmlResetLastError(); 15997 if (mem_base != xmlMemBlocks()) { 15998 printf("Leak of %d blocks found in xmlCreateURLParserCtxt", 15999 xmlMemBlocks() - mem_base); 16000 test_ret++; 16001 printf(" %d", n_filename); 16002 printf(" %d", n_options); 16003 printf("\n"); 16004 } 16005 } 16006 } 16007 function_tests++; 16008 16009 return(test_ret); 16010 } 16011 16012 16013 static int 16014 test_xmlCurrentChar(void) { 16015 int test_ret = 0; 16016 16017 int mem_base; 16018 int ret_val; 16019 xmlParserCtxtPtr ctxt; /* the XML parser context */ 16020 int n_ctxt; 16021 int * len; /* pointer to the length of the char read */ 16022 int n_len; 16023 16024 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16025 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 16026 mem_base = xmlMemBlocks(); 16027 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16028 len = gen_int_ptr(n_len, 1); 16029 16030 ret_val = xmlCurrentChar(ctxt, len); 16031 desret_int(ret_val); 16032 call_tests++; 16033 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16034 des_int_ptr(n_len, len, 1); 16035 xmlResetLastError(); 16036 if (mem_base != xmlMemBlocks()) { 16037 printf("Leak of %d blocks found in xmlCurrentChar", 16038 xmlMemBlocks() - mem_base); 16039 test_ret++; 16040 printf(" %d", n_ctxt); 16041 printf(" %d", n_len); 16042 printf("\n"); 16043 } 16044 } 16045 } 16046 function_tests++; 16047 16048 return(test_ret); 16049 } 16050 16051 16052 static int 16053 test_xmlErrMemory(void) { 16054 int test_ret = 0; 16055 16056 int mem_base; 16057 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16058 int n_ctxt; 16059 char * extra; /* extra informations */ 16060 int n_extra; 16061 16062 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16063 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) { 16064 mem_base = xmlMemBlocks(); 16065 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16066 extra = gen_const_char_ptr(n_extra, 1); 16067 16068 xmlErrMemory(ctxt, (const char *)extra); 16069 call_tests++; 16070 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16071 des_const_char_ptr(n_extra, (const char *)extra, 1); 16072 xmlResetLastError(); 16073 if (mem_base != xmlMemBlocks()) { 16074 printf("Leak of %d blocks found in xmlErrMemory", 16075 xmlMemBlocks() - mem_base); 16076 test_ret++; 16077 printf(" %d", n_ctxt); 16078 printf(" %d", n_extra); 16079 printf("\n"); 16080 } 16081 } 16082 } 16083 function_tests++; 16084 16085 return(test_ret); 16086 } 16087 16088 16089 static int 16090 test_xmlIsLetter(void) { 16091 int test_ret = 0; 16092 16093 int mem_base; 16094 int ret_val; 16095 int c; /* an unicode character (int) */ 16096 int n_c; 16097 16098 for (n_c = 0;n_c < gen_nb_int;n_c++) { 16099 mem_base = xmlMemBlocks(); 16100 c = gen_int(n_c, 0); 16101 16102 ret_val = xmlIsLetter(c); 16103 desret_int(ret_val); 16104 call_tests++; 16105 des_int(n_c, c, 0); 16106 xmlResetLastError(); 16107 if (mem_base != xmlMemBlocks()) { 16108 printf("Leak of %d blocks found in xmlIsLetter", 16109 xmlMemBlocks() - mem_base); 16110 test_ret++; 16111 printf(" %d", n_c); 16112 printf("\n"); 16113 } 16114 } 16115 function_tests++; 16116 16117 return(test_ret); 16118 } 16119 16120 16121 static int 16122 test_xmlNewEntityInputStream(void) { 16123 int test_ret = 0; 16124 16125 int mem_base; 16126 xmlParserInputPtr ret_val; 16127 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16128 int n_ctxt; 16129 xmlEntityPtr entity; /* an Entity pointer */ 16130 int n_entity; 16131 16132 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16133 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) { 16134 mem_base = xmlMemBlocks(); 16135 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16136 entity = gen_xmlEntityPtr(n_entity, 1); 16137 16138 ret_val = xmlNewEntityInputStream(ctxt, entity); 16139 desret_xmlParserInputPtr(ret_val); 16140 call_tests++; 16141 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16142 des_xmlEntityPtr(n_entity, entity, 1); 16143 xmlResetLastError(); 16144 if (mem_base != xmlMemBlocks()) { 16145 printf("Leak of %d blocks found in xmlNewEntityInputStream", 16146 xmlMemBlocks() - mem_base); 16147 test_ret++; 16148 printf(" %d", n_ctxt); 16149 printf(" %d", n_entity); 16150 printf("\n"); 16151 } 16152 } 16153 } 16154 function_tests++; 16155 16156 return(test_ret); 16157 } 16158 16159 16160 static int 16161 test_xmlNewInputFromFile(void) { 16162 int test_ret = 0; 16163 16164 int mem_base; 16165 xmlParserInputPtr ret_val; 16166 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16167 int n_ctxt; 16168 const char * filename; /* the filename to use as entity */ 16169 int n_filename; 16170 16171 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16172 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 16173 mem_base = xmlMemBlocks(); 16174 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16175 filename = gen_filepath(n_filename, 1); 16176 16177 ret_val = xmlNewInputFromFile(ctxt, filename); 16178 desret_xmlParserInputPtr(ret_val); 16179 call_tests++; 16180 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16181 des_filepath(n_filename, filename, 1); 16182 xmlResetLastError(); 16183 if (mem_base != xmlMemBlocks()) { 16184 printf("Leak of %d blocks found in xmlNewInputFromFile", 16185 xmlMemBlocks() - mem_base); 16186 test_ret++; 16187 printf(" %d", n_ctxt); 16188 printf(" %d", n_filename); 16189 printf("\n"); 16190 } 16191 } 16192 } 16193 function_tests++; 16194 16195 return(test_ret); 16196 } 16197 16198 16199 static int 16200 test_xmlNewInputStream(void) { 16201 int test_ret = 0; 16202 16203 int mem_base; 16204 xmlParserInputPtr ret_val; 16205 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16206 int n_ctxt; 16207 16208 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16209 mem_base = xmlMemBlocks(); 16210 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16211 16212 ret_val = xmlNewInputStream(ctxt); 16213 desret_xmlParserInputPtr(ret_val); 16214 call_tests++; 16215 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16216 xmlResetLastError(); 16217 if (mem_base != xmlMemBlocks()) { 16218 printf("Leak of %d blocks found in xmlNewInputStream", 16219 xmlMemBlocks() - mem_base); 16220 test_ret++; 16221 printf(" %d", n_ctxt); 16222 printf("\n"); 16223 } 16224 } 16225 function_tests++; 16226 16227 return(test_ret); 16228 } 16229 16230 16231 static int 16232 test_xmlNewStringInputStream(void) { 16233 int test_ret = 0; 16234 16235 int mem_base; 16236 xmlParserInputPtr ret_val; 16237 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16238 int n_ctxt; 16239 xmlChar * buffer; /* an memory buffer */ 16240 int n_buffer; 16241 16242 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16243 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { 16244 mem_base = xmlMemBlocks(); 16245 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16246 buffer = gen_const_xmlChar_ptr(n_buffer, 1); 16247 16248 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer); 16249 desret_xmlParserInputPtr(ret_val); 16250 call_tests++; 16251 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16252 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1); 16253 xmlResetLastError(); 16254 if (mem_base != xmlMemBlocks()) { 16255 printf("Leak of %d blocks found in xmlNewStringInputStream", 16256 xmlMemBlocks() - mem_base); 16257 test_ret++; 16258 printf(" %d", n_ctxt); 16259 printf(" %d", n_buffer); 16260 printf("\n"); 16261 } 16262 } 16263 } 16264 function_tests++; 16265 16266 return(test_ret); 16267 } 16268 16269 16270 static int 16271 test_xmlNextChar(void) { 16272 int test_ret = 0; 16273 16274 int mem_base; 16275 xmlParserCtxtPtr ctxt; /* the XML parser context */ 16276 int n_ctxt; 16277 16278 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16279 mem_base = xmlMemBlocks(); 16280 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16281 16282 xmlNextChar(ctxt); 16283 call_tests++; 16284 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16285 xmlResetLastError(); 16286 if (mem_base != xmlMemBlocks()) { 16287 printf("Leak of %d blocks found in xmlNextChar", 16288 xmlMemBlocks() - mem_base); 16289 test_ret++; 16290 printf(" %d", n_ctxt); 16291 printf("\n"); 16292 } 16293 } 16294 function_tests++; 16295 16296 return(test_ret); 16297 } 16298 16299 16300 static int 16301 test_xmlParserInputShrink(void) { 16302 int test_ret = 0; 16303 16304 int mem_base; 16305 xmlParserInputPtr in; /* an XML parser input */ 16306 int n_in; 16307 16308 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { 16309 mem_base = xmlMemBlocks(); 16310 in = gen_xmlParserInputPtr(n_in, 0); 16311 16312 xmlParserInputShrink(in); 16313 call_tests++; 16314 des_xmlParserInputPtr(n_in, in, 0); 16315 xmlResetLastError(); 16316 if (mem_base != xmlMemBlocks()) { 16317 printf("Leak of %d blocks found in xmlParserInputShrink", 16318 xmlMemBlocks() - mem_base); 16319 test_ret++; 16320 printf(" %d", n_in); 16321 printf("\n"); 16322 } 16323 } 16324 function_tests++; 16325 16326 return(test_ret); 16327 } 16328 16329 16330 static int 16331 test_xmlPopInput(void) { 16332 int test_ret = 0; 16333 16334 int mem_base; 16335 xmlChar ret_val; 16336 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16337 int n_ctxt; 16338 16339 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16340 mem_base = xmlMemBlocks(); 16341 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16342 16343 ret_val = xmlPopInput(ctxt); 16344 desret_xmlChar(ret_val); 16345 call_tests++; 16346 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16347 xmlResetLastError(); 16348 if (mem_base != xmlMemBlocks()) { 16349 printf("Leak of %d blocks found in xmlPopInput", 16350 xmlMemBlocks() - mem_base); 16351 test_ret++; 16352 printf(" %d", n_ctxt); 16353 printf("\n"); 16354 } 16355 } 16356 function_tests++; 16357 16358 return(test_ret); 16359 } 16360 16361 16362 static int 16363 test_xmlPushInput(void) { 16364 int test_ret = 0; 16365 16366 int mem_base; 16367 int ret_val; 16368 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16369 int n_ctxt; 16370 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */ 16371 int n_input; 16372 16373 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16374 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 16375 mem_base = xmlMemBlocks(); 16376 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16377 input = gen_xmlParserInputPtr(n_input, 1); 16378 16379 ret_val = xmlPushInput(ctxt, input); 16380 desret_int(ret_val); 16381 call_tests++; 16382 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16383 des_xmlParserInputPtr(n_input, input, 1); 16384 xmlResetLastError(); 16385 if (mem_base != xmlMemBlocks()) { 16386 printf("Leak of %d blocks found in xmlPushInput", 16387 xmlMemBlocks() - mem_base); 16388 test_ret++; 16389 printf(" %d", n_ctxt); 16390 printf(" %d", n_input); 16391 printf("\n"); 16392 } 16393 } 16394 } 16395 function_tests++; 16396 16397 return(test_ret); 16398 } 16399 16400 16401 static int 16402 test_xmlSetEntityReferenceFunc(void) { 16403 int test_ret = 0; 16404 16405 16406 /* missing type support */ 16407 return(test_ret); 16408 } 16409 16410 16411 static int 16412 test_xmlSplitQName(void) { 16413 int test_ret = 0; 16414 16415 int mem_base; 16416 xmlChar * ret_val; 16417 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16418 int n_ctxt; 16419 xmlChar * name; /* an XML parser context */ 16420 int n_name; 16421 xmlChar ** prefix; /* a xmlChar ** */ 16422 int n_prefix; 16423 16424 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16425 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 16426 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) { 16427 mem_base = xmlMemBlocks(); 16428 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16429 name = gen_const_xmlChar_ptr(n_name, 1); 16430 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2); 16431 16432 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix); 16433 desret_xmlChar_ptr(ret_val); 16434 call_tests++; 16435 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16436 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 16437 des_xmlChar_ptr_ptr(n_prefix, prefix, 2); 16438 xmlResetLastError(); 16439 if (mem_base != xmlMemBlocks()) { 16440 printf("Leak of %d blocks found in xmlSplitQName", 16441 xmlMemBlocks() - mem_base); 16442 test_ret++; 16443 printf(" %d", n_ctxt); 16444 printf(" %d", n_name); 16445 printf(" %d", n_prefix); 16446 printf("\n"); 16447 } 16448 } 16449 } 16450 } 16451 function_tests++; 16452 16453 return(test_ret); 16454 } 16455 16456 16457 static int 16458 test_xmlStringCurrentChar(void) { 16459 int test_ret = 0; 16460 16461 int mem_base; 16462 int ret_val; 16463 xmlParserCtxtPtr ctxt; /* the XML parser context */ 16464 int n_ctxt; 16465 xmlChar * cur; /* pointer to the beginning of the char */ 16466 int n_cur; 16467 int * len; /* pointer to the length of the char read */ 16468 int n_len; 16469 16470 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16471 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 16472 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 16473 mem_base = xmlMemBlocks(); 16474 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16475 cur = gen_const_xmlChar_ptr(n_cur, 1); 16476 len = gen_int_ptr(n_len, 2); 16477 16478 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len); 16479 desret_int(ret_val); 16480 call_tests++; 16481 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16482 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 16483 des_int_ptr(n_len, len, 2); 16484 xmlResetLastError(); 16485 if (mem_base != xmlMemBlocks()) { 16486 printf("Leak of %d blocks found in xmlStringCurrentChar", 16487 xmlMemBlocks() - mem_base); 16488 test_ret++; 16489 printf(" %d", n_ctxt); 16490 printf(" %d", n_cur); 16491 printf(" %d", n_len); 16492 printf("\n"); 16493 } 16494 } 16495 } 16496 } 16497 function_tests++; 16498 16499 return(test_ret); 16500 } 16501 16502 16503 static int 16504 test_xmlStringDecodeEntities(void) { 16505 int test_ret = 0; 16506 16507 int mem_base; 16508 xmlChar * ret_val; 16509 xmlParserCtxtPtr ctxt; /* the parser context */ 16510 int n_ctxt; 16511 xmlChar * str; /* the input string */ 16512 int n_str; 16513 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */ 16514 int n_what; 16515 xmlChar end; /* an end marker xmlChar, 0 if none */ 16516 int n_end; 16517 xmlChar end2; /* an end marker xmlChar, 0 if none */ 16518 int n_end2; 16519 xmlChar end3; /* an end marker xmlChar, 0 if none */ 16520 int n_end3; 16521 16522 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16523 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 16524 for (n_what = 0;n_what < gen_nb_int;n_what++) { 16525 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) { 16526 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) { 16527 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) { 16528 mem_base = xmlMemBlocks(); 16529 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16530 str = gen_const_xmlChar_ptr(n_str, 1); 16531 what = gen_int(n_what, 2); 16532 end = gen_xmlChar(n_end, 3); 16533 end2 = gen_xmlChar(n_end2, 4); 16534 end3 = gen_xmlChar(n_end3, 5); 16535 16536 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3); 16537 desret_xmlChar_ptr(ret_val); 16538 call_tests++; 16539 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16540 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 16541 des_int(n_what, what, 2); 16542 des_xmlChar(n_end, end, 3); 16543 des_xmlChar(n_end2, end2, 4); 16544 des_xmlChar(n_end3, end3, 5); 16545 xmlResetLastError(); 16546 if (mem_base != xmlMemBlocks()) { 16547 printf("Leak of %d blocks found in xmlStringDecodeEntities", 16548 xmlMemBlocks() - mem_base); 16549 test_ret++; 16550 printf(" %d", n_ctxt); 16551 printf(" %d", n_str); 16552 printf(" %d", n_what); 16553 printf(" %d", n_end); 16554 printf(" %d", n_end2); 16555 printf(" %d", n_end3); 16556 printf("\n"); 16557 } 16558 } 16559 } 16560 } 16561 } 16562 } 16563 } 16564 function_tests++; 16565 16566 return(test_ret); 16567 } 16568 16569 16570 static int 16571 test_xmlStringLenDecodeEntities(void) { 16572 int test_ret = 0; 16573 16574 int mem_base; 16575 xmlChar * ret_val; 16576 xmlParserCtxtPtr ctxt; /* the parser context */ 16577 int n_ctxt; 16578 xmlChar * str; /* the input string */ 16579 int n_str; 16580 int len; /* the string length */ 16581 int n_len; 16582 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */ 16583 int n_what; 16584 xmlChar end; /* an end marker xmlChar, 0 if none */ 16585 int n_end; 16586 xmlChar end2; /* an end marker xmlChar, 0 if none */ 16587 int n_end2; 16588 xmlChar end3; /* an end marker xmlChar, 0 if none */ 16589 int n_end3; 16590 16591 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16592 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 16593 for (n_len = 0;n_len < gen_nb_int;n_len++) { 16594 for (n_what = 0;n_what < gen_nb_int;n_what++) { 16595 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) { 16596 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) { 16597 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) { 16598 mem_base = xmlMemBlocks(); 16599 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16600 str = gen_const_xmlChar_ptr(n_str, 1); 16601 len = gen_int(n_len, 2); 16602 what = gen_int(n_what, 3); 16603 end = gen_xmlChar(n_end, 4); 16604 end2 = gen_xmlChar(n_end2, 5); 16605 end3 = gen_xmlChar(n_end3, 6); 16606 16607 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3); 16608 desret_xmlChar_ptr(ret_val); 16609 call_tests++; 16610 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16611 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 16612 des_int(n_len, len, 2); 16613 des_int(n_what, what, 3); 16614 des_xmlChar(n_end, end, 4); 16615 des_xmlChar(n_end2, end2, 5); 16616 des_xmlChar(n_end3, end3, 6); 16617 xmlResetLastError(); 16618 if (mem_base != xmlMemBlocks()) { 16619 printf("Leak of %d blocks found in xmlStringLenDecodeEntities", 16620 xmlMemBlocks() - mem_base); 16621 test_ret++; 16622 printf(" %d", n_ctxt); 16623 printf(" %d", n_str); 16624 printf(" %d", n_len); 16625 printf(" %d", n_what); 16626 printf(" %d", n_end); 16627 printf(" %d", n_end2); 16628 printf(" %d", n_end3); 16629 printf("\n"); 16630 } 16631 } 16632 } 16633 } 16634 } 16635 } 16636 } 16637 } 16638 function_tests++; 16639 16640 return(test_ret); 16641 } 16642 16643 16644 static int 16645 test_xmlSwitchEncoding(void) { 16646 int test_ret = 0; 16647 16648 int mem_base; 16649 int ret_val; 16650 xmlParserCtxtPtr ctxt; /* the parser context */ 16651 int n_ctxt; 16652 xmlCharEncoding enc; /* the encoding value (number) */ 16653 int n_enc; 16654 16655 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16656 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 16657 mem_base = xmlMemBlocks(); 16658 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16659 enc = gen_xmlCharEncoding(n_enc, 1); 16660 16661 ret_val = xmlSwitchEncoding(ctxt, enc); 16662 desret_int(ret_val); 16663 call_tests++; 16664 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16665 des_xmlCharEncoding(n_enc, enc, 1); 16666 xmlResetLastError(); 16667 if (mem_base != xmlMemBlocks()) { 16668 printf("Leak of %d blocks found in xmlSwitchEncoding", 16669 xmlMemBlocks() - mem_base); 16670 test_ret++; 16671 printf(" %d", n_ctxt); 16672 printf(" %d", n_enc); 16673 printf("\n"); 16674 } 16675 } 16676 } 16677 function_tests++; 16678 16679 return(test_ret); 16680 } 16681 16682 16683 static int 16684 test_xmlSwitchInputEncoding(void) { 16685 int test_ret = 0; 16686 16687 int mem_base; 16688 int ret_val; 16689 xmlParserCtxtPtr ctxt; /* the parser context */ 16690 int n_ctxt; 16691 xmlParserInputPtr input; /* the input stream */ 16692 int n_input; 16693 xmlCharEncodingHandlerPtr handler; /* the encoding handler */ 16694 int n_handler; 16695 16696 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16697 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 16698 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { 16699 mem_base = xmlMemBlocks(); 16700 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16701 input = gen_xmlParserInputPtr(n_input, 1); 16702 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2); 16703 16704 ret_val = xmlSwitchInputEncoding(ctxt, input, handler); 16705 desret_int(ret_val); 16706 call_tests++; 16707 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16708 des_xmlParserInputPtr(n_input, input, 1); 16709 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2); 16710 xmlResetLastError(); 16711 if (mem_base != xmlMemBlocks()) { 16712 printf("Leak of %d blocks found in xmlSwitchInputEncoding", 16713 xmlMemBlocks() - mem_base); 16714 test_ret++; 16715 printf(" %d", n_ctxt); 16716 printf(" %d", n_input); 16717 printf(" %d", n_handler); 16718 printf("\n"); 16719 } 16720 } 16721 } 16722 } 16723 function_tests++; 16724 16725 return(test_ret); 16726 } 16727 16728 16729 static int 16730 test_xmlSwitchToEncoding(void) { 16731 int test_ret = 0; 16732 16733 int mem_base; 16734 int ret_val; 16735 xmlParserCtxtPtr ctxt; /* the parser context */ 16736 int n_ctxt; 16737 xmlCharEncodingHandlerPtr handler; /* the encoding handler */ 16738 int n_handler; 16739 16740 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16741 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { 16742 mem_base = xmlMemBlocks(); 16743 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16744 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1); 16745 16746 ret_val = xmlSwitchToEncoding(ctxt, handler); 16747 desret_int(ret_val); 16748 call_tests++; 16749 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16750 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1); 16751 xmlResetLastError(); 16752 if (mem_base != xmlMemBlocks()) { 16753 printf("Leak of %d blocks found in xmlSwitchToEncoding", 16754 xmlMemBlocks() - mem_base); 16755 test_ret++; 16756 printf(" %d", n_ctxt); 16757 printf(" %d", n_handler); 16758 printf("\n"); 16759 } 16760 } 16761 } 16762 function_tests++; 16763 16764 return(test_ret); 16765 } 16766 16767 static int 16768 test_parserInternals(void) { 16769 int test_ret = 0; 16770 16771 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n"); 16772 test_ret += test_htmlCreateFileParserCtxt(); 16773 test_ret += test_htmlInitAutoClose(); 16774 test_ret += test_inputPop(); 16775 test_ret += test_inputPush(); 16776 test_ret += test_namePop(); 16777 test_ret += test_namePush(); 16778 test_ret += test_nodePop(); 16779 test_ret += test_nodePush(); 16780 test_ret += test_xmlCheckLanguageID(); 16781 test_ret += test_xmlCopyChar(); 16782 test_ret += test_xmlCopyCharMultiByte(); 16783 test_ret += test_xmlCreateEntityParserCtxt(); 16784 test_ret += test_xmlCreateFileParserCtxt(); 16785 test_ret += test_xmlCreateMemoryParserCtxt(); 16786 test_ret += test_xmlCreateURLParserCtxt(); 16787 test_ret += test_xmlCurrentChar(); 16788 test_ret += test_xmlErrMemory(); 16789 test_ret += test_xmlIsLetter(); 16790 test_ret += test_xmlNewEntityInputStream(); 16791 test_ret += test_xmlNewInputFromFile(); 16792 test_ret += test_xmlNewInputStream(); 16793 test_ret += test_xmlNewStringInputStream(); 16794 test_ret += test_xmlNextChar(); 16795 test_ret += test_xmlParserInputShrink(); 16796 test_ret += test_xmlPopInput(); 16797 test_ret += test_xmlPushInput(); 16798 test_ret += test_xmlSetEntityReferenceFunc(); 16799 test_ret += test_xmlSplitQName(); 16800 test_ret += test_xmlStringCurrentChar(); 16801 test_ret += test_xmlStringDecodeEntities(); 16802 test_ret += test_xmlStringLenDecodeEntities(); 16803 test_ret += test_xmlSwitchEncoding(); 16804 test_ret += test_xmlSwitchInputEncoding(); 16805 test_ret += test_xmlSwitchToEncoding(); 16806 16807 if (test_ret != 0) 16808 printf("Module parserInternals: %d errors\n", test_ret); 16809 return(test_ret); 16810 } 16811 16812 static int 16813 test_xmlPatternFromRoot(void) { 16814 int test_ret = 0; 16815 16816 #if defined(LIBXML_PATTERN_ENABLED) 16817 int mem_base; 16818 int ret_val; 16819 xmlPatternPtr comp; /* the precompiled pattern */ 16820 int n_comp; 16821 16822 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16823 mem_base = xmlMemBlocks(); 16824 comp = gen_xmlPatternPtr(n_comp, 0); 16825 16826 ret_val = xmlPatternFromRoot(comp); 16827 desret_int(ret_val); 16828 call_tests++; 16829 des_xmlPatternPtr(n_comp, comp, 0); 16830 xmlResetLastError(); 16831 if (mem_base != xmlMemBlocks()) { 16832 printf("Leak of %d blocks found in xmlPatternFromRoot", 16833 xmlMemBlocks() - mem_base); 16834 test_ret++; 16835 printf(" %d", n_comp); 16836 printf("\n"); 16837 } 16838 } 16839 function_tests++; 16840 #endif 16841 16842 return(test_ret); 16843 } 16844 16845 16846 static int 16847 test_xmlPatternGetStreamCtxt(void) { 16848 int test_ret = 0; 16849 16850 16851 /* missing type support */ 16852 return(test_ret); 16853 } 16854 16855 16856 static int 16857 test_xmlPatternMatch(void) { 16858 int test_ret = 0; 16859 16860 #if defined(LIBXML_PATTERN_ENABLED) 16861 int mem_base; 16862 int ret_val; 16863 xmlPatternPtr comp; /* the precompiled pattern */ 16864 int n_comp; 16865 xmlNodePtr node; /* a node */ 16866 int n_node; 16867 16868 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16869 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 16870 mem_base = xmlMemBlocks(); 16871 comp = gen_xmlPatternPtr(n_comp, 0); 16872 node = gen_xmlNodePtr(n_node, 1); 16873 16874 ret_val = xmlPatternMatch(comp, node); 16875 desret_int(ret_val); 16876 call_tests++; 16877 des_xmlPatternPtr(n_comp, comp, 0); 16878 des_xmlNodePtr(n_node, node, 1); 16879 xmlResetLastError(); 16880 if (mem_base != xmlMemBlocks()) { 16881 printf("Leak of %d blocks found in xmlPatternMatch", 16882 xmlMemBlocks() - mem_base); 16883 test_ret++; 16884 printf(" %d", n_comp); 16885 printf(" %d", n_node); 16886 printf("\n"); 16887 } 16888 } 16889 } 16890 function_tests++; 16891 #endif 16892 16893 return(test_ret); 16894 } 16895 16896 16897 static int 16898 test_xmlPatternMaxDepth(void) { 16899 int test_ret = 0; 16900 16901 #if defined(LIBXML_PATTERN_ENABLED) 16902 int mem_base; 16903 int ret_val; 16904 xmlPatternPtr comp; /* the precompiled pattern */ 16905 int n_comp; 16906 16907 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16908 mem_base = xmlMemBlocks(); 16909 comp = gen_xmlPatternPtr(n_comp, 0); 16910 16911 ret_val = xmlPatternMaxDepth(comp); 16912 desret_int(ret_val); 16913 call_tests++; 16914 des_xmlPatternPtr(n_comp, comp, 0); 16915 xmlResetLastError(); 16916 if (mem_base != xmlMemBlocks()) { 16917 printf("Leak of %d blocks found in xmlPatternMaxDepth", 16918 xmlMemBlocks() - mem_base); 16919 test_ret++; 16920 printf(" %d", n_comp); 16921 printf("\n"); 16922 } 16923 } 16924 function_tests++; 16925 #endif 16926 16927 return(test_ret); 16928 } 16929 16930 16931 static int 16932 test_xmlPatternMinDepth(void) { 16933 int test_ret = 0; 16934 16935 #if defined(LIBXML_PATTERN_ENABLED) 16936 int mem_base; 16937 int ret_val; 16938 xmlPatternPtr comp; /* the precompiled pattern */ 16939 int n_comp; 16940 16941 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16942 mem_base = xmlMemBlocks(); 16943 comp = gen_xmlPatternPtr(n_comp, 0); 16944 16945 ret_val = xmlPatternMinDepth(comp); 16946 desret_int(ret_val); 16947 call_tests++; 16948 des_xmlPatternPtr(n_comp, comp, 0); 16949 xmlResetLastError(); 16950 if (mem_base != xmlMemBlocks()) { 16951 printf("Leak of %d blocks found in xmlPatternMinDepth", 16952 xmlMemBlocks() - mem_base); 16953 test_ret++; 16954 printf(" %d", n_comp); 16955 printf("\n"); 16956 } 16957 } 16958 function_tests++; 16959 #endif 16960 16961 return(test_ret); 16962 } 16963 16964 16965 static int 16966 test_xmlPatternStreamable(void) { 16967 int test_ret = 0; 16968 16969 #if defined(LIBXML_PATTERN_ENABLED) 16970 int mem_base; 16971 int ret_val; 16972 xmlPatternPtr comp; /* the precompiled pattern */ 16973 int n_comp; 16974 16975 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16976 mem_base = xmlMemBlocks(); 16977 comp = gen_xmlPatternPtr(n_comp, 0); 16978 16979 ret_val = xmlPatternStreamable(comp); 16980 desret_int(ret_val); 16981 call_tests++; 16982 des_xmlPatternPtr(n_comp, comp, 0); 16983 xmlResetLastError(); 16984 if (mem_base != xmlMemBlocks()) { 16985 printf("Leak of %d blocks found in xmlPatternStreamable", 16986 xmlMemBlocks() - mem_base); 16987 test_ret++; 16988 printf(" %d", n_comp); 16989 printf("\n"); 16990 } 16991 } 16992 function_tests++; 16993 #endif 16994 16995 return(test_ret); 16996 } 16997 16998 16999 static int 17000 test_xmlPatterncompile(void) { 17001 int test_ret = 0; 17002 17003 17004 /* missing type support */ 17005 return(test_ret); 17006 } 17007 17008 #ifdef LIBXML_PATTERN_ENABLED 17009 17010 #define gen_nb_xmlStreamCtxtPtr 1 17011 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17012 return(NULL); 17013 } 17014 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17015 } 17016 #endif 17017 17018 17019 static int 17020 test_xmlStreamPop(void) { 17021 int test_ret = 0; 17022 17023 #if defined(LIBXML_PATTERN_ENABLED) 17024 int mem_base; 17025 int ret_val; 17026 xmlStreamCtxtPtr stream; /* the stream context */ 17027 int n_stream; 17028 17029 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17030 mem_base = xmlMemBlocks(); 17031 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17032 17033 ret_val = xmlStreamPop(stream); 17034 desret_int(ret_val); 17035 call_tests++; 17036 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17037 xmlResetLastError(); 17038 if (mem_base != xmlMemBlocks()) { 17039 printf("Leak of %d blocks found in xmlStreamPop", 17040 xmlMemBlocks() - mem_base); 17041 test_ret++; 17042 printf(" %d", n_stream); 17043 printf("\n"); 17044 } 17045 } 17046 function_tests++; 17047 #endif 17048 17049 return(test_ret); 17050 } 17051 17052 17053 static int 17054 test_xmlStreamPush(void) { 17055 int test_ret = 0; 17056 17057 #if defined(LIBXML_PATTERN_ENABLED) 17058 int mem_base; 17059 int ret_val; 17060 xmlStreamCtxtPtr stream; /* the stream context */ 17061 int n_stream; 17062 xmlChar * name; /* the current name */ 17063 int n_name; 17064 xmlChar * ns; /* the namespace name */ 17065 int n_ns; 17066 17067 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17068 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 17069 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 17070 mem_base = xmlMemBlocks(); 17071 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17072 name = gen_const_xmlChar_ptr(n_name, 1); 17073 ns = gen_const_xmlChar_ptr(n_ns, 2); 17074 17075 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns); 17076 desret_int(ret_val); 17077 call_tests++; 17078 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17079 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 17080 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); 17081 xmlResetLastError(); 17082 if (mem_base != xmlMemBlocks()) { 17083 printf("Leak of %d blocks found in xmlStreamPush", 17084 xmlMemBlocks() - mem_base); 17085 test_ret++; 17086 printf(" %d", n_stream); 17087 printf(" %d", n_name); 17088 printf(" %d", n_ns); 17089 printf("\n"); 17090 } 17091 } 17092 } 17093 } 17094 function_tests++; 17095 #endif 17096 17097 return(test_ret); 17098 } 17099 17100 17101 static int 17102 test_xmlStreamPushAttr(void) { 17103 int test_ret = 0; 17104 17105 #if defined(LIBXML_PATTERN_ENABLED) 17106 int mem_base; 17107 int ret_val; 17108 xmlStreamCtxtPtr stream; /* the stream context */ 17109 int n_stream; 17110 xmlChar * name; /* the current name */ 17111 int n_name; 17112 xmlChar * ns; /* the namespace name */ 17113 int n_ns; 17114 17115 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17116 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 17117 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 17118 mem_base = xmlMemBlocks(); 17119 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17120 name = gen_const_xmlChar_ptr(n_name, 1); 17121 ns = gen_const_xmlChar_ptr(n_ns, 2); 17122 17123 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns); 17124 desret_int(ret_val); 17125 call_tests++; 17126 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17127 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 17128 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); 17129 xmlResetLastError(); 17130 if (mem_base != xmlMemBlocks()) { 17131 printf("Leak of %d blocks found in xmlStreamPushAttr", 17132 xmlMemBlocks() - mem_base); 17133 test_ret++; 17134 printf(" %d", n_stream); 17135 printf(" %d", n_name); 17136 printf(" %d", n_ns); 17137 printf("\n"); 17138 } 17139 } 17140 } 17141 } 17142 function_tests++; 17143 #endif 17144 17145 return(test_ret); 17146 } 17147 17148 17149 static int 17150 test_xmlStreamPushNode(void) { 17151 int test_ret = 0; 17152 17153 #if defined(LIBXML_PATTERN_ENABLED) 17154 int mem_base; 17155 int ret_val; 17156 xmlStreamCtxtPtr stream; /* the stream context */ 17157 int n_stream; 17158 xmlChar * name; /* the current name */ 17159 int n_name; 17160 xmlChar * ns; /* the namespace name */ 17161 int n_ns; 17162 int nodeType; /* the type of the node being pushed */ 17163 int n_nodeType; 17164 17165 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17166 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 17167 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 17168 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) { 17169 mem_base = xmlMemBlocks(); 17170 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17171 name = gen_const_xmlChar_ptr(n_name, 1); 17172 ns = gen_const_xmlChar_ptr(n_ns, 2); 17173 nodeType = gen_int(n_nodeType, 3); 17174 17175 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType); 17176 desret_int(ret_val); 17177 call_tests++; 17178 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17179 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 17180 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); 17181 des_int(n_nodeType, nodeType, 3); 17182 xmlResetLastError(); 17183 if (mem_base != xmlMemBlocks()) { 17184 printf("Leak of %d blocks found in xmlStreamPushNode", 17185 xmlMemBlocks() - mem_base); 17186 test_ret++; 17187 printf(" %d", n_stream); 17188 printf(" %d", n_name); 17189 printf(" %d", n_ns); 17190 printf(" %d", n_nodeType); 17191 printf("\n"); 17192 } 17193 } 17194 } 17195 } 17196 } 17197 function_tests++; 17198 #endif 17199 17200 return(test_ret); 17201 } 17202 17203 17204 static int 17205 test_xmlStreamWantsAnyNode(void) { 17206 int test_ret = 0; 17207 17208 #if defined(LIBXML_PATTERN_ENABLED) 17209 int mem_base; 17210 int ret_val; 17211 xmlStreamCtxtPtr streamCtxt; /* the stream context */ 17212 int n_streamCtxt; 17213 17214 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) { 17215 mem_base = xmlMemBlocks(); 17216 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0); 17217 17218 ret_val = xmlStreamWantsAnyNode(streamCtxt); 17219 desret_int(ret_val); 17220 call_tests++; 17221 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0); 17222 xmlResetLastError(); 17223 if (mem_base != xmlMemBlocks()) { 17224 printf("Leak of %d blocks found in xmlStreamWantsAnyNode", 17225 xmlMemBlocks() - mem_base); 17226 test_ret++; 17227 printf(" %d", n_streamCtxt); 17228 printf("\n"); 17229 } 17230 } 17231 function_tests++; 17232 #endif 17233 17234 return(test_ret); 17235 } 17236 17237 static int 17238 test_pattern(void) { 17239 int test_ret = 0; 17240 17241 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n"); 17242 test_ret += test_xmlPatternFromRoot(); 17243 test_ret += test_xmlPatternGetStreamCtxt(); 17244 test_ret += test_xmlPatternMatch(); 17245 test_ret += test_xmlPatternMaxDepth(); 17246 test_ret += test_xmlPatternMinDepth(); 17247 test_ret += test_xmlPatternStreamable(); 17248 test_ret += test_xmlPatterncompile(); 17249 test_ret += test_xmlStreamPop(); 17250 test_ret += test_xmlStreamPush(); 17251 test_ret += test_xmlStreamPushAttr(); 17252 test_ret += test_xmlStreamPushNode(); 17253 test_ret += test_xmlStreamWantsAnyNode(); 17254 17255 if (test_ret != 0) 17256 printf("Module pattern: %d errors\n", test_ret); 17257 return(test_ret); 17258 } 17259 #ifdef LIBXML_SCHEMAS_ENABLED 17260 17261 #define gen_nb_xmlRelaxNGPtr 1 17262 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17263 return(NULL); 17264 } 17265 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17266 } 17267 #endif 17268 17269 17270 static int 17271 test_xmlRelaxNGDump(void) { 17272 int test_ret = 0; 17273 17274 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 17275 int mem_base; 17276 FILE * output; /* the file output */ 17277 int n_output; 17278 xmlRelaxNGPtr schema; /* a schema structure */ 17279 int n_schema; 17280 17281 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { 17282 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { 17283 mem_base = xmlMemBlocks(); 17284 output = gen_FILE_ptr(n_output, 0); 17285 schema = gen_xmlRelaxNGPtr(n_schema, 1); 17286 17287 xmlRelaxNGDump(output, schema); 17288 call_tests++; 17289 des_FILE_ptr(n_output, output, 0); 17290 des_xmlRelaxNGPtr(n_schema, schema, 1); 17291 xmlResetLastError(); 17292 if (mem_base != xmlMemBlocks()) { 17293 printf("Leak of %d blocks found in xmlRelaxNGDump", 17294 xmlMemBlocks() - mem_base); 17295 test_ret++; 17296 printf(" %d", n_output); 17297 printf(" %d", n_schema); 17298 printf("\n"); 17299 } 17300 } 17301 } 17302 function_tests++; 17303 #endif 17304 17305 return(test_ret); 17306 } 17307 17308 17309 static int 17310 test_xmlRelaxNGDumpTree(void) { 17311 int test_ret = 0; 17312 17313 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 17314 int mem_base; 17315 FILE * output; /* the file output */ 17316 int n_output; 17317 xmlRelaxNGPtr schema; /* a schema structure */ 17318 int n_schema; 17319 17320 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { 17321 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { 17322 mem_base = xmlMemBlocks(); 17323 output = gen_FILE_ptr(n_output, 0); 17324 schema = gen_xmlRelaxNGPtr(n_schema, 1); 17325 17326 xmlRelaxNGDumpTree(output, schema); 17327 call_tests++; 17328 des_FILE_ptr(n_output, output, 0); 17329 des_xmlRelaxNGPtr(n_schema, schema, 1); 17330 xmlResetLastError(); 17331 if (mem_base != xmlMemBlocks()) { 17332 printf("Leak of %d blocks found in xmlRelaxNGDumpTree", 17333 xmlMemBlocks() - mem_base); 17334 test_ret++; 17335 printf(" %d", n_output); 17336 printf(" %d", n_schema); 17337 printf("\n"); 17338 } 17339 } 17340 } 17341 function_tests++; 17342 #endif 17343 17344 return(test_ret); 17345 } 17346 17347 #ifdef LIBXML_SCHEMAS_ENABLED 17348 17349 #define gen_nb_xmlRelaxNGParserCtxtPtr 1 17350 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17351 return(NULL); 17352 } 17353 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17354 } 17355 #endif 17356 17357 #ifdef LIBXML_SCHEMAS_ENABLED 17358 17359 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1 17360 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17361 return(NULL); 17362 } 17363 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17364 } 17365 #endif 17366 17367 #ifdef LIBXML_SCHEMAS_ENABLED 17368 17369 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1 17370 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17371 return(NULL); 17372 } 17373 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17374 } 17375 #endif 17376 17377 17378 static int 17379 test_xmlRelaxNGGetParserErrors(void) { 17380 int test_ret = 0; 17381 17382 #if defined(LIBXML_SCHEMAS_ENABLED) 17383 int mem_base; 17384 int ret_val; 17385 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */ 17386 int n_ctxt; 17387 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */ 17388 int n_err; 17389 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */ 17390 int n_warn; 17391 void ** ctx; /* contextual data for the callbacks result */ 17392 int n_ctx; 17393 17394 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) { 17395 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) { 17396 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) { 17397 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { 17398 mem_base = xmlMemBlocks(); 17399 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0); 17400 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1); 17401 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2); 17402 ctx = gen_void_ptr_ptr(n_ctx, 3); 17403 17404 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx); 17405 desret_int(ret_val); 17406 call_tests++; 17407 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0); 17408 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1); 17409 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2); 17410 des_void_ptr_ptr(n_ctx, ctx, 3); 17411 xmlResetLastError(); 17412 if (mem_base != xmlMemBlocks()) { 17413 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors", 17414 xmlMemBlocks() - mem_base); 17415 test_ret++; 17416 printf(" %d", n_ctxt); 17417 printf(" %d", n_err); 17418 printf(" %d", n_warn); 17419 printf(" %d", n_ctx); 17420 printf("\n"); 17421 } 17422 } 17423 } 17424 } 17425 } 17426 function_tests++; 17427 #endif 17428 17429 return(test_ret); 17430 } 17431 17432 #ifdef LIBXML_SCHEMAS_ENABLED 17433 17434 #define gen_nb_xmlRelaxNGValidCtxtPtr 1 17435 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17436 return(NULL); 17437 } 17438 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17439 } 17440 #endif 17441 17442 17443 static int 17444 test_xmlRelaxNGGetValidErrors(void) { 17445 int test_ret = 0; 17446 17447 #if defined(LIBXML_SCHEMAS_ENABLED) 17448 int mem_base; 17449 int ret_val; 17450 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ 17451 int n_ctxt; 17452 xmlRelaxNGValidityErrorFunc * err; /* the error function result */ 17453 int n_err; 17454 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */ 17455 int n_warn; 17456 void ** ctx; /* the functions context result */ 17457 int n_ctx; 17458 17459 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17460 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) { 17461 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) { 17462 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { 17463 mem_base = xmlMemBlocks(); 17464 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17465 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1); 17466 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2); 17467 ctx = gen_void_ptr_ptr(n_ctx, 3); 17468 17469 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx); 17470 desret_int(ret_val); 17471 call_tests++; 17472 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17473 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1); 17474 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2); 17475 des_void_ptr_ptr(n_ctx, ctx, 3); 17476 xmlResetLastError(); 17477 if (mem_base != xmlMemBlocks()) { 17478 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors", 17479 xmlMemBlocks() - mem_base); 17480 test_ret++; 17481 printf(" %d", n_ctxt); 17482 printf(" %d", n_err); 17483 printf(" %d", n_warn); 17484 printf(" %d", n_ctx); 17485 printf("\n"); 17486 } 17487 } 17488 } 17489 } 17490 } 17491 function_tests++; 17492 #endif 17493 17494 return(test_ret); 17495 } 17496 17497 17498 static int 17499 test_xmlRelaxNGInitTypes(void) { 17500 int test_ret = 0; 17501 17502 #if defined(LIBXML_SCHEMAS_ENABLED) 17503 int mem_base; 17504 int ret_val; 17505 17506 mem_base = xmlMemBlocks(); 17507 17508 ret_val = xmlRelaxNGInitTypes(); 17509 desret_int(ret_val); 17510 call_tests++; 17511 xmlResetLastError(); 17512 if (mem_base != xmlMemBlocks()) { 17513 printf("Leak of %d blocks found in xmlRelaxNGInitTypes", 17514 xmlMemBlocks() - mem_base); 17515 test_ret++; 17516 printf("\n"); 17517 } 17518 function_tests++; 17519 #endif 17520 17521 return(test_ret); 17522 } 17523 17524 17525 static int 17526 test_xmlRelaxNGNewDocParserCtxt(void) { 17527 int test_ret = 0; 17528 17529 #if defined(LIBXML_SCHEMAS_ENABLED) 17530 int mem_base; 17531 xmlRelaxNGParserCtxtPtr ret_val; 17532 xmlDocPtr doc; /* a preparsed document tree */ 17533 int n_doc; 17534 17535 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17536 mem_base = xmlMemBlocks(); 17537 doc = gen_xmlDocPtr(n_doc, 0); 17538 17539 ret_val = xmlRelaxNGNewDocParserCtxt(doc); 17540 desret_xmlRelaxNGParserCtxtPtr(ret_val); 17541 call_tests++; 17542 des_xmlDocPtr(n_doc, doc, 0); 17543 xmlResetLastError(); 17544 if (mem_base != xmlMemBlocks()) { 17545 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt", 17546 xmlMemBlocks() - mem_base); 17547 test_ret++; 17548 printf(" %d", n_doc); 17549 printf("\n"); 17550 } 17551 } 17552 function_tests++; 17553 #endif 17554 17555 return(test_ret); 17556 } 17557 17558 17559 static int 17560 test_xmlRelaxNGNewMemParserCtxt(void) { 17561 int test_ret = 0; 17562 17563 #if defined(LIBXML_SCHEMAS_ENABLED) 17564 int mem_base; 17565 xmlRelaxNGParserCtxtPtr ret_val; 17566 char * buffer; /* a pointer to a char array containing the schemas */ 17567 int n_buffer; 17568 int size; /* the size of the array */ 17569 int n_size; 17570 17571 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 17572 for (n_size = 0;n_size < gen_nb_int;n_size++) { 17573 mem_base = xmlMemBlocks(); 17574 buffer = gen_const_char_ptr(n_buffer, 0); 17575 size = gen_int(n_size, 1); 17576 17577 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size); 17578 desret_xmlRelaxNGParserCtxtPtr(ret_val); 17579 call_tests++; 17580 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 17581 des_int(n_size, size, 1); 17582 xmlResetLastError(); 17583 if (mem_base != xmlMemBlocks()) { 17584 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt", 17585 xmlMemBlocks() - mem_base); 17586 test_ret++; 17587 printf(" %d", n_buffer); 17588 printf(" %d", n_size); 17589 printf("\n"); 17590 } 17591 } 17592 } 17593 function_tests++; 17594 #endif 17595 17596 return(test_ret); 17597 } 17598 17599 17600 static int 17601 test_xmlRelaxNGNewParserCtxt(void) { 17602 int test_ret = 0; 17603 17604 #if defined(LIBXML_SCHEMAS_ENABLED) 17605 int mem_base; 17606 xmlRelaxNGParserCtxtPtr ret_val; 17607 char * URL; /* the location of the schema */ 17608 int n_URL; 17609 17610 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) { 17611 mem_base = xmlMemBlocks(); 17612 URL = gen_const_char_ptr(n_URL, 0); 17613 17614 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL); 17615 desret_xmlRelaxNGParserCtxtPtr(ret_val); 17616 call_tests++; 17617 des_const_char_ptr(n_URL, (const char *)URL, 0); 17618 xmlResetLastError(); 17619 if (mem_base != xmlMemBlocks()) { 17620 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt", 17621 xmlMemBlocks() - mem_base); 17622 test_ret++; 17623 printf(" %d", n_URL); 17624 printf("\n"); 17625 } 17626 } 17627 function_tests++; 17628 #endif 17629 17630 return(test_ret); 17631 } 17632 17633 17634 static int 17635 test_xmlRelaxNGNewValidCtxt(void) { 17636 int test_ret = 0; 17637 17638 17639 /* missing type support */ 17640 return(test_ret); 17641 } 17642 17643 17644 static int 17645 test_xmlRelaxNGParse(void) { 17646 int test_ret = 0; 17647 17648 17649 /* missing type support */ 17650 return(test_ret); 17651 } 17652 17653 17654 static int 17655 test_xmlRelaxNGSetParserErrors(void) { 17656 int test_ret = 0; 17657 17658 17659 /* missing type support */ 17660 return(test_ret); 17661 } 17662 17663 17664 static int 17665 test_xmlRelaxNGSetParserStructuredErrors(void) { 17666 int test_ret = 0; 17667 17668 17669 /* missing type support */ 17670 return(test_ret); 17671 } 17672 17673 17674 static int 17675 test_xmlRelaxNGSetValidErrors(void) { 17676 int test_ret = 0; 17677 17678 17679 /* missing type support */ 17680 return(test_ret); 17681 } 17682 17683 17684 static int 17685 test_xmlRelaxNGSetValidStructuredErrors(void) { 17686 int test_ret = 0; 17687 17688 17689 /* missing type support */ 17690 return(test_ret); 17691 } 17692 17693 17694 static int 17695 test_xmlRelaxNGValidateDoc(void) { 17696 int test_ret = 0; 17697 17698 #if defined(LIBXML_SCHEMAS_ENABLED) 17699 int mem_base; 17700 int ret_val; 17701 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ 17702 int n_ctxt; 17703 xmlDocPtr doc; /* a parsed document tree */ 17704 int n_doc; 17705 17706 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17707 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17708 mem_base = xmlMemBlocks(); 17709 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17710 doc = gen_xmlDocPtr(n_doc, 1); 17711 17712 ret_val = xmlRelaxNGValidateDoc(ctxt, doc); 17713 desret_int(ret_val); 17714 call_tests++; 17715 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17716 des_xmlDocPtr(n_doc, doc, 1); 17717 xmlResetLastError(); 17718 if (mem_base != xmlMemBlocks()) { 17719 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc", 17720 xmlMemBlocks() - mem_base); 17721 test_ret++; 17722 printf(" %d", n_ctxt); 17723 printf(" %d", n_doc); 17724 printf("\n"); 17725 } 17726 } 17727 } 17728 function_tests++; 17729 #endif 17730 17731 return(test_ret); 17732 } 17733 17734 17735 static int 17736 test_xmlRelaxNGValidateFullElement(void) { 17737 int test_ret = 0; 17738 17739 #if defined(LIBXML_SCHEMAS_ENABLED) 17740 int mem_base; 17741 int ret_val; 17742 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ 17743 int n_ctxt; 17744 xmlDocPtr doc; /* a document instance */ 17745 int n_doc; 17746 xmlNodePtr elem; /* an element instance */ 17747 int n_elem; 17748 17749 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17750 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17751 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 17752 mem_base = xmlMemBlocks(); 17753 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17754 doc = gen_xmlDocPtr(n_doc, 1); 17755 elem = gen_xmlNodePtr(n_elem, 2); 17756 17757 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem); 17758 desret_int(ret_val); 17759 call_tests++; 17760 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17761 des_xmlDocPtr(n_doc, doc, 1); 17762 des_xmlNodePtr(n_elem, elem, 2); 17763 xmlResetLastError(); 17764 if (mem_base != xmlMemBlocks()) { 17765 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement", 17766 xmlMemBlocks() - mem_base); 17767 test_ret++; 17768 printf(" %d", n_ctxt); 17769 printf(" %d", n_doc); 17770 printf(" %d", n_elem); 17771 printf("\n"); 17772 } 17773 } 17774 } 17775 } 17776 function_tests++; 17777 #endif 17778 17779 return(test_ret); 17780 } 17781 17782 17783 static int 17784 test_xmlRelaxNGValidatePopElement(void) { 17785 int test_ret = 0; 17786 17787 #if defined(LIBXML_SCHEMAS_ENABLED) 17788 int mem_base; 17789 int ret_val; 17790 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ 17791 int n_ctxt; 17792 xmlDocPtr doc; /* a document instance */ 17793 int n_doc; 17794 xmlNodePtr elem; /* an element instance */ 17795 int n_elem; 17796 17797 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17798 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17799 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 17800 mem_base = xmlMemBlocks(); 17801 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17802 doc = gen_xmlDocPtr(n_doc, 1); 17803 elem = gen_xmlNodePtr(n_elem, 2); 17804 17805 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem); 17806 desret_int(ret_val); 17807 call_tests++; 17808 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17809 des_xmlDocPtr(n_doc, doc, 1); 17810 des_xmlNodePtr(n_elem, elem, 2); 17811 xmlResetLastError(); 17812 if (mem_base != xmlMemBlocks()) { 17813 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement", 17814 xmlMemBlocks() - mem_base); 17815 test_ret++; 17816 printf(" %d", n_ctxt); 17817 printf(" %d", n_doc); 17818 printf(" %d", n_elem); 17819 printf("\n"); 17820 } 17821 } 17822 } 17823 } 17824 function_tests++; 17825 #endif 17826 17827 return(test_ret); 17828 } 17829 17830 17831 static int 17832 test_xmlRelaxNGValidatePushCData(void) { 17833 int test_ret = 0; 17834 17835 #if defined(LIBXML_SCHEMAS_ENABLED) 17836 int mem_base; 17837 int ret_val; 17838 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ 17839 int n_ctxt; 17840 xmlChar * data; /* some character data read */ 17841 int n_data; 17842 int len; /* the length of the data */ 17843 int n_len; 17844 17845 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17846 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { 17847 for (n_len = 0;n_len < gen_nb_int;n_len++) { 17848 mem_base = xmlMemBlocks(); 17849 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17850 data = gen_const_xmlChar_ptr(n_data, 1); 17851 len = gen_int(n_len, 2); 17852 17853 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len); 17854 desret_int(ret_val); 17855 call_tests++; 17856 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17857 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1); 17858 des_int(n_len, len, 2); 17859 xmlResetLastError(); 17860 if (mem_base != xmlMemBlocks()) { 17861 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData", 17862 xmlMemBlocks() - mem_base); 17863 test_ret++; 17864 printf(" %d", n_ctxt); 17865 printf(" %d", n_data); 17866 printf(" %d", n_len); 17867 printf("\n"); 17868 } 17869 } 17870 } 17871 } 17872 function_tests++; 17873 #endif 17874 17875 return(test_ret); 17876 } 17877 17878 17879 static int 17880 test_xmlRelaxNGValidatePushElement(void) { 17881 int test_ret = 0; 17882 17883 #if defined(LIBXML_SCHEMAS_ENABLED) 17884 int mem_base; 17885 int ret_val; 17886 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ 17887 int n_ctxt; 17888 xmlDocPtr doc; /* a document instance */ 17889 int n_doc; 17890 xmlNodePtr elem; /* an element instance */ 17891 int n_elem; 17892 17893 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17894 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17895 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 17896 mem_base = xmlMemBlocks(); 17897 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17898 doc = gen_xmlDocPtr(n_doc, 1); 17899 elem = gen_xmlNodePtr(n_elem, 2); 17900 17901 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem); 17902 desret_int(ret_val); 17903 call_tests++; 17904 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17905 des_xmlDocPtr(n_doc, doc, 1); 17906 des_xmlNodePtr(n_elem, elem, 2); 17907 xmlResetLastError(); 17908 if (mem_base != xmlMemBlocks()) { 17909 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement", 17910 xmlMemBlocks() - mem_base); 17911 test_ret++; 17912 printf(" %d", n_ctxt); 17913 printf(" %d", n_doc); 17914 printf(" %d", n_elem); 17915 printf("\n"); 17916 } 17917 } 17918 } 17919 } 17920 function_tests++; 17921 #endif 17922 17923 return(test_ret); 17924 } 17925 17926 17927 static int 17928 test_xmlRelaxParserSetFlag(void) { 17929 int test_ret = 0; 17930 17931 #if defined(LIBXML_SCHEMAS_ENABLED) 17932 int mem_base; 17933 int ret_val; 17934 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */ 17935 int n_ctxt; 17936 int flags; /* a set of flags values */ 17937 int n_flags; 17938 17939 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) { 17940 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 17941 mem_base = xmlMemBlocks(); 17942 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0); 17943 flags = gen_int(n_flags, 1); 17944 17945 ret_val = xmlRelaxParserSetFlag(ctxt, flags); 17946 desret_int(ret_val); 17947 call_tests++; 17948 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0); 17949 des_int(n_flags, flags, 1); 17950 xmlResetLastError(); 17951 if (mem_base != xmlMemBlocks()) { 17952 printf("Leak of %d blocks found in xmlRelaxParserSetFlag", 17953 xmlMemBlocks() - mem_base); 17954 test_ret++; 17955 printf(" %d", n_ctxt); 17956 printf(" %d", n_flags); 17957 printf("\n"); 17958 } 17959 } 17960 } 17961 function_tests++; 17962 #endif 17963 17964 return(test_ret); 17965 } 17966 17967 static int 17968 test_relaxng(void) { 17969 int test_ret = 0; 17970 17971 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n"); 17972 test_ret += test_xmlRelaxNGDump(); 17973 test_ret += test_xmlRelaxNGDumpTree(); 17974 test_ret += test_xmlRelaxNGGetParserErrors(); 17975 test_ret += test_xmlRelaxNGGetValidErrors(); 17976 test_ret += test_xmlRelaxNGInitTypes(); 17977 test_ret += test_xmlRelaxNGNewDocParserCtxt(); 17978 test_ret += test_xmlRelaxNGNewMemParserCtxt(); 17979 test_ret += test_xmlRelaxNGNewParserCtxt(); 17980 test_ret += test_xmlRelaxNGNewValidCtxt(); 17981 test_ret += test_xmlRelaxNGParse(); 17982 test_ret += test_xmlRelaxNGSetParserErrors(); 17983 test_ret += test_xmlRelaxNGSetParserStructuredErrors(); 17984 test_ret += test_xmlRelaxNGSetValidErrors(); 17985 test_ret += test_xmlRelaxNGSetValidStructuredErrors(); 17986 test_ret += test_xmlRelaxNGValidateDoc(); 17987 test_ret += test_xmlRelaxNGValidateFullElement(); 17988 test_ret += test_xmlRelaxNGValidatePopElement(); 17989 test_ret += test_xmlRelaxNGValidatePushCData(); 17990 test_ret += test_xmlRelaxNGValidatePushElement(); 17991 test_ret += test_xmlRelaxParserSetFlag(); 17992 17993 if (test_ret != 0) 17994 printf("Module relaxng: %d errors\n", test_ret); 17995 return(test_ret); 17996 } 17997 static int 17998 test_schemasInternals(void) { 17999 int test_ret = 0; 18000 18001 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n"); 18002 18003 if (test_ret != 0) 18004 printf("Module schemasInternals: %d errors\n", test_ret); 18005 return(test_ret); 18006 } 18007 18008 static int 18009 test_xmlSchematronNewDocParserCtxt(void) { 18010 int test_ret = 0; 18011 18012 18013 /* missing type support */ 18014 return(test_ret); 18015 } 18016 18017 18018 static int 18019 test_xmlSchematronNewMemParserCtxt(void) { 18020 int test_ret = 0; 18021 18022 18023 /* missing type support */ 18024 return(test_ret); 18025 } 18026 18027 18028 static int 18029 test_xmlSchematronNewParserCtxt(void) { 18030 int test_ret = 0; 18031 18032 18033 /* missing type support */ 18034 return(test_ret); 18035 } 18036 18037 #ifdef LIBXML_SCHEMATRON_ENABLED 18038 18039 #define gen_nb_xmlSchematronPtr 1 18040 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18041 return(NULL); 18042 } 18043 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18044 } 18045 #endif 18046 18047 18048 static int 18049 test_xmlSchematronNewValidCtxt(void) { 18050 int test_ret = 0; 18051 18052 18053 /* missing type support */ 18054 return(test_ret); 18055 } 18056 18057 #ifdef LIBXML_SCHEMATRON_ENABLED 18058 18059 #define gen_nb_xmlSchematronParserCtxtPtr 1 18060 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18061 return(NULL); 18062 } 18063 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18064 } 18065 #endif 18066 18067 18068 static int 18069 test_xmlSchematronParse(void) { 18070 int test_ret = 0; 18071 18072 18073 /* missing type support */ 18074 return(test_ret); 18075 } 18076 18077 #ifdef LIBXML_SCHEMATRON_ENABLED 18078 18079 #define gen_nb_xmlSchematronValidCtxtPtr 1 18080 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18081 return(NULL); 18082 } 18083 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18084 } 18085 #endif 18086 18087 18088 static int 18089 test_xmlSchematronSetValidStructuredErrors(void) { 18090 int test_ret = 0; 18091 18092 18093 /* missing type support */ 18094 return(test_ret); 18095 } 18096 18097 18098 static int 18099 test_xmlSchematronValidateDoc(void) { 18100 int test_ret = 0; 18101 18102 #if defined(LIBXML_SCHEMATRON_ENABLED) 18103 int mem_base; 18104 int ret_val; 18105 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */ 18106 int n_ctxt; 18107 xmlDocPtr instance; /* the document instace tree */ 18108 int n_instance; 18109 18110 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) { 18111 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) { 18112 mem_base = xmlMemBlocks(); 18113 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0); 18114 instance = gen_xmlDocPtr(n_instance, 1); 18115 18116 ret_val = xmlSchematronValidateDoc(ctxt, instance); 18117 desret_int(ret_val); 18118 call_tests++; 18119 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0); 18120 des_xmlDocPtr(n_instance, instance, 1); 18121 xmlResetLastError(); 18122 if (mem_base != xmlMemBlocks()) { 18123 printf("Leak of %d blocks found in xmlSchematronValidateDoc", 18124 xmlMemBlocks() - mem_base); 18125 test_ret++; 18126 printf(" %d", n_ctxt); 18127 printf(" %d", n_instance); 18128 printf("\n"); 18129 } 18130 } 18131 } 18132 function_tests++; 18133 #endif 18134 18135 return(test_ret); 18136 } 18137 18138 static int 18139 test_schematron(void) { 18140 int test_ret = 0; 18141 18142 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n"); 18143 test_ret += test_xmlSchematronNewDocParserCtxt(); 18144 test_ret += test_xmlSchematronNewMemParserCtxt(); 18145 test_ret += test_xmlSchematronNewParserCtxt(); 18146 test_ret += test_xmlSchematronNewValidCtxt(); 18147 test_ret += test_xmlSchematronParse(); 18148 test_ret += test_xmlSchematronSetValidStructuredErrors(); 18149 test_ret += test_xmlSchematronValidateDoc(); 18150 18151 if (test_ret != 0) 18152 printf("Module schematron: %d errors\n", test_ret); 18153 return(test_ret); 18154 } 18155 18156 static int 18157 test_xmlAddChild(void) { 18158 int test_ret = 0; 18159 18160 int mem_base; 18161 xmlNodePtr ret_val; 18162 xmlNodePtr parent; /* the parent node */ 18163 int n_parent; 18164 xmlNodePtr cur; /* the child node */ 18165 int n_cur; 18166 18167 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 18168 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { 18169 mem_base = xmlMemBlocks(); 18170 parent = gen_xmlNodePtr(n_parent, 0); 18171 cur = gen_xmlNodePtr_in(n_cur, 1); 18172 18173 ret_val = xmlAddChild(parent, cur); 18174 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; } 18175 desret_xmlNodePtr(ret_val); 18176 call_tests++; 18177 des_xmlNodePtr(n_parent, parent, 0); 18178 des_xmlNodePtr_in(n_cur, cur, 1); 18179 xmlResetLastError(); 18180 if (mem_base != xmlMemBlocks()) { 18181 printf("Leak of %d blocks found in xmlAddChild", 18182 xmlMemBlocks() - mem_base); 18183 test_ret++; 18184 printf(" %d", n_parent); 18185 printf(" %d", n_cur); 18186 printf("\n"); 18187 } 18188 } 18189 } 18190 function_tests++; 18191 18192 return(test_ret); 18193 } 18194 18195 18196 static int 18197 test_xmlAddChildList(void) { 18198 int test_ret = 0; 18199 18200 int mem_base; 18201 xmlNodePtr ret_val; 18202 xmlNodePtr parent; /* the parent node */ 18203 int n_parent; 18204 xmlNodePtr cur; /* the first node in the list */ 18205 int n_cur; 18206 18207 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 18208 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { 18209 mem_base = xmlMemBlocks(); 18210 parent = gen_xmlNodePtr(n_parent, 0); 18211 cur = gen_xmlNodePtr_in(n_cur, 1); 18212 18213 ret_val = xmlAddChildList(parent, cur); 18214 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; } 18215 desret_xmlNodePtr(ret_val); 18216 call_tests++; 18217 des_xmlNodePtr(n_parent, parent, 0); 18218 des_xmlNodePtr_in(n_cur, cur, 1); 18219 xmlResetLastError(); 18220 if (mem_base != xmlMemBlocks()) { 18221 printf("Leak of %d blocks found in xmlAddChildList", 18222 xmlMemBlocks() - mem_base); 18223 test_ret++; 18224 printf(" %d", n_parent); 18225 printf(" %d", n_cur); 18226 printf("\n"); 18227 } 18228 } 18229 } 18230 function_tests++; 18231 18232 return(test_ret); 18233 } 18234 18235 18236 static int 18237 test_xmlAddNextSibling(void) { 18238 int test_ret = 0; 18239 18240 int mem_base; 18241 xmlNodePtr ret_val; 18242 xmlNodePtr cur; /* the child node */ 18243 int n_cur; 18244 xmlNodePtr elem; /* the new node */ 18245 int n_elem; 18246 18247 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 18248 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { 18249 mem_base = xmlMemBlocks(); 18250 cur = gen_xmlNodePtr(n_cur, 0); 18251 elem = gen_xmlNodePtr_in(n_elem, 1); 18252 18253 ret_val = xmlAddNextSibling(cur, elem); 18254 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } 18255 desret_xmlNodePtr(ret_val); 18256 call_tests++; 18257 des_xmlNodePtr(n_cur, cur, 0); 18258 des_xmlNodePtr_in(n_elem, elem, 1); 18259 xmlResetLastError(); 18260 if (mem_base != xmlMemBlocks()) { 18261 printf("Leak of %d blocks found in xmlAddNextSibling", 18262 xmlMemBlocks() - mem_base); 18263 test_ret++; 18264 printf(" %d", n_cur); 18265 printf(" %d", n_elem); 18266 printf("\n"); 18267 } 18268 } 18269 } 18270 function_tests++; 18271 18272 return(test_ret); 18273 } 18274 18275 18276 static int 18277 test_xmlAddPrevSibling(void) { 18278 int test_ret = 0; 18279 18280 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) 18281 int mem_base; 18282 xmlNodePtr ret_val; 18283 xmlNodePtr cur; /* the child node */ 18284 int n_cur; 18285 xmlNodePtr elem; /* the new node */ 18286 int n_elem; 18287 18288 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 18289 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { 18290 mem_base = xmlMemBlocks(); 18291 cur = gen_xmlNodePtr(n_cur, 0); 18292 elem = gen_xmlNodePtr_in(n_elem, 1); 18293 18294 ret_val = xmlAddPrevSibling(cur, elem); 18295 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } 18296 desret_xmlNodePtr(ret_val); 18297 call_tests++; 18298 des_xmlNodePtr(n_cur, cur, 0); 18299 des_xmlNodePtr_in(n_elem, elem, 1); 18300 xmlResetLastError(); 18301 if (mem_base != xmlMemBlocks()) { 18302 printf("Leak of %d blocks found in xmlAddPrevSibling", 18303 xmlMemBlocks() - mem_base); 18304 test_ret++; 18305 printf(" %d", n_cur); 18306 printf(" %d", n_elem); 18307 printf("\n"); 18308 } 18309 } 18310 } 18311 function_tests++; 18312 #endif 18313 18314 return(test_ret); 18315 } 18316 18317 18318 static int 18319 test_xmlAddSibling(void) { 18320 int test_ret = 0; 18321 18322 int mem_base; 18323 xmlNodePtr ret_val; 18324 xmlNodePtr cur; /* the child node */ 18325 int n_cur; 18326 xmlNodePtr elem; /* the new node */ 18327 int n_elem; 18328 18329 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 18330 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { 18331 mem_base = xmlMemBlocks(); 18332 cur = gen_xmlNodePtr(n_cur, 0); 18333 elem = gen_xmlNodePtr_in(n_elem, 1); 18334 18335 ret_val = xmlAddSibling(cur, elem); 18336 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } 18337 desret_xmlNodePtr(ret_val); 18338 call_tests++; 18339 des_xmlNodePtr(n_cur, cur, 0); 18340 des_xmlNodePtr_in(n_elem, elem, 1); 18341 xmlResetLastError(); 18342 if (mem_base != xmlMemBlocks()) { 18343 printf("Leak of %d blocks found in xmlAddSibling", 18344 xmlMemBlocks() - mem_base); 18345 test_ret++; 18346 printf(" %d", n_cur); 18347 printf(" %d", n_elem); 18348 printf("\n"); 18349 } 18350 } 18351 } 18352 function_tests++; 18353 18354 return(test_ret); 18355 } 18356 18357 18358 static int 18359 test_xmlAttrSerializeTxtContent(void) { 18360 int test_ret = 0; 18361 18362 #if defined(LIBXML_OUTPUT_ENABLED) 18363 #ifdef LIBXML_OUTPUT_ENABLED 18364 int mem_base; 18365 xmlBufferPtr buf; /* the XML buffer output */ 18366 int n_buf; 18367 xmlDocPtr doc; /* the document */ 18368 int n_doc; 18369 xmlAttrPtr attr; /* the attribute node */ 18370 int n_attr; 18371 xmlChar * string; /* the text content */ 18372 int n_string; 18373 18374 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18375 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 18376 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 18377 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 18378 mem_base = xmlMemBlocks(); 18379 buf = gen_xmlBufferPtr(n_buf, 0); 18380 doc = gen_xmlDocPtr(n_doc, 1); 18381 attr = gen_xmlAttrPtr(n_attr, 2); 18382 string = gen_const_xmlChar_ptr(n_string, 3); 18383 18384 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string); 18385 call_tests++; 18386 des_xmlBufferPtr(n_buf, buf, 0); 18387 des_xmlDocPtr(n_doc, doc, 1); 18388 des_xmlAttrPtr(n_attr, attr, 2); 18389 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3); 18390 xmlResetLastError(); 18391 if (mem_base != xmlMemBlocks()) { 18392 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent", 18393 xmlMemBlocks() - mem_base); 18394 test_ret++; 18395 printf(" %d", n_buf); 18396 printf(" %d", n_doc); 18397 printf(" %d", n_attr); 18398 printf(" %d", n_string); 18399 printf("\n"); 18400 } 18401 } 18402 } 18403 } 18404 } 18405 function_tests++; 18406 #endif 18407 #endif 18408 18409 return(test_ret); 18410 } 18411 18412 18413 #define gen_nb_const_xmlBuf_ptr 1 18414 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18415 return(NULL); 18416 } 18417 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18418 } 18419 18420 static int 18421 test_xmlBufContent(void) { 18422 int test_ret = 0; 18423 18424 int mem_base; 18425 xmlChar * ret_val; 18426 xmlBuf * buf; /* the buffer */ 18427 int n_buf; 18428 18429 for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) { 18430 mem_base = xmlMemBlocks(); 18431 buf = gen_const_xmlBuf_ptr(n_buf, 0); 18432 18433 ret_val = xmlBufContent((const xmlBuf *)buf); 18434 desret_xmlChar_ptr(ret_val); 18435 call_tests++; 18436 des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0); 18437 xmlResetLastError(); 18438 if (mem_base != xmlMemBlocks()) { 18439 printf("Leak of %d blocks found in xmlBufContent", 18440 xmlMemBlocks() - mem_base); 18441 test_ret++; 18442 printf(" %d", n_buf); 18443 printf("\n"); 18444 } 18445 } 18446 function_tests++; 18447 18448 return(test_ret); 18449 } 18450 18451 18452 #define gen_nb_xmlBufPtr 1 18453 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18454 return(NULL); 18455 } 18456 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18457 } 18458 18459 static int 18460 test_xmlBufEnd(void) { 18461 int test_ret = 0; 18462 18463 int mem_base; 18464 xmlChar * ret_val; 18465 xmlBufPtr buf; /* the buffer */ 18466 int n_buf; 18467 18468 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) { 18469 mem_base = xmlMemBlocks(); 18470 buf = gen_xmlBufPtr(n_buf, 0); 18471 18472 ret_val = xmlBufEnd(buf); 18473 desret_xmlChar_ptr(ret_val); 18474 call_tests++; 18475 des_xmlBufPtr(n_buf, buf, 0); 18476 xmlResetLastError(); 18477 if (mem_base != xmlMemBlocks()) { 18478 printf("Leak of %d blocks found in xmlBufEnd", 18479 xmlMemBlocks() - mem_base); 18480 test_ret++; 18481 printf(" %d", n_buf); 18482 printf("\n"); 18483 } 18484 } 18485 function_tests++; 18486 18487 return(test_ret); 18488 } 18489 18490 18491 #define gen_nb_const_xmlNode_ptr 1 18492 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18493 return(NULL); 18494 } 18495 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18496 } 18497 18498 static int 18499 test_xmlBufGetNodeContent(void) { 18500 int test_ret = 0; 18501 18502 int mem_base; 18503 int ret_val; 18504 xmlBufPtr buf; /* a buffer xmlBufPtr */ 18505 int n_buf; 18506 xmlNode * cur; /* the node being read */ 18507 int n_cur; 18508 18509 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) { 18510 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) { 18511 mem_base = xmlMemBlocks(); 18512 buf = gen_xmlBufPtr(n_buf, 0); 18513 cur = gen_const_xmlNode_ptr(n_cur, 1); 18514 18515 ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur); 18516 desret_int(ret_val); 18517 call_tests++; 18518 des_xmlBufPtr(n_buf, buf, 0); 18519 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1); 18520 xmlResetLastError(); 18521 if (mem_base != xmlMemBlocks()) { 18522 printf("Leak of %d blocks found in xmlBufGetNodeContent", 18523 xmlMemBlocks() - mem_base); 18524 test_ret++; 18525 printf(" %d", n_buf); 18526 printf(" %d", n_cur); 18527 printf("\n"); 18528 } 18529 } 18530 } 18531 function_tests++; 18532 18533 return(test_ret); 18534 } 18535 18536 18537 static int 18538 test_xmlBufNodeDump(void) { 18539 int test_ret = 0; 18540 18541 18542 /* missing type support */ 18543 return(test_ret); 18544 } 18545 18546 18547 static int 18548 test_xmlBufShrink(void) { 18549 int test_ret = 0; 18550 18551 18552 /* missing type support */ 18553 return(test_ret); 18554 } 18555 18556 18557 #define gen_nb_const_xmlBufPtr 1 18558 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18559 return(NULL); 18560 } 18561 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18562 } 18563 18564 static int 18565 test_xmlBufUse(void) { 18566 int test_ret = 0; 18567 18568 18569 /* missing type support */ 18570 return(test_ret); 18571 } 18572 18573 18574 static int 18575 test_xmlBufferAdd(void) { 18576 int test_ret = 0; 18577 18578 int mem_base; 18579 int ret_val; 18580 xmlBufferPtr buf; /* the buffer to dump */ 18581 int n_buf; 18582 xmlChar * str; /* the #xmlChar string */ 18583 int n_str; 18584 int len; /* the number of #xmlChar to add */ 18585 int n_len; 18586 18587 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18588 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 18589 for (n_len = 0;n_len < gen_nb_int;n_len++) { 18590 mem_base = xmlMemBlocks(); 18591 buf = gen_xmlBufferPtr(n_buf, 0); 18592 str = gen_const_xmlChar_ptr(n_str, 1); 18593 len = gen_int(n_len, 2); 18594 18595 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len); 18596 desret_int(ret_val); 18597 call_tests++; 18598 des_xmlBufferPtr(n_buf, buf, 0); 18599 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 18600 des_int(n_len, len, 2); 18601 xmlResetLastError(); 18602 if (mem_base != xmlMemBlocks()) { 18603 printf("Leak of %d blocks found in xmlBufferAdd", 18604 xmlMemBlocks() - mem_base); 18605 test_ret++; 18606 printf(" %d", n_buf); 18607 printf(" %d", n_str); 18608 printf(" %d", n_len); 18609 printf("\n"); 18610 } 18611 } 18612 } 18613 } 18614 function_tests++; 18615 18616 return(test_ret); 18617 } 18618 18619 18620 static int 18621 test_xmlBufferAddHead(void) { 18622 int test_ret = 0; 18623 18624 int mem_base; 18625 int ret_val; 18626 xmlBufferPtr buf; /* the buffer */ 18627 int n_buf; 18628 xmlChar * str; /* the #xmlChar string */ 18629 int n_str; 18630 int len; /* the number of #xmlChar to add */ 18631 int n_len; 18632 18633 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18634 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 18635 for (n_len = 0;n_len < gen_nb_int;n_len++) { 18636 mem_base = xmlMemBlocks(); 18637 buf = gen_xmlBufferPtr(n_buf, 0); 18638 str = gen_const_xmlChar_ptr(n_str, 1); 18639 len = gen_int(n_len, 2); 18640 18641 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len); 18642 desret_int(ret_val); 18643 call_tests++; 18644 des_xmlBufferPtr(n_buf, buf, 0); 18645 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 18646 des_int(n_len, len, 2); 18647 xmlResetLastError(); 18648 if (mem_base != xmlMemBlocks()) { 18649 printf("Leak of %d blocks found in xmlBufferAddHead", 18650 xmlMemBlocks() - mem_base); 18651 test_ret++; 18652 printf(" %d", n_buf); 18653 printf(" %d", n_str); 18654 printf(" %d", n_len); 18655 printf("\n"); 18656 } 18657 } 18658 } 18659 } 18660 function_tests++; 18661 18662 return(test_ret); 18663 } 18664 18665 18666 static int 18667 test_xmlBufferCCat(void) { 18668 int test_ret = 0; 18669 18670 int mem_base; 18671 int ret_val; 18672 xmlBufferPtr buf; /* the buffer to dump */ 18673 int n_buf; 18674 char * str; /* the C char string */ 18675 int n_str; 18676 18677 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18678 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { 18679 mem_base = xmlMemBlocks(); 18680 buf = gen_xmlBufferPtr(n_buf, 0); 18681 str = gen_const_char_ptr(n_str, 1); 18682 18683 ret_val = xmlBufferCCat(buf, (const char *)str); 18684 desret_int(ret_val); 18685 call_tests++; 18686 des_xmlBufferPtr(n_buf, buf, 0); 18687 des_const_char_ptr(n_str, (const char *)str, 1); 18688 xmlResetLastError(); 18689 if (mem_base != xmlMemBlocks()) { 18690 printf("Leak of %d blocks found in xmlBufferCCat", 18691 xmlMemBlocks() - mem_base); 18692 test_ret++; 18693 printf(" %d", n_buf); 18694 printf(" %d", n_str); 18695 printf("\n"); 18696 } 18697 } 18698 } 18699 function_tests++; 18700 18701 return(test_ret); 18702 } 18703 18704 18705 static int 18706 test_xmlBufferCat(void) { 18707 int test_ret = 0; 18708 18709 int mem_base; 18710 int ret_val; 18711 xmlBufferPtr buf; /* the buffer to add to */ 18712 int n_buf; 18713 xmlChar * str; /* the #xmlChar string */ 18714 int n_str; 18715 18716 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18717 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 18718 mem_base = xmlMemBlocks(); 18719 buf = gen_xmlBufferPtr(n_buf, 0); 18720 str = gen_const_xmlChar_ptr(n_str, 1); 18721 18722 ret_val = xmlBufferCat(buf, (const xmlChar *)str); 18723 desret_int(ret_val); 18724 call_tests++; 18725 des_xmlBufferPtr(n_buf, buf, 0); 18726 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 18727 xmlResetLastError(); 18728 if (mem_base != xmlMemBlocks()) { 18729 printf("Leak of %d blocks found in xmlBufferCat", 18730 xmlMemBlocks() - mem_base); 18731 test_ret++; 18732 printf(" %d", n_buf); 18733 printf(" %d", n_str); 18734 printf("\n"); 18735 } 18736 } 18737 } 18738 function_tests++; 18739 18740 return(test_ret); 18741 } 18742 18743 18744 #define gen_nb_const_xmlBuffer_ptr 1 18745 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18746 return(NULL); 18747 } 18748 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18749 } 18750 18751 static int 18752 test_xmlBufferContent(void) { 18753 int test_ret = 0; 18754 18755 int mem_base; 18756 const xmlChar * ret_val; 18757 xmlBuffer * buf; /* the buffer */ 18758 int n_buf; 18759 18760 for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) { 18761 mem_base = xmlMemBlocks(); 18762 buf = gen_const_xmlBuffer_ptr(n_buf, 0); 18763 18764 ret_val = xmlBufferContent((const xmlBuffer *)buf); 18765 desret_const_xmlChar_ptr(ret_val); 18766 call_tests++; 18767 des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0); 18768 xmlResetLastError(); 18769 if (mem_base != xmlMemBlocks()) { 18770 printf("Leak of %d blocks found in xmlBufferContent", 18771 xmlMemBlocks() - mem_base); 18772 test_ret++; 18773 printf(" %d", n_buf); 18774 printf("\n"); 18775 } 18776 } 18777 function_tests++; 18778 18779 return(test_ret); 18780 } 18781 18782 18783 static int 18784 test_xmlBufferCreate(void) { 18785 int test_ret = 0; 18786 18787 int mem_base; 18788 xmlBufferPtr ret_val; 18789 18790 mem_base = xmlMemBlocks(); 18791 18792 ret_val = xmlBufferCreate(); 18793 desret_xmlBufferPtr(ret_val); 18794 call_tests++; 18795 xmlResetLastError(); 18796 if (mem_base != xmlMemBlocks()) { 18797 printf("Leak of %d blocks found in xmlBufferCreate", 18798 xmlMemBlocks() - mem_base); 18799 test_ret++; 18800 printf("\n"); 18801 } 18802 function_tests++; 18803 18804 return(test_ret); 18805 } 18806 18807 18808 static int 18809 test_xmlBufferCreateSize(void) { 18810 int test_ret = 0; 18811 18812 18813 /* missing type support */ 18814 return(test_ret); 18815 } 18816 18817 18818 static int 18819 test_xmlBufferCreateStatic(void) { 18820 int test_ret = 0; 18821 18822 18823 /* missing type support */ 18824 return(test_ret); 18825 } 18826 18827 18828 static int 18829 test_xmlBufferDetach(void) { 18830 int test_ret = 0; 18831 18832 int mem_base; 18833 xmlChar * ret_val; 18834 xmlBufferPtr buf; /* the buffer */ 18835 int n_buf; 18836 18837 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18838 mem_base = xmlMemBlocks(); 18839 buf = gen_xmlBufferPtr(n_buf, 0); 18840 18841 ret_val = xmlBufferDetach(buf); 18842 desret_xmlChar_ptr(ret_val); 18843 call_tests++; 18844 des_xmlBufferPtr(n_buf, buf, 0); 18845 xmlResetLastError(); 18846 if (mem_base != xmlMemBlocks()) { 18847 printf("Leak of %d blocks found in xmlBufferDetach", 18848 xmlMemBlocks() - mem_base); 18849 test_ret++; 18850 printf(" %d", n_buf); 18851 printf("\n"); 18852 } 18853 } 18854 function_tests++; 18855 18856 return(test_ret); 18857 } 18858 18859 18860 static int 18861 test_xmlBufferEmpty(void) { 18862 int test_ret = 0; 18863 18864 int mem_base; 18865 xmlBufferPtr buf; /* the buffer */ 18866 int n_buf; 18867 18868 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18869 mem_base = xmlMemBlocks(); 18870 buf = gen_xmlBufferPtr(n_buf, 0); 18871 18872 xmlBufferEmpty(buf); 18873 call_tests++; 18874 des_xmlBufferPtr(n_buf, buf, 0); 18875 xmlResetLastError(); 18876 if (mem_base != xmlMemBlocks()) { 18877 printf("Leak of %d blocks found in xmlBufferEmpty", 18878 xmlMemBlocks() - mem_base); 18879 test_ret++; 18880 printf(" %d", n_buf); 18881 printf("\n"); 18882 } 18883 } 18884 function_tests++; 18885 18886 return(test_ret); 18887 } 18888 18889 18890 static int 18891 test_xmlBufferGrow(void) { 18892 int test_ret = 0; 18893 18894 int mem_base; 18895 int ret_val; 18896 xmlBufferPtr buf; /* the buffer */ 18897 int n_buf; 18898 unsigned int len; /* the minimum free size to allocate */ 18899 int n_len; 18900 18901 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18902 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) { 18903 mem_base = xmlMemBlocks(); 18904 buf = gen_xmlBufferPtr(n_buf, 0); 18905 len = gen_unsigned_int(n_len, 1); 18906 18907 ret_val = xmlBufferGrow(buf, len); 18908 desret_int(ret_val); 18909 call_tests++; 18910 des_xmlBufferPtr(n_buf, buf, 0); 18911 des_unsigned_int(n_len, len, 1); 18912 xmlResetLastError(); 18913 if (mem_base != xmlMemBlocks()) { 18914 printf("Leak of %d blocks found in xmlBufferGrow", 18915 xmlMemBlocks() - mem_base); 18916 test_ret++; 18917 printf(" %d", n_buf); 18918 printf(" %d", n_len); 18919 printf("\n"); 18920 } 18921 } 18922 } 18923 function_tests++; 18924 18925 return(test_ret); 18926 } 18927 18928 18929 static int 18930 test_xmlBufferLength(void) { 18931 int test_ret = 0; 18932 18933 int mem_base; 18934 int ret_val; 18935 xmlBuffer * buf; /* the buffer */ 18936 int n_buf; 18937 18938 for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) { 18939 mem_base = xmlMemBlocks(); 18940 buf = gen_const_xmlBuffer_ptr(n_buf, 0); 18941 18942 ret_val = xmlBufferLength((const xmlBuffer *)buf); 18943 desret_int(ret_val); 18944 call_tests++; 18945 des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0); 18946 xmlResetLastError(); 18947 if (mem_base != xmlMemBlocks()) { 18948 printf("Leak of %d blocks found in xmlBufferLength", 18949 xmlMemBlocks() - mem_base); 18950 test_ret++; 18951 printf(" %d", n_buf); 18952 printf("\n"); 18953 } 18954 } 18955 function_tests++; 18956 18957 return(test_ret); 18958 } 18959 18960 18961 static int 18962 test_xmlBufferResize(void) { 18963 int test_ret = 0; 18964 18965 int mem_base; 18966 int ret_val; 18967 xmlBufferPtr buf; /* the buffer to resize */ 18968 int n_buf; 18969 unsigned int size; /* the desired size */ 18970 int n_size; 18971 18972 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18973 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) { 18974 mem_base = xmlMemBlocks(); 18975 buf = gen_xmlBufferPtr(n_buf, 0); 18976 size = gen_unsigned_int(n_size, 1); 18977 18978 ret_val = xmlBufferResize(buf, size); 18979 desret_int(ret_val); 18980 call_tests++; 18981 des_xmlBufferPtr(n_buf, buf, 0); 18982 des_unsigned_int(n_size, size, 1); 18983 xmlResetLastError(); 18984 if (mem_base != xmlMemBlocks()) { 18985 printf("Leak of %d blocks found in xmlBufferResize", 18986 xmlMemBlocks() - mem_base); 18987 test_ret++; 18988 printf(" %d", n_buf); 18989 printf(" %d", n_size); 18990 printf("\n"); 18991 } 18992 } 18993 } 18994 function_tests++; 18995 18996 return(test_ret); 18997 } 18998 18999 19000 static int 19001 test_xmlBufferSetAllocationScheme(void) { 19002 int test_ret = 0; 19003 19004 int mem_base; 19005 xmlBufferPtr buf; /* the buffer to tune */ 19006 int n_buf; 19007 xmlBufferAllocationScheme scheme; /* allocation scheme to use */ 19008 int n_scheme; 19009 19010 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 19011 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) { 19012 mem_base = xmlMemBlocks(); 19013 buf = gen_xmlBufferPtr(n_buf, 0); 19014 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1); 19015 19016 xmlBufferSetAllocationScheme(buf, scheme); 19017 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;} 19018 call_tests++; 19019 des_xmlBufferPtr(n_buf, buf, 0); 19020 des_xmlBufferAllocationScheme(n_scheme, scheme, 1); 19021 xmlResetLastError(); 19022 if (mem_base != xmlMemBlocks()) { 19023 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme", 19024 xmlMemBlocks() - mem_base); 19025 test_ret++; 19026 printf(" %d", n_buf); 19027 printf(" %d", n_scheme); 19028 printf("\n"); 19029 } 19030 } 19031 } 19032 function_tests++; 19033 19034 return(test_ret); 19035 } 19036 19037 19038 static int 19039 test_xmlBufferShrink(void) { 19040 int test_ret = 0; 19041 19042 int mem_base; 19043 int ret_val; 19044 xmlBufferPtr buf; /* the buffer to dump */ 19045 int n_buf; 19046 unsigned int len; /* the number of xmlChar to remove */ 19047 int n_len; 19048 19049 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 19050 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) { 19051 mem_base = xmlMemBlocks(); 19052 buf = gen_xmlBufferPtr(n_buf, 0); 19053 len = gen_unsigned_int(n_len, 1); 19054 19055 ret_val = xmlBufferShrink(buf, len); 19056 desret_int(ret_val); 19057 call_tests++; 19058 des_xmlBufferPtr(n_buf, buf, 0); 19059 des_unsigned_int(n_len, len, 1); 19060 xmlResetLastError(); 19061 if (mem_base != xmlMemBlocks()) { 19062 printf("Leak of %d blocks found in xmlBufferShrink", 19063 xmlMemBlocks() - mem_base); 19064 test_ret++; 19065 printf(" %d", n_buf); 19066 printf(" %d", n_len); 19067 printf("\n"); 19068 } 19069 } 19070 } 19071 function_tests++; 19072 19073 return(test_ret); 19074 } 19075 19076 19077 static int 19078 test_xmlBufferWriteCHAR(void) { 19079 int test_ret = 0; 19080 19081 int mem_base; 19082 xmlBufferPtr buf; /* the XML buffer */ 19083 int n_buf; 19084 xmlChar * string; /* the string to add */ 19085 int n_string; 19086 19087 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 19088 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 19089 mem_base = xmlMemBlocks(); 19090 buf = gen_xmlBufferPtr(n_buf, 0); 19091 string = gen_const_xmlChar_ptr(n_string, 1); 19092 19093 xmlBufferWriteCHAR(buf, (const xmlChar *)string); 19094 call_tests++; 19095 des_xmlBufferPtr(n_buf, buf, 0); 19096 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1); 19097 xmlResetLastError(); 19098 if (mem_base != xmlMemBlocks()) { 19099 printf("Leak of %d blocks found in xmlBufferWriteCHAR", 19100 xmlMemBlocks() - mem_base); 19101 test_ret++; 19102 printf(" %d", n_buf); 19103 printf(" %d", n_string); 19104 printf("\n"); 19105 } 19106 } 19107 } 19108 function_tests++; 19109 19110 return(test_ret); 19111 } 19112 19113 19114 static int 19115 test_xmlBufferWriteChar(void) { 19116 int test_ret = 0; 19117 19118 int mem_base; 19119 xmlBufferPtr buf; /* the XML buffer output */ 19120 int n_buf; 19121 char * string; /* the string to add */ 19122 int n_string; 19123 19124 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 19125 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) { 19126 mem_base = xmlMemBlocks(); 19127 buf = gen_xmlBufferPtr(n_buf, 0); 19128 string = gen_const_char_ptr(n_string, 1); 19129 19130 xmlBufferWriteChar(buf, (const char *)string); 19131 call_tests++; 19132 des_xmlBufferPtr(n_buf, buf, 0); 19133 des_const_char_ptr(n_string, (const char *)string, 1); 19134 xmlResetLastError(); 19135 if (mem_base != xmlMemBlocks()) { 19136 printf("Leak of %d blocks found in xmlBufferWriteChar", 19137 xmlMemBlocks() - mem_base); 19138 test_ret++; 19139 printf(" %d", n_buf); 19140 printf(" %d", n_string); 19141 printf("\n"); 19142 } 19143 } 19144 } 19145 function_tests++; 19146 19147 return(test_ret); 19148 } 19149 19150 19151 static int 19152 test_xmlBufferWriteQuotedString(void) { 19153 int test_ret = 0; 19154 19155 int mem_base; 19156 xmlBufferPtr buf; /* the XML buffer output */ 19157 int n_buf; 19158 xmlChar * string; /* the string to add */ 19159 int n_string; 19160 19161 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 19162 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 19163 mem_base = xmlMemBlocks(); 19164 buf = gen_xmlBufferPtr(n_buf, 0); 19165 string = gen_const_xmlChar_ptr(n_string, 1); 19166 19167 xmlBufferWriteQuotedString(buf, (const xmlChar *)string); 19168 call_tests++; 19169 des_xmlBufferPtr(n_buf, buf, 0); 19170 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1); 19171 xmlResetLastError(); 19172 if (mem_base != xmlMemBlocks()) { 19173 printf("Leak of %d blocks found in xmlBufferWriteQuotedString", 19174 xmlMemBlocks() - mem_base); 19175 test_ret++; 19176 printf(" %d", n_buf); 19177 printf(" %d", n_string); 19178 printf("\n"); 19179 } 19180 } 19181 } 19182 function_tests++; 19183 19184 return(test_ret); 19185 } 19186 19187 19188 static int 19189 test_xmlBuildQName(void) { 19190 int test_ret = 0; 19191 19192 int mem_base; 19193 xmlChar * ret_val; 19194 xmlChar * ncname; /* the Name */ 19195 int n_ncname; 19196 xmlChar * prefix; /* the prefix */ 19197 int n_prefix; 19198 xmlChar * memory; /* preallocated memory */ 19199 int n_memory; 19200 int len; /* preallocated memory length */ 19201 int n_len; 19202 19203 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) { 19204 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 19205 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) { 19206 for (n_len = 0;n_len < gen_nb_int;n_len++) { 19207 mem_base = xmlMemBlocks(); 19208 ncname = gen_const_xmlChar_ptr(n_ncname, 0); 19209 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 19210 memory = gen_xmlChar_ptr(n_memory, 2); 19211 len = gen_int(n_len, 3); 19212 19213 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len); 19214 if ((ret_val != NULL) && (ret_val != ncname) && 19215 (ret_val != prefix) && (ret_val != memory)) 19216 xmlFree(ret_val); 19217 ret_val = NULL; 19218 desret_xmlChar_ptr(ret_val); 19219 call_tests++; 19220 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0); 19221 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 19222 des_xmlChar_ptr(n_memory, memory, 2); 19223 des_int(n_len, len, 3); 19224 xmlResetLastError(); 19225 if (mem_base != xmlMemBlocks()) { 19226 printf("Leak of %d blocks found in xmlBuildQName", 19227 xmlMemBlocks() - mem_base); 19228 test_ret++; 19229 printf(" %d", n_ncname); 19230 printf(" %d", n_prefix); 19231 printf(" %d", n_memory); 19232 printf(" %d", n_len); 19233 printf("\n"); 19234 } 19235 } 19236 } 19237 } 19238 } 19239 function_tests++; 19240 19241 return(test_ret); 19242 } 19243 19244 19245 static int 19246 test_xmlChildElementCount(void) { 19247 int test_ret = 0; 19248 19249 #if defined(LIBXML_TREE_ENABLED) 19250 int mem_base; 19251 unsigned long ret_val; 19252 xmlNodePtr parent; /* the parent node */ 19253 int n_parent; 19254 19255 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 19256 mem_base = xmlMemBlocks(); 19257 parent = gen_xmlNodePtr(n_parent, 0); 19258 19259 ret_val = xmlChildElementCount(parent); 19260 desret_unsigned_long(ret_val); 19261 call_tests++; 19262 des_xmlNodePtr(n_parent, parent, 0); 19263 xmlResetLastError(); 19264 if (mem_base != xmlMemBlocks()) { 19265 printf("Leak of %d blocks found in xmlChildElementCount", 19266 xmlMemBlocks() - mem_base); 19267 test_ret++; 19268 printf(" %d", n_parent); 19269 printf("\n"); 19270 } 19271 } 19272 function_tests++; 19273 #endif 19274 19275 return(test_ret); 19276 } 19277 19278 19279 static int 19280 test_xmlCopyDoc(void) { 19281 int test_ret = 0; 19282 19283 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 19284 int mem_base; 19285 xmlDocPtr ret_val; 19286 xmlDocPtr doc; /* the document */ 19287 int n_doc; 19288 int recursive; /* if not zero do a recursive copy. */ 19289 int n_recursive; 19290 19291 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19292 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) { 19293 mem_base = xmlMemBlocks(); 19294 doc = gen_xmlDocPtr(n_doc, 0); 19295 recursive = gen_int(n_recursive, 1); 19296 19297 ret_val = xmlCopyDoc(doc, recursive); 19298 desret_xmlDocPtr(ret_val); 19299 call_tests++; 19300 des_xmlDocPtr(n_doc, doc, 0); 19301 des_int(n_recursive, recursive, 1); 19302 xmlResetLastError(); 19303 if (mem_base != xmlMemBlocks()) { 19304 printf("Leak of %d blocks found in xmlCopyDoc", 19305 xmlMemBlocks() - mem_base); 19306 test_ret++; 19307 printf(" %d", n_doc); 19308 printf(" %d", n_recursive); 19309 printf("\n"); 19310 } 19311 } 19312 } 19313 function_tests++; 19314 #endif 19315 19316 return(test_ret); 19317 } 19318 19319 19320 static int 19321 test_xmlCopyDtd(void) { 19322 int test_ret = 0; 19323 19324 #if defined(LIBXML_TREE_ENABLED) 19325 int mem_base; 19326 xmlDtdPtr ret_val; 19327 xmlDtdPtr dtd; /* the dtd */ 19328 int n_dtd; 19329 19330 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 19331 mem_base = xmlMemBlocks(); 19332 dtd = gen_xmlDtdPtr(n_dtd, 0); 19333 19334 ret_val = xmlCopyDtd(dtd); 19335 desret_xmlDtdPtr(ret_val); 19336 call_tests++; 19337 des_xmlDtdPtr(n_dtd, dtd, 0); 19338 xmlResetLastError(); 19339 if (mem_base != xmlMemBlocks()) { 19340 printf("Leak of %d blocks found in xmlCopyDtd", 19341 xmlMemBlocks() - mem_base); 19342 test_ret++; 19343 printf(" %d", n_dtd); 19344 printf("\n"); 19345 } 19346 } 19347 function_tests++; 19348 #endif 19349 19350 return(test_ret); 19351 } 19352 19353 19354 static int 19355 test_xmlCopyNamespace(void) { 19356 int test_ret = 0; 19357 19358 int mem_base; 19359 xmlNsPtr ret_val; 19360 xmlNsPtr cur; /* the namespace */ 19361 int n_cur; 19362 19363 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) { 19364 mem_base = xmlMemBlocks(); 19365 cur = gen_xmlNsPtr(n_cur, 0); 19366 19367 ret_val = xmlCopyNamespace(cur); 19368 if (ret_val != NULL) xmlFreeNs(ret_val); 19369 desret_xmlNsPtr(ret_val); 19370 call_tests++; 19371 des_xmlNsPtr(n_cur, cur, 0); 19372 xmlResetLastError(); 19373 if (mem_base != xmlMemBlocks()) { 19374 printf("Leak of %d blocks found in xmlCopyNamespace", 19375 xmlMemBlocks() - mem_base); 19376 test_ret++; 19377 printf(" %d", n_cur); 19378 printf("\n"); 19379 } 19380 } 19381 function_tests++; 19382 19383 return(test_ret); 19384 } 19385 19386 19387 static int 19388 test_xmlCopyNamespaceList(void) { 19389 int test_ret = 0; 19390 19391 int mem_base; 19392 xmlNsPtr ret_val; 19393 xmlNsPtr cur; /* the first namespace */ 19394 int n_cur; 19395 19396 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) { 19397 mem_base = xmlMemBlocks(); 19398 cur = gen_xmlNsPtr(n_cur, 0); 19399 19400 ret_val = xmlCopyNamespaceList(cur); 19401 if (ret_val != NULL) xmlFreeNsList(ret_val); 19402 desret_xmlNsPtr(ret_val); 19403 call_tests++; 19404 des_xmlNsPtr(n_cur, cur, 0); 19405 xmlResetLastError(); 19406 if (mem_base != xmlMemBlocks()) { 19407 printf("Leak of %d blocks found in xmlCopyNamespaceList", 19408 xmlMemBlocks() - mem_base); 19409 test_ret++; 19410 printf(" %d", n_cur); 19411 printf("\n"); 19412 } 19413 } 19414 function_tests++; 19415 19416 return(test_ret); 19417 } 19418 19419 19420 static int 19421 test_xmlCopyNode(void) { 19422 int test_ret = 0; 19423 19424 int mem_base; 19425 xmlNodePtr ret_val; 19426 xmlNodePtr node; /* the node */ 19427 int n_node; 19428 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */ 19429 int n_extended; 19430 19431 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19432 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) { 19433 mem_base = xmlMemBlocks(); 19434 node = gen_xmlNodePtr(n_node, 0); 19435 extended = gen_int(n_extended, 1); 19436 19437 ret_val = xmlCopyNode(node, extended); 19438 desret_xmlNodePtr(ret_val); 19439 call_tests++; 19440 des_xmlNodePtr(n_node, node, 0); 19441 des_int(n_extended, extended, 1); 19442 xmlResetLastError(); 19443 if (mem_base != xmlMemBlocks()) { 19444 printf("Leak of %d blocks found in xmlCopyNode", 19445 xmlMemBlocks() - mem_base); 19446 test_ret++; 19447 printf(" %d", n_node); 19448 printf(" %d", n_extended); 19449 printf("\n"); 19450 } 19451 } 19452 } 19453 function_tests++; 19454 19455 return(test_ret); 19456 } 19457 19458 19459 static int 19460 test_xmlCopyNodeList(void) { 19461 int test_ret = 0; 19462 19463 int mem_base; 19464 xmlNodePtr ret_val; 19465 xmlNodePtr node; /* the first node in the list. */ 19466 int n_node; 19467 19468 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19469 mem_base = xmlMemBlocks(); 19470 node = gen_xmlNodePtr(n_node, 0); 19471 19472 ret_val = xmlCopyNodeList(node); 19473 desret_xmlNodePtr(ret_val); 19474 call_tests++; 19475 des_xmlNodePtr(n_node, node, 0); 19476 xmlResetLastError(); 19477 if (mem_base != xmlMemBlocks()) { 19478 printf("Leak of %d blocks found in xmlCopyNodeList", 19479 xmlMemBlocks() - mem_base); 19480 test_ret++; 19481 printf(" %d", n_node); 19482 printf("\n"); 19483 } 19484 } 19485 function_tests++; 19486 19487 return(test_ret); 19488 } 19489 19490 19491 static int 19492 test_xmlCopyProp(void) { 19493 int test_ret = 0; 19494 19495 int mem_base; 19496 xmlAttrPtr ret_val; 19497 xmlNodePtr target; /* the element where the attribute will be grafted */ 19498 int n_target; 19499 xmlAttrPtr cur; /* the attribute */ 19500 int n_cur; 19501 19502 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) { 19503 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { 19504 mem_base = xmlMemBlocks(); 19505 target = gen_xmlNodePtr(n_target, 0); 19506 cur = gen_xmlAttrPtr(n_cur, 1); 19507 19508 ret_val = xmlCopyProp(target, cur); 19509 desret_xmlAttrPtr(ret_val); 19510 call_tests++; 19511 des_xmlNodePtr(n_target, target, 0); 19512 des_xmlAttrPtr(n_cur, cur, 1); 19513 xmlResetLastError(); 19514 if (mem_base != xmlMemBlocks()) { 19515 printf("Leak of %d blocks found in xmlCopyProp", 19516 xmlMemBlocks() - mem_base); 19517 test_ret++; 19518 printf(" %d", n_target); 19519 printf(" %d", n_cur); 19520 printf("\n"); 19521 } 19522 } 19523 } 19524 function_tests++; 19525 19526 return(test_ret); 19527 } 19528 19529 19530 static int 19531 test_xmlCopyPropList(void) { 19532 int test_ret = 0; 19533 19534 int mem_base; 19535 xmlAttrPtr ret_val; 19536 xmlNodePtr target; /* the element where the attributes will be grafted */ 19537 int n_target; 19538 xmlAttrPtr cur; /* the first attribute */ 19539 int n_cur; 19540 19541 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) { 19542 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { 19543 mem_base = xmlMemBlocks(); 19544 target = gen_xmlNodePtr(n_target, 0); 19545 cur = gen_xmlAttrPtr(n_cur, 1); 19546 19547 ret_val = xmlCopyPropList(target, cur); 19548 desret_xmlAttrPtr(ret_val); 19549 call_tests++; 19550 des_xmlNodePtr(n_target, target, 0); 19551 des_xmlAttrPtr(n_cur, cur, 1); 19552 xmlResetLastError(); 19553 if (mem_base != xmlMemBlocks()) { 19554 printf("Leak of %d blocks found in xmlCopyPropList", 19555 xmlMemBlocks() - mem_base); 19556 test_ret++; 19557 printf(" %d", n_target); 19558 printf(" %d", n_cur); 19559 printf("\n"); 19560 } 19561 } 19562 } 19563 function_tests++; 19564 19565 return(test_ret); 19566 } 19567 19568 19569 static int 19570 test_xmlCreateIntSubset(void) { 19571 int test_ret = 0; 19572 19573 int mem_base; 19574 xmlDtdPtr ret_val; 19575 xmlDocPtr doc; /* the document pointer */ 19576 int n_doc; 19577 xmlChar * name; /* the DTD name */ 19578 int n_name; 19579 xmlChar * ExternalID; /* the external (PUBLIC) ID */ 19580 int n_ExternalID; 19581 xmlChar * SystemID; /* the system ID */ 19582 int n_SystemID; 19583 19584 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19585 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 19586 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 19587 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 19588 mem_base = xmlMemBlocks(); 19589 doc = gen_xmlDocPtr(n_doc, 0); 19590 name = gen_const_xmlChar_ptr(n_name, 1); 19591 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 19592 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 19593 19594 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 19595 desret_xmlDtdPtr(ret_val); 19596 call_tests++; 19597 des_xmlDocPtr(n_doc, doc, 0); 19598 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 19599 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 19600 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 19601 xmlResetLastError(); 19602 if (mem_base != xmlMemBlocks()) { 19603 printf("Leak of %d blocks found in xmlCreateIntSubset", 19604 xmlMemBlocks() - mem_base); 19605 test_ret++; 19606 printf(" %d", n_doc); 19607 printf(" %d", n_name); 19608 printf(" %d", n_ExternalID); 19609 printf(" %d", n_SystemID); 19610 printf("\n"); 19611 } 19612 } 19613 } 19614 } 19615 } 19616 function_tests++; 19617 19618 return(test_ret); 19619 } 19620 19621 19622 #define gen_nb_xmlDOMWrapCtxtPtr 1 19623 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 19624 return(NULL); 19625 } 19626 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 19627 } 19628 19629 static int 19630 test_xmlDOMWrapAdoptNode(void) { 19631 int test_ret = 0; 19632 19633 int mem_base; 19634 int ret_val; 19635 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */ 19636 int n_ctxt; 19637 xmlDocPtr sourceDoc; /* the optional sourceDoc */ 19638 int n_sourceDoc; 19639 xmlNodePtr node; /* the node to start with */ 19640 int n_node; 19641 xmlDocPtr destDoc; /* the destination doc */ 19642 int n_destDoc; 19643 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */ 19644 int n_destParent; 19645 int options; /* option flags */ 19646 int n_options; 19647 19648 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19649 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) { 19650 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19651 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) { 19652 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) { 19653 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19654 mem_base = xmlMemBlocks(); 19655 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19656 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1); 19657 node = gen_xmlNodePtr(n_node, 2); 19658 destDoc = gen_xmlDocPtr(n_destDoc, 3); 19659 destParent = gen_xmlNodePtr(n_destParent, 4); 19660 options = gen_int(n_options, 5); 19661 19662 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options); 19663 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;} 19664 desret_int(ret_val); 19665 call_tests++; 19666 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19667 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1); 19668 des_xmlNodePtr(n_node, node, 2); 19669 des_xmlDocPtr(n_destDoc, destDoc, 3); 19670 des_xmlNodePtr(n_destParent, destParent, 4); 19671 des_int(n_options, options, 5); 19672 xmlResetLastError(); 19673 if (mem_base != xmlMemBlocks()) { 19674 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode", 19675 xmlMemBlocks() - mem_base); 19676 test_ret++; 19677 printf(" %d", n_ctxt); 19678 printf(" %d", n_sourceDoc); 19679 printf(" %d", n_node); 19680 printf(" %d", n_destDoc); 19681 printf(" %d", n_destParent); 19682 printf(" %d", n_options); 19683 printf("\n"); 19684 } 19685 } 19686 } 19687 } 19688 } 19689 } 19690 } 19691 function_tests++; 19692 19693 return(test_ret); 19694 } 19695 19696 19697 static int 19698 test_xmlDOMWrapCloneNode(void) { 19699 int test_ret = 0; 19700 19701 int mem_base; 19702 int ret_val; 19703 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */ 19704 int n_ctxt; 19705 xmlDocPtr sourceDoc; /* the optional sourceDoc */ 19706 int n_sourceDoc; 19707 xmlNodePtr node; /* the node to start with */ 19708 int n_node; 19709 xmlNodePtr * resNode; /* the clone of the given @node */ 19710 int n_resNode; 19711 xmlDocPtr destDoc; /* the destination doc */ 19712 int n_destDoc; 19713 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */ 19714 int n_destParent; 19715 int deep; /* descend into child if set */ 19716 int n_deep; 19717 int options; /* option flags */ 19718 int n_options; 19719 19720 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19721 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) { 19722 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19723 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) { 19724 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) { 19725 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) { 19726 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) { 19727 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19728 mem_base = xmlMemBlocks(); 19729 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19730 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1); 19731 node = gen_xmlNodePtr(n_node, 2); 19732 resNode = gen_xmlNodePtr_ptr(n_resNode, 3); 19733 destDoc = gen_xmlDocPtr(n_destDoc, 4); 19734 destParent = gen_xmlNodePtr(n_destParent, 5); 19735 deep = gen_int(n_deep, 6); 19736 options = gen_int(n_options, 7); 19737 19738 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options); 19739 desret_int(ret_val); 19740 call_tests++; 19741 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19742 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1); 19743 des_xmlNodePtr(n_node, node, 2); 19744 des_xmlNodePtr_ptr(n_resNode, resNode, 3); 19745 des_xmlDocPtr(n_destDoc, destDoc, 4); 19746 des_xmlNodePtr(n_destParent, destParent, 5); 19747 des_int(n_deep, deep, 6); 19748 des_int(n_options, options, 7); 19749 xmlResetLastError(); 19750 if (mem_base != xmlMemBlocks()) { 19751 printf("Leak of %d blocks found in xmlDOMWrapCloneNode", 19752 xmlMemBlocks() - mem_base); 19753 test_ret++; 19754 printf(" %d", n_ctxt); 19755 printf(" %d", n_sourceDoc); 19756 printf(" %d", n_node); 19757 printf(" %d", n_resNode); 19758 printf(" %d", n_destDoc); 19759 printf(" %d", n_destParent); 19760 printf(" %d", n_deep); 19761 printf(" %d", n_options); 19762 printf("\n"); 19763 } 19764 } 19765 } 19766 } 19767 } 19768 } 19769 } 19770 } 19771 } 19772 function_tests++; 19773 19774 return(test_ret); 19775 } 19776 19777 19778 static int 19779 test_xmlDOMWrapNewCtxt(void) { 19780 int test_ret = 0; 19781 19782 19783 /* missing type support */ 19784 return(test_ret); 19785 } 19786 19787 19788 static int 19789 test_xmlDOMWrapReconcileNamespaces(void) { 19790 int test_ret = 0; 19791 19792 int mem_base; 19793 int ret_val; 19794 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */ 19795 int n_ctxt; 19796 xmlNodePtr elem; /* the element-node */ 19797 int n_elem; 19798 int options; /* option flags */ 19799 int n_options; 19800 19801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19802 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 19803 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19804 mem_base = xmlMemBlocks(); 19805 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19806 elem = gen_xmlNodePtr(n_elem, 1); 19807 options = gen_int(n_options, 2); 19808 19809 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options); 19810 desret_int(ret_val); 19811 call_tests++; 19812 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19813 des_xmlNodePtr(n_elem, elem, 1); 19814 des_int(n_options, options, 2); 19815 xmlResetLastError(); 19816 if (mem_base != xmlMemBlocks()) { 19817 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces", 19818 xmlMemBlocks() - mem_base); 19819 test_ret++; 19820 printf(" %d", n_ctxt); 19821 printf(" %d", n_elem); 19822 printf(" %d", n_options); 19823 printf("\n"); 19824 } 19825 } 19826 } 19827 } 19828 function_tests++; 19829 19830 return(test_ret); 19831 } 19832 19833 19834 static int 19835 test_xmlDOMWrapRemoveNode(void) { 19836 int test_ret = 0; 19837 19838 int mem_base; 19839 int ret_val; 19840 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */ 19841 int n_ctxt; 19842 xmlDocPtr doc; /* the doc */ 19843 int n_doc; 19844 xmlNodePtr node; /* the node to be removed. */ 19845 int n_node; 19846 int options; /* set of options, unused at the moment */ 19847 int n_options; 19848 19849 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19850 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19851 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19852 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19853 mem_base = xmlMemBlocks(); 19854 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19855 doc = gen_xmlDocPtr(n_doc, 1); 19856 node = gen_xmlNodePtr(n_node, 2); 19857 options = gen_int(n_options, 3); 19858 19859 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options); 19860 desret_int(ret_val); 19861 call_tests++; 19862 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19863 des_xmlDocPtr(n_doc, doc, 1); 19864 des_xmlNodePtr(n_node, node, 2); 19865 des_int(n_options, options, 3); 19866 xmlResetLastError(); 19867 if (mem_base != xmlMemBlocks()) { 19868 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode", 19869 xmlMemBlocks() - mem_base); 19870 test_ret++; 19871 printf(" %d", n_ctxt); 19872 printf(" %d", n_doc); 19873 printf(" %d", n_node); 19874 printf(" %d", n_options); 19875 printf("\n"); 19876 } 19877 } 19878 } 19879 } 19880 } 19881 function_tests++; 19882 19883 return(test_ret); 19884 } 19885 19886 19887 static int 19888 test_xmlDocCopyNode(void) { 19889 int test_ret = 0; 19890 19891 int mem_base; 19892 xmlNodePtr ret_val; 19893 xmlNodePtr node; /* the node */ 19894 int n_node; 19895 xmlDocPtr doc; /* the document */ 19896 int n_doc; 19897 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */ 19898 int n_extended; 19899 19900 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19901 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19902 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) { 19903 mem_base = xmlMemBlocks(); 19904 node = gen_xmlNodePtr(n_node, 0); 19905 doc = gen_xmlDocPtr(n_doc, 1); 19906 extended = gen_int(n_extended, 2); 19907 19908 ret_val = xmlDocCopyNode(node, doc, extended); 19909 desret_xmlNodePtr(ret_val); 19910 call_tests++; 19911 des_xmlNodePtr(n_node, node, 0); 19912 des_xmlDocPtr(n_doc, doc, 1); 19913 des_int(n_extended, extended, 2); 19914 xmlResetLastError(); 19915 if (mem_base != xmlMemBlocks()) { 19916 printf("Leak of %d blocks found in xmlDocCopyNode", 19917 xmlMemBlocks() - mem_base); 19918 test_ret++; 19919 printf(" %d", n_node); 19920 printf(" %d", n_doc); 19921 printf(" %d", n_extended); 19922 printf("\n"); 19923 } 19924 } 19925 } 19926 } 19927 function_tests++; 19928 19929 return(test_ret); 19930 } 19931 19932 19933 static int 19934 test_xmlDocCopyNodeList(void) { 19935 int test_ret = 0; 19936 19937 int mem_base; 19938 xmlNodePtr ret_val; 19939 xmlDocPtr doc; /* the target document */ 19940 int n_doc; 19941 xmlNodePtr node; /* the first node in the list. */ 19942 int n_node; 19943 19944 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19945 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19946 mem_base = xmlMemBlocks(); 19947 doc = gen_xmlDocPtr(n_doc, 0); 19948 node = gen_xmlNodePtr(n_node, 1); 19949 19950 ret_val = xmlDocCopyNodeList(doc, node); 19951 desret_xmlNodePtr(ret_val); 19952 call_tests++; 19953 des_xmlDocPtr(n_doc, doc, 0); 19954 des_xmlNodePtr(n_node, node, 1); 19955 xmlResetLastError(); 19956 if (mem_base != xmlMemBlocks()) { 19957 printf("Leak of %d blocks found in xmlDocCopyNodeList", 19958 xmlMemBlocks() - mem_base); 19959 test_ret++; 19960 printf(" %d", n_doc); 19961 printf(" %d", n_node); 19962 printf("\n"); 19963 } 19964 } 19965 } 19966 function_tests++; 19967 19968 return(test_ret); 19969 } 19970 19971 19972 static int 19973 test_xmlDocDump(void) { 19974 int test_ret = 0; 19975 19976 #if defined(LIBXML_OUTPUT_ENABLED) 19977 int mem_base; 19978 int ret_val; 19979 FILE * f; /* the FILE* */ 19980 int n_f; 19981 xmlDocPtr cur; /* the document */ 19982 int n_cur; 19983 19984 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 19985 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 19986 mem_base = xmlMemBlocks(); 19987 f = gen_FILE_ptr(n_f, 0); 19988 cur = gen_xmlDocPtr(n_cur, 1); 19989 19990 ret_val = xmlDocDump(f, cur); 19991 desret_int(ret_val); 19992 call_tests++; 19993 des_FILE_ptr(n_f, f, 0); 19994 des_xmlDocPtr(n_cur, cur, 1); 19995 xmlResetLastError(); 19996 if (mem_base != xmlMemBlocks()) { 19997 printf("Leak of %d blocks found in xmlDocDump", 19998 xmlMemBlocks() - mem_base); 19999 test_ret++; 20000 printf(" %d", n_f); 20001 printf(" %d", n_cur); 20002 printf("\n"); 20003 } 20004 } 20005 } 20006 function_tests++; 20007 #endif 20008 20009 return(test_ret); 20010 } 20011 20012 20013 static int 20014 test_xmlDocDumpFormatMemory(void) { 20015 int test_ret = 0; 20016 20017 #if defined(LIBXML_OUTPUT_ENABLED) 20018 int mem_base; 20019 xmlDocPtr cur; /* the document */ 20020 int n_cur; 20021 xmlChar ** mem; /* OUT: the memory pointer */ 20022 int n_mem; 20023 int * size; /* OUT: the memory length */ 20024 int n_size; 20025 int format; /* should formatting spaces been added */ 20026 int n_format; 20027 20028 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 20029 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 20030 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 20031 for (n_format = 0;n_format < gen_nb_int;n_format++) { 20032 mem_base = xmlMemBlocks(); 20033 cur = gen_xmlDocPtr(n_cur, 0); 20034 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 20035 size = gen_int_ptr(n_size, 2); 20036 format = gen_int(n_format, 3); 20037 20038 xmlDocDumpFormatMemory(cur, mem, size, format); 20039 call_tests++; 20040 des_xmlDocPtr(n_cur, cur, 0); 20041 des_xmlChar_ptr_ptr(n_mem, mem, 1); 20042 des_int_ptr(n_size, size, 2); 20043 des_int(n_format, format, 3); 20044 xmlResetLastError(); 20045 if (mem_base != xmlMemBlocks()) { 20046 printf("Leak of %d blocks found in xmlDocDumpFormatMemory", 20047 xmlMemBlocks() - mem_base); 20048 test_ret++; 20049 printf(" %d", n_cur); 20050 printf(" %d", n_mem); 20051 printf(" %d", n_size); 20052 printf(" %d", n_format); 20053 printf("\n"); 20054 } 20055 } 20056 } 20057 } 20058 } 20059 function_tests++; 20060 #endif 20061 20062 return(test_ret); 20063 } 20064 20065 20066 static int 20067 test_xmlDocDumpFormatMemoryEnc(void) { 20068 int test_ret = 0; 20069 20070 #if defined(LIBXML_OUTPUT_ENABLED) 20071 int mem_base; 20072 xmlDocPtr out_doc; /* Document to generate XML text from */ 20073 int n_out_doc; 20074 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */ 20075 int n_doc_txt_ptr; 20076 int * doc_txt_len; /* Length of the generated XML text */ 20077 int n_doc_txt_len; 20078 char * txt_encoding; /* Character encoding to use when generating XML text */ 20079 int n_txt_encoding; 20080 int format; /* should formatting spaces been added */ 20081 int n_format; 20082 20083 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) { 20084 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { 20085 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) { 20086 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) { 20087 for (n_format = 0;n_format < gen_nb_int;n_format++) { 20088 mem_base = xmlMemBlocks(); 20089 out_doc = gen_xmlDocPtr(n_out_doc, 0); 20090 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1); 20091 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2); 20092 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3); 20093 format = gen_int(n_format, 4); 20094 20095 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format); 20096 call_tests++; 20097 des_xmlDocPtr(n_out_doc, out_doc, 0); 20098 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1); 20099 des_int_ptr(n_doc_txt_len, doc_txt_len, 2); 20100 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3); 20101 des_int(n_format, format, 4); 20102 xmlResetLastError(); 20103 if (mem_base != xmlMemBlocks()) { 20104 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc", 20105 xmlMemBlocks() - mem_base); 20106 test_ret++; 20107 printf(" %d", n_out_doc); 20108 printf(" %d", n_doc_txt_ptr); 20109 printf(" %d", n_doc_txt_len); 20110 printf(" %d", n_txt_encoding); 20111 printf(" %d", n_format); 20112 printf("\n"); 20113 } 20114 } 20115 } 20116 } 20117 } 20118 } 20119 function_tests++; 20120 #endif 20121 20122 return(test_ret); 20123 } 20124 20125 20126 static int 20127 test_xmlDocDumpMemory(void) { 20128 int test_ret = 0; 20129 20130 #if defined(LIBXML_OUTPUT_ENABLED) 20131 int mem_base; 20132 xmlDocPtr cur; /* the document */ 20133 int n_cur; 20134 xmlChar ** mem; /* OUT: the memory pointer */ 20135 int n_mem; 20136 int * size; /* OUT: the memory length */ 20137 int n_size; 20138 20139 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 20140 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 20141 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 20142 mem_base = xmlMemBlocks(); 20143 cur = gen_xmlDocPtr(n_cur, 0); 20144 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 20145 size = gen_int_ptr(n_size, 2); 20146 20147 xmlDocDumpMemory(cur, mem, size); 20148 call_tests++; 20149 des_xmlDocPtr(n_cur, cur, 0); 20150 des_xmlChar_ptr_ptr(n_mem, mem, 1); 20151 des_int_ptr(n_size, size, 2); 20152 xmlResetLastError(); 20153 if (mem_base != xmlMemBlocks()) { 20154 printf("Leak of %d blocks found in xmlDocDumpMemory", 20155 xmlMemBlocks() - mem_base); 20156 test_ret++; 20157 printf(" %d", n_cur); 20158 printf(" %d", n_mem); 20159 printf(" %d", n_size); 20160 printf("\n"); 20161 } 20162 } 20163 } 20164 } 20165 function_tests++; 20166 #endif 20167 20168 return(test_ret); 20169 } 20170 20171 20172 static int 20173 test_xmlDocDumpMemoryEnc(void) { 20174 int test_ret = 0; 20175 20176 #if defined(LIBXML_OUTPUT_ENABLED) 20177 int mem_base; 20178 xmlDocPtr out_doc; /* Document to generate XML text from */ 20179 int n_out_doc; 20180 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */ 20181 int n_doc_txt_ptr; 20182 int * doc_txt_len; /* Length of the generated XML text */ 20183 int n_doc_txt_len; 20184 char * txt_encoding; /* Character encoding to use when generating XML text */ 20185 int n_txt_encoding; 20186 20187 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) { 20188 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { 20189 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) { 20190 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) { 20191 mem_base = xmlMemBlocks(); 20192 out_doc = gen_xmlDocPtr(n_out_doc, 0); 20193 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1); 20194 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2); 20195 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3); 20196 20197 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding); 20198 call_tests++; 20199 des_xmlDocPtr(n_out_doc, out_doc, 0); 20200 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1); 20201 des_int_ptr(n_doc_txt_len, doc_txt_len, 2); 20202 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3); 20203 xmlResetLastError(); 20204 if (mem_base != xmlMemBlocks()) { 20205 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc", 20206 xmlMemBlocks() - mem_base); 20207 test_ret++; 20208 printf(" %d", n_out_doc); 20209 printf(" %d", n_doc_txt_ptr); 20210 printf(" %d", n_doc_txt_len); 20211 printf(" %d", n_txt_encoding); 20212 printf("\n"); 20213 } 20214 } 20215 } 20216 } 20217 } 20218 function_tests++; 20219 #endif 20220 20221 return(test_ret); 20222 } 20223 20224 20225 static int 20226 test_xmlDocFormatDump(void) { 20227 int test_ret = 0; 20228 20229 #if defined(LIBXML_OUTPUT_ENABLED) 20230 int mem_base; 20231 int ret_val; 20232 FILE * f; /* the FILE* */ 20233 int n_f; 20234 xmlDocPtr cur; /* the document */ 20235 int n_cur; 20236 int format; /* should formatting spaces been added */ 20237 int n_format; 20238 20239 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 20240 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 20241 for (n_format = 0;n_format < gen_nb_int;n_format++) { 20242 mem_base = xmlMemBlocks(); 20243 f = gen_FILE_ptr(n_f, 0); 20244 cur = gen_xmlDocPtr(n_cur, 1); 20245 format = gen_int(n_format, 2); 20246 20247 ret_val = xmlDocFormatDump(f, cur, format); 20248 desret_int(ret_val); 20249 call_tests++; 20250 des_FILE_ptr(n_f, f, 0); 20251 des_xmlDocPtr(n_cur, cur, 1); 20252 des_int(n_format, format, 2); 20253 xmlResetLastError(); 20254 if (mem_base != xmlMemBlocks()) { 20255 printf("Leak of %d blocks found in xmlDocFormatDump", 20256 xmlMemBlocks() - mem_base); 20257 test_ret++; 20258 printf(" %d", n_f); 20259 printf(" %d", n_cur); 20260 printf(" %d", n_format); 20261 printf("\n"); 20262 } 20263 } 20264 } 20265 } 20266 function_tests++; 20267 #endif 20268 20269 return(test_ret); 20270 } 20271 20272 20273 static int 20274 test_xmlDocGetRootElement(void) { 20275 int test_ret = 0; 20276 20277 int mem_base; 20278 xmlNodePtr ret_val; 20279 xmlDoc * doc; /* the document */ 20280 int n_doc; 20281 20282 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 20283 mem_base = xmlMemBlocks(); 20284 doc = gen_const_xmlDoc_ptr(n_doc, 0); 20285 20286 ret_val = xmlDocGetRootElement((const xmlDoc *)doc); 20287 desret_xmlNodePtr(ret_val); 20288 call_tests++; 20289 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 20290 xmlResetLastError(); 20291 if (mem_base != xmlMemBlocks()) { 20292 printf("Leak of %d blocks found in xmlDocGetRootElement", 20293 xmlMemBlocks() - mem_base); 20294 test_ret++; 20295 printf(" %d", n_doc); 20296 printf("\n"); 20297 } 20298 } 20299 function_tests++; 20300 20301 return(test_ret); 20302 } 20303 20304 20305 static int 20306 test_xmlDocSetRootElement(void) { 20307 int test_ret = 0; 20308 20309 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) 20310 int mem_base; 20311 xmlNodePtr ret_val; 20312 xmlDocPtr doc; /* the document */ 20313 int n_doc; 20314 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. */ 20315 int n_root; 20316 20317 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20318 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) { 20319 mem_base = xmlMemBlocks(); 20320 doc = gen_xmlDocPtr(n_doc, 0); 20321 root = gen_xmlNodePtr_in(n_root, 1); 20322 20323 ret_val = xmlDocSetRootElement(doc, root); 20324 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; } 20325 desret_xmlNodePtr(ret_val); 20326 call_tests++; 20327 des_xmlDocPtr(n_doc, doc, 0); 20328 des_xmlNodePtr_in(n_root, root, 1); 20329 xmlResetLastError(); 20330 if (mem_base != xmlMemBlocks()) { 20331 printf("Leak of %d blocks found in xmlDocSetRootElement", 20332 xmlMemBlocks() - mem_base); 20333 test_ret++; 20334 printf(" %d", n_doc); 20335 printf(" %d", n_root); 20336 printf("\n"); 20337 } 20338 } 20339 } 20340 function_tests++; 20341 #endif 20342 20343 return(test_ret); 20344 } 20345 20346 20347 static int 20348 test_xmlElemDump(void) { 20349 int test_ret = 0; 20350 20351 #if defined(LIBXML_OUTPUT_ENABLED) 20352 int mem_base; 20353 FILE * f; /* the FILE * for the output */ 20354 int n_f; 20355 xmlDocPtr doc; /* the document */ 20356 int n_doc; 20357 xmlNodePtr cur; /* the current node */ 20358 int n_cur; 20359 20360 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 20361 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20362 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 20363 mem_base = xmlMemBlocks(); 20364 f = gen_FILE_ptr(n_f, 0); 20365 doc = gen_xmlDocPtr(n_doc, 1); 20366 cur = gen_xmlNodePtr(n_cur, 2); 20367 20368 xmlElemDump(f, doc, cur); 20369 call_tests++; 20370 des_FILE_ptr(n_f, f, 0); 20371 des_xmlDocPtr(n_doc, doc, 1); 20372 des_xmlNodePtr(n_cur, cur, 2); 20373 xmlResetLastError(); 20374 if (mem_base != xmlMemBlocks()) { 20375 printf("Leak of %d blocks found in xmlElemDump", 20376 xmlMemBlocks() - mem_base); 20377 test_ret++; 20378 printf(" %d", n_f); 20379 printf(" %d", n_doc); 20380 printf(" %d", n_cur); 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_xmlFirstElementChild(void) { 20395 int test_ret = 0; 20396 20397 #if defined(LIBXML_TREE_ENABLED) 20398 int mem_base; 20399 xmlNodePtr ret_val; 20400 xmlNodePtr parent; /* the parent node */ 20401 int n_parent; 20402 20403 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 20404 mem_base = xmlMemBlocks(); 20405 parent = gen_xmlNodePtr(n_parent, 0); 20406 20407 ret_val = xmlFirstElementChild(parent); 20408 desret_xmlNodePtr(ret_val); 20409 call_tests++; 20410 des_xmlNodePtr(n_parent, parent, 0); 20411 xmlResetLastError(); 20412 if (mem_base != xmlMemBlocks()) { 20413 printf("Leak of %d blocks found in xmlFirstElementChild", 20414 xmlMemBlocks() - mem_base); 20415 test_ret++; 20416 printf(" %d", n_parent); 20417 printf("\n"); 20418 } 20419 } 20420 function_tests++; 20421 #endif 20422 20423 return(test_ret); 20424 } 20425 20426 20427 static int 20428 test_xmlGetBufferAllocationScheme(void) { 20429 int test_ret = 0; 20430 20431 int mem_base; 20432 xmlBufferAllocationScheme ret_val; 20433 20434 mem_base = xmlMemBlocks(); 20435 20436 ret_val = xmlGetBufferAllocationScheme(); 20437 desret_xmlBufferAllocationScheme(ret_val); 20438 call_tests++; 20439 xmlResetLastError(); 20440 if (mem_base != xmlMemBlocks()) { 20441 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme", 20442 xmlMemBlocks() - mem_base); 20443 test_ret++; 20444 printf("\n"); 20445 } 20446 function_tests++; 20447 20448 return(test_ret); 20449 } 20450 20451 20452 static int 20453 test_xmlGetCompressMode(void) { 20454 int test_ret = 0; 20455 20456 int mem_base; 20457 int ret_val; 20458 20459 mem_base = xmlMemBlocks(); 20460 20461 ret_val = xmlGetCompressMode(); 20462 desret_int(ret_val); 20463 call_tests++; 20464 xmlResetLastError(); 20465 if (mem_base != xmlMemBlocks()) { 20466 printf("Leak of %d blocks found in xmlGetCompressMode", 20467 xmlMemBlocks() - mem_base); 20468 test_ret++; 20469 printf("\n"); 20470 } 20471 function_tests++; 20472 20473 return(test_ret); 20474 } 20475 20476 20477 static int 20478 test_xmlGetDocCompressMode(void) { 20479 int test_ret = 0; 20480 20481 int mem_base; 20482 int ret_val; 20483 xmlDoc * doc; /* the document */ 20484 int n_doc; 20485 20486 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 20487 mem_base = xmlMemBlocks(); 20488 doc = gen_const_xmlDoc_ptr(n_doc, 0); 20489 20490 ret_val = xmlGetDocCompressMode((const xmlDoc *)doc); 20491 desret_int(ret_val); 20492 call_tests++; 20493 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 20494 xmlResetLastError(); 20495 if (mem_base != xmlMemBlocks()) { 20496 printf("Leak of %d blocks found in xmlGetDocCompressMode", 20497 xmlMemBlocks() - mem_base); 20498 test_ret++; 20499 printf(" %d", n_doc); 20500 printf("\n"); 20501 } 20502 } 20503 function_tests++; 20504 20505 return(test_ret); 20506 } 20507 20508 20509 static int 20510 test_xmlGetIntSubset(void) { 20511 int test_ret = 0; 20512 20513 int mem_base; 20514 xmlDtdPtr ret_val; 20515 xmlDoc * doc; /* the document pointer */ 20516 int n_doc; 20517 20518 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 20519 mem_base = xmlMemBlocks(); 20520 doc = gen_const_xmlDoc_ptr(n_doc, 0); 20521 20522 ret_val = xmlGetIntSubset((const xmlDoc *)doc); 20523 desret_xmlDtdPtr(ret_val); 20524 call_tests++; 20525 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 20526 xmlResetLastError(); 20527 if (mem_base != xmlMemBlocks()) { 20528 printf("Leak of %d blocks found in xmlGetIntSubset", 20529 xmlMemBlocks() - mem_base); 20530 test_ret++; 20531 printf(" %d", n_doc); 20532 printf("\n"); 20533 } 20534 } 20535 function_tests++; 20536 20537 return(test_ret); 20538 } 20539 20540 20541 static int 20542 test_xmlGetLastChild(void) { 20543 int test_ret = 0; 20544 20545 int mem_base; 20546 xmlNodePtr ret_val; 20547 xmlNode * parent; /* the parent node */ 20548 int n_parent; 20549 20550 for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) { 20551 mem_base = xmlMemBlocks(); 20552 parent = gen_const_xmlNode_ptr(n_parent, 0); 20553 20554 ret_val = xmlGetLastChild((const xmlNode *)parent); 20555 desret_xmlNodePtr(ret_val); 20556 call_tests++; 20557 des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0); 20558 xmlResetLastError(); 20559 if (mem_base != xmlMemBlocks()) { 20560 printf("Leak of %d blocks found in xmlGetLastChild", 20561 xmlMemBlocks() - mem_base); 20562 test_ret++; 20563 printf(" %d", n_parent); 20564 printf("\n"); 20565 } 20566 } 20567 function_tests++; 20568 20569 return(test_ret); 20570 } 20571 20572 20573 static int 20574 test_xmlGetLineNo(void) { 20575 int test_ret = 0; 20576 20577 int mem_base; 20578 long ret_val; 20579 xmlNode * node; /* valid node */ 20580 int n_node; 20581 20582 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20583 mem_base = xmlMemBlocks(); 20584 node = gen_const_xmlNode_ptr(n_node, 0); 20585 20586 ret_val = xmlGetLineNo((const xmlNode *)node); 20587 desret_long(ret_val); 20588 call_tests++; 20589 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20590 xmlResetLastError(); 20591 if (mem_base != xmlMemBlocks()) { 20592 printf("Leak of %d blocks found in xmlGetLineNo", 20593 xmlMemBlocks() - mem_base); 20594 test_ret++; 20595 printf(" %d", n_node); 20596 printf("\n"); 20597 } 20598 } 20599 function_tests++; 20600 20601 return(test_ret); 20602 } 20603 20604 20605 static int 20606 test_xmlGetNoNsProp(void) { 20607 int test_ret = 0; 20608 20609 int mem_base; 20610 xmlChar * ret_val; 20611 xmlNode * node; /* the node */ 20612 int n_node; 20613 xmlChar * name; /* the attribute name */ 20614 int n_name; 20615 20616 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20617 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20618 mem_base = xmlMemBlocks(); 20619 node = gen_const_xmlNode_ptr(n_node, 0); 20620 name = gen_const_xmlChar_ptr(n_name, 1); 20621 20622 ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name); 20623 desret_xmlChar_ptr(ret_val); 20624 call_tests++; 20625 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20626 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20627 xmlResetLastError(); 20628 if (mem_base != xmlMemBlocks()) { 20629 printf("Leak of %d blocks found in xmlGetNoNsProp", 20630 xmlMemBlocks() - mem_base); 20631 test_ret++; 20632 printf(" %d", n_node); 20633 printf(" %d", n_name); 20634 printf("\n"); 20635 } 20636 } 20637 } 20638 function_tests++; 20639 20640 return(test_ret); 20641 } 20642 20643 20644 static int 20645 test_xmlGetNodePath(void) { 20646 int test_ret = 0; 20647 20648 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) 20649 int mem_base; 20650 xmlChar * ret_val; 20651 xmlNode * node; /* a node */ 20652 int n_node; 20653 20654 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20655 mem_base = xmlMemBlocks(); 20656 node = gen_const_xmlNode_ptr(n_node, 0); 20657 20658 ret_val = xmlGetNodePath((const xmlNode *)node); 20659 desret_xmlChar_ptr(ret_val); 20660 call_tests++; 20661 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20662 xmlResetLastError(); 20663 if (mem_base != xmlMemBlocks()) { 20664 printf("Leak of %d blocks found in xmlGetNodePath", 20665 xmlMemBlocks() - mem_base); 20666 test_ret++; 20667 printf(" %d", n_node); 20668 printf("\n"); 20669 } 20670 } 20671 function_tests++; 20672 #endif 20673 20674 return(test_ret); 20675 } 20676 20677 20678 static int 20679 test_xmlGetNsList(void) { 20680 int test_ret = 0; 20681 20682 20683 /* missing type support */ 20684 return(test_ret); 20685 } 20686 20687 20688 static int 20689 test_xmlGetNsProp(void) { 20690 int test_ret = 0; 20691 20692 int mem_base; 20693 xmlChar * ret_val; 20694 xmlNode * node; /* the node */ 20695 int n_node; 20696 xmlChar * name; /* the attribute name */ 20697 int n_name; 20698 xmlChar * nameSpace; /* the URI of the namespace */ 20699 int n_nameSpace; 20700 20701 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20702 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20703 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { 20704 mem_base = xmlMemBlocks(); 20705 node = gen_const_xmlNode_ptr(n_node, 0); 20706 name = gen_const_xmlChar_ptr(n_name, 1); 20707 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); 20708 20709 ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace); 20710 desret_xmlChar_ptr(ret_val); 20711 call_tests++; 20712 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20713 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20714 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); 20715 xmlResetLastError(); 20716 if (mem_base != xmlMemBlocks()) { 20717 printf("Leak of %d blocks found in xmlGetNsProp", 20718 xmlMemBlocks() - mem_base); 20719 test_ret++; 20720 printf(" %d", n_node); 20721 printf(" %d", n_name); 20722 printf(" %d", n_nameSpace); 20723 printf("\n"); 20724 } 20725 } 20726 } 20727 } 20728 function_tests++; 20729 20730 return(test_ret); 20731 } 20732 20733 20734 static int 20735 test_xmlGetProp(void) { 20736 int test_ret = 0; 20737 20738 int mem_base; 20739 xmlChar * ret_val; 20740 xmlNode * node; /* the node */ 20741 int n_node; 20742 xmlChar * name; /* the attribute name */ 20743 int n_name; 20744 20745 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20746 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20747 mem_base = xmlMemBlocks(); 20748 node = gen_const_xmlNode_ptr(n_node, 0); 20749 name = gen_const_xmlChar_ptr(n_name, 1); 20750 20751 ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name); 20752 desret_xmlChar_ptr(ret_val); 20753 call_tests++; 20754 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20755 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20756 xmlResetLastError(); 20757 if (mem_base != xmlMemBlocks()) { 20758 printf("Leak of %d blocks found in xmlGetProp", 20759 xmlMemBlocks() - mem_base); 20760 test_ret++; 20761 printf(" %d", n_node); 20762 printf(" %d", n_name); 20763 printf("\n"); 20764 } 20765 } 20766 } 20767 function_tests++; 20768 20769 return(test_ret); 20770 } 20771 20772 20773 static int 20774 test_xmlHasNsProp(void) { 20775 int test_ret = 0; 20776 20777 int mem_base; 20778 xmlAttrPtr ret_val; 20779 xmlNode * node; /* the node */ 20780 int n_node; 20781 xmlChar * name; /* the attribute name */ 20782 int n_name; 20783 xmlChar * nameSpace; /* the URI of the namespace */ 20784 int n_nameSpace; 20785 20786 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20787 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20788 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { 20789 mem_base = xmlMemBlocks(); 20790 node = gen_const_xmlNode_ptr(n_node, 0); 20791 name = gen_const_xmlChar_ptr(n_name, 1); 20792 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); 20793 20794 ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace); 20795 desret_xmlAttrPtr(ret_val); 20796 call_tests++; 20797 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20798 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20799 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); 20800 xmlResetLastError(); 20801 if (mem_base != xmlMemBlocks()) { 20802 printf("Leak of %d blocks found in xmlHasNsProp", 20803 xmlMemBlocks() - mem_base); 20804 test_ret++; 20805 printf(" %d", n_node); 20806 printf(" %d", n_name); 20807 printf(" %d", n_nameSpace); 20808 printf("\n"); 20809 } 20810 } 20811 } 20812 } 20813 function_tests++; 20814 20815 return(test_ret); 20816 } 20817 20818 20819 static int 20820 test_xmlHasProp(void) { 20821 int test_ret = 0; 20822 20823 int mem_base; 20824 xmlAttrPtr ret_val; 20825 xmlNode * node; /* the node */ 20826 int n_node; 20827 xmlChar * name; /* the attribute name */ 20828 int n_name; 20829 20830 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20831 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20832 mem_base = xmlMemBlocks(); 20833 node = gen_const_xmlNode_ptr(n_node, 0); 20834 name = gen_const_xmlChar_ptr(n_name, 1); 20835 20836 ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name); 20837 desret_xmlAttrPtr(ret_val); 20838 call_tests++; 20839 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20840 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20841 xmlResetLastError(); 20842 if (mem_base != xmlMemBlocks()) { 20843 printf("Leak of %d blocks found in xmlHasProp", 20844 xmlMemBlocks() - mem_base); 20845 test_ret++; 20846 printf(" %d", n_node); 20847 printf(" %d", n_name); 20848 printf("\n"); 20849 } 20850 } 20851 } 20852 function_tests++; 20853 20854 return(test_ret); 20855 } 20856 20857 20858 static int 20859 test_xmlIsBlankNode(void) { 20860 int test_ret = 0; 20861 20862 int mem_base; 20863 int ret_val; 20864 xmlNode * node; /* the node */ 20865 int n_node; 20866 20867 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 20868 mem_base = xmlMemBlocks(); 20869 node = gen_const_xmlNode_ptr(n_node, 0); 20870 20871 ret_val = xmlIsBlankNode((const xmlNode *)node); 20872 desret_int(ret_val); 20873 call_tests++; 20874 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 20875 xmlResetLastError(); 20876 if (mem_base != xmlMemBlocks()) { 20877 printf("Leak of %d blocks found in xmlIsBlankNode", 20878 xmlMemBlocks() - mem_base); 20879 test_ret++; 20880 printf(" %d", n_node); 20881 printf("\n"); 20882 } 20883 } 20884 function_tests++; 20885 20886 return(test_ret); 20887 } 20888 20889 20890 static int 20891 test_xmlIsXHTML(void) { 20892 int test_ret = 0; 20893 20894 int mem_base; 20895 int ret_val; 20896 xmlChar * systemID; /* the system identifier */ 20897 int n_systemID; 20898 xmlChar * publicID; /* the public identifier */ 20899 int n_publicID; 20900 20901 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) { 20902 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) { 20903 mem_base = xmlMemBlocks(); 20904 systemID = gen_const_xmlChar_ptr(n_systemID, 0); 20905 publicID = gen_const_xmlChar_ptr(n_publicID, 1); 20906 20907 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID); 20908 desret_int(ret_val); 20909 call_tests++; 20910 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0); 20911 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1); 20912 xmlResetLastError(); 20913 if (mem_base != xmlMemBlocks()) { 20914 printf("Leak of %d blocks found in xmlIsXHTML", 20915 xmlMemBlocks() - mem_base); 20916 test_ret++; 20917 printf(" %d", n_systemID); 20918 printf(" %d", n_publicID); 20919 printf("\n"); 20920 } 20921 } 20922 } 20923 function_tests++; 20924 20925 return(test_ret); 20926 } 20927 20928 20929 static int 20930 test_xmlLastElementChild(void) { 20931 int test_ret = 0; 20932 20933 #if defined(LIBXML_TREE_ENABLED) 20934 int mem_base; 20935 xmlNodePtr ret_val; 20936 xmlNodePtr parent; /* the parent node */ 20937 int n_parent; 20938 20939 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 20940 mem_base = xmlMemBlocks(); 20941 parent = gen_xmlNodePtr(n_parent, 0); 20942 20943 ret_val = xmlLastElementChild(parent); 20944 desret_xmlNodePtr(ret_val); 20945 call_tests++; 20946 des_xmlNodePtr(n_parent, parent, 0); 20947 xmlResetLastError(); 20948 if (mem_base != xmlMemBlocks()) { 20949 printf("Leak of %d blocks found in xmlLastElementChild", 20950 xmlMemBlocks() - mem_base); 20951 test_ret++; 20952 printf(" %d", n_parent); 20953 printf("\n"); 20954 } 20955 } 20956 function_tests++; 20957 #endif 20958 20959 return(test_ret); 20960 } 20961 20962 20963 static int 20964 test_xmlNewCDataBlock(void) { 20965 int test_ret = 0; 20966 20967 int mem_base; 20968 xmlNodePtr ret_val; 20969 xmlDocPtr doc; /* the document */ 20970 int n_doc; 20971 xmlChar * content; /* the CDATA block content content */ 20972 int n_content; 20973 int len; /* the length of the block */ 20974 int n_len; 20975 20976 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20977 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 20978 for (n_len = 0;n_len < gen_nb_int;n_len++) { 20979 mem_base = xmlMemBlocks(); 20980 doc = gen_xmlDocPtr(n_doc, 0); 20981 content = gen_const_xmlChar_ptr(n_content, 1); 20982 len = gen_int(n_len, 2); 20983 20984 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len); 20985 desret_xmlNodePtr(ret_val); 20986 call_tests++; 20987 des_xmlDocPtr(n_doc, doc, 0); 20988 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 20989 des_int(n_len, len, 2); 20990 xmlResetLastError(); 20991 if (mem_base != xmlMemBlocks()) { 20992 printf("Leak of %d blocks found in xmlNewCDataBlock", 20993 xmlMemBlocks() - mem_base); 20994 test_ret++; 20995 printf(" %d", n_doc); 20996 printf(" %d", n_content); 20997 printf(" %d", n_len); 20998 printf("\n"); 20999 } 21000 } 21001 } 21002 } 21003 function_tests++; 21004 21005 return(test_ret); 21006 } 21007 21008 21009 static int 21010 test_xmlNewCharRef(void) { 21011 int test_ret = 0; 21012 21013 int mem_base; 21014 xmlNodePtr ret_val; 21015 xmlDocPtr doc; /* the document */ 21016 int n_doc; 21017 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */ 21018 int n_name; 21019 21020 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21021 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21022 mem_base = xmlMemBlocks(); 21023 doc = gen_xmlDocPtr(n_doc, 0); 21024 name = gen_const_xmlChar_ptr(n_name, 1); 21025 21026 ret_val = xmlNewCharRef(doc, (const xmlChar *)name); 21027 desret_xmlNodePtr(ret_val); 21028 call_tests++; 21029 des_xmlDocPtr(n_doc, doc, 0); 21030 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21031 xmlResetLastError(); 21032 if (mem_base != xmlMemBlocks()) { 21033 printf("Leak of %d blocks found in xmlNewCharRef", 21034 xmlMemBlocks() - mem_base); 21035 test_ret++; 21036 printf(" %d", n_doc); 21037 printf(" %d", n_name); 21038 printf("\n"); 21039 } 21040 } 21041 } 21042 function_tests++; 21043 21044 return(test_ret); 21045 } 21046 21047 21048 static int 21049 test_xmlNewChild(void) { 21050 int test_ret = 0; 21051 21052 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 21053 #ifdef LIBXML_TREE_ENABLED 21054 int mem_base; 21055 xmlNodePtr ret_val; 21056 xmlNodePtr parent; /* the parent node */ 21057 int n_parent; 21058 xmlNsPtr ns; /* a namespace if any */ 21059 int n_ns; 21060 xmlChar * name; /* the name of the child */ 21061 int n_name; 21062 xmlChar * content; /* the XML content of the child if any. */ 21063 int n_content; 21064 21065 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 21066 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21067 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21068 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21069 mem_base = xmlMemBlocks(); 21070 parent = gen_xmlNodePtr(n_parent, 0); 21071 ns = gen_xmlNsPtr(n_ns, 1); 21072 name = gen_const_xmlChar_ptr(n_name, 2); 21073 content = gen_const_xmlChar_ptr(n_content, 3); 21074 21075 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content); 21076 desret_xmlNodePtr(ret_val); 21077 call_tests++; 21078 des_xmlNodePtr(n_parent, parent, 0); 21079 des_xmlNsPtr(n_ns, ns, 1); 21080 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21081 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21082 xmlResetLastError(); 21083 if (mem_base != xmlMemBlocks()) { 21084 printf("Leak of %d blocks found in xmlNewChild", 21085 xmlMemBlocks() - mem_base); 21086 test_ret++; 21087 printf(" %d", n_parent); 21088 printf(" %d", n_ns); 21089 printf(" %d", n_name); 21090 printf(" %d", n_content); 21091 printf("\n"); 21092 } 21093 } 21094 } 21095 } 21096 } 21097 function_tests++; 21098 #endif 21099 #endif 21100 21101 return(test_ret); 21102 } 21103 21104 21105 static int 21106 test_xmlNewComment(void) { 21107 int test_ret = 0; 21108 21109 int mem_base; 21110 xmlNodePtr ret_val; 21111 xmlChar * content; /* the comment content */ 21112 int n_content; 21113 21114 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21115 mem_base = xmlMemBlocks(); 21116 content = gen_const_xmlChar_ptr(n_content, 0); 21117 21118 ret_val = xmlNewComment((const xmlChar *)content); 21119 desret_xmlNodePtr(ret_val); 21120 call_tests++; 21121 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); 21122 xmlResetLastError(); 21123 if (mem_base != xmlMemBlocks()) { 21124 printf("Leak of %d blocks found in xmlNewComment", 21125 xmlMemBlocks() - mem_base); 21126 test_ret++; 21127 printf(" %d", n_content); 21128 printf("\n"); 21129 } 21130 } 21131 function_tests++; 21132 21133 return(test_ret); 21134 } 21135 21136 21137 static int 21138 test_xmlNewDoc(void) { 21139 int test_ret = 0; 21140 21141 int mem_base; 21142 xmlDocPtr ret_val; 21143 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */ 21144 int n_version; 21145 21146 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) { 21147 mem_base = xmlMemBlocks(); 21148 version = gen_const_xmlChar_ptr(n_version, 0); 21149 21150 ret_val = xmlNewDoc((const xmlChar *)version); 21151 desret_xmlDocPtr(ret_val); 21152 call_tests++; 21153 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0); 21154 xmlResetLastError(); 21155 if (mem_base != xmlMemBlocks()) { 21156 printf("Leak of %d blocks found in xmlNewDoc", 21157 xmlMemBlocks() - mem_base); 21158 test_ret++; 21159 printf(" %d", n_version); 21160 printf("\n"); 21161 } 21162 } 21163 function_tests++; 21164 21165 return(test_ret); 21166 } 21167 21168 21169 static int 21170 test_xmlNewDocComment(void) { 21171 int test_ret = 0; 21172 21173 int mem_base; 21174 xmlNodePtr ret_val; 21175 xmlDocPtr doc; /* the document */ 21176 int n_doc; 21177 xmlChar * content; /* the comment content */ 21178 int n_content; 21179 21180 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21181 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21182 mem_base = xmlMemBlocks(); 21183 doc = gen_xmlDocPtr(n_doc, 0); 21184 content = gen_const_xmlChar_ptr(n_content, 1); 21185 21186 ret_val = xmlNewDocComment(doc, (const xmlChar *)content); 21187 desret_xmlNodePtr(ret_val); 21188 call_tests++; 21189 des_xmlDocPtr(n_doc, doc, 0); 21190 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21191 xmlResetLastError(); 21192 if (mem_base != xmlMemBlocks()) { 21193 printf("Leak of %d blocks found in xmlNewDocComment", 21194 xmlMemBlocks() - mem_base); 21195 test_ret++; 21196 printf(" %d", n_doc); 21197 printf(" %d", n_content); 21198 printf("\n"); 21199 } 21200 } 21201 } 21202 function_tests++; 21203 21204 return(test_ret); 21205 } 21206 21207 21208 static int 21209 test_xmlNewDocFragment(void) { 21210 int test_ret = 0; 21211 21212 #if defined(LIBXML_TREE_ENABLED) 21213 int mem_base; 21214 xmlNodePtr ret_val; 21215 xmlDocPtr doc; /* the document owning the fragment */ 21216 int n_doc; 21217 21218 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21219 mem_base = xmlMemBlocks(); 21220 doc = gen_xmlDocPtr(n_doc, 0); 21221 21222 ret_val = xmlNewDocFragment(doc); 21223 desret_xmlNodePtr(ret_val); 21224 call_tests++; 21225 des_xmlDocPtr(n_doc, doc, 0); 21226 xmlResetLastError(); 21227 if (mem_base != xmlMemBlocks()) { 21228 printf("Leak of %d blocks found in xmlNewDocFragment", 21229 xmlMemBlocks() - mem_base); 21230 test_ret++; 21231 printf(" %d", n_doc); 21232 printf("\n"); 21233 } 21234 } 21235 function_tests++; 21236 #endif 21237 21238 return(test_ret); 21239 } 21240 21241 21242 static int 21243 test_xmlNewDocNode(void) { 21244 int test_ret = 0; 21245 21246 int mem_base; 21247 xmlNodePtr ret_val; 21248 xmlDocPtr doc; /* the document */ 21249 int n_doc; 21250 xmlNsPtr ns; /* namespace if any */ 21251 int n_ns; 21252 xmlChar * name; /* the node name */ 21253 int n_name; 21254 xmlChar * content; /* the XML text content if any */ 21255 int n_content; 21256 21257 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21258 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21259 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21260 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21261 mem_base = xmlMemBlocks(); 21262 doc = gen_xmlDocPtr(n_doc, 0); 21263 ns = gen_xmlNsPtr(n_ns, 1); 21264 name = gen_const_xmlChar_ptr(n_name, 2); 21265 content = gen_const_xmlChar_ptr(n_content, 3); 21266 21267 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content); 21268 desret_xmlNodePtr(ret_val); 21269 call_tests++; 21270 des_xmlDocPtr(n_doc, doc, 0); 21271 des_xmlNsPtr(n_ns, ns, 1); 21272 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21273 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21274 xmlResetLastError(); 21275 if (mem_base != xmlMemBlocks()) { 21276 printf("Leak of %d blocks found in xmlNewDocNode", 21277 xmlMemBlocks() - mem_base); 21278 test_ret++; 21279 printf(" %d", n_doc); 21280 printf(" %d", n_ns); 21281 printf(" %d", n_name); 21282 printf(" %d", n_content); 21283 printf("\n"); 21284 } 21285 } 21286 } 21287 } 21288 } 21289 function_tests++; 21290 21291 return(test_ret); 21292 } 21293 21294 21295 static int 21296 test_xmlNewDocNodeEatName(void) { 21297 int test_ret = 0; 21298 21299 int mem_base; 21300 xmlNodePtr ret_val; 21301 xmlDocPtr doc; /* the document */ 21302 int n_doc; 21303 xmlNsPtr ns; /* namespace if any */ 21304 int n_ns; 21305 xmlChar * name; /* the node name */ 21306 int n_name; 21307 xmlChar * content; /* the XML text content if any */ 21308 int n_content; 21309 21310 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21311 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21312 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { 21313 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21314 mem_base = xmlMemBlocks(); 21315 doc = gen_xmlDocPtr(n_doc, 0); 21316 ns = gen_xmlNsPtr(n_ns, 1); 21317 name = gen_eaten_name(n_name, 2); 21318 content = gen_const_xmlChar_ptr(n_content, 3); 21319 21320 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content); 21321 desret_xmlNodePtr(ret_val); 21322 call_tests++; 21323 des_xmlDocPtr(n_doc, doc, 0); 21324 des_xmlNsPtr(n_ns, ns, 1); 21325 des_eaten_name(n_name, name, 2); 21326 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21327 xmlResetLastError(); 21328 if (mem_base != xmlMemBlocks()) { 21329 printf("Leak of %d blocks found in xmlNewDocNodeEatName", 21330 xmlMemBlocks() - mem_base); 21331 test_ret++; 21332 printf(" %d", n_doc); 21333 printf(" %d", n_ns); 21334 printf(" %d", n_name); 21335 printf(" %d", n_content); 21336 printf("\n"); 21337 } 21338 } 21339 } 21340 } 21341 } 21342 function_tests++; 21343 21344 return(test_ret); 21345 } 21346 21347 21348 static int 21349 test_xmlNewDocPI(void) { 21350 int test_ret = 0; 21351 21352 int mem_base; 21353 xmlNodePtr ret_val; 21354 xmlDocPtr doc; /* the target document */ 21355 int n_doc; 21356 xmlChar * name; /* the processing instruction name */ 21357 int n_name; 21358 xmlChar * content; /* the PI content */ 21359 int n_content; 21360 21361 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21362 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21363 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21364 mem_base = xmlMemBlocks(); 21365 doc = gen_xmlDocPtr(n_doc, 0); 21366 name = gen_const_xmlChar_ptr(n_name, 1); 21367 content = gen_const_xmlChar_ptr(n_content, 2); 21368 21369 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content); 21370 desret_xmlNodePtr(ret_val); 21371 call_tests++; 21372 des_xmlDocPtr(n_doc, doc, 0); 21373 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21374 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); 21375 xmlResetLastError(); 21376 if (mem_base != xmlMemBlocks()) { 21377 printf("Leak of %d blocks found in xmlNewDocPI", 21378 xmlMemBlocks() - mem_base); 21379 test_ret++; 21380 printf(" %d", n_doc); 21381 printf(" %d", n_name); 21382 printf(" %d", n_content); 21383 printf("\n"); 21384 } 21385 } 21386 } 21387 } 21388 function_tests++; 21389 21390 return(test_ret); 21391 } 21392 21393 21394 static int 21395 test_xmlNewDocProp(void) { 21396 int test_ret = 0; 21397 21398 int mem_base; 21399 xmlAttrPtr ret_val; 21400 xmlDocPtr doc; /* the document */ 21401 int n_doc; 21402 xmlChar * name; /* the name of the attribute */ 21403 int n_name; 21404 xmlChar * value; /* the value of the attribute */ 21405 int n_value; 21406 21407 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21408 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21409 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21410 mem_base = xmlMemBlocks(); 21411 doc = gen_xmlDocPtr(n_doc, 0); 21412 name = gen_const_xmlChar_ptr(n_name, 1); 21413 value = gen_const_xmlChar_ptr(n_value, 2); 21414 21415 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value); 21416 desret_xmlAttrPtr(ret_val); 21417 call_tests++; 21418 des_xmlDocPtr(n_doc, doc, 0); 21419 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21420 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); 21421 xmlResetLastError(); 21422 if (mem_base != xmlMemBlocks()) { 21423 printf("Leak of %d blocks found in xmlNewDocProp", 21424 xmlMemBlocks() - mem_base); 21425 test_ret++; 21426 printf(" %d", n_doc); 21427 printf(" %d", n_name); 21428 printf(" %d", n_value); 21429 printf("\n"); 21430 } 21431 } 21432 } 21433 } 21434 function_tests++; 21435 21436 return(test_ret); 21437 } 21438 21439 21440 static int 21441 test_xmlNewDocRawNode(void) { 21442 int test_ret = 0; 21443 21444 #if defined(LIBXML_TREE_ENABLED) 21445 #ifdef LIBXML_TREE_ENABLED 21446 int mem_base; 21447 xmlNodePtr ret_val; 21448 xmlDocPtr doc; /* the document */ 21449 int n_doc; 21450 xmlNsPtr ns; /* namespace if any */ 21451 int n_ns; 21452 xmlChar * name; /* the node name */ 21453 int n_name; 21454 xmlChar * content; /* the text content if any */ 21455 int n_content; 21456 21457 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21458 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21459 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21460 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21461 mem_base = xmlMemBlocks(); 21462 doc = gen_xmlDocPtr(n_doc, 0); 21463 ns = gen_xmlNsPtr(n_ns, 1); 21464 name = gen_const_xmlChar_ptr(n_name, 2); 21465 content = gen_const_xmlChar_ptr(n_content, 3); 21466 21467 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content); 21468 desret_xmlNodePtr(ret_val); 21469 call_tests++; 21470 des_xmlDocPtr(n_doc, doc, 0); 21471 des_xmlNsPtr(n_ns, ns, 1); 21472 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21473 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21474 xmlResetLastError(); 21475 if (mem_base != xmlMemBlocks()) { 21476 printf("Leak of %d blocks found in xmlNewDocRawNode", 21477 xmlMemBlocks() - mem_base); 21478 test_ret++; 21479 printf(" %d", n_doc); 21480 printf(" %d", n_ns); 21481 printf(" %d", n_name); 21482 printf(" %d", n_content); 21483 printf("\n"); 21484 } 21485 } 21486 } 21487 } 21488 } 21489 function_tests++; 21490 #endif 21491 #endif 21492 21493 return(test_ret); 21494 } 21495 21496 21497 static int 21498 test_xmlNewDocText(void) { 21499 int test_ret = 0; 21500 21501 int mem_base; 21502 xmlNodePtr ret_val; 21503 xmlDoc * doc; /* the document */ 21504 int n_doc; 21505 xmlChar * content; /* the text content */ 21506 int n_content; 21507 21508 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 21509 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21510 mem_base = xmlMemBlocks(); 21511 doc = gen_const_xmlDoc_ptr(n_doc, 0); 21512 content = gen_const_xmlChar_ptr(n_content, 1); 21513 21514 ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content); 21515 desret_xmlNodePtr(ret_val); 21516 call_tests++; 21517 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 21518 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21519 xmlResetLastError(); 21520 if (mem_base != xmlMemBlocks()) { 21521 printf("Leak of %d blocks found in xmlNewDocText", 21522 xmlMemBlocks() - mem_base); 21523 test_ret++; 21524 printf(" %d", n_doc); 21525 printf(" %d", n_content); 21526 printf("\n"); 21527 } 21528 } 21529 } 21530 function_tests++; 21531 21532 return(test_ret); 21533 } 21534 21535 21536 static int 21537 test_xmlNewDocTextLen(void) { 21538 int test_ret = 0; 21539 21540 int mem_base; 21541 xmlNodePtr ret_val; 21542 xmlDocPtr doc; /* the document */ 21543 int n_doc; 21544 xmlChar * content; /* the text content */ 21545 int n_content; 21546 int len; /* the text len. */ 21547 int n_len; 21548 21549 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21550 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21551 for (n_len = 0;n_len < gen_nb_int;n_len++) { 21552 mem_base = xmlMemBlocks(); 21553 doc = gen_xmlDocPtr(n_doc, 0); 21554 content = gen_const_xmlChar_ptr(n_content, 1); 21555 len = gen_int(n_len, 2); 21556 21557 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len); 21558 desret_xmlNodePtr(ret_val); 21559 call_tests++; 21560 des_xmlDocPtr(n_doc, doc, 0); 21561 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21562 des_int(n_len, len, 2); 21563 xmlResetLastError(); 21564 if (mem_base != xmlMemBlocks()) { 21565 printf("Leak of %d blocks found in xmlNewDocTextLen", 21566 xmlMemBlocks() - mem_base); 21567 test_ret++; 21568 printf(" %d", n_doc); 21569 printf(" %d", n_content); 21570 printf(" %d", n_len); 21571 printf("\n"); 21572 } 21573 } 21574 } 21575 } 21576 function_tests++; 21577 21578 return(test_ret); 21579 } 21580 21581 21582 static int 21583 test_xmlNewDtd(void) { 21584 int test_ret = 0; 21585 21586 int mem_base; 21587 xmlDtdPtr ret_val; 21588 xmlDocPtr doc; /* the document pointer */ 21589 int n_doc; 21590 xmlChar * name; /* the DTD name */ 21591 int n_name; 21592 xmlChar * ExternalID; /* the external ID */ 21593 int n_ExternalID; 21594 xmlChar * SystemID; /* the system ID */ 21595 int n_SystemID; 21596 21597 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21598 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21599 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 21600 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 21601 mem_base = xmlMemBlocks(); 21602 doc = gen_xmlDocPtr(n_doc, 0); 21603 name = gen_const_xmlChar_ptr(n_name, 1); 21604 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 21605 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 21606 21607 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 21608 desret_xmlDtdPtr(ret_val); 21609 call_tests++; 21610 des_xmlDocPtr(n_doc, doc, 0); 21611 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21612 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 21613 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 21614 xmlResetLastError(); 21615 if (mem_base != xmlMemBlocks()) { 21616 printf("Leak of %d blocks found in xmlNewDtd", 21617 xmlMemBlocks() - mem_base); 21618 test_ret++; 21619 printf(" %d", n_doc); 21620 printf(" %d", n_name); 21621 printf(" %d", n_ExternalID); 21622 printf(" %d", n_SystemID); 21623 printf("\n"); 21624 } 21625 } 21626 } 21627 } 21628 } 21629 function_tests++; 21630 21631 return(test_ret); 21632 } 21633 21634 21635 static int 21636 test_xmlNewNode(void) { 21637 int test_ret = 0; 21638 21639 int mem_base; 21640 xmlNodePtr ret_val; 21641 xmlNsPtr ns; /* namespace if any */ 21642 int n_ns; 21643 xmlChar * name; /* the node name */ 21644 int n_name; 21645 21646 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21647 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21648 mem_base = xmlMemBlocks(); 21649 ns = gen_xmlNsPtr(n_ns, 0); 21650 name = gen_const_xmlChar_ptr(n_name, 1); 21651 21652 ret_val = xmlNewNode(ns, (const xmlChar *)name); 21653 desret_xmlNodePtr(ret_val); 21654 call_tests++; 21655 des_xmlNsPtr(n_ns, ns, 0); 21656 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21657 xmlResetLastError(); 21658 if (mem_base != xmlMemBlocks()) { 21659 printf("Leak of %d blocks found in xmlNewNode", 21660 xmlMemBlocks() - mem_base); 21661 test_ret++; 21662 printf(" %d", n_ns); 21663 printf(" %d", n_name); 21664 printf("\n"); 21665 } 21666 } 21667 } 21668 function_tests++; 21669 21670 return(test_ret); 21671 } 21672 21673 21674 static int 21675 test_xmlNewNodeEatName(void) { 21676 int test_ret = 0; 21677 21678 int mem_base; 21679 xmlNodePtr ret_val; 21680 xmlNsPtr ns; /* namespace if any */ 21681 int n_ns; 21682 xmlChar * name; /* the node name */ 21683 int n_name; 21684 21685 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21686 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { 21687 mem_base = xmlMemBlocks(); 21688 ns = gen_xmlNsPtr(n_ns, 0); 21689 name = gen_eaten_name(n_name, 1); 21690 21691 ret_val = xmlNewNodeEatName(ns, name); 21692 desret_xmlNodePtr(ret_val); 21693 call_tests++; 21694 des_xmlNsPtr(n_ns, ns, 0); 21695 des_eaten_name(n_name, name, 1); 21696 xmlResetLastError(); 21697 if (mem_base != xmlMemBlocks()) { 21698 printf("Leak of %d blocks found in xmlNewNodeEatName", 21699 xmlMemBlocks() - mem_base); 21700 test_ret++; 21701 printf(" %d", n_ns); 21702 printf(" %d", n_name); 21703 printf("\n"); 21704 } 21705 } 21706 } 21707 function_tests++; 21708 21709 return(test_ret); 21710 } 21711 21712 21713 static int 21714 test_xmlNewNs(void) { 21715 int test_ret = 0; 21716 21717 int mem_base; 21718 xmlNsPtr ret_val; 21719 xmlNodePtr node; /* the element carrying the namespace */ 21720 int n_node; 21721 xmlChar * href; /* the URI associated */ 21722 int n_href; 21723 xmlChar * prefix; /* the prefix for the namespace */ 21724 int n_prefix; 21725 21726 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21727 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) { 21728 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 21729 mem_base = xmlMemBlocks(); 21730 node = gen_xmlNodePtr(n_node, 0); 21731 href = gen_const_xmlChar_ptr(n_href, 1); 21732 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 21733 21734 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix); 21735 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val); 21736 desret_xmlNsPtr(ret_val); 21737 call_tests++; 21738 des_xmlNodePtr(n_node, node, 0); 21739 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1); 21740 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 21741 xmlResetLastError(); 21742 if (mem_base != xmlMemBlocks()) { 21743 printf("Leak of %d blocks found in xmlNewNs", 21744 xmlMemBlocks() - mem_base); 21745 test_ret++; 21746 printf(" %d", n_node); 21747 printf(" %d", n_href); 21748 printf(" %d", n_prefix); 21749 printf("\n"); 21750 } 21751 } 21752 } 21753 } 21754 function_tests++; 21755 21756 return(test_ret); 21757 } 21758 21759 21760 static int 21761 test_xmlNewNsProp(void) { 21762 int test_ret = 0; 21763 21764 int mem_base; 21765 xmlAttrPtr ret_val; 21766 xmlNodePtr node; /* the holding node */ 21767 int n_node; 21768 xmlNsPtr ns; /* the namespace */ 21769 int n_ns; 21770 xmlChar * name; /* the name of the attribute */ 21771 int n_name; 21772 xmlChar * value; /* the value of the attribute */ 21773 int n_value; 21774 21775 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21776 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21777 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21778 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21779 mem_base = xmlMemBlocks(); 21780 node = gen_xmlNodePtr(n_node, 0); 21781 ns = gen_xmlNsPtr(n_ns, 1); 21782 name = gen_const_xmlChar_ptr(n_name, 2); 21783 value = gen_const_xmlChar_ptr(n_value, 3); 21784 21785 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value); 21786 desret_xmlAttrPtr(ret_val); 21787 call_tests++; 21788 des_xmlNodePtr(n_node, node, 0); 21789 des_xmlNsPtr(n_ns, ns, 1); 21790 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21791 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 21792 xmlResetLastError(); 21793 if (mem_base != xmlMemBlocks()) { 21794 printf("Leak of %d blocks found in xmlNewNsProp", 21795 xmlMemBlocks() - mem_base); 21796 test_ret++; 21797 printf(" %d", n_node); 21798 printf(" %d", n_ns); 21799 printf(" %d", n_name); 21800 printf(" %d", n_value); 21801 printf("\n"); 21802 } 21803 } 21804 } 21805 } 21806 } 21807 function_tests++; 21808 21809 return(test_ret); 21810 } 21811 21812 21813 static int 21814 test_xmlNewNsPropEatName(void) { 21815 int test_ret = 0; 21816 21817 int mem_base; 21818 xmlAttrPtr ret_val; 21819 xmlNodePtr node; /* the holding node */ 21820 int n_node; 21821 xmlNsPtr ns; /* the namespace */ 21822 int n_ns; 21823 xmlChar * name; /* the name of the attribute */ 21824 int n_name; 21825 xmlChar * value; /* the value of the attribute */ 21826 int n_value; 21827 21828 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21829 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21830 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { 21831 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21832 mem_base = xmlMemBlocks(); 21833 node = gen_xmlNodePtr(n_node, 0); 21834 ns = gen_xmlNsPtr(n_ns, 1); 21835 name = gen_eaten_name(n_name, 2); 21836 value = gen_const_xmlChar_ptr(n_value, 3); 21837 21838 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value); 21839 desret_xmlAttrPtr(ret_val); 21840 call_tests++; 21841 des_xmlNodePtr(n_node, node, 0); 21842 des_xmlNsPtr(n_ns, ns, 1); 21843 des_eaten_name(n_name, name, 2); 21844 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 21845 xmlResetLastError(); 21846 if (mem_base != xmlMemBlocks()) { 21847 printf("Leak of %d blocks found in xmlNewNsPropEatName", 21848 xmlMemBlocks() - mem_base); 21849 test_ret++; 21850 printf(" %d", n_node); 21851 printf(" %d", n_ns); 21852 printf(" %d", n_name); 21853 printf(" %d", n_value); 21854 printf("\n"); 21855 } 21856 } 21857 } 21858 } 21859 } 21860 function_tests++; 21861 21862 return(test_ret); 21863 } 21864 21865 21866 static int 21867 test_xmlNewPI(void) { 21868 int test_ret = 0; 21869 21870 int mem_base; 21871 xmlNodePtr ret_val; 21872 xmlChar * name; /* the processing instruction name */ 21873 int n_name; 21874 xmlChar * content; /* the PI content */ 21875 int n_content; 21876 21877 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21878 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21879 mem_base = xmlMemBlocks(); 21880 name = gen_const_xmlChar_ptr(n_name, 0); 21881 content = gen_const_xmlChar_ptr(n_content, 1); 21882 21883 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content); 21884 desret_xmlNodePtr(ret_val); 21885 call_tests++; 21886 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 21887 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21888 xmlResetLastError(); 21889 if (mem_base != xmlMemBlocks()) { 21890 printf("Leak of %d blocks found in xmlNewPI", 21891 xmlMemBlocks() - mem_base); 21892 test_ret++; 21893 printf(" %d", n_name); 21894 printf(" %d", n_content); 21895 printf("\n"); 21896 } 21897 } 21898 } 21899 function_tests++; 21900 21901 return(test_ret); 21902 } 21903 21904 21905 static int 21906 test_xmlNewProp(void) { 21907 int test_ret = 0; 21908 21909 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 21910 #ifdef LIBXML_TREE_ENABLED 21911 int mem_base; 21912 xmlAttrPtr ret_val; 21913 xmlNodePtr node; /* the holding node */ 21914 int n_node; 21915 xmlChar * name; /* the name of the attribute */ 21916 int n_name; 21917 xmlChar * value; /* the value of the attribute */ 21918 int n_value; 21919 21920 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21921 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21922 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21923 mem_base = xmlMemBlocks(); 21924 node = gen_xmlNodePtr(n_node, 0); 21925 name = gen_const_xmlChar_ptr(n_name, 1); 21926 value = gen_const_xmlChar_ptr(n_value, 2); 21927 21928 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value); 21929 desret_xmlAttrPtr(ret_val); 21930 call_tests++; 21931 des_xmlNodePtr(n_node, node, 0); 21932 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21933 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); 21934 xmlResetLastError(); 21935 if (mem_base != xmlMemBlocks()) { 21936 printf("Leak of %d blocks found in xmlNewProp", 21937 xmlMemBlocks() - mem_base); 21938 test_ret++; 21939 printf(" %d", n_node); 21940 printf(" %d", n_name); 21941 printf(" %d", n_value); 21942 printf("\n"); 21943 } 21944 } 21945 } 21946 } 21947 function_tests++; 21948 #endif 21949 #endif 21950 21951 return(test_ret); 21952 } 21953 21954 21955 static int 21956 test_xmlNewReference(void) { 21957 int test_ret = 0; 21958 21959 int mem_base; 21960 xmlNodePtr ret_val; 21961 xmlDoc * doc; /* the document */ 21962 int n_doc; 21963 xmlChar * name; /* the reference name, or the reference string with & and ; */ 21964 int n_name; 21965 21966 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 21967 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21968 mem_base = xmlMemBlocks(); 21969 doc = gen_const_xmlDoc_ptr(n_doc, 0); 21970 name = gen_const_xmlChar_ptr(n_name, 1); 21971 21972 ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name); 21973 desret_xmlNodePtr(ret_val); 21974 call_tests++; 21975 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 21976 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21977 xmlResetLastError(); 21978 if (mem_base != xmlMemBlocks()) { 21979 printf("Leak of %d blocks found in xmlNewReference", 21980 xmlMemBlocks() - mem_base); 21981 test_ret++; 21982 printf(" %d", n_doc); 21983 printf(" %d", n_name); 21984 printf("\n"); 21985 } 21986 } 21987 } 21988 function_tests++; 21989 21990 return(test_ret); 21991 } 21992 21993 21994 static int 21995 test_xmlNewText(void) { 21996 int test_ret = 0; 21997 21998 int mem_base; 21999 xmlNodePtr ret_val; 22000 xmlChar * content; /* the text content */ 22001 int n_content; 22002 22003 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22004 mem_base = xmlMemBlocks(); 22005 content = gen_const_xmlChar_ptr(n_content, 0); 22006 22007 ret_val = xmlNewText((const xmlChar *)content); 22008 desret_xmlNodePtr(ret_val); 22009 call_tests++; 22010 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); 22011 xmlResetLastError(); 22012 if (mem_base != xmlMemBlocks()) { 22013 printf("Leak of %d blocks found in xmlNewText", 22014 xmlMemBlocks() - mem_base); 22015 test_ret++; 22016 printf(" %d", n_content); 22017 printf("\n"); 22018 } 22019 } 22020 function_tests++; 22021 22022 return(test_ret); 22023 } 22024 22025 22026 static int 22027 test_xmlNewTextChild(void) { 22028 int test_ret = 0; 22029 22030 #if defined(LIBXML_TREE_ENABLED) 22031 #ifdef LIBXML_TREE_ENABLED 22032 int mem_base; 22033 xmlNodePtr ret_val; 22034 xmlNodePtr parent; /* the parent node */ 22035 int n_parent; 22036 xmlNsPtr ns; /* a namespace if any */ 22037 int n_ns; 22038 xmlChar * name; /* the name of the child */ 22039 int n_name; 22040 xmlChar * content; /* the text content of the child if any. */ 22041 int n_content; 22042 22043 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 22044 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 22045 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 22046 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22047 mem_base = xmlMemBlocks(); 22048 parent = gen_xmlNodePtr(n_parent, 0); 22049 ns = gen_xmlNsPtr(n_ns, 1); 22050 name = gen_const_xmlChar_ptr(n_name, 2); 22051 content = gen_const_xmlChar_ptr(n_content, 3); 22052 22053 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content); 22054 desret_xmlNodePtr(ret_val); 22055 call_tests++; 22056 des_xmlNodePtr(n_parent, parent, 0); 22057 des_xmlNsPtr(n_ns, ns, 1); 22058 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 22059 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 22060 xmlResetLastError(); 22061 if (mem_base != xmlMemBlocks()) { 22062 printf("Leak of %d blocks found in xmlNewTextChild", 22063 xmlMemBlocks() - mem_base); 22064 test_ret++; 22065 printf(" %d", n_parent); 22066 printf(" %d", n_ns); 22067 printf(" %d", n_name); 22068 printf(" %d", n_content); 22069 printf("\n"); 22070 } 22071 } 22072 } 22073 } 22074 } 22075 function_tests++; 22076 #endif 22077 #endif 22078 22079 return(test_ret); 22080 } 22081 22082 22083 static int 22084 test_xmlNewTextLen(void) { 22085 int test_ret = 0; 22086 22087 int mem_base; 22088 xmlNodePtr ret_val; 22089 xmlChar * content; /* the text content */ 22090 int n_content; 22091 int len; /* the text len. */ 22092 int n_len; 22093 22094 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22095 for (n_len = 0;n_len < gen_nb_int;n_len++) { 22096 mem_base = xmlMemBlocks(); 22097 content = gen_const_xmlChar_ptr(n_content, 0); 22098 len = gen_int(n_len, 1); 22099 22100 ret_val = xmlNewTextLen((const xmlChar *)content, len); 22101 desret_xmlNodePtr(ret_val); 22102 call_tests++; 22103 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); 22104 des_int(n_len, len, 1); 22105 xmlResetLastError(); 22106 if (mem_base != xmlMemBlocks()) { 22107 printf("Leak of %d blocks found in xmlNewTextLen", 22108 xmlMemBlocks() - mem_base); 22109 test_ret++; 22110 printf(" %d", n_content); 22111 printf(" %d", n_len); 22112 printf("\n"); 22113 } 22114 } 22115 } 22116 function_tests++; 22117 22118 return(test_ret); 22119 } 22120 22121 22122 static int 22123 test_xmlNextElementSibling(void) { 22124 int test_ret = 0; 22125 22126 #if defined(LIBXML_TREE_ENABLED) 22127 int mem_base; 22128 xmlNodePtr ret_val; 22129 xmlNodePtr node; /* the current node */ 22130 int n_node; 22131 22132 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 22133 mem_base = xmlMemBlocks(); 22134 node = gen_xmlNodePtr(n_node, 0); 22135 22136 ret_val = xmlNextElementSibling(node); 22137 desret_xmlNodePtr(ret_val); 22138 call_tests++; 22139 des_xmlNodePtr(n_node, node, 0); 22140 xmlResetLastError(); 22141 if (mem_base != xmlMemBlocks()) { 22142 printf("Leak of %d blocks found in xmlNextElementSibling", 22143 xmlMemBlocks() - mem_base); 22144 test_ret++; 22145 printf(" %d", n_node); 22146 printf("\n"); 22147 } 22148 } 22149 function_tests++; 22150 #endif 22151 22152 return(test_ret); 22153 } 22154 22155 22156 static int 22157 test_xmlNodeAddContent(void) { 22158 int test_ret = 0; 22159 22160 int mem_base; 22161 xmlNodePtr cur; /* the node being modified */ 22162 int n_cur; 22163 xmlChar * content; /* extra content */ 22164 int n_content; 22165 22166 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22167 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22168 mem_base = xmlMemBlocks(); 22169 cur = gen_xmlNodePtr(n_cur, 0); 22170 content = gen_const_xmlChar_ptr(n_content, 1); 22171 22172 xmlNodeAddContent(cur, (const xmlChar *)content); 22173 call_tests++; 22174 des_xmlNodePtr(n_cur, cur, 0); 22175 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22176 xmlResetLastError(); 22177 if (mem_base != xmlMemBlocks()) { 22178 printf("Leak of %d blocks found in xmlNodeAddContent", 22179 xmlMemBlocks() - mem_base); 22180 test_ret++; 22181 printf(" %d", n_cur); 22182 printf(" %d", n_content); 22183 printf("\n"); 22184 } 22185 } 22186 } 22187 function_tests++; 22188 22189 return(test_ret); 22190 } 22191 22192 22193 static int 22194 test_xmlNodeAddContentLen(void) { 22195 int test_ret = 0; 22196 22197 int mem_base; 22198 xmlNodePtr cur; /* the node being modified */ 22199 int n_cur; 22200 xmlChar * content; /* extra content */ 22201 int n_content; 22202 int len; /* the size of @content */ 22203 int n_len; 22204 22205 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22206 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22207 for (n_len = 0;n_len < gen_nb_int;n_len++) { 22208 mem_base = xmlMemBlocks(); 22209 cur = gen_xmlNodePtr(n_cur, 0); 22210 content = gen_const_xmlChar_ptr(n_content, 1); 22211 len = gen_int(n_len, 2); 22212 22213 xmlNodeAddContentLen(cur, (const xmlChar *)content, len); 22214 call_tests++; 22215 des_xmlNodePtr(n_cur, cur, 0); 22216 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22217 des_int(n_len, len, 2); 22218 xmlResetLastError(); 22219 if (mem_base != xmlMemBlocks()) { 22220 printf("Leak of %d blocks found in xmlNodeAddContentLen", 22221 xmlMemBlocks() - mem_base); 22222 test_ret++; 22223 printf(" %d", n_cur); 22224 printf(" %d", n_content); 22225 printf(" %d", n_len); 22226 printf("\n"); 22227 } 22228 } 22229 } 22230 } 22231 function_tests++; 22232 22233 return(test_ret); 22234 } 22235 22236 22237 static int 22238 test_xmlNodeBufGetContent(void) { 22239 int test_ret = 0; 22240 22241 int mem_base; 22242 int ret_val; 22243 xmlBufferPtr buffer; /* a buffer */ 22244 int n_buffer; 22245 xmlNode * cur; /* the node being read */ 22246 int n_cur; 22247 22248 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { 22249 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) { 22250 mem_base = xmlMemBlocks(); 22251 buffer = gen_xmlBufferPtr(n_buffer, 0); 22252 cur = gen_const_xmlNode_ptr(n_cur, 1); 22253 22254 ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur); 22255 desret_int(ret_val); 22256 call_tests++; 22257 des_xmlBufferPtr(n_buffer, buffer, 0); 22258 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1); 22259 xmlResetLastError(); 22260 if (mem_base != xmlMemBlocks()) { 22261 printf("Leak of %d blocks found in xmlNodeBufGetContent", 22262 xmlMemBlocks() - mem_base); 22263 test_ret++; 22264 printf(" %d", n_buffer); 22265 printf(" %d", n_cur); 22266 printf("\n"); 22267 } 22268 } 22269 } 22270 function_tests++; 22271 22272 return(test_ret); 22273 } 22274 22275 22276 static int 22277 test_xmlNodeDump(void) { 22278 int test_ret = 0; 22279 22280 #if defined(LIBXML_OUTPUT_ENABLED) 22281 int mem_base; 22282 int ret_val; 22283 xmlBufferPtr buf; /* the XML buffer output */ 22284 int n_buf; 22285 xmlDocPtr doc; /* the document */ 22286 int n_doc; 22287 xmlNodePtr cur; /* the current node */ 22288 int n_cur; 22289 int level; /* the imbrication level for indenting */ 22290 int n_level; 22291 int format; /* is formatting allowed */ 22292 int n_format; 22293 22294 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 22295 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22296 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22297 for (n_level = 0;n_level < gen_nb_int;n_level++) { 22298 for (n_format = 0;n_format < gen_nb_int;n_format++) { 22299 mem_base = xmlMemBlocks(); 22300 buf = gen_xmlBufferPtr(n_buf, 0); 22301 doc = gen_xmlDocPtr(n_doc, 1); 22302 cur = gen_xmlNodePtr(n_cur, 2); 22303 level = gen_int(n_level, 3); 22304 format = gen_int(n_format, 4); 22305 22306 ret_val = xmlNodeDump(buf, doc, cur, level, format); 22307 desret_int(ret_val); 22308 call_tests++; 22309 des_xmlBufferPtr(n_buf, buf, 0); 22310 des_xmlDocPtr(n_doc, doc, 1); 22311 des_xmlNodePtr(n_cur, cur, 2); 22312 des_int(n_level, level, 3); 22313 des_int(n_format, format, 4); 22314 xmlResetLastError(); 22315 if (mem_base != xmlMemBlocks()) { 22316 printf("Leak of %d blocks found in xmlNodeDump", 22317 xmlMemBlocks() - mem_base); 22318 test_ret++; 22319 printf(" %d", n_buf); 22320 printf(" %d", n_doc); 22321 printf(" %d", n_cur); 22322 printf(" %d", n_level); 22323 printf(" %d", n_format); 22324 printf("\n"); 22325 } 22326 } 22327 } 22328 } 22329 } 22330 } 22331 function_tests++; 22332 #endif 22333 22334 return(test_ret); 22335 } 22336 22337 22338 static int 22339 test_xmlNodeDumpOutput(void) { 22340 int test_ret = 0; 22341 22342 #if defined(LIBXML_OUTPUT_ENABLED) 22343 int mem_base; 22344 xmlOutputBufferPtr buf; /* the XML buffer output */ 22345 int n_buf; 22346 xmlDocPtr doc; /* the document */ 22347 int n_doc; 22348 xmlNodePtr cur; /* the current node */ 22349 int n_cur; 22350 int level; /* the imbrication level for indenting */ 22351 int n_level; 22352 int format; /* is formatting allowed */ 22353 int n_format; 22354 char * encoding; /* an optional encoding string */ 22355 int n_encoding; 22356 22357 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 22358 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22359 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22360 for (n_level = 0;n_level < gen_nb_int;n_level++) { 22361 for (n_format = 0;n_format < gen_nb_int;n_format++) { 22362 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 22363 mem_base = xmlMemBlocks(); 22364 buf = gen_xmlOutputBufferPtr(n_buf, 0); 22365 doc = gen_xmlDocPtr(n_doc, 1); 22366 cur = gen_xmlNodePtr(n_cur, 2); 22367 level = gen_int(n_level, 3); 22368 format = gen_int(n_format, 4); 22369 encoding = gen_const_char_ptr(n_encoding, 5); 22370 22371 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding); 22372 call_tests++; 22373 des_xmlOutputBufferPtr(n_buf, buf, 0); 22374 des_xmlDocPtr(n_doc, doc, 1); 22375 des_xmlNodePtr(n_cur, cur, 2); 22376 des_int(n_level, level, 3); 22377 des_int(n_format, format, 4); 22378 des_const_char_ptr(n_encoding, (const char *)encoding, 5); 22379 xmlResetLastError(); 22380 if (mem_base != xmlMemBlocks()) { 22381 printf("Leak of %d blocks found in xmlNodeDumpOutput", 22382 xmlMemBlocks() - mem_base); 22383 test_ret++; 22384 printf(" %d", n_buf); 22385 printf(" %d", n_doc); 22386 printf(" %d", n_cur); 22387 printf(" %d", n_level); 22388 printf(" %d", n_format); 22389 printf(" %d", n_encoding); 22390 printf("\n"); 22391 } 22392 } 22393 } 22394 } 22395 } 22396 } 22397 } 22398 function_tests++; 22399 #endif 22400 22401 return(test_ret); 22402 } 22403 22404 22405 static int 22406 test_xmlNodeGetBase(void) { 22407 int test_ret = 0; 22408 22409 int mem_base; 22410 xmlChar * ret_val; 22411 xmlDoc * doc; /* the document the node pertains to */ 22412 int n_doc; 22413 xmlNode * cur; /* the node being checked */ 22414 int n_cur; 22415 22416 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 22417 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) { 22418 mem_base = xmlMemBlocks(); 22419 doc = gen_const_xmlDoc_ptr(n_doc, 0); 22420 cur = gen_const_xmlNode_ptr(n_cur, 1); 22421 22422 ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur); 22423 desret_xmlChar_ptr(ret_val); 22424 call_tests++; 22425 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 22426 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1); 22427 xmlResetLastError(); 22428 if (mem_base != xmlMemBlocks()) { 22429 printf("Leak of %d blocks found in xmlNodeGetBase", 22430 xmlMemBlocks() - mem_base); 22431 test_ret++; 22432 printf(" %d", n_doc); 22433 printf(" %d", n_cur); 22434 printf("\n"); 22435 } 22436 } 22437 } 22438 function_tests++; 22439 22440 return(test_ret); 22441 } 22442 22443 22444 static int 22445 test_xmlNodeGetContent(void) { 22446 int test_ret = 0; 22447 22448 int mem_base; 22449 xmlChar * ret_val; 22450 xmlNode * cur; /* the node being read */ 22451 int n_cur; 22452 22453 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) { 22454 mem_base = xmlMemBlocks(); 22455 cur = gen_const_xmlNode_ptr(n_cur, 0); 22456 22457 ret_val = xmlNodeGetContent((const xmlNode *)cur); 22458 desret_xmlChar_ptr(ret_val); 22459 call_tests++; 22460 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0); 22461 xmlResetLastError(); 22462 if (mem_base != xmlMemBlocks()) { 22463 printf("Leak of %d blocks found in xmlNodeGetContent", 22464 xmlMemBlocks() - mem_base); 22465 test_ret++; 22466 printf(" %d", n_cur); 22467 printf("\n"); 22468 } 22469 } 22470 function_tests++; 22471 22472 return(test_ret); 22473 } 22474 22475 22476 static int 22477 test_xmlNodeGetLang(void) { 22478 int test_ret = 0; 22479 22480 int mem_base; 22481 xmlChar * ret_val; 22482 xmlNode * cur; /* the node being checked */ 22483 int n_cur; 22484 22485 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) { 22486 mem_base = xmlMemBlocks(); 22487 cur = gen_const_xmlNode_ptr(n_cur, 0); 22488 22489 ret_val = xmlNodeGetLang((const xmlNode *)cur); 22490 desret_xmlChar_ptr(ret_val); 22491 call_tests++; 22492 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0); 22493 xmlResetLastError(); 22494 if (mem_base != xmlMemBlocks()) { 22495 printf("Leak of %d blocks found in xmlNodeGetLang", 22496 xmlMemBlocks() - mem_base); 22497 test_ret++; 22498 printf(" %d", n_cur); 22499 printf("\n"); 22500 } 22501 } 22502 function_tests++; 22503 22504 return(test_ret); 22505 } 22506 22507 22508 static int 22509 test_xmlNodeGetSpacePreserve(void) { 22510 int test_ret = 0; 22511 22512 int mem_base; 22513 int ret_val; 22514 xmlNode * cur; /* the node being checked */ 22515 int n_cur; 22516 22517 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) { 22518 mem_base = xmlMemBlocks(); 22519 cur = gen_const_xmlNode_ptr(n_cur, 0); 22520 22521 ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur); 22522 desret_int(ret_val); 22523 call_tests++; 22524 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0); 22525 xmlResetLastError(); 22526 if (mem_base != xmlMemBlocks()) { 22527 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve", 22528 xmlMemBlocks() - mem_base); 22529 test_ret++; 22530 printf(" %d", n_cur); 22531 printf("\n"); 22532 } 22533 } 22534 function_tests++; 22535 22536 return(test_ret); 22537 } 22538 22539 22540 static int 22541 test_xmlNodeIsText(void) { 22542 int test_ret = 0; 22543 22544 int mem_base; 22545 int ret_val; 22546 xmlNode * node; /* the node */ 22547 int n_node; 22548 22549 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) { 22550 mem_base = xmlMemBlocks(); 22551 node = gen_const_xmlNode_ptr(n_node, 0); 22552 22553 ret_val = xmlNodeIsText((const xmlNode *)node); 22554 desret_int(ret_val); 22555 call_tests++; 22556 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0); 22557 xmlResetLastError(); 22558 if (mem_base != xmlMemBlocks()) { 22559 printf("Leak of %d blocks found in xmlNodeIsText", 22560 xmlMemBlocks() - mem_base); 22561 test_ret++; 22562 printf(" %d", n_node); 22563 printf("\n"); 22564 } 22565 } 22566 function_tests++; 22567 22568 return(test_ret); 22569 } 22570 22571 22572 static int 22573 test_xmlNodeListGetRawString(void) { 22574 int test_ret = 0; 22575 22576 #if defined(LIBXML_TREE_ENABLED) 22577 int mem_base; 22578 xmlChar * ret_val; 22579 xmlDoc * doc; /* the document */ 22580 int n_doc; 22581 xmlNode * list; /* a Node list */ 22582 int n_list; 22583 int inLine; /* should we replace entity contents or show their external form */ 22584 int n_inLine; 22585 22586 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 22587 for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) { 22588 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { 22589 mem_base = xmlMemBlocks(); 22590 doc = gen_const_xmlDoc_ptr(n_doc, 0); 22591 list = gen_const_xmlNode_ptr(n_list, 1); 22592 inLine = gen_int(n_inLine, 2); 22593 22594 ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine); 22595 desret_xmlChar_ptr(ret_val); 22596 call_tests++; 22597 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 22598 des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1); 22599 des_int(n_inLine, inLine, 2); 22600 xmlResetLastError(); 22601 if (mem_base != xmlMemBlocks()) { 22602 printf("Leak of %d blocks found in xmlNodeListGetRawString", 22603 xmlMemBlocks() - mem_base); 22604 test_ret++; 22605 printf(" %d", n_doc); 22606 printf(" %d", n_list); 22607 printf(" %d", n_inLine); 22608 printf("\n"); 22609 } 22610 } 22611 } 22612 } 22613 function_tests++; 22614 #endif 22615 22616 return(test_ret); 22617 } 22618 22619 22620 static int 22621 test_xmlNodeListGetString(void) { 22622 int test_ret = 0; 22623 22624 int mem_base; 22625 xmlChar * ret_val; 22626 xmlDocPtr doc; /* the document */ 22627 int n_doc; 22628 xmlNode * list; /* a Node list */ 22629 int n_list; 22630 int inLine; /* should we replace entity contents or show their external form */ 22631 int n_inLine; 22632 22633 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22634 for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) { 22635 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { 22636 mem_base = xmlMemBlocks(); 22637 doc = gen_xmlDocPtr(n_doc, 0); 22638 list = gen_const_xmlNode_ptr(n_list, 1); 22639 inLine = gen_int(n_inLine, 2); 22640 22641 ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine); 22642 desret_xmlChar_ptr(ret_val); 22643 call_tests++; 22644 des_xmlDocPtr(n_doc, doc, 0); 22645 des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1); 22646 des_int(n_inLine, inLine, 2); 22647 xmlResetLastError(); 22648 if (mem_base != xmlMemBlocks()) { 22649 printf("Leak of %d blocks found in xmlNodeListGetString", 22650 xmlMemBlocks() - mem_base); 22651 test_ret++; 22652 printf(" %d", n_doc); 22653 printf(" %d", n_list); 22654 printf(" %d", n_inLine); 22655 printf("\n"); 22656 } 22657 } 22658 } 22659 } 22660 function_tests++; 22661 22662 return(test_ret); 22663 } 22664 22665 22666 static int 22667 test_xmlNodeSetBase(void) { 22668 int test_ret = 0; 22669 22670 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) 22671 int mem_base; 22672 xmlNodePtr cur; /* the node being changed */ 22673 int n_cur; 22674 xmlChar * uri; /* the new base URI */ 22675 int n_uri; 22676 22677 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22678 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) { 22679 mem_base = xmlMemBlocks(); 22680 cur = gen_xmlNodePtr(n_cur, 0); 22681 uri = gen_const_xmlChar_ptr(n_uri, 1); 22682 22683 xmlNodeSetBase(cur, (const xmlChar *)uri); 22684 call_tests++; 22685 des_xmlNodePtr(n_cur, cur, 0); 22686 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1); 22687 xmlResetLastError(); 22688 if (mem_base != xmlMemBlocks()) { 22689 printf("Leak of %d blocks found in xmlNodeSetBase", 22690 xmlMemBlocks() - mem_base); 22691 test_ret++; 22692 printf(" %d", n_cur); 22693 printf(" %d", n_uri); 22694 printf("\n"); 22695 } 22696 } 22697 } 22698 function_tests++; 22699 #endif 22700 22701 return(test_ret); 22702 } 22703 22704 22705 static int 22706 test_xmlNodeSetContent(void) { 22707 int test_ret = 0; 22708 22709 int mem_base; 22710 xmlNodePtr cur; /* the node being modified */ 22711 int n_cur; 22712 xmlChar * content; /* the new value of the content */ 22713 int n_content; 22714 22715 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22716 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22717 mem_base = xmlMemBlocks(); 22718 cur = gen_xmlNodePtr(n_cur, 0); 22719 content = gen_const_xmlChar_ptr(n_content, 1); 22720 22721 xmlNodeSetContent(cur, (const xmlChar *)content); 22722 call_tests++; 22723 des_xmlNodePtr(n_cur, cur, 0); 22724 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22725 xmlResetLastError(); 22726 if (mem_base != xmlMemBlocks()) { 22727 printf("Leak of %d blocks found in xmlNodeSetContent", 22728 xmlMemBlocks() - mem_base); 22729 test_ret++; 22730 printf(" %d", n_cur); 22731 printf(" %d", n_content); 22732 printf("\n"); 22733 } 22734 } 22735 } 22736 function_tests++; 22737 22738 return(test_ret); 22739 } 22740 22741 22742 static int 22743 test_xmlNodeSetContentLen(void) { 22744 int test_ret = 0; 22745 22746 #if defined(LIBXML_TREE_ENABLED) 22747 int mem_base; 22748 xmlNodePtr cur; /* the node being modified */ 22749 int n_cur; 22750 xmlChar * content; /* the new value of the content */ 22751 int n_content; 22752 int len; /* the size of @content */ 22753 int n_len; 22754 22755 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22756 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22757 for (n_len = 0;n_len < gen_nb_int;n_len++) { 22758 mem_base = xmlMemBlocks(); 22759 cur = gen_xmlNodePtr(n_cur, 0); 22760 content = gen_const_xmlChar_ptr(n_content, 1); 22761 len = gen_int(n_len, 2); 22762 22763 xmlNodeSetContentLen(cur, (const xmlChar *)content, len); 22764 call_tests++; 22765 des_xmlNodePtr(n_cur, cur, 0); 22766 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22767 des_int(n_len, len, 2); 22768 xmlResetLastError(); 22769 if (mem_base != xmlMemBlocks()) { 22770 printf("Leak of %d blocks found in xmlNodeSetContentLen", 22771 xmlMemBlocks() - mem_base); 22772 test_ret++; 22773 printf(" %d", n_cur); 22774 printf(" %d", n_content); 22775 printf(" %d", n_len); 22776 printf("\n"); 22777 } 22778 } 22779 } 22780 } 22781 function_tests++; 22782 #endif 22783 22784 return(test_ret); 22785 } 22786 22787 22788 static int 22789 test_xmlNodeSetLang(void) { 22790 int test_ret = 0; 22791 22792 #if defined(LIBXML_TREE_ENABLED) 22793 int mem_base; 22794 xmlNodePtr cur; /* the node being changed */ 22795 int n_cur; 22796 xmlChar * lang; /* the language description */ 22797 int n_lang; 22798 22799 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22800 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { 22801 mem_base = xmlMemBlocks(); 22802 cur = gen_xmlNodePtr(n_cur, 0); 22803 lang = gen_const_xmlChar_ptr(n_lang, 1); 22804 22805 xmlNodeSetLang(cur, (const xmlChar *)lang); 22806 call_tests++; 22807 des_xmlNodePtr(n_cur, cur, 0); 22808 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1); 22809 xmlResetLastError(); 22810 if (mem_base != xmlMemBlocks()) { 22811 printf("Leak of %d blocks found in xmlNodeSetLang", 22812 xmlMemBlocks() - mem_base); 22813 test_ret++; 22814 printf(" %d", n_cur); 22815 printf(" %d", n_lang); 22816 printf("\n"); 22817 } 22818 } 22819 } 22820 function_tests++; 22821 #endif 22822 22823 return(test_ret); 22824 } 22825 22826 22827 static int 22828 test_xmlNodeSetName(void) { 22829 int test_ret = 0; 22830 22831 #if defined(LIBXML_TREE_ENABLED) 22832 int mem_base; 22833 xmlNodePtr cur; /* the node being changed */ 22834 int n_cur; 22835 xmlChar * name; /* the new tag name */ 22836 int n_name; 22837 22838 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22839 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 22840 mem_base = xmlMemBlocks(); 22841 cur = gen_xmlNodePtr(n_cur, 0); 22842 name = gen_const_xmlChar_ptr(n_name, 1); 22843 22844 xmlNodeSetName(cur, (const xmlChar *)name); 22845 call_tests++; 22846 des_xmlNodePtr(n_cur, cur, 0); 22847 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 22848 xmlResetLastError(); 22849 if (mem_base != xmlMemBlocks()) { 22850 printf("Leak of %d blocks found in xmlNodeSetName", 22851 xmlMemBlocks() - mem_base); 22852 test_ret++; 22853 printf(" %d", n_cur); 22854 printf(" %d", n_name); 22855 printf("\n"); 22856 } 22857 } 22858 } 22859 function_tests++; 22860 #endif 22861 22862 return(test_ret); 22863 } 22864 22865 22866 static int 22867 test_xmlNodeSetSpacePreserve(void) { 22868 int test_ret = 0; 22869 22870 #if defined(LIBXML_TREE_ENABLED) 22871 int mem_base; 22872 xmlNodePtr cur; /* the node being changed */ 22873 int n_cur; 22874 int val; /* the xml:space value ("0": default, 1: "preserve") */ 22875 int n_val; 22876 22877 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22878 for (n_val = 0;n_val < gen_nb_int;n_val++) { 22879 mem_base = xmlMemBlocks(); 22880 cur = gen_xmlNodePtr(n_cur, 0); 22881 val = gen_int(n_val, 1); 22882 22883 xmlNodeSetSpacePreserve(cur, val); 22884 call_tests++; 22885 des_xmlNodePtr(n_cur, cur, 0); 22886 des_int(n_val, val, 1); 22887 xmlResetLastError(); 22888 if (mem_base != xmlMemBlocks()) { 22889 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve", 22890 xmlMemBlocks() - mem_base); 22891 test_ret++; 22892 printf(" %d", n_cur); 22893 printf(" %d", n_val); 22894 printf("\n"); 22895 } 22896 } 22897 } 22898 function_tests++; 22899 #endif 22900 22901 return(test_ret); 22902 } 22903 22904 22905 static int 22906 test_xmlPreviousElementSibling(void) { 22907 int test_ret = 0; 22908 22909 #if defined(LIBXML_TREE_ENABLED) 22910 int mem_base; 22911 xmlNodePtr ret_val; 22912 xmlNodePtr node; /* the current node */ 22913 int n_node; 22914 22915 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 22916 mem_base = xmlMemBlocks(); 22917 node = gen_xmlNodePtr(n_node, 0); 22918 22919 ret_val = xmlPreviousElementSibling(node); 22920 desret_xmlNodePtr(ret_val); 22921 call_tests++; 22922 des_xmlNodePtr(n_node, node, 0); 22923 xmlResetLastError(); 22924 if (mem_base != xmlMemBlocks()) { 22925 printf("Leak of %d blocks found in xmlPreviousElementSibling", 22926 xmlMemBlocks() - mem_base); 22927 test_ret++; 22928 printf(" %d", n_node); 22929 printf("\n"); 22930 } 22931 } 22932 function_tests++; 22933 #endif 22934 22935 return(test_ret); 22936 } 22937 22938 22939 static int 22940 test_xmlReconciliateNs(void) { 22941 int test_ret = 0; 22942 22943 #if defined(LIBXML_TREE_ENABLED) 22944 #ifdef LIBXML_TREE_ENABLED 22945 int mem_base; 22946 int ret_val; 22947 xmlDocPtr doc; /* the document */ 22948 int n_doc; 22949 xmlNodePtr tree; /* a node defining the subtree to reconciliate */ 22950 int n_tree; 22951 22952 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22953 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 22954 mem_base = xmlMemBlocks(); 22955 doc = gen_xmlDocPtr(n_doc, 0); 22956 tree = gen_xmlNodePtr(n_tree, 1); 22957 22958 ret_val = xmlReconciliateNs(doc, tree); 22959 desret_int(ret_val); 22960 call_tests++; 22961 des_xmlDocPtr(n_doc, doc, 0); 22962 des_xmlNodePtr(n_tree, tree, 1); 22963 xmlResetLastError(); 22964 if (mem_base != xmlMemBlocks()) { 22965 printf("Leak of %d blocks found in xmlReconciliateNs", 22966 xmlMemBlocks() - mem_base); 22967 test_ret++; 22968 printf(" %d", n_doc); 22969 printf(" %d", n_tree); 22970 printf("\n"); 22971 } 22972 } 22973 } 22974 function_tests++; 22975 #endif 22976 #endif 22977 22978 return(test_ret); 22979 } 22980 22981 22982 static int 22983 test_xmlRemoveProp(void) { 22984 int test_ret = 0; 22985 22986 int mem_base; 22987 int ret_val; 22988 xmlAttrPtr cur; /* an attribute */ 22989 int n_cur; 22990 22991 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { 22992 mem_base = xmlMemBlocks(); 22993 cur = gen_xmlAttrPtr(n_cur, 0); 22994 22995 ret_val = xmlRemoveProp(cur); 22996 cur = NULL; 22997 desret_int(ret_val); 22998 call_tests++; 22999 des_xmlAttrPtr(n_cur, cur, 0); 23000 xmlResetLastError(); 23001 if (mem_base != xmlMemBlocks()) { 23002 printf("Leak of %d blocks found in xmlRemoveProp", 23003 xmlMemBlocks() - mem_base); 23004 test_ret++; 23005 printf(" %d", n_cur); 23006 printf("\n"); 23007 } 23008 } 23009 function_tests++; 23010 23011 return(test_ret); 23012 } 23013 23014 23015 static int 23016 test_xmlReplaceNode(void) { 23017 int test_ret = 0; 23018 23019 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) 23020 int mem_base; 23021 xmlNodePtr ret_val; 23022 xmlNodePtr old; /* the old node */ 23023 int n_old; 23024 xmlNodePtr cur; /* the node */ 23025 int n_cur; 23026 23027 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) { 23028 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { 23029 mem_base = xmlMemBlocks(); 23030 old = gen_xmlNodePtr(n_old, 0); 23031 cur = gen_xmlNodePtr_in(n_cur, 1); 23032 23033 ret_val = xmlReplaceNode(old, cur); 23034 if (cur != NULL) { 23035 xmlUnlinkNode(cur); 23036 xmlFreeNode(cur) ; cur = NULL ; } 23037 if (old != NULL) { 23038 xmlUnlinkNode(old); 23039 xmlFreeNode(old) ; old = NULL ; } 23040 ret_val = NULL; 23041 desret_xmlNodePtr(ret_val); 23042 call_tests++; 23043 des_xmlNodePtr(n_old, old, 0); 23044 des_xmlNodePtr_in(n_cur, cur, 1); 23045 xmlResetLastError(); 23046 if (mem_base != xmlMemBlocks()) { 23047 printf("Leak of %d blocks found in xmlReplaceNode", 23048 xmlMemBlocks() - mem_base); 23049 test_ret++; 23050 printf(" %d", n_old); 23051 printf(" %d", n_cur); 23052 printf("\n"); 23053 } 23054 } 23055 } 23056 function_tests++; 23057 #endif 23058 23059 return(test_ret); 23060 } 23061 23062 23063 static int 23064 test_xmlSaveFile(void) { 23065 int test_ret = 0; 23066 23067 #if defined(LIBXML_OUTPUT_ENABLED) 23068 int mem_base; 23069 int ret_val; 23070 const char * filename; /* the filename (or URL) */ 23071 int n_filename; 23072 xmlDocPtr cur; /* the document */ 23073 int n_cur; 23074 23075 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 23076 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23077 mem_base = xmlMemBlocks(); 23078 filename = gen_fileoutput(n_filename, 0); 23079 cur = gen_xmlDocPtr(n_cur, 1); 23080 23081 ret_val = xmlSaveFile(filename, cur); 23082 desret_int(ret_val); 23083 call_tests++; 23084 des_fileoutput(n_filename, filename, 0); 23085 des_xmlDocPtr(n_cur, cur, 1); 23086 xmlResetLastError(); 23087 if (mem_base != xmlMemBlocks()) { 23088 printf("Leak of %d blocks found in xmlSaveFile", 23089 xmlMemBlocks() - mem_base); 23090 test_ret++; 23091 printf(" %d", n_filename); 23092 printf(" %d", n_cur); 23093 printf("\n"); 23094 } 23095 } 23096 } 23097 function_tests++; 23098 #endif 23099 23100 return(test_ret); 23101 } 23102 23103 23104 static int 23105 test_xmlSaveFileEnc(void) { 23106 int test_ret = 0; 23107 23108 #if defined(LIBXML_OUTPUT_ENABLED) 23109 int mem_base; 23110 int ret_val; 23111 const char * filename; /* the filename (or URL) */ 23112 int n_filename; 23113 xmlDocPtr cur; /* the document */ 23114 int n_cur; 23115 char * encoding; /* the name of an encoding (or NULL) */ 23116 int n_encoding; 23117 23118 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 23119 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23120 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 23121 mem_base = xmlMemBlocks(); 23122 filename = gen_fileoutput(n_filename, 0); 23123 cur = gen_xmlDocPtr(n_cur, 1); 23124 encoding = gen_const_char_ptr(n_encoding, 2); 23125 23126 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding); 23127 desret_int(ret_val); 23128 call_tests++; 23129 des_fileoutput(n_filename, filename, 0); 23130 des_xmlDocPtr(n_cur, cur, 1); 23131 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 23132 xmlResetLastError(); 23133 if (mem_base != xmlMemBlocks()) { 23134 printf("Leak of %d blocks found in xmlSaveFileEnc", 23135 xmlMemBlocks() - mem_base); 23136 test_ret++; 23137 printf(" %d", n_filename); 23138 printf(" %d", n_cur); 23139 printf(" %d", n_encoding); 23140 printf("\n"); 23141 } 23142 } 23143 } 23144 } 23145 function_tests++; 23146 #endif 23147 23148 return(test_ret); 23149 } 23150 23151 23152 static int 23153 test_xmlSaveFileTo(void) { 23154 int test_ret = 0; 23155 23156 #if defined(LIBXML_OUTPUT_ENABLED) 23157 int mem_base; 23158 int ret_val; 23159 xmlOutputBufferPtr buf; /* an output I/O buffer */ 23160 int n_buf; 23161 xmlDocPtr cur; /* the document */ 23162 int n_cur; 23163 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ 23164 int n_encoding; 23165 23166 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 23167 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23168 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 23169 mem_base = xmlMemBlocks(); 23170 buf = gen_xmlOutputBufferPtr(n_buf, 0); 23171 cur = gen_xmlDocPtr(n_cur, 1); 23172 encoding = gen_const_char_ptr(n_encoding, 2); 23173 23174 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding); 23175 buf = NULL; 23176 desret_int(ret_val); 23177 call_tests++; 23178 des_xmlOutputBufferPtr(n_buf, buf, 0); 23179 des_xmlDocPtr(n_cur, cur, 1); 23180 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 23181 xmlResetLastError(); 23182 if (mem_base != xmlMemBlocks()) { 23183 printf("Leak of %d blocks found in xmlSaveFileTo", 23184 xmlMemBlocks() - mem_base); 23185 test_ret++; 23186 printf(" %d", n_buf); 23187 printf(" %d", n_cur); 23188 printf(" %d", n_encoding); 23189 printf("\n"); 23190 } 23191 } 23192 } 23193 } 23194 function_tests++; 23195 #endif 23196 23197 return(test_ret); 23198 } 23199 23200 23201 static int 23202 test_xmlSaveFormatFile(void) { 23203 int test_ret = 0; 23204 23205 #if defined(LIBXML_OUTPUT_ENABLED) 23206 int mem_base; 23207 int ret_val; 23208 const char * filename; /* the filename (or URL) */ 23209 int n_filename; 23210 xmlDocPtr cur; /* the document */ 23211 int n_cur; 23212 int format; /* should formatting spaces been added */ 23213 int n_format; 23214 23215 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 23216 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23217 for (n_format = 0;n_format < gen_nb_int;n_format++) { 23218 mem_base = xmlMemBlocks(); 23219 filename = gen_fileoutput(n_filename, 0); 23220 cur = gen_xmlDocPtr(n_cur, 1); 23221 format = gen_int(n_format, 2); 23222 23223 ret_val = xmlSaveFormatFile(filename, cur, format); 23224 desret_int(ret_val); 23225 call_tests++; 23226 des_fileoutput(n_filename, filename, 0); 23227 des_xmlDocPtr(n_cur, cur, 1); 23228 des_int(n_format, format, 2); 23229 xmlResetLastError(); 23230 if (mem_base != xmlMemBlocks()) { 23231 printf("Leak of %d blocks found in xmlSaveFormatFile", 23232 xmlMemBlocks() - mem_base); 23233 test_ret++; 23234 printf(" %d", n_filename); 23235 printf(" %d", n_cur); 23236 printf(" %d", n_format); 23237 printf("\n"); 23238 } 23239 } 23240 } 23241 } 23242 function_tests++; 23243 #endif 23244 23245 return(test_ret); 23246 } 23247 23248 23249 static int 23250 test_xmlSaveFormatFileEnc(void) { 23251 int test_ret = 0; 23252 23253 #if defined(LIBXML_OUTPUT_ENABLED) 23254 int mem_base; 23255 int ret_val; 23256 const char * filename; /* the filename or URL to output */ 23257 int n_filename; 23258 xmlDocPtr cur; /* the document being saved */ 23259 int n_cur; 23260 char * encoding; /* the name of the encoding to use or NULL. */ 23261 int n_encoding; 23262 int format; /* should formatting spaces be added. */ 23263 int n_format; 23264 23265 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 23266 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23267 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 23268 for (n_format = 0;n_format < gen_nb_int;n_format++) { 23269 mem_base = xmlMemBlocks(); 23270 filename = gen_fileoutput(n_filename, 0); 23271 cur = gen_xmlDocPtr(n_cur, 1); 23272 encoding = gen_const_char_ptr(n_encoding, 2); 23273 format = gen_int(n_format, 3); 23274 23275 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format); 23276 desret_int(ret_val); 23277 call_tests++; 23278 des_fileoutput(n_filename, filename, 0); 23279 des_xmlDocPtr(n_cur, cur, 1); 23280 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 23281 des_int(n_format, format, 3); 23282 xmlResetLastError(); 23283 if (mem_base != xmlMemBlocks()) { 23284 printf("Leak of %d blocks found in xmlSaveFormatFileEnc", 23285 xmlMemBlocks() - mem_base); 23286 test_ret++; 23287 printf(" %d", n_filename); 23288 printf(" %d", n_cur); 23289 printf(" %d", n_encoding); 23290 printf(" %d", n_format); 23291 printf("\n"); 23292 } 23293 } 23294 } 23295 } 23296 } 23297 function_tests++; 23298 #endif 23299 23300 return(test_ret); 23301 } 23302 23303 23304 static int 23305 test_xmlSaveFormatFileTo(void) { 23306 int test_ret = 0; 23307 23308 #if defined(LIBXML_OUTPUT_ENABLED) 23309 int mem_base; 23310 int ret_val; 23311 xmlOutputBufferPtr buf; /* an output I/O buffer */ 23312 int n_buf; 23313 xmlDocPtr cur; /* the document */ 23314 int n_cur; 23315 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ 23316 int n_encoding; 23317 int format; /* should formatting spaces been added */ 23318 int n_format; 23319 23320 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 23321 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23322 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 23323 for (n_format = 0;n_format < gen_nb_int;n_format++) { 23324 mem_base = xmlMemBlocks(); 23325 buf = gen_xmlOutputBufferPtr(n_buf, 0); 23326 cur = gen_xmlDocPtr(n_cur, 1); 23327 encoding = gen_const_char_ptr(n_encoding, 2); 23328 format = gen_int(n_format, 3); 23329 23330 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format); 23331 buf = NULL; 23332 desret_int(ret_val); 23333 call_tests++; 23334 des_xmlOutputBufferPtr(n_buf, buf, 0); 23335 des_xmlDocPtr(n_cur, cur, 1); 23336 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 23337 des_int(n_format, format, 3); 23338 xmlResetLastError(); 23339 if (mem_base != xmlMemBlocks()) { 23340 printf("Leak of %d blocks found in xmlSaveFormatFileTo", 23341 xmlMemBlocks() - mem_base); 23342 test_ret++; 23343 printf(" %d", n_buf); 23344 printf(" %d", n_cur); 23345 printf(" %d", n_encoding); 23346 printf(" %d", n_format); 23347 printf("\n"); 23348 } 23349 } 23350 } 23351 } 23352 } 23353 function_tests++; 23354 #endif 23355 23356 return(test_ret); 23357 } 23358 23359 23360 static int 23361 test_xmlSearchNs(void) { 23362 int test_ret = 0; 23363 23364 int mem_base; 23365 xmlNsPtr ret_val; 23366 xmlDocPtr doc; /* the document */ 23367 int n_doc; 23368 xmlNodePtr node; /* the current node */ 23369 int n_node; 23370 xmlChar * nameSpace; /* the namespace prefix */ 23371 int n_nameSpace; 23372 23373 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23374 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23375 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { 23376 mem_base = xmlMemBlocks(); 23377 doc = gen_xmlDocPtr(n_doc, 0); 23378 node = gen_xmlNodePtr(n_node, 1); 23379 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); 23380 23381 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace); 23382 desret_xmlNsPtr(ret_val); 23383 call_tests++; 23384 des_xmlDocPtr(n_doc, doc, 0); 23385 des_xmlNodePtr(n_node, node, 1); 23386 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); 23387 xmlResetLastError(); 23388 if (mem_base != xmlMemBlocks()) { 23389 printf("Leak of %d blocks found in xmlSearchNs", 23390 xmlMemBlocks() - mem_base); 23391 test_ret++; 23392 printf(" %d", n_doc); 23393 printf(" %d", n_node); 23394 printf(" %d", n_nameSpace); 23395 printf("\n"); 23396 } 23397 } 23398 } 23399 } 23400 function_tests++; 23401 23402 return(test_ret); 23403 } 23404 23405 23406 static int 23407 test_xmlSearchNsByHref(void) { 23408 int test_ret = 0; 23409 23410 int mem_base; 23411 xmlNsPtr ret_val; 23412 xmlDocPtr doc; /* the document */ 23413 int n_doc; 23414 xmlNodePtr node; /* the current node */ 23415 int n_node; 23416 xmlChar * href; /* the namespace value */ 23417 int n_href; 23418 23419 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23420 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23421 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) { 23422 mem_base = xmlMemBlocks(); 23423 doc = gen_xmlDocPtr(n_doc, 0); 23424 node = gen_xmlNodePtr(n_node, 1); 23425 href = gen_const_xmlChar_ptr(n_href, 2); 23426 23427 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href); 23428 desret_xmlNsPtr(ret_val); 23429 call_tests++; 23430 des_xmlDocPtr(n_doc, doc, 0); 23431 des_xmlNodePtr(n_node, node, 1); 23432 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2); 23433 xmlResetLastError(); 23434 if (mem_base != xmlMemBlocks()) { 23435 printf("Leak of %d blocks found in xmlSearchNsByHref", 23436 xmlMemBlocks() - mem_base); 23437 test_ret++; 23438 printf(" %d", n_doc); 23439 printf(" %d", n_node); 23440 printf(" %d", n_href); 23441 printf("\n"); 23442 } 23443 } 23444 } 23445 } 23446 function_tests++; 23447 23448 return(test_ret); 23449 } 23450 23451 23452 static int 23453 test_xmlSetBufferAllocationScheme(void) { 23454 int test_ret = 0; 23455 23456 int mem_base; 23457 xmlBufferAllocationScheme scheme; /* allocation method to use */ 23458 int n_scheme; 23459 23460 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) { 23461 mem_base = xmlMemBlocks(); 23462 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0); 23463 23464 xmlSetBufferAllocationScheme(scheme); 23465 call_tests++; 23466 des_xmlBufferAllocationScheme(n_scheme, scheme, 0); 23467 xmlResetLastError(); 23468 if (mem_base != xmlMemBlocks()) { 23469 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme", 23470 xmlMemBlocks() - mem_base); 23471 test_ret++; 23472 printf(" %d", n_scheme); 23473 printf("\n"); 23474 } 23475 } 23476 function_tests++; 23477 23478 return(test_ret); 23479 } 23480 23481 23482 static int 23483 test_xmlSetCompressMode(void) { 23484 int test_ret = 0; 23485 23486 int mem_base; 23487 int mode; /* the compression ratio */ 23488 int n_mode; 23489 23490 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 23491 mem_base = xmlMemBlocks(); 23492 mode = gen_int(n_mode, 0); 23493 23494 xmlSetCompressMode(mode); 23495 call_tests++; 23496 des_int(n_mode, mode, 0); 23497 xmlResetLastError(); 23498 if (mem_base != xmlMemBlocks()) { 23499 printf("Leak of %d blocks found in xmlSetCompressMode", 23500 xmlMemBlocks() - mem_base); 23501 test_ret++; 23502 printf(" %d", n_mode); 23503 printf("\n"); 23504 } 23505 } 23506 function_tests++; 23507 23508 return(test_ret); 23509 } 23510 23511 23512 static int 23513 test_xmlSetDocCompressMode(void) { 23514 int test_ret = 0; 23515 23516 int mem_base; 23517 xmlDocPtr doc; /* the document */ 23518 int n_doc; 23519 int mode; /* the compression ratio */ 23520 int n_mode; 23521 23522 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23523 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 23524 mem_base = xmlMemBlocks(); 23525 doc = gen_xmlDocPtr(n_doc, 0); 23526 mode = gen_int(n_mode, 1); 23527 23528 xmlSetDocCompressMode(doc, mode); 23529 call_tests++; 23530 des_xmlDocPtr(n_doc, doc, 0); 23531 des_int(n_mode, mode, 1); 23532 xmlResetLastError(); 23533 if (mem_base != xmlMemBlocks()) { 23534 printf("Leak of %d blocks found in xmlSetDocCompressMode", 23535 xmlMemBlocks() - mem_base); 23536 test_ret++; 23537 printf(" %d", n_doc); 23538 printf(" %d", n_mode); 23539 printf("\n"); 23540 } 23541 } 23542 } 23543 function_tests++; 23544 23545 return(test_ret); 23546 } 23547 23548 23549 static int 23550 test_xmlSetNs(void) { 23551 int test_ret = 0; 23552 23553 int mem_base; 23554 xmlNodePtr node; /* a node in the document */ 23555 int n_node; 23556 xmlNsPtr ns; /* a namespace pointer */ 23557 int n_ns; 23558 23559 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23560 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 23561 mem_base = xmlMemBlocks(); 23562 node = gen_xmlNodePtr(n_node, 0); 23563 ns = gen_xmlNsPtr(n_ns, 1); 23564 23565 xmlSetNs(node, ns); 23566 call_tests++; 23567 des_xmlNodePtr(n_node, node, 0); 23568 des_xmlNsPtr(n_ns, ns, 1); 23569 xmlResetLastError(); 23570 if (mem_base != xmlMemBlocks()) { 23571 printf("Leak of %d blocks found in xmlSetNs", 23572 xmlMemBlocks() - mem_base); 23573 test_ret++; 23574 printf(" %d", n_node); 23575 printf(" %d", n_ns); 23576 printf("\n"); 23577 } 23578 } 23579 } 23580 function_tests++; 23581 23582 return(test_ret); 23583 } 23584 23585 23586 static int 23587 test_xmlSetNsProp(void) { 23588 int test_ret = 0; 23589 23590 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) 23591 int mem_base; 23592 xmlAttrPtr ret_val; 23593 xmlNodePtr node; /* the node */ 23594 int n_node; 23595 xmlNsPtr ns; /* the namespace definition */ 23596 int n_ns; 23597 xmlChar * name; /* the attribute name */ 23598 int n_name; 23599 xmlChar * value; /* the attribute value */ 23600 int n_value; 23601 23602 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23603 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 23604 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23605 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23606 mem_base = xmlMemBlocks(); 23607 node = gen_xmlNodePtr(n_node, 0); 23608 ns = gen_xmlNsPtr(n_ns, 1); 23609 name = gen_const_xmlChar_ptr(n_name, 2); 23610 value = gen_const_xmlChar_ptr(n_value, 3); 23611 23612 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value); 23613 desret_xmlAttrPtr(ret_val); 23614 call_tests++; 23615 des_xmlNodePtr(n_node, node, 0); 23616 des_xmlNsPtr(n_ns, ns, 1); 23617 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 23618 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 23619 xmlResetLastError(); 23620 if (mem_base != xmlMemBlocks()) { 23621 printf("Leak of %d blocks found in xmlSetNsProp", 23622 xmlMemBlocks() - mem_base); 23623 test_ret++; 23624 printf(" %d", n_node); 23625 printf(" %d", n_ns); 23626 printf(" %d", n_name); 23627 printf(" %d", n_value); 23628 printf("\n"); 23629 } 23630 } 23631 } 23632 } 23633 } 23634 function_tests++; 23635 #endif 23636 23637 return(test_ret); 23638 } 23639 23640 23641 static int 23642 test_xmlSetProp(void) { 23643 int test_ret = 0; 23644 23645 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) 23646 int mem_base; 23647 xmlAttrPtr ret_val; 23648 xmlNodePtr node; /* the node */ 23649 int n_node; 23650 xmlChar * name; /* the attribute name (a QName) */ 23651 int n_name; 23652 xmlChar * value; /* the attribute value */ 23653 int n_value; 23654 23655 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23656 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23657 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23658 mem_base = xmlMemBlocks(); 23659 node = gen_xmlNodePtr(n_node, 0); 23660 name = gen_const_xmlChar_ptr(n_name, 1); 23661 value = gen_const_xmlChar_ptr(n_value, 2); 23662 23663 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value); 23664 desret_xmlAttrPtr(ret_val); 23665 call_tests++; 23666 des_xmlNodePtr(n_node, node, 0); 23667 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 23668 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); 23669 xmlResetLastError(); 23670 if (mem_base != xmlMemBlocks()) { 23671 printf("Leak of %d blocks found in xmlSetProp", 23672 xmlMemBlocks() - mem_base); 23673 test_ret++; 23674 printf(" %d", n_node); 23675 printf(" %d", n_name); 23676 printf(" %d", n_value); 23677 printf("\n"); 23678 } 23679 } 23680 } 23681 } 23682 function_tests++; 23683 #endif 23684 23685 return(test_ret); 23686 } 23687 23688 23689 static int 23690 test_xmlSplitQName2(void) { 23691 int test_ret = 0; 23692 23693 int mem_base; 23694 xmlChar * ret_val; 23695 xmlChar * name; /* the full QName */ 23696 int n_name; 23697 xmlChar ** prefix; /* a xmlChar ** */ 23698 int n_prefix; 23699 23700 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23701 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) { 23702 mem_base = xmlMemBlocks(); 23703 name = gen_const_xmlChar_ptr(n_name, 0); 23704 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1); 23705 23706 ret_val = xmlSplitQName2((const xmlChar *)name, prefix); 23707 desret_xmlChar_ptr(ret_val); 23708 call_tests++; 23709 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 23710 des_xmlChar_ptr_ptr(n_prefix, prefix, 1); 23711 xmlResetLastError(); 23712 if (mem_base != xmlMemBlocks()) { 23713 printf("Leak of %d blocks found in xmlSplitQName2", 23714 xmlMemBlocks() - mem_base); 23715 test_ret++; 23716 printf(" %d", n_name); 23717 printf(" %d", n_prefix); 23718 printf("\n"); 23719 } 23720 } 23721 } 23722 function_tests++; 23723 23724 return(test_ret); 23725 } 23726 23727 23728 static int 23729 test_xmlSplitQName3(void) { 23730 int test_ret = 0; 23731 23732 int mem_base; 23733 const xmlChar * ret_val; 23734 xmlChar * name; /* the full QName */ 23735 int n_name; 23736 int * len; /* an int * */ 23737 int n_len; 23738 23739 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23740 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 23741 mem_base = xmlMemBlocks(); 23742 name = gen_const_xmlChar_ptr(n_name, 0); 23743 len = gen_int_ptr(n_len, 1); 23744 23745 ret_val = xmlSplitQName3((const xmlChar *)name, len); 23746 desret_const_xmlChar_ptr(ret_val); 23747 call_tests++; 23748 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 23749 des_int_ptr(n_len, len, 1); 23750 xmlResetLastError(); 23751 if (mem_base != xmlMemBlocks()) { 23752 printf("Leak of %d blocks found in xmlSplitQName3", 23753 xmlMemBlocks() - mem_base); 23754 test_ret++; 23755 printf(" %d", n_name); 23756 printf(" %d", n_len); 23757 printf("\n"); 23758 } 23759 } 23760 } 23761 function_tests++; 23762 23763 return(test_ret); 23764 } 23765 23766 23767 static int 23768 test_xmlStringGetNodeList(void) { 23769 int test_ret = 0; 23770 23771 int mem_base; 23772 xmlNodePtr ret_val; 23773 xmlDoc * doc; /* the document */ 23774 int n_doc; 23775 xmlChar * value; /* the value of the attribute */ 23776 int n_value; 23777 23778 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 23779 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23780 mem_base = xmlMemBlocks(); 23781 doc = gen_const_xmlDoc_ptr(n_doc, 0); 23782 value = gen_const_xmlChar_ptr(n_value, 1); 23783 23784 ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value); 23785 desret_xmlNodePtr(ret_val); 23786 call_tests++; 23787 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 23788 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 23789 xmlResetLastError(); 23790 if (mem_base != xmlMemBlocks()) { 23791 printf("Leak of %d blocks found in xmlStringGetNodeList", 23792 xmlMemBlocks() - mem_base); 23793 test_ret++; 23794 printf(" %d", n_doc); 23795 printf(" %d", n_value); 23796 printf("\n"); 23797 } 23798 } 23799 } 23800 function_tests++; 23801 23802 return(test_ret); 23803 } 23804 23805 23806 static int 23807 test_xmlStringLenGetNodeList(void) { 23808 int test_ret = 0; 23809 23810 int mem_base; 23811 xmlNodePtr ret_val; 23812 xmlDoc * doc; /* the document */ 23813 int n_doc; 23814 xmlChar * value; /* the value of the text */ 23815 int n_value; 23816 int len; /* the length of the string value */ 23817 int n_len; 23818 23819 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) { 23820 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23821 for (n_len = 0;n_len < gen_nb_int;n_len++) { 23822 mem_base = xmlMemBlocks(); 23823 doc = gen_const_xmlDoc_ptr(n_doc, 0); 23824 value = gen_const_xmlChar_ptr(n_value, 1); 23825 len = gen_int(n_len, 2); 23826 23827 ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len); 23828 desret_xmlNodePtr(ret_val); 23829 call_tests++; 23830 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0); 23831 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 23832 des_int(n_len, len, 2); 23833 xmlResetLastError(); 23834 if (mem_base != xmlMemBlocks()) { 23835 printf("Leak of %d blocks found in xmlStringLenGetNodeList", 23836 xmlMemBlocks() - mem_base); 23837 test_ret++; 23838 printf(" %d", n_doc); 23839 printf(" %d", n_value); 23840 printf(" %d", n_len); 23841 printf("\n"); 23842 } 23843 } 23844 } 23845 } 23846 function_tests++; 23847 23848 return(test_ret); 23849 } 23850 23851 23852 static int 23853 test_xmlTextConcat(void) { 23854 int test_ret = 0; 23855 23856 int mem_base; 23857 int ret_val; 23858 xmlNodePtr node; /* the node */ 23859 int n_node; 23860 xmlChar * content; /* the content */ 23861 int n_content; 23862 int len; /* @content length */ 23863 int n_len; 23864 23865 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23866 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 23867 for (n_len = 0;n_len < gen_nb_int;n_len++) { 23868 mem_base = xmlMemBlocks(); 23869 node = gen_xmlNodePtr(n_node, 0); 23870 content = gen_const_xmlChar_ptr(n_content, 1); 23871 len = gen_int(n_len, 2); 23872 23873 ret_val = xmlTextConcat(node, (const xmlChar *)content, len); 23874 desret_int(ret_val); 23875 call_tests++; 23876 des_xmlNodePtr(n_node, node, 0); 23877 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 23878 des_int(n_len, len, 2); 23879 xmlResetLastError(); 23880 if (mem_base != xmlMemBlocks()) { 23881 printf("Leak of %d blocks found in xmlTextConcat", 23882 xmlMemBlocks() - mem_base); 23883 test_ret++; 23884 printf(" %d", n_node); 23885 printf(" %d", n_content); 23886 printf(" %d", n_len); 23887 printf("\n"); 23888 } 23889 } 23890 } 23891 } 23892 function_tests++; 23893 23894 return(test_ret); 23895 } 23896 23897 23898 static int 23899 test_xmlTextMerge(void) { 23900 int test_ret = 0; 23901 23902 int mem_base; 23903 xmlNodePtr ret_val; 23904 xmlNodePtr first; /* the first text node */ 23905 int n_first; 23906 xmlNodePtr second; /* the second text node being merged */ 23907 int n_second; 23908 23909 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) { 23910 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) { 23911 mem_base = xmlMemBlocks(); 23912 first = gen_xmlNodePtr_in(n_first, 0); 23913 second = gen_xmlNodePtr_in(n_second, 1); 23914 23915 ret_val = xmlTextMerge(first, second); 23916 if ((first != NULL) && (first->type != XML_TEXT_NODE)) { 23917 xmlUnlinkNode(second); 23918 xmlFreeNode(second) ; second = NULL ; } 23919 desret_xmlNodePtr(ret_val); 23920 call_tests++; 23921 des_xmlNodePtr_in(n_first, first, 0); 23922 des_xmlNodePtr_in(n_second, second, 1); 23923 xmlResetLastError(); 23924 if (mem_base != xmlMemBlocks()) { 23925 printf("Leak of %d blocks found in xmlTextMerge", 23926 xmlMemBlocks() - mem_base); 23927 test_ret++; 23928 printf(" %d", n_first); 23929 printf(" %d", n_second); 23930 printf("\n"); 23931 } 23932 } 23933 } 23934 function_tests++; 23935 23936 return(test_ret); 23937 } 23938 23939 23940 static int 23941 test_xmlUnsetNsProp(void) { 23942 int test_ret = 0; 23943 23944 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23945 int mem_base; 23946 int ret_val; 23947 xmlNodePtr node; /* the node */ 23948 int n_node; 23949 xmlNsPtr ns; /* the namespace definition */ 23950 int n_ns; 23951 xmlChar * name; /* the attribute name */ 23952 int n_name; 23953 23954 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23955 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 23956 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23957 mem_base = xmlMemBlocks(); 23958 node = gen_xmlNodePtr(n_node, 0); 23959 ns = gen_xmlNsPtr(n_ns, 1); 23960 name = gen_const_xmlChar_ptr(n_name, 2); 23961 23962 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name); 23963 desret_int(ret_val); 23964 call_tests++; 23965 des_xmlNodePtr(n_node, node, 0); 23966 des_xmlNsPtr(n_ns, ns, 1); 23967 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 23968 xmlResetLastError(); 23969 if (mem_base != xmlMemBlocks()) { 23970 printf("Leak of %d blocks found in xmlUnsetNsProp", 23971 xmlMemBlocks() - mem_base); 23972 test_ret++; 23973 printf(" %d", n_node); 23974 printf(" %d", n_ns); 23975 printf(" %d", n_name); 23976 printf("\n"); 23977 } 23978 } 23979 } 23980 } 23981 function_tests++; 23982 #endif 23983 23984 return(test_ret); 23985 } 23986 23987 23988 static int 23989 test_xmlUnsetProp(void) { 23990 int test_ret = 0; 23991 23992 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23993 int mem_base; 23994 int ret_val; 23995 xmlNodePtr node; /* the node */ 23996 int n_node; 23997 xmlChar * name; /* the attribute name */ 23998 int n_name; 23999 24000 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 24001 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 24002 mem_base = xmlMemBlocks(); 24003 node = gen_xmlNodePtr(n_node, 0); 24004 name = gen_const_xmlChar_ptr(n_name, 1); 24005 24006 ret_val = xmlUnsetProp(node, (const xmlChar *)name); 24007 desret_int(ret_val); 24008 call_tests++; 24009 des_xmlNodePtr(n_node, node, 0); 24010 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 24011 xmlResetLastError(); 24012 if (mem_base != xmlMemBlocks()) { 24013 printf("Leak of %d blocks found in xmlUnsetProp", 24014 xmlMemBlocks() - mem_base); 24015 test_ret++; 24016 printf(" %d", n_node); 24017 printf(" %d", n_name); 24018 printf("\n"); 24019 } 24020 } 24021 } 24022 function_tests++; 24023 #endif 24024 24025 return(test_ret); 24026 } 24027 24028 24029 static int 24030 test_xmlValidateNCName(void) { 24031 int test_ret = 0; 24032 24033 #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) 24034 #ifdef LIBXML_TREE_ENABLED 24035 int mem_base; 24036 int ret_val; 24037 xmlChar * value; /* the value to check */ 24038 int n_value; 24039 int space; /* allow spaces in front and end of the string */ 24040 int n_space; 24041 24042 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 24043 for (n_space = 0;n_space < gen_nb_int;n_space++) { 24044 mem_base = xmlMemBlocks(); 24045 value = gen_const_xmlChar_ptr(n_value, 0); 24046 space = gen_int(n_space, 1); 24047 24048 ret_val = xmlValidateNCName((const xmlChar *)value, space); 24049 desret_int(ret_val); 24050 call_tests++; 24051 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 24052 des_int(n_space, space, 1); 24053 xmlResetLastError(); 24054 if (mem_base != xmlMemBlocks()) { 24055 printf("Leak of %d blocks found in xmlValidateNCName", 24056 xmlMemBlocks() - mem_base); 24057 test_ret++; 24058 printf(" %d", n_value); 24059 printf(" %d", n_space); 24060 printf("\n"); 24061 } 24062 } 24063 } 24064 function_tests++; 24065 #endif 24066 #endif 24067 24068 return(test_ret); 24069 } 24070 24071 24072 static int 24073 test_xmlValidateNMToken(void) { 24074 int test_ret = 0; 24075 24076 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 24077 #ifdef LIBXML_TREE_ENABLED 24078 int mem_base; 24079 int ret_val; 24080 xmlChar * value; /* the value to check */ 24081 int n_value; 24082 int space; /* allow spaces in front and end of the string */ 24083 int n_space; 24084 24085 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 24086 for (n_space = 0;n_space < gen_nb_int;n_space++) { 24087 mem_base = xmlMemBlocks(); 24088 value = gen_const_xmlChar_ptr(n_value, 0); 24089 space = gen_int(n_space, 1); 24090 24091 ret_val = xmlValidateNMToken((const xmlChar *)value, space); 24092 desret_int(ret_val); 24093 call_tests++; 24094 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 24095 des_int(n_space, space, 1); 24096 xmlResetLastError(); 24097 if (mem_base != xmlMemBlocks()) { 24098 printf("Leak of %d blocks found in xmlValidateNMToken", 24099 xmlMemBlocks() - mem_base); 24100 test_ret++; 24101 printf(" %d", n_value); 24102 printf(" %d", n_space); 24103 printf("\n"); 24104 } 24105 } 24106 } 24107 function_tests++; 24108 #endif 24109 #endif 24110 24111 return(test_ret); 24112 } 24113 24114 24115 static int 24116 test_xmlValidateName(void) { 24117 int test_ret = 0; 24118 24119 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 24120 #ifdef LIBXML_TREE_ENABLED 24121 int mem_base; 24122 int ret_val; 24123 xmlChar * value; /* the value to check */ 24124 int n_value; 24125 int space; /* allow spaces in front and end of the string */ 24126 int n_space; 24127 24128 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 24129 for (n_space = 0;n_space < gen_nb_int;n_space++) { 24130 mem_base = xmlMemBlocks(); 24131 value = gen_const_xmlChar_ptr(n_value, 0); 24132 space = gen_int(n_space, 1); 24133 24134 ret_val = xmlValidateName((const xmlChar *)value, space); 24135 desret_int(ret_val); 24136 call_tests++; 24137 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 24138 des_int(n_space, space, 1); 24139 xmlResetLastError(); 24140 if (mem_base != xmlMemBlocks()) { 24141 printf("Leak of %d blocks found in xmlValidateName", 24142 xmlMemBlocks() - mem_base); 24143 test_ret++; 24144 printf(" %d", n_value); 24145 printf(" %d", n_space); 24146 printf("\n"); 24147 } 24148 } 24149 } 24150 function_tests++; 24151 #endif 24152 #endif 24153 24154 return(test_ret); 24155 } 24156 24157 24158 static int 24159 test_xmlValidateQName(void) { 24160 int test_ret = 0; 24161 24162 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 24163 #ifdef LIBXML_TREE_ENABLED 24164 int mem_base; 24165 int ret_val; 24166 xmlChar * value; /* the value to check */ 24167 int n_value; 24168 int space; /* allow spaces in front and end of the string */ 24169 int n_space; 24170 24171 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 24172 for (n_space = 0;n_space < gen_nb_int;n_space++) { 24173 mem_base = xmlMemBlocks(); 24174 value = gen_const_xmlChar_ptr(n_value, 0); 24175 space = gen_int(n_space, 1); 24176 24177 ret_val = xmlValidateQName((const xmlChar *)value, space); 24178 desret_int(ret_val); 24179 call_tests++; 24180 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 24181 des_int(n_space, space, 1); 24182 xmlResetLastError(); 24183 if (mem_base != xmlMemBlocks()) { 24184 printf("Leak of %d blocks found in xmlValidateQName", 24185 xmlMemBlocks() - mem_base); 24186 test_ret++; 24187 printf(" %d", n_value); 24188 printf(" %d", n_space); 24189 printf("\n"); 24190 } 24191 } 24192 } 24193 function_tests++; 24194 #endif 24195 #endif 24196 24197 return(test_ret); 24198 } 24199 24200 static int 24201 test_tree(void) { 24202 int test_ret = 0; 24203 24204 if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n"); 24205 test_ret += test_xmlAddChild(); 24206 test_ret += test_xmlAddChildList(); 24207 test_ret += test_xmlAddNextSibling(); 24208 test_ret += test_xmlAddPrevSibling(); 24209 test_ret += test_xmlAddSibling(); 24210 test_ret += test_xmlAttrSerializeTxtContent(); 24211 test_ret += test_xmlBufContent(); 24212 test_ret += test_xmlBufEnd(); 24213 test_ret += test_xmlBufGetNodeContent(); 24214 test_ret += test_xmlBufNodeDump(); 24215 test_ret += test_xmlBufShrink(); 24216 test_ret += test_xmlBufUse(); 24217 test_ret += test_xmlBufferAdd(); 24218 test_ret += test_xmlBufferAddHead(); 24219 test_ret += test_xmlBufferCCat(); 24220 test_ret += test_xmlBufferCat(); 24221 test_ret += test_xmlBufferContent(); 24222 test_ret += test_xmlBufferCreate(); 24223 test_ret += test_xmlBufferCreateSize(); 24224 test_ret += test_xmlBufferCreateStatic(); 24225 test_ret += test_xmlBufferDetach(); 24226 test_ret += test_xmlBufferEmpty(); 24227 test_ret += test_xmlBufferGrow(); 24228 test_ret += test_xmlBufferLength(); 24229 test_ret += test_xmlBufferResize(); 24230 test_ret += test_xmlBufferSetAllocationScheme(); 24231 test_ret += test_xmlBufferShrink(); 24232 test_ret += test_xmlBufferWriteCHAR(); 24233 test_ret += test_xmlBufferWriteChar(); 24234 test_ret += test_xmlBufferWriteQuotedString(); 24235 test_ret += test_xmlBuildQName(); 24236 test_ret += test_xmlChildElementCount(); 24237 test_ret += test_xmlCopyDoc(); 24238 test_ret += test_xmlCopyDtd(); 24239 test_ret += test_xmlCopyNamespace(); 24240 test_ret += test_xmlCopyNamespaceList(); 24241 test_ret += test_xmlCopyNode(); 24242 test_ret += test_xmlCopyNodeList(); 24243 test_ret += test_xmlCopyProp(); 24244 test_ret += test_xmlCopyPropList(); 24245 test_ret += test_xmlCreateIntSubset(); 24246 test_ret += test_xmlDOMWrapAdoptNode(); 24247 test_ret += test_xmlDOMWrapCloneNode(); 24248 test_ret += test_xmlDOMWrapNewCtxt(); 24249 test_ret += test_xmlDOMWrapReconcileNamespaces(); 24250 test_ret += test_xmlDOMWrapRemoveNode(); 24251 test_ret += test_xmlDocCopyNode(); 24252 test_ret += test_xmlDocCopyNodeList(); 24253 test_ret += test_xmlDocDump(); 24254 test_ret += test_xmlDocDumpFormatMemory(); 24255 test_ret += test_xmlDocDumpFormatMemoryEnc(); 24256 test_ret += test_xmlDocDumpMemory(); 24257 test_ret += test_xmlDocDumpMemoryEnc(); 24258 test_ret += test_xmlDocFormatDump(); 24259 test_ret += test_xmlDocGetRootElement(); 24260 test_ret += test_xmlDocSetRootElement(); 24261 test_ret += test_xmlElemDump(); 24262 test_ret += test_xmlFirstElementChild(); 24263 test_ret += test_xmlGetBufferAllocationScheme(); 24264 test_ret += test_xmlGetCompressMode(); 24265 test_ret += test_xmlGetDocCompressMode(); 24266 test_ret += test_xmlGetIntSubset(); 24267 test_ret += test_xmlGetLastChild(); 24268 test_ret += test_xmlGetLineNo(); 24269 test_ret += test_xmlGetNoNsProp(); 24270 test_ret += test_xmlGetNodePath(); 24271 test_ret += test_xmlGetNsList(); 24272 test_ret += test_xmlGetNsProp(); 24273 test_ret += test_xmlGetProp(); 24274 test_ret += test_xmlHasNsProp(); 24275 test_ret += test_xmlHasProp(); 24276 test_ret += test_xmlIsBlankNode(); 24277 test_ret += test_xmlIsXHTML(); 24278 test_ret += test_xmlLastElementChild(); 24279 test_ret += test_xmlNewCDataBlock(); 24280 test_ret += test_xmlNewCharRef(); 24281 test_ret += test_xmlNewChild(); 24282 test_ret += test_xmlNewComment(); 24283 test_ret += test_xmlNewDoc(); 24284 test_ret += test_xmlNewDocComment(); 24285 test_ret += test_xmlNewDocFragment(); 24286 test_ret += test_xmlNewDocNode(); 24287 test_ret += test_xmlNewDocNodeEatName(); 24288 test_ret += test_xmlNewDocPI(); 24289 test_ret += test_xmlNewDocProp(); 24290 test_ret += test_xmlNewDocRawNode(); 24291 test_ret += test_xmlNewDocText(); 24292 test_ret += test_xmlNewDocTextLen(); 24293 test_ret += test_xmlNewDtd(); 24294 test_ret += test_xmlNewNode(); 24295 test_ret += test_xmlNewNodeEatName(); 24296 test_ret += test_xmlNewNs(); 24297 test_ret += test_xmlNewNsProp(); 24298 test_ret += test_xmlNewNsPropEatName(); 24299 test_ret += test_xmlNewPI(); 24300 test_ret += test_xmlNewProp(); 24301 test_ret += test_xmlNewReference(); 24302 test_ret += test_xmlNewText(); 24303 test_ret += test_xmlNewTextChild(); 24304 test_ret += test_xmlNewTextLen(); 24305 test_ret += test_xmlNextElementSibling(); 24306 test_ret += test_xmlNodeAddContent(); 24307 test_ret += test_xmlNodeAddContentLen(); 24308 test_ret += test_xmlNodeBufGetContent(); 24309 test_ret += test_xmlNodeDump(); 24310 test_ret += test_xmlNodeDumpOutput(); 24311 test_ret += test_xmlNodeGetBase(); 24312 test_ret += test_xmlNodeGetContent(); 24313 test_ret += test_xmlNodeGetLang(); 24314 test_ret += test_xmlNodeGetSpacePreserve(); 24315 test_ret += test_xmlNodeIsText(); 24316 test_ret += test_xmlNodeListGetRawString(); 24317 test_ret += test_xmlNodeListGetString(); 24318 test_ret += test_xmlNodeSetBase(); 24319 test_ret += test_xmlNodeSetContent(); 24320 test_ret += test_xmlNodeSetContentLen(); 24321 test_ret += test_xmlNodeSetLang(); 24322 test_ret += test_xmlNodeSetName(); 24323 test_ret += test_xmlNodeSetSpacePreserve(); 24324 test_ret += test_xmlPreviousElementSibling(); 24325 test_ret += test_xmlReconciliateNs(); 24326 test_ret += test_xmlRemoveProp(); 24327 test_ret += test_xmlReplaceNode(); 24328 test_ret += test_xmlSaveFile(); 24329 test_ret += test_xmlSaveFileEnc(); 24330 test_ret += test_xmlSaveFileTo(); 24331 test_ret += test_xmlSaveFormatFile(); 24332 test_ret += test_xmlSaveFormatFileEnc(); 24333 test_ret += test_xmlSaveFormatFileTo(); 24334 test_ret += test_xmlSearchNs(); 24335 test_ret += test_xmlSearchNsByHref(); 24336 test_ret += test_xmlSetBufferAllocationScheme(); 24337 test_ret += test_xmlSetCompressMode(); 24338 test_ret += test_xmlSetDocCompressMode(); 24339 test_ret += test_xmlSetNs(); 24340 test_ret += test_xmlSetNsProp(); 24341 test_ret += test_xmlSetProp(); 24342 test_ret += test_xmlSplitQName2(); 24343 test_ret += test_xmlSplitQName3(); 24344 test_ret += test_xmlStringGetNodeList(); 24345 test_ret += test_xmlStringLenGetNodeList(); 24346 test_ret += test_xmlTextConcat(); 24347 test_ret += test_xmlTextMerge(); 24348 test_ret += test_xmlUnsetNsProp(); 24349 test_ret += test_xmlUnsetProp(); 24350 test_ret += test_xmlValidateNCName(); 24351 test_ret += test_xmlValidateNMToken(); 24352 test_ret += test_xmlValidateName(); 24353 test_ret += test_xmlValidateQName(); 24354 24355 if (test_ret != 0) 24356 printf("Module tree: %d errors\n", test_ret); 24357 return(test_ret); 24358 } 24359 24360 static int 24361 test_xmlBuildRelativeURI(void) { 24362 int test_ret = 0; 24363 24364 int mem_base; 24365 xmlChar * ret_val; 24366 xmlChar * URI; /* the URI reference under consideration */ 24367 int n_URI; 24368 xmlChar * base; /* the base value */ 24369 int n_base; 24370 24371 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 24372 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { 24373 mem_base = xmlMemBlocks(); 24374 URI = gen_const_xmlChar_ptr(n_URI, 0); 24375 base = gen_const_xmlChar_ptr(n_base, 1); 24376 24377 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base); 24378 desret_xmlChar_ptr(ret_val); 24379 call_tests++; 24380 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 24381 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1); 24382 xmlResetLastError(); 24383 if (mem_base != xmlMemBlocks()) { 24384 printf("Leak of %d blocks found in xmlBuildRelativeURI", 24385 xmlMemBlocks() - mem_base); 24386 test_ret++; 24387 printf(" %d", n_URI); 24388 printf(" %d", n_base); 24389 printf("\n"); 24390 } 24391 } 24392 } 24393 function_tests++; 24394 24395 return(test_ret); 24396 } 24397 24398 24399 static int 24400 test_xmlBuildURI(void) { 24401 int test_ret = 0; 24402 24403 int mem_base; 24404 xmlChar * ret_val; 24405 xmlChar * URI; /* the URI instance found in the document */ 24406 int n_URI; 24407 xmlChar * base; /* the base value */ 24408 int n_base; 24409 24410 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 24411 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { 24412 mem_base = xmlMemBlocks(); 24413 URI = gen_const_xmlChar_ptr(n_URI, 0); 24414 base = gen_const_xmlChar_ptr(n_base, 1); 24415 24416 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base); 24417 desret_xmlChar_ptr(ret_val); 24418 call_tests++; 24419 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 24420 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1); 24421 xmlResetLastError(); 24422 if (mem_base != xmlMemBlocks()) { 24423 printf("Leak of %d blocks found in xmlBuildURI", 24424 xmlMemBlocks() - mem_base); 24425 test_ret++; 24426 printf(" %d", n_URI); 24427 printf(" %d", n_base); 24428 printf("\n"); 24429 } 24430 } 24431 } 24432 function_tests++; 24433 24434 return(test_ret); 24435 } 24436 24437 24438 static int 24439 test_xmlCanonicPath(void) { 24440 int test_ret = 0; 24441 24442 int mem_base; 24443 xmlChar * ret_val; 24444 xmlChar * path; /* the resource locator in a filesystem notation */ 24445 int n_path; 24446 24447 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { 24448 mem_base = xmlMemBlocks(); 24449 path = gen_const_xmlChar_ptr(n_path, 0); 24450 24451 ret_val = xmlCanonicPath((const xmlChar *)path); 24452 desret_xmlChar_ptr(ret_val); 24453 call_tests++; 24454 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); 24455 xmlResetLastError(); 24456 if (mem_base != xmlMemBlocks()) { 24457 printf("Leak of %d blocks found in xmlCanonicPath", 24458 xmlMemBlocks() - mem_base); 24459 test_ret++; 24460 printf(" %d", n_path); 24461 printf("\n"); 24462 } 24463 } 24464 function_tests++; 24465 24466 return(test_ret); 24467 } 24468 24469 24470 static int 24471 test_xmlCreateURI(void) { 24472 int test_ret = 0; 24473 24474 24475 /* missing type support */ 24476 return(test_ret); 24477 } 24478 24479 24480 static int 24481 test_xmlNormalizeURIPath(void) { 24482 int test_ret = 0; 24483 24484 int mem_base; 24485 int ret_val; 24486 char * path; /* pointer to the path string */ 24487 int n_path; 24488 24489 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) { 24490 mem_base = xmlMemBlocks(); 24491 path = gen_char_ptr(n_path, 0); 24492 24493 ret_val = xmlNormalizeURIPath(path); 24494 desret_int(ret_val); 24495 call_tests++; 24496 des_char_ptr(n_path, path, 0); 24497 xmlResetLastError(); 24498 if (mem_base != xmlMemBlocks()) { 24499 printf("Leak of %d blocks found in xmlNormalizeURIPath", 24500 xmlMemBlocks() - mem_base); 24501 test_ret++; 24502 printf(" %d", n_path); 24503 printf("\n"); 24504 } 24505 } 24506 function_tests++; 24507 24508 return(test_ret); 24509 } 24510 24511 24512 static int 24513 test_xmlParseURI(void) { 24514 int test_ret = 0; 24515 24516 24517 /* missing type support */ 24518 return(test_ret); 24519 } 24520 24521 24522 static int 24523 test_xmlParseURIRaw(void) { 24524 int test_ret = 0; 24525 24526 24527 /* missing type support */ 24528 return(test_ret); 24529 } 24530 24531 24532 #define gen_nb_xmlURIPtr 1 24533 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24534 return(NULL); 24535 } 24536 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24537 } 24538 24539 static int 24540 test_xmlParseURIReference(void) { 24541 int test_ret = 0; 24542 24543 int mem_base; 24544 int ret_val; 24545 xmlURIPtr uri; /* pointer to an URI structure */ 24546 int n_uri; 24547 char * str; /* the string to analyze */ 24548 int n_str; 24549 24550 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { 24551 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { 24552 mem_base = xmlMemBlocks(); 24553 uri = gen_xmlURIPtr(n_uri, 0); 24554 str = gen_const_char_ptr(n_str, 1); 24555 24556 ret_val = xmlParseURIReference(uri, (const char *)str); 24557 desret_int(ret_val); 24558 call_tests++; 24559 des_xmlURIPtr(n_uri, uri, 0); 24560 des_const_char_ptr(n_str, (const char *)str, 1); 24561 xmlResetLastError(); 24562 if (mem_base != xmlMemBlocks()) { 24563 printf("Leak of %d blocks found in xmlParseURIReference", 24564 xmlMemBlocks() - mem_base); 24565 test_ret++; 24566 printf(" %d", n_uri); 24567 printf(" %d", n_str); 24568 printf("\n"); 24569 } 24570 } 24571 } 24572 function_tests++; 24573 24574 return(test_ret); 24575 } 24576 24577 24578 static int 24579 test_xmlPathToURI(void) { 24580 int test_ret = 0; 24581 24582 int mem_base; 24583 xmlChar * ret_val; 24584 xmlChar * path; /* the resource locator in a filesystem notation */ 24585 int n_path; 24586 24587 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { 24588 mem_base = xmlMemBlocks(); 24589 path = gen_const_xmlChar_ptr(n_path, 0); 24590 24591 ret_val = xmlPathToURI((const xmlChar *)path); 24592 desret_xmlChar_ptr(ret_val); 24593 call_tests++; 24594 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); 24595 xmlResetLastError(); 24596 if (mem_base != xmlMemBlocks()) { 24597 printf("Leak of %d blocks found in xmlPathToURI", 24598 xmlMemBlocks() - mem_base); 24599 test_ret++; 24600 printf(" %d", n_path); 24601 printf("\n"); 24602 } 24603 } 24604 function_tests++; 24605 24606 return(test_ret); 24607 } 24608 24609 24610 static int 24611 test_xmlPrintURI(void) { 24612 int test_ret = 0; 24613 24614 int mem_base; 24615 FILE * stream; /* a FILE* for the output */ 24616 int n_stream; 24617 xmlURIPtr uri; /* pointer to an xmlURI */ 24618 int n_uri; 24619 24620 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) { 24621 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { 24622 mem_base = xmlMemBlocks(); 24623 stream = gen_FILE_ptr(n_stream, 0); 24624 uri = gen_xmlURIPtr(n_uri, 1); 24625 24626 xmlPrintURI(stream, uri); 24627 call_tests++; 24628 des_FILE_ptr(n_stream, stream, 0); 24629 des_xmlURIPtr(n_uri, uri, 1); 24630 xmlResetLastError(); 24631 if (mem_base != xmlMemBlocks()) { 24632 printf("Leak of %d blocks found in xmlPrintURI", 24633 xmlMemBlocks() - mem_base); 24634 test_ret++; 24635 printf(" %d", n_stream); 24636 printf(" %d", n_uri); 24637 printf("\n"); 24638 } 24639 } 24640 } 24641 function_tests++; 24642 24643 return(test_ret); 24644 } 24645 24646 24647 static int 24648 test_xmlSaveUri(void) { 24649 int test_ret = 0; 24650 24651 int mem_base; 24652 xmlChar * ret_val; 24653 xmlURIPtr uri; /* pointer to an xmlURI */ 24654 int n_uri; 24655 24656 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { 24657 mem_base = xmlMemBlocks(); 24658 uri = gen_xmlURIPtr(n_uri, 0); 24659 24660 ret_val = xmlSaveUri(uri); 24661 desret_xmlChar_ptr(ret_val); 24662 call_tests++; 24663 des_xmlURIPtr(n_uri, uri, 0); 24664 xmlResetLastError(); 24665 if (mem_base != xmlMemBlocks()) { 24666 printf("Leak of %d blocks found in xmlSaveUri", 24667 xmlMemBlocks() - mem_base); 24668 test_ret++; 24669 printf(" %d", n_uri); 24670 printf("\n"); 24671 } 24672 } 24673 function_tests++; 24674 24675 return(test_ret); 24676 } 24677 24678 24679 static int 24680 test_xmlURIEscape(void) { 24681 int test_ret = 0; 24682 24683 int mem_base; 24684 xmlChar * ret_val; 24685 xmlChar * str; /* the string of the URI to escape */ 24686 int n_str; 24687 24688 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 24689 mem_base = xmlMemBlocks(); 24690 str = gen_const_xmlChar_ptr(n_str, 0); 24691 24692 ret_val = xmlURIEscape((const xmlChar *)str); 24693 desret_xmlChar_ptr(ret_val); 24694 call_tests++; 24695 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); 24696 xmlResetLastError(); 24697 if (mem_base != xmlMemBlocks()) { 24698 printf("Leak of %d blocks found in xmlURIEscape", 24699 xmlMemBlocks() - mem_base); 24700 test_ret++; 24701 printf(" %d", n_str); 24702 printf("\n"); 24703 } 24704 } 24705 function_tests++; 24706 24707 return(test_ret); 24708 } 24709 24710 24711 static int 24712 test_xmlURIEscapeStr(void) { 24713 int test_ret = 0; 24714 24715 int mem_base; 24716 xmlChar * ret_val; 24717 xmlChar * str; /* string to escape */ 24718 int n_str; 24719 xmlChar * list; /* exception list string of chars not to escape */ 24720 int n_list; 24721 24722 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 24723 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) { 24724 mem_base = xmlMemBlocks(); 24725 str = gen_const_xmlChar_ptr(n_str, 0); 24726 list = gen_const_xmlChar_ptr(n_list, 1); 24727 24728 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list); 24729 desret_xmlChar_ptr(ret_val); 24730 call_tests++; 24731 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); 24732 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1); 24733 xmlResetLastError(); 24734 if (mem_base != xmlMemBlocks()) { 24735 printf("Leak of %d blocks found in xmlURIEscapeStr", 24736 xmlMemBlocks() - mem_base); 24737 test_ret++; 24738 printf(" %d", n_str); 24739 printf(" %d", n_list); 24740 printf("\n"); 24741 } 24742 } 24743 } 24744 function_tests++; 24745 24746 return(test_ret); 24747 } 24748 24749 24750 static int 24751 test_xmlURIUnescapeString(void) { 24752 int test_ret = 0; 24753 24754 24755 /* missing type support */ 24756 return(test_ret); 24757 } 24758 24759 static int 24760 test_uri(void) { 24761 int test_ret = 0; 24762 24763 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n"); 24764 test_ret += test_xmlBuildRelativeURI(); 24765 test_ret += test_xmlBuildURI(); 24766 test_ret += test_xmlCanonicPath(); 24767 test_ret += test_xmlCreateURI(); 24768 test_ret += test_xmlNormalizeURIPath(); 24769 test_ret += test_xmlParseURI(); 24770 test_ret += test_xmlParseURIRaw(); 24771 test_ret += test_xmlParseURIReference(); 24772 test_ret += test_xmlPathToURI(); 24773 test_ret += test_xmlPrintURI(); 24774 test_ret += test_xmlSaveUri(); 24775 test_ret += test_xmlURIEscape(); 24776 test_ret += test_xmlURIEscapeStr(); 24777 test_ret += test_xmlURIUnescapeString(); 24778 24779 if (test_ret != 0) 24780 printf("Module uri: %d errors\n", test_ret); 24781 return(test_ret); 24782 } 24783 24784 static int 24785 test_xmlAddAttributeDecl(void) { 24786 int test_ret = 0; 24787 24788 int mem_base; 24789 xmlAttributePtr ret_val; 24790 xmlValidCtxtPtr ctxt; /* the validation context */ 24791 int n_ctxt; 24792 xmlDtdPtr dtd; /* pointer to the DTD */ 24793 int n_dtd; 24794 xmlChar * elem; /* the element name */ 24795 int n_elem; 24796 xmlChar * name; /* the attribute name */ 24797 int n_name; 24798 xmlChar * ns; /* the attribute namespace prefix */ 24799 int n_ns; 24800 xmlAttributeType type; /* the attribute type */ 24801 int n_type; 24802 xmlAttributeDefault def; /* the attribute default type */ 24803 int n_def; 24804 xmlChar * defaultValue; /* the attribute default value */ 24805 int n_defaultValue; 24806 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */ 24807 int n_tree; 24808 24809 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 24810 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 24811 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 24812 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 24813 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 24814 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) { 24815 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) { 24816 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) { 24817 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) { 24818 mem_base = xmlMemBlocks(); 24819 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 24820 dtd = gen_xmlDtdPtr(n_dtd, 1); 24821 elem = gen_const_xmlChar_ptr(n_elem, 2); 24822 name = gen_const_xmlChar_ptr(n_name, 3); 24823 ns = gen_const_xmlChar_ptr(n_ns, 4); 24824 type = gen_xmlAttributeType(n_type, 5); 24825 def = gen_xmlAttributeDefault(n_def, 6); 24826 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7); 24827 tree = gen_xmlEnumerationPtr(n_tree, 8); 24828 24829 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree); 24830 desret_xmlAttributePtr(ret_val); 24831 call_tests++; 24832 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 24833 des_xmlDtdPtr(n_dtd, dtd, 1); 24834 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2); 24835 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); 24836 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4); 24837 des_xmlAttributeType(n_type, type, 5); 24838 des_xmlAttributeDefault(n_def, def, 6); 24839 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7); 24840 des_xmlEnumerationPtr(n_tree, tree, 8); 24841 xmlResetLastError(); 24842 if (mem_base != xmlMemBlocks()) { 24843 printf("Leak of %d blocks found in xmlAddAttributeDecl", 24844 xmlMemBlocks() - mem_base); 24845 test_ret++; 24846 printf(" %d", n_ctxt); 24847 printf(" %d", n_dtd); 24848 printf(" %d", n_elem); 24849 printf(" %d", n_name); 24850 printf(" %d", n_ns); 24851 printf(" %d", n_type); 24852 printf(" %d", n_def); 24853 printf(" %d", n_defaultValue); 24854 printf(" %d", n_tree); 24855 printf("\n"); 24856 } 24857 } 24858 } 24859 } 24860 } 24861 } 24862 } 24863 } 24864 } 24865 } 24866 function_tests++; 24867 24868 return(test_ret); 24869 } 24870 24871 24872 static int 24873 test_xmlAddElementDecl(void) { 24874 int test_ret = 0; 24875 24876 int mem_base; 24877 xmlElementPtr ret_val; 24878 xmlValidCtxtPtr ctxt; /* the validation context */ 24879 int n_ctxt; 24880 xmlDtdPtr dtd; /* pointer to the DTD */ 24881 int n_dtd; 24882 xmlChar * name; /* the entity name */ 24883 int n_name; 24884 xmlElementTypeVal type; /* the element type */ 24885 int n_type; 24886 xmlElementContentPtr content; /* the element content tree or NULL */ 24887 int n_content; 24888 24889 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 24890 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 24891 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 24892 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) { 24893 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 24894 mem_base = xmlMemBlocks(); 24895 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 24896 dtd = gen_xmlDtdPtr(n_dtd, 1); 24897 name = gen_const_xmlChar_ptr(n_name, 2); 24898 type = gen_xmlElementTypeVal(n_type, 3); 24899 content = gen_xmlElementContentPtr(n_content, 4); 24900 24901 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content); 24902 desret_xmlElementPtr(ret_val); 24903 call_tests++; 24904 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 24905 des_xmlDtdPtr(n_dtd, dtd, 1); 24906 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 24907 des_xmlElementTypeVal(n_type, type, 3); 24908 des_xmlElementContentPtr(n_content, content, 4); 24909 xmlResetLastError(); 24910 if (mem_base != xmlMemBlocks()) { 24911 printf("Leak of %d blocks found in xmlAddElementDecl", 24912 xmlMemBlocks() - mem_base); 24913 test_ret++; 24914 printf(" %d", n_ctxt); 24915 printf(" %d", n_dtd); 24916 printf(" %d", n_name); 24917 printf(" %d", n_type); 24918 printf(" %d", n_content); 24919 printf("\n"); 24920 } 24921 } 24922 } 24923 } 24924 } 24925 } 24926 function_tests++; 24927 24928 return(test_ret); 24929 } 24930 24931 24932 static int 24933 test_xmlAddID(void) { 24934 int test_ret = 0; 24935 24936 24937 /* missing type support */ 24938 return(test_ret); 24939 } 24940 24941 24942 static int 24943 test_xmlAddNotationDecl(void) { 24944 int test_ret = 0; 24945 24946 24947 /* missing type support */ 24948 return(test_ret); 24949 } 24950 24951 24952 static int 24953 test_xmlAddRef(void) { 24954 int test_ret = 0; 24955 24956 24957 /* missing type support */ 24958 return(test_ret); 24959 } 24960 24961 24962 #define gen_nb_xmlAttributeTablePtr 1 24963 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24964 return(NULL); 24965 } 24966 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24967 } 24968 24969 static int 24970 test_xmlCopyAttributeTable(void) { 24971 int test_ret = 0; 24972 24973 24974 /* missing type support */ 24975 return(test_ret); 24976 } 24977 24978 24979 static int 24980 test_xmlCopyDocElementContent(void) { 24981 int test_ret = 0; 24982 24983 int mem_base; 24984 xmlElementContentPtr ret_val; 24985 xmlDocPtr doc; /* the document owning the element declaration */ 24986 int n_doc; 24987 xmlElementContentPtr cur; /* An element content pointer. */ 24988 int n_cur; 24989 24990 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 24991 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) { 24992 mem_base = xmlMemBlocks(); 24993 doc = gen_xmlDocPtr(n_doc, 0); 24994 cur = gen_xmlElementContentPtr(n_cur, 1); 24995 24996 ret_val = xmlCopyDocElementContent(doc, cur); 24997 desret_xmlElementContentPtr(ret_val); 24998 call_tests++; 24999 des_xmlDocPtr(n_doc, doc, 0); 25000 des_xmlElementContentPtr(n_cur, cur, 1); 25001 xmlResetLastError(); 25002 if (mem_base != xmlMemBlocks()) { 25003 printf("Leak of %d blocks found in xmlCopyDocElementContent", 25004 xmlMemBlocks() - mem_base); 25005 test_ret++; 25006 printf(" %d", n_doc); 25007 printf(" %d", n_cur); 25008 printf("\n"); 25009 } 25010 } 25011 } 25012 function_tests++; 25013 25014 return(test_ret); 25015 } 25016 25017 25018 static int 25019 test_xmlCopyElementContent(void) { 25020 int test_ret = 0; 25021 25022 int mem_base; 25023 xmlElementContentPtr ret_val; 25024 xmlElementContentPtr cur; /* An element content pointer. */ 25025 int n_cur; 25026 25027 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) { 25028 mem_base = xmlMemBlocks(); 25029 cur = gen_xmlElementContentPtr(n_cur, 0); 25030 25031 ret_val = xmlCopyElementContent(cur); 25032 desret_xmlElementContentPtr(ret_val); 25033 call_tests++; 25034 des_xmlElementContentPtr(n_cur, cur, 0); 25035 xmlResetLastError(); 25036 if (mem_base != xmlMemBlocks()) { 25037 printf("Leak of %d blocks found in xmlCopyElementContent", 25038 xmlMemBlocks() - mem_base); 25039 test_ret++; 25040 printf(" %d", n_cur); 25041 printf("\n"); 25042 } 25043 } 25044 function_tests++; 25045 25046 return(test_ret); 25047 } 25048 25049 25050 #define gen_nb_xmlElementTablePtr 1 25051 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25052 return(NULL); 25053 } 25054 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25055 } 25056 25057 static int 25058 test_xmlCopyElementTable(void) { 25059 int test_ret = 0; 25060 25061 25062 /* missing type support */ 25063 return(test_ret); 25064 } 25065 25066 25067 static int 25068 test_xmlCopyEnumeration(void) { 25069 int test_ret = 0; 25070 25071 25072 /* missing type support */ 25073 return(test_ret); 25074 } 25075 25076 25077 #define gen_nb_xmlNotationTablePtr 1 25078 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25079 return(NULL); 25080 } 25081 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25082 } 25083 25084 static int 25085 test_xmlCopyNotationTable(void) { 25086 int test_ret = 0; 25087 25088 25089 /* missing type support */ 25090 return(test_ret); 25091 } 25092 25093 25094 static int 25095 test_xmlCreateEnumeration(void) { 25096 int test_ret = 0; 25097 25098 25099 /* missing type support */ 25100 return(test_ret); 25101 } 25102 25103 25104 #define gen_nb_xmlAttributePtr 1 25105 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25106 return(NULL); 25107 } 25108 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25109 } 25110 25111 static int 25112 test_xmlDumpAttributeDecl(void) { 25113 int test_ret = 0; 25114 25115 #if defined(LIBXML_OUTPUT_ENABLED) 25116 int mem_base; 25117 xmlBufferPtr buf; /* the XML buffer output */ 25118 int n_buf; 25119 xmlAttributePtr attr; /* An attribute declaration */ 25120 int n_attr; 25121 25122 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25123 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) { 25124 mem_base = xmlMemBlocks(); 25125 buf = gen_xmlBufferPtr(n_buf, 0); 25126 attr = gen_xmlAttributePtr(n_attr, 1); 25127 25128 xmlDumpAttributeDecl(buf, attr); 25129 call_tests++; 25130 des_xmlBufferPtr(n_buf, buf, 0); 25131 des_xmlAttributePtr(n_attr, attr, 1); 25132 xmlResetLastError(); 25133 if (mem_base != xmlMemBlocks()) { 25134 printf("Leak of %d blocks found in xmlDumpAttributeDecl", 25135 xmlMemBlocks() - mem_base); 25136 test_ret++; 25137 printf(" %d", n_buf); 25138 printf(" %d", n_attr); 25139 printf("\n"); 25140 } 25141 } 25142 } 25143 function_tests++; 25144 #endif 25145 25146 return(test_ret); 25147 } 25148 25149 25150 static int 25151 test_xmlDumpAttributeTable(void) { 25152 int test_ret = 0; 25153 25154 #if defined(LIBXML_OUTPUT_ENABLED) 25155 int mem_base; 25156 xmlBufferPtr buf; /* the XML buffer output */ 25157 int n_buf; 25158 xmlAttributeTablePtr table; /* An attribute table */ 25159 int n_table; 25160 25161 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25162 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) { 25163 mem_base = xmlMemBlocks(); 25164 buf = gen_xmlBufferPtr(n_buf, 0); 25165 table = gen_xmlAttributeTablePtr(n_table, 1); 25166 25167 xmlDumpAttributeTable(buf, table); 25168 call_tests++; 25169 des_xmlBufferPtr(n_buf, buf, 0); 25170 des_xmlAttributeTablePtr(n_table, table, 1); 25171 xmlResetLastError(); 25172 if (mem_base != xmlMemBlocks()) { 25173 printf("Leak of %d blocks found in xmlDumpAttributeTable", 25174 xmlMemBlocks() - mem_base); 25175 test_ret++; 25176 printf(" %d", n_buf); 25177 printf(" %d", n_table); 25178 printf("\n"); 25179 } 25180 } 25181 } 25182 function_tests++; 25183 #endif 25184 25185 return(test_ret); 25186 } 25187 25188 25189 #define gen_nb_xmlElementPtr 1 25190 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25191 return(NULL); 25192 } 25193 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25194 } 25195 25196 static int 25197 test_xmlDumpElementDecl(void) { 25198 int test_ret = 0; 25199 25200 #if defined(LIBXML_OUTPUT_ENABLED) 25201 int mem_base; 25202 xmlBufferPtr buf; /* the XML buffer output */ 25203 int n_buf; 25204 xmlElementPtr elem; /* An element table */ 25205 int n_elem; 25206 25207 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25208 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { 25209 mem_base = xmlMemBlocks(); 25210 buf = gen_xmlBufferPtr(n_buf, 0); 25211 elem = gen_xmlElementPtr(n_elem, 1); 25212 25213 xmlDumpElementDecl(buf, elem); 25214 call_tests++; 25215 des_xmlBufferPtr(n_buf, buf, 0); 25216 des_xmlElementPtr(n_elem, elem, 1); 25217 xmlResetLastError(); 25218 if (mem_base != xmlMemBlocks()) { 25219 printf("Leak of %d blocks found in xmlDumpElementDecl", 25220 xmlMemBlocks() - mem_base); 25221 test_ret++; 25222 printf(" %d", n_buf); 25223 printf(" %d", n_elem); 25224 printf("\n"); 25225 } 25226 } 25227 } 25228 function_tests++; 25229 #endif 25230 25231 return(test_ret); 25232 } 25233 25234 25235 static int 25236 test_xmlDumpElementTable(void) { 25237 int test_ret = 0; 25238 25239 #if defined(LIBXML_OUTPUT_ENABLED) 25240 int mem_base; 25241 xmlBufferPtr buf; /* the XML buffer output */ 25242 int n_buf; 25243 xmlElementTablePtr table; /* An element table */ 25244 int n_table; 25245 25246 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25247 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) { 25248 mem_base = xmlMemBlocks(); 25249 buf = gen_xmlBufferPtr(n_buf, 0); 25250 table = gen_xmlElementTablePtr(n_table, 1); 25251 25252 xmlDumpElementTable(buf, table); 25253 call_tests++; 25254 des_xmlBufferPtr(n_buf, buf, 0); 25255 des_xmlElementTablePtr(n_table, table, 1); 25256 xmlResetLastError(); 25257 if (mem_base != xmlMemBlocks()) { 25258 printf("Leak of %d blocks found in xmlDumpElementTable", 25259 xmlMemBlocks() - mem_base); 25260 test_ret++; 25261 printf(" %d", n_buf); 25262 printf(" %d", n_table); 25263 printf("\n"); 25264 } 25265 } 25266 } 25267 function_tests++; 25268 #endif 25269 25270 return(test_ret); 25271 } 25272 25273 25274 #define gen_nb_xmlNotationPtr 1 25275 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25276 return(NULL); 25277 } 25278 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25279 } 25280 25281 static int 25282 test_xmlDumpNotationDecl(void) { 25283 int test_ret = 0; 25284 25285 #if defined(LIBXML_OUTPUT_ENABLED) 25286 int mem_base; 25287 xmlBufferPtr buf; /* the XML buffer output */ 25288 int n_buf; 25289 xmlNotationPtr nota; /* A notation declaration */ 25290 int n_nota; 25291 25292 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25293 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) { 25294 mem_base = xmlMemBlocks(); 25295 buf = gen_xmlBufferPtr(n_buf, 0); 25296 nota = gen_xmlNotationPtr(n_nota, 1); 25297 25298 xmlDumpNotationDecl(buf, nota); 25299 call_tests++; 25300 des_xmlBufferPtr(n_buf, buf, 0); 25301 des_xmlNotationPtr(n_nota, nota, 1); 25302 xmlResetLastError(); 25303 if (mem_base != xmlMemBlocks()) { 25304 printf("Leak of %d blocks found in xmlDumpNotationDecl", 25305 xmlMemBlocks() - mem_base); 25306 test_ret++; 25307 printf(" %d", n_buf); 25308 printf(" %d", n_nota); 25309 printf("\n"); 25310 } 25311 } 25312 } 25313 function_tests++; 25314 #endif 25315 25316 return(test_ret); 25317 } 25318 25319 25320 static int 25321 test_xmlDumpNotationTable(void) { 25322 int test_ret = 0; 25323 25324 #if defined(LIBXML_OUTPUT_ENABLED) 25325 int mem_base; 25326 xmlBufferPtr buf; /* the XML buffer output */ 25327 int n_buf; 25328 xmlNotationTablePtr table; /* A notation table */ 25329 int n_table; 25330 25331 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25332 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) { 25333 mem_base = xmlMemBlocks(); 25334 buf = gen_xmlBufferPtr(n_buf, 0); 25335 table = gen_xmlNotationTablePtr(n_table, 1); 25336 25337 xmlDumpNotationTable(buf, table); 25338 call_tests++; 25339 des_xmlBufferPtr(n_buf, buf, 0); 25340 des_xmlNotationTablePtr(n_table, table, 1); 25341 xmlResetLastError(); 25342 if (mem_base != xmlMemBlocks()) { 25343 printf("Leak of %d blocks found in xmlDumpNotationTable", 25344 xmlMemBlocks() - mem_base); 25345 test_ret++; 25346 printf(" %d", n_buf); 25347 printf(" %d", n_table); 25348 printf("\n"); 25349 } 25350 } 25351 } 25352 function_tests++; 25353 #endif 25354 25355 return(test_ret); 25356 } 25357 25358 25359 static int 25360 test_xmlGetDtdAttrDesc(void) { 25361 int test_ret = 0; 25362 25363 int mem_base; 25364 xmlAttributePtr ret_val; 25365 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25366 int n_dtd; 25367 xmlChar * elem; /* the element name */ 25368 int n_elem; 25369 xmlChar * name; /* the attribute name */ 25370 int n_name; 25371 25372 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25373 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 25374 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25375 mem_base = xmlMemBlocks(); 25376 dtd = gen_xmlDtdPtr(n_dtd, 0); 25377 elem = gen_const_xmlChar_ptr(n_elem, 1); 25378 name = gen_const_xmlChar_ptr(n_name, 2); 25379 25380 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name); 25381 desret_xmlAttributePtr(ret_val); 25382 call_tests++; 25383 des_xmlDtdPtr(n_dtd, dtd, 0); 25384 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); 25385 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 25386 xmlResetLastError(); 25387 if (mem_base != xmlMemBlocks()) { 25388 printf("Leak of %d blocks found in xmlGetDtdAttrDesc", 25389 xmlMemBlocks() - mem_base); 25390 test_ret++; 25391 printf(" %d", n_dtd); 25392 printf(" %d", n_elem); 25393 printf(" %d", n_name); 25394 printf("\n"); 25395 } 25396 } 25397 } 25398 } 25399 function_tests++; 25400 25401 return(test_ret); 25402 } 25403 25404 25405 static int 25406 test_xmlGetDtdElementDesc(void) { 25407 int test_ret = 0; 25408 25409 int mem_base; 25410 xmlElementPtr ret_val; 25411 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25412 int n_dtd; 25413 xmlChar * name; /* the element name */ 25414 int n_name; 25415 25416 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25417 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25418 mem_base = xmlMemBlocks(); 25419 dtd = gen_xmlDtdPtr(n_dtd, 0); 25420 name = gen_const_xmlChar_ptr(n_name, 1); 25421 25422 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name); 25423 desret_xmlElementPtr(ret_val); 25424 call_tests++; 25425 des_xmlDtdPtr(n_dtd, dtd, 0); 25426 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25427 xmlResetLastError(); 25428 if (mem_base != xmlMemBlocks()) { 25429 printf("Leak of %d blocks found in xmlGetDtdElementDesc", 25430 xmlMemBlocks() - mem_base); 25431 test_ret++; 25432 printf(" %d", n_dtd); 25433 printf(" %d", n_name); 25434 printf("\n"); 25435 } 25436 } 25437 } 25438 function_tests++; 25439 25440 return(test_ret); 25441 } 25442 25443 25444 static int 25445 test_xmlGetDtdNotationDesc(void) { 25446 int test_ret = 0; 25447 25448 25449 /* missing type support */ 25450 return(test_ret); 25451 } 25452 25453 25454 static int 25455 test_xmlGetDtdQAttrDesc(void) { 25456 int test_ret = 0; 25457 25458 int mem_base; 25459 xmlAttributePtr ret_val; 25460 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25461 int n_dtd; 25462 xmlChar * elem; /* the element name */ 25463 int n_elem; 25464 xmlChar * name; /* the attribute name */ 25465 int n_name; 25466 xmlChar * prefix; /* the attribute namespace prefix */ 25467 int n_prefix; 25468 25469 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25470 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 25471 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25472 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 25473 mem_base = xmlMemBlocks(); 25474 dtd = gen_xmlDtdPtr(n_dtd, 0); 25475 elem = gen_const_xmlChar_ptr(n_elem, 1); 25476 name = gen_const_xmlChar_ptr(n_name, 2); 25477 prefix = gen_const_xmlChar_ptr(n_prefix, 3); 25478 25479 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix); 25480 desret_xmlAttributePtr(ret_val); 25481 call_tests++; 25482 des_xmlDtdPtr(n_dtd, dtd, 0); 25483 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); 25484 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 25485 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3); 25486 xmlResetLastError(); 25487 if (mem_base != xmlMemBlocks()) { 25488 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc", 25489 xmlMemBlocks() - mem_base); 25490 test_ret++; 25491 printf(" %d", n_dtd); 25492 printf(" %d", n_elem); 25493 printf(" %d", n_name); 25494 printf(" %d", n_prefix); 25495 printf("\n"); 25496 } 25497 } 25498 } 25499 } 25500 } 25501 function_tests++; 25502 25503 return(test_ret); 25504 } 25505 25506 25507 static int 25508 test_xmlGetDtdQElementDesc(void) { 25509 int test_ret = 0; 25510 25511 int mem_base; 25512 xmlElementPtr ret_val; 25513 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25514 int n_dtd; 25515 xmlChar * name; /* the element name */ 25516 int n_name; 25517 xmlChar * prefix; /* the element namespace prefix */ 25518 int n_prefix; 25519 25520 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25521 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25522 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 25523 mem_base = xmlMemBlocks(); 25524 dtd = gen_xmlDtdPtr(n_dtd, 0); 25525 name = gen_const_xmlChar_ptr(n_name, 1); 25526 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 25527 25528 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix); 25529 desret_xmlElementPtr(ret_val); 25530 call_tests++; 25531 des_xmlDtdPtr(n_dtd, dtd, 0); 25532 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25533 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 25534 xmlResetLastError(); 25535 if (mem_base != xmlMemBlocks()) { 25536 printf("Leak of %d blocks found in xmlGetDtdQElementDesc", 25537 xmlMemBlocks() - mem_base); 25538 test_ret++; 25539 printf(" %d", n_dtd); 25540 printf(" %d", n_name); 25541 printf(" %d", n_prefix); 25542 printf("\n"); 25543 } 25544 } 25545 } 25546 } 25547 function_tests++; 25548 25549 return(test_ret); 25550 } 25551 25552 25553 static int 25554 test_xmlGetID(void) { 25555 int test_ret = 0; 25556 25557 int mem_base; 25558 xmlAttrPtr ret_val; 25559 xmlDocPtr doc; /* pointer to the document */ 25560 int n_doc; 25561 xmlChar * ID; /* the ID value */ 25562 int n_ID; 25563 25564 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25565 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 25566 mem_base = xmlMemBlocks(); 25567 doc = gen_xmlDocPtr(n_doc, 0); 25568 ID = gen_const_xmlChar_ptr(n_ID, 1); 25569 25570 ret_val = xmlGetID(doc, (const xmlChar *)ID); 25571 desret_xmlAttrPtr(ret_val); 25572 call_tests++; 25573 des_xmlDocPtr(n_doc, doc, 0); 25574 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1); 25575 xmlResetLastError(); 25576 if (mem_base != xmlMemBlocks()) { 25577 printf("Leak of %d blocks found in xmlGetID", 25578 xmlMemBlocks() - mem_base); 25579 test_ret++; 25580 printf(" %d", n_doc); 25581 printf(" %d", n_ID); 25582 printf("\n"); 25583 } 25584 } 25585 } 25586 function_tests++; 25587 25588 return(test_ret); 25589 } 25590 25591 25592 static int 25593 test_xmlGetRefs(void) { 25594 int test_ret = 0; 25595 25596 25597 /* missing type support */ 25598 return(test_ret); 25599 } 25600 25601 25602 static int 25603 test_xmlIsID(void) { 25604 int test_ret = 0; 25605 25606 int mem_base; 25607 int ret_val; 25608 xmlDocPtr doc; /* the document */ 25609 int n_doc; 25610 xmlNodePtr elem; /* the element carrying the attribute */ 25611 int n_elem; 25612 xmlAttrPtr attr; /* the attribute */ 25613 int n_attr; 25614 25615 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25616 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 25617 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25618 mem_base = xmlMemBlocks(); 25619 doc = gen_xmlDocPtr(n_doc, 0); 25620 elem = gen_xmlNodePtr(n_elem, 1); 25621 attr = gen_xmlAttrPtr(n_attr, 2); 25622 25623 ret_val = xmlIsID(doc, elem, attr); 25624 desret_int(ret_val); 25625 call_tests++; 25626 des_xmlDocPtr(n_doc, doc, 0); 25627 des_xmlNodePtr(n_elem, elem, 1); 25628 des_xmlAttrPtr(n_attr, attr, 2); 25629 xmlResetLastError(); 25630 if (mem_base != xmlMemBlocks()) { 25631 printf("Leak of %d blocks found in xmlIsID", 25632 xmlMemBlocks() - mem_base); 25633 test_ret++; 25634 printf(" %d", n_doc); 25635 printf(" %d", n_elem); 25636 printf(" %d", n_attr); 25637 printf("\n"); 25638 } 25639 } 25640 } 25641 } 25642 function_tests++; 25643 25644 return(test_ret); 25645 } 25646 25647 25648 static int 25649 test_xmlIsMixedElement(void) { 25650 int test_ret = 0; 25651 25652 int mem_base; 25653 int ret_val; 25654 xmlDocPtr doc; /* the document */ 25655 int n_doc; 25656 xmlChar * name; /* the element name */ 25657 int n_name; 25658 25659 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25660 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25661 mem_base = xmlMemBlocks(); 25662 doc = gen_xmlDocPtr(n_doc, 0); 25663 name = gen_const_xmlChar_ptr(n_name, 1); 25664 25665 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name); 25666 desret_int(ret_val); 25667 call_tests++; 25668 des_xmlDocPtr(n_doc, doc, 0); 25669 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25670 xmlResetLastError(); 25671 if (mem_base != xmlMemBlocks()) { 25672 printf("Leak of %d blocks found in xmlIsMixedElement", 25673 xmlMemBlocks() - mem_base); 25674 test_ret++; 25675 printf(" %d", n_doc); 25676 printf(" %d", n_name); 25677 printf("\n"); 25678 } 25679 } 25680 } 25681 function_tests++; 25682 25683 return(test_ret); 25684 } 25685 25686 25687 static int 25688 test_xmlIsRef(void) { 25689 int test_ret = 0; 25690 25691 int mem_base; 25692 int ret_val; 25693 xmlDocPtr doc; /* the document */ 25694 int n_doc; 25695 xmlNodePtr elem; /* the element carrying the attribute */ 25696 int n_elem; 25697 xmlAttrPtr attr; /* the attribute */ 25698 int n_attr; 25699 25700 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25701 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 25702 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25703 mem_base = xmlMemBlocks(); 25704 doc = gen_xmlDocPtr(n_doc, 0); 25705 elem = gen_xmlNodePtr(n_elem, 1); 25706 attr = gen_xmlAttrPtr(n_attr, 2); 25707 25708 ret_val = xmlIsRef(doc, elem, attr); 25709 desret_int(ret_val); 25710 call_tests++; 25711 des_xmlDocPtr(n_doc, doc, 0); 25712 des_xmlNodePtr(n_elem, elem, 1); 25713 des_xmlAttrPtr(n_attr, attr, 2); 25714 xmlResetLastError(); 25715 if (mem_base != xmlMemBlocks()) { 25716 printf("Leak of %d blocks found in xmlIsRef", 25717 xmlMemBlocks() - mem_base); 25718 test_ret++; 25719 printf(" %d", n_doc); 25720 printf(" %d", n_elem); 25721 printf(" %d", n_attr); 25722 printf("\n"); 25723 } 25724 } 25725 } 25726 } 25727 function_tests++; 25728 25729 return(test_ret); 25730 } 25731 25732 25733 static int 25734 test_xmlNewDocElementContent(void) { 25735 int test_ret = 0; 25736 25737 int mem_base; 25738 xmlElementContentPtr ret_val; 25739 xmlDocPtr doc; /* the document */ 25740 int n_doc; 25741 xmlChar * name; /* the subelement name or NULL */ 25742 int n_name; 25743 xmlElementContentType type; /* the type of element content decl */ 25744 int n_type; 25745 25746 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25747 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25748 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) { 25749 mem_base = xmlMemBlocks(); 25750 doc = gen_xmlDocPtr(n_doc, 0); 25751 name = gen_const_xmlChar_ptr(n_name, 1); 25752 type = gen_xmlElementContentType(n_type, 2); 25753 25754 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type); 25755 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL; 25756 desret_xmlElementContentPtr(ret_val); 25757 call_tests++; 25758 des_xmlDocPtr(n_doc, doc, 0); 25759 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25760 des_xmlElementContentType(n_type, type, 2); 25761 xmlResetLastError(); 25762 if (mem_base != xmlMemBlocks()) { 25763 printf("Leak of %d blocks found in xmlNewDocElementContent", 25764 xmlMemBlocks() - mem_base); 25765 test_ret++; 25766 printf(" %d", n_doc); 25767 printf(" %d", n_name); 25768 printf(" %d", n_type); 25769 printf("\n"); 25770 } 25771 } 25772 } 25773 } 25774 function_tests++; 25775 25776 return(test_ret); 25777 } 25778 25779 25780 static int 25781 test_xmlNewElementContent(void) { 25782 int test_ret = 0; 25783 25784 int mem_base; 25785 xmlElementContentPtr ret_val; 25786 xmlChar * name; /* the subelement name or NULL */ 25787 int n_name; 25788 xmlElementContentType type; /* the type of element content decl */ 25789 int n_type; 25790 25791 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25792 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) { 25793 mem_base = xmlMemBlocks(); 25794 name = gen_const_xmlChar_ptr(n_name, 0); 25795 type = gen_xmlElementContentType(n_type, 1); 25796 25797 ret_val = xmlNewElementContent((const xmlChar *)name, type); 25798 desret_xmlElementContentPtr(ret_val); 25799 call_tests++; 25800 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 25801 des_xmlElementContentType(n_type, type, 1); 25802 xmlResetLastError(); 25803 if (mem_base != xmlMemBlocks()) { 25804 printf("Leak of %d blocks found in xmlNewElementContent", 25805 xmlMemBlocks() - mem_base); 25806 test_ret++; 25807 printf(" %d", n_name); 25808 printf(" %d", n_type); 25809 printf("\n"); 25810 } 25811 } 25812 } 25813 function_tests++; 25814 25815 return(test_ret); 25816 } 25817 25818 25819 static int 25820 test_xmlNewValidCtxt(void) { 25821 int test_ret = 0; 25822 25823 25824 /* missing type support */ 25825 return(test_ret); 25826 } 25827 25828 25829 static int 25830 test_xmlRemoveID(void) { 25831 int test_ret = 0; 25832 25833 int mem_base; 25834 int ret_val; 25835 xmlDocPtr doc; /* the document */ 25836 int n_doc; 25837 xmlAttrPtr attr; /* the attribute */ 25838 int n_attr; 25839 25840 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25841 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25842 mem_base = xmlMemBlocks(); 25843 doc = gen_xmlDocPtr(n_doc, 0); 25844 attr = gen_xmlAttrPtr(n_attr, 1); 25845 25846 ret_val = xmlRemoveID(doc, attr); 25847 desret_int(ret_val); 25848 call_tests++; 25849 des_xmlDocPtr(n_doc, doc, 0); 25850 des_xmlAttrPtr(n_attr, attr, 1); 25851 xmlResetLastError(); 25852 if (mem_base != xmlMemBlocks()) { 25853 printf("Leak of %d blocks found in xmlRemoveID", 25854 xmlMemBlocks() - mem_base); 25855 test_ret++; 25856 printf(" %d", n_doc); 25857 printf(" %d", n_attr); 25858 printf("\n"); 25859 } 25860 } 25861 } 25862 function_tests++; 25863 25864 return(test_ret); 25865 } 25866 25867 25868 static int 25869 test_xmlRemoveRef(void) { 25870 int test_ret = 0; 25871 25872 int mem_base; 25873 int ret_val; 25874 xmlDocPtr doc; /* the document */ 25875 int n_doc; 25876 xmlAttrPtr attr; /* the attribute */ 25877 int n_attr; 25878 25879 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25880 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25881 mem_base = xmlMemBlocks(); 25882 doc = gen_xmlDocPtr(n_doc, 0); 25883 attr = gen_xmlAttrPtr(n_attr, 1); 25884 25885 ret_val = xmlRemoveRef(doc, attr); 25886 desret_int(ret_val); 25887 call_tests++; 25888 des_xmlDocPtr(n_doc, doc, 0); 25889 des_xmlAttrPtr(n_attr, attr, 1); 25890 xmlResetLastError(); 25891 if (mem_base != xmlMemBlocks()) { 25892 printf("Leak of %d blocks found in xmlRemoveRef", 25893 xmlMemBlocks() - mem_base); 25894 test_ret++; 25895 printf(" %d", n_doc); 25896 printf(" %d", n_attr); 25897 printf("\n"); 25898 } 25899 } 25900 } 25901 function_tests++; 25902 25903 return(test_ret); 25904 } 25905 25906 25907 static int 25908 test_xmlSnprintfElementContent(void) { 25909 int test_ret = 0; 25910 25911 int mem_base; 25912 char * buf; /* an output buffer */ 25913 int n_buf; 25914 int size; /* the buffer size */ 25915 int n_size; 25916 xmlElementContentPtr content; /* An element table */ 25917 int n_content; 25918 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */ 25919 int n_englob; 25920 25921 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) { 25922 for (n_size = 0;n_size < gen_nb_int;n_size++) { 25923 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 25924 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) { 25925 mem_base = xmlMemBlocks(); 25926 buf = gen_char_ptr(n_buf, 0); 25927 size = gen_int(n_size, 1); 25928 content = gen_xmlElementContentPtr(n_content, 2); 25929 englob = gen_int(n_englob, 3); 25930 25931 xmlSnprintfElementContent(buf, size, content, englob); 25932 call_tests++; 25933 des_char_ptr(n_buf, buf, 0); 25934 des_int(n_size, size, 1); 25935 des_xmlElementContentPtr(n_content, content, 2); 25936 des_int(n_englob, englob, 3); 25937 xmlResetLastError(); 25938 if (mem_base != xmlMemBlocks()) { 25939 printf("Leak of %d blocks found in xmlSnprintfElementContent", 25940 xmlMemBlocks() - mem_base); 25941 test_ret++; 25942 printf(" %d", n_buf); 25943 printf(" %d", n_size); 25944 printf(" %d", n_content); 25945 printf(" %d", n_englob); 25946 printf("\n"); 25947 } 25948 } 25949 } 25950 } 25951 } 25952 function_tests++; 25953 25954 return(test_ret); 25955 } 25956 25957 25958 static int 25959 test_xmlSprintfElementContent(void) { 25960 int test_ret = 0; 25961 25962 #if defined(LIBXML_OUTPUT_ENABLED) 25963 #ifdef LIBXML_OUTPUT_ENABLED 25964 int mem_base; 25965 char * buf; /* an output buffer */ 25966 int n_buf; 25967 xmlElementContentPtr content; /* An element table */ 25968 int n_content; 25969 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */ 25970 int n_englob; 25971 25972 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) { 25973 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 25974 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) { 25975 mem_base = xmlMemBlocks(); 25976 buf = gen_char_ptr(n_buf, 0); 25977 content = gen_xmlElementContentPtr(n_content, 1); 25978 englob = gen_int(n_englob, 2); 25979 25980 xmlSprintfElementContent(buf, content, englob); 25981 call_tests++; 25982 des_char_ptr(n_buf, buf, 0); 25983 des_xmlElementContentPtr(n_content, content, 1); 25984 des_int(n_englob, englob, 2); 25985 xmlResetLastError(); 25986 if (mem_base != xmlMemBlocks()) { 25987 printf("Leak of %d blocks found in xmlSprintfElementContent", 25988 xmlMemBlocks() - mem_base); 25989 test_ret++; 25990 printf(" %d", n_buf); 25991 printf(" %d", n_content); 25992 printf(" %d", n_englob); 25993 printf("\n"); 25994 } 25995 } 25996 } 25997 } 25998 function_tests++; 25999 #endif 26000 #endif 26001 26002 return(test_ret); 26003 } 26004 26005 26006 static int 26007 test_xmlValidBuildContentModel(void) { 26008 int test_ret = 0; 26009 26010 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 26011 int mem_base; 26012 int ret_val; 26013 xmlValidCtxtPtr ctxt; /* a validation context */ 26014 int n_ctxt; 26015 xmlElementPtr elem; /* an element declaration node */ 26016 int n_elem; 26017 26018 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26019 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { 26020 mem_base = xmlMemBlocks(); 26021 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26022 elem = gen_xmlElementPtr(n_elem, 1); 26023 26024 ret_val = xmlValidBuildContentModel(ctxt, elem); 26025 desret_int(ret_val); 26026 call_tests++; 26027 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26028 des_xmlElementPtr(n_elem, elem, 1); 26029 xmlResetLastError(); 26030 if (mem_base != xmlMemBlocks()) { 26031 printf("Leak of %d blocks found in xmlValidBuildContentModel", 26032 xmlMemBlocks() - mem_base); 26033 test_ret++; 26034 printf(" %d", n_ctxt); 26035 printf(" %d", n_elem); 26036 printf("\n"); 26037 } 26038 } 26039 } 26040 function_tests++; 26041 #endif 26042 26043 return(test_ret); 26044 } 26045 26046 26047 static int 26048 test_xmlValidCtxtNormalizeAttributeValue(void) { 26049 int test_ret = 0; 26050 26051 #if defined(LIBXML_VALID_ENABLED) 26052 int mem_base; 26053 xmlChar * ret_val; 26054 xmlValidCtxtPtr ctxt; /* the validation context or NULL */ 26055 int n_ctxt; 26056 xmlDocPtr doc; /* the document */ 26057 int n_doc; 26058 xmlNodePtr elem; /* the parent */ 26059 int n_elem; 26060 xmlChar * name; /* the attribute name */ 26061 int n_name; 26062 xmlChar * value; /* the attribute value */ 26063 int n_value; 26064 26065 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26066 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26067 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26068 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 26069 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26070 mem_base = xmlMemBlocks(); 26071 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26072 doc = gen_xmlDocPtr(n_doc, 1); 26073 elem = gen_xmlNodePtr(n_elem, 2); 26074 name = gen_const_xmlChar_ptr(n_name, 3); 26075 value = gen_const_xmlChar_ptr(n_value, 4); 26076 26077 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value); 26078 desret_xmlChar_ptr(ret_val); 26079 call_tests++; 26080 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26081 des_xmlDocPtr(n_doc, doc, 1); 26082 des_xmlNodePtr(n_elem, elem, 2); 26083 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); 26084 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4); 26085 xmlResetLastError(); 26086 if (mem_base != xmlMemBlocks()) { 26087 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue", 26088 xmlMemBlocks() - mem_base); 26089 test_ret++; 26090 printf(" %d", n_ctxt); 26091 printf(" %d", n_doc); 26092 printf(" %d", n_elem); 26093 printf(" %d", n_name); 26094 printf(" %d", n_value); 26095 printf("\n"); 26096 } 26097 } 26098 } 26099 } 26100 } 26101 } 26102 function_tests++; 26103 #endif 26104 26105 return(test_ret); 26106 } 26107 26108 26109 #define gen_nb_xmlElementContent_ptr 1 26110 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 26111 return(NULL); 26112 } 26113 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 26114 } 26115 26116 static int 26117 test_xmlValidGetPotentialChildren(void) { 26118 int test_ret = 0; 26119 26120 #if defined(LIBXML_VALID_ENABLED) 26121 #ifdef LIBXML_VALID_ENABLED 26122 int mem_base; 26123 int ret_val; 26124 xmlElementContent * ctree; /* an element content tree */ 26125 int n_ctree; 26126 xmlChar ** names; /* an array to store the list of child names */ 26127 int n_names; 26128 int * len; /* a pointer to the number of element in the list */ 26129 int n_len; 26130 int max; /* the size of the array */ 26131 int n_max; 26132 26133 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) { 26134 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { 26135 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 26136 for (n_max = 0;n_max < gen_nb_int;n_max++) { 26137 mem_base = xmlMemBlocks(); 26138 ctree = gen_xmlElementContent_ptr(n_ctree, 0); 26139 names = gen_const_xmlChar_ptr_ptr(n_names, 1); 26140 len = gen_int_ptr(n_len, 2); 26141 max = gen_int(n_max, 3); 26142 26143 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max); 26144 desret_int(ret_val); 26145 call_tests++; 26146 des_xmlElementContent_ptr(n_ctree, ctree, 0); 26147 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1); 26148 des_int_ptr(n_len, len, 2); 26149 des_int(n_max, max, 3); 26150 xmlResetLastError(); 26151 if (mem_base != xmlMemBlocks()) { 26152 printf("Leak of %d blocks found in xmlValidGetPotentialChildren", 26153 xmlMemBlocks() - mem_base); 26154 test_ret++; 26155 printf(" %d", n_ctree); 26156 printf(" %d", n_names); 26157 printf(" %d", n_len); 26158 printf(" %d", n_max); 26159 printf("\n"); 26160 } 26161 } 26162 } 26163 } 26164 } 26165 function_tests++; 26166 #endif 26167 #endif 26168 26169 return(test_ret); 26170 } 26171 26172 26173 static int 26174 test_xmlValidGetValidElements(void) { 26175 int test_ret = 0; 26176 26177 #if defined(LIBXML_VALID_ENABLED) 26178 #ifdef LIBXML_VALID_ENABLED 26179 int mem_base; 26180 int ret_val; 26181 xmlNode * prev; /* an element to insert after */ 26182 int n_prev; 26183 xmlNode * next; /* an element to insert next */ 26184 int n_next; 26185 xmlChar ** names; /* an array to store the list of child names */ 26186 int n_names; 26187 int max; /* the size of the array */ 26188 int n_max; 26189 26190 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) { 26191 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) { 26192 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { 26193 for (n_max = 0;n_max < gen_nb_int;n_max++) { 26194 mem_base = xmlMemBlocks(); 26195 prev = gen_xmlNodePtr(n_prev, 0); 26196 next = gen_xmlNodePtr(n_next, 1); 26197 names = gen_const_xmlChar_ptr_ptr(n_names, 2); 26198 max = gen_int(n_max, 3); 26199 26200 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max); 26201 desret_int(ret_val); 26202 call_tests++; 26203 des_xmlNodePtr(n_prev, prev, 0); 26204 des_xmlNodePtr(n_next, next, 1); 26205 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2); 26206 des_int(n_max, max, 3); 26207 xmlResetLastError(); 26208 if (mem_base != xmlMemBlocks()) { 26209 printf("Leak of %d blocks found in xmlValidGetValidElements", 26210 xmlMemBlocks() - mem_base); 26211 test_ret++; 26212 printf(" %d", n_prev); 26213 printf(" %d", n_next); 26214 printf(" %d", n_names); 26215 printf(" %d", n_max); 26216 printf("\n"); 26217 } 26218 } 26219 } 26220 } 26221 } 26222 function_tests++; 26223 #endif 26224 #endif 26225 26226 return(test_ret); 26227 } 26228 26229 26230 static int 26231 test_xmlValidNormalizeAttributeValue(void) { 26232 int test_ret = 0; 26233 26234 #if defined(LIBXML_VALID_ENABLED) 26235 int mem_base; 26236 xmlChar * ret_val; 26237 xmlDocPtr doc; /* the document */ 26238 int n_doc; 26239 xmlNodePtr elem; /* the parent */ 26240 int n_elem; 26241 xmlChar * name; /* the attribute name */ 26242 int n_name; 26243 xmlChar * value; /* the attribute value */ 26244 int n_value; 26245 26246 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26247 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26248 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 26249 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26250 mem_base = xmlMemBlocks(); 26251 doc = gen_xmlDocPtr(n_doc, 0); 26252 elem = gen_xmlNodePtr(n_elem, 1); 26253 name = gen_const_xmlChar_ptr(n_name, 2); 26254 value = gen_const_xmlChar_ptr(n_value, 3); 26255 26256 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value); 26257 desret_xmlChar_ptr(ret_val); 26258 call_tests++; 26259 des_xmlDocPtr(n_doc, doc, 0); 26260 des_xmlNodePtr(n_elem, elem, 1); 26261 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 26262 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 26263 xmlResetLastError(); 26264 if (mem_base != xmlMemBlocks()) { 26265 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue", 26266 xmlMemBlocks() - mem_base); 26267 test_ret++; 26268 printf(" %d", n_doc); 26269 printf(" %d", n_elem); 26270 printf(" %d", n_name); 26271 printf(" %d", n_value); 26272 printf("\n"); 26273 } 26274 } 26275 } 26276 } 26277 } 26278 function_tests++; 26279 #endif 26280 26281 return(test_ret); 26282 } 26283 26284 26285 static int 26286 test_xmlValidateAttributeDecl(void) { 26287 int test_ret = 0; 26288 26289 #if defined(LIBXML_VALID_ENABLED) 26290 int mem_base; 26291 int ret_val; 26292 xmlValidCtxtPtr ctxt; /* the validation context */ 26293 int n_ctxt; 26294 xmlDocPtr doc; /* a document instance */ 26295 int n_doc; 26296 xmlAttributePtr attr; /* an attribute definition */ 26297 int n_attr; 26298 26299 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26300 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26301 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) { 26302 mem_base = xmlMemBlocks(); 26303 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26304 doc = gen_xmlDocPtr(n_doc, 1); 26305 attr = gen_xmlAttributePtr(n_attr, 2); 26306 26307 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr); 26308 desret_int(ret_val); 26309 call_tests++; 26310 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26311 des_xmlDocPtr(n_doc, doc, 1); 26312 des_xmlAttributePtr(n_attr, attr, 2); 26313 xmlResetLastError(); 26314 if (mem_base != xmlMemBlocks()) { 26315 printf("Leak of %d blocks found in xmlValidateAttributeDecl", 26316 xmlMemBlocks() - mem_base); 26317 test_ret++; 26318 printf(" %d", n_ctxt); 26319 printf(" %d", n_doc); 26320 printf(" %d", n_attr); 26321 printf("\n"); 26322 } 26323 } 26324 } 26325 } 26326 function_tests++; 26327 #endif 26328 26329 return(test_ret); 26330 } 26331 26332 26333 static int 26334 test_xmlValidateAttributeValue(void) { 26335 int test_ret = 0; 26336 26337 #if defined(LIBXML_VALID_ENABLED) 26338 int mem_base; 26339 int ret_val; 26340 xmlAttributeType type; /* an attribute type */ 26341 int n_type; 26342 xmlChar * value; /* an attribute value */ 26343 int n_value; 26344 26345 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) { 26346 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26347 mem_base = xmlMemBlocks(); 26348 type = gen_xmlAttributeType(n_type, 0); 26349 value = gen_const_xmlChar_ptr(n_value, 1); 26350 26351 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value); 26352 desret_int(ret_val); 26353 call_tests++; 26354 des_xmlAttributeType(n_type, type, 0); 26355 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 26356 xmlResetLastError(); 26357 if (mem_base != xmlMemBlocks()) { 26358 printf("Leak of %d blocks found in xmlValidateAttributeValue", 26359 xmlMemBlocks() - mem_base); 26360 test_ret++; 26361 printf(" %d", n_type); 26362 printf(" %d", n_value); 26363 printf("\n"); 26364 } 26365 } 26366 } 26367 function_tests++; 26368 #endif 26369 26370 return(test_ret); 26371 } 26372 26373 26374 static int 26375 test_xmlValidateDocument(void) { 26376 int test_ret = 0; 26377 26378 #if defined(LIBXML_VALID_ENABLED) 26379 int mem_base; 26380 int ret_val; 26381 xmlValidCtxtPtr ctxt; /* the validation context */ 26382 int n_ctxt; 26383 xmlDocPtr doc; /* a document instance */ 26384 int n_doc; 26385 26386 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26387 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26388 mem_base = xmlMemBlocks(); 26389 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26390 doc = gen_xmlDocPtr(n_doc, 1); 26391 26392 ret_val = xmlValidateDocument(ctxt, doc); 26393 desret_int(ret_val); 26394 call_tests++; 26395 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26396 des_xmlDocPtr(n_doc, doc, 1); 26397 xmlResetLastError(); 26398 if (mem_base != xmlMemBlocks()) { 26399 printf("Leak of %d blocks found in xmlValidateDocument", 26400 xmlMemBlocks() - mem_base); 26401 test_ret++; 26402 printf(" %d", n_ctxt); 26403 printf(" %d", n_doc); 26404 printf("\n"); 26405 } 26406 } 26407 } 26408 function_tests++; 26409 #endif 26410 26411 return(test_ret); 26412 } 26413 26414 26415 static int 26416 test_xmlValidateDocumentFinal(void) { 26417 int test_ret = 0; 26418 26419 #if defined(LIBXML_VALID_ENABLED) 26420 int mem_base; 26421 int ret_val; 26422 xmlValidCtxtPtr ctxt; /* the validation context */ 26423 int n_ctxt; 26424 xmlDocPtr doc; /* a document instance */ 26425 int n_doc; 26426 26427 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26428 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26429 mem_base = xmlMemBlocks(); 26430 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26431 doc = gen_xmlDocPtr(n_doc, 1); 26432 26433 ret_val = xmlValidateDocumentFinal(ctxt, doc); 26434 desret_int(ret_val); 26435 call_tests++; 26436 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26437 des_xmlDocPtr(n_doc, doc, 1); 26438 xmlResetLastError(); 26439 if (mem_base != xmlMemBlocks()) { 26440 printf("Leak of %d blocks found in xmlValidateDocumentFinal", 26441 xmlMemBlocks() - mem_base); 26442 test_ret++; 26443 printf(" %d", n_ctxt); 26444 printf(" %d", n_doc); 26445 printf("\n"); 26446 } 26447 } 26448 } 26449 function_tests++; 26450 #endif 26451 26452 return(test_ret); 26453 } 26454 26455 26456 static int 26457 test_xmlValidateDtd(void) { 26458 int test_ret = 0; 26459 26460 #if defined(LIBXML_VALID_ENABLED) 26461 int mem_base; 26462 int ret_val; 26463 xmlValidCtxtPtr ctxt; /* the validation context */ 26464 int n_ctxt; 26465 xmlDocPtr doc; /* a document instance */ 26466 int n_doc; 26467 xmlDtdPtr dtd; /* a dtd instance */ 26468 int n_dtd; 26469 26470 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26471 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26472 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 26473 mem_base = xmlMemBlocks(); 26474 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26475 doc = gen_xmlDocPtr(n_doc, 1); 26476 dtd = gen_xmlDtdPtr(n_dtd, 2); 26477 26478 ret_val = xmlValidateDtd(ctxt, doc, dtd); 26479 desret_int(ret_val); 26480 call_tests++; 26481 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26482 des_xmlDocPtr(n_doc, doc, 1); 26483 des_xmlDtdPtr(n_dtd, dtd, 2); 26484 xmlResetLastError(); 26485 if (mem_base != xmlMemBlocks()) { 26486 printf("Leak of %d blocks found in xmlValidateDtd", 26487 xmlMemBlocks() - mem_base); 26488 test_ret++; 26489 printf(" %d", n_ctxt); 26490 printf(" %d", n_doc); 26491 printf(" %d", n_dtd); 26492 printf("\n"); 26493 } 26494 } 26495 } 26496 } 26497 function_tests++; 26498 #endif 26499 26500 return(test_ret); 26501 } 26502 26503 26504 static int 26505 test_xmlValidateDtdFinal(void) { 26506 int test_ret = 0; 26507 26508 #if defined(LIBXML_VALID_ENABLED) 26509 int mem_base; 26510 int ret_val; 26511 xmlValidCtxtPtr ctxt; /* the validation context */ 26512 int n_ctxt; 26513 xmlDocPtr doc; /* a document instance */ 26514 int n_doc; 26515 26516 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26517 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26518 mem_base = xmlMemBlocks(); 26519 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26520 doc = gen_xmlDocPtr(n_doc, 1); 26521 26522 ret_val = xmlValidateDtdFinal(ctxt, doc); 26523 desret_int(ret_val); 26524 call_tests++; 26525 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26526 des_xmlDocPtr(n_doc, doc, 1); 26527 xmlResetLastError(); 26528 if (mem_base != xmlMemBlocks()) { 26529 printf("Leak of %d blocks found in xmlValidateDtdFinal", 26530 xmlMemBlocks() - mem_base); 26531 test_ret++; 26532 printf(" %d", n_ctxt); 26533 printf(" %d", n_doc); 26534 printf("\n"); 26535 } 26536 } 26537 } 26538 function_tests++; 26539 #endif 26540 26541 return(test_ret); 26542 } 26543 26544 26545 static int 26546 test_xmlValidateElement(void) { 26547 int test_ret = 0; 26548 26549 #if defined(LIBXML_VALID_ENABLED) 26550 int mem_base; 26551 int ret_val; 26552 xmlValidCtxtPtr ctxt; /* the validation context */ 26553 int n_ctxt; 26554 xmlDocPtr doc; /* a document instance */ 26555 int n_doc; 26556 xmlNodePtr elem; /* an element instance */ 26557 int n_elem; 26558 26559 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26560 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26561 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26562 mem_base = xmlMemBlocks(); 26563 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26564 doc = gen_xmlDocPtr(n_doc, 1); 26565 elem = gen_xmlNodePtr(n_elem, 2); 26566 26567 ret_val = xmlValidateElement(ctxt, doc, elem); 26568 desret_int(ret_val); 26569 call_tests++; 26570 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26571 des_xmlDocPtr(n_doc, doc, 1); 26572 des_xmlNodePtr(n_elem, elem, 2); 26573 xmlResetLastError(); 26574 if (mem_base != xmlMemBlocks()) { 26575 printf("Leak of %d blocks found in xmlValidateElement", 26576 xmlMemBlocks() - mem_base); 26577 test_ret++; 26578 printf(" %d", n_ctxt); 26579 printf(" %d", n_doc); 26580 printf(" %d", n_elem); 26581 printf("\n"); 26582 } 26583 } 26584 } 26585 } 26586 function_tests++; 26587 #endif 26588 26589 return(test_ret); 26590 } 26591 26592 26593 static int 26594 test_xmlValidateElementDecl(void) { 26595 int test_ret = 0; 26596 26597 #if defined(LIBXML_VALID_ENABLED) 26598 int mem_base; 26599 int ret_val; 26600 xmlValidCtxtPtr ctxt; /* the validation context */ 26601 int n_ctxt; 26602 xmlDocPtr doc; /* a document instance */ 26603 int n_doc; 26604 xmlElementPtr elem; /* an element definition */ 26605 int n_elem; 26606 26607 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26608 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26609 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { 26610 mem_base = xmlMemBlocks(); 26611 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26612 doc = gen_xmlDocPtr(n_doc, 1); 26613 elem = gen_xmlElementPtr(n_elem, 2); 26614 26615 ret_val = xmlValidateElementDecl(ctxt, doc, elem); 26616 desret_int(ret_val); 26617 call_tests++; 26618 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26619 des_xmlDocPtr(n_doc, doc, 1); 26620 des_xmlElementPtr(n_elem, elem, 2); 26621 xmlResetLastError(); 26622 if (mem_base != xmlMemBlocks()) { 26623 printf("Leak of %d blocks found in xmlValidateElementDecl", 26624 xmlMemBlocks() - mem_base); 26625 test_ret++; 26626 printf(" %d", n_ctxt); 26627 printf(" %d", n_doc); 26628 printf(" %d", n_elem); 26629 printf("\n"); 26630 } 26631 } 26632 } 26633 } 26634 function_tests++; 26635 #endif 26636 26637 return(test_ret); 26638 } 26639 26640 26641 static int 26642 test_xmlValidateNameValue(void) { 26643 int test_ret = 0; 26644 26645 #if defined(LIBXML_VALID_ENABLED) 26646 int mem_base; 26647 int ret_val; 26648 xmlChar * value; /* an Name value */ 26649 int n_value; 26650 26651 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26652 mem_base = xmlMemBlocks(); 26653 value = gen_const_xmlChar_ptr(n_value, 0); 26654 26655 ret_val = xmlValidateNameValue((const xmlChar *)value); 26656 desret_int(ret_val); 26657 call_tests++; 26658 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26659 xmlResetLastError(); 26660 if (mem_base != xmlMemBlocks()) { 26661 printf("Leak of %d blocks found in xmlValidateNameValue", 26662 xmlMemBlocks() - mem_base); 26663 test_ret++; 26664 printf(" %d", n_value); 26665 printf("\n"); 26666 } 26667 } 26668 function_tests++; 26669 #endif 26670 26671 return(test_ret); 26672 } 26673 26674 26675 static int 26676 test_xmlValidateNamesValue(void) { 26677 int test_ret = 0; 26678 26679 #if defined(LIBXML_VALID_ENABLED) 26680 int mem_base; 26681 int ret_val; 26682 xmlChar * value; /* an Names value */ 26683 int n_value; 26684 26685 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26686 mem_base = xmlMemBlocks(); 26687 value = gen_const_xmlChar_ptr(n_value, 0); 26688 26689 ret_val = xmlValidateNamesValue((const xmlChar *)value); 26690 desret_int(ret_val); 26691 call_tests++; 26692 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26693 xmlResetLastError(); 26694 if (mem_base != xmlMemBlocks()) { 26695 printf("Leak of %d blocks found in xmlValidateNamesValue", 26696 xmlMemBlocks() - mem_base); 26697 test_ret++; 26698 printf(" %d", n_value); 26699 printf("\n"); 26700 } 26701 } 26702 function_tests++; 26703 #endif 26704 26705 return(test_ret); 26706 } 26707 26708 26709 static int 26710 test_xmlValidateNmtokenValue(void) { 26711 int test_ret = 0; 26712 26713 #if defined(LIBXML_VALID_ENABLED) 26714 int mem_base; 26715 int ret_val; 26716 xmlChar * value; /* an Nmtoken value */ 26717 int n_value; 26718 26719 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26720 mem_base = xmlMemBlocks(); 26721 value = gen_const_xmlChar_ptr(n_value, 0); 26722 26723 ret_val = xmlValidateNmtokenValue((const xmlChar *)value); 26724 desret_int(ret_val); 26725 call_tests++; 26726 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26727 xmlResetLastError(); 26728 if (mem_base != xmlMemBlocks()) { 26729 printf("Leak of %d blocks found in xmlValidateNmtokenValue", 26730 xmlMemBlocks() - mem_base); 26731 test_ret++; 26732 printf(" %d", n_value); 26733 printf("\n"); 26734 } 26735 } 26736 function_tests++; 26737 #endif 26738 26739 return(test_ret); 26740 } 26741 26742 26743 static int 26744 test_xmlValidateNmtokensValue(void) { 26745 int test_ret = 0; 26746 26747 #if defined(LIBXML_VALID_ENABLED) 26748 int mem_base; 26749 int ret_val; 26750 xmlChar * value; /* an Nmtokens value */ 26751 int n_value; 26752 26753 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26754 mem_base = xmlMemBlocks(); 26755 value = gen_const_xmlChar_ptr(n_value, 0); 26756 26757 ret_val = xmlValidateNmtokensValue((const xmlChar *)value); 26758 desret_int(ret_val); 26759 call_tests++; 26760 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26761 xmlResetLastError(); 26762 if (mem_base != xmlMemBlocks()) { 26763 printf("Leak of %d blocks found in xmlValidateNmtokensValue", 26764 xmlMemBlocks() - mem_base); 26765 test_ret++; 26766 printf(" %d", n_value); 26767 printf("\n"); 26768 } 26769 } 26770 function_tests++; 26771 #endif 26772 26773 return(test_ret); 26774 } 26775 26776 26777 static int 26778 test_xmlValidateNotationDecl(void) { 26779 int test_ret = 0; 26780 26781 #if defined(LIBXML_VALID_ENABLED) 26782 int mem_base; 26783 int ret_val; 26784 xmlValidCtxtPtr ctxt; /* the validation context */ 26785 int n_ctxt; 26786 xmlDocPtr doc; /* a document instance */ 26787 int n_doc; 26788 xmlNotationPtr nota; /* a notation definition */ 26789 int n_nota; 26790 26791 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26792 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26793 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) { 26794 mem_base = xmlMemBlocks(); 26795 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26796 doc = gen_xmlDocPtr(n_doc, 1); 26797 nota = gen_xmlNotationPtr(n_nota, 2); 26798 26799 ret_val = xmlValidateNotationDecl(ctxt, doc, nota); 26800 desret_int(ret_val); 26801 call_tests++; 26802 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26803 des_xmlDocPtr(n_doc, doc, 1); 26804 des_xmlNotationPtr(n_nota, nota, 2); 26805 xmlResetLastError(); 26806 if (mem_base != xmlMemBlocks()) { 26807 printf("Leak of %d blocks found in xmlValidateNotationDecl", 26808 xmlMemBlocks() - mem_base); 26809 test_ret++; 26810 printf(" %d", n_ctxt); 26811 printf(" %d", n_doc); 26812 printf(" %d", n_nota); 26813 printf("\n"); 26814 } 26815 } 26816 } 26817 } 26818 function_tests++; 26819 #endif 26820 26821 return(test_ret); 26822 } 26823 26824 26825 static int 26826 test_xmlValidateNotationUse(void) { 26827 int test_ret = 0; 26828 26829 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 26830 int mem_base; 26831 int ret_val; 26832 xmlValidCtxtPtr ctxt; /* the validation context */ 26833 int n_ctxt; 26834 xmlDocPtr doc; /* the document */ 26835 int n_doc; 26836 xmlChar * notationName; /* the notation name to check */ 26837 int n_notationName; 26838 26839 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26840 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26841 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { 26842 mem_base = xmlMemBlocks(); 26843 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26844 doc = gen_xmlDocPtr(n_doc, 1); 26845 notationName = gen_const_xmlChar_ptr(n_notationName, 2); 26846 26847 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName); 26848 desret_int(ret_val); 26849 call_tests++; 26850 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26851 des_xmlDocPtr(n_doc, doc, 1); 26852 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2); 26853 xmlResetLastError(); 26854 if (mem_base != xmlMemBlocks()) { 26855 printf("Leak of %d blocks found in xmlValidateNotationUse", 26856 xmlMemBlocks() - mem_base); 26857 test_ret++; 26858 printf(" %d", n_ctxt); 26859 printf(" %d", n_doc); 26860 printf(" %d", n_notationName); 26861 printf("\n"); 26862 } 26863 } 26864 } 26865 } 26866 function_tests++; 26867 #endif 26868 26869 return(test_ret); 26870 } 26871 26872 26873 static int 26874 test_xmlValidateOneAttribute(void) { 26875 int test_ret = 0; 26876 26877 #if defined(LIBXML_VALID_ENABLED) 26878 int mem_base; 26879 int ret_val; 26880 xmlValidCtxtPtr ctxt; /* the validation context */ 26881 int n_ctxt; 26882 xmlDocPtr doc; /* a document instance */ 26883 int n_doc; 26884 xmlNodePtr elem; /* an element instance */ 26885 int n_elem; 26886 xmlAttrPtr attr; /* an attribute instance */ 26887 int n_attr; 26888 xmlChar * value; /* the attribute value (without entities processing) */ 26889 int n_value; 26890 26891 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26892 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26893 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26894 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 26895 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26896 mem_base = xmlMemBlocks(); 26897 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26898 doc = gen_xmlDocPtr(n_doc, 1); 26899 elem = gen_xmlNodePtr(n_elem, 2); 26900 attr = gen_xmlAttrPtr(n_attr, 3); 26901 value = gen_const_xmlChar_ptr(n_value, 4); 26902 26903 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value); 26904 desret_int(ret_val); 26905 call_tests++; 26906 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26907 des_xmlDocPtr(n_doc, doc, 1); 26908 des_xmlNodePtr(n_elem, elem, 2); 26909 des_xmlAttrPtr(n_attr, attr, 3); 26910 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4); 26911 xmlResetLastError(); 26912 if (mem_base != xmlMemBlocks()) { 26913 printf("Leak of %d blocks found in xmlValidateOneAttribute", 26914 xmlMemBlocks() - mem_base); 26915 test_ret++; 26916 printf(" %d", n_ctxt); 26917 printf(" %d", n_doc); 26918 printf(" %d", n_elem); 26919 printf(" %d", n_attr); 26920 printf(" %d", n_value); 26921 printf("\n"); 26922 } 26923 } 26924 } 26925 } 26926 } 26927 } 26928 function_tests++; 26929 #endif 26930 26931 return(test_ret); 26932 } 26933 26934 26935 static int 26936 test_xmlValidateOneElement(void) { 26937 int test_ret = 0; 26938 26939 #if defined(LIBXML_VALID_ENABLED) 26940 int mem_base; 26941 int ret_val; 26942 xmlValidCtxtPtr ctxt; /* the validation context */ 26943 int n_ctxt; 26944 xmlDocPtr doc; /* a document instance */ 26945 int n_doc; 26946 xmlNodePtr elem; /* an element instance */ 26947 int n_elem; 26948 26949 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26950 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26951 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26952 mem_base = xmlMemBlocks(); 26953 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26954 doc = gen_xmlDocPtr(n_doc, 1); 26955 elem = gen_xmlNodePtr(n_elem, 2); 26956 26957 ret_val = xmlValidateOneElement(ctxt, doc, elem); 26958 desret_int(ret_val); 26959 call_tests++; 26960 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26961 des_xmlDocPtr(n_doc, doc, 1); 26962 des_xmlNodePtr(n_elem, elem, 2); 26963 xmlResetLastError(); 26964 if (mem_base != xmlMemBlocks()) { 26965 printf("Leak of %d blocks found in xmlValidateOneElement", 26966 xmlMemBlocks() - mem_base); 26967 test_ret++; 26968 printf(" %d", n_ctxt); 26969 printf(" %d", n_doc); 26970 printf(" %d", n_elem); 26971 printf("\n"); 26972 } 26973 } 26974 } 26975 } 26976 function_tests++; 26977 #endif 26978 26979 return(test_ret); 26980 } 26981 26982 26983 static int 26984 test_xmlValidateOneNamespace(void) { 26985 int test_ret = 0; 26986 26987 #if defined(LIBXML_VALID_ENABLED) 26988 int mem_base; 26989 int ret_val; 26990 xmlValidCtxtPtr ctxt; /* the validation context */ 26991 int n_ctxt; 26992 xmlDocPtr doc; /* a document instance */ 26993 int n_doc; 26994 xmlNodePtr elem; /* an element instance */ 26995 int n_elem; 26996 xmlChar * prefix; /* the namespace prefix */ 26997 int n_prefix; 26998 xmlNsPtr ns; /* an namespace declaration instance */ 26999 int n_ns; 27000 xmlChar * value; /* the attribute value (without entities processing) */ 27001 int n_value; 27002 27003 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 27004 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27005 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 27006 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 27007 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 27008 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 27009 mem_base = xmlMemBlocks(); 27010 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 27011 doc = gen_xmlDocPtr(n_doc, 1); 27012 elem = gen_xmlNodePtr(n_elem, 2); 27013 prefix = gen_const_xmlChar_ptr(n_prefix, 3); 27014 ns = gen_xmlNsPtr(n_ns, 4); 27015 value = gen_const_xmlChar_ptr(n_value, 5); 27016 27017 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value); 27018 desret_int(ret_val); 27019 call_tests++; 27020 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 27021 des_xmlDocPtr(n_doc, doc, 1); 27022 des_xmlNodePtr(n_elem, elem, 2); 27023 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3); 27024 des_xmlNsPtr(n_ns, ns, 4); 27025 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5); 27026 xmlResetLastError(); 27027 if (mem_base != xmlMemBlocks()) { 27028 printf("Leak of %d blocks found in xmlValidateOneNamespace", 27029 xmlMemBlocks() - mem_base); 27030 test_ret++; 27031 printf(" %d", n_ctxt); 27032 printf(" %d", n_doc); 27033 printf(" %d", n_elem); 27034 printf(" %d", n_prefix); 27035 printf(" %d", n_ns); 27036 printf(" %d", n_value); 27037 printf("\n"); 27038 } 27039 } 27040 } 27041 } 27042 } 27043 } 27044 } 27045 function_tests++; 27046 #endif 27047 27048 return(test_ret); 27049 } 27050 27051 27052 static int 27053 test_xmlValidatePopElement(void) { 27054 int test_ret = 0; 27055 27056 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 27057 int mem_base; 27058 int ret_val; 27059 xmlValidCtxtPtr ctxt; /* the validation context */ 27060 int n_ctxt; 27061 xmlDocPtr doc; /* a document instance */ 27062 int n_doc; 27063 xmlNodePtr elem; /* an element instance */ 27064 int n_elem; 27065 xmlChar * qname; /* the qualified name as appearing in the serialization */ 27066 int n_qname; 27067 27068 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 27069 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27070 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 27071 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { 27072 mem_base = xmlMemBlocks(); 27073 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 27074 doc = gen_xmlDocPtr(n_doc, 1); 27075 elem = gen_xmlNodePtr(n_elem, 2); 27076 qname = gen_const_xmlChar_ptr(n_qname, 3); 27077 27078 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname); 27079 desret_int(ret_val); 27080 call_tests++; 27081 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 27082 des_xmlDocPtr(n_doc, doc, 1); 27083 des_xmlNodePtr(n_elem, elem, 2); 27084 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3); 27085 xmlResetLastError(); 27086 if (mem_base != xmlMemBlocks()) { 27087 printf("Leak of %d blocks found in xmlValidatePopElement", 27088 xmlMemBlocks() - mem_base); 27089 test_ret++; 27090 printf(" %d", n_ctxt); 27091 printf(" %d", n_doc); 27092 printf(" %d", n_elem); 27093 printf(" %d", n_qname); 27094 printf("\n"); 27095 } 27096 } 27097 } 27098 } 27099 } 27100 function_tests++; 27101 #endif 27102 27103 return(test_ret); 27104 } 27105 27106 27107 static int 27108 test_xmlValidatePushCData(void) { 27109 int test_ret = 0; 27110 27111 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 27112 int mem_base; 27113 int ret_val; 27114 xmlValidCtxtPtr ctxt; /* the validation context */ 27115 int n_ctxt; 27116 xmlChar * data; /* some character data read */ 27117 int n_data; 27118 int len; /* the length of the data */ 27119 int n_len; 27120 27121 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 27122 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { 27123 for (n_len = 0;n_len < gen_nb_int;n_len++) { 27124 mem_base = xmlMemBlocks(); 27125 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 27126 data = gen_const_xmlChar_ptr(n_data, 1); 27127 len = gen_int(n_len, 2); 27128 27129 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len); 27130 desret_int(ret_val); 27131 call_tests++; 27132 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 27133 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1); 27134 des_int(n_len, len, 2); 27135 xmlResetLastError(); 27136 if (mem_base != xmlMemBlocks()) { 27137 printf("Leak of %d blocks found in xmlValidatePushCData", 27138 xmlMemBlocks() - mem_base); 27139 test_ret++; 27140 printf(" %d", n_ctxt); 27141 printf(" %d", n_data); 27142 printf(" %d", n_len); 27143 printf("\n"); 27144 } 27145 } 27146 } 27147 } 27148 function_tests++; 27149 #endif 27150 27151 return(test_ret); 27152 } 27153 27154 27155 static int 27156 test_xmlValidatePushElement(void) { 27157 int test_ret = 0; 27158 27159 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 27160 int mem_base; 27161 int ret_val; 27162 xmlValidCtxtPtr ctxt; /* the validation context */ 27163 int n_ctxt; 27164 xmlDocPtr doc; /* a document instance */ 27165 int n_doc; 27166 xmlNodePtr elem; /* an element instance */ 27167 int n_elem; 27168 xmlChar * qname; /* the qualified name as appearing in the serialization */ 27169 int n_qname; 27170 27171 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 27172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27173 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 27174 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { 27175 mem_base = xmlMemBlocks(); 27176 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 27177 doc = gen_xmlDocPtr(n_doc, 1); 27178 elem = gen_xmlNodePtr(n_elem, 2); 27179 qname = gen_const_xmlChar_ptr(n_qname, 3); 27180 27181 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname); 27182 desret_int(ret_val); 27183 call_tests++; 27184 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 27185 des_xmlDocPtr(n_doc, doc, 1); 27186 des_xmlNodePtr(n_elem, elem, 2); 27187 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3); 27188 xmlResetLastError(); 27189 if (mem_base != xmlMemBlocks()) { 27190 printf("Leak of %d blocks found in xmlValidatePushElement", 27191 xmlMemBlocks() - mem_base); 27192 test_ret++; 27193 printf(" %d", n_ctxt); 27194 printf(" %d", n_doc); 27195 printf(" %d", n_elem); 27196 printf(" %d", n_qname); 27197 printf("\n"); 27198 } 27199 } 27200 } 27201 } 27202 } 27203 function_tests++; 27204 #endif 27205 27206 return(test_ret); 27207 } 27208 27209 27210 static int 27211 test_xmlValidateRoot(void) { 27212 int test_ret = 0; 27213 27214 #if defined(LIBXML_VALID_ENABLED) 27215 int mem_base; 27216 int ret_val; 27217 xmlValidCtxtPtr ctxt; /* the validation context */ 27218 int n_ctxt; 27219 xmlDocPtr doc; /* a document instance */ 27220 int n_doc; 27221 27222 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 27223 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27224 mem_base = xmlMemBlocks(); 27225 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 27226 doc = gen_xmlDocPtr(n_doc, 1); 27227 27228 ret_val = xmlValidateRoot(ctxt, doc); 27229 desret_int(ret_val); 27230 call_tests++; 27231 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 27232 des_xmlDocPtr(n_doc, doc, 1); 27233 xmlResetLastError(); 27234 if (mem_base != xmlMemBlocks()) { 27235 printf("Leak of %d blocks found in xmlValidateRoot", 27236 xmlMemBlocks() - mem_base); 27237 test_ret++; 27238 printf(" %d", n_ctxt); 27239 printf(" %d", n_doc); 27240 printf("\n"); 27241 } 27242 } 27243 } 27244 function_tests++; 27245 #endif 27246 27247 return(test_ret); 27248 } 27249 27250 static int 27251 test_valid(void) { 27252 int test_ret = 0; 27253 27254 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n"); 27255 test_ret += test_xmlAddAttributeDecl(); 27256 test_ret += test_xmlAddElementDecl(); 27257 test_ret += test_xmlAddID(); 27258 test_ret += test_xmlAddNotationDecl(); 27259 test_ret += test_xmlAddRef(); 27260 test_ret += test_xmlCopyAttributeTable(); 27261 test_ret += test_xmlCopyDocElementContent(); 27262 test_ret += test_xmlCopyElementContent(); 27263 test_ret += test_xmlCopyElementTable(); 27264 test_ret += test_xmlCopyEnumeration(); 27265 test_ret += test_xmlCopyNotationTable(); 27266 test_ret += test_xmlCreateEnumeration(); 27267 test_ret += test_xmlDumpAttributeDecl(); 27268 test_ret += test_xmlDumpAttributeTable(); 27269 test_ret += test_xmlDumpElementDecl(); 27270 test_ret += test_xmlDumpElementTable(); 27271 test_ret += test_xmlDumpNotationDecl(); 27272 test_ret += test_xmlDumpNotationTable(); 27273 test_ret += test_xmlGetDtdAttrDesc(); 27274 test_ret += test_xmlGetDtdElementDesc(); 27275 test_ret += test_xmlGetDtdNotationDesc(); 27276 test_ret += test_xmlGetDtdQAttrDesc(); 27277 test_ret += test_xmlGetDtdQElementDesc(); 27278 test_ret += test_xmlGetID(); 27279 test_ret += test_xmlGetRefs(); 27280 test_ret += test_xmlIsID(); 27281 test_ret += test_xmlIsMixedElement(); 27282 test_ret += test_xmlIsRef(); 27283 test_ret += test_xmlNewDocElementContent(); 27284 test_ret += test_xmlNewElementContent(); 27285 test_ret += test_xmlNewValidCtxt(); 27286 test_ret += test_xmlRemoveID(); 27287 test_ret += test_xmlRemoveRef(); 27288 test_ret += test_xmlSnprintfElementContent(); 27289 test_ret += test_xmlSprintfElementContent(); 27290 test_ret += test_xmlValidBuildContentModel(); 27291 test_ret += test_xmlValidCtxtNormalizeAttributeValue(); 27292 test_ret += test_xmlValidGetPotentialChildren(); 27293 test_ret += test_xmlValidGetValidElements(); 27294 test_ret += test_xmlValidNormalizeAttributeValue(); 27295 test_ret += test_xmlValidateAttributeDecl(); 27296 test_ret += test_xmlValidateAttributeValue(); 27297 test_ret += test_xmlValidateDocument(); 27298 test_ret += test_xmlValidateDocumentFinal(); 27299 test_ret += test_xmlValidateDtd(); 27300 test_ret += test_xmlValidateDtdFinal(); 27301 test_ret += test_xmlValidateElement(); 27302 test_ret += test_xmlValidateElementDecl(); 27303 test_ret += test_xmlValidateNameValue(); 27304 test_ret += test_xmlValidateNamesValue(); 27305 test_ret += test_xmlValidateNmtokenValue(); 27306 test_ret += test_xmlValidateNmtokensValue(); 27307 test_ret += test_xmlValidateNotationDecl(); 27308 test_ret += test_xmlValidateNotationUse(); 27309 test_ret += test_xmlValidateOneAttribute(); 27310 test_ret += test_xmlValidateOneElement(); 27311 test_ret += test_xmlValidateOneNamespace(); 27312 test_ret += test_xmlValidatePopElement(); 27313 test_ret += test_xmlValidatePushCData(); 27314 test_ret += test_xmlValidatePushElement(); 27315 test_ret += test_xmlValidateRoot(); 27316 27317 if (test_ret != 0) 27318 printf("Module valid: %d errors\n", test_ret); 27319 return(test_ret); 27320 } 27321 27322 static int 27323 test_xmlXIncludeNewContext(void) { 27324 int test_ret = 0; 27325 27326 27327 /* missing type support */ 27328 return(test_ret); 27329 } 27330 27331 27332 static int 27333 test_xmlXIncludeProcess(void) { 27334 int test_ret = 0; 27335 27336 #if defined(LIBXML_XINCLUDE_ENABLED) 27337 int mem_base; 27338 int ret_val; 27339 xmlDocPtr doc; /* an XML document */ 27340 int n_doc; 27341 27342 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27343 mem_base = xmlMemBlocks(); 27344 doc = gen_xmlDocPtr(n_doc, 0); 27345 27346 ret_val = xmlXIncludeProcess(doc); 27347 desret_int(ret_val); 27348 call_tests++; 27349 des_xmlDocPtr(n_doc, doc, 0); 27350 xmlResetLastError(); 27351 if (mem_base != xmlMemBlocks()) { 27352 printf("Leak of %d blocks found in xmlXIncludeProcess", 27353 xmlMemBlocks() - mem_base); 27354 test_ret++; 27355 printf(" %d", n_doc); 27356 printf("\n"); 27357 } 27358 } 27359 function_tests++; 27360 #endif 27361 27362 return(test_ret); 27363 } 27364 27365 27366 static int 27367 test_xmlXIncludeProcessFlags(void) { 27368 int test_ret = 0; 27369 27370 #if defined(LIBXML_XINCLUDE_ENABLED) 27371 int mem_base; 27372 int ret_val; 27373 xmlDocPtr doc; /* an XML document */ 27374 int n_doc; 27375 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27376 int n_flags; 27377 27378 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27379 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27380 mem_base = xmlMemBlocks(); 27381 doc = gen_xmlDocPtr(n_doc, 0); 27382 flags = gen_int(n_flags, 1); 27383 27384 ret_val = xmlXIncludeProcessFlags(doc, flags); 27385 desret_int(ret_val); 27386 call_tests++; 27387 des_xmlDocPtr(n_doc, doc, 0); 27388 des_int(n_flags, flags, 1); 27389 xmlResetLastError(); 27390 if (mem_base != xmlMemBlocks()) { 27391 printf("Leak of %d blocks found in xmlXIncludeProcessFlags", 27392 xmlMemBlocks() - mem_base); 27393 test_ret++; 27394 printf(" %d", n_doc); 27395 printf(" %d", n_flags); 27396 printf("\n"); 27397 } 27398 } 27399 } 27400 function_tests++; 27401 #endif 27402 27403 return(test_ret); 27404 } 27405 27406 27407 static int 27408 test_xmlXIncludeProcessFlagsData(void) { 27409 int test_ret = 0; 27410 27411 #if defined(LIBXML_XINCLUDE_ENABLED) 27412 int mem_base; 27413 int ret_val; 27414 xmlDocPtr doc; /* an XML document */ 27415 int n_doc; 27416 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27417 int n_flags; 27418 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ 27419 int n_data; 27420 27421 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27422 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27423 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 27424 mem_base = xmlMemBlocks(); 27425 doc = gen_xmlDocPtr(n_doc, 0); 27426 flags = gen_int(n_flags, 1); 27427 data = gen_userdata(n_data, 2); 27428 27429 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data); 27430 desret_int(ret_val); 27431 call_tests++; 27432 des_xmlDocPtr(n_doc, doc, 0); 27433 des_int(n_flags, flags, 1); 27434 des_userdata(n_data, data, 2); 27435 xmlResetLastError(); 27436 if (mem_base != xmlMemBlocks()) { 27437 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData", 27438 xmlMemBlocks() - mem_base); 27439 test_ret++; 27440 printf(" %d", n_doc); 27441 printf(" %d", n_flags); 27442 printf(" %d", n_data); 27443 printf("\n"); 27444 } 27445 } 27446 } 27447 } 27448 function_tests++; 27449 #endif 27450 27451 return(test_ret); 27452 } 27453 27454 #ifdef LIBXML_XINCLUDE_ENABLED 27455 27456 #define gen_nb_xmlXIncludeCtxtPtr 1 27457 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 27458 return(NULL); 27459 } 27460 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 27461 } 27462 #endif 27463 27464 27465 static int 27466 test_xmlXIncludeProcessNode(void) { 27467 int test_ret = 0; 27468 27469 #if defined(LIBXML_XINCLUDE_ENABLED) 27470 int mem_base; 27471 int ret_val; 27472 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */ 27473 int n_ctxt; 27474 xmlNodePtr node; /* a node in an XML document */ 27475 int n_node; 27476 27477 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) { 27478 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 27479 mem_base = xmlMemBlocks(); 27480 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0); 27481 node = gen_xmlNodePtr(n_node, 1); 27482 27483 ret_val = xmlXIncludeProcessNode(ctxt, node); 27484 desret_int(ret_val); 27485 call_tests++; 27486 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0); 27487 des_xmlNodePtr(n_node, node, 1); 27488 xmlResetLastError(); 27489 if (mem_base != xmlMemBlocks()) { 27490 printf("Leak of %d blocks found in xmlXIncludeProcessNode", 27491 xmlMemBlocks() - mem_base); 27492 test_ret++; 27493 printf(" %d", n_ctxt); 27494 printf(" %d", n_node); 27495 printf("\n"); 27496 } 27497 } 27498 } 27499 function_tests++; 27500 #endif 27501 27502 return(test_ret); 27503 } 27504 27505 27506 static int 27507 test_xmlXIncludeProcessTree(void) { 27508 int test_ret = 0; 27509 27510 #if defined(LIBXML_XINCLUDE_ENABLED) 27511 int mem_base; 27512 int ret_val; 27513 xmlNodePtr tree; /* a node in an XML document */ 27514 int n_tree; 27515 27516 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 27517 mem_base = xmlMemBlocks(); 27518 tree = gen_xmlNodePtr(n_tree, 0); 27519 27520 ret_val = xmlXIncludeProcessTree(tree); 27521 desret_int(ret_val); 27522 call_tests++; 27523 des_xmlNodePtr(n_tree, tree, 0); 27524 xmlResetLastError(); 27525 if (mem_base != xmlMemBlocks()) { 27526 printf("Leak of %d blocks found in xmlXIncludeProcessTree", 27527 xmlMemBlocks() - mem_base); 27528 test_ret++; 27529 printf(" %d", n_tree); 27530 printf("\n"); 27531 } 27532 } 27533 function_tests++; 27534 #endif 27535 27536 return(test_ret); 27537 } 27538 27539 27540 static int 27541 test_xmlXIncludeProcessTreeFlags(void) { 27542 int test_ret = 0; 27543 27544 #if defined(LIBXML_XINCLUDE_ENABLED) 27545 int mem_base; 27546 int ret_val; 27547 xmlNodePtr tree; /* a node in an XML document */ 27548 int n_tree; 27549 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27550 int n_flags; 27551 27552 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 27553 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27554 mem_base = xmlMemBlocks(); 27555 tree = gen_xmlNodePtr(n_tree, 0); 27556 flags = gen_int(n_flags, 1); 27557 27558 ret_val = xmlXIncludeProcessTreeFlags(tree, flags); 27559 desret_int(ret_val); 27560 call_tests++; 27561 des_xmlNodePtr(n_tree, tree, 0); 27562 des_int(n_flags, flags, 1); 27563 xmlResetLastError(); 27564 if (mem_base != xmlMemBlocks()) { 27565 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags", 27566 xmlMemBlocks() - mem_base); 27567 test_ret++; 27568 printf(" %d", n_tree); 27569 printf(" %d", n_flags); 27570 printf("\n"); 27571 } 27572 } 27573 } 27574 function_tests++; 27575 #endif 27576 27577 return(test_ret); 27578 } 27579 27580 27581 static int 27582 test_xmlXIncludeProcessTreeFlagsData(void) { 27583 int test_ret = 0; 27584 27585 #if defined(LIBXML_XINCLUDE_ENABLED) 27586 int mem_base; 27587 int ret_val; 27588 xmlNodePtr tree; /* an XML node */ 27589 int n_tree; 27590 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27591 int n_flags; 27592 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ 27593 int n_data; 27594 27595 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 27596 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27597 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 27598 mem_base = xmlMemBlocks(); 27599 tree = gen_xmlNodePtr(n_tree, 0); 27600 flags = gen_int(n_flags, 1); 27601 data = gen_userdata(n_data, 2); 27602 27603 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data); 27604 desret_int(ret_val); 27605 call_tests++; 27606 des_xmlNodePtr(n_tree, tree, 0); 27607 des_int(n_flags, flags, 1); 27608 des_userdata(n_data, data, 2); 27609 xmlResetLastError(); 27610 if (mem_base != xmlMemBlocks()) { 27611 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData", 27612 xmlMemBlocks() - mem_base); 27613 test_ret++; 27614 printf(" %d", n_tree); 27615 printf(" %d", n_flags); 27616 printf(" %d", n_data); 27617 printf("\n"); 27618 } 27619 } 27620 } 27621 } 27622 function_tests++; 27623 #endif 27624 27625 return(test_ret); 27626 } 27627 27628 27629 static int 27630 test_xmlXIncludeSetFlags(void) { 27631 int test_ret = 0; 27632 27633 #if defined(LIBXML_XINCLUDE_ENABLED) 27634 int mem_base; 27635 int ret_val; 27636 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */ 27637 int n_ctxt; 27638 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27639 int n_flags; 27640 27641 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) { 27642 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27643 mem_base = xmlMemBlocks(); 27644 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0); 27645 flags = gen_int(n_flags, 1); 27646 27647 ret_val = xmlXIncludeSetFlags(ctxt, flags); 27648 desret_int(ret_val); 27649 call_tests++; 27650 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0); 27651 des_int(n_flags, flags, 1); 27652 xmlResetLastError(); 27653 if (mem_base != xmlMemBlocks()) { 27654 printf("Leak of %d blocks found in xmlXIncludeSetFlags", 27655 xmlMemBlocks() - mem_base); 27656 test_ret++; 27657 printf(" %d", n_ctxt); 27658 printf(" %d", n_flags); 27659 printf("\n"); 27660 } 27661 } 27662 } 27663 function_tests++; 27664 #endif 27665 27666 return(test_ret); 27667 } 27668 27669 static int 27670 test_xinclude(void) { 27671 int test_ret = 0; 27672 27673 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n"); 27674 test_ret += test_xmlXIncludeNewContext(); 27675 test_ret += test_xmlXIncludeProcess(); 27676 test_ret += test_xmlXIncludeProcessFlags(); 27677 test_ret += test_xmlXIncludeProcessFlagsData(); 27678 test_ret += test_xmlXIncludeProcessNode(); 27679 test_ret += test_xmlXIncludeProcessTree(); 27680 test_ret += test_xmlXIncludeProcessTreeFlags(); 27681 test_ret += test_xmlXIncludeProcessTreeFlagsData(); 27682 test_ret += test_xmlXIncludeSetFlags(); 27683 27684 if (test_ret != 0) 27685 printf("Module xinclude: %d errors\n", test_ret); 27686 return(test_ret); 27687 } 27688 27689 static int 27690 test_xmlAllocOutputBuffer(void) { 27691 int test_ret = 0; 27692 27693 #if defined(LIBXML_OUTPUT_ENABLED) 27694 int mem_base; 27695 xmlOutputBufferPtr ret_val; 27696 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 27697 int n_encoder; 27698 27699 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 27700 mem_base = xmlMemBlocks(); 27701 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0); 27702 27703 ret_val = xmlAllocOutputBuffer(encoder); 27704 desret_xmlOutputBufferPtr(ret_val); 27705 call_tests++; 27706 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0); 27707 xmlResetLastError(); 27708 if (mem_base != xmlMemBlocks()) { 27709 printf("Leak of %d blocks found in xmlAllocOutputBuffer", 27710 xmlMemBlocks() - mem_base); 27711 test_ret++; 27712 printf(" %d", n_encoder); 27713 printf("\n"); 27714 } 27715 } 27716 function_tests++; 27717 #endif 27718 27719 return(test_ret); 27720 } 27721 27722 27723 static int 27724 test_xmlAllocParserInputBuffer(void) { 27725 int test_ret = 0; 27726 27727 int mem_base; 27728 xmlParserInputBufferPtr ret_val; 27729 xmlCharEncoding enc; /* the charset encoding if known */ 27730 int n_enc; 27731 27732 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 27733 mem_base = xmlMemBlocks(); 27734 enc = gen_xmlCharEncoding(n_enc, 0); 27735 27736 ret_val = xmlAllocParserInputBuffer(enc); 27737 desret_xmlParserInputBufferPtr(ret_val); 27738 call_tests++; 27739 des_xmlCharEncoding(n_enc, enc, 0); 27740 xmlResetLastError(); 27741 if (mem_base != xmlMemBlocks()) { 27742 printf("Leak of %d blocks found in xmlAllocParserInputBuffer", 27743 xmlMemBlocks() - mem_base); 27744 test_ret++; 27745 printf(" %d", n_enc); 27746 printf("\n"); 27747 } 27748 } 27749 function_tests++; 27750 27751 return(test_ret); 27752 } 27753 27754 27755 static int 27756 test_xmlCheckFilename(void) { 27757 int test_ret = 0; 27758 27759 int mem_base; 27760 int ret_val; 27761 char * path; /* the path to check */ 27762 int n_path; 27763 27764 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) { 27765 mem_base = xmlMemBlocks(); 27766 path = gen_const_char_ptr(n_path, 0); 27767 27768 ret_val = xmlCheckFilename((const char *)path); 27769 desret_int(ret_val); 27770 call_tests++; 27771 des_const_char_ptr(n_path, (const char *)path, 0); 27772 xmlResetLastError(); 27773 if (mem_base != xmlMemBlocks()) { 27774 printf("Leak of %d blocks found in xmlCheckFilename", 27775 xmlMemBlocks() - mem_base); 27776 test_ret++; 27777 printf(" %d", n_path); 27778 printf("\n"); 27779 } 27780 } 27781 function_tests++; 27782 27783 return(test_ret); 27784 } 27785 27786 27787 static int 27788 test_xmlCheckHTTPInput(void) { 27789 int test_ret = 0; 27790 27791 int mem_base; 27792 xmlParserInputPtr ret_val; 27793 xmlParserCtxtPtr ctxt; /* an XML parser context */ 27794 int n_ctxt; 27795 xmlParserInputPtr ret; /* an XML parser input */ 27796 int n_ret; 27797 27798 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 27799 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) { 27800 mem_base = xmlMemBlocks(); 27801 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 27802 ret = gen_xmlParserInputPtr(n_ret, 1); 27803 27804 ret_val = xmlCheckHTTPInput(ctxt, ret); 27805 desret_xmlParserInputPtr(ret_val); 27806 call_tests++; 27807 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 27808 des_xmlParserInputPtr(n_ret, ret, 1); 27809 xmlResetLastError(); 27810 if (mem_base != xmlMemBlocks()) { 27811 printf("Leak of %d blocks found in xmlCheckHTTPInput", 27812 xmlMemBlocks() - mem_base); 27813 test_ret++; 27814 printf(" %d", n_ctxt); 27815 printf(" %d", n_ret); 27816 printf("\n"); 27817 } 27818 } 27819 } 27820 function_tests++; 27821 27822 return(test_ret); 27823 } 27824 27825 27826 static int 27827 test_xmlCleanupInputCallbacks(void) { 27828 int test_ret = 0; 27829 27830 int mem_base; 27831 27832 mem_base = xmlMemBlocks(); 27833 27834 xmlCleanupInputCallbacks(); 27835 call_tests++; 27836 xmlResetLastError(); 27837 if (mem_base != xmlMemBlocks()) { 27838 printf("Leak of %d blocks found in xmlCleanupInputCallbacks", 27839 xmlMemBlocks() - mem_base); 27840 test_ret++; 27841 printf("\n"); 27842 } 27843 function_tests++; 27844 27845 return(test_ret); 27846 } 27847 27848 27849 static int 27850 test_xmlCleanupOutputCallbacks(void) { 27851 int test_ret = 0; 27852 27853 #if defined(LIBXML_OUTPUT_ENABLED) 27854 int mem_base; 27855 27856 mem_base = xmlMemBlocks(); 27857 27858 xmlCleanupOutputCallbacks(); 27859 call_tests++; 27860 xmlResetLastError(); 27861 if (mem_base != xmlMemBlocks()) { 27862 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks", 27863 xmlMemBlocks() - mem_base); 27864 test_ret++; 27865 printf("\n"); 27866 } 27867 function_tests++; 27868 #endif 27869 27870 return(test_ret); 27871 } 27872 27873 27874 static int 27875 test_xmlFileClose(void) { 27876 int test_ret = 0; 27877 27878 int mem_base; 27879 int ret_val; 27880 void * context; /* the I/O context */ 27881 int n_context; 27882 27883 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27884 mem_base = xmlMemBlocks(); 27885 context = gen_void_ptr(n_context, 0); 27886 27887 ret_val = xmlFileClose(context); 27888 desret_int(ret_val); 27889 call_tests++; 27890 des_void_ptr(n_context, context, 0); 27891 xmlResetLastError(); 27892 if (mem_base != xmlMemBlocks()) { 27893 printf("Leak of %d blocks found in xmlFileClose", 27894 xmlMemBlocks() - mem_base); 27895 test_ret++; 27896 printf(" %d", n_context); 27897 printf("\n"); 27898 } 27899 } 27900 function_tests++; 27901 27902 return(test_ret); 27903 } 27904 27905 27906 static int 27907 test_xmlFileMatch(void) { 27908 int test_ret = 0; 27909 27910 int mem_base; 27911 int ret_val; 27912 const char * filename; /* the URI for matching */ 27913 int n_filename; 27914 27915 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 27916 mem_base = xmlMemBlocks(); 27917 filename = gen_filepath(n_filename, 0); 27918 27919 ret_val = xmlFileMatch(filename); 27920 desret_int(ret_val); 27921 call_tests++; 27922 des_filepath(n_filename, filename, 0); 27923 xmlResetLastError(); 27924 if (mem_base != xmlMemBlocks()) { 27925 printf("Leak of %d blocks found in xmlFileMatch", 27926 xmlMemBlocks() - mem_base); 27927 test_ret++; 27928 printf(" %d", n_filename); 27929 printf("\n"); 27930 } 27931 } 27932 function_tests++; 27933 27934 return(test_ret); 27935 } 27936 27937 27938 static int 27939 test_xmlFileOpen(void) { 27940 int test_ret = 0; 27941 27942 int mem_base; 27943 void * ret_val; 27944 const char * filename; /* the URI for matching */ 27945 int n_filename; 27946 27947 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 27948 mem_base = xmlMemBlocks(); 27949 filename = gen_filepath(n_filename, 0); 27950 27951 ret_val = xmlFileOpen(filename); 27952 desret_void_ptr(ret_val); 27953 call_tests++; 27954 des_filepath(n_filename, filename, 0); 27955 xmlResetLastError(); 27956 if (mem_base != xmlMemBlocks()) { 27957 printf("Leak of %d blocks found in xmlFileOpen", 27958 xmlMemBlocks() - mem_base); 27959 test_ret++; 27960 printf(" %d", n_filename); 27961 printf("\n"); 27962 } 27963 } 27964 function_tests++; 27965 27966 return(test_ret); 27967 } 27968 27969 27970 static int 27971 test_xmlFileRead(void) { 27972 int test_ret = 0; 27973 27974 int mem_base; 27975 int ret_val; 27976 void * context; /* the I/O context */ 27977 int n_context; 27978 char * buffer; /* where to drop data */ 27979 int n_buffer; 27980 int len; /* number of bytes to write */ 27981 int n_len; 27982 27983 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27984 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 27985 for (n_len = 0;n_len < gen_nb_int;n_len++) { 27986 mem_base = xmlMemBlocks(); 27987 context = gen_void_ptr(n_context, 0); 27988 buffer = gen_char_ptr(n_buffer, 1); 27989 len = gen_int(n_len, 2); 27990 27991 ret_val = xmlFileRead(context, buffer, len); 27992 desret_int(ret_val); 27993 call_tests++; 27994 des_void_ptr(n_context, context, 0); 27995 des_char_ptr(n_buffer, buffer, 1); 27996 des_int(n_len, len, 2); 27997 xmlResetLastError(); 27998 if (mem_base != xmlMemBlocks()) { 27999 printf("Leak of %d blocks found in xmlFileRead", 28000 xmlMemBlocks() - mem_base); 28001 test_ret++; 28002 printf(" %d", n_context); 28003 printf(" %d", n_buffer); 28004 printf(" %d", n_len); 28005 printf("\n"); 28006 } 28007 } 28008 } 28009 } 28010 function_tests++; 28011 28012 return(test_ret); 28013 } 28014 28015 28016 static int 28017 test_xmlIOFTPClose(void) { 28018 int test_ret = 0; 28019 28020 #if defined(LIBXML_FTP_ENABLED) 28021 int mem_base; 28022 int ret_val; 28023 void * context; /* the I/O context */ 28024 int n_context; 28025 28026 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 28027 mem_base = xmlMemBlocks(); 28028 context = gen_void_ptr(n_context, 0); 28029 28030 ret_val = xmlIOFTPClose(context); 28031 desret_int(ret_val); 28032 call_tests++; 28033 des_void_ptr(n_context, context, 0); 28034 xmlResetLastError(); 28035 if (mem_base != xmlMemBlocks()) { 28036 printf("Leak of %d blocks found in xmlIOFTPClose", 28037 xmlMemBlocks() - mem_base); 28038 test_ret++; 28039 printf(" %d", n_context); 28040 printf("\n"); 28041 } 28042 } 28043 function_tests++; 28044 #endif 28045 28046 return(test_ret); 28047 } 28048 28049 28050 static int 28051 test_xmlIOFTPMatch(void) { 28052 int test_ret = 0; 28053 28054 #if defined(LIBXML_FTP_ENABLED) 28055 int mem_base; 28056 int ret_val; 28057 const char * filename; /* the URI for matching */ 28058 int n_filename; 28059 28060 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 28061 mem_base = xmlMemBlocks(); 28062 filename = gen_filepath(n_filename, 0); 28063 28064 ret_val = xmlIOFTPMatch(filename); 28065 desret_int(ret_val); 28066 call_tests++; 28067 des_filepath(n_filename, filename, 0); 28068 xmlResetLastError(); 28069 if (mem_base != xmlMemBlocks()) { 28070 printf("Leak of %d blocks found in xmlIOFTPMatch", 28071 xmlMemBlocks() - mem_base); 28072 test_ret++; 28073 printf(" %d", n_filename); 28074 printf("\n"); 28075 } 28076 } 28077 function_tests++; 28078 #endif 28079 28080 return(test_ret); 28081 } 28082 28083 28084 static int 28085 test_xmlIOFTPOpen(void) { 28086 int test_ret = 0; 28087 28088 #if defined(LIBXML_FTP_ENABLED) 28089 int mem_base; 28090 void * ret_val; 28091 const char * filename; /* the URI for matching */ 28092 int n_filename; 28093 28094 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 28095 mem_base = xmlMemBlocks(); 28096 filename = gen_filepath(n_filename, 0); 28097 28098 ret_val = xmlIOFTPOpen(filename); 28099 desret_void_ptr(ret_val); 28100 call_tests++; 28101 des_filepath(n_filename, filename, 0); 28102 xmlResetLastError(); 28103 if (mem_base != xmlMemBlocks()) { 28104 printf("Leak of %d blocks found in xmlIOFTPOpen", 28105 xmlMemBlocks() - mem_base); 28106 test_ret++; 28107 printf(" %d", n_filename); 28108 printf("\n"); 28109 } 28110 } 28111 function_tests++; 28112 #endif 28113 28114 return(test_ret); 28115 } 28116 28117 28118 static int 28119 test_xmlIOFTPRead(void) { 28120 int test_ret = 0; 28121 28122 #if defined(LIBXML_FTP_ENABLED) 28123 int mem_base; 28124 int ret_val; 28125 void * context; /* the I/O context */ 28126 int n_context; 28127 char * buffer; /* where to drop data */ 28128 int n_buffer; 28129 int len; /* number of bytes to write */ 28130 int n_len; 28131 28132 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 28133 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 28134 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28135 mem_base = xmlMemBlocks(); 28136 context = gen_void_ptr(n_context, 0); 28137 buffer = gen_char_ptr(n_buffer, 1); 28138 len = gen_int(n_len, 2); 28139 28140 ret_val = xmlIOFTPRead(context, buffer, len); 28141 desret_int(ret_val); 28142 call_tests++; 28143 des_void_ptr(n_context, context, 0); 28144 des_char_ptr(n_buffer, buffer, 1); 28145 des_int(n_len, len, 2); 28146 xmlResetLastError(); 28147 if (mem_base != xmlMemBlocks()) { 28148 printf("Leak of %d blocks found in xmlIOFTPRead", 28149 xmlMemBlocks() - mem_base); 28150 test_ret++; 28151 printf(" %d", n_context); 28152 printf(" %d", n_buffer); 28153 printf(" %d", n_len); 28154 printf("\n"); 28155 } 28156 } 28157 } 28158 } 28159 function_tests++; 28160 #endif 28161 28162 return(test_ret); 28163 } 28164 28165 28166 static int 28167 test_xmlIOHTTPClose(void) { 28168 int test_ret = 0; 28169 28170 #if defined(LIBXML_HTTP_ENABLED) 28171 int mem_base; 28172 int ret_val; 28173 void * context; /* the I/O context */ 28174 int n_context; 28175 28176 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 28177 mem_base = xmlMemBlocks(); 28178 context = gen_void_ptr(n_context, 0); 28179 28180 ret_val = xmlIOHTTPClose(context); 28181 desret_int(ret_val); 28182 call_tests++; 28183 des_void_ptr(n_context, context, 0); 28184 xmlResetLastError(); 28185 if (mem_base != xmlMemBlocks()) { 28186 printf("Leak of %d blocks found in xmlIOHTTPClose", 28187 xmlMemBlocks() - mem_base); 28188 test_ret++; 28189 printf(" %d", n_context); 28190 printf("\n"); 28191 } 28192 } 28193 function_tests++; 28194 #endif 28195 28196 return(test_ret); 28197 } 28198 28199 28200 static int 28201 test_xmlIOHTTPMatch(void) { 28202 int test_ret = 0; 28203 28204 #if defined(LIBXML_HTTP_ENABLED) 28205 int mem_base; 28206 int ret_val; 28207 const char * filename; /* the URI for matching */ 28208 int n_filename; 28209 28210 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 28211 mem_base = xmlMemBlocks(); 28212 filename = gen_filepath(n_filename, 0); 28213 28214 ret_val = xmlIOHTTPMatch(filename); 28215 desret_int(ret_val); 28216 call_tests++; 28217 des_filepath(n_filename, filename, 0); 28218 xmlResetLastError(); 28219 if (mem_base != xmlMemBlocks()) { 28220 printf("Leak of %d blocks found in xmlIOHTTPMatch", 28221 xmlMemBlocks() - mem_base); 28222 test_ret++; 28223 printf(" %d", n_filename); 28224 printf("\n"); 28225 } 28226 } 28227 function_tests++; 28228 #endif 28229 28230 return(test_ret); 28231 } 28232 28233 28234 static int 28235 test_xmlIOHTTPOpen(void) { 28236 int test_ret = 0; 28237 28238 #if defined(LIBXML_HTTP_ENABLED) 28239 int mem_base; 28240 void * ret_val; 28241 const char * filename; /* the URI for matching */ 28242 int n_filename; 28243 28244 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 28245 mem_base = xmlMemBlocks(); 28246 filename = gen_filepath(n_filename, 0); 28247 28248 ret_val = xmlIOHTTPOpen(filename); 28249 desret_xmlNanoHTTPCtxtPtr(ret_val); 28250 call_tests++; 28251 des_filepath(n_filename, filename, 0); 28252 xmlResetLastError(); 28253 if (mem_base != xmlMemBlocks()) { 28254 printf("Leak of %d blocks found in xmlIOHTTPOpen", 28255 xmlMemBlocks() - mem_base); 28256 test_ret++; 28257 printf(" %d", n_filename); 28258 printf("\n"); 28259 } 28260 } 28261 function_tests++; 28262 #endif 28263 28264 return(test_ret); 28265 } 28266 28267 28268 static int 28269 test_xmlIOHTTPRead(void) { 28270 int test_ret = 0; 28271 28272 #if defined(LIBXML_HTTP_ENABLED) 28273 int mem_base; 28274 int ret_val; 28275 void * context; /* the I/O context */ 28276 int n_context; 28277 char * buffer; /* where to drop data */ 28278 int n_buffer; 28279 int len; /* number of bytes to write */ 28280 int n_len; 28281 28282 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 28283 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 28284 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28285 mem_base = xmlMemBlocks(); 28286 context = gen_void_ptr(n_context, 0); 28287 buffer = gen_char_ptr(n_buffer, 1); 28288 len = gen_int(n_len, 2); 28289 28290 ret_val = xmlIOHTTPRead(context, buffer, len); 28291 desret_int(ret_val); 28292 call_tests++; 28293 des_void_ptr(n_context, context, 0); 28294 des_char_ptr(n_buffer, buffer, 1); 28295 des_int(n_len, len, 2); 28296 xmlResetLastError(); 28297 if (mem_base != xmlMemBlocks()) { 28298 printf("Leak of %d blocks found in xmlIOHTTPRead", 28299 xmlMemBlocks() - mem_base); 28300 test_ret++; 28301 printf(" %d", n_context); 28302 printf(" %d", n_buffer); 28303 printf(" %d", n_len); 28304 printf("\n"); 28305 } 28306 } 28307 } 28308 } 28309 function_tests++; 28310 #endif 28311 28312 return(test_ret); 28313 } 28314 28315 28316 static int 28317 test_xmlNoNetExternalEntityLoader(void) { 28318 int test_ret = 0; 28319 28320 int mem_base; 28321 xmlParserInputPtr ret_val; 28322 const char * URL; /* the URL for the entity to load */ 28323 int n_URL; 28324 char * ID; /* the System ID for the entity to load */ 28325 int n_ID; 28326 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */ 28327 int n_ctxt; 28328 28329 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 28330 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) { 28331 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 28332 mem_base = xmlMemBlocks(); 28333 URL = gen_filepath(n_URL, 0); 28334 ID = gen_const_char_ptr(n_ID, 1); 28335 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2); 28336 28337 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt); 28338 desret_xmlParserInputPtr(ret_val); 28339 call_tests++; 28340 des_filepath(n_URL, URL, 0); 28341 des_const_char_ptr(n_ID, (const char *)ID, 1); 28342 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2); 28343 xmlResetLastError(); 28344 if (mem_base != xmlMemBlocks()) { 28345 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader", 28346 xmlMemBlocks() - mem_base); 28347 test_ret++; 28348 printf(" %d", n_URL); 28349 printf(" %d", n_ID); 28350 printf(" %d", n_ctxt); 28351 printf("\n"); 28352 } 28353 } 28354 } 28355 } 28356 function_tests++; 28357 28358 return(test_ret); 28359 } 28360 28361 28362 static int 28363 test_xmlNormalizeWindowsPath(void) { 28364 int test_ret = 0; 28365 28366 int mem_base; 28367 xmlChar * ret_val; 28368 xmlChar * path; /* the input file path */ 28369 int n_path; 28370 28371 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { 28372 mem_base = xmlMemBlocks(); 28373 path = gen_const_xmlChar_ptr(n_path, 0); 28374 28375 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path); 28376 desret_xmlChar_ptr(ret_val); 28377 call_tests++; 28378 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); 28379 xmlResetLastError(); 28380 if (mem_base != xmlMemBlocks()) { 28381 printf("Leak of %d blocks found in xmlNormalizeWindowsPath", 28382 xmlMemBlocks() - mem_base); 28383 test_ret++; 28384 printf(" %d", n_path); 28385 printf("\n"); 28386 } 28387 } 28388 function_tests++; 28389 28390 return(test_ret); 28391 } 28392 28393 28394 static int 28395 test_xmlOutputBufferCreateBuffer(void) { 28396 int test_ret = 0; 28397 28398 #if defined(LIBXML_OUTPUT_ENABLED) 28399 int mem_base; 28400 xmlOutputBufferPtr ret_val; 28401 xmlBufferPtr buffer; /* a xmlBufferPtr */ 28402 int n_buffer; 28403 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28404 int n_encoder; 28405 28406 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { 28407 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28408 mem_base = xmlMemBlocks(); 28409 buffer = gen_xmlBufferPtr(n_buffer, 0); 28410 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28411 28412 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder); 28413 desret_xmlOutputBufferPtr(ret_val); 28414 call_tests++; 28415 des_xmlBufferPtr(n_buffer, buffer, 0); 28416 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28417 xmlResetLastError(); 28418 if (mem_base != xmlMemBlocks()) { 28419 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer", 28420 xmlMemBlocks() - mem_base); 28421 test_ret++; 28422 printf(" %d", n_buffer); 28423 printf(" %d", n_encoder); 28424 printf("\n"); 28425 } 28426 } 28427 } 28428 function_tests++; 28429 #endif 28430 28431 return(test_ret); 28432 } 28433 28434 28435 static int 28436 test_xmlOutputBufferCreateFd(void) { 28437 int test_ret = 0; 28438 28439 #if defined(LIBXML_OUTPUT_ENABLED) 28440 int mem_base; 28441 xmlOutputBufferPtr ret_val; 28442 int fd; /* a file descriptor number */ 28443 int n_fd; 28444 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28445 int n_encoder; 28446 28447 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { 28448 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28449 mem_base = xmlMemBlocks(); 28450 fd = gen_int(n_fd, 0); 28451 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28452 28453 ret_val = xmlOutputBufferCreateFd(fd, encoder); 28454 desret_xmlOutputBufferPtr(ret_val); 28455 call_tests++; 28456 des_int(n_fd, fd, 0); 28457 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28458 xmlResetLastError(); 28459 if (mem_base != xmlMemBlocks()) { 28460 printf("Leak of %d blocks found in xmlOutputBufferCreateFd", 28461 xmlMemBlocks() - mem_base); 28462 test_ret++; 28463 printf(" %d", n_fd); 28464 printf(" %d", n_encoder); 28465 printf("\n"); 28466 } 28467 } 28468 } 28469 function_tests++; 28470 #endif 28471 28472 return(test_ret); 28473 } 28474 28475 28476 static int 28477 test_xmlOutputBufferCreateFile(void) { 28478 int test_ret = 0; 28479 28480 #if defined(LIBXML_OUTPUT_ENABLED) 28481 int mem_base; 28482 xmlOutputBufferPtr ret_val; 28483 FILE * file; /* a FILE* */ 28484 int n_file; 28485 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28486 int n_encoder; 28487 28488 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) { 28489 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28490 mem_base = xmlMemBlocks(); 28491 file = gen_FILE_ptr(n_file, 0); 28492 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28493 28494 ret_val = xmlOutputBufferCreateFile(file, encoder); 28495 desret_xmlOutputBufferPtr(ret_val); 28496 call_tests++; 28497 des_FILE_ptr(n_file, file, 0); 28498 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28499 xmlResetLastError(); 28500 if (mem_base != xmlMemBlocks()) { 28501 printf("Leak of %d blocks found in xmlOutputBufferCreateFile", 28502 xmlMemBlocks() - mem_base); 28503 test_ret++; 28504 printf(" %d", n_file); 28505 printf(" %d", n_encoder); 28506 printf("\n"); 28507 } 28508 } 28509 } 28510 function_tests++; 28511 #endif 28512 28513 return(test_ret); 28514 } 28515 28516 28517 static int 28518 test_xmlOutputBufferCreateFilename(void) { 28519 int test_ret = 0; 28520 28521 #if defined(LIBXML_OUTPUT_ENABLED) 28522 int mem_base; 28523 xmlOutputBufferPtr ret_val; 28524 const char * URI; /* a C string containing the URI or filename */ 28525 int n_URI; 28526 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28527 int n_encoder; 28528 int compression; /* the compression ration (0 none, 9 max). */ 28529 int n_compression; 28530 28531 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) { 28532 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28533 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { 28534 mem_base = xmlMemBlocks(); 28535 URI = gen_fileoutput(n_URI, 0); 28536 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28537 compression = gen_int(n_compression, 2); 28538 28539 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression); 28540 desret_xmlOutputBufferPtr(ret_val); 28541 call_tests++; 28542 des_fileoutput(n_URI, URI, 0); 28543 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28544 des_int(n_compression, compression, 2); 28545 xmlResetLastError(); 28546 if (mem_base != xmlMemBlocks()) { 28547 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename", 28548 xmlMemBlocks() - mem_base); 28549 test_ret++; 28550 printf(" %d", n_URI); 28551 printf(" %d", n_encoder); 28552 printf(" %d", n_compression); 28553 printf("\n"); 28554 } 28555 } 28556 } 28557 } 28558 function_tests++; 28559 #endif 28560 28561 return(test_ret); 28562 } 28563 28564 28565 static int 28566 test_xmlOutputBufferFlush(void) { 28567 int test_ret = 0; 28568 28569 #if defined(LIBXML_OUTPUT_ENABLED) 28570 int mem_base; 28571 int ret_val; 28572 xmlOutputBufferPtr out; /* a buffered output */ 28573 int n_out; 28574 28575 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28576 mem_base = xmlMemBlocks(); 28577 out = gen_xmlOutputBufferPtr(n_out, 0); 28578 28579 ret_val = xmlOutputBufferFlush(out); 28580 desret_int(ret_val); 28581 call_tests++; 28582 des_xmlOutputBufferPtr(n_out, out, 0); 28583 xmlResetLastError(); 28584 if (mem_base != xmlMemBlocks()) { 28585 printf("Leak of %d blocks found in xmlOutputBufferFlush", 28586 xmlMemBlocks() - mem_base); 28587 test_ret++; 28588 printf(" %d", n_out); 28589 printf("\n"); 28590 } 28591 } 28592 function_tests++; 28593 #endif 28594 28595 return(test_ret); 28596 } 28597 28598 28599 static int 28600 test_xmlOutputBufferGetContent(void) { 28601 int test_ret = 0; 28602 28603 #if defined(LIBXML_OUTPUT_ENABLED) 28604 int mem_base; 28605 const xmlChar * ret_val; 28606 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */ 28607 int n_out; 28608 28609 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28610 mem_base = xmlMemBlocks(); 28611 out = gen_xmlOutputBufferPtr(n_out, 0); 28612 28613 ret_val = xmlOutputBufferGetContent(out); 28614 desret_const_xmlChar_ptr(ret_val); 28615 call_tests++; 28616 des_xmlOutputBufferPtr(n_out, out, 0); 28617 xmlResetLastError(); 28618 if (mem_base != xmlMemBlocks()) { 28619 printf("Leak of %d blocks found in xmlOutputBufferGetContent", 28620 xmlMemBlocks() - mem_base); 28621 test_ret++; 28622 printf(" %d", n_out); 28623 printf("\n"); 28624 } 28625 } 28626 function_tests++; 28627 #endif 28628 28629 return(test_ret); 28630 } 28631 28632 28633 static int 28634 test_xmlOutputBufferGetSize(void) { 28635 int test_ret = 0; 28636 28637 28638 /* missing type support */ 28639 return(test_ret); 28640 } 28641 28642 28643 static int 28644 test_xmlOutputBufferWrite(void) { 28645 int test_ret = 0; 28646 28647 #if defined(LIBXML_OUTPUT_ENABLED) 28648 int mem_base; 28649 int ret_val; 28650 xmlOutputBufferPtr out; /* a buffered parser output */ 28651 int n_out; 28652 int len; /* the size in bytes of the array. */ 28653 int n_len; 28654 char * buf; /* an char array */ 28655 int n_buf; 28656 28657 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28658 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28659 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { 28660 mem_base = xmlMemBlocks(); 28661 out = gen_xmlOutputBufferPtr(n_out, 0); 28662 len = gen_int(n_len, 1); 28663 buf = gen_const_char_ptr(n_buf, 2); 28664 28665 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf); 28666 desret_int(ret_val); 28667 call_tests++; 28668 des_xmlOutputBufferPtr(n_out, out, 0); 28669 des_int(n_len, len, 1); 28670 des_const_char_ptr(n_buf, (const char *)buf, 2); 28671 xmlResetLastError(); 28672 if (mem_base != xmlMemBlocks()) { 28673 printf("Leak of %d blocks found in xmlOutputBufferWrite", 28674 xmlMemBlocks() - mem_base); 28675 test_ret++; 28676 printf(" %d", n_out); 28677 printf(" %d", n_len); 28678 printf(" %d", n_buf); 28679 printf("\n"); 28680 } 28681 } 28682 } 28683 } 28684 function_tests++; 28685 #endif 28686 28687 return(test_ret); 28688 } 28689 28690 28691 static int 28692 test_xmlOutputBufferWriteEscape(void) { 28693 int test_ret = 0; 28694 28695 28696 /* missing type support */ 28697 return(test_ret); 28698 } 28699 28700 28701 static int 28702 test_xmlOutputBufferWriteString(void) { 28703 int test_ret = 0; 28704 28705 #if defined(LIBXML_OUTPUT_ENABLED) 28706 int mem_base; 28707 int ret_val; 28708 xmlOutputBufferPtr out; /* a buffered parser output */ 28709 int n_out; 28710 char * str; /* a zero terminated C string */ 28711 int n_str; 28712 28713 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28714 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { 28715 mem_base = xmlMemBlocks(); 28716 out = gen_xmlOutputBufferPtr(n_out, 0); 28717 str = gen_const_char_ptr(n_str, 1); 28718 28719 ret_val = xmlOutputBufferWriteString(out, (const char *)str); 28720 desret_int(ret_val); 28721 call_tests++; 28722 des_xmlOutputBufferPtr(n_out, out, 0); 28723 des_const_char_ptr(n_str, (const char *)str, 1); 28724 xmlResetLastError(); 28725 if (mem_base != xmlMemBlocks()) { 28726 printf("Leak of %d blocks found in xmlOutputBufferWriteString", 28727 xmlMemBlocks() - mem_base); 28728 test_ret++; 28729 printf(" %d", n_out); 28730 printf(" %d", n_str); 28731 printf("\n"); 28732 } 28733 } 28734 } 28735 function_tests++; 28736 #endif 28737 28738 return(test_ret); 28739 } 28740 28741 28742 static int 28743 test_xmlParserGetDirectory(void) { 28744 int test_ret = 0; 28745 28746 28747 /* missing type support */ 28748 return(test_ret); 28749 } 28750 28751 28752 static int 28753 test_xmlParserInputBufferCreateFd(void) { 28754 int test_ret = 0; 28755 28756 int mem_base; 28757 xmlParserInputBufferPtr ret_val; 28758 int fd; /* a file descriptor number */ 28759 int n_fd; 28760 xmlCharEncoding enc; /* the charset encoding if known */ 28761 int n_enc; 28762 28763 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { 28764 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28765 mem_base = xmlMemBlocks(); 28766 fd = gen_int(n_fd, 0); 28767 enc = gen_xmlCharEncoding(n_enc, 1); 28768 if (fd >= 0) fd = -1; 28769 28770 ret_val = xmlParserInputBufferCreateFd(fd, enc); 28771 desret_xmlParserInputBufferPtr(ret_val); 28772 call_tests++; 28773 des_int(n_fd, fd, 0); 28774 des_xmlCharEncoding(n_enc, enc, 1); 28775 xmlResetLastError(); 28776 if (mem_base != xmlMemBlocks()) { 28777 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd", 28778 xmlMemBlocks() - mem_base); 28779 test_ret++; 28780 printf(" %d", n_fd); 28781 printf(" %d", n_enc); 28782 printf("\n"); 28783 } 28784 } 28785 } 28786 function_tests++; 28787 28788 return(test_ret); 28789 } 28790 28791 28792 static int 28793 test_xmlParserInputBufferCreateFile(void) { 28794 int test_ret = 0; 28795 28796 int mem_base; 28797 xmlParserInputBufferPtr ret_val; 28798 FILE * file; /* a FILE* */ 28799 int n_file; 28800 xmlCharEncoding enc; /* the charset encoding if known */ 28801 int n_enc; 28802 28803 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) { 28804 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28805 mem_base = xmlMemBlocks(); 28806 file = gen_FILE_ptr(n_file, 0); 28807 enc = gen_xmlCharEncoding(n_enc, 1); 28808 28809 ret_val = xmlParserInputBufferCreateFile(file, enc); 28810 desret_xmlParserInputBufferPtr(ret_val); 28811 call_tests++; 28812 des_FILE_ptr(n_file, file, 0); 28813 des_xmlCharEncoding(n_enc, enc, 1); 28814 xmlResetLastError(); 28815 if (mem_base != xmlMemBlocks()) { 28816 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile", 28817 xmlMemBlocks() - mem_base); 28818 test_ret++; 28819 printf(" %d", n_file); 28820 printf(" %d", n_enc); 28821 printf("\n"); 28822 } 28823 } 28824 } 28825 function_tests++; 28826 28827 return(test_ret); 28828 } 28829 28830 28831 static int 28832 test_xmlParserInputBufferCreateFilename(void) { 28833 int test_ret = 0; 28834 28835 int mem_base; 28836 xmlParserInputBufferPtr ret_val; 28837 const char * URI; /* a C string containing the URI or filename */ 28838 int n_URI; 28839 xmlCharEncoding enc; /* the charset encoding if known */ 28840 int n_enc; 28841 28842 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) { 28843 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28844 mem_base = xmlMemBlocks(); 28845 URI = gen_fileoutput(n_URI, 0); 28846 enc = gen_xmlCharEncoding(n_enc, 1); 28847 28848 ret_val = xmlParserInputBufferCreateFilename(URI, enc); 28849 desret_xmlParserInputBufferPtr(ret_val); 28850 call_tests++; 28851 des_fileoutput(n_URI, URI, 0); 28852 des_xmlCharEncoding(n_enc, enc, 1); 28853 xmlResetLastError(); 28854 if (mem_base != xmlMemBlocks()) { 28855 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename", 28856 xmlMemBlocks() - mem_base); 28857 test_ret++; 28858 printf(" %d", n_URI); 28859 printf(" %d", n_enc); 28860 printf("\n"); 28861 } 28862 } 28863 } 28864 function_tests++; 28865 28866 return(test_ret); 28867 } 28868 28869 28870 static int 28871 test_xmlParserInputBufferCreateMem(void) { 28872 int test_ret = 0; 28873 28874 int mem_base; 28875 xmlParserInputBufferPtr ret_val; 28876 char * mem; /* the memory input */ 28877 int n_mem; 28878 int size; /* the length of the memory block */ 28879 int n_size; 28880 xmlCharEncoding enc; /* the charset encoding if known */ 28881 int n_enc; 28882 28883 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) { 28884 for (n_size = 0;n_size < gen_nb_int;n_size++) { 28885 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28886 mem_base = xmlMemBlocks(); 28887 mem = gen_const_char_ptr(n_mem, 0); 28888 size = gen_int(n_size, 1); 28889 enc = gen_xmlCharEncoding(n_enc, 2); 28890 28891 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc); 28892 desret_xmlParserInputBufferPtr(ret_val); 28893 call_tests++; 28894 des_const_char_ptr(n_mem, (const char *)mem, 0); 28895 des_int(n_size, size, 1); 28896 des_xmlCharEncoding(n_enc, enc, 2); 28897 xmlResetLastError(); 28898 if (mem_base != xmlMemBlocks()) { 28899 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem", 28900 xmlMemBlocks() - mem_base); 28901 test_ret++; 28902 printf(" %d", n_mem); 28903 printf(" %d", n_size); 28904 printf(" %d", n_enc); 28905 printf("\n"); 28906 } 28907 } 28908 } 28909 } 28910 function_tests++; 28911 28912 return(test_ret); 28913 } 28914 28915 28916 static int 28917 test_xmlParserInputBufferCreateStatic(void) { 28918 int test_ret = 0; 28919 28920 int mem_base; 28921 xmlParserInputBufferPtr ret_val; 28922 char * mem; /* the memory input */ 28923 int n_mem; 28924 int size; /* the length of the memory block */ 28925 int n_size; 28926 xmlCharEncoding enc; /* the charset encoding if known */ 28927 int n_enc; 28928 28929 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) { 28930 for (n_size = 0;n_size < gen_nb_int;n_size++) { 28931 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28932 mem_base = xmlMemBlocks(); 28933 mem = gen_const_char_ptr(n_mem, 0); 28934 size = gen_int(n_size, 1); 28935 enc = gen_xmlCharEncoding(n_enc, 2); 28936 28937 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc); 28938 desret_xmlParserInputBufferPtr(ret_val); 28939 call_tests++; 28940 des_const_char_ptr(n_mem, (const char *)mem, 0); 28941 des_int(n_size, size, 1); 28942 des_xmlCharEncoding(n_enc, enc, 2); 28943 xmlResetLastError(); 28944 if (mem_base != xmlMemBlocks()) { 28945 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic", 28946 xmlMemBlocks() - mem_base); 28947 test_ret++; 28948 printf(" %d", n_mem); 28949 printf(" %d", n_size); 28950 printf(" %d", n_enc); 28951 printf("\n"); 28952 } 28953 } 28954 } 28955 } 28956 function_tests++; 28957 28958 return(test_ret); 28959 } 28960 28961 28962 static int 28963 test_xmlParserInputBufferGrow(void) { 28964 int test_ret = 0; 28965 28966 int mem_base; 28967 int ret_val; 28968 xmlParserInputBufferPtr in; /* a buffered parser input */ 28969 int n_in; 28970 int len; /* indicative value of the amount of chars to read */ 28971 int n_len; 28972 28973 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { 28974 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28975 mem_base = xmlMemBlocks(); 28976 in = gen_xmlParserInputBufferPtr(n_in, 0); 28977 len = gen_int(n_len, 1); 28978 28979 ret_val = xmlParserInputBufferGrow(in, len); 28980 desret_int(ret_val); 28981 call_tests++; 28982 des_xmlParserInputBufferPtr(n_in, in, 0); 28983 des_int(n_len, len, 1); 28984 xmlResetLastError(); 28985 if (mem_base != xmlMemBlocks()) { 28986 printf("Leak of %d blocks found in xmlParserInputBufferGrow", 28987 xmlMemBlocks() - mem_base); 28988 test_ret++; 28989 printf(" %d", n_in); 28990 printf(" %d", n_len); 28991 printf("\n"); 28992 } 28993 } 28994 } 28995 function_tests++; 28996 28997 return(test_ret); 28998 } 28999 29000 29001 static int 29002 test_xmlParserInputBufferPush(void) { 29003 int test_ret = 0; 29004 29005 int mem_base; 29006 int ret_val; 29007 xmlParserInputBufferPtr in; /* a buffered parser input */ 29008 int n_in; 29009 int len; /* the size in bytes of the array. */ 29010 int n_len; 29011 char * buf; /* an char array */ 29012 int n_buf; 29013 29014 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { 29015 for (n_len = 0;n_len < gen_nb_int;n_len++) { 29016 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { 29017 mem_base = xmlMemBlocks(); 29018 in = gen_xmlParserInputBufferPtr(n_in, 0); 29019 len = gen_int(n_len, 1); 29020 buf = gen_const_char_ptr(n_buf, 2); 29021 29022 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf); 29023 desret_int(ret_val); 29024 call_tests++; 29025 des_xmlParserInputBufferPtr(n_in, in, 0); 29026 des_int(n_len, len, 1); 29027 des_const_char_ptr(n_buf, (const char *)buf, 2); 29028 xmlResetLastError(); 29029 if (mem_base != xmlMemBlocks()) { 29030 printf("Leak of %d blocks found in xmlParserInputBufferPush", 29031 xmlMemBlocks() - mem_base); 29032 test_ret++; 29033 printf(" %d", n_in); 29034 printf(" %d", n_len); 29035 printf(" %d", n_buf); 29036 printf("\n"); 29037 } 29038 } 29039 } 29040 } 29041 function_tests++; 29042 29043 return(test_ret); 29044 } 29045 29046 29047 static int 29048 test_xmlParserInputBufferRead(void) { 29049 int test_ret = 0; 29050 29051 int mem_base; 29052 int ret_val; 29053 xmlParserInputBufferPtr in; /* a buffered parser input */ 29054 int n_in; 29055 int len; /* indicative value of the amount of chars to read */ 29056 int n_len; 29057 29058 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { 29059 for (n_len = 0;n_len < gen_nb_int;n_len++) { 29060 mem_base = xmlMemBlocks(); 29061 in = gen_xmlParserInputBufferPtr(n_in, 0); 29062 len = gen_int(n_len, 1); 29063 29064 ret_val = xmlParserInputBufferRead(in, len); 29065 desret_int(ret_val); 29066 call_tests++; 29067 des_xmlParserInputBufferPtr(n_in, in, 0); 29068 des_int(n_len, len, 1); 29069 xmlResetLastError(); 29070 if (mem_base != xmlMemBlocks()) { 29071 printf("Leak of %d blocks found in xmlParserInputBufferRead", 29072 xmlMemBlocks() - mem_base); 29073 test_ret++; 29074 printf(" %d", n_in); 29075 printf(" %d", n_len); 29076 printf("\n"); 29077 } 29078 } 29079 } 29080 function_tests++; 29081 29082 return(test_ret); 29083 } 29084 29085 29086 static int 29087 test_xmlPopInputCallbacks(void) { 29088 int test_ret = 0; 29089 29090 int mem_base; 29091 int ret_val; 29092 29093 mem_base = xmlMemBlocks(); 29094 29095 ret_val = xmlPopInputCallbacks(); 29096 desret_int(ret_val); 29097 call_tests++; 29098 xmlResetLastError(); 29099 if (mem_base != xmlMemBlocks()) { 29100 printf("Leak of %d blocks found in xmlPopInputCallbacks", 29101 xmlMemBlocks() - mem_base); 29102 test_ret++; 29103 printf("\n"); 29104 } 29105 function_tests++; 29106 29107 return(test_ret); 29108 } 29109 29110 29111 static int 29112 test_xmlRegisterDefaultInputCallbacks(void) { 29113 int test_ret = 0; 29114 29115 int mem_base; 29116 29117 mem_base = xmlMemBlocks(); 29118 29119 xmlRegisterDefaultInputCallbacks(); 29120 call_tests++; 29121 xmlResetLastError(); 29122 if (mem_base != xmlMemBlocks()) { 29123 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks", 29124 xmlMemBlocks() - mem_base); 29125 test_ret++; 29126 printf("\n"); 29127 } 29128 function_tests++; 29129 29130 return(test_ret); 29131 } 29132 29133 29134 static int 29135 test_xmlRegisterDefaultOutputCallbacks(void) { 29136 int test_ret = 0; 29137 29138 #if defined(LIBXML_OUTPUT_ENABLED) 29139 int mem_base; 29140 29141 mem_base = xmlMemBlocks(); 29142 29143 xmlRegisterDefaultOutputCallbacks(); 29144 call_tests++; 29145 xmlResetLastError(); 29146 if (mem_base != xmlMemBlocks()) { 29147 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks", 29148 xmlMemBlocks() - mem_base); 29149 test_ret++; 29150 printf("\n"); 29151 } 29152 function_tests++; 29153 #endif 29154 29155 return(test_ret); 29156 } 29157 29158 29159 static int 29160 test_xmlRegisterHTTPPostCallbacks(void) { 29161 int test_ret = 0; 29162 29163 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED) 29164 int mem_base; 29165 29166 mem_base = xmlMemBlocks(); 29167 29168 xmlRegisterHTTPPostCallbacks(); 29169 call_tests++; 29170 xmlResetLastError(); 29171 if (mem_base != xmlMemBlocks()) { 29172 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks", 29173 xmlMemBlocks() - mem_base); 29174 test_ret++; 29175 printf("\n"); 29176 } 29177 function_tests++; 29178 #endif 29179 29180 return(test_ret); 29181 } 29182 29183 static int 29184 test_xmlIO(void) { 29185 int test_ret = 0; 29186 29187 if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n"); 29188 test_ret += test_xmlAllocOutputBuffer(); 29189 test_ret += test_xmlAllocParserInputBuffer(); 29190 test_ret += test_xmlCheckFilename(); 29191 test_ret += test_xmlCheckHTTPInput(); 29192 test_ret += test_xmlCleanupInputCallbacks(); 29193 test_ret += test_xmlCleanupOutputCallbacks(); 29194 test_ret += test_xmlFileClose(); 29195 test_ret += test_xmlFileMatch(); 29196 test_ret += test_xmlFileOpen(); 29197 test_ret += test_xmlFileRead(); 29198 test_ret += test_xmlIOFTPClose(); 29199 test_ret += test_xmlIOFTPMatch(); 29200 test_ret += test_xmlIOFTPOpen(); 29201 test_ret += test_xmlIOFTPRead(); 29202 test_ret += test_xmlIOHTTPClose(); 29203 test_ret += test_xmlIOHTTPMatch(); 29204 test_ret += test_xmlIOHTTPOpen(); 29205 test_ret += test_xmlIOHTTPRead(); 29206 test_ret += test_xmlNoNetExternalEntityLoader(); 29207 test_ret += test_xmlNormalizeWindowsPath(); 29208 test_ret += test_xmlOutputBufferCreateBuffer(); 29209 test_ret += test_xmlOutputBufferCreateFd(); 29210 test_ret += test_xmlOutputBufferCreateFile(); 29211 test_ret += test_xmlOutputBufferCreateFilename(); 29212 test_ret += test_xmlOutputBufferFlush(); 29213 test_ret += test_xmlOutputBufferGetContent(); 29214 test_ret += test_xmlOutputBufferGetSize(); 29215 test_ret += test_xmlOutputBufferWrite(); 29216 test_ret += test_xmlOutputBufferWriteEscape(); 29217 test_ret += test_xmlOutputBufferWriteString(); 29218 test_ret += test_xmlParserGetDirectory(); 29219 test_ret += test_xmlParserInputBufferCreateFd(); 29220 test_ret += test_xmlParserInputBufferCreateFile(); 29221 test_ret += test_xmlParserInputBufferCreateFilename(); 29222 test_ret += test_xmlParserInputBufferCreateMem(); 29223 test_ret += test_xmlParserInputBufferCreateStatic(); 29224 test_ret += test_xmlParserInputBufferGrow(); 29225 test_ret += test_xmlParserInputBufferPush(); 29226 test_ret += test_xmlParserInputBufferRead(); 29227 test_ret += test_xmlPopInputCallbacks(); 29228 test_ret += test_xmlRegisterDefaultInputCallbacks(); 29229 test_ret += test_xmlRegisterDefaultOutputCallbacks(); 29230 test_ret += test_xmlRegisterHTTPPostCallbacks(); 29231 29232 if (test_ret != 0) 29233 printf("Module xmlIO: %d errors\n", test_ret); 29234 return(test_ret); 29235 } 29236 #ifdef LIBXML_AUTOMATA_ENABLED 29237 29238 #define gen_nb_xmlAutomataPtr 1 29239 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29240 return(NULL); 29241 } 29242 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29243 } 29244 #endif 29245 29246 29247 static int 29248 test_xmlAutomataCompile(void) { 29249 int test_ret = 0; 29250 29251 29252 /* missing type support */ 29253 return(test_ret); 29254 } 29255 29256 29257 static int 29258 test_xmlAutomataGetInitState(void) { 29259 int test_ret = 0; 29260 29261 29262 /* missing type support */ 29263 return(test_ret); 29264 } 29265 29266 29267 static int 29268 test_xmlAutomataIsDeterminist(void) { 29269 int test_ret = 0; 29270 29271 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) 29272 int mem_base; 29273 int ret_val; 29274 xmlAutomataPtr am; /* an automata */ 29275 int n_am; 29276 29277 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { 29278 mem_base = xmlMemBlocks(); 29279 am = gen_xmlAutomataPtr(n_am, 0); 29280 29281 ret_val = xmlAutomataIsDeterminist(am); 29282 desret_int(ret_val); 29283 call_tests++; 29284 des_xmlAutomataPtr(n_am, am, 0); 29285 xmlResetLastError(); 29286 if (mem_base != xmlMemBlocks()) { 29287 printf("Leak of %d blocks found in xmlAutomataIsDeterminist", 29288 xmlMemBlocks() - mem_base); 29289 test_ret++; 29290 printf(" %d", n_am); 29291 printf("\n"); 29292 } 29293 } 29294 function_tests++; 29295 #endif 29296 29297 return(test_ret); 29298 } 29299 29300 #ifdef LIBXML_AUTOMATA_ENABLED 29301 29302 #define gen_nb_xmlAutomataStatePtr 1 29303 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29304 return(NULL); 29305 } 29306 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29307 } 29308 #endif 29309 29310 29311 static int 29312 test_xmlAutomataNewAllTrans(void) { 29313 int test_ret = 0; 29314 29315 29316 /* missing type support */ 29317 return(test_ret); 29318 } 29319 29320 29321 static int 29322 test_xmlAutomataNewCountTrans(void) { 29323 int test_ret = 0; 29324 29325 29326 /* missing type support */ 29327 return(test_ret); 29328 } 29329 29330 29331 static int 29332 test_xmlAutomataNewCountTrans2(void) { 29333 int test_ret = 0; 29334 29335 29336 /* missing type support */ 29337 return(test_ret); 29338 } 29339 29340 29341 static int 29342 test_xmlAutomataNewCountedTrans(void) { 29343 int test_ret = 0; 29344 29345 29346 /* missing type support */ 29347 return(test_ret); 29348 } 29349 29350 29351 static int 29352 test_xmlAutomataNewCounter(void) { 29353 int test_ret = 0; 29354 29355 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) 29356 int mem_base; 29357 int ret_val; 29358 xmlAutomataPtr am; /* an automata */ 29359 int n_am; 29360 int min; /* the minimal value on the counter */ 29361 int n_min; 29362 int max; /* the maximal value on the counter */ 29363 int n_max; 29364 29365 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { 29366 for (n_min = 0;n_min < gen_nb_int;n_min++) { 29367 for (n_max = 0;n_max < gen_nb_int;n_max++) { 29368 mem_base = xmlMemBlocks(); 29369 am = gen_xmlAutomataPtr(n_am, 0); 29370 min = gen_int(n_min, 1); 29371 max = gen_int(n_max, 2); 29372 29373 ret_val = xmlAutomataNewCounter(am, min, max); 29374 desret_int(ret_val); 29375 call_tests++; 29376 des_xmlAutomataPtr(n_am, am, 0); 29377 des_int(n_min, min, 1); 29378 des_int(n_max, max, 2); 29379 xmlResetLastError(); 29380 if (mem_base != xmlMemBlocks()) { 29381 printf("Leak of %d blocks found in xmlAutomataNewCounter", 29382 xmlMemBlocks() - mem_base); 29383 test_ret++; 29384 printf(" %d", n_am); 29385 printf(" %d", n_min); 29386 printf(" %d", n_max); 29387 printf("\n"); 29388 } 29389 } 29390 } 29391 } 29392 function_tests++; 29393 #endif 29394 29395 return(test_ret); 29396 } 29397 29398 29399 static int 29400 test_xmlAutomataNewCounterTrans(void) { 29401 int test_ret = 0; 29402 29403 29404 /* missing type support */ 29405 return(test_ret); 29406 } 29407 29408 29409 static int 29410 test_xmlAutomataNewEpsilon(void) { 29411 int test_ret = 0; 29412 29413 29414 /* missing type support */ 29415 return(test_ret); 29416 } 29417 29418 29419 static int 29420 test_xmlAutomataNewNegTrans(void) { 29421 int test_ret = 0; 29422 29423 29424 /* missing type support */ 29425 return(test_ret); 29426 } 29427 29428 29429 static int 29430 test_xmlAutomataNewOnceTrans(void) { 29431 int test_ret = 0; 29432 29433 29434 /* missing type support */ 29435 return(test_ret); 29436 } 29437 29438 29439 static int 29440 test_xmlAutomataNewOnceTrans2(void) { 29441 int test_ret = 0; 29442 29443 29444 /* missing type support */ 29445 return(test_ret); 29446 } 29447 29448 29449 static int 29450 test_xmlAutomataNewState(void) { 29451 int test_ret = 0; 29452 29453 29454 /* missing type support */ 29455 return(test_ret); 29456 } 29457 29458 29459 static int 29460 test_xmlAutomataNewTransition(void) { 29461 int test_ret = 0; 29462 29463 29464 /* missing type support */ 29465 return(test_ret); 29466 } 29467 29468 29469 static int 29470 test_xmlAutomataNewTransition2(void) { 29471 int test_ret = 0; 29472 29473 29474 /* missing type support */ 29475 return(test_ret); 29476 } 29477 29478 29479 static int 29480 test_xmlAutomataSetFinalState(void) { 29481 int test_ret = 0; 29482 29483 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) 29484 int mem_base; 29485 int ret_val; 29486 xmlAutomataPtr am; /* an automata */ 29487 int n_am; 29488 xmlAutomataStatePtr state; /* a state in this automata */ 29489 int n_state; 29490 29491 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { 29492 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) { 29493 mem_base = xmlMemBlocks(); 29494 am = gen_xmlAutomataPtr(n_am, 0); 29495 state = gen_xmlAutomataStatePtr(n_state, 1); 29496 29497 ret_val = xmlAutomataSetFinalState(am, state); 29498 desret_int(ret_val); 29499 call_tests++; 29500 des_xmlAutomataPtr(n_am, am, 0); 29501 des_xmlAutomataStatePtr(n_state, state, 1); 29502 xmlResetLastError(); 29503 if (mem_base != xmlMemBlocks()) { 29504 printf("Leak of %d blocks found in xmlAutomataSetFinalState", 29505 xmlMemBlocks() - mem_base); 29506 test_ret++; 29507 printf(" %d", n_am); 29508 printf(" %d", n_state); 29509 printf("\n"); 29510 } 29511 } 29512 } 29513 function_tests++; 29514 #endif 29515 29516 return(test_ret); 29517 } 29518 29519 29520 static int 29521 test_xmlNewAutomata(void) { 29522 int test_ret = 0; 29523 29524 29525 /* missing type support */ 29526 return(test_ret); 29527 } 29528 29529 static int 29530 test_xmlautomata(void) { 29531 int test_ret = 0; 29532 29533 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n"); 29534 test_ret += test_xmlAutomataCompile(); 29535 test_ret += test_xmlAutomataGetInitState(); 29536 test_ret += test_xmlAutomataIsDeterminist(); 29537 test_ret += test_xmlAutomataNewAllTrans(); 29538 test_ret += test_xmlAutomataNewCountTrans(); 29539 test_ret += test_xmlAutomataNewCountTrans2(); 29540 test_ret += test_xmlAutomataNewCountedTrans(); 29541 test_ret += test_xmlAutomataNewCounter(); 29542 test_ret += test_xmlAutomataNewCounterTrans(); 29543 test_ret += test_xmlAutomataNewEpsilon(); 29544 test_ret += test_xmlAutomataNewNegTrans(); 29545 test_ret += test_xmlAutomataNewOnceTrans(); 29546 test_ret += test_xmlAutomataNewOnceTrans2(); 29547 test_ret += test_xmlAutomataNewState(); 29548 test_ret += test_xmlAutomataNewTransition(); 29549 test_ret += test_xmlAutomataNewTransition2(); 29550 test_ret += test_xmlAutomataSetFinalState(); 29551 test_ret += test_xmlNewAutomata(); 29552 29553 if (test_ret != 0) 29554 printf("Module xmlautomata: %d errors\n", test_ret); 29555 return(test_ret); 29556 } 29557 29558 #define gen_nb_xmlGenericErrorFunc_ptr 1 29559 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29560 return(NULL); 29561 } 29562 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29563 } 29564 29565 static int 29566 test_initGenericErrorDefaultFunc(void) { 29567 int test_ret = 0; 29568 29569 int mem_base; 29570 xmlGenericErrorFunc * handler; /* the handler */ 29571 int n_handler; 29572 29573 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) { 29574 mem_base = xmlMemBlocks(); 29575 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0); 29576 29577 initGenericErrorDefaultFunc(handler); 29578 call_tests++; 29579 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0); 29580 xmlResetLastError(); 29581 if (mem_base != xmlMemBlocks()) { 29582 printf("Leak of %d blocks found in initGenericErrorDefaultFunc", 29583 xmlMemBlocks() - mem_base); 29584 test_ret++; 29585 printf(" %d", n_handler); 29586 printf("\n"); 29587 } 29588 } 29589 function_tests++; 29590 29591 return(test_ret); 29592 } 29593 29594 29595 #define gen_nb_xmlErrorPtr 1 29596 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29597 return(NULL); 29598 } 29599 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29600 } 29601 29602 static int 29603 test_xmlCopyError(void) { 29604 int test_ret = 0; 29605 29606 int mem_base; 29607 int ret_val; 29608 xmlErrorPtr from; /* a source error */ 29609 int n_from; 29610 xmlErrorPtr to; /* a target error */ 29611 int n_to; 29612 29613 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) { 29614 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) { 29615 mem_base = xmlMemBlocks(); 29616 from = gen_xmlErrorPtr(n_from, 0); 29617 to = gen_xmlErrorPtr(n_to, 1); 29618 29619 ret_val = xmlCopyError(from, to); 29620 desret_int(ret_val); 29621 call_tests++; 29622 des_xmlErrorPtr(n_from, from, 0); 29623 des_xmlErrorPtr(n_to, to, 1); 29624 xmlResetLastError(); 29625 if (mem_base != xmlMemBlocks()) { 29626 printf("Leak of %d blocks found in xmlCopyError", 29627 xmlMemBlocks() - mem_base); 29628 test_ret++; 29629 printf(" %d", n_from); 29630 printf(" %d", n_to); 29631 printf("\n"); 29632 } 29633 } 29634 } 29635 function_tests++; 29636 29637 return(test_ret); 29638 } 29639 29640 29641 static int 29642 test_xmlCtxtGetLastError(void) { 29643 int test_ret = 0; 29644 29645 29646 /* missing type support */ 29647 return(test_ret); 29648 } 29649 29650 29651 static int 29652 test_xmlCtxtResetLastError(void) { 29653 int test_ret = 0; 29654 29655 int mem_base; 29656 void * ctx; /* an XML parser context */ 29657 int n_ctx; 29658 29659 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 29660 mem_base = xmlMemBlocks(); 29661 ctx = gen_void_ptr(n_ctx, 0); 29662 29663 xmlCtxtResetLastError(ctx); 29664 call_tests++; 29665 des_void_ptr(n_ctx, ctx, 0); 29666 xmlResetLastError(); 29667 if (mem_base != xmlMemBlocks()) { 29668 printf("Leak of %d blocks found in xmlCtxtResetLastError", 29669 xmlMemBlocks() - mem_base); 29670 test_ret++; 29671 printf(" %d", n_ctx); 29672 printf("\n"); 29673 } 29674 } 29675 function_tests++; 29676 29677 return(test_ret); 29678 } 29679 29680 29681 static int 29682 test_xmlGetLastError(void) { 29683 int test_ret = 0; 29684 29685 29686 /* missing type support */ 29687 return(test_ret); 29688 } 29689 29690 29691 static int 29692 test_xmlParserError(void) { 29693 int test_ret = 0; 29694 29695 29696 /* missing type support */ 29697 return(test_ret); 29698 } 29699 29700 29701 static int 29702 test_xmlParserPrintFileContext(void) { 29703 int test_ret = 0; 29704 29705 int mem_base; 29706 xmlParserInputPtr input; /* an xmlParserInputPtr input */ 29707 int n_input; 29708 29709 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 29710 mem_base = xmlMemBlocks(); 29711 input = gen_xmlParserInputPtr(n_input, 0); 29712 29713 xmlParserPrintFileContext(input); 29714 call_tests++; 29715 des_xmlParserInputPtr(n_input, input, 0); 29716 xmlResetLastError(); 29717 if (mem_base != xmlMemBlocks()) { 29718 printf("Leak of %d blocks found in xmlParserPrintFileContext", 29719 xmlMemBlocks() - mem_base); 29720 test_ret++; 29721 printf(" %d", n_input); 29722 printf("\n"); 29723 } 29724 } 29725 function_tests++; 29726 29727 return(test_ret); 29728 } 29729 29730 29731 static int 29732 test_xmlParserPrintFileInfo(void) { 29733 int test_ret = 0; 29734 29735 int mem_base; 29736 xmlParserInputPtr input; /* an xmlParserInputPtr input */ 29737 int n_input; 29738 29739 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 29740 mem_base = xmlMemBlocks(); 29741 input = gen_xmlParserInputPtr(n_input, 0); 29742 29743 xmlParserPrintFileInfo(input); 29744 call_tests++; 29745 des_xmlParserInputPtr(n_input, input, 0); 29746 xmlResetLastError(); 29747 if (mem_base != xmlMemBlocks()) { 29748 printf("Leak of %d blocks found in xmlParserPrintFileInfo", 29749 xmlMemBlocks() - mem_base); 29750 test_ret++; 29751 printf(" %d", n_input); 29752 printf("\n"); 29753 } 29754 } 29755 function_tests++; 29756 29757 return(test_ret); 29758 } 29759 29760 29761 static int 29762 test_xmlParserValidityError(void) { 29763 int test_ret = 0; 29764 29765 29766 /* missing type support */ 29767 return(test_ret); 29768 } 29769 29770 29771 static int 29772 test_xmlParserValidityWarning(void) { 29773 int test_ret = 0; 29774 29775 29776 /* missing type support */ 29777 return(test_ret); 29778 } 29779 29780 29781 static int 29782 test_xmlParserWarning(void) { 29783 int test_ret = 0; 29784 29785 29786 /* missing type support */ 29787 return(test_ret); 29788 } 29789 29790 29791 static int 29792 test_xmlResetError(void) { 29793 int test_ret = 0; 29794 29795 int mem_base; 29796 xmlErrorPtr err; /* pointer to the error. */ 29797 int n_err; 29798 29799 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) { 29800 mem_base = xmlMemBlocks(); 29801 err = gen_xmlErrorPtr(n_err, 0); 29802 29803 xmlResetError(err); 29804 call_tests++; 29805 des_xmlErrorPtr(n_err, err, 0); 29806 xmlResetLastError(); 29807 if (mem_base != xmlMemBlocks()) { 29808 printf("Leak of %d blocks found in xmlResetError", 29809 xmlMemBlocks() - mem_base); 29810 test_ret++; 29811 printf(" %d", n_err); 29812 printf("\n"); 29813 } 29814 } 29815 function_tests++; 29816 29817 return(test_ret); 29818 } 29819 29820 29821 static int 29822 test_xmlResetLastError(void) { 29823 int test_ret = 0; 29824 29825 29826 29827 xmlResetLastError(); 29828 call_tests++; 29829 xmlResetLastError(); 29830 function_tests++; 29831 29832 return(test_ret); 29833 } 29834 29835 29836 static int 29837 test_xmlSetGenericErrorFunc(void) { 29838 int test_ret = 0; 29839 29840 29841 /* missing type support */ 29842 return(test_ret); 29843 } 29844 29845 29846 static int 29847 test_xmlSetStructuredErrorFunc(void) { 29848 int test_ret = 0; 29849 29850 29851 /* missing type support */ 29852 return(test_ret); 29853 } 29854 29855 static int 29856 test_xmlerror(void) { 29857 int test_ret = 0; 29858 29859 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n"); 29860 test_ret += test_initGenericErrorDefaultFunc(); 29861 test_ret += test_xmlCopyError(); 29862 test_ret += test_xmlCtxtGetLastError(); 29863 test_ret += test_xmlCtxtResetLastError(); 29864 test_ret += test_xmlGetLastError(); 29865 test_ret += test_xmlParserError(); 29866 test_ret += test_xmlParserPrintFileContext(); 29867 test_ret += test_xmlParserPrintFileInfo(); 29868 test_ret += test_xmlParserValidityError(); 29869 test_ret += test_xmlParserValidityWarning(); 29870 test_ret += test_xmlParserWarning(); 29871 test_ret += test_xmlResetError(); 29872 test_ret += test_xmlResetLastError(); 29873 test_ret += test_xmlSetGenericErrorFunc(); 29874 test_ret += test_xmlSetStructuredErrorFunc(); 29875 29876 if (test_ret != 0) 29877 printf("Module xmlerror: %d errors\n", test_ret); 29878 return(test_ret); 29879 } 29880 #ifdef LIBXML_MODULES_ENABLED 29881 29882 #define gen_nb_xmlModulePtr 1 29883 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29884 return(NULL); 29885 } 29886 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29887 } 29888 #endif 29889 29890 29891 static int 29892 test_xmlModuleClose(void) { 29893 int test_ret = 0; 29894 29895 #if defined(LIBXML_MODULES_ENABLED) 29896 int mem_base; 29897 int ret_val; 29898 xmlModulePtr module; /* the module handle */ 29899 int n_module; 29900 29901 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) { 29902 mem_base = xmlMemBlocks(); 29903 module = gen_xmlModulePtr(n_module, 0); 29904 29905 ret_val = xmlModuleClose(module); 29906 desret_int(ret_val); 29907 call_tests++; 29908 des_xmlModulePtr(n_module, module, 0); 29909 xmlResetLastError(); 29910 if (mem_base != xmlMemBlocks()) { 29911 printf("Leak of %d blocks found in xmlModuleClose", 29912 xmlMemBlocks() - mem_base); 29913 test_ret++; 29914 printf(" %d", n_module); 29915 printf("\n"); 29916 } 29917 } 29918 function_tests++; 29919 #endif 29920 29921 return(test_ret); 29922 } 29923 29924 29925 static int 29926 test_xmlModuleOpen(void) { 29927 int test_ret = 0; 29928 29929 29930 /* missing type support */ 29931 return(test_ret); 29932 } 29933 29934 29935 static int 29936 test_xmlModuleSymbol(void) { 29937 int test_ret = 0; 29938 29939 #if defined(LIBXML_MODULES_ENABLED) 29940 int mem_base; 29941 int ret_val; 29942 xmlModulePtr module; /* the module */ 29943 int n_module; 29944 char * name; /* the name of the symbol */ 29945 int n_name; 29946 void ** symbol; /* the resulting symbol address */ 29947 int n_symbol; 29948 29949 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) { 29950 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 29951 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) { 29952 mem_base = xmlMemBlocks(); 29953 module = gen_xmlModulePtr(n_module, 0); 29954 name = gen_const_char_ptr(n_name, 1); 29955 symbol = gen_void_ptr_ptr(n_symbol, 2); 29956 29957 ret_val = xmlModuleSymbol(module, (const char *)name, symbol); 29958 desret_int(ret_val); 29959 call_tests++; 29960 des_xmlModulePtr(n_module, module, 0); 29961 des_const_char_ptr(n_name, (const char *)name, 1); 29962 des_void_ptr_ptr(n_symbol, symbol, 2); 29963 xmlResetLastError(); 29964 if (mem_base != xmlMemBlocks()) { 29965 printf("Leak of %d blocks found in xmlModuleSymbol", 29966 xmlMemBlocks() - mem_base); 29967 test_ret++; 29968 printf(" %d", n_module); 29969 printf(" %d", n_name); 29970 printf(" %d", n_symbol); 29971 printf("\n"); 29972 } 29973 } 29974 } 29975 } 29976 function_tests++; 29977 #endif 29978 29979 return(test_ret); 29980 } 29981 29982 static int 29983 test_xmlmodule(void) { 29984 int test_ret = 0; 29985 29986 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n"); 29987 test_ret += test_xmlModuleClose(); 29988 test_ret += test_xmlModuleOpen(); 29989 test_ret += test_xmlModuleSymbol(); 29990 29991 if (test_ret != 0) 29992 printf("Module xmlmodule: %d errors\n", test_ret); 29993 return(test_ret); 29994 } 29995 29996 static int 29997 test_xmlNewTextReader(void) { 29998 int test_ret = 0; 29999 30000 #if defined(LIBXML_READER_ENABLED) 30001 int mem_base; 30002 xmlTextReaderPtr ret_val; 30003 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */ 30004 int n_input; 30005 const char * URI; /* the URI information for the source if available */ 30006 int n_URI; 30007 30008 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 30009 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) { 30010 mem_base = xmlMemBlocks(); 30011 input = gen_xmlParserInputBufferPtr(n_input, 0); 30012 URI = gen_filepath(n_URI, 1); 30013 30014 ret_val = xmlNewTextReader(input, URI); 30015 desret_xmlTextReaderPtr(ret_val); 30016 call_tests++; 30017 des_xmlParserInputBufferPtr(n_input, input, 0); 30018 des_filepath(n_URI, URI, 1); 30019 xmlResetLastError(); 30020 if (mem_base != xmlMemBlocks()) { 30021 printf("Leak of %d blocks found in xmlNewTextReader", 30022 xmlMemBlocks() - mem_base); 30023 test_ret++; 30024 printf(" %d", n_input); 30025 printf(" %d", n_URI); 30026 printf("\n"); 30027 } 30028 } 30029 } 30030 function_tests++; 30031 #endif 30032 30033 return(test_ret); 30034 } 30035 30036 30037 static int 30038 test_xmlNewTextReaderFilename(void) { 30039 int test_ret = 0; 30040 30041 #if defined(LIBXML_READER_ENABLED) 30042 int mem_base; 30043 xmlTextReaderPtr ret_val; 30044 const char * URI; /* the URI of the resource to process */ 30045 int n_URI; 30046 30047 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) { 30048 mem_base = xmlMemBlocks(); 30049 URI = gen_filepath(n_URI, 0); 30050 30051 ret_val = xmlNewTextReaderFilename(URI); 30052 desret_xmlTextReaderPtr(ret_val); 30053 call_tests++; 30054 des_filepath(n_URI, URI, 0); 30055 xmlResetLastError(); 30056 if (mem_base != xmlMemBlocks()) { 30057 printf("Leak of %d blocks found in xmlNewTextReaderFilename", 30058 xmlMemBlocks() - mem_base); 30059 test_ret++; 30060 printf(" %d", n_URI); 30061 printf("\n"); 30062 } 30063 } 30064 function_tests++; 30065 #endif 30066 30067 return(test_ret); 30068 } 30069 30070 30071 static int 30072 test_xmlReaderForDoc(void) { 30073 int test_ret = 0; 30074 30075 #if defined(LIBXML_READER_ENABLED) 30076 int mem_base; 30077 xmlTextReaderPtr ret_val; 30078 xmlChar * cur; /* a pointer to a zero terminated string */ 30079 int n_cur; 30080 const char * URL; /* the base URL to use for the document */ 30081 int n_URL; 30082 char * encoding; /* the document encoding, or NULL */ 30083 int n_encoding; 30084 int options; /* a combination of xmlParserOption */ 30085 int n_options; 30086 30087 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 30088 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 30089 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30090 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30091 mem_base = xmlMemBlocks(); 30092 cur = gen_const_xmlChar_ptr(n_cur, 0); 30093 URL = gen_filepath(n_URL, 1); 30094 encoding = gen_const_char_ptr(n_encoding, 2); 30095 options = gen_parseroptions(n_options, 3); 30096 30097 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options); 30098 desret_xmlTextReaderPtr(ret_val); 30099 call_tests++; 30100 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 30101 des_filepath(n_URL, URL, 1); 30102 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 30103 des_parseroptions(n_options, options, 3); 30104 xmlResetLastError(); 30105 if (mem_base != xmlMemBlocks()) { 30106 printf("Leak of %d blocks found in xmlReaderForDoc", 30107 xmlMemBlocks() - mem_base); 30108 test_ret++; 30109 printf(" %d", n_cur); 30110 printf(" %d", n_URL); 30111 printf(" %d", n_encoding); 30112 printf(" %d", n_options); 30113 printf("\n"); 30114 } 30115 } 30116 } 30117 } 30118 } 30119 function_tests++; 30120 #endif 30121 30122 return(test_ret); 30123 } 30124 30125 30126 static int 30127 test_xmlReaderForFile(void) { 30128 int test_ret = 0; 30129 30130 #if defined(LIBXML_READER_ENABLED) 30131 int mem_base; 30132 xmlTextReaderPtr ret_val; 30133 const char * filename; /* a file or URL */ 30134 int n_filename; 30135 char * encoding; /* the document encoding, or NULL */ 30136 int n_encoding; 30137 int options; /* a combination of xmlParserOption */ 30138 int n_options; 30139 30140 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 30141 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30142 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30143 mem_base = xmlMemBlocks(); 30144 filename = gen_filepath(n_filename, 0); 30145 encoding = gen_const_char_ptr(n_encoding, 1); 30146 options = gen_parseroptions(n_options, 2); 30147 30148 ret_val = xmlReaderForFile(filename, (const char *)encoding, options); 30149 desret_xmlTextReaderPtr(ret_val); 30150 call_tests++; 30151 des_filepath(n_filename, filename, 0); 30152 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 30153 des_parseroptions(n_options, options, 2); 30154 xmlResetLastError(); 30155 if (mem_base != xmlMemBlocks()) { 30156 printf("Leak of %d blocks found in xmlReaderForFile", 30157 xmlMemBlocks() - mem_base); 30158 test_ret++; 30159 printf(" %d", n_filename); 30160 printf(" %d", n_encoding); 30161 printf(" %d", n_options); 30162 printf("\n"); 30163 } 30164 } 30165 } 30166 } 30167 function_tests++; 30168 #endif 30169 30170 return(test_ret); 30171 } 30172 30173 30174 static int 30175 test_xmlReaderForMemory(void) { 30176 int test_ret = 0; 30177 30178 #if defined(LIBXML_READER_ENABLED) 30179 int mem_base; 30180 xmlTextReaderPtr ret_val; 30181 char * buffer; /* a pointer to a char array */ 30182 int n_buffer; 30183 int size; /* the size of the array */ 30184 int n_size; 30185 const char * URL; /* the base URL to use for the document */ 30186 int n_URL; 30187 char * encoding; /* the document encoding, or NULL */ 30188 int n_encoding; 30189 int options; /* a combination of xmlParserOption */ 30190 int n_options; 30191 30192 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 30193 for (n_size = 0;n_size < gen_nb_int;n_size++) { 30194 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 30195 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30196 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30197 mem_base = xmlMemBlocks(); 30198 buffer = gen_const_char_ptr(n_buffer, 0); 30199 size = gen_int(n_size, 1); 30200 URL = gen_filepath(n_URL, 2); 30201 encoding = gen_const_char_ptr(n_encoding, 3); 30202 options = gen_parseroptions(n_options, 4); 30203 30204 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options); 30205 desret_xmlTextReaderPtr(ret_val); 30206 call_tests++; 30207 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 30208 des_int(n_size, size, 1); 30209 des_filepath(n_URL, URL, 2); 30210 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 30211 des_parseroptions(n_options, options, 4); 30212 xmlResetLastError(); 30213 if (mem_base != xmlMemBlocks()) { 30214 printf("Leak of %d blocks found in xmlReaderForMemory", 30215 xmlMemBlocks() - mem_base); 30216 test_ret++; 30217 printf(" %d", n_buffer); 30218 printf(" %d", n_size); 30219 printf(" %d", n_URL); 30220 printf(" %d", n_encoding); 30221 printf(" %d", n_options); 30222 printf("\n"); 30223 } 30224 } 30225 } 30226 } 30227 } 30228 } 30229 function_tests++; 30230 #endif 30231 30232 return(test_ret); 30233 } 30234 30235 30236 static int 30237 test_xmlReaderNewDoc(void) { 30238 int test_ret = 0; 30239 30240 #if defined(LIBXML_READER_ENABLED) 30241 int mem_base; 30242 int ret_val; 30243 xmlTextReaderPtr reader; /* an XML reader */ 30244 int n_reader; 30245 xmlChar * cur; /* a pointer to a zero terminated string */ 30246 int n_cur; 30247 const char * URL; /* the base URL to use for the document */ 30248 int n_URL; 30249 char * encoding; /* the document encoding, or NULL */ 30250 int n_encoding; 30251 int options; /* a combination of xmlParserOption */ 30252 int n_options; 30253 30254 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30255 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 30256 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 30257 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30258 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30259 mem_base = xmlMemBlocks(); 30260 reader = gen_xmlTextReaderPtr(n_reader, 0); 30261 cur = gen_const_xmlChar_ptr(n_cur, 1); 30262 URL = gen_filepath(n_URL, 2); 30263 encoding = gen_const_char_ptr(n_encoding, 3); 30264 options = gen_parseroptions(n_options, 4); 30265 30266 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options); 30267 desret_int(ret_val); 30268 call_tests++; 30269 des_xmlTextReaderPtr(n_reader, reader, 0); 30270 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 30271 des_filepath(n_URL, URL, 2); 30272 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 30273 des_parseroptions(n_options, options, 4); 30274 xmlResetLastError(); 30275 if (mem_base != xmlMemBlocks()) { 30276 printf("Leak of %d blocks found in xmlReaderNewDoc", 30277 xmlMemBlocks() - mem_base); 30278 test_ret++; 30279 printf(" %d", n_reader); 30280 printf(" %d", n_cur); 30281 printf(" %d", n_URL); 30282 printf(" %d", n_encoding); 30283 printf(" %d", n_options); 30284 printf("\n"); 30285 } 30286 } 30287 } 30288 } 30289 } 30290 } 30291 function_tests++; 30292 #endif 30293 30294 return(test_ret); 30295 } 30296 30297 30298 static int 30299 test_xmlReaderNewFile(void) { 30300 int test_ret = 0; 30301 30302 #if defined(LIBXML_READER_ENABLED) 30303 int mem_base; 30304 int ret_val; 30305 xmlTextReaderPtr reader; /* an XML reader */ 30306 int n_reader; 30307 const char * filename; /* a file or URL */ 30308 int n_filename; 30309 char * encoding; /* the document encoding, or NULL */ 30310 int n_encoding; 30311 int options; /* a combination of xmlParserOption */ 30312 int n_options; 30313 30314 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30315 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 30316 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30317 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30318 mem_base = xmlMemBlocks(); 30319 reader = gen_xmlTextReaderPtr(n_reader, 0); 30320 filename = gen_filepath(n_filename, 1); 30321 encoding = gen_const_char_ptr(n_encoding, 2); 30322 options = gen_parseroptions(n_options, 3); 30323 30324 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options); 30325 desret_int(ret_val); 30326 call_tests++; 30327 des_xmlTextReaderPtr(n_reader, reader, 0); 30328 des_filepath(n_filename, filename, 1); 30329 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 30330 des_parseroptions(n_options, options, 3); 30331 xmlResetLastError(); 30332 if (mem_base != xmlMemBlocks()) { 30333 printf("Leak of %d blocks found in xmlReaderNewFile", 30334 xmlMemBlocks() - mem_base); 30335 test_ret++; 30336 printf(" %d", n_reader); 30337 printf(" %d", n_filename); 30338 printf(" %d", n_encoding); 30339 printf(" %d", n_options); 30340 printf("\n"); 30341 } 30342 } 30343 } 30344 } 30345 } 30346 function_tests++; 30347 #endif 30348 30349 return(test_ret); 30350 } 30351 30352 30353 static int 30354 test_xmlReaderNewMemory(void) { 30355 int test_ret = 0; 30356 30357 #if defined(LIBXML_READER_ENABLED) 30358 int mem_base; 30359 int ret_val; 30360 xmlTextReaderPtr reader; /* an XML reader */ 30361 int n_reader; 30362 char * buffer; /* a pointer to a char array */ 30363 int n_buffer; 30364 int size; /* the size of the array */ 30365 int n_size; 30366 const char * URL; /* the base URL to use for the document */ 30367 int n_URL; 30368 char * encoding; /* the document encoding, or NULL */ 30369 int n_encoding; 30370 int options; /* a combination of xmlParserOption */ 30371 int n_options; 30372 30373 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30374 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 30375 for (n_size = 0;n_size < gen_nb_int;n_size++) { 30376 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 30377 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30378 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30379 mem_base = xmlMemBlocks(); 30380 reader = gen_xmlTextReaderPtr(n_reader, 0); 30381 buffer = gen_const_char_ptr(n_buffer, 1); 30382 size = gen_int(n_size, 2); 30383 URL = gen_filepath(n_URL, 3); 30384 encoding = gen_const_char_ptr(n_encoding, 4); 30385 options = gen_parseroptions(n_options, 5); 30386 30387 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options); 30388 desret_int(ret_val); 30389 call_tests++; 30390 des_xmlTextReaderPtr(n_reader, reader, 0); 30391 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 30392 des_int(n_size, size, 2); 30393 des_filepath(n_URL, URL, 3); 30394 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 30395 des_parseroptions(n_options, options, 5); 30396 xmlResetLastError(); 30397 if (mem_base != xmlMemBlocks()) { 30398 printf("Leak of %d blocks found in xmlReaderNewMemory", 30399 xmlMemBlocks() - mem_base); 30400 test_ret++; 30401 printf(" %d", n_reader); 30402 printf(" %d", n_buffer); 30403 printf(" %d", n_size); 30404 printf(" %d", n_URL); 30405 printf(" %d", n_encoding); 30406 printf(" %d", n_options); 30407 printf("\n"); 30408 } 30409 } 30410 } 30411 } 30412 } 30413 } 30414 } 30415 function_tests++; 30416 #endif 30417 30418 return(test_ret); 30419 } 30420 30421 30422 static int 30423 test_xmlReaderNewWalker(void) { 30424 int test_ret = 0; 30425 30426 #if defined(LIBXML_READER_ENABLED) 30427 int mem_base; 30428 int ret_val; 30429 xmlTextReaderPtr reader; /* an XML reader */ 30430 int n_reader; 30431 xmlDocPtr doc; /* a preparsed document */ 30432 int n_doc; 30433 30434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30435 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 30436 mem_base = xmlMemBlocks(); 30437 reader = gen_xmlTextReaderPtr(n_reader, 0); 30438 doc = gen_xmlDocPtr(n_doc, 1); 30439 30440 ret_val = xmlReaderNewWalker(reader, doc); 30441 desret_int(ret_val); 30442 call_tests++; 30443 des_xmlTextReaderPtr(n_reader, reader, 0); 30444 des_xmlDocPtr(n_doc, doc, 1); 30445 xmlResetLastError(); 30446 if (mem_base != xmlMemBlocks()) { 30447 printf("Leak of %d blocks found in xmlReaderNewWalker", 30448 xmlMemBlocks() - mem_base); 30449 test_ret++; 30450 printf(" %d", n_reader); 30451 printf(" %d", n_doc); 30452 printf("\n"); 30453 } 30454 } 30455 } 30456 function_tests++; 30457 #endif 30458 30459 return(test_ret); 30460 } 30461 30462 30463 static int 30464 test_xmlReaderWalker(void) { 30465 int test_ret = 0; 30466 30467 #if defined(LIBXML_READER_ENABLED) 30468 int mem_base; 30469 xmlTextReaderPtr ret_val; 30470 xmlDocPtr doc; /* a preparsed document */ 30471 int n_doc; 30472 30473 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 30474 mem_base = xmlMemBlocks(); 30475 doc = gen_xmlDocPtr(n_doc, 0); 30476 30477 ret_val = xmlReaderWalker(doc); 30478 desret_xmlTextReaderPtr(ret_val); 30479 call_tests++; 30480 des_xmlDocPtr(n_doc, doc, 0); 30481 xmlResetLastError(); 30482 if (mem_base != xmlMemBlocks()) { 30483 printf("Leak of %d blocks found in xmlReaderWalker", 30484 xmlMemBlocks() - mem_base); 30485 test_ret++; 30486 printf(" %d", n_doc); 30487 printf("\n"); 30488 } 30489 } 30490 function_tests++; 30491 #endif 30492 30493 return(test_ret); 30494 } 30495 30496 30497 static int 30498 test_xmlTextReaderAttributeCount(void) { 30499 int test_ret = 0; 30500 30501 #if defined(LIBXML_READER_ENABLED) 30502 int mem_base; 30503 int ret_val; 30504 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30505 int n_reader; 30506 30507 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30508 mem_base = xmlMemBlocks(); 30509 reader = gen_xmlTextReaderPtr(n_reader, 0); 30510 30511 ret_val = xmlTextReaderAttributeCount(reader); 30512 desret_int(ret_val); 30513 call_tests++; 30514 des_xmlTextReaderPtr(n_reader, reader, 0); 30515 xmlResetLastError(); 30516 if (mem_base != xmlMemBlocks()) { 30517 printf("Leak of %d blocks found in xmlTextReaderAttributeCount", 30518 xmlMemBlocks() - mem_base); 30519 test_ret++; 30520 printf(" %d", n_reader); 30521 printf("\n"); 30522 } 30523 } 30524 function_tests++; 30525 #endif 30526 30527 return(test_ret); 30528 } 30529 30530 30531 static int 30532 test_xmlTextReaderBaseUri(void) { 30533 int test_ret = 0; 30534 30535 #if defined(LIBXML_READER_ENABLED) 30536 int mem_base; 30537 xmlChar * ret_val; 30538 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30539 int n_reader; 30540 30541 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30542 mem_base = xmlMemBlocks(); 30543 reader = gen_xmlTextReaderPtr(n_reader, 0); 30544 30545 ret_val = xmlTextReaderBaseUri(reader); 30546 desret_xmlChar_ptr(ret_val); 30547 call_tests++; 30548 des_xmlTextReaderPtr(n_reader, reader, 0); 30549 xmlResetLastError(); 30550 if (mem_base != xmlMemBlocks()) { 30551 printf("Leak of %d blocks found in xmlTextReaderBaseUri", 30552 xmlMemBlocks() - mem_base); 30553 test_ret++; 30554 printf(" %d", n_reader); 30555 printf("\n"); 30556 } 30557 } 30558 function_tests++; 30559 #endif 30560 30561 return(test_ret); 30562 } 30563 30564 30565 static int 30566 test_xmlTextReaderByteConsumed(void) { 30567 int test_ret = 0; 30568 30569 #if defined(LIBXML_READER_ENABLED) 30570 int mem_base; 30571 long ret_val; 30572 xmlTextReaderPtr reader; /* an XML reader */ 30573 int n_reader; 30574 30575 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30576 mem_base = xmlMemBlocks(); 30577 reader = gen_xmlTextReaderPtr(n_reader, 0); 30578 30579 ret_val = xmlTextReaderByteConsumed(reader); 30580 desret_long(ret_val); 30581 call_tests++; 30582 des_xmlTextReaderPtr(n_reader, reader, 0); 30583 xmlResetLastError(); 30584 if (mem_base != xmlMemBlocks()) { 30585 printf("Leak of %d blocks found in xmlTextReaderByteConsumed", 30586 xmlMemBlocks() - mem_base); 30587 test_ret++; 30588 printf(" %d", n_reader); 30589 printf("\n"); 30590 } 30591 } 30592 function_tests++; 30593 #endif 30594 30595 return(test_ret); 30596 } 30597 30598 30599 static int 30600 test_xmlTextReaderClose(void) { 30601 int test_ret = 0; 30602 30603 #if defined(LIBXML_READER_ENABLED) 30604 int mem_base; 30605 int ret_val; 30606 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30607 int n_reader; 30608 30609 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30610 mem_base = xmlMemBlocks(); 30611 reader = gen_xmlTextReaderPtr(n_reader, 0); 30612 30613 ret_val = xmlTextReaderClose(reader); 30614 desret_int(ret_val); 30615 call_tests++; 30616 des_xmlTextReaderPtr(n_reader, reader, 0); 30617 xmlResetLastError(); 30618 if (mem_base != xmlMemBlocks()) { 30619 printf("Leak of %d blocks found in xmlTextReaderClose", 30620 xmlMemBlocks() - mem_base); 30621 test_ret++; 30622 printf(" %d", n_reader); 30623 printf("\n"); 30624 } 30625 } 30626 function_tests++; 30627 #endif 30628 30629 return(test_ret); 30630 } 30631 30632 30633 static int 30634 test_xmlTextReaderConstBaseUri(void) { 30635 int test_ret = 0; 30636 30637 #if defined(LIBXML_READER_ENABLED) 30638 int mem_base; 30639 const xmlChar * ret_val; 30640 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30641 int n_reader; 30642 30643 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30644 mem_base = xmlMemBlocks(); 30645 reader = gen_xmlTextReaderPtr(n_reader, 0); 30646 30647 ret_val = xmlTextReaderConstBaseUri(reader); 30648 desret_const_xmlChar_ptr(ret_val); 30649 call_tests++; 30650 des_xmlTextReaderPtr(n_reader, reader, 0); 30651 xmlResetLastError(); 30652 if (mem_base != xmlMemBlocks()) { 30653 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri", 30654 xmlMemBlocks() - mem_base); 30655 test_ret++; 30656 printf(" %d", n_reader); 30657 printf("\n"); 30658 } 30659 } 30660 function_tests++; 30661 #endif 30662 30663 return(test_ret); 30664 } 30665 30666 30667 static int 30668 test_xmlTextReaderConstEncoding(void) { 30669 int test_ret = 0; 30670 30671 #if defined(LIBXML_READER_ENABLED) 30672 int mem_base; 30673 const xmlChar * ret_val; 30674 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30675 int n_reader; 30676 30677 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30678 mem_base = xmlMemBlocks(); 30679 reader = gen_xmlTextReaderPtr(n_reader, 0); 30680 30681 ret_val = xmlTextReaderConstEncoding(reader); 30682 desret_const_xmlChar_ptr(ret_val); 30683 call_tests++; 30684 des_xmlTextReaderPtr(n_reader, reader, 0); 30685 xmlResetLastError(); 30686 if (mem_base != xmlMemBlocks()) { 30687 printf("Leak of %d blocks found in xmlTextReaderConstEncoding", 30688 xmlMemBlocks() - mem_base); 30689 test_ret++; 30690 printf(" %d", n_reader); 30691 printf("\n"); 30692 } 30693 } 30694 function_tests++; 30695 #endif 30696 30697 return(test_ret); 30698 } 30699 30700 30701 static int 30702 test_xmlTextReaderConstLocalName(void) { 30703 int test_ret = 0; 30704 30705 #if defined(LIBXML_READER_ENABLED) 30706 int mem_base; 30707 const xmlChar * ret_val; 30708 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30709 int n_reader; 30710 30711 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30712 mem_base = xmlMemBlocks(); 30713 reader = gen_xmlTextReaderPtr(n_reader, 0); 30714 30715 ret_val = xmlTextReaderConstLocalName(reader); 30716 desret_const_xmlChar_ptr(ret_val); 30717 call_tests++; 30718 des_xmlTextReaderPtr(n_reader, reader, 0); 30719 xmlResetLastError(); 30720 if (mem_base != xmlMemBlocks()) { 30721 printf("Leak of %d blocks found in xmlTextReaderConstLocalName", 30722 xmlMemBlocks() - mem_base); 30723 test_ret++; 30724 printf(" %d", n_reader); 30725 printf("\n"); 30726 } 30727 } 30728 function_tests++; 30729 #endif 30730 30731 return(test_ret); 30732 } 30733 30734 30735 static int 30736 test_xmlTextReaderConstName(void) { 30737 int test_ret = 0; 30738 30739 #if defined(LIBXML_READER_ENABLED) 30740 int mem_base; 30741 const xmlChar * ret_val; 30742 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30743 int n_reader; 30744 30745 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30746 mem_base = xmlMemBlocks(); 30747 reader = gen_xmlTextReaderPtr(n_reader, 0); 30748 30749 ret_val = xmlTextReaderConstName(reader); 30750 desret_const_xmlChar_ptr(ret_val); 30751 call_tests++; 30752 des_xmlTextReaderPtr(n_reader, reader, 0); 30753 xmlResetLastError(); 30754 if (mem_base != xmlMemBlocks()) { 30755 printf("Leak of %d blocks found in xmlTextReaderConstName", 30756 xmlMemBlocks() - mem_base); 30757 test_ret++; 30758 printf(" %d", n_reader); 30759 printf("\n"); 30760 } 30761 } 30762 function_tests++; 30763 #endif 30764 30765 return(test_ret); 30766 } 30767 30768 30769 static int 30770 test_xmlTextReaderConstNamespaceUri(void) { 30771 int test_ret = 0; 30772 30773 #if defined(LIBXML_READER_ENABLED) 30774 int mem_base; 30775 const xmlChar * ret_val; 30776 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30777 int n_reader; 30778 30779 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30780 mem_base = xmlMemBlocks(); 30781 reader = gen_xmlTextReaderPtr(n_reader, 0); 30782 30783 ret_val = xmlTextReaderConstNamespaceUri(reader); 30784 desret_const_xmlChar_ptr(ret_val); 30785 call_tests++; 30786 des_xmlTextReaderPtr(n_reader, reader, 0); 30787 xmlResetLastError(); 30788 if (mem_base != xmlMemBlocks()) { 30789 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri", 30790 xmlMemBlocks() - mem_base); 30791 test_ret++; 30792 printf(" %d", n_reader); 30793 printf("\n"); 30794 } 30795 } 30796 function_tests++; 30797 #endif 30798 30799 return(test_ret); 30800 } 30801 30802 30803 static int 30804 test_xmlTextReaderConstPrefix(void) { 30805 int test_ret = 0; 30806 30807 #if defined(LIBXML_READER_ENABLED) 30808 int mem_base; 30809 const xmlChar * ret_val; 30810 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30811 int n_reader; 30812 30813 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30814 mem_base = xmlMemBlocks(); 30815 reader = gen_xmlTextReaderPtr(n_reader, 0); 30816 30817 ret_val = xmlTextReaderConstPrefix(reader); 30818 desret_const_xmlChar_ptr(ret_val); 30819 call_tests++; 30820 des_xmlTextReaderPtr(n_reader, reader, 0); 30821 xmlResetLastError(); 30822 if (mem_base != xmlMemBlocks()) { 30823 printf("Leak of %d blocks found in xmlTextReaderConstPrefix", 30824 xmlMemBlocks() - mem_base); 30825 test_ret++; 30826 printf(" %d", n_reader); 30827 printf("\n"); 30828 } 30829 } 30830 function_tests++; 30831 #endif 30832 30833 return(test_ret); 30834 } 30835 30836 30837 static int 30838 test_xmlTextReaderConstString(void) { 30839 int test_ret = 0; 30840 30841 #if defined(LIBXML_READER_ENABLED) 30842 int mem_base; 30843 const xmlChar * ret_val; 30844 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30845 int n_reader; 30846 xmlChar * str; /* the string to intern. */ 30847 int n_str; 30848 30849 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30850 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 30851 mem_base = xmlMemBlocks(); 30852 reader = gen_xmlTextReaderPtr(n_reader, 0); 30853 str = gen_const_xmlChar_ptr(n_str, 1); 30854 30855 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str); 30856 desret_const_xmlChar_ptr(ret_val); 30857 call_tests++; 30858 des_xmlTextReaderPtr(n_reader, reader, 0); 30859 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 30860 xmlResetLastError(); 30861 if (mem_base != xmlMemBlocks()) { 30862 printf("Leak of %d blocks found in xmlTextReaderConstString", 30863 xmlMemBlocks() - mem_base); 30864 test_ret++; 30865 printf(" %d", n_reader); 30866 printf(" %d", n_str); 30867 printf("\n"); 30868 } 30869 } 30870 } 30871 function_tests++; 30872 #endif 30873 30874 return(test_ret); 30875 } 30876 30877 30878 static int 30879 test_xmlTextReaderConstValue(void) { 30880 int test_ret = 0; 30881 30882 #if defined(LIBXML_READER_ENABLED) 30883 int mem_base; 30884 const xmlChar * ret_val; 30885 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30886 int n_reader; 30887 30888 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30889 mem_base = xmlMemBlocks(); 30890 reader = gen_xmlTextReaderPtr(n_reader, 0); 30891 30892 ret_val = xmlTextReaderConstValue(reader); 30893 desret_const_xmlChar_ptr(ret_val); 30894 call_tests++; 30895 des_xmlTextReaderPtr(n_reader, reader, 0); 30896 xmlResetLastError(); 30897 if (mem_base != xmlMemBlocks()) { 30898 printf("Leak of %d blocks found in xmlTextReaderConstValue", 30899 xmlMemBlocks() - mem_base); 30900 test_ret++; 30901 printf(" %d", n_reader); 30902 printf("\n"); 30903 } 30904 } 30905 function_tests++; 30906 #endif 30907 30908 return(test_ret); 30909 } 30910 30911 30912 static int 30913 test_xmlTextReaderConstXmlLang(void) { 30914 int test_ret = 0; 30915 30916 #if defined(LIBXML_READER_ENABLED) 30917 int mem_base; 30918 const xmlChar * ret_val; 30919 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30920 int n_reader; 30921 30922 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30923 mem_base = xmlMemBlocks(); 30924 reader = gen_xmlTextReaderPtr(n_reader, 0); 30925 30926 ret_val = xmlTextReaderConstXmlLang(reader); 30927 desret_const_xmlChar_ptr(ret_val); 30928 call_tests++; 30929 des_xmlTextReaderPtr(n_reader, reader, 0); 30930 xmlResetLastError(); 30931 if (mem_base != xmlMemBlocks()) { 30932 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang", 30933 xmlMemBlocks() - mem_base); 30934 test_ret++; 30935 printf(" %d", n_reader); 30936 printf("\n"); 30937 } 30938 } 30939 function_tests++; 30940 #endif 30941 30942 return(test_ret); 30943 } 30944 30945 30946 static int 30947 test_xmlTextReaderConstXmlVersion(void) { 30948 int test_ret = 0; 30949 30950 #if defined(LIBXML_READER_ENABLED) 30951 int mem_base; 30952 const xmlChar * ret_val; 30953 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30954 int n_reader; 30955 30956 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30957 mem_base = xmlMemBlocks(); 30958 reader = gen_xmlTextReaderPtr(n_reader, 0); 30959 30960 ret_val = xmlTextReaderConstXmlVersion(reader); 30961 desret_const_xmlChar_ptr(ret_val); 30962 call_tests++; 30963 des_xmlTextReaderPtr(n_reader, reader, 0); 30964 xmlResetLastError(); 30965 if (mem_base != xmlMemBlocks()) { 30966 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion", 30967 xmlMemBlocks() - mem_base); 30968 test_ret++; 30969 printf(" %d", n_reader); 30970 printf("\n"); 30971 } 30972 } 30973 function_tests++; 30974 #endif 30975 30976 return(test_ret); 30977 } 30978 30979 30980 static int 30981 test_xmlTextReaderCurrentDoc(void) { 30982 int test_ret = 0; 30983 30984 #if defined(LIBXML_READER_ENABLED) 30985 int mem_base; 30986 xmlDocPtr ret_val; 30987 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 30988 int n_reader; 30989 30990 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30991 mem_base = xmlMemBlocks(); 30992 reader = gen_xmlTextReaderPtr(n_reader, 0); 30993 30994 ret_val = xmlTextReaderCurrentDoc(reader); 30995 desret_xmlDocPtr(ret_val); 30996 call_tests++; 30997 des_xmlTextReaderPtr(n_reader, reader, 0); 30998 xmlResetLastError(); 30999 if (mem_base != xmlMemBlocks()) { 31000 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc", 31001 xmlMemBlocks() - mem_base); 31002 test_ret++; 31003 printf(" %d", n_reader); 31004 printf("\n"); 31005 } 31006 } 31007 function_tests++; 31008 #endif 31009 31010 return(test_ret); 31011 } 31012 31013 31014 static int 31015 test_xmlTextReaderCurrentNode(void) { 31016 int test_ret = 0; 31017 31018 #if defined(LIBXML_READER_ENABLED) 31019 int mem_base; 31020 xmlNodePtr ret_val; 31021 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31022 int n_reader; 31023 31024 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31025 mem_base = xmlMemBlocks(); 31026 reader = gen_xmlTextReaderPtr(n_reader, 0); 31027 31028 ret_val = xmlTextReaderCurrentNode(reader); 31029 desret_xmlNodePtr(ret_val); 31030 call_tests++; 31031 des_xmlTextReaderPtr(n_reader, reader, 0); 31032 xmlResetLastError(); 31033 if (mem_base != xmlMemBlocks()) { 31034 printf("Leak of %d blocks found in xmlTextReaderCurrentNode", 31035 xmlMemBlocks() - mem_base); 31036 test_ret++; 31037 printf(" %d", n_reader); 31038 printf("\n"); 31039 } 31040 } 31041 function_tests++; 31042 #endif 31043 31044 return(test_ret); 31045 } 31046 31047 31048 static int 31049 test_xmlTextReaderDepth(void) { 31050 int test_ret = 0; 31051 31052 #if defined(LIBXML_READER_ENABLED) 31053 int mem_base; 31054 int ret_val; 31055 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31056 int n_reader; 31057 31058 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31059 mem_base = xmlMemBlocks(); 31060 reader = gen_xmlTextReaderPtr(n_reader, 0); 31061 31062 ret_val = xmlTextReaderDepth(reader); 31063 desret_int(ret_val); 31064 call_tests++; 31065 des_xmlTextReaderPtr(n_reader, reader, 0); 31066 xmlResetLastError(); 31067 if (mem_base != xmlMemBlocks()) { 31068 printf("Leak of %d blocks found in xmlTextReaderDepth", 31069 xmlMemBlocks() - mem_base); 31070 test_ret++; 31071 printf(" %d", n_reader); 31072 printf("\n"); 31073 } 31074 } 31075 function_tests++; 31076 #endif 31077 31078 return(test_ret); 31079 } 31080 31081 31082 static int 31083 test_xmlTextReaderExpand(void) { 31084 int test_ret = 0; 31085 31086 #if defined(LIBXML_READER_ENABLED) 31087 int mem_base; 31088 xmlNodePtr ret_val; 31089 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31090 int n_reader; 31091 31092 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31093 mem_base = xmlMemBlocks(); 31094 reader = gen_xmlTextReaderPtr(n_reader, 0); 31095 31096 ret_val = xmlTextReaderExpand(reader); 31097 desret_xmlNodePtr(ret_val); 31098 call_tests++; 31099 des_xmlTextReaderPtr(n_reader, reader, 0); 31100 xmlResetLastError(); 31101 if (mem_base != xmlMemBlocks()) { 31102 printf("Leak of %d blocks found in xmlTextReaderExpand", 31103 xmlMemBlocks() - mem_base); 31104 test_ret++; 31105 printf(" %d", n_reader); 31106 printf("\n"); 31107 } 31108 } 31109 function_tests++; 31110 #endif 31111 31112 return(test_ret); 31113 } 31114 31115 31116 static int 31117 test_xmlTextReaderGetAttribute(void) { 31118 int test_ret = 0; 31119 31120 #if defined(LIBXML_READER_ENABLED) 31121 int mem_base; 31122 xmlChar * ret_val; 31123 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31124 int n_reader; 31125 xmlChar * name; /* the qualified name of the attribute. */ 31126 int n_name; 31127 31128 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31129 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 31130 mem_base = xmlMemBlocks(); 31131 reader = gen_xmlTextReaderPtr(n_reader, 0); 31132 name = gen_const_xmlChar_ptr(n_name, 1); 31133 31134 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name); 31135 desret_xmlChar_ptr(ret_val); 31136 call_tests++; 31137 des_xmlTextReaderPtr(n_reader, reader, 0); 31138 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 31139 xmlResetLastError(); 31140 if (mem_base != xmlMemBlocks()) { 31141 printf("Leak of %d blocks found in xmlTextReaderGetAttribute", 31142 xmlMemBlocks() - mem_base); 31143 test_ret++; 31144 printf(" %d", n_reader); 31145 printf(" %d", n_name); 31146 printf("\n"); 31147 } 31148 } 31149 } 31150 function_tests++; 31151 #endif 31152 31153 return(test_ret); 31154 } 31155 31156 31157 static int 31158 test_xmlTextReaderGetAttributeNo(void) { 31159 int test_ret = 0; 31160 31161 #if defined(LIBXML_READER_ENABLED) 31162 int mem_base; 31163 xmlChar * ret_val; 31164 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31165 int n_reader; 31166 int no; /* the zero-based index of the attribute relative to the containing element */ 31167 int n_no; 31168 31169 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31170 for (n_no = 0;n_no < gen_nb_int;n_no++) { 31171 mem_base = xmlMemBlocks(); 31172 reader = gen_xmlTextReaderPtr(n_reader, 0); 31173 no = gen_int(n_no, 1); 31174 31175 ret_val = xmlTextReaderGetAttributeNo(reader, no); 31176 desret_xmlChar_ptr(ret_val); 31177 call_tests++; 31178 des_xmlTextReaderPtr(n_reader, reader, 0); 31179 des_int(n_no, no, 1); 31180 xmlResetLastError(); 31181 if (mem_base != xmlMemBlocks()) { 31182 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo", 31183 xmlMemBlocks() - mem_base); 31184 test_ret++; 31185 printf(" %d", n_reader); 31186 printf(" %d", n_no); 31187 printf("\n"); 31188 } 31189 } 31190 } 31191 function_tests++; 31192 #endif 31193 31194 return(test_ret); 31195 } 31196 31197 31198 static int 31199 test_xmlTextReaderGetAttributeNs(void) { 31200 int test_ret = 0; 31201 31202 #if defined(LIBXML_READER_ENABLED) 31203 int mem_base; 31204 xmlChar * ret_val; 31205 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31206 int n_reader; 31207 xmlChar * localName; /* the local name of the attribute. */ 31208 int n_localName; 31209 xmlChar * namespaceURI; /* the namespace URI of the attribute. */ 31210 int n_namespaceURI; 31211 31212 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31213 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) { 31214 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { 31215 mem_base = xmlMemBlocks(); 31216 reader = gen_xmlTextReaderPtr(n_reader, 0); 31217 localName = gen_const_xmlChar_ptr(n_localName, 1); 31218 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2); 31219 31220 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI); 31221 desret_xmlChar_ptr(ret_val); 31222 call_tests++; 31223 des_xmlTextReaderPtr(n_reader, reader, 0); 31224 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1); 31225 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2); 31226 xmlResetLastError(); 31227 if (mem_base != xmlMemBlocks()) { 31228 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs", 31229 xmlMemBlocks() - mem_base); 31230 test_ret++; 31231 printf(" %d", n_reader); 31232 printf(" %d", n_localName); 31233 printf(" %d", n_namespaceURI); 31234 printf("\n"); 31235 } 31236 } 31237 } 31238 } 31239 function_tests++; 31240 #endif 31241 31242 return(test_ret); 31243 } 31244 31245 #ifdef LIBXML_READER_ENABLED 31246 31247 #define gen_nb_xmlTextReaderErrorFunc_ptr 1 31248 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 31249 return(NULL); 31250 } 31251 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 31252 } 31253 #endif 31254 31255 31256 static int 31257 test_xmlTextReaderGetErrorHandler(void) { 31258 int test_ret = 0; 31259 31260 #if defined(LIBXML_READER_ENABLED) 31261 int mem_base; 31262 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31263 int n_reader; 31264 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */ 31265 int n_f; 31266 void ** arg; /* a user argument */ 31267 int n_arg; 31268 31269 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31270 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) { 31271 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) { 31272 mem_base = xmlMemBlocks(); 31273 reader = gen_xmlTextReaderPtr(n_reader, 0); 31274 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1); 31275 arg = gen_void_ptr_ptr(n_arg, 2); 31276 31277 xmlTextReaderGetErrorHandler(reader, f, arg); 31278 call_tests++; 31279 des_xmlTextReaderPtr(n_reader, reader, 0); 31280 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1); 31281 des_void_ptr_ptr(n_arg, arg, 2); 31282 xmlResetLastError(); 31283 if (mem_base != xmlMemBlocks()) { 31284 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler", 31285 xmlMemBlocks() - mem_base); 31286 test_ret++; 31287 printf(" %d", n_reader); 31288 printf(" %d", n_f); 31289 printf(" %d", n_arg); 31290 printf("\n"); 31291 } 31292 } 31293 } 31294 } 31295 function_tests++; 31296 #endif 31297 31298 return(test_ret); 31299 } 31300 31301 31302 static int 31303 test_xmlTextReaderGetParserColumnNumber(void) { 31304 int test_ret = 0; 31305 31306 #if defined(LIBXML_READER_ENABLED) 31307 int mem_base; 31308 int ret_val; 31309 xmlTextReaderPtr reader; /* the user data (XML reader context) */ 31310 int n_reader; 31311 31312 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31313 mem_base = xmlMemBlocks(); 31314 reader = gen_xmlTextReaderPtr(n_reader, 0); 31315 31316 ret_val = xmlTextReaderGetParserColumnNumber(reader); 31317 desret_int(ret_val); 31318 call_tests++; 31319 des_xmlTextReaderPtr(n_reader, reader, 0); 31320 xmlResetLastError(); 31321 if (mem_base != xmlMemBlocks()) { 31322 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber", 31323 xmlMemBlocks() - mem_base); 31324 test_ret++; 31325 printf(" %d", n_reader); 31326 printf("\n"); 31327 } 31328 } 31329 function_tests++; 31330 #endif 31331 31332 return(test_ret); 31333 } 31334 31335 31336 static int 31337 test_xmlTextReaderGetParserLineNumber(void) { 31338 int test_ret = 0; 31339 31340 #if defined(LIBXML_READER_ENABLED) 31341 int mem_base; 31342 int ret_val; 31343 xmlTextReaderPtr reader; /* the user data (XML reader context) */ 31344 int n_reader; 31345 31346 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31347 mem_base = xmlMemBlocks(); 31348 reader = gen_xmlTextReaderPtr(n_reader, 0); 31349 31350 ret_val = xmlTextReaderGetParserLineNumber(reader); 31351 desret_int(ret_val); 31352 call_tests++; 31353 des_xmlTextReaderPtr(n_reader, reader, 0); 31354 xmlResetLastError(); 31355 if (mem_base != xmlMemBlocks()) { 31356 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber", 31357 xmlMemBlocks() - mem_base); 31358 test_ret++; 31359 printf(" %d", n_reader); 31360 printf("\n"); 31361 } 31362 } 31363 function_tests++; 31364 #endif 31365 31366 return(test_ret); 31367 } 31368 31369 31370 static int 31371 test_xmlTextReaderGetParserProp(void) { 31372 int test_ret = 0; 31373 31374 #if defined(LIBXML_READER_ENABLED) 31375 int mem_base; 31376 int ret_val; 31377 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31378 int n_reader; 31379 int prop; /* the xmlParserProperties to get */ 31380 int n_prop; 31381 31382 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31383 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) { 31384 mem_base = xmlMemBlocks(); 31385 reader = gen_xmlTextReaderPtr(n_reader, 0); 31386 prop = gen_int(n_prop, 1); 31387 31388 ret_val = xmlTextReaderGetParserProp(reader, prop); 31389 desret_int(ret_val); 31390 call_tests++; 31391 des_xmlTextReaderPtr(n_reader, reader, 0); 31392 des_int(n_prop, prop, 1); 31393 xmlResetLastError(); 31394 if (mem_base != xmlMemBlocks()) { 31395 printf("Leak of %d blocks found in xmlTextReaderGetParserProp", 31396 xmlMemBlocks() - mem_base); 31397 test_ret++; 31398 printf(" %d", n_reader); 31399 printf(" %d", n_prop); 31400 printf("\n"); 31401 } 31402 } 31403 } 31404 function_tests++; 31405 #endif 31406 31407 return(test_ret); 31408 } 31409 31410 31411 static int 31412 test_xmlTextReaderGetRemainder(void) { 31413 int test_ret = 0; 31414 31415 #if defined(LIBXML_READER_ENABLED) 31416 int mem_base; 31417 xmlParserInputBufferPtr ret_val; 31418 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31419 int n_reader; 31420 31421 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31422 mem_base = xmlMemBlocks(); 31423 reader = gen_xmlTextReaderPtr(n_reader, 0); 31424 31425 ret_val = xmlTextReaderGetRemainder(reader); 31426 desret_xmlParserInputBufferPtr(ret_val); 31427 call_tests++; 31428 des_xmlTextReaderPtr(n_reader, reader, 0); 31429 xmlResetLastError(); 31430 if (mem_base != xmlMemBlocks()) { 31431 printf("Leak of %d blocks found in xmlTextReaderGetRemainder", 31432 xmlMemBlocks() - mem_base); 31433 test_ret++; 31434 printf(" %d", n_reader); 31435 printf("\n"); 31436 } 31437 } 31438 function_tests++; 31439 #endif 31440 31441 return(test_ret); 31442 } 31443 31444 31445 static int 31446 test_xmlTextReaderHasAttributes(void) { 31447 int test_ret = 0; 31448 31449 #if defined(LIBXML_READER_ENABLED) 31450 int mem_base; 31451 int ret_val; 31452 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31453 int n_reader; 31454 31455 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31456 mem_base = xmlMemBlocks(); 31457 reader = gen_xmlTextReaderPtr(n_reader, 0); 31458 31459 ret_val = xmlTextReaderHasAttributes(reader); 31460 desret_int(ret_val); 31461 call_tests++; 31462 des_xmlTextReaderPtr(n_reader, reader, 0); 31463 xmlResetLastError(); 31464 if (mem_base != xmlMemBlocks()) { 31465 printf("Leak of %d blocks found in xmlTextReaderHasAttributes", 31466 xmlMemBlocks() - mem_base); 31467 test_ret++; 31468 printf(" %d", n_reader); 31469 printf("\n"); 31470 } 31471 } 31472 function_tests++; 31473 #endif 31474 31475 return(test_ret); 31476 } 31477 31478 31479 static int 31480 test_xmlTextReaderHasValue(void) { 31481 int test_ret = 0; 31482 31483 #if defined(LIBXML_READER_ENABLED) 31484 int mem_base; 31485 int ret_val; 31486 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31487 int n_reader; 31488 31489 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31490 mem_base = xmlMemBlocks(); 31491 reader = gen_xmlTextReaderPtr(n_reader, 0); 31492 31493 ret_val = xmlTextReaderHasValue(reader); 31494 desret_int(ret_val); 31495 call_tests++; 31496 des_xmlTextReaderPtr(n_reader, reader, 0); 31497 xmlResetLastError(); 31498 if (mem_base != xmlMemBlocks()) { 31499 printf("Leak of %d blocks found in xmlTextReaderHasValue", 31500 xmlMemBlocks() - mem_base); 31501 test_ret++; 31502 printf(" %d", n_reader); 31503 printf("\n"); 31504 } 31505 } 31506 function_tests++; 31507 #endif 31508 31509 return(test_ret); 31510 } 31511 31512 31513 static int 31514 test_xmlTextReaderIsDefault(void) { 31515 int test_ret = 0; 31516 31517 #if defined(LIBXML_READER_ENABLED) 31518 int mem_base; 31519 int ret_val; 31520 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31521 int n_reader; 31522 31523 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31524 mem_base = xmlMemBlocks(); 31525 reader = gen_xmlTextReaderPtr(n_reader, 0); 31526 31527 ret_val = xmlTextReaderIsDefault(reader); 31528 desret_int(ret_val); 31529 call_tests++; 31530 des_xmlTextReaderPtr(n_reader, reader, 0); 31531 xmlResetLastError(); 31532 if (mem_base != xmlMemBlocks()) { 31533 printf("Leak of %d blocks found in xmlTextReaderIsDefault", 31534 xmlMemBlocks() - mem_base); 31535 test_ret++; 31536 printf(" %d", n_reader); 31537 printf("\n"); 31538 } 31539 } 31540 function_tests++; 31541 #endif 31542 31543 return(test_ret); 31544 } 31545 31546 31547 static int 31548 test_xmlTextReaderIsEmptyElement(void) { 31549 int test_ret = 0; 31550 31551 #if defined(LIBXML_READER_ENABLED) 31552 int mem_base; 31553 int ret_val; 31554 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31555 int n_reader; 31556 31557 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31558 mem_base = xmlMemBlocks(); 31559 reader = gen_xmlTextReaderPtr(n_reader, 0); 31560 31561 ret_val = xmlTextReaderIsEmptyElement(reader); 31562 desret_int(ret_val); 31563 call_tests++; 31564 des_xmlTextReaderPtr(n_reader, reader, 0); 31565 xmlResetLastError(); 31566 if (mem_base != xmlMemBlocks()) { 31567 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement", 31568 xmlMemBlocks() - mem_base); 31569 test_ret++; 31570 printf(" %d", n_reader); 31571 printf("\n"); 31572 } 31573 } 31574 function_tests++; 31575 #endif 31576 31577 return(test_ret); 31578 } 31579 31580 31581 static int 31582 test_xmlTextReaderIsNamespaceDecl(void) { 31583 int test_ret = 0; 31584 31585 #if defined(LIBXML_READER_ENABLED) 31586 int mem_base; 31587 int ret_val; 31588 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31589 int n_reader; 31590 31591 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31592 mem_base = xmlMemBlocks(); 31593 reader = gen_xmlTextReaderPtr(n_reader, 0); 31594 31595 ret_val = xmlTextReaderIsNamespaceDecl(reader); 31596 desret_int(ret_val); 31597 call_tests++; 31598 des_xmlTextReaderPtr(n_reader, reader, 0); 31599 xmlResetLastError(); 31600 if (mem_base != xmlMemBlocks()) { 31601 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl", 31602 xmlMemBlocks() - mem_base); 31603 test_ret++; 31604 printf(" %d", n_reader); 31605 printf("\n"); 31606 } 31607 } 31608 function_tests++; 31609 #endif 31610 31611 return(test_ret); 31612 } 31613 31614 31615 static int 31616 test_xmlTextReaderIsValid(void) { 31617 int test_ret = 0; 31618 31619 #if defined(LIBXML_READER_ENABLED) 31620 int mem_base; 31621 int ret_val; 31622 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31623 int n_reader; 31624 31625 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31626 mem_base = xmlMemBlocks(); 31627 reader = gen_xmlTextReaderPtr(n_reader, 0); 31628 31629 ret_val = xmlTextReaderIsValid(reader); 31630 desret_int(ret_val); 31631 call_tests++; 31632 des_xmlTextReaderPtr(n_reader, reader, 0); 31633 xmlResetLastError(); 31634 if (mem_base != xmlMemBlocks()) { 31635 printf("Leak of %d blocks found in xmlTextReaderIsValid", 31636 xmlMemBlocks() - mem_base); 31637 test_ret++; 31638 printf(" %d", n_reader); 31639 printf("\n"); 31640 } 31641 } 31642 function_tests++; 31643 #endif 31644 31645 return(test_ret); 31646 } 31647 31648 31649 static int 31650 test_xmlTextReaderLocalName(void) { 31651 int test_ret = 0; 31652 31653 #if defined(LIBXML_READER_ENABLED) 31654 int mem_base; 31655 xmlChar * ret_val; 31656 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31657 int n_reader; 31658 31659 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31660 mem_base = xmlMemBlocks(); 31661 reader = gen_xmlTextReaderPtr(n_reader, 0); 31662 31663 ret_val = xmlTextReaderLocalName(reader); 31664 desret_xmlChar_ptr(ret_val); 31665 call_tests++; 31666 des_xmlTextReaderPtr(n_reader, reader, 0); 31667 xmlResetLastError(); 31668 if (mem_base != xmlMemBlocks()) { 31669 printf("Leak of %d blocks found in xmlTextReaderLocalName", 31670 xmlMemBlocks() - mem_base); 31671 test_ret++; 31672 printf(" %d", n_reader); 31673 printf("\n"); 31674 } 31675 } 31676 function_tests++; 31677 #endif 31678 31679 return(test_ret); 31680 } 31681 31682 #ifdef LIBXML_READER_ENABLED 31683 31684 #define gen_nb_xmlTextReaderLocatorPtr 1 31685 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 31686 return(NULL); 31687 } 31688 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 31689 } 31690 #endif 31691 31692 31693 static int 31694 test_xmlTextReaderLocatorBaseURI(void) { 31695 int test_ret = 0; 31696 31697 #if defined(LIBXML_READER_ENABLED) 31698 int mem_base; 31699 xmlChar * ret_val; 31700 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */ 31701 int n_locator; 31702 31703 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) { 31704 mem_base = xmlMemBlocks(); 31705 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0); 31706 31707 ret_val = xmlTextReaderLocatorBaseURI(locator); 31708 desret_xmlChar_ptr(ret_val); 31709 call_tests++; 31710 des_xmlTextReaderLocatorPtr(n_locator, locator, 0); 31711 xmlResetLastError(); 31712 if (mem_base != xmlMemBlocks()) { 31713 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI", 31714 xmlMemBlocks() - mem_base); 31715 test_ret++; 31716 printf(" %d", n_locator); 31717 printf("\n"); 31718 } 31719 } 31720 function_tests++; 31721 #endif 31722 31723 return(test_ret); 31724 } 31725 31726 31727 static int 31728 test_xmlTextReaderLocatorLineNumber(void) { 31729 int test_ret = 0; 31730 31731 #if defined(LIBXML_READER_ENABLED) 31732 int mem_base; 31733 int ret_val; 31734 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */ 31735 int n_locator; 31736 31737 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) { 31738 mem_base = xmlMemBlocks(); 31739 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0); 31740 31741 ret_val = xmlTextReaderLocatorLineNumber(locator); 31742 desret_int(ret_val); 31743 call_tests++; 31744 des_xmlTextReaderLocatorPtr(n_locator, locator, 0); 31745 xmlResetLastError(); 31746 if (mem_base != xmlMemBlocks()) { 31747 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber", 31748 xmlMemBlocks() - mem_base); 31749 test_ret++; 31750 printf(" %d", n_locator); 31751 printf("\n"); 31752 } 31753 } 31754 function_tests++; 31755 #endif 31756 31757 return(test_ret); 31758 } 31759 31760 31761 static int 31762 test_xmlTextReaderLookupNamespace(void) { 31763 int test_ret = 0; 31764 31765 #if defined(LIBXML_READER_ENABLED) 31766 int mem_base; 31767 xmlChar * ret_val; 31768 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31769 int n_reader; 31770 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */ 31771 int n_prefix; 31772 31773 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31774 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 31775 mem_base = xmlMemBlocks(); 31776 reader = gen_xmlTextReaderPtr(n_reader, 0); 31777 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 31778 31779 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix); 31780 desret_xmlChar_ptr(ret_val); 31781 call_tests++; 31782 des_xmlTextReaderPtr(n_reader, reader, 0); 31783 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 31784 xmlResetLastError(); 31785 if (mem_base != xmlMemBlocks()) { 31786 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace", 31787 xmlMemBlocks() - mem_base); 31788 test_ret++; 31789 printf(" %d", n_reader); 31790 printf(" %d", n_prefix); 31791 printf("\n"); 31792 } 31793 } 31794 } 31795 function_tests++; 31796 #endif 31797 31798 return(test_ret); 31799 } 31800 31801 31802 static int 31803 test_xmlTextReaderMoveToAttribute(void) { 31804 int test_ret = 0; 31805 31806 #if defined(LIBXML_READER_ENABLED) 31807 int mem_base; 31808 int ret_val; 31809 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31810 int n_reader; 31811 xmlChar * name; /* the qualified name of the attribute. */ 31812 int n_name; 31813 31814 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31815 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 31816 mem_base = xmlMemBlocks(); 31817 reader = gen_xmlTextReaderPtr(n_reader, 0); 31818 name = gen_const_xmlChar_ptr(n_name, 1); 31819 31820 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name); 31821 desret_int(ret_val); 31822 call_tests++; 31823 des_xmlTextReaderPtr(n_reader, reader, 0); 31824 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 31825 xmlResetLastError(); 31826 if (mem_base != xmlMemBlocks()) { 31827 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute", 31828 xmlMemBlocks() - mem_base); 31829 test_ret++; 31830 printf(" %d", n_reader); 31831 printf(" %d", n_name); 31832 printf("\n"); 31833 } 31834 } 31835 } 31836 function_tests++; 31837 #endif 31838 31839 return(test_ret); 31840 } 31841 31842 31843 static int 31844 test_xmlTextReaderMoveToAttributeNo(void) { 31845 int test_ret = 0; 31846 31847 #if defined(LIBXML_READER_ENABLED) 31848 int mem_base; 31849 int ret_val; 31850 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31851 int n_reader; 31852 int no; /* the zero-based index of the attribute relative to the containing element. */ 31853 int n_no; 31854 31855 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31856 for (n_no = 0;n_no < gen_nb_int;n_no++) { 31857 mem_base = xmlMemBlocks(); 31858 reader = gen_xmlTextReaderPtr(n_reader, 0); 31859 no = gen_int(n_no, 1); 31860 31861 ret_val = xmlTextReaderMoveToAttributeNo(reader, no); 31862 desret_int(ret_val); 31863 call_tests++; 31864 des_xmlTextReaderPtr(n_reader, reader, 0); 31865 des_int(n_no, no, 1); 31866 xmlResetLastError(); 31867 if (mem_base != xmlMemBlocks()) { 31868 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo", 31869 xmlMemBlocks() - mem_base); 31870 test_ret++; 31871 printf(" %d", n_reader); 31872 printf(" %d", n_no); 31873 printf("\n"); 31874 } 31875 } 31876 } 31877 function_tests++; 31878 #endif 31879 31880 return(test_ret); 31881 } 31882 31883 31884 static int 31885 test_xmlTextReaderMoveToAttributeNs(void) { 31886 int test_ret = 0; 31887 31888 #if defined(LIBXML_READER_ENABLED) 31889 int mem_base; 31890 int ret_val; 31891 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31892 int n_reader; 31893 xmlChar * localName; /* the local name of the attribute. */ 31894 int n_localName; 31895 xmlChar * namespaceURI; /* the namespace URI of the attribute. */ 31896 int n_namespaceURI; 31897 31898 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31899 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) { 31900 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { 31901 mem_base = xmlMemBlocks(); 31902 reader = gen_xmlTextReaderPtr(n_reader, 0); 31903 localName = gen_const_xmlChar_ptr(n_localName, 1); 31904 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2); 31905 31906 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI); 31907 desret_int(ret_val); 31908 call_tests++; 31909 des_xmlTextReaderPtr(n_reader, reader, 0); 31910 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1); 31911 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2); 31912 xmlResetLastError(); 31913 if (mem_base != xmlMemBlocks()) { 31914 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs", 31915 xmlMemBlocks() - mem_base); 31916 test_ret++; 31917 printf(" %d", n_reader); 31918 printf(" %d", n_localName); 31919 printf(" %d", n_namespaceURI); 31920 printf("\n"); 31921 } 31922 } 31923 } 31924 } 31925 function_tests++; 31926 #endif 31927 31928 return(test_ret); 31929 } 31930 31931 31932 static int 31933 test_xmlTextReaderMoveToElement(void) { 31934 int test_ret = 0; 31935 31936 #if defined(LIBXML_READER_ENABLED) 31937 int mem_base; 31938 int ret_val; 31939 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31940 int n_reader; 31941 31942 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31943 mem_base = xmlMemBlocks(); 31944 reader = gen_xmlTextReaderPtr(n_reader, 0); 31945 31946 ret_val = xmlTextReaderMoveToElement(reader); 31947 desret_int(ret_val); 31948 call_tests++; 31949 des_xmlTextReaderPtr(n_reader, reader, 0); 31950 xmlResetLastError(); 31951 if (mem_base != xmlMemBlocks()) { 31952 printf("Leak of %d blocks found in xmlTextReaderMoveToElement", 31953 xmlMemBlocks() - mem_base); 31954 test_ret++; 31955 printf(" %d", n_reader); 31956 printf("\n"); 31957 } 31958 } 31959 function_tests++; 31960 #endif 31961 31962 return(test_ret); 31963 } 31964 31965 31966 static int 31967 test_xmlTextReaderMoveToFirstAttribute(void) { 31968 int test_ret = 0; 31969 31970 #if defined(LIBXML_READER_ENABLED) 31971 int mem_base; 31972 int ret_val; 31973 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 31974 int n_reader; 31975 31976 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 31977 mem_base = xmlMemBlocks(); 31978 reader = gen_xmlTextReaderPtr(n_reader, 0); 31979 31980 ret_val = xmlTextReaderMoveToFirstAttribute(reader); 31981 desret_int(ret_val); 31982 call_tests++; 31983 des_xmlTextReaderPtr(n_reader, reader, 0); 31984 xmlResetLastError(); 31985 if (mem_base != xmlMemBlocks()) { 31986 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute", 31987 xmlMemBlocks() - mem_base); 31988 test_ret++; 31989 printf(" %d", n_reader); 31990 printf("\n"); 31991 } 31992 } 31993 function_tests++; 31994 #endif 31995 31996 return(test_ret); 31997 } 31998 31999 32000 static int 32001 test_xmlTextReaderMoveToNextAttribute(void) { 32002 int test_ret = 0; 32003 32004 #if defined(LIBXML_READER_ENABLED) 32005 int mem_base; 32006 int ret_val; 32007 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32008 int n_reader; 32009 32010 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32011 mem_base = xmlMemBlocks(); 32012 reader = gen_xmlTextReaderPtr(n_reader, 0); 32013 32014 ret_val = xmlTextReaderMoveToNextAttribute(reader); 32015 desret_int(ret_val); 32016 call_tests++; 32017 des_xmlTextReaderPtr(n_reader, reader, 0); 32018 xmlResetLastError(); 32019 if (mem_base != xmlMemBlocks()) { 32020 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute", 32021 xmlMemBlocks() - mem_base); 32022 test_ret++; 32023 printf(" %d", n_reader); 32024 printf("\n"); 32025 } 32026 } 32027 function_tests++; 32028 #endif 32029 32030 return(test_ret); 32031 } 32032 32033 32034 static int 32035 test_xmlTextReaderName(void) { 32036 int test_ret = 0; 32037 32038 #if defined(LIBXML_READER_ENABLED) 32039 int mem_base; 32040 xmlChar * ret_val; 32041 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32042 int n_reader; 32043 32044 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32045 mem_base = xmlMemBlocks(); 32046 reader = gen_xmlTextReaderPtr(n_reader, 0); 32047 32048 ret_val = xmlTextReaderName(reader); 32049 desret_xmlChar_ptr(ret_val); 32050 call_tests++; 32051 des_xmlTextReaderPtr(n_reader, reader, 0); 32052 xmlResetLastError(); 32053 if (mem_base != xmlMemBlocks()) { 32054 printf("Leak of %d blocks found in xmlTextReaderName", 32055 xmlMemBlocks() - mem_base); 32056 test_ret++; 32057 printf(" %d", n_reader); 32058 printf("\n"); 32059 } 32060 } 32061 function_tests++; 32062 #endif 32063 32064 return(test_ret); 32065 } 32066 32067 32068 static int 32069 test_xmlTextReaderNamespaceUri(void) { 32070 int test_ret = 0; 32071 32072 #if defined(LIBXML_READER_ENABLED) 32073 int mem_base; 32074 xmlChar * ret_val; 32075 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32076 int n_reader; 32077 32078 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32079 mem_base = xmlMemBlocks(); 32080 reader = gen_xmlTextReaderPtr(n_reader, 0); 32081 32082 ret_val = xmlTextReaderNamespaceUri(reader); 32083 desret_xmlChar_ptr(ret_val); 32084 call_tests++; 32085 des_xmlTextReaderPtr(n_reader, reader, 0); 32086 xmlResetLastError(); 32087 if (mem_base != xmlMemBlocks()) { 32088 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri", 32089 xmlMemBlocks() - mem_base); 32090 test_ret++; 32091 printf(" %d", n_reader); 32092 printf("\n"); 32093 } 32094 } 32095 function_tests++; 32096 #endif 32097 32098 return(test_ret); 32099 } 32100 32101 32102 static int 32103 test_xmlTextReaderNext(void) { 32104 int test_ret = 0; 32105 32106 #if defined(LIBXML_READER_ENABLED) 32107 int mem_base; 32108 int ret_val; 32109 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32110 int n_reader; 32111 32112 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32113 mem_base = xmlMemBlocks(); 32114 reader = gen_xmlTextReaderPtr(n_reader, 0); 32115 32116 ret_val = xmlTextReaderNext(reader); 32117 desret_int(ret_val); 32118 call_tests++; 32119 des_xmlTextReaderPtr(n_reader, reader, 0); 32120 xmlResetLastError(); 32121 if (mem_base != xmlMemBlocks()) { 32122 printf("Leak of %d blocks found in xmlTextReaderNext", 32123 xmlMemBlocks() - mem_base); 32124 test_ret++; 32125 printf(" %d", n_reader); 32126 printf("\n"); 32127 } 32128 } 32129 function_tests++; 32130 #endif 32131 32132 return(test_ret); 32133 } 32134 32135 32136 static int 32137 test_xmlTextReaderNextSibling(void) { 32138 int test_ret = 0; 32139 32140 #if defined(LIBXML_READER_ENABLED) 32141 int mem_base; 32142 int ret_val; 32143 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32144 int n_reader; 32145 32146 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32147 mem_base = xmlMemBlocks(); 32148 reader = gen_xmlTextReaderPtr(n_reader, 0); 32149 32150 ret_val = xmlTextReaderNextSibling(reader); 32151 desret_int(ret_val); 32152 call_tests++; 32153 des_xmlTextReaderPtr(n_reader, reader, 0); 32154 xmlResetLastError(); 32155 if (mem_base != xmlMemBlocks()) { 32156 printf("Leak of %d blocks found in xmlTextReaderNextSibling", 32157 xmlMemBlocks() - mem_base); 32158 test_ret++; 32159 printf(" %d", n_reader); 32160 printf("\n"); 32161 } 32162 } 32163 function_tests++; 32164 #endif 32165 32166 return(test_ret); 32167 } 32168 32169 32170 static int 32171 test_xmlTextReaderNodeType(void) { 32172 int test_ret = 0; 32173 32174 #if defined(LIBXML_READER_ENABLED) 32175 int mem_base; 32176 int ret_val; 32177 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32178 int n_reader; 32179 32180 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32181 mem_base = xmlMemBlocks(); 32182 reader = gen_xmlTextReaderPtr(n_reader, 0); 32183 32184 ret_val = xmlTextReaderNodeType(reader); 32185 desret_int(ret_val); 32186 call_tests++; 32187 des_xmlTextReaderPtr(n_reader, reader, 0); 32188 xmlResetLastError(); 32189 if (mem_base != xmlMemBlocks()) { 32190 printf("Leak of %d blocks found in xmlTextReaderNodeType", 32191 xmlMemBlocks() - mem_base); 32192 test_ret++; 32193 printf(" %d", n_reader); 32194 printf("\n"); 32195 } 32196 } 32197 function_tests++; 32198 #endif 32199 32200 return(test_ret); 32201 } 32202 32203 32204 static int 32205 test_xmlTextReaderNormalization(void) { 32206 int test_ret = 0; 32207 32208 #if defined(LIBXML_READER_ENABLED) 32209 int mem_base; 32210 int ret_val; 32211 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32212 int n_reader; 32213 32214 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32215 mem_base = xmlMemBlocks(); 32216 reader = gen_xmlTextReaderPtr(n_reader, 0); 32217 32218 ret_val = xmlTextReaderNormalization(reader); 32219 desret_int(ret_val); 32220 call_tests++; 32221 des_xmlTextReaderPtr(n_reader, reader, 0); 32222 xmlResetLastError(); 32223 if (mem_base != xmlMemBlocks()) { 32224 printf("Leak of %d blocks found in xmlTextReaderNormalization", 32225 xmlMemBlocks() - mem_base); 32226 test_ret++; 32227 printf(" %d", n_reader); 32228 printf("\n"); 32229 } 32230 } 32231 function_tests++; 32232 #endif 32233 32234 return(test_ret); 32235 } 32236 32237 32238 static int 32239 test_xmlTextReaderPrefix(void) { 32240 int test_ret = 0; 32241 32242 #if defined(LIBXML_READER_ENABLED) 32243 int mem_base; 32244 xmlChar * ret_val; 32245 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32246 int n_reader; 32247 32248 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32249 mem_base = xmlMemBlocks(); 32250 reader = gen_xmlTextReaderPtr(n_reader, 0); 32251 32252 ret_val = xmlTextReaderPrefix(reader); 32253 desret_xmlChar_ptr(ret_val); 32254 call_tests++; 32255 des_xmlTextReaderPtr(n_reader, reader, 0); 32256 xmlResetLastError(); 32257 if (mem_base != xmlMemBlocks()) { 32258 printf("Leak of %d blocks found in xmlTextReaderPrefix", 32259 xmlMemBlocks() - mem_base); 32260 test_ret++; 32261 printf(" %d", n_reader); 32262 printf("\n"); 32263 } 32264 } 32265 function_tests++; 32266 #endif 32267 32268 return(test_ret); 32269 } 32270 32271 32272 static int 32273 test_xmlTextReaderPreserve(void) { 32274 int test_ret = 0; 32275 32276 #if defined(LIBXML_READER_ENABLED) 32277 int mem_base; 32278 xmlNodePtr ret_val; 32279 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32280 int n_reader; 32281 32282 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32283 mem_base = xmlMemBlocks(); 32284 reader = gen_xmlTextReaderPtr(n_reader, 0); 32285 32286 ret_val = xmlTextReaderPreserve(reader); 32287 desret_xmlNodePtr(ret_val); 32288 call_tests++; 32289 des_xmlTextReaderPtr(n_reader, reader, 0); 32290 xmlResetLastError(); 32291 if (mem_base != xmlMemBlocks()) { 32292 printf("Leak of %d blocks found in xmlTextReaderPreserve", 32293 xmlMemBlocks() - mem_base); 32294 test_ret++; 32295 printf(" %d", n_reader); 32296 printf("\n"); 32297 } 32298 } 32299 function_tests++; 32300 #endif 32301 32302 return(test_ret); 32303 } 32304 32305 32306 static int 32307 test_xmlTextReaderPreservePattern(void) { 32308 int test_ret = 0; 32309 32310 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) 32311 #ifdef LIBXML_PATTERN_ENABLED 32312 int mem_base; 32313 int ret_val; 32314 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32315 int n_reader; 32316 xmlChar * pattern; /* an XPath subset pattern */ 32317 int n_pattern; 32318 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */ 32319 int n_namespaces; 32320 32321 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32322 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) { 32323 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) { 32324 mem_base = xmlMemBlocks(); 32325 reader = gen_xmlTextReaderPtr(n_reader, 0); 32326 pattern = gen_const_xmlChar_ptr(n_pattern, 1); 32327 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2); 32328 32329 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces); 32330 desret_int(ret_val); 32331 call_tests++; 32332 des_xmlTextReaderPtr(n_reader, reader, 0); 32333 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1); 32334 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2); 32335 xmlResetLastError(); 32336 if (mem_base != xmlMemBlocks()) { 32337 printf("Leak of %d blocks found in xmlTextReaderPreservePattern", 32338 xmlMemBlocks() - mem_base); 32339 test_ret++; 32340 printf(" %d", n_reader); 32341 printf(" %d", n_pattern); 32342 printf(" %d", n_namespaces); 32343 printf("\n"); 32344 } 32345 } 32346 } 32347 } 32348 function_tests++; 32349 #endif 32350 #endif 32351 32352 return(test_ret); 32353 } 32354 32355 32356 static int 32357 test_xmlTextReaderQuoteChar(void) { 32358 int test_ret = 0; 32359 32360 #if defined(LIBXML_READER_ENABLED) 32361 int mem_base; 32362 int ret_val; 32363 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32364 int n_reader; 32365 32366 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32367 mem_base = xmlMemBlocks(); 32368 reader = gen_xmlTextReaderPtr(n_reader, 0); 32369 32370 ret_val = xmlTextReaderQuoteChar(reader); 32371 desret_int(ret_val); 32372 call_tests++; 32373 des_xmlTextReaderPtr(n_reader, reader, 0); 32374 xmlResetLastError(); 32375 if (mem_base != xmlMemBlocks()) { 32376 printf("Leak of %d blocks found in xmlTextReaderQuoteChar", 32377 xmlMemBlocks() - mem_base); 32378 test_ret++; 32379 printf(" %d", n_reader); 32380 printf("\n"); 32381 } 32382 } 32383 function_tests++; 32384 #endif 32385 32386 return(test_ret); 32387 } 32388 32389 32390 static int 32391 test_xmlTextReaderRead(void) { 32392 int test_ret = 0; 32393 32394 #if defined(LIBXML_READER_ENABLED) 32395 int mem_base; 32396 int ret_val; 32397 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32398 int n_reader; 32399 32400 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32401 mem_base = xmlMemBlocks(); 32402 reader = gen_xmlTextReaderPtr(n_reader, 0); 32403 32404 ret_val = xmlTextReaderRead(reader); 32405 desret_int(ret_val); 32406 call_tests++; 32407 des_xmlTextReaderPtr(n_reader, reader, 0); 32408 xmlResetLastError(); 32409 if (mem_base != xmlMemBlocks()) { 32410 printf("Leak of %d blocks found in xmlTextReaderRead", 32411 xmlMemBlocks() - mem_base); 32412 test_ret++; 32413 printf(" %d", n_reader); 32414 printf("\n"); 32415 } 32416 } 32417 function_tests++; 32418 #endif 32419 32420 return(test_ret); 32421 } 32422 32423 32424 static int 32425 test_xmlTextReaderReadAttributeValue(void) { 32426 int test_ret = 0; 32427 32428 #if defined(LIBXML_READER_ENABLED) 32429 int mem_base; 32430 int ret_val; 32431 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32432 int n_reader; 32433 32434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32435 mem_base = xmlMemBlocks(); 32436 reader = gen_xmlTextReaderPtr(n_reader, 0); 32437 32438 ret_val = xmlTextReaderReadAttributeValue(reader); 32439 desret_int(ret_val); 32440 call_tests++; 32441 des_xmlTextReaderPtr(n_reader, reader, 0); 32442 xmlResetLastError(); 32443 if (mem_base != xmlMemBlocks()) { 32444 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue", 32445 xmlMemBlocks() - mem_base); 32446 test_ret++; 32447 printf(" %d", n_reader); 32448 printf("\n"); 32449 } 32450 } 32451 function_tests++; 32452 #endif 32453 32454 return(test_ret); 32455 } 32456 32457 32458 static int 32459 test_xmlTextReaderReadState(void) { 32460 int test_ret = 0; 32461 32462 #if defined(LIBXML_READER_ENABLED) 32463 int mem_base; 32464 int ret_val; 32465 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32466 int n_reader; 32467 32468 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32469 mem_base = xmlMemBlocks(); 32470 reader = gen_xmlTextReaderPtr(n_reader, 0); 32471 32472 ret_val = xmlTextReaderReadState(reader); 32473 desret_int(ret_val); 32474 call_tests++; 32475 des_xmlTextReaderPtr(n_reader, reader, 0); 32476 xmlResetLastError(); 32477 if (mem_base != xmlMemBlocks()) { 32478 printf("Leak of %d blocks found in xmlTextReaderReadState", 32479 xmlMemBlocks() - mem_base); 32480 test_ret++; 32481 printf(" %d", n_reader); 32482 printf("\n"); 32483 } 32484 } 32485 function_tests++; 32486 #endif 32487 32488 return(test_ret); 32489 } 32490 32491 32492 static int 32493 test_xmlTextReaderRelaxNGSetSchema(void) { 32494 int test_ret = 0; 32495 32496 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) 32497 int mem_base; 32498 int ret_val; 32499 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32500 int n_reader; 32501 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */ 32502 int n_schema; 32503 32504 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32505 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { 32506 mem_base = xmlMemBlocks(); 32507 reader = gen_xmlTextReaderPtr(n_reader, 0); 32508 schema = gen_xmlRelaxNGPtr(n_schema, 1); 32509 32510 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema); 32511 desret_int(ret_val); 32512 call_tests++; 32513 des_xmlTextReaderPtr(n_reader, reader, 0); 32514 des_xmlRelaxNGPtr(n_schema, schema, 1); 32515 xmlResetLastError(); 32516 if (mem_base != xmlMemBlocks()) { 32517 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema", 32518 xmlMemBlocks() - mem_base); 32519 test_ret++; 32520 printf(" %d", n_reader); 32521 printf(" %d", n_schema); 32522 printf("\n"); 32523 } 32524 } 32525 } 32526 function_tests++; 32527 #endif 32528 32529 return(test_ret); 32530 } 32531 32532 32533 static int 32534 test_xmlTextReaderRelaxNGValidate(void) { 32535 int test_ret = 0; 32536 32537 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) 32538 int mem_base; 32539 int ret_val; 32540 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32541 int n_reader; 32542 char * rng; /* the path to a RelaxNG schema or NULL */ 32543 int n_rng; 32544 32545 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32546 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) { 32547 mem_base = xmlMemBlocks(); 32548 reader = gen_xmlTextReaderPtr(n_reader, 0); 32549 rng = gen_const_char_ptr(n_rng, 1); 32550 32551 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng); 32552 desret_int(ret_val); 32553 call_tests++; 32554 des_xmlTextReaderPtr(n_reader, reader, 0); 32555 des_const_char_ptr(n_rng, (const char *)rng, 1); 32556 xmlResetLastError(); 32557 if (mem_base != xmlMemBlocks()) { 32558 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate", 32559 xmlMemBlocks() - mem_base); 32560 test_ret++; 32561 printf(" %d", n_reader); 32562 printf(" %d", n_rng); 32563 printf("\n"); 32564 } 32565 } 32566 } 32567 function_tests++; 32568 #endif 32569 32570 return(test_ret); 32571 } 32572 32573 32574 static int 32575 test_xmlTextReaderRelaxNGValidateCtxt(void) { 32576 int test_ret = 0; 32577 32578 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) 32579 int mem_base; 32580 int ret_val; 32581 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32582 int n_reader; 32583 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */ 32584 int n_ctxt; 32585 int options; /* options (not used yet) */ 32586 int n_options; 32587 32588 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32589 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 32590 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 32591 mem_base = xmlMemBlocks(); 32592 reader = gen_xmlTextReaderPtr(n_reader, 0); 32593 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1); 32594 options = gen_parseroptions(n_options, 2); 32595 32596 ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options); 32597 desret_int(ret_val); 32598 call_tests++; 32599 des_xmlTextReaderPtr(n_reader, reader, 0); 32600 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1); 32601 des_parseroptions(n_options, options, 2); 32602 xmlResetLastError(); 32603 if (mem_base != xmlMemBlocks()) { 32604 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt", 32605 xmlMemBlocks() - mem_base); 32606 test_ret++; 32607 printf(" %d", n_reader); 32608 printf(" %d", n_ctxt); 32609 printf(" %d", n_options); 32610 printf("\n"); 32611 } 32612 } 32613 } 32614 } 32615 function_tests++; 32616 #endif 32617 32618 return(test_ret); 32619 } 32620 32621 32622 static int 32623 test_xmlTextReaderSchemaValidate(void) { 32624 int test_ret = 0; 32625 32626 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) 32627 int ret_val; 32628 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32629 int n_reader; 32630 char * xsd; /* the path to a W3C XSD schema or NULL */ 32631 int n_xsd; 32632 32633 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32634 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) { 32635 reader = gen_xmlTextReaderPtr(n_reader, 0); 32636 xsd = gen_const_char_ptr(n_xsd, 1); 32637 32638 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd); 32639 desret_int(ret_val); 32640 call_tests++; 32641 des_xmlTextReaderPtr(n_reader, reader, 0); 32642 des_const_char_ptr(n_xsd, (const char *)xsd, 1); 32643 xmlResetLastError(); 32644 } 32645 } 32646 function_tests++; 32647 #endif 32648 32649 return(test_ret); 32650 } 32651 32652 32653 static int 32654 test_xmlTextReaderSchemaValidateCtxt(void) { 32655 int test_ret = 0; 32656 32657 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) 32658 int mem_base; 32659 int ret_val; 32660 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32661 int n_reader; 32662 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */ 32663 int n_ctxt; 32664 int options; /* options (not used yet) */ 32665 int n_options; 32666 32667 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32668 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { 32669 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 32670 mem_base = xmlMemBlocks(); 32671 reader = gen_xmlTextReaderPtr(n_reader, 0); 32672 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1); 32673 options = gen_parseroptions(n_options, 2); 32674 32675 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options); 32676 desret_int(ret_val); 32677 call_tests++; 32678 des_xmlTextReaderPtr(n_reader, reader, 0); 32679 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1); 32680 des_parseroptions(n_options, options, 2); 32681 xmlResetLastError(); 32682 if (mem_base != xmlMemBlocks()) { 32683 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt", 32684 xmlMemBlocks() - mem_base); 32685 test_ret++; 32686 printf(" %d", n_reader); 32687 printf(" %d", n_ctxt); 32688 printf(" %d", n_options); 32689 printf("\n"); 32690 } 32691 } 32692 } 32693 } 32694 function_tests++; 32695 #endif 32696 32697 return(test_ret); 32698 } 32699 32700 32701 static int 32702 test_xmlTextReaderSetErrorHandler(void) { 32703 int test_ret = 0; 32704 32705 32706 /* missing type support */ 32707 return(test_ret); 32708 } 32709 32710 32711 static int 32712 test_xmlTextReaderSetParserProp(void) { 32713 int test_ret = 0; 32714 32715 #if defined(LIBXML_READER_ENABLED) 32716 int mem_base; 32717 int ret_val; 32718 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32719 int n_reader; 32720 int prop; /* the xmlParserProperties to set */ 32721 int n_prop; 32722 int value; /* usually 0 or 1 to (de)activate it */ 32723 int n_value; 32724 32725 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32726 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) { 32727 for (n_value = 0;n_value < gen_nb_int;n_value++) { 32728 mem_base = xmlMemBlocks(); 32729 reader = gen_xmlTextReaderPtr(n_reader, 0); 32730 prop = gen_int(n_prop, 1); 32731 value = gen_int(n_value, 2); 32732 32733 ret_val = xmlTextReaderSetParserProp(reader, prop, value); 32734 desret_int(ret_val); 32735 call_tests++; 32736 des_xmlTextReaderPtr(n_reader, reader, 0); 32737 des_int(n_prop, prop, 1); 32738 des_int(n_value, value, 2); 32739 xmlResetLastError(); 32740 if (mem_base != xmlMemBlocks()) { 32741 printf("Leak of %d blocks found in xmlTextReaderSetParserProp", 32742 xmlMemBlocks() - mem_base); 32743 test_ret++; 32744 printf(" %d", n_reader); 32745 printf(" %d", n_prop); 32746 printf(" %d", n_value); 32747 printf("\n"); 32748 } 32749 } 32750 } 32751 } 32752 function_tests++; 32753 #endif 32754 32755 return(test_ret); 32756 } 32757 32758 32759 static int 32760 test_xmlTextReaderSetSchema(void) { 32761 int test_ret = 0; 32762 32763 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) 32764 int mem_base; 32765 int ret_val; 32766 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32767 int n_reader; 32768 xmlSchemaPtr schema; /* a precompiled Schema schema */ 32769 int n_schema; 32770 32771 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32772 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) { 32773 mem_base = xmlMemBlocks(); 32774 reader = gen_xmlTextReaderPtr(n_reader, 0); 32775 schema = gen_xmlSchemaPtr(n_schema, 1); 32776 32777 ret_val = xmlTextReaderSetSchema(reader, schema); 32778 desret_int(ret_val); 32779 call_tests++; 32780 des_xmlTextReaderPtr(n_reader, reader, 0); 32781 des_xmlSchemaPtr(n_schema, schema, 1); 32782 xmlResetLastError(); 32783 if (mem_base != xmlMemBlocks()) { 32784 printf("Leak of %d blocks found in xmlTextReaderSetSchema", 32785 xmlMemBlocks() - mem_base); 32786 test_ret++; 32787 printf(" %d", n_reader); 32788 printf(" %d", n_schema); 32789 printf("\n"); 32790 } 32791 } 32792 } 32793 function_tests++; 32794 #endif 32795 32796 return(test_ret); 32797 } 32798 32799 32800 static int 32801 test_xmlTextReaderSetStructuredErrorHandler(void) { 32802 int test_ret = 0; 32803 32804 32805 /* missing type support */ 32806 return(test_ret); 32807 } 32808 32809 32810 static int 32811 test_xmlTextReaderSetup(void) { 32812 int test_ret = 0; 32813 32814 #if defined(LIBXML_READER_ENABLED) 32815 int mem_base; 32816 int ret_val; 32817 xmlTextReaderPtr reader; /* an XML reader */ 32818 int n_reader; 32819 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */ 32820 int n_input; 32821 const char * URL; /* the base URL to use for the document */ 32822 int n_URL; 32823 char * encoding; /* the document encoding, or NULL */ 32824 int n_encoding; 32825 int options; /* a combination of xmlParserOption */ 32826 int n_options; 32827 32828 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32829 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 32830 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 32831 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 32832 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 32833 mem_base = xmlMemBlocks(); 32834 reader = gen_xmlTextReaderPtr(n_reader, 0); 32835 input = gen_xmlParserInputBufferPtr(n_input, 1); 32836 URL = gen_filepath(n_URL, 2); 32837 encoding = gen_const_char_ptr(n_encoding, 3); 32838 options = gen_parseroptions(n_options, 4); 32839 32840 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options); 32841 desret_int(ret_val); 32842 call_tests++; 32843 des_xmlTextReaderPtr(n_reader, reader, 0); 32844 des_filepath(n_URL, URL, 2); 32845 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 32846 des_parseroptions(n_options, options, 4); 32847 xmlResetLastError(); 32848 if (mem_base != xmlMemBlocks()) { 32849 printf("Leak of %d blocks found in xmlTextReaderSetup", 32850 xmlMemBlocks() - mem_base); 32851 test_ret++; 32852 printf(" %d", n_reader); 32853 printf(" %d", n_input); 32854 printf(" %d", n_URL); 32855 printf(" %d", n_encoding); 32856 printf(" %d", n_options); 32857 printf("\n"); 32858 } 32859 } 32860 } 32861 } 32862 } 32863 } 32864 function_tests++; 32865 #endif 32866 32867 return(test_ret); 32868 } 32869 32870 32871 static int 32872 test_xmlTextReaderStandalone(void) { 32873 int test_ret = 0; 32874 32875 #if defined(LIBXML_READER_ENABLED) 32876 int mem_base; 32877 int ret_val; 32878 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32879 int n_reader; 32880 32881 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32882 mem_base = xmlMemBlocks(); 32883 reader = gen_xmlTextReaderPtr(n_reader, 0); 32884 32885 ret_val = xmlTextReaderStandalone(reader); 32886 desret_int(ret_val); 32887 call_tests++; 32888 des_xmlTextReaderPtr(n_reader, reader, 0); 32889 xmlResetLastError(); 32890 if (mem_base != xmlMemBlocks()) { 32891 printf("Leak of %d blocks found in xmlTextReaderStandalone", 32892 xmlMemBlocks() - mem_base); 32893 test_ret++; 32894 printf(" %d", n_reader); 32895 printf("\n"); 32896 } 32897 } 32898 function_tests++; 32899 #endif 32900 32901 return(test_ret); 32902 } 32903 32904 32905 static int 32906 test_xmlTextReaderValue(void) { 32907 int test_ret = 0; 32908 32909 #if defined(LIBXML_READER_ENABLED) 32910 int mem_base; 32911 xmlChar * ret_val; 32912 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32913 int n_reader; 32914 32915 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32916 mem_base = xmlMemBlocks(); 32917 reader = gen_xmlTextReaderPtr(n_reader, 0); 32918 32919 ret_val = xmlTextReaderValue(reader); 32920 desret_xmlChar_ptr(ret_val); 32921 call_tests++; 32922 des_xmlTextReaderPtr(n_reader, reader, 0); 32923 xmlResetLastError(); 32924 if (mem_base != xmlMemBlocks()) { 32925 printf("Leak of %d blocks found in xmlTextReaderValue", 32926 xmlMemBlocks() - mem_base); 32927 test_ret++; 32928 printf(" %d", n_reader); 32929 printf("\n"); 32930 } 32931 } 32932 function_tests++; 32933 #endif 32934 32935 return(test_ret); 32936 } 32937 32938 32939 static int 32940 test_xmlTextReaderXmlLang(void) { 32941 int test_ret = 0; 32942 32943 #if defined(LIBXML_READER_ENABLED) 32944 int mem_base; 32945 xmlChar * ret_val; 32946 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ 32947 int n_reader; 32948 32949 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 32950 mem_base = xmlMemBlocks(); 32951 reader = gen_xmlTextReaderPtr(n_reader, 0); 32952 32953 ret_val = xmlTextReaderXmlLang(reader); 32954 desret_xmlChar_ptr(ret_val); 32955 call_tests++; 32956 des_xmlTextReaderPtr(n_reader, reader, 0); 32957 xmlResetLastError(); 32958 if (mem_base != xmlMemBlocks()) { 32959 printf("Leak of %d blocks found in xmlTextReaderXmlLang", 32960 xmlMemBlocks() - mem_base); 32961 test_ret++; 32962 printf(" %d", n_reader); 32963 printf("\n"); 32964 } 32965 } 32966 function_tests++; 32967 #endif 32968 32969 return(test_ret); 32970 } 32971 32972 static int 32973 test_xmlreader(void) { 32974 int test_ret = 0; 32975 32976 if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n"); 32977 test_ret += test_xmlNewTextReader(); 32978 test_ret += test_xmlNewTextReaderFilename(); 32979 test_ret += test_xmlReaderForDoc(); 32980 test_ret += test_xmlReaderForFile(); 32981 test_ret += test_xmlReaderForMemory(); 32982 test_ret += test_xmlReaderNewDoc(); 32983 test_ret += test_xmlReaderNewFile(); 32984 test_ret += test_xmlReaderNewMemory(); 32985 test_ret += test_xmlReaderNewWalker(); 32986 test_ret += test_xmlReaderWalker(); 32987 test_ret += test_xmlTextReaderAttributeCount(); 32988 test_ret += test_xmlTextReaderBaseUri(); 32989 test_ret += test_xmlTextReaderByteConsumed(); 32990 test_ret += test_xmlTextReaderClose(); 32991 test_ret += test_xmlTextReaderConstBaseUri(); 32992 test_ret += test_xmlTextReaderConstEncoding(); 32993 test_ret += test_xmlTextReaderConstLocalName(); 32994 test_ret += test_xmlTextReaderConstName(); 32995 test_ret += test_xmlTextReaderConstNamespaceUri(); 32996 test_ret += test_xmlTextReaderConstPrefix(); 32997 test_ret += test_xmlTextReaderConstString(); 32998 test_ret += test_xmlTextReaderConstValue(); 32999 test_ret += test_xmlTextReaderConstXmlLang(); 33000 test_ret += test_xmlTextReaderConstXmlVersion(); 33001 test_ret += test_xmlTextReaderCurrentDoc(); 33002 test_ret += test_xmlTextReaderCurrentNode(); 33003 test_ret += test_xmlTextReaderDepth(); 33004 test_ret += test_xmlTextReaderExpand(); 33005 test_ret += test_xmlTextReaderGetAttribute(); 33006 test_ret += test_xmlTextReaderGetAttributeNo(); 33007 test_ret += test_xmlTextReaderGetAttributeNs(); 33008 test_ret += test_xmlTextReaderGetErrorHandler(); 33009 test_ret += test_xmlTextReaderGetParserColumnNumber(); 33010 test_ret += test_xmlTextReaderGetParserLineNumber(); 33011 test_ret += test_xmlTextReaderGetParserProp(); 33012 test_ret += test_xmlTextReaderGetRemainder(); 33013 test_ret += test_xmlTextReaderHasAttributes(); 33014 test_ret += test_xmlTextReaderHasValue(); 33015 test_ret += test_xmlTextReaderIsDefault(); 33016 test_ret += test_xmlTextReaderIsEmptyElement(); 33017 test_ret += test_xmlTextReaderIsNamespaceDecl(); 33018 test_ret += test_xmlTextReaderIsValid(); 33019 test_ret += test_xmlTextReaderLocalName(); 33020 test_ret += test_xmlTextReaderLocatorBaseURI(); 33021 test_ret += test_xmlTextReaderLocatorLineNumber(); 33022 test_ret += test_xmlTextReaderLookupNamespace(); 33023 test_ret += test_xmlTextReaderMoveToAttribute(); 33024 test_ret += test_xmlTextReaderMoveToAttributeNo(); 33025 test_ret += test_xmlTextReaderMoveToAttributeNs(); 33026 test_ret += test_xmlTextReaderMoveToElement(); 33027 test_ret += test_xmlTextReaderMoveToFirstAttribute(); 33028 test_ret += test_xmlTextReaderMoveToNextAttribute(); 33029 test_ret += test_xmlTextReaderName(); 33030 test_ret += test_xmlTextReaderNamespaceUri(); 33031 test_ret += test_xmlTextReaderNext(); 33032 test_ret += test_xmlTextReaderNextSibling(); 33033 test_ret += test_xmlTextReaderNodeType(); 33034 test_ret += test_xmlTextReaderNormalization(); 33035 test_ret += test_xmlTextReaderPrefix(); 33036 test_ret += test_xmlTextReaderPreserve(); 33037 test_ret += test_xmlTextReaderPreservePattern(); 33038 test_ret += test_xmlTextReaderQuoteChar(); 33039 test_ret += test_xmlTextReaderRead(); 33040 test_ret += test_xmlTextReaderReadAttributeValue(); 33041 test_ret += test_xmlTextReaderReadState(); 33042 test_ret += test_xmlTextReaderRelaxNGSetSchema(); 33043 test_ret += test_xmlTextReaderRelaxNGValidate(); 33044 test_ret += test_xmlTextReaderRelaxNGValidateCtxt(); 33045 test_ret += test_xmlTextReaderSchemaValidate(); 33046 test_ret += test_xmlTextReaderSchemaValidateCtxt(); 33047 test_ret += test_xmlTextReaderSetErrorHandler(); 33048 test_ret += test_xmlTextReaderSetParserProp(); 33049 test_ret += test_xmlTextReaderSetSchema(); 33050 test_ret += test_xmlTextReaderSetStructuredErrorHandler(); 33051 test_ret += test_xmlTextReaderSetup(); 33052 test_ret += test_xmlTextReaderStandalone(); 33053 test_ret += test_xmlTextReaderValue(); 33054 test_ret += test_xmlTextReaderXmlLang(); 33055 33056 if (test_ret != 0) 33057 printf("Module xmlreader: %d errors\n", test_ret); 33058 return(test_ret); 33059 } 33060 33061 static int 33062 test_xmlExpCtxtNbCons(void) { 33063 int test_ret = 0; 33064 33065 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33066 int mem_base; 33067 int ret_val; 33068 xmlExpCtxtPtr ctxt; /* an expression context */ 33069 int n_ctxt; 33070 33071 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { 33072 mem_base = xmlMemBlocks(); 33073 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); 33074 33075 ret_val = xmlExpCtxtNbCons(ctxt); 33076 desret_int(ret_val); 33077 call_tests++; 33078 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); 33079 xmlResetLastError(); 33080 if (mem_base != xmlMemBlocks()) { 33081 printf("Leak of %d blocks found in xmlExpCtxtNbCons", 33082 xmlMemBlocks() - mem_base); 33083 test_ret++; 33084 printf(" %d", n_ctxt); 33085 printf("\n"); 33086 } 33087 } 33088 function_tests++; 33089 #endif 33090 33091 return(test_ret); 33092 } 33093 33094 33095 static int 33096 test_xmlExpCtxtNbNodes(void) { 33097 int test_ret = 0; 33098 33099 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33100 int mem_base; 33101 int ret_val; 33102 xmlExpCtxtPtr ctxt; /* an expression context */ 33103 int n_ctxt; 33104 33105 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { 33106 mem_base = xmlMemBlocks(); 33107 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); 33108 33109 ret_val = xmlExpCtxtNbNodes(ctxt); 33110 desret_int(ret_val); 33111 call_tests++; 33112 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); 33113 xmlResetLastError(); 33114 if (mem_base != xmlMemBlocks()) { 33115 printf("Leak of %d blocks found in xmlExpCtxtNbNodes", 33116 xmlMemBlocks() - mem_base); 33117 test_ret++; 33118 printf(" %d", n_ctxt); 33119 printf("\n"); 33120 } 33121 } 33122 function_tests++; 33123 #endif 33124 33125 return(test_ret); 33126 } 33127 33128 33129 static int 33130 test_xmlExpDump(void) { 33131 int test_ret = 0; 33132 33133 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33134 int mem_base; 33135 xmlBufferPtr buf; /* a buffer to receive the output */ 33136 int n_buf; 33137 xmlExpNodePtr expr; /* the compiled expression */ 33138 int n_expr; 33139 33140 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 33141 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) { 33142 mem_base = xmlMemBlocks(); 33143 buf = gen_xmlBufferPtr(n_buf, 0); 33144 expr = gen_xmlExpNodePtr(n_expr, 1); 33145 33146 xmlExpDump(buf, expr); 33147 call_tests++; 33148 des_xmlBufferPtr(n_buf, buf, 0); 33149 des_xmlExpNodePtr(n_expr, expr, 1); 33150 xmlResetLastError(); 33151 if (mem_base != xmlMemBlocks()) { 33152 printf("Leak of %d blocks found in xmlExpDump", 33153 xmlMemBlocks() - mem_base); 33154 test_ret++; 33155 printf(" %d", n_buf); 33156 printf(" %d", n_expr); 33157 printf("\n"); 33158 } 33159 } 33160 } 33161 function_tests++; 33162 #endif 33163 33164 return(test_ret); 33165 } 33166 33167 33168 static int 33169 test_xmlExpExpDerive(void) { 33170 int test_ret = 0; 33171 33172 33173 /* missing type support */ 33174 return(test_ret); 33175 } 33176 33177 33178 static int 33179 test_xmlExpGetLanguage(void) { 33180 int test_ret = 0; 33181 33182 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33183 int mem_base; 33184 int ret_val; 33185 xmlExpCtxtPtr ctxt; /* the expression context */ 33186 int n_ctxt; 33187 xmlExpNodePtr exp; /* the expression */ 33188 int n_exp; 33189 xmlChar ** langList; /* where to store the tokens */ 33190 int n_langList; 33191 int len; /* the allocated length of @list */ 33192 int n_len; 33193 33194 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { 33195 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { 33196 for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) { 33197 for (n_len = 0;n_len < gen_nb_int;n_len++) { 33198 mem_base = xmlMemBlocks(); 33199 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); 33200 exp = gen_xmlExpNodePtr(n_exp, 1); 33201 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2); 33202 len = gen_int(n_len, 3); 33203 33204 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len); 33205 desret_int(ret_val); 33206 call_tests++; 33207 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); 33208 des_xmlExpNodePtr(n_exp, exp, 1); 33209 des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2); 33210 des_int(n_len, len, 3); 33211 xmlResetLastError(); 33212 if (mem_base != xmlMemBlocks()) { 33213 printf("Leak of %d blocks found in xmlExpGetLanguage", 33214 xmlMemBlocks() - mem_base); 33215 test_ret++; 33216 printf(" %d", n_ctxt); 33217 printf(" %d", n_exp); 33218 printf(" %d", n_langList); 33219 printf(" %d", n_len); 33220 printf("\n"); 33221 } 33222 } 33223 } 33224 } 33225 } 33226 function_tests++; 33227 #endif 33228 33229 return(test_ret); 33230 } 33231 33232 33233 static int 33234 test_xmlExpGetStart(void) { 33235 int test_ret = 0; 33236 33237 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33238 int mem_base; 33239 int ret_val; 33240 xmlExpCtxtPtr ctxt; /* the expression context */ 33241 int n_ctxt; 33242 xmlExpNodePtr exp; /* the expression */ 33243 int n_exp; 33244 xmlChar ** tokList; /* where to store the tokens */ 33245 int n_tokList; 33246 int len; /* the allocated length of @list */ 33247 int n_len; 33248 33249 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { 33250 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { 33251 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) { 33252 for (n_len = 0;n_len < gen_nb_int;n_len++) { 33253 mem_base = xmlMemBlocks(); 33254 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); 33255 exp = gen_xmlExpNodePtr(n_exp, 1); 33256 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2); 33257 len = gen_int(n_len, 3); 33258 33259 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len); 33260 desret_int(ret_val); 33261 call_tests++; 33262 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); 33263 des_xmlExpNodePtr(n_exp, exp, 1); 33264 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2); 33265 des_int(n_len, len, 3); 33266 xmlResetLastError(); 33267 if (mem_base != xmlMemBlocks()) { 33268 printf("Leak of %d blocks found in xmlExpGetStart", 33269 xmlMemBlocks() - mem_base); 33270 test_ret++; 33271 printf(" %d", n_ctxt); 33272 printf(" %d", n_exp); 33273 printf(" %d", n_tokList); 33274 printf(" %d", n_len); 33275 printf("\n"); 33276 } 33277 } 33278 } 33279 } 33280 } 33281 function_tests++; 33282 #endif 33283 33284 return(test_ret); 33285 } 33286 33287 33288 static int 33289 test_xmlExpIsNillable(void) { 33290 int test_ret = 0; 33291 33292 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33293 int mem_base; 33294 int ret_val; 33295 xmlExpNodePtr exp; /* the expression */ 33296 int n_exp; 33297 33298 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { 33299 mem_base = xmlMemBlocks(); 33300 exp = gen_xmlExpNodePtr(n_exp, 0); 33301 33302 ret_val = xmlExpIsNillable(exp); 33303 desret_int(ret_val); 33304 call_tests++; 33305 des_xmlExpNodePtr(n_exp, exp, 0); 33306 xmlResetLastError(); 33307 if (mem_base != xmlMemBlocks()) { 33308 printf("Leak of %d blocks found in xmlExpIsNillable", 33309 xmlMemBlocks() - mem_base); 33310 test_ret++; 33311 printf(" %d", n_exp); 33312 printf("\n"); 33313 } 33314 } 33315 function_tests++; 33316 #endif 33317 33318 return(test_ret); 33319 } 33320 33321 33322 static int 33323 test_xmlExpMaxToken(void) { 33324 int test_ret = 0; 33325 33326 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33327 int mem_base; 33328 int ret_val; 33329 xmlExpNodePtr expr; /* a compiled expression */ 33330 int n_expr; 33331 33332 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) { 33333 mem_base = xmlMemBlocks(); 33334 expr = gen_xmlExpNodePtr(n_expr, 0); 33335 33336 ret_val = xmlExpMaxToken(expr); 33337 desret_int(ret_val); 33338 call_tests++; 33339 des_xmlExpNodePtr(n_expr, expr, 0); 33340 xmlResetLastError(); 33341 if (mem_base != xmlMemBlocks()) { 33342 printf("Leak of %d blocks found in xmlExpMaxToken", 33343 xmlMemBlocks() - mem_base); 33344 test_ret++; 33345 printf(" %d", n_expr); 33346 printf("\n"); 33347 } 33348 } 33349 function_tests++; 33350 #endif 33351 33352 return(test_ret); 33353 } 33354 33355 33356 static int 33357 test_xmlExpNewAtom(void) { 33358 int test_ret = 0; 33359 33360 33361 /* missing type support */ 33362 return(test_ret); 33363 } 33364 33365 33366 static int 33367 test_xmlExpNewCtxt(void) { 33368 int test_ret = 0; 33369 33370 33371 /* missing type support */ 33372 return(test_ret); 33373 } 33374 33375 33376 static int 33377 test_xmlExpNewOr(void) { 33378 int test_ret = 0; 33379 33380 33381 /* missing type support */ 33382 return(test_ret); 33383 } 33384 33385 33386 static int 33387 test_xmlExpNewRange(void) { 33388 int test_ret = 0; 33389 33390 33391 /* missing type support */ 33392 return(test_ret); 33393 } 33394 33395 33396 static int 33397 test_xmlExpNewSeq(void) { 33398 int test_ret = 0; 33399 33400 33401 /* missing type support */ 33402 return(test_ret); 33403 } 33404 33405 33406 static int 33407 test_xmlExpParse(void) { 33408 int test_ret = 0; 33409 33410 33411 /* missing type support */ 33412 return(test_ret); 33413 } 33414 33415 33416 static int 33417 test_xmlExpRef(void) { 33418 int test_ret = 0; 33419 33420 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33421 int mem_base; 33422 xmlExpNodePtr exp; /* the expression */ 33423 int n_exp; 33424 33425 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { 33426 mem_base = xmlMemBlocks(); 33427 exp = gen_xmlExpNodePtr(n_exp, 0); 33428 33429 xmlExpRef(exp); 33430 call_tests++; 33431 des_xmlExpNodePtr(n_exp, exp, 0); 33432 xmlResetLastError(); 33433 if (mem_base != xmlMemBlocks()) { 33434 printf("Leak of %d blocks found in xmlExpRef", 33435 xmlMemBlocks() - mem_base); 33436 test_ret++; 33437 printf(" %d", n_exp); 33438 printf("\n"); 33439 } 33440 } 33441 function_tests++; 33442 #endif 33443 33444 return(test_ret); 33445 } 33446 33447 33448 static int 33449 test_xmlExpStringDerive(void) { 33450 int test_ret = 0; 33451 33452 33453 /* missing type support */ 33454 return(test_ret); 33455 } 33456 33457 33458 static int 33459 test_xmlExpSubsume(void) { 33460 int test_ret = 0; 33461 33462 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 33463 int mem_base; 33464 int ret_val; 33465 xmlExpCtxtPtr ctxt; /* the expressions context */ 33466 int n_ctxt; 33467 xmlExpNodePtr exp; /* the englobing expression */ 33468 int n_exp; 33469 xmlExpNodePtr sub; /* the subexpression */ 33470 int n_sub; 33471 33472 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { 33473 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { 33474 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) { 33475 mem_base = xmlMemBlocks(); 33476 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); 33477 exp = gen_xmlExpNodePtr(n_exp, 1); 33478 sub = gen_xmlExpNodePtr(n_sub, 2); 33479 33480 ret_val = xmlExpSubsume(ctxt, exp, sub); 33481 desret_int(ret_val); 33482 call_tests++; 33483 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); 33484 des_xmlExpNodePtr(n_exp, exp, 1); 33485 des_xmlExpNodePtr(n_sub, sub, 2); 33486 xmlResetLastError(); 33487 if (mem_base != xmlMemBlocks()) { 33488 printf("Leak of %d blocks found in xmlExpSubsume", 33489 xmlMemBlocks() - mem_base); 33490 test_ret++; 33491 printf(" %d", n_ctxt); 33492 printf(" %d", n_exp); 33493 printf(" %d", n_sub); 33494 printf("\n"); 33495 } 33496 } 33497 } 33498 } 33499 function_tests++; 33500 #endif 33501 33502 return(test_ret); 33503 } 33504 33505 #ifdef LIBXML_REGEXP_ENABLED 33506 33507 #define gen_nb_xmlRegExecCtxtPtr 1 33508 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 33509 return(NULL); 33510 } 33511 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 33512 } 33513 #endif 33514 33515 33516 static int 33517 test_xmlRegExecErrInfo(void) { 33518 int test_ret = 0; 33519 33520 #if defined(LIBXML_REGEXP_ENABLED) 33521 int mem_base; 33522 int ret_val; 33523 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */ 33524 int n_exec; 33525 xmlChar ** string; /* return value for the error string */ 33526 int n_string; 33527 int * nbval; /* pointer to the number of accepted values IN/OUT */ 33528 int n_nbval; 33529 int * nbneg; /* return number of negative transitions */ 33530 int n_nbneg; 33531 xmlChar ** values; /* pointer to the array of acceptable values */ 33532 int n_values; 33533 int * terminal; /* return value if this was a terminal state */ 33534 int n_terminal; 33535 33536 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { 33537 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) { 33538 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) { 33539 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) { 33540 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) { 33541 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) { 33542 mem_base = xmlMemBlocks(); 33543 exec = gen_xmlRegExecCtxtPtr(n_exec, 0); 33544 string = gen_const_xmlChar_ptr_ptr(n_string, 1); 33545 nbval = gen_int_ptr(n_nbval, 2); 33546 nbneg = gen_int_ptr(n_nbneg, 3); 33547 values = gen_xmlChar_ptr_ptr(n_values, 4); 33548 terminal = gen_int_ptr(n_terminal, 5); 33549 33550 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal); 33551 desret_int(ret_val); 33552 call_tests++; 33553 des_xmlRegExecCtxtPtr(n_exec, exec, 0); 33554 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1); 33555 des_int_ptr(n_nbval, nbval, 2); 33556 des_int_ptr(n_nbneg, nbneg, 3); 33557 des_xmlChar_ptr_ptr(n_values, values, 4); 33558 des_int_ptr(n_terminal, terminal, 5); 33559 xmlResetLastError(); 33560 if (mem_base != xmlMemBlocks()) { 33561 printf("Leak of %d blocks found in xmlRegExecErrInfo", 33562 xmlMemBlocks() - mem_base); 33563 test_ret++; 33564 printf(" %d", n_exec); 33565 printf(" %d", n_string); 33566 printf(" %d", n_nbval); 33567 printf(" %d", n_nbneg); 33568 printf(" %d", n_values); 33569 printf(" %d", n_terminal); 33570 printf("\n"); 33571 } 33572 } 33573 } 33574 } 33575 } 33576 } 33577 } 33578 function_tests++; 33579 #endif 33580 33581 return(test_ret); 33582 } 33583 33584 33585 static int 33586 test_xmlRegExecNextValues(void) { 33587 int test_ret = 0; 33588 33589 #if defined(LIBXML_REGEXP_ENABLED) 33590 int mem_base; 33591 int ret_val; 33592 xmlRegExecCtxtPtr exec; /* a regexp execution context */ 33593 int n_exec; 33594 int * nbval; /* pointer to the number of accepted values IN/OUT */ 33595 int n_nbval; 33596 int * nbneg; /* return number of negative transitions */ 33597 int n_nbneg; 33598 xmlChar ** values; /* pointer to the array of acceptable values */ 33599 int n_values; 33600 int * terminal; /* return value if this was a terminal state */ 33601 int n_terminal; 33602 33603 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { 33604 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) { 33605 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) { 33606 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) { 33607 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) { 33608 mem_base = xmlMemBlocks(); 33609 exec = gen_xmlRegExecCtxtPtr(n_exec, 0); 33610 nbval = gen_int_ptr(n_nbval, 1); 33611 nbneg = gen_int_ptr(n_nbneg, 2); 33612 values = gen_xmlChar_ptr_ptr(n_values, 3); 33613 terminal = gen_int_ptr(n_terminal, 4); 33614 33615 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal); 33616 desret_int(ret_val); 33617 call_tests++; 33618 des_xmlRegExecCtxtPtr(n_exec, exec, 0); 33619 des_int_ptr(n_nbval, nbval, 1); 33620 des_int_ptr(n_nbneg, nbneg, 2); 33621 des_xmlChar_ptr_ptr(n_values, values, 3); 33622 des_int_ptr(n_terminal, terminal, 4); 33623 xmlResetLastError(); 33624 if (mem_base != xmlMemBlocks()) { 33625 printf("Leak of %d blocks found in xmlRegExecNextValues", 33626 xmlMemBlocks() - mem_base); 33627 test_ret++; 33628 printf(" %d", n_exec); 33629 printf(" %d", n_nbval); 33630 printf(" %d", n_nbneg); 33631 printf(" %d", n_values); 33632 printf(" %d", n_terminal); 33633 printf("\n"); 33634 } 33635 } 33636 } 33637 } 33638 } 33639 } 33640 function_tests++; 33641 #endif 33642 33643 return(test_ret); 33644 } 33645 33646 33647 static int 33648 test_xmlRegExecPushString(void) { 33649 int test_ret = 0; 33650 33651 #if defined(LIBXML_REGEXP_ENABLED) 33652 int mem_base; 33653 int ret_val; 33654 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */ 33655 int n_exec; 33656 xmlChar * value; /* a string token input */ 33657 int n_value; 33658 void * data; /* data associated to the token to reuse in callbacks */ 33659 int n_data; 33660 33661 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { 33662 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 33663 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 33664 mem_base = xmlMemBlocks(); 33665 exec = gen_xmlRegExecCtxtPtr(n_exec, 0); 33666 value = gen_const_xmlChar_ptr(n_value, 1); 33667 data = gen_userdata(n_data, 2); 33668 33669 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data); 33670 desret_int(ret_val); 33671 call_tests++; 33672 des_xmlRegExecCtxtPtr(n_exec, exec, 0); 33673 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 33674 des_userdata(n_data, data, 2); 33675 xmlResetLastError(); 33676 if (mem_base != xmlMemBlocks()) { 33677 printf("Leak of %d blocks found in xmlRegExecPushString", 33678 xmlMemBlocks() - mem_base); 33679 test_ret++; 33680 printf(" %d", n_exec); 33681 printf(" %d", n_value); 33682 printf(" %d", n_data); 33683 printf("\n"); 33684 } 33685 } 33686 } 33687 } 33688 function_tests++; 33689 #endif 33690 33691 return(test_ret); 33692 } 33693 33694 33695 static int 33696 test_xmlRegExecPushString2(void) { 33697 int test_ret = 0; 33698 33699 #if defined(LIBXML_REGEXP_ENABLED) 33700 int mem_base; 33701 int ret_val; 33702 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */ 33703 int n_exec; 33704 xmlChar * value; /* the first string token input */ 33705 int n_value; 33706 xmlChar * value2; /* the second string token input */ 33707 int n_value2; 33708 void * data; /* data associated to the token to reuse in callbacks */ 33709 int n_data; 33710 33711 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { 33712 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 33713 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) { 33714 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 33715 mem_base = xmlMemBlocks(); 33716 exec = gen_xmlRegExecCtxtPtr(n_exec, 0); 33717 value = gen_const_xmlChar_ptr(n_value, 1); 33718 value2 = gen_const_xmlChar_ptr(n_value2, 2); 33719 data = gen_userdata(n_data, 3); 33720 33721 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data); 33722 desret_int(ret_val); 33723 call_tests++; 33724 des_xmlRegExecCtxtPtr(n_exec, exec, 0); 33725 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 33726 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2); 33727 des_userdata(n_data, data, 3); 33728 xmlResetLastError(); 33729 if (mem_base != xmlMemBlocks()) { 33730 printf("Leak of %d blocks found in xmlRegExecPushString2", 33731 xmlMemBlocks() - mem_base); 33732 test_ret++; 33733 printf(" %d", n_exec); 33734 printf(" %d", n_value); 33735 printf(" %d", n_value2); 33736 printf(" %d", n_data); 33737 printf("\n"); 33738 } 33739 } 33740 } 33741 } 33742 } 33743 function_tests++; 33744 #endif 33745 33746 return(test_ret); 33747 } 33748 33749 #ifdef LIBXML_REGEXP_ENABLED 33750 33751 #define gen_nb_xmlRegexpPtr 1 33752 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 33753 return(NULL); 33754 } 33755 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 33756 } 33757 #endif 33758 33759 33760 static int 33761 test_xmlRegNewExecCtxt(void) { 33762 int test_ret = 0; 33763 33764 33765 /* missing type support */ 33766 return(test_ret); 33767 } 33768 33769 33770 static int 33771 test_xmlRegexpCompile(void) { 33772 int test_ret = 0; 33773 33774 33775 /* missing type support */ 33776 return(test_ret); 33777 } 33778 33779 33780 static int 33781 test_xmlRegexpExec(void) { 33782 int test_ret = 0; 33783 33784 #if defined(LIBXML_REGEXP_ENABLED) 33785 int mem_base; 33786 int ret_val; 33787 xmlRegexpPtr comp; /* the compiled regular expression */ 33788 int n_comp; 33789 xmlChar * content; /* the value to check against the regular expression */ 33790 int n_content; 33791 33792 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) { 33793 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 33794 mem_base = xmlMemBlocks(); 33795 comp = gen_xmlRegexpPtr(n_comp, 0); 33796 content = gen_const_xmlChar_ptr(n_content, 1); 33797 33798 ret_val = xmlRegexpExec(comp, (const xmlChar *)content); 33799 desret_int(ret_val); 33800 call_tests++; 33801 des_xmlRegexpPtr(n_comp, comp, 0); 33802 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 33803 xmlResetLastError(); 33804 if (mem_base != xmlMemBlocks()) { 33805 printf("Leak of %d blocks found in xmlRegexpExec", 33806 xmlMemBlocks() - mem_base); 33807 test_ret++; 33808 printf(" %d", n_comp); 33809 printf(" %d", n_content); 33810 printf("\n"); 33811 } 33812 } 33813 } 33814 function_tests++; 33815 #endif 33816 33817 return(test_ret); 33818 } 33819 33820 33821 static int 33822 test_xmlRegexpIsDeterminist(void) { 33823 int test_ret = 0; 33824 33825 #if defined(LIBXML_REGEXP_ENABLED) 33826 int mem_base; 33827 int ret_val; 33828 xmlRegexpPtr comp; /* the compiled regular expression */ 33829 int n_comp; 33830 33831 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) { 33832 mem_base = xmlMemBlocks(); 33833 comp = gen_xmlRegexpPtr(n_comp, 0); 33834 33835 ret_val = xmlRegexpIsDeterminist(comp); 33836 desret_int(ret_val); 33837 call_tests++; 33838 des_xmlRegexpPtr(n_comp, comp, 0); 33839 xmlResetLastError(); 33840 if (mem_base != xmlMemBlocks()) { 33841 printf("Leak of %d blocks found in xmlRegexpIsDeterminist", 33842 xmlMemBlocks() - mem_base); 33843 test_ret++; 33844 printf(" %d", n_comp); 33845 printf("\n"); 33846 } 33847 } 33848 function_tests++; 33849 #endif 33850 33851 return(test_ret); 33852 } 33853 33854 33855 static int 33856 test_xmlRegexpPrint(void) { 33857 int test_ret = 0; 33858 33859 #if defined(LIBXML_REGEXP_ENABLED) 33860 int mem_base; 33861 FILE * output; /* the file for the output debug */ 33862 int n_output; 33863 xmlRegexpPtr regexp; /* the compiled regexp */ 33864 int n_regexp; 33865 33866 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { 33867 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) { 33868 mem_base = xmlMemBlocks(); 33869 output = gen_FILE_ptr(n_output, 0); 33870 regexp = gen_xmlRegexpPtr(n_regexp, 1); 33871 33872 xmlRegexpPrint(output, regexp); 33873 call_tests++; 33874 des_FILE_ptr(n_output, output, 0); 33875 des_xmlRegexpPtr(n_regexp, regexp, 1); 33876 xmlResetLastError(); 33877 if (mem_base != xmlMemBlocks()) { 33878 printf("Leak of %d blocks found in xmlRegexpPrint", 33879 xmlMemBlocks() - mem_base); 33880 test_ret++; 33881 printf(" %d", n_output); 33882 printf(" %d", n_regexp); 33883 printf("\n"); 33884 } 33885 } 33886 } 33887 function_tests++; 33888 #endif 33889 33890 return(test_ret); 33891 } 33892 33893 static int 33894 test_xmlregexp(void) { 33895 int test_ret = 0; 33896 33897 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n"); 33898 test_ret += test_xmlExpCtxtNbCons(); 33899 test_ret += test_xmlExpCtxtNbNodes(); 33900 test_ret += test_xmlExpDump(); 33901 test_ret += test_xmlExpExpDerive(); 33902 test_ret += test_xmlExpGetLanguage(); 33903 test_ret += test_xmlExpGetStart(); 33904 test_ret += test_xmlExpIsNillable(); 33905 test_ret += test_xmlExpMaxToken(); 33906 test_ret += test_xmlExpNewAtom(); 33907 test_ret += test_xmlExpNewCtxt(); 33908 test_ret += test_xmlExpNewOr(); 33909 test_ret += test_xmlExpNewRange(); 33910 test_ret += test_xmlExpNewSeq(); 33911 test_ret += test_xmlExpParse(); 33912 test_ret += test_xmlExpRef(); 33913 test_ret += test_xmlExpStringDerive(); 33914 test_ret += test_xmlExpSubsume(); 33915 test_ret += test_xmlRegExecErrInfo(); 33916 test_ret += test_xmlRegExecNextValues(); 33917 test_ret += test_xmlRegExecPushString(); 33918 test_ret += test_xmlRegExecPushString2(); 33919 test_ret += test_xmlRegNewExecCtxt(); 33920 test_ret += test_xmlRegexpCompile(); 33921 test_ret += test_xmlRegexpExec(); 33922 test_ret += test_xmlRegexpIsDeterminist(); 33923 test_ret += test_xmlRegexpPrint(); 33924 33925 if (test_ret != 0) 33926 printf("Module xmlregexp: %d errors\n", test_ret); 33927 return(test_ret); 33928 } 33929 #ifdef LIBXML_OUTPUT_ENABLED 33930 33931 #define gen_nb_xmlSaveCtxtPtr 1 33932 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 33933 return(NULL); 33934 } 33935 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 33936 } 33937 #endif 33938 33939 33940 static int 33941 test_xmlSaveClose(void) { 33942 int test_ret = 0; 33943 33944 #if defined(LIBXML_OUTPUT_ENABLED) 33945 int mem_base; 33946 int ret_val; 33947 xmlSaveCtxtPtr ctxt; /* a document saving context */ 33948 int n_ctxt; 33949 33950 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { 33951 mem_base = xmlMemBlocks(); 33952 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); 33953 33954 ret_val = xmlSaveClose(ctxt); 33955 desret_int(ret_val); 33956 call_tests++; 33957 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); 33958 xmlResetLastError(); 33959 if (mem_base != xmlMemBlocks()) { 33960 printf("Leak of %d blocks found in xmlSaveClose", 33961 xmlMemBlocks() - mem_base); 33962 test_ret++; 33963 printf(" %d", n_ctxt); 33964 printf("\n"); 33965 } 33966 } 33967 function_tests++; 33968 #endif 33969 33970 return(test_ret); 33971 } 33972 33973 33974 static int 33975 test_xmlSaveDoc(void) { 33976 int test_ret = 0; 33977 33978 #if defined(LIBXML_OUTPUT_ENABLED) 33979 int mem_base; 33980 long ret_val; 33981 xmlSaveCtxtPtr ctxt; /* a document saving context */ 33982 int n_ctxt; 33983 xmlDocPtr doc; /* a document */ 33984 int n_doc; 33985 33986 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { 33987 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 33988 mem_base = xmlMemBlocks(); 33989 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); 33990 doc = gen_xmlDocPtr(n_doc, 1); 33991 33992 ret_val = xmlSaveDoc(ctxt, doc); 33993 desret_long(ret_val); 33994 call_tests++; 33995 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); 33996 des_xmlDocPtr(n_doc, doc, 1); 33997 xmlResetLastError(); 33998 if (mem_base != xmlMemBlocks()) { 33999 printf("Leak of %d blocks found in xmlSaveDoc", 34000 xmlMemBlocks() - mem_base); 34001 test_ret++; 34002 printf(" %d", n_ctxt); 34003 printf(" %d", n_doc); 34004 printf("\n"); 34005 } 34006 } 34007 } 34008 function_tests++; 34009 #endif 34010 34011 return(test_ret); 34012 } 34013 34014 34015 static int 34016 test_xmlSaveFlush(void) { 34017 int test_ret = 0; 34018 34019 #if defined(LIBXML_OUTPUT_ENABLED) 34020 int mem_base; 34021 int ret_val; 34022 xmlSaveCtxtPtr ctxt; /* a document saving context */ 34023 int n_ctxt; 34024 34025 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { 34026 mem_base = xmlMemBlocks(); 34027 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); 34028 34029 ret_val = xmlSaveFlush(ctxt); 34030 desret_int(ret_val); 34031 call_tests++; 34032 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); 34033 xmlResetLastError(); 34034 if (mem_base != xmlMemBlocks()) { 34035 printf("Leak of %d blocks found in xmlSaveFlush", 34036 xmlMemBlocks() - mem_base); 34037 test_ret++; 34038 printf(" %d", n_ctxt); 34039 printf("\n"); 34040 } 34041 } 34042 function_tests++; 34043 #endif 34044 34045 return(test_ret); 34046 } 34047 34048 34049 static int 34050 test_xmlSaveSetAttrEscape(void) { 34051 int test_ret = 0; 34052 34053 34054 /* missing type support */ 34055 return(test_ret); 34056 } 34057 34058 34059 static int 34060 test_xmlSaveSetEscape(void) { 34061 int test_ret = 0; 34062 34063 34064 /* missing type support */ 34065 return(test_ret); 34066 } 34067 34068 34069 static int 34070 test_xmlSaveToBuffer(void) { 34071 int test_ret = 0; 34072 34073 34074 /* missing type support */ 34075 return(test_ret); 34076 } 34077 34078 34079 static int 34080 test_xmlSaveToFd(void) { 34081 int test_ret = 0; 34082 34083 34084 /* missing type support */ 34085 return(test_ret); 34086 } 34087 34088 34089 static int 34090 test_xmlSaveToFilename(void) { 34091 int test_ret = 0; 34092 34093 34094 /* missing type support */ 34095 return(test_ret); 34096 } 34097 34098 34099 static int 34100 test_xmlSaveTree(void) { 34101 int test_ret = 0; 34102 34103 #if defined(LIBXML_OUTPUT_ENABLED) 34104 int mem_base; 34105 long ret_val; 34106 xmlSaveCtxtPtr ctxt; /* a document saving context */ 34107 int n_ctxt; 34108 xmlNodePtr node; /* the top node of the subtree to save */ 34109 int n_node; 34110 34111 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { 34112 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 34113 mem_base = xmlMemBlocks(); 34114 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); 34115 node = gen_xmlNodePtr(n_node, 1); 34116 34117 ret_val = xmlSaveTree(ctxt, node); 34118 desret_long(ret_val); 34119 call_tests++; 34120 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); 34121 des_xmlNodePtr(n_node, node, 1); 34122 xmlResetLastError(); 34123 if (mem_base != xmlMemBlocks()) { 34124 printf("Leak of %d blocks found in xmlSaveTree", 34125 xmlMemBlocks() - mem_base); 34126 test_ret++; 34127 printf(" %d", n_ctxt); 34128 printf(" %d", n_node); 34129 printf("\n"); 34130 } 34131 } 34132 } 34133 function_tests++; 34134 #endif 34135 34136 return(test_ret); 34137 } 34138 34139 static int 34140 test_xmlsave(void) { 34141 int test_ret = 0; 34142 34143 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n"); 34144 test_ret += test_xmlSaveClose(); 34145 test_ret += test_xmlSaveDoc(); 34146 test_ret += test_xmlSaveFlush(); 34147 test_ret += test_xmlSaveSetAttrEscape(); 34148 test_ret += test_xmlSaveSetEscape(); 34149 test_ret += test_xmlSaveToBuffer(); 34150 test_ret += test_xmlSaveToFd(); 34151 test_ret += test_xmlSaveToFilename(); 34152 test_ret += test_xmlSaveTree(); 34153 34154 if (test_ret != 0) 34155 printf("Module xmlsave: %d errors\n", test_ret); 34156 return(test_ret); 34157 } 34158 34159 static int 34160 test_xmlSchemaDump(void) { 34161 int test_ret = 0; 34162 34163 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 34164 int mem_base; 34165 FILE * output; /* the file output */ 34166 int n_output; 34167 xmlSchemaPtr schema; /* a schema structure */ 34168 int n_schema; 34169 34170 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { 34171 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) { 34172 mem_base = xmlMemBlocks(); 34173 output = gen_FILE_ptr(n_output, 0); 34174 schema = gen_xmlSchemaPtr(n_schema, 1); 34175 34176 xmlSchemaDump(output, schema); 34177 call_tests++; 34178 des_FILE_ptr(n_output, output, 0); 34179 des_xmlSchemaPtr(n_schema, schema, 1); 34180 xmlResetLastError(); 34181 if (mem_base != xmlMemBlocks()) { 34182 printf("Leak of %d blocks found in xmlSchemaDump", 34183 xmlMemBlocks() - mem_base); 34184 test_ret++; 34185 printf(" %d", n_output); 34186 printf(" %d", n_schema); 34187 printf("\n"); 34188 } 34189 } 34190 } 34191 function_tests++; 34192 #endif 34193 34194 return(test_ret); 34195 } 34196 34197 #ifdef LIBXML_SCHEMAS_ENABLED 34198 34199 #define gen_nb_xmlSchemaParserCtxtPtr 1 34200 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 34201 return(NULL); 34202 } 34203 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 34204 } 34205 #endif 34206 34207 #ifdef LIBXML_SCHEMAS_ENABLED 34208 34209 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1 34210 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 34211 return(NULL); 34212 } 34213 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 34214 } 34215 #endif 34216 34217 #ifdef LIBXML_SCHEMAS_ENABLED 34218 34219 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1 34220 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 34221 return(NULL); 34222 } 34223 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 34224 } 34225 #endif 34226 34227 34228 static int 34229 test_xmlSchemaGetParserErrors(void) { 34230 int test_ret = 0; 34231 34232 #if defined(LIBXML_SCHEMAS_ENABLED) 34233 int mem_base; 34234 int ret_val; 34235 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */ 34236 int n_ctxt; 34237 xmlSchemaValidityErrorFunc * err; /* the error callback result */ 34238 int n_err; 34239 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */ 34240 int n_warn; 34241 void ** ctx; /* contextual data for the callbacks result */ 34242 int n_ctx; 34243 34244 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) { 34245 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) { 34246 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) { 34247 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { 34248 mem_base = xmlMemBlocks(); 34249 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0); 34250 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1); 34251 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2); 34252 ctx = gen_void_ptr_ptr(n_ctx, 3); 34253 34254 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx); 34255 desret_int(ret_val); 34256 call_tests++; 34257 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0); 34258 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1); 34259 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2); 34260 des_void_ptr_ptr(n_ctx, ctx, 3); 34261 xmlResetLastError(); 34262 if (mem_base != xmlMemBlocks()) { 34263 printf("Leak of %d blocks found in xmlSchemaGetParserErrors", 34264 xmlMemBlocks() - mem_base); 34265 test_ret++; 34266 printf(" %d", n_ctxt); 34267 printf(" %d", n_err); 34268 printf(" %d", n_warn); 34269 printf(" %d", n_ctx); 34270 printf("\n"); 34271 } 34272 }