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 #ifdef HAVE_CONFIG_H 12 #include "libxml.h" 13 #else 14 #include <stdio.h> 15 #endif 16 17 #include <stdlib.h> /* for putenv() */ 18 #include <string.h> 19 #include <libxml/xmlerror.h> 20 #include <libxml/relaxng.h> 21 22 #if defined(_WIN32) && !defined(__CYGWIN__) 23 #define snprintf _snprintf 24 #endif 25 26 static int testlibxml2(void); 27 static int test_module(const char *module); 28 29 static int generic_errors = 0; 30 static int call_tests = 0; 31 static int function_tests = 0; 32 33 static xmlChar chartab[1024]; 34 static int inttab[1024]; 35 static unsigned long longtab[1024]; 36 37 static xmlDocPtr api_doc = NULL; 38 static xmlDtdPtr api_dtd = NULL; 39 static xmlNodePtr api_root = NULL; 40 static xmlAttrPtr api_attr = NULL; 41 static xmlNsPtr api_ns = NULL; 42 43 static void 44 structured_errors(void *userData ATTRIBUTE_UNUSED, 45 xmlErrorPtr error ATTRIBUTE_UNUSED) { 46 generic_errors++; 47 } 48 49 static void 50 free_api_doc(void) { 51 xmlFreeDoc(api_doc); 52 api_doc = NULL; 53 api_dtd = NULL; 54 api_root = NULL; 55 api_attr = NULL; 56 api_ns = NULL; 57 } 58 59 static xmlDocPtr 60 get_api_doc(void) { 61 if (api_doc == NULL) { 62 api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0); 63 api_root = NULL; 64 api_attr = NULL; 65 } 66 return(api_doc); 67 } 68 69 static xmlDtdPtr 70 get_api_dtd(void) { 71 if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) { 72 get_api_doc(); 73 if ((api_doc != NULL) && (api_doc->children != NULL) && 74 (api_doc->children->type == XML_DTD_NODE)) 75 api_dtd = (xmlDtdPtr) api_doc->children; 76 } 77 return(api_dtd); 78 } 79 80 static xmlNodePtr 81 get_api_root(void) { 82 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) { 83 get_api_doc(); 84 if ((api_doc != NULL) && (api_doc->children != NULL) && 85 (api_doc->children->next != NULL) && 86 (api_doc->children->next->type == XML_ELEMENT_NODE)) 87 api_root = api_doc->children->next; 88 } 89 return(api_root); 90 } 91 92 static xmlNsPtr 93 get_api_ns(void) { 94 get_api_root(); 95 if (api_root != NULL) 96 api_ns = api_root->nsDef; 97 return(api_ns); 98 } 99 100 static xmlAttrPtr 101 get_api_attr(void) { 102 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) 103 static int nr = 0; 104 xmlChar name[20]; 105 #endif 106 107 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) { 108 get_api_root(); 109 } 110 if (api_root == NULL) 111 return(NULL); 112 if (api_root->properties != NULL) { 113 api_attr = api_root->properties; 114 return(api_root->properties); 115 } 116 api_attr = NULL; 117 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) 118 snprintf((char *) name, 20, "foo%d", nr++); 119 api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar"); 120 #endif 121 return(api_attr); 122 } 123 124 static int quiet = 0; 125 126 int main(int argc, char **argv) { 127 int ret; 128 int blocks, mem; 129 130 /* access to the proxy can slow up regression tests a lot */ 131 putenv((char *) "http_proxy="); 132 133 memset(chartab, 0, sizeof(chartab)); 134 strncpy((char *) chartab, " chartab\n", 20); 135 memset(inttab, 0, sizeof(inttab)); 136 memset(longtab, 0, sizeof(longtab)); 137 138 xmlInitParser(); 139 #ifdef LIBXML_SCHEMAS_ENABLED 140 xmlRelaxNGInitTypes(); 141 #endif 142 143 LIBXML_TEST_VERSION 144 145 xmlSetStructuredErrorFunc(NULL, structured_errors); 146 147 if (argc >= 2) { 148 if (!strcmp(argv[1], "-q")) { 149 quiet = 1; 150 if (argc >= 3) 151 ret = test_module(argv[2]); 152 else 153 ret = testlibxml2(); 154 } else { 155 ret = test_module(argv[1]); 156 } 157 } else 158 ret = testlibxml2(); 159 160 xmlCleanupParser(); 161 blocks = xmlMemBlocks(); 162 mem = xmlMemUsed(); 163 if ((blocks != 0) || (mem != 0)) { 164 printf("testapi leaked %d bytes in %d blocks\n", mem, blocks); 165 } 166 xmlMemoryDump(); 167 168 return (ret != 0); 169 } 170 171 #include <libxml/HTMLparser.h> 172 #include <libxml/HTMLtree.h> 173 #include <libxml/catalog.h> 174 #include <libxml/chvalid.h> 175 #include <libxml/dict.h> 176 #include <libxml/encoding.h> 177 #include <libxml/entities.h> 178 #include <libxml/hash.h> 179 #include <libxml/list.h> 180 #include <libxml/nanoftp.h> 181 #include <libxml/nanohttp.h> 182 #include <libxml/parser.h> 183 #include <libxml/parserInternals.h> 184 #include <libxml/pattern.h> 185 #include <libxml/relaxng.h> 186 #include <libxml/schemasInternals.h> 187 #include <libxml/schematron.h> 188 #include <libxml/tree.h> 189 #include <libxml/uri.h> 190 #include <libxml/valid.h> 191 #include <libxml/xinclude.h> 192 #include <libxml/xmlIO.h> 193 #include <libxml/xmlerror.h> 194 #include <libxml/xmlreader.h> 195 #include <libxml/xmlsave.h> 196 #include <libxml/xmlschemas.h> 197 #include <libxml/xmlschemastypes.h> 198 #include <libxml/xmlstring.h> 199 #include <libxml/xmlwriter.h> 200 #include <libxml/xpath.h> 201 #include <libxml/xpointer.h> 202 #include <libxml/debugXML.h> 203 204 /* 205 We manually define xmlErrMemory because it's normal declaration 206 is "hidden" by #ifdef IN_LIBXML 207 */ 208 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra); 209 210 /* 211 We need some "remote" addresses, but want to avoid getting into 212 name resolution delays, so we use these 213 */ 214 #define REMOTE1GOOD "http://localhost/" 215 #define REMOTE1BAD "http:http://http" 216 #define REMOTE2GOOD "ftp://localhost/foo" 217 218 #define gen_nb_void_ptr 2 219 220 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 221 return(NULL); 222 } 223 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 224 } 225 226 #if 0 227 #define gen_nb_const_void_ptr 2 228 229 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) { 230 if (no == 0) return((const void *) "immutable string"); 231 return(NULL); 232 } 233 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 234 } 235 #endif 236 237 #define gen_nb_userdata 3 238 239 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) { 240 if (no == 0) return((void *) &call_tests); 241 if (no == 1) return((void *) -1); 242 return(NULL); 243 } 244 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 245 } 246 247 248 #define gen_nb_int 4 249 250 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) { 251 if (no == 0) return(0); 252 if (no == 1) return(1); 253 if (no == 2) return(-1); 254 if (no == 3) return(122); 255 return(-1); 256 } 257 258 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 259 } 260 261 #define gen_nb_parseroptions 5 262 263 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) { 264 if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER); 265 if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA); 266 if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN); 267 if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT); 268 return(XML_PARSE_SAX1); 269 } 270 271 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 272 } 273 274 #if 0 275 #define gen_nb_long 5 276 277 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) { 278 if (no == 0) return(0); 279 if (no == 1) return(1); 280 if (no == 2) return(-1); 281 if (no == 3) return(122); 282 return(-1); 283 } 284 285 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 286 } 287 #endif 288 289 #define gen_nb_xmlChar 4 290 291 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) { 292 if (no == 0) return('a'); 293 if (no == 1) return(' '); 294 if (no == 2) return((xmlChar) ''); 295 return(0); 296 } 297 298 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 299 } 300 301 #define gen_nb_unsigned_int 3 302 303 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) { 304 if (no == 0) return(0); 305 if (no == 1) return(1); 306 if (no == 2) return(122); 307 return((unsigned int) -1); 308 } 309 310 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 311 } 312 313 #define gen_nb_unsigned_long 4 314 315 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) { 316 if (no == 0) return(0); 317 if (no == 1) return(1); 318 if (no == 2) return(122); 319 return((unsigned long) -1); 320 } 321 322 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 323 } 324 325 #define gen_nb_double 4 326 327 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) { 328 if (no == 0) return(0); 329 if (no == 1) return(-1.1); 330 #if defined(LIBXML_XPATH_ENABLED) 331 if (no == 2) return(xmlXPathNAN); 332 #endif 333 return(-1); 334 } 335 336 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 337 } 338 339 #define gen_nb_unsigned_long_ptr 2 340 341 static unsigned long *gen_unsigned_long_ptr(int no, int nr) { 342 if (no == 0) return(&longtab[nr]); 343 return(NULL); 344 } 345 346 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 347 } 348 349 #define gen_nb_int_ptr 2 350 351 static int *gen_int_ptr(int no, int nr) { 352 if (no == 0) return(&inttab[nr]); 353 return(NULL); 354 } 355 356 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 357 } 358 359 #define gen_nb_const_char_ptr 4 360 361 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) { 362 if (no == 0) return((char *) "foo"); 363 if (no == 1) return((char *) "<foo/>"); 364 if (no == 2) return((char *) "test/ent2"); 365 return(NULL); 366 } 367 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 368 } 369 370 #define gen_nb_xmlChar_ptr 2 371 372 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) { 373 if (no == 0) return(&chartab[0]); 374 return(NULL); 375 } 376 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 377 } 378 379 #define gen_nb_FILE_ptr 2 380 381 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) { 382 if (no == 0) return(fopen("test.out", "a+")); 383 return(NULL); 384 } 385 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) { 386 if (val != NULL) fclose(val); 387 } 388 389 #define gen_nb_debug_FILE_ptr 2 390 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 391 return(fopen("test.out", "a+")); 392 } 393 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) { 394 if (val != NULL) fclose(val); 395 } 396 397 #define gen_nb_const_xmlChar_ptr 5 398 399 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) { 400 if (no == 0) return((xmlChar *) "foo"); 401 if (no == 1) return((xmlChar *) "<foo/>"); 402 if (no == 2) return((xmlChar *) "nne"); 403 if (no == 3) return((xmlChar *) " 2ab "); 404 return(NULL); 405 } 406 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 407 } 408 409 #define gen_nb_filepath 8 410 411 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) { 412 if (no == 0) return("missing.xml"); 413 if (no == 1) return("<foo/>"); 414 if (no == 2) return("test/ent2"); 415 if (no == 3) return("test/valid/REC-xml-19980210.xml"); 416 if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd"); 417 if (no == 5) return(REMOTE1GOOD); 418 if (no == 6) return(REMOTE1BAD); 419 return(NULL); 420 } 421 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 422 } 423 424 #define gen_nb_eaten_name 2 425 426 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) { 427 if (no == 0) return(xmlStrdup(BAD_CAST "eaten")); 428 return(NULL); 429 } 430 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 431 } 432 433 #define gen_nb_fileoutput 6 434 435 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) { 436 if (no == 0) return("/missing.xml"); 437 if (no == 1) return("<foo/>"); 438 if (no == 2) return(REMOTE2GOOD); 439 if (no == 3) return(REMOTE1GOOD); 440 if (no == 4) return(REMOTE1BAD); 441 return(NULL); 442 } 443 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 444 } 445 446 #define gen_nb_xmlParserCtxtPtr 3 447 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { 448 if (no == 0) return(xmlNewParserCtxt()); 449 if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6)); 450 return(NULL); 451 } 452 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) { 453 if (val != NULL) 454 xmlFreeParserCtxt(val); 455 } 456 457 #define gen_nb_xmlSAXHandlerPtr 2 458 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) { 459 #ifdef LIBXML_SAX1_ENABLED 460 if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler); 461 #endif 462 return(NULL); 463 } 464 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 465 } 466 467 #define gen_nb_xmlValidCtxtPtr 2 468 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { 469 #ifdef LIBXML_VALID_ENABLED 470 if (no == 0) return(xmlNewValidCtxt()); 471 #endif 472 return(NULL); 473 } 474 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) { 475 #ifdef LIBXML_VALID_ENABLED 476 if (val != NULL) 477 xmlFreeValidCtxt(val); 478 #endif 479 } 480 481 #define gen_nb_xmlParserInputBufferPtr 8 482 483 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { 484 if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE)); 485 if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE)); 486 if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE)); 487 if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE)); 488 if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE)); 489 if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE)); 490 if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE)); 491 return(NULL); 492 } 493 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) { 494 xmlFreeParserInputBuffer(val); 495 } 496 497 #define gen_nb_xmlDocPtr 4 498 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) { 499 if (no == 0) return(xmlNewDoc(BAD_CAST "1.0")); 500 if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0)); 501 if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0)); 502 return(NULL); 503 } 504 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) { 505 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) 506 xmlFreeDoc(val); 507 } 508 509 #define gen_nb_xmlAttrPtr 2 510 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) { 511 if (no == 0) return(get_api_attr()); 512 return(NULL); 513 } 514 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 515 if (no == 0) free_api_doc(); 516 } 517 518 #define gen_nb_xmlDictPtr 2 519 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) { 520 if (no == 0) return(xmlDictCreate()); 521 return(NULL); 522 } 523 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) { 524 if (val != NULL) 525 xmlDictFree(val); 526 } 527 528 #define gen_nb_xmlNodePtr 3 529 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) { 530 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL)); 531 if (no == 1) return(get_api_root()); 532 return(NULL); 533 /* if (no == 2) return((xmlNodePtr) get_api_doc()); */ 534 } 535 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) { 536 if (no == 1) { 537 free_api_doc(); 538 } else if (val != NULL) { 539 xmlUnlinkNode(val); 540 xmlFreeNode(val); 541 } 542 } 543 544 #define gen_nb_xmlDtdPtr 3 545 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) { 546 if (no == 0) 547 return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar")); 548 if (no == 1) return(get_api_dtd()); 549 return(NULL); 550 } 551 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) { 552 if (no == 1) free_api_doc(); 553 else if (val != NULL) { 554 xmlUnlinkNode((xmlNodePtr) val); 555 xmlFreeNode((xmlNodePtr) val); 556 } 557 } 558 559 #define gen_nb_xmlNsPtr 2 560 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) { 561 if (no == 0) return(get_api_ns()); 562 return(NULL); 563 } 564 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 565 if (no == 0) free_api_doc(); 566 } 567 568 #define gen_nb_xmlNodePtr_in 3 569 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) { 570 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL)); 571 if (no == 0) return(xmlNewText(BAD_CAST "text")); 572 return(NULL); 573 } 574 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 575 } 576 577 #ifdef LIBXML_WRITER_ENABLED 578 #define gen_nb_xmlTextWriterPtr 2 579 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) { 580 if (no == 0) return(xmlNewTextWriterFilename("test.out", 0)); 581 return(NULL); 582 } 583 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) { 584 if (val != NULL) xmlFreeTextWriter(val); 585 } 586 #endif 587 588 #ifdef LIBXML_READER_ENABLED 589 #define gen_nb_xmlTextReaderPtr 4 590 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) { 591 if (no == 0) return(xmlNewTextReaderFilename("test/ent2")); 592 if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml")); 593 if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd")); 594 return(NULL); 595 } 596 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) { 597 if (val != NULL) xmlFreeTextReader(val); 598 } 599 #endif 600 601 #define gen_nb_xmlBufferPtr 3 602 static const char *static_buf_content = "a static buffer"; 603 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { 604 if (no == 0) return(xmlBufferCreate()); 605 if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13)); 606 return(NULL); 607 } 608 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) { 609 if (val != NULL) { 610 xmlBufferFree(val); 611 } 612 } 613 614 #define gen_nb_xmlListPtr 2 615 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) { 616 if (no == 0) return(xmlListCreate(NULL, NULL)); 617 return(NULL); 618 } 619 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) { 620 if (val != NULL) { 621 xmlListDelete(val); 622 } 623 } 624 625 #define gen_nb_xmlHashTablePtr 2 626 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) { 627 if (no == 0) return(xmlHashCreate(10)); 628 return(NULL); 629 } 630 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) { 631 if (val != NULL) { 632 xmlHashFree(val, NULL); 633 } 634 } 635 636 #include <libxml/xpathInternals.h> 637 638 #ifdef LIBXML_XPATH_ENABLED 639 #define gen_nb_xmlXPathObjectPtr 5 640 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) { 641 if (no == 0) return(xmlXPathNewString(BAD_CAST "string object")); 642 if (no == 1) return(xmlXPathNewFloat(1.1)); 643 if (no == 2) return(xmlXPathNewBoolean(1)); 644 if (no == 3) return(xmlXPathNewNodeSet(NULL)); 645 return(NULL); 646 } 647 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) { 648 if (val != NULL) { 649 xmlXPathFreeObject(val); 650 } 651 } 652 #endif 653 654 #ifdef LIBXML_OUTPUT_ENABLED 655 #define gen_nb_xmlOutputBufferPtr 2 656 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { 657 if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0)); 658 return(NULL); 659 } 660 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) { 661 if (val != NULL) { 662 xmlOutputBufferClose(val); 663 } 664 } 665 #endif 666 667 #ifdef LIBXML_FTP_ENABLED 668 #define gen_nb_xmlNanoFTPCtxtPtr 4 669 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { 670 if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD)); 671 if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD)); 672 if (no == 2) return(xmlNanoFTPNewCtxt("foo")); 673 return(NULL); 674 } 675 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) { 676 if (val != NULL) { 677 xmlNanoFTPFreeCtxt(val); 678 } 679 } 680 #endif 681 682 #ifdef LIBXML_HTTP_ENABLED 683 #define gen_nb_xmlNanoHTTPCtxtPtr 1 684 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { 685 if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL)); 686 if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL)); 687 if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL)); 688 return(NULL); 689 } 690 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) { 691 if (val != NULL) { 692 xmlNanoHTTPClose(val); 693 } 694 } 695 #endif 696 697 #define gen_nb_xmlCharEncoding 4 698 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) { 699 if (no == 0) return(XML_CHAR_ENCODING_UTF8); 700 if (no == 1) return(XML_CHAR_ENCODING_NONE); 701 if (no == 2) return(XML_CHAR_ENCODING_8859_1); 702 return(XML_CHAR_ENCODING_ERROR); 703 } 704 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 705 } 706 707 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) 708 709 #define gen_nb_xmlExpCtxtPtr 1 710 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 711 return(NULL); 712 } 713 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 714 } 715 716 #define gen_nb_xmlExpNodePtr 1 717 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 718 return(NULL); 719 } 720 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 721 } 722 723 #endif 724 725 #if defined(LIBXML_SCHEMAS_ENABLED) 726 #define gen_nb_xmlSchemaPtr 1 727 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 728 return(NULL); 729 } 730 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 731 } 732 733 #define gen_nb_xmlSchemaValidCtxtPtr 1 734 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 735 return(NULL); 736 } 737 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 738 } 739 740 #endif /* LIBXML_SCHEMAS_ENABLED */ 741 742 #define gen_nb_xmlHashDeallocator 2 743 static void 744 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) { 745 } 746 747 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) { 748 if (no == 0) return(test_xmlHashDeallocator); 749 return(NULL); 750 } 751 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 752 } 753 754 755 static void desret_int(int val ATTRIBUTE_UNUSED) { 756 } 757 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) { 758 } 759 static void desret_long(long val ATTRIBUTE_UNUSED) { 760 } 761 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) { 762 } 763 static void desret_double(double val ATTRIBUTE_UNUSED) { 764 } 765 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) { 766 } 767 #if 0 768 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) { 769 } 770 #endif 771 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) { 772 } 773 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) { 774 } 775 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) { 776 } 777 static void desret_xmlChar_ptr(xmlChar *val) { 778 if (val != NULL) 779 xmlFree(val); 780 } 781 static void desret_xmlDocPtr(xmlDocPtr val) { 782 if (val != api_doc) 783 xmlFreeDoc(val); 784 } 785 static void desret_xmlDictPtr(xmlDictPtr val) { 786 xmlDictFree(val); 787 } 788 #ifdef LIBXML_OUTPUT_ENABLED 789 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) { 790 xmlOutputBufferClose(val); 791 } 792 #endif 793 #ifdef LIBXML_READER_ENABLED 794 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) { 795 xmlFreeTextReader(val); 796 } 797 #endif 798 static void desret_xmlNodePtr(xmlNodePtr val) { 799 if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) { 800 xmlUnlinkNode(val); 801 xmlFreeNode(val); 802 } 803 } 804 static void desret_xmlAttrPtr(xmlAttrPtr val) { 805 if (val != NULL) { 806 xmlUnlinkNode((xmlNodePtr) val); 807 xmlFreeNode((xmlNodePtr) val); 808 } 809 } 810 static void desret_xmlEntityPtr(xmlEntityPtr val) { 811 if (val != NULL) { 812 xmlUnlinkNode((xmlNodePtr) val); 813 xmlFreeNode((xmlNodePtr) val); 814 } 815 } 816 static void desret_xmlElementPtr(xmlElementPtr val) { 817 if (val != NULL) { 818 xmlUnlinkNode((xmlNodePtr) val); 819 } 820 } 821 static void desret_xmlAttributePtr(xmlAttributePtr val) { 822 if (val != NULL) { 823 xmlUnlinkNode((xmlNodePtr) val); 824 } 825 } 826 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) { 827 } 828 static void desret_xmlDtdPtr(xmlDtdPtr val) { 829 desret_xmlNodePtr((xmlNodePtr)val); 830 } 831 #ifdef LIBXML_XPATH_ENABLED 832 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) { 833 xmlXPathFreeObject(val); 834 } 835 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) { 836 xmlXPathFreeNodeSet(val); 837 } 838 #endif 839 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) { 840 xmlFreeParserCtxt(val); 841 } 842 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) { 843 xmlFreeParserInputBuffer(val); 844 } 845 static void desret_xmlParserInputPtr(xmlParserInputPtr val) { 846 xmlFreeInputStream(val); 847 } 848 #ifdef LIBXML_WRITER_ENABLED 849 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) { 850 xmlFreeTextWriter(val); 851 } 852 #endif 853 static void desret_xmlBufferPtr(xmlBufferPtr val) { 854 xmlBufferFree(val); 855 } 856 #ifdef LIBXML_SCHEMAS_ENABLED 857 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) { 858 xmlSchemaFreeParserCtxt(val); 859 } 860 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) { 861 } 862 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) { 863 xmlRelaxNGFreeParserCtxt(val); 864 } 865 #endif 866 #ifdef LIBXML_HTML_ENABLED 867 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) { 868 } 869 #endif 870 #ifdef LIBXML_HTTP_ENABLED 871 static void desret_xmlNanoHTTPCtxtPtr(void *val) { 872 xmlNanoHTTPClose(val); 873 } 874 #endif 875 #ifdef LIBXML_FTP_ENABLED 876 static void desret_xmlNanoFTPCtxtPtr(void *val) { 877 xmlNanoFTPClose(val); 878 } 879 #endif 880 /* cut and pasted from autogenerated to avoid troubles */ 881 #define gen_nb_const_xmlChar_ptr_ptr 1 882 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 883 return(NULL); 884 } 885 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 886 } 887 888 #define gen_nb_unsigned_char_ptr 1 889 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 890 return(NULL); 891 } 892 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 893 } 894 895 #define gen_nb_const_unsigned_char_ptr 1 896 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 897 return(NULL); 898 } 899 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 900 } 901 902 #ifdef LIBXML_HTML_ENABLED 903 #define gen_nb_const_htmlNodePtr 1 904 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 905 return(NULL); 906 } 907 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 908 } 909 #endif 910 911 #ifdef LIBXML_HTML_ENABLED 912 #define gen_nb_htmlDocPtr 3 913 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 914 if (no == 0) return(htmlNewDoc(NULL, NULL)); 915 if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0)); 916 return(NULL); 917 } 918 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 919 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) 920 xmlFreeDoc(val); 921 } 922 static void desret_htmlDocPtr(htmlDocPtr val) { 923 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) 924 xmlFreeDoc(val); 925 } 926 #define gen_nb_htmlParserCtxtPtr 3 927 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 928 if (no == 0) return(xmlNewParserCtxt()); 929 if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7)); 930 return(NULL); 931 } 932 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 933 if (val != NULL) 934 htmlFreeParserCtxt(val); 935 } 936 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) { 937 if (val != NULL) 938 htmlFreeParserCtxt(val); 939 } 940 #endif 941 942 #ifdef LIBXML_XPATH_ENABLED 943 #define gen_nb_xmlNodeSetPtr 1 944 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 945 return(NULL); 946 } 947 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 948 } 949 #endif 950 951 #ifdef LIBXML_DEBUG_ENABLED 952 #ifdef LIBXML_XPATH_ENABLED 953 #define gen_nb_xmlShellCtxtPtr 1 954 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 955 return(NULL); 956 } 957 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 958 } 959 #endif 960 #endif 961 962 #ifdef LIBXML_PATTERN_ENABLED 963 #define gen_nb_xmlPatternPtr 1 964 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 965 return(NULL); 966 } 967 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 968 } 969 #endif 970 971 #define gen_nb_xmlElementContentPtr 1 972 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 973 return(NULL); 974 } 975 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) { 976 if (val != NULL) 977 xmlFreeElementContent(val); 978 } 979 static void desret_xmlElementContentPtr(xmlElementContentPtr val) { 980 if (val != NULL) 981 xmlFreeElementContent(val); 982 } 983 984 #define gen_nb_xmlParserNodeInfoSeqPtr 1 985 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 986 return(NULL); 987 } 988 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 989 } 990 991 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) { 992 } 993 994 #define gen_nb_void_ptr_ptr 1 995 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 996 return(NULL); 997 } 998 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 999 } 1000 1001 /************************************************************************ 1002 * * 1003 * WARNING: end of the manually maintained part of the test code * 1004 * do not remove or alter the CUT HERE line * 1005 * * 1006 ************************************************************************/ 1007 1008 /* CUT HERE: everything below that line is generated */ 1009 #ifdef LIBXML_HTML_ENABLED 1010 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) { 1011 } 1012 1013 #endif 1014 1015 #define gen_nb_xmlAttributeDefault 4 1016 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) { 1017 if (no == 1) return(XML_ATTRIBUTE_FIXED); 1018 if (no == 2) return(XML_ATTRIBUTE_IMPLIED); 1019 if (no == 3) return(XML_ATTRIBUTE_NONE); 1020 if (no == 4) return(XML_ATTRIBUTE_REQUIRED); 1021 return(0); 1022 } 1023 1024 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1025 } 1026 1027 #define gen_nb_xmlAttributeType 4 1028 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) { 1029 if (no == 1) return(XML_ATTRIBUTE_CDATA); 1030 if (no == 2) return(XML_ATTRIBUTE_ENTITIES); 1031 if (no == 3) return(XML_ATTRIBUTE_ENTITY); 1032 if (no == 4) return(XML_ATTRIBUTE_ENUMERATION); 1033 return(0); 1034 } 1035 1036 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1037 } 1038 1039 #define gen_nb_xmlBufferAllocationScheme 4 1040 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) { 1041 if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT); 1042 if (no == 2) return(XML_BUFFER_ALLOC_EXACT); 1043 if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE); 1044 if (no == 4) return(XML_BUFFER_ALLOC_IO); 1045 return(0); 1046 } 1047 1048 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1049 } 1050 1051 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) { 1052 } 1053 1054 #ifdef LIBXML_CATALOG_ENABLED 1055 #define gen_nb_xmlCatalogAllow 4 1056 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) { 1057 if (no == 1) return(XML_CATA_ALLOW_ALL); 1058 if (no == 2) return(XML_CATA_ALLOW_DOCUMENT); 1059 if (no == 3) return(XML_CATA_ALLOW_GLOBAL); 1060 if (no == 4) return(XML_CATA_ALLOW_NONE); 1061 return(0); 1062 } 1063 1064 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1065 } 1066 1067 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) { 1068 } 1069 1070 #endif 1071 1072 #ifdef LIBXML_CATALOG_ENABLED 1073 #define gen_nb_xmlCatalogPrefer 3 1074 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) { 1075 if (no == 1) return(XML_CATA_PREFER_NONE); 1076 if (no == 2) return(XML_CATA_PREFER_PUBLIC); 1077 if (no == 3) return(XML_CATA_PREFER_SYSTEM); 1078 return(0); 1079 } 1080 1081 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1082 } 1083 1084 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) { 1085 } 1086 1087 #endif 1088 1089 #define gen_nb_xmlElementContentType 4 1090 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) { 1091 if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT); 1092 if (no == 2) return(XML_ELEMENT_CONTENT_OR); 1093 if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA); 1094 if (no == 4) return(XML_ELEMENT_CONTENT_SEQ); 1095 return(0); 1096 } 1097 1098 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1099 } 1100 1101 #define gen_nb_xmlElementTypeVal 4 1102 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) { 1103 if (no == 1) return(XML_ELEMENT_TYPE_ANY); 1104 if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT); 1105 if (no == 3) return(XML_ELEMENT_TYPE_EMPTY); 1106 if (no == 4) return(XML_ELEMENT_TYPE_MIXED); 1107 return(0); 1108 } 1109 1110 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1111 } 1112 1113 #define gen_nb_xmlFeature 4 1114 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) { 1115 if (no == 1) return(XML_WITH_AUTOMATA); 1116 if (no == 2) return(XML_WITH_C14N); 1117 if (no == 3) return(XML_WITH_CATALOG); 1118 if (no == 4) return(XML_WITH_DEBUG); 1119 return(0); 1120 } 1121 1122 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1123 } 1124 1125 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { 1126 } 1127 1128 #ifdef LIBXML_SCHEMAS_ENABLED 1129 #define gen_nb_xmlSchemaValType 4 1130 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) { 1131 if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE); 1132 if (no == 2) return(XML_SCHEMAS_ANYTYPE); 1133 if (no == 3) return(XML_SCHEMAS_ANYURI); 1134 if (no == 4) return(XML_SCHEMAS_BASE64BINARY); 1135 return(0); 1136 } 1137 1138 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1139 } 1140 1141 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) { 1142 } 1143 1144 #endif 1145 1146 #ifdef LIBXML_SCHEMAS_ENABLED 1147 #define gen_nb_xmlSchemaWhitespaceValueType 4 1148 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) { 1149 if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE); 1150 if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE); 1151 if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE); 1152 if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN); 1153 return(0); 1154 } 1155 1156 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1157 } 1158 1159 #endif 1160 1161 #include <libxml/HTMLparser.h> 1162 #include <libxml/HTMLtree.h> 1163 #include <libxml/SAX2.h> 1164 #include <libxml/c14n.h> 1165 #include <libxml/catalog.h> 1166 #include <libxml/chvalid.h> 1167 #include <libxml/debugXML.h> 1168 #include <libxml/dict.h> 1169 #include <libxml/encoding.h> 1170 #include <libxml/entities.h> 1171 #include <libxml/hash.h> 1172 #include <libxml/list.h> 1173 #include <libxml/nanoftp.h> 1174 #include <libxml/nanohttp.h> 1175 #include <libxml/parser.h> 1176 #include <libxml/parserInternals.h> 1177 #include <libxml/pattern.h> 1178 #include <libxml/relaxng.h> 1179 #include <libxml/schemasInternals.h> 1180 #include <libxml/schematron.h> 1181 #include <libxml/tree.h> 1182 #include <libxml/uri.h> 1183 #include <libxml/valid.h> 1184 #include <libxml/xinclude.h> 1185 #include <libxml/xmlIO.h> 1186 #include <libxml/xmlautomata.h> 1187 #include <libxml/xmlerror.h> 1188 #include <libxml/xmlmodule.h> 1189 #include <libxml/xmlreader.h> 1190 #include <libxml/xmlregexp.h> 1191 #include <libxml/xmlsave.h> 1192 #include <libxml/xmlschemas.h> 1193 #include <libxml/xmlschemastypes.h> 1194 #include <libxml/xmlstring.h> 1195 #include <libxml/xmlunicode.h> 1196 #include <libxml/xmlwriter.h> 1197 #include <libxml/xpath.h> 1198 #include <libxml/xpathInternals.h> 1199 #include <libxml/xpointer.h> 1200 static int test_HTMLparser(void); 1201 static int test_HTMLtree(void); 1202 static int test_SAX2(void); 1203 static int test_c14n(void); 1204 static int test_catalog(void); 1205 static int test_chvalid(void); 1206 static int test_debugXML(void); 1207 static int test_dict(void); 1208 static int test_encoding(void); 1209 static int test_entities(void); 1210 static int test_hash(void); 1211 static int test_list(void); 1212 static int test_nanoftp(void); 1213 static int test_nanohttp(void); 1214 static int test_parser(void); 1215 static int test_parserInternals(void); 1216 static int test_pattern(void); 1217 static int test_relaxng(void); 1218 static int test_schemasInternals(void); 1219 static int test_schematron(void); 1220 static int test_tree(void); 1221 static int test_uri(void); 1222 static int test_valid(void); 1223 static int test_xinclude(void); 1224 static int test_xmlIO(void); 1225 static int test_xmlautomata(void); 1226 static int test_xmlerror(void); 1227 static int test_xmlmodule(void); 1228 static int test_xmlreader(void); 1229 static int test_xmlregexp(void); 1230 static int test_xmlsave(void); 1231 static int test_xmlschemas(void); 1232 static int test_xmlschemastypes(void); 1233 static int test_xmlstring(void); 1234 static int test_xmlunicode(void); 1235 static int test_xmlwriter(void); 1236 static int test_xpath(void); 1237 static int test_xpathInternals(void); 1238 static int test_xpointer(void); 1239 1240 /** 1241 * testlibxml2: 1242 * 1243 * Main entry point of the tester for the full libxml2 module, 1244 * it calls all the tester entry point for each module. 1245 * 1246 * Returns the number of error found 1247 */ 1248 static int 1249 testlibxml2(void) 1250 { 1251 int test_ret = 0; 1252 1253 test_ret += test_HTMLparser(); 1254 test_ret += test_HTMLtree(); 1255 test_ret += test_SAX2(); 1256 test_ret += test_c14n(); 1257 test_ret += test_catalog(); 1258 test_ret += test_chvalid(); 1259 test_ret += test_debugXML(); 1260 test_ret += test_dict(); 1261 test_ret += test_encoding(); 1262 test_ret += test_entities(); 1263 test_ret += test_hash(); 1264 test_ret += test_list(); 1265 test_ret += test_nanoftp(); 1266 test_ret += test_nanohttp(); 1267 test_ret += test_parser(); 1268 test_ret += test_parserInternals(); 1269 test_ret += test_pattern(); 1270 test_ret += test_relaxng(); 1271 test_ret += test_schemasInternals(); 1272 test_ret += test_schematron(); 1273 test_ret += test_tree(); 1274 test_ret += test_uri(); 1275 test_ret += test_valid(); 1276 test_ret += test_xinclude(); 1277 test_ret += test_xmlIO(); 1278 test_ret += test_xmlautomata(); 1279 test_ret += test_xmlerror(); 1280 test_ret += test_xmlmodule(); 1281 test_ret += test_xmlreader(); 1282 test_ret += test_xmlregexp(); 1283 test_ret += test_xmlsave(); 1284 test_ret += test_xmlschemas(); 1285 test_ret += test_xmlschemastypes(); 1286 test_ret += test_xmlstring(); 1287 test_ret += test_xmlunicode(); 1288 test_ret += test_xmlwriter(); 1289 test_ret += test_xpath(); 1290 test_ret += test_xpathInternals(); 1291 test_ret += test_xpointer(); 1292 1293 printf("Total: %d functions, %d tests, %d errors\n", 1294 function_tests, call_tests, test_ret); 1295 return(test_ret); 1296 } 1297 1298 1299 static int 1300 test_UTF8ToHtml(void) { 1301 int test_ret = 0; 1302 1303 #if defined(LIBXML_HTML_ENABLED) 1304 int mem_base; 1305 int ret_val; 1306 unsigned char * out; /* a pointer to an array of bytes to store the result */ 1307 int n_out; 1308 int * outlen; /* the length of @out */ 1309 int n_outlen; 1310 unsigned char * in; /* a pointer to an array of UTF-8 chars */ 1311 int n_in; 1312 int * inlen; /* the length of @in */ 1313 int n_inlen; 1314 1315 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 1316 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 1317 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 1318 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 1319 mem_base = xmlMemBlocks(); 1320 out = gen_unsigned_char_ptr(n_out, 0); 1321 outlen = gen_int_ptr(n_outlen, 1); 1322 in = gen_const_unsigned_char_ptr(n_in, 2); 1323 inlen = gen_int_ptr(n_inlen, 3); 1324 1325 ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen); 1326 desret_int(ret_val); 1327 call_tests++; 1328 des_unsigned_char_ptr(n_out, out, 0); 1329 des_int_ptr(n_outlen, outlen, 1); 1330 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 1331 des_int_ptr(n_inlen, inlen, 3); 1332 xmlResetLastError(); 1333 if (mem_base != xmlMemBlocks()) { 1334 printf("Leak of %d blocks found in UTF8ToHtml", 1335 xmlMemBlocks() - mem_base); 1336 test_ret++; 1337 printf(" %d", n_out); 1338 printf(" %d", n_outlen); 1339 printf(" %d", n_in); 1340 printf(" %d", n_inlen); 1341 printf("\n"); 1342 } 1343 } 1344 } 1345 } 1346 } 1347 function_tests++; 1348 #endif 1349 1350 return(test_ret); 1351 } 1352 1353 #ifdef LIBXML_HTML_ENABLED 1354 1355 #define gen_nb_const_htmlElemDesc_ptr 1 1356 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1357 return(NULL); 1358 } 1359 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1360 } 1361 #endif 1362 1363 1364 static int 1365 test_htmlAttrAllowed(void) { 1366 int test_ret = 0; 1367 1368 #if defined(LIBXML_HTML_ENABLED) 1369 int mem_base; 1370 htmlStatus ret_val; 1371 htmlElemDesc * elt; /* HTML element */ 1372 int n_elt; 1373 xmlChar * attr; /* HTML attribute */ 1374 int n_attr; 1375 int legacy; /* whether to allow deprecated attributes */ 1376 int n_legacy; 1377 1378 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) { 1379 for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) { 1380 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) { 1381 mem_base = xmlMemBlocks(); 1382 elt = gen_const_htmlElemDesc_ptr(n_elt, 0); 1383 attr = gen_const_xmlChar_ptr(n_attr, 1); 1384 legacy = gen_int(n_legacy, 2); 1385 1386 ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy); 1387 desret_htmlStatus(ret_val); 1388 call_tests++; 1389 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0); 1390 des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1); 1391 des_int(n_legacy, legacy, 2); 1392 xmlResetLastError(); 1393 if (mem_base != xmlMemBlocks()) { 1394 printf("Leak of %d blocks found in htmlAttrAllowed", 1395 xmlMemBlocks() - mem_base); 1396 test_ret++; 1397 printf(" %d", n_elt); 1398 printf(" %d", n_attr); 1399 printf(" %d", n_legacy); 1400 printf("\n"); 1401 } 1402 } 1403 } 1404 } 1405 function_tests++; 1406 #endif 1407 1408 return(test_ret); 1409 } 1410 1411 #ifdef LIBXML_HTML_ENABLED 1412 1413 #define gen_nb_htmlNodePtr 1 1414 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1415 return(NULL); 1416 } 1417 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1418 } 1419 #endif 1420 1421 1422 static int 1423 test_htmlAutoCloseTag(void) { 1424 int test_ret = 0; 1425 1426 #if defined(LIBXML_HTML_ENABLED) 1427 int mem_base; 1428 int ret_val; 1429 htmlDocPtr doc; /* the HTML document */ 1430 int n_doc; 1431 xmlChar * name; /* The tag name */ 1432 int n_name; 1433 htmlNodePtr elem; /* the HTML element */ 1434 int n_elem; 1435 1436 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 1437 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 1438 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) { 1439 mem_base = xmlMemBlocks(); 1440 doc = gen_htmlDocPtr(n_doc, 0); 1441 name = gen_const_xmlChar_ptr(n_name, 1); 1442 elem = gen_htmlNodePtr(n_elem, 2); 1443 1444 ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem); 1445 desret_int(ret_val); 1446 call_tests++; 1447 des_htmlDocPtr(n_doc, doc, 0); 1448 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 1449 des_htmlNodePtr(n_elem, elem, 2); 1450 xmlResetLastError(); 1451 if (mem_base != xmlMemBlocks()) { 1452 printf("Leak of %d blocks found in htmlAutoCloseTag", 1453 xmlMemBlocks() - mem_base); 1454 test_ret++; 1455 printf(" %d", n_doc); 1456 printf(" %d", n_name); 1457 printf(" %d", n_elem); 1458 printf("\n"); 1459 } 1460 } 1461 } 1462 } 1463 function_tests++; 1464 #endif 1465 1466 return(test_ret); 1467 } 1468 1469 1470 static int 1471 test_htmlCreateMemoryParserCtxt(void) { 1472 int test_ret = 0; 1473 1474 #if defined(LIBXML_HTML_ENABLED) 1475 int mem_base; 1476 htmlParserCtxtPtr ret_val; 1477 char * buffer; /* a pointer to a char array */ 1478 int n_buffer; 1479 int size; /* the size of the array */ 1480 int n_size; 1481 1482 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 1483 for (n_size = 0;n_size < gen_nb_int;n_size++) { 1484 mem_base = xmlMemBlocks(); 1485 buffer = gen_const_char_ptr(n_buffer, 0); 1486 size = gen_int(n_size, 1); 1487 1488 ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size); 1489 desret_htmlParserCtxtPtr(ret_val); 1490 call_tests++; 1491 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 1492 des_int(n_size, size, 1); 1493 xmlResetLastError(); 1494 if (mem_base != xmlMemBlocks()) { 1495 printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt", 1496 xmlMemBlocks() - mem_base); 1497 test_ret++; 1498 printf(" %d", n_buffer); 1499 printf(" %d", n_size); 1500 printf("\n"); 1501 } 1502 } 1503 } 1504 function_tests++; 1505 #endif 1506 1507 return(test_ret); 1508 } 1509 1510 #ifdef LIBXML_HTML_ENABLED 1511 1512 #define gen_nb_htmlSAXHandlerPtr 1 1513 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1514 return(NULL); 1515 } 1516 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 1517 } 1518 #endif 1519 1520 1521 static int 1522 test_htmlCreatePushParserCtxt(void) { 1523 int test_ret = 0; 1524 1525 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) 1526 int mem_base; 1527 htmlParserCtxtPtr ret_val; 1528 htmlSAXHandlerPtr sax; /* a SAX handler */ 1529 int n_sax; 1530 void * user_data; /* The user data returned on SAX callbacks */ 1531 int n_user_data; 1532 char * chunk; /* a pointer to an array of chars */ 1533 int n_chunk; 1534 int size; /* number of chars in the array */ 1535 int n_size; 1536 const char * filename; /* an optional file name or URI */ 1537 int n_filename; 1538 xmlCharEncoding enc; /* an optional encoding */ 1539 int n_enc; 1540 1541 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { 1542 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 1543 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 1544 for (n_size = 0;n_size < gen_nb_int;n_size++) { 1545 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 1546 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 1547 mem_base = xmlMemBlocks(); 1548 sax = gen_htmlSAXHandlerPtr(n_sax, 0); 1549 user_data = gen_userdata(n_user_data, 1); 1550 chunk = gen_const_char_ptr(n_chunk, 2); 1551 size = gen_int(n_size, 3); 1552 filename = gen_fileoutput(n_filename, 4); 1553 enc = gen_xmlCharEncoding(n_enc, 5); 1554 1555 ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc); 1556 desret_htmlParserCtxtPtr(ret_val); 1557 call_tests++; 1558 des_htmlSAXHandlerPtr(n_sax, sax, 0); 1559 des_userdata(n_user_data, user_data, 1); 1560 des_const_char_ptr(n_chunk, (const char *)chunk, 2); 1561 des_int(n_size, size, 3); 1562 des_fileoutput(n_filename, filename, 4); 1563 des_xmlCharEncoding(n_enc, enc, 5); 1564 xmlResetLastError(); 1565 if (mem_base != xmlMemBlocks()) { 1566 printf("Leak of %d blocks found in htmlCreatePushParserCtxt", 1567 xmlMemBlocks() - mem_base); 1568 test_ret++; 1569 printf(" %d", n_sax); 1570 printf(" %d", n_user_data); 1571 printf(" %d", n_chunk); 1572 printf(" %d", n_size); 1573 printf(" %d", n_filename); 1574 printf(" %d", n_enc); 1575 printf("\n"); 1576 } 1577 } 1578 } 1579 } 1580 } 1581 } 1582 } 1583 function_tests++; 1584 #endif 1585 1586 return(test_ret); 1587 } 1588 1589 1590 static int 1591 test_htmlCtxtReadDoc(void) { 1592 int test_ret = 0; 1593 1594 #if defined(LIBXML_HTML_ENABLED) 1595 int mem_base; 1596 htmlDocPtr ret_val; 1597 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1598 int n_ctxt; 1599 xmlChar * cur; /* a pointer to a zero terminated string */ 1600 int n_cur; 1601 const char * URL; /* the base URL to use for the document */ 1602 int n_URL; 1603 char * encoding; /* the document encoding, or NULL */ 1604 int n_encoding; 1605 int options; /* a combination of htmlParserOption(s) */ 1606 int n_options; 1607 1608 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1609 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 1610 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 1611 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 1612 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1613 mem_base = xmlMemBlocks(); 1614 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1615 cur = gen_const_xmlChar_ptr(n_cur, 1); 1616 URL = gen_filepath(n_URL, 2); 1617 encoding = gen_const_char_ptr(n_encoding, 3); 1618 options = gen_int(n_options, 4); 1619 1620 ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options); 1621 desret_htmlDocPtr(ret_val); 1622 call_tests++; 1623 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1624 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 1625 des_filepath(n_URL, URL, 2); 1626 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 1627 des_int(n_options, options, 4); 1628 xmlResetLastError(); 1629 if (mem_base != xmlMemBlocks()) { 1630 printf("Leak of %d blocks found in htmlCtxtReadDoc", 1631 xmlMemBlocks() - mem_base); 1632 test_ret++; 1633 printf(" %d", n_ctxt); 1634 printf(" %d", n_cur); 1635 printf(" %d", n_URL); 1636 printf(" %d", n_encoding); 1637 printf(" %d", n_options); 1638 printf("\n"); 1639 } 1640 } 1641 } 1642 } 1643 } 1644 } 1645 function_tests++; 1646 #endif 1647 1648 return(test_ret); 1649 } 1650 1651 1652 static int 1653 test_htmlCtxtReadFile(void) { 1654 int test_ret = 0; 1655 1656 #if defined(LIBXML_HTML_ENABLED) 1657 htmlDocPtr ret_val; 1658 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1659 int n_ctxt; 1660 const char * filename; /* a file or URL */ 1661 int n_filename; 1662 char * encoding; /* the document encoding, or NULL */ 1663 int n_encoding; 1664 int options; /* a combination of htmlParserOption(s) */ 1665 int n_options; 1666 1667 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1668 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 1669 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 1670 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1671 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1672 filename = gen_filepath(n_filename, 1); 1673 encoding = gen_const_char_ptr(n_encoding, 2); 1674 options = gen_int(n_options, 3); 1675 1676 ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options); 1677 desret_htmlDocPtr(ret_val); 1678 call_tests++; 1679 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1680 des_filepath(n_filename, filename, 1); 1681 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 1682 des_int(n_options, options, 3); 1683 xmlResetLastError(); 1684 } 1685 } 1686 } 1687 } 1688 function_tests++; 1689 #endif 1690 1691 return(test_ret); 1692 } 1693 1694 1695 static int 1696 test_htmlCtxtReadMemory(void) { 1697 int test_ret = 0; 1698 1699 #if defined(LIBXML_HTML_ENABLED) 1700 int mem_base; 1701 htmlDocPtr ret_val; 1702 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1703 int n_ctxt; 1704 char * buffer; /* a pointer to a char array */ 1705 int n_buffer; 1706 int size; /* the size of the array */ 1707 int n_size; 1708 const char * URL; /* the base URL to use for the document */ 1709 int n_URL; 1710 char * encoding; /* the document encoding, or NULL */ 1711 int n_encoding; 1712 int options; /* a combination of htmlParserOption(s) */ 1713 int n_options; 1714 1715 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1716 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 1717 for (n_size = 0;n_size < gen_nb_int;n_size++) { 1718 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 1719 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 1720 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1721 mem_base = xmlMemBlocks(); 1722 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1723 buffer = gen_const_char_ptr(n_buffer, 1); 1724 size = gen_int(n_size, 2); 1725 URL = gen_filepath(n_URL, 3); 1726 encoding = gen_const_char_ptr(n_encoding, 4); 1727 options = gen_int(n_options, 5); 1728 1729 ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options); 1730 desret_htmlDocPtr(ret_val); 1731 call_tests++; 1732 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1733 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 1734 des_int(n_size, size, 2); 1735 des_filepath(n_URL, URL, 3); 1736 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 1737 des_int(n_options, options, 5); 1738 xmlResetLastError(); 1739 if (mem_base != xmlMemBlocks()) { 1740 printf("Leak of %d blocks found in htmlCtxtReadMemory", 1741 xmlMemBlocks() - mem_base); 1742 test_ret++; 1743 printf(" %d", n_ctxt); 1744 printf(" %d", n_buffer); 1745 printf(" %d", n_size); 1746 printf(" %d", n_URL); 1747 printf(" %d", n_encoding); 1748 printf(" %d", n_options); 1749 printf("\n"); 1750 } 1751 } 1752 } 1753 } 1754 } 1755 } 1756 } 1757 function_tests++; 1758 #endif 1759 1760 return(test_ret); 1761 } 1762 1763 1764 static int 1765 test_htmlCtxtReset(void) { 1766 int test_ret = 0; 1767 1768 #if defined(LIBXML_HTML_ENABLED) 1769 int mem_base; 1770 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1771 int n_ctxt; 1772 1773 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1774 mem_base = xmlMemBlocks(); 1775 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1776 1777 htmlCtxtReset(ctxt); 1778 call_tests++; 1779 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1780 xmlResetLastError(); 1781 if (mem_base != xmlMemBlocks()) { 1782 printf("Leak of %d blocks found in htmlCtxtReset", 1783 xmlMemBlocks() - mem_base); 1784 test_ret++; 1785 printf(" %d", n_ctxt); 1786 printf("\n"); 1787 } 1788 } 1789 function_tests++; 1790 #endif 1791 1792 return(test_ret); 1793 } 1794 1795 1796 static int 1797 test_htmlCtxtUseOptions(void) { 1798 int test_ret = 0; 1799 1800 #if defined(LIBXML_HTML_ENABLED) 1801 int mem_base; 1802 int ret_val; 1803 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 1804 int n_ctxt; 1805 int options; /* a combination of htmlParserOption(s) */ 1806 int n_options; 1807 1808 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 1809 for (n_options = 0;n_options < gen_nb_int;n_options++) { 1810 mem_base = xmlMemBlocks(); 1811 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 1812 options = gen_int(n_options, 1); 1813 1814 ret_val = htmlCtxtUseOptions(ctxt, options); 1815 desret_int(ret_val); 1816 call_tests++; 1817 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 1818 des_int(n_options, options, 1); 1819 xmlResetLastError(); 1820 if (mem_base != xmlMemBlocks()) { 1821 printf("Leak of %d blocks found in htmlCtxtUseOptions", 1822 xmlMemBlocks() - mem_base); 1823 test_ret++; 1824 printf(" %d", n_ctxt); 1825 printf(" %d", n_options); 1826 printf("\n"); 1827 } 1828 } 1829 } 1830 function_tests++; 1831 #endif 1832 1833 return(test_ret); 1834 } 1835 1836 1837 static int 1838 test_htmlElementAllowedHere(void) { 1839 int test_ret = 0; 1840 1841 #if defined(LIBXML_HTML_ENABLED) 1842 int mem_base; 1843 int ret_val; 1844 htmlElemDesc * parent; /* HTML parent element */ 1845 int n_parent; 1846 xmlChar * elt; /* HTML element */ 1847 int n_elt; 1848 1849 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) { 1850 for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) { 1851 mem_base = xmlMemBlocks(); 1852 parent = gen_const_htmlElemDesc_ptr(n_parent, 0); 1853 elt = gen_const_xmlChar_ptr(n_elt, 1); 1854 1855 ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt); 1856 desret_int(ret_val); 1857 call_tests++; 1858 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0); 1859 des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1); 1860 xmlResetLastError(); 1861 if (mem_base != xmlMemBlocks()) { 1862 printf("Leak of %d blocks found in htmlElementAllowedHere", 1863 xmlMemBlocks() - mem_base); 1864 test_ret++; 1865 printf(" %d", n_parent); 1866 printf(" %d", n_elt); 1867 printf("\n"); 1868 } 1869 } 1870 } 1871 function_tests++; 1872 #endif 1873 1874 return(test_ret); 1875 } 1876 1877 1878 static int 1879 test_htmlElementStatusHere(void) { 1880 int test_ret = 0; 1881 1882 #if defined(LIBXML_HTML_ENABLED) 1883 int mem_base; 1884 htmlStatus ret_val; 1885 htmlElemDesc * parent; /* HTML parent element */ 1886 int n_parent; 1887 htmlElemDesc * elt; /* HTML element */ 1888 int n_elt; 1889 1890 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) { 1891 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) { 1892 mem_base = xmlMemBlocks(); 1893 parent = gen_const_htmlElemDesc_ptr(n_parent, 0); 1894 elt = gen_const_htmlElemDesc_ptr(n_elt, 1); 1895 1896 ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt); 1897 desret_htmlStatus(ret_val); 1898 call_tests++; 1899 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0); 1900 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1); 1901 xmlResetLastError(); 1902 if (mem_base != xmlMemBlocks()) { 1903 printf("Leak of %d blocks found in htmlElementStatusHere", 1904 xmlMemBlocks() - mem_base); 1905 test_ret++; 1906 printf(" %d", n_parent); 1907 printf(" %d", n_elt); 1908 printf("\n"); 1909 } 1910 } 1911 } 1912 function_tests++; 1913 #endif 1914 1915 return(test_ret); 1916 } 1917 1918 1919 static int 1920 test_htmlEncodeEntities(void) { 1921 int test_ret = 0; 1922 1923 #if defined(LIBXML_HTML_ENABLED) 1924 int mem_base; 1925 int ret_val; 1926 unsigned char * out; /* a pointer to an array of bytes to store the result */ 1927 int n_out; 1928 int * outlen; /* the length of @out */ 1929 int n_outlen; 1930 unsigned char * in; /* a pointer to an array of UTF-8 chars */ 1931 int n_in; 1932 int * inlen; /* the length of @in */ 1933 int n_inlen; 1934 int quoteChar; /* the quote character to escape (' or ") or zero. */ 1935 int n_quoteChar; 1936 1937 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 1938 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 1939 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 1940 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 1941 for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) { 1942 mem_base = xmlMemBlocks(); 1943 out = gen_unsigned_char_ptr(n_out, 0); 1944 outlen = gen_int_ptr(n_outlen, 1); 1945 in = gen_const_unsigned_char_ptr(n_in, 2); 1946 inlen = gen_int_ptr(n_inlen, 3); 1947 quoteChar = gen_int(n_quoteChar, 4); 1948 1949 ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar); 1950 desret_int(ret_val); 1951 call_tests++; 1952 des_unsigned_char_ptr(n_out, out, 0); 1953 des_int_ptr(n_outlen, outlen, 1); 1954 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 1955 des_int_ptr(n_inlen, inlen, 3); 1956 des_int(n_quoteChar, quoteChar, 4); 1957 xmlResetLastError(); 1958 if (mem_base != xmlMemBlocks()) { 1959 printf("Leak of %d blocks found in htmlEncodeEntities", 1960 xmlMemBlocks() - mem_base); 1961 test_ret++; 1962 printf(" %d", n_out); 1963 printf(" %d", n_outlen); 1964 printf(" %d", n_in); 1965 printf(" %d", n_inlen); 1966 printf(" %d", n_quoteChar); 1967 printf("\n"); 1968 } 1969 } 1970 } 1971 } 1972 } 1973 } 1974 function_tests++; 1975 #endif 1976 1977 return(test_ret); 1978 } 1979 1980 1981 static int 1982 test_htmlEntityLookup(void) { 1983 int test_ret = 0; 1984 1985 #if defined(LIBXML_HTML_ENABLED) 1986 int mem_base; 1987 const htmlEntityDesc * ret_val; 1988 xmlChar * name; /* the entity name */ 1989 int n_name; 1990 1991 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 1992 mem_base = xmlMemBlocks(); 1993 name = gen_const_xmlChar_ptr(n_name, 0); 1994 1995 ret_val = htmlEntityLookup((const xmlChar *)name); 1996 desret_const_htmlEntityDesc_ptr(ret_val); 1997 call_tests++; 1998 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 1999 xmlResetLastError(); 2000 if (mem_base != xmlMemBlocks()) { 2001 printf("Leak of %d blocks found in htmlEntityLookup", 2002 xmlMemBlocks() - mem_base); 2003 test_ret++; 2004 printf(" %d", n_name); 2005 printf("\n"); 2006 } 2007 } 2008 function_tests++; 2009 #endif 2010 2011 return(test_ret); 2012 } 2013 2014 2015 static int 2016 test_htmlEntityValueLookup(void) { 2017 int test_ret = 0; 2018 2019 #if defined(LIBXML_HTML_ENABLED) 2020 int mem_base; 2021 const htmlEntityDesc * ret_val; 2022 unsigned int value; /* the entity's unicode value */ 2023 int n_value; 2024 2025 for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) { 2026 mem_base = xmlMemBlocks(); 2027 value = gen_unsigned_int(n_value, 0); 2028 2029 ret_val = htmlEntityValueLookup(value); 2030 desret_const_htmlEntityDesc_ptr(ret_val); 2031 call_tests++; 2032 des_unsigned_int(n_value, value, 0); 2033 xmlResetLastError(); 2034 if (mem_base != xmlMemBlocks()) { 2035 printf("Leak of %d blocks found in htmlEntityValueLookup", 2036 xmlMemBlocks() - mem_base); 2037 test_ret++; 2038 printf(" %d", n_value); 2039 printf("\n"); 2040 } 2041 } 2042 function_tests++; 2043 #endif 2044 2045 return(test_ret); 2046 } 2047 2048 2049 static int 2050 test_htmlHandleOmittedElem(void) { 2051 int test_ret = 0; 2052 2053 #if defined(LIBXML_HTML_ENABLED) 2054 int mem_base; 2055 int ret_val; 2056 int val; /* int 0 or 1 */ 2057 int n_val; 2058 2059 for (n_val = 0;n_val < gen_nb_int;n_val++) { 2060 mem_base = xmlMemBlocks(); 2061 val = gen_int(n_val, 0); 2062 2063 ret_val = htmlHandleOmittedElem(val); 2064 desret_int(ret_val); 2065 call_tests++; 2066 des_int(n_val, val, 0); 2067 xmlResetLastError(); 2068 if (mem_base != xmlMemBlocks()) { 2069 printf("Leak of %d blocks found in htmlHandleOmittedElem", 2070 xmlMemBlocks() - mem_base); 2071 test_ret++; 2072 printf(" %d", n_val); 2073 printf("\n"); 2074 } 2075 } 2076 function_tests++; 2077 #endif 2078 2079 return(test_ret); 2080 } 2081 2082 2083 static int 2084 test_htmlIsAutoClosed(void) { 2085 int test_ret = 0; 2086 2087 #if defined(LIBXML_HTML_ENABLED) 2088 int mem_base; 2089 int ret_val; 2090 htmlDocPtr doc; /* the HTML document */ 2091 int n_doc; 2092 htmlNodePtr elem; /* the HTML element */ 2093 int n_elem; 2094 2095 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 2096 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) { 2097 mem_base = xmlMemBlocks(); 2098 doc = gen_htmlDocPtr(n_doc, 0); 2099 elem = gen_htmlNodePtr(n_elem, 1); 2100 2101 ret_val = htmlIsAutoClosed(doc, elem); 2102 desret_int(ret_val); 2103 call_tests++; 2104 des_htmlDocPtr(n_doc, doc, 0); 2105 des_htmlNodePtr(n_elem, elem, 1); 2106 xmlResetLastError(); 2107 if (mem_base != xmlMemBlocks()) { 2108 printf("Leak of %d blocks found in htmlIsAutoClosed", 2109 xmlMemBlocks() - mem_base); 2110 test_ret++; 2111 printf(" %d", n_doc); 2112 printf(" %d", n_elem); 2113 printf("\n"); 2114 } 2115 } 2116 } 2117 function_tests++; 2118 #endif 2119 2120 return(test_ret); 2121 } 2122 2123 2124 static int 2125 test_htmlIsScriptAttribute(void) { 2126 int test_ret = 0; 2127 2128 #if defined(LIBXML_HTML_ENABLED) 2129 int mem_base; 2130 int ret_val; 2131 xmlChar * name; /* an attribute name */ 2132 int n_name; 2133 2134 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 2135 mem_base = xmlMemBlocks(); 2136 name = gen_const_xmlChar_ptr(n_name, 0); 2137 2138 ret_val = htmlIsScriptAttribute((const xmlChar *)name); 2139 desret_int(ret_val); 2140 call_tests++; 2141 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 2142 xmlResetLastError(); 2143 if (mem_base != xmlMemBlocks()) { 2144 printf("Leak of %d blocks found in htmlIsScriptAttribute", 2145 xmlMemBlocks() - mem_base); 2146 test_ret++; 2147 printf(" %d", n_name); 2148 printf("\n"); 2149 } 2150 } 2151 function_tests++; 2152 #endif 2153 2154 return(test_ret); 2155 } 2156 2157 2158 static int 2159 test_htmlNewParserCtxt(void) { 2160 int test_ret = 0; 2161 2162 #if defined(LIBXML_HTML_ENABLED) 2163 int mem_base; 2164 htmlParserCtxtPtr ret_val; 2165 2166 mem_base = xmlMemBlocks(); 2167 2168 ret_val = htmlNewParserCtxt(); 2169 desret_htmlParserCtxtPtr(ret_val); 2170 call_tests++; 2171 xmlResetLastError(); 2172 if (mem_base != xmlMemBlocks()) { 2173 printf("Leak of %d blocks found in htmlNewParserCtxt", 2174 xmlMemBlocks() - mem_base); 2175 test_ret++; 2176 printf("\n"); 2177 } 2178 function_tests++; 2179 #endif 2180 2181 return(test_ret); 2182 } 2183 2184 2185 static int 2186 test_htmlNodeStatus(void) { 2187 int test_ret = 0; 2188 2189 #if defined(LIBXML_HTML_ENABLED) 2190 int mem_base; 2191 htmlStatus ret_val; 2192 htmlNodePtr node; /* an htmlNodePtr in a tree */ 2193 int n_node; 2194 int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */ 2195 int n_legacy; 2196 2197 for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) { 2198 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) { 2199 mem_base = xmlMemBlocks(); 2200 node = gen_const_htmlNodePtr(n_node, 0); 2201 legacy = gen_int(n_legacy, 1); 2202 2203 ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy); 2204 desret_htmlStatus(ret_val); 2205 call_tests++; 2206 des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0); 2207 des_int(n_legacy, legacy, 1); 2208 xmlResetLastError(); 2209 if (mem_base != xmlMemBlocks()) { 2210 printf("Leak of %d blocks found in htmlNodeStatus", 2211 xmlMemBlocks() - mem_base); 2212 test_ret++; 2213 printf(" %d", n_node); 2214 printf(" %d", n_legacy); 2215 printf("\n"); 2216 } 2217 } 2218 } 2219 function_tests++; 2220 #endif 2221 2222 return(test_ret); 2223 } 2224 2225 2226 static int 2227 test_htmlParseCharRef(void) { 2228 int test_ret = 0; 2229 2230 #if defined(LIBXML_HTML_ENABLED) 2231 int mem_base; 2232 int ret_val; 2233 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2234 int n_ctxt; 2235 2236 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2237 mem_base = xmlMemBlocks(); 2238 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2239 2240 ret_val = htmlParseCharRef(ctxt); 2241 desret_int(ret_val); 2242 call_tests++; 2243 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2244 xmlResetLastError(); 2245 if (mem_base != xmlMemBlocks()) { 2246 printf("Leak of %d blocks found in htmlParseCharRef", 2247 xmlMemBlocks() - mem_base); 2248 test_ret++; 2249 printf(" %d", n_ctxt); 2250 printf("\n"); 2251 } 2252 } 2253 function_tests++; 2254 #endif 2255 2256 return(test_ret); 2257 } 2258 2259 2260 static int 2261 test_htmlParseChunk(void) { 2262 int test_ret = 0; 2263 2264 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) 2265 int mem_base; 2266 int ret_val; 2267 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2268 int n_ctxt; 2269 char * chunk; /* an char array */ 2270 int n_chunk; 2271 int size; /* the size in byte of the chunk */ 2272 int n_size; 2273 int terminate; /* last chunk indicator */ 2274 int n_terminate; 2275 2276 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2277 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 2278 for (n_size = 0;n_size < gen_nb_int;n_size++) { 2279 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { 2280 mem_base = xmlMemBlocks(); 2281 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2282 chunk = gen_const_char_ptr(n_chunk, 1); 2283 size = gen_int(n_size, 2); 2284 terminate = gen_int(n_terminate, 3); 2285 2286 ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate); 2287 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 2288 desret_int(ret_val); 2289 call_tests++; 2290 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2291 des_const_char_ptr(n_chunk, (const char *)chunk, 1); 2292 des_int(n_size, size, 2); 2293 des_int(n_terminate, terminate, 3); 2294 xmlResetLastError(); 2295 if (mem_base != xmlMemBlocks()) { 2296 printf("Leak of %d blocks found in htmlParseChunk", 2297 xmlMemBlocks() - mem_base); 2298 test_ret++; 2299 printf(" %d", n_ctxt); 2300 printf(" %d", n_chunk); 2301 printf(" %d", n_size); 2302 printf(" %d", n_terminate); 2303 printf("\n"); 2304 } 2305 } 2306 } 2307 } 2308 } 2309 function_tests++; 2310 #endif 2311 2312 return(test_ret); 2313 } 2314 2315 2316 static int 2317 test_htmlParseDoc(void) { 2318 int test_ret = 0; 2319 2320 #if defined(LIBXML_HTML_ENABLED) 2321 int mem_base; 2322 htmlDocPtr ret_val; 2323 xmlChar * cur; /* a pointer to an array of xmlChar */ 2324 int n_cur; 2325 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2326 int n_encoding; 2327 2328 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { 2329 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2330 mem_base = xmlMemBlocks(); 2331 cur = gen_xmlChar_ptr(n_cur, 0); 2332 encoding = gen_const_char_ptr(n_encoding, 1); 2333 2334 ret_val = htmlParseDoc(cur, (const char *)encoding); 2335 desret_htmlDocPtr(ret_val); 2336 call_tests++; 2337 des_xmlChar_ptr(n_cur, cur, 0); 2338 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2339 xmlResetLastError(); 2340 if (mem_base != xmlMemBlocks()) { 2341 printf("Leak of %d blocks found in htmlParseDoc", 2342 xmlMemBlocks() - mem_base); 2343 test_ret++; 2344 printf(" %d", n_cur); 2345 printf(" %d", n_encoding); 2346 printf("\n"); 2347 } 2348 } 2349 } 2350 function_tests++; 2351 #endif 2352 2353 return(test_ret); 2354 } 2355 2356 2357 static int 2358 test_htmlParseDocument(void) { 2359 int test_ret = 0; 2360 2361 #if defined(LIBXML_HTML_ENABLED) 2362 int mem_base; 2363 int ret_val; 2364 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2365 int n_ctxt; 2366 2367 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2368 mem_base = xmlMemBlocks(); 2369 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2370 2371 ret_val = htmlParseDocument(ctxt); 2372 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 2373 desret_int(ret_val); 2374 call_tests++; 2375 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2376 xmlResetLastError(); 2377 if (mem_base != xmlMemBlocks()) { 2378 printf("Leak of %d blocks found in htmlParseDocument", 2379 xmlMemBlocks() - mem_base); 2380 test_ret++; 2381 printf(" %d", n_ctxt); 2382 printf("\n"); 2383 } 2384 } 2385 function_tests++; 2386 #endif 2387 2388 return(test_ret); 2389 } 2390 2391 2392 static int 2393 test_htmlParseElement(void) { 2394 int test_ret = 0; 2395 2396 #if defined(LIBXML_HTML_ENABLED) 2397 int mem_base; 2398 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2399 int n_ctxt; 2400 2401 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2402 mem_base = xmlMemBlocks(); 2403 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2404 2405 htmlParseElement(ctxt); 2406 call_tests++; 2407 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2408 xmlResetLastError(); 2409 if (mem_base != xmlMemBlocks()) { 2410 printf("Leak of %d blocks found in htmlParseElement", 2411 xmlMemBlocks() - mem_base); 2412 test_ret++; 2413 printf(" %d", n_ctxt); 2414 printf("\n"); 2415 } 2416 } 2417 function_tests++; 2418 #endif 2419 2420 return(test_ret); 2421 } 2422 2423 2424 static int 2425 test_htmlParseEntityRef(void) { 2426 int test_ret = 0; 2427 2428 #if defined(LIBXML_HTML_ENABLED) 2429 int mem_base; 2430 const htmlEntityDesc * ret_val; 2431 htmlParserCtxtPtr ctxt; /* an HTML parser context */ 2432 int n_ctxt; 2433 xmlChar ** str; /* location to store the entity name */ 2434 int n_str; 2435 2436 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { 2437 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) { 2438 mem_base = xmlMemBlocks(); 2439 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); 2440 str = gen_const_xmlChar_ptr_ptr(n_str, 1); 2441 2442 ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str); 2443 desret_const_htmlEntityDesc_ptr(ret_val); 2444 call_tests++; 2445 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); 2446 des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1); 2447 xmlResetLastError(); 2448 if (mem_base != xmlMemBlocks()) { 2449 printf("Leak of %d blocks found in htmlParseEntityRef", 2450 xmlMemBlocks() - mem_base); 2451 test_ret++; 2452 printf(" %d", n_ctxt); 2453 printf(" %d", n_str); 2454 printf("\n"); 2455 } 2456 } 2457 } 2458 function_tests++; 2459 #endif 2460 2461 return(test_ret); 2462 } 2463 2464 2465 static int 2466 test_htmlParseFile(void) { 2467 int test_ret = 0; 2468 2469 #if defined(LIBXML_HTML_ENABLED) 2470 htmlDocPtr ret_val; 2471 const char * filename; /* the filename */ 2472 int n_filename; 2473 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2474 int n_encoding; 2475 2476 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 2477 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2478 filename = gen_filepath(n_filename, 0); 2479 encoding = gen_const_char_ptr(n_encoding, 1); 2480 2481 ret_val = htmlParseFile(filename, (const char *)encoding); 2482 desret_htmlDocPtr(ret_val); 2483 call_tests++; 2484 des_filepath(n_filename, filename, 0); 2485 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2486 xmlResetLastError(); 2487 } 2488 } 2489 function_tests++; 2490 #endif 2491 2492 return(test_ret); 2493 } 2494 2495 2496 static int 2497 test_htmlReadDoc(void) { 2498 int test_ret = 0; 2499 2500 #if defined(LIBXML_HTML_ENABLED) 2501 int mem_base; 2502 htmlDocPtr ret_val; 2503 xmlChar * cur; /* a pointer to a zero terminated string */ 2504 int n_cur; 2505 const char * URL; /* the base URL to use for the document */ 2506 int n_URL; 2507 char * encoding; /* the document encoding, or NULL */ 2508 int n_encoding; 2509 int options; /* a combination of htmlParserOption(s) */ 2510 int n_options; 2511 2512 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 2513 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 2514 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2515 for (n_options = 0;n_options < gen_nb_int;n_options++) { 2516 mem_base = xmlMemBlocks(); 2517 cur = gen_const_xmlChar_ptr(n_cur, 0); 2518 URL = gen_filepath(n_URL, 1); 2519 encoding = gen_const_char_ptr(n_encoding, 2); 2520 options = gen_int(n_options, 3); 2521 2522 ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options); 2523 desret_htmlDocPtr(ret_val); 2524 call_tests++; 2525 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 2526 des_filepath(n_URL, URL, 1); 2527 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 2528 des_int(n_options, options, 3); 2529 xmlResetLastError(); 2530 if (mem_base != xmlMemBlocks()) { 2531 printf("Leak of %d blocks found in htmlReadDoc", 2532 xmlMemBlocks() - mem_base); 2533 test_ret++; 2534 printf(" %d", n_cur); 2535 printf(" %d", n_URL); 2536 printf(" %d", n_encoding); 2537 printf(" %d", n_options); 2538 printf("\n"); 2539 } 2540 } 2541 } 2542 } 2543 } 2544 function_tests++; 2545 #endif 2546 2547 return(test_ret); 2548 } 2549 2550 2551 static int 2552 test_htmlReadFile(void) { 2553 int test_ret = 0; 2554 2555 #if defined(LIBXML_HTML_ENABLED) 2556 int mem_base; 2557 htmlDocPtr ret_val; 2558 const char * filename; /* a file or URL */ 2559 int n_filename; 2560 char * encoding; /* the document encoding, or NULL */ 2561 int n_encoding; 2562 int options; /* a combination of htmlParserOption(s) */ 2563 int n_options; 2564 2565 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 2566 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2567 for (n_options = 0;n_options < gen_nb_int;n_options++) { 2568 mem_base = xmlMemBlocks(); 2569 filename = gen_filepath(n_filename, 0); 2570 encoding = gen_const_char_ptr(n_encoding, 1); 2571 options = gen_int(n_options, 2); 2572 2573 ret_val = htmlReadFile(filename, (const char *)encoding, options); 2574 desret_htmlDocPtr(ret_val); 2575 call_tests++; 2576 des_filepath(n_filename, filename, 0); 2577 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2578 des_int(n_options, options, 2); 2579 xmlResetLastError(); 2580 if (mem_base != xmlMemBlocks()) { 2581 printf("Leak of %d blocks found in htmlReadFile", 2582 xmlMemBlocks() - mem_base); 2583 test_ret++; 2584 printf(" %d", n_filename); 2585 printf(" %d", n_encoding); 2586 printf(" %d", n_options); 2587 printf("\n"); 2588 } 2589 } 2590 } 2591 } 2592 function_tests++; 2593 #endif 2594 2595 return(test_ret); 2596 } 2597 2598 2599 static int 2600 test_htmlReadMemory(void) { 2601 int test_ret = 0; 2602 2603 #if defined(LIBXML_HTML_ENABLED) 2604 int mem_base; 2605 htmlDocPtr ret_val; 2606 char * buffer; /* a pointer to a char array */ 2607 int n_buffer; 2608 int size; /* the size of the array */ 2609 int n_size; 2610 const char * URL; /* the base URL to use for the document */ 2611 int n_URL; 2612 char * encoding; /* the document encoding, or NULL */ 2613 int n_encoding; 2614 int options; /* a combination of htmlParserOption(s) */ 2615 int n_options; 2616 2617 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 2618 for (n_size = 0;n_size < gen_nb_int;n_size++) { 2619 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 2620 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2621 for (n_options = 0;n_options < gen_nb_int;n_options++) { 2622 mem_base = xmlMemBlocks(); 2623 buffer = gen_const_char_ptr(n_buffer, 0); 2624 size = gen_int(n_size, 1); 2625 URL = gen_filepath(n_URL, 2); 2626 encoding = gen_const_char_ptr(n_encoding, 3); 2627 options = gen_int(n_options, 4); 2628 2629 ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options); 2630 desret_htmlDocPtr(ret_val); 2631 call_tests++; 2632 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 2633 des_int(n_size, size, 1); 2634 des_filepath(n_URL, URL, 2); 2635 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 2636 des_int(n_options, options, 4); 2637 xmlResetLastError(); 2638 if (mem_base != xmlMemBlocks()) { 2639 printf("Leak of %d blocks found in htmlReadMemory", 2640 xmlMemBlocks() - mem_base); 2641 test_ret++; 2642 printf(" %d", n_buffer); 2643 printf(" %d", n_size); 2644 printf(" %d", n_URL); 2645 printf(" %d", n_encoding); 2646 printf(" %d", n_options); 2647 printf("\n"); 2648 } 2649 } 2650 } 2651 } 2652 } 2653 } 2654 function_tests++; 2655 #endif 2656 2657 return(test_ret); 2658 } 2659 2660 2661 static int 2662 test_htmlSAXParseDoc(void) { 2663 int test_ret = 0; 2664 2665 #if defined(LIBXML_HTML_ENABLED) 2666 int mem_base; 2667 htmlDocPtr ret_val; 2668 xmlChar * cur; /* a pointer to an array of xmlChar */ 2669 int n_cur; 2670 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2671 int n_encoding; 2672 htmlSAXHandlerPtr sax; /* the SAX handler block */ 2673 int n_sax; 2674 void * userData; /* if using SAX, this pointer will be provided on callbacks. */ 2675 int n_userData; 2676 2677 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { 2678 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2679 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { 2680 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) { 2681 mem_base = xmlMemBlocks(); 2682 cur = gen_xmlChar_ptr(n_cur, 0); 2683 encoding = gen_const_char_ptr(n_encoding, 1); 2684 sax = gen_htmlSAXHandlerPtr(n_sax, 2); 2685 userData = gen_userdata(n_userData, 3); 2686 2687 ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData); 2688 desret_htmlDocPtr(ret_val); 2689 call_tests++; 2690 des_xmlChar_ptr(n_cur, cur, 0); 2691 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2692 des_htmlSAXHandlerPtr(n_sax, sax, 2); 2693 des_userdata(n_userData, userData, 3); 2694 xmlResetLastError(); 2695 if (mem_base != xmlMemBlocks()) { 2696 printf("Leak of %d blocks found in htmlSAXParseDoc", 2697 xmlMemBlocks() - mem_base); 2698 test_ret++; 2699 printf(" %d", n_cur); 2700 printf(" %d", n_encoding); 2701 printf(" %d", n_sax); 2702 printf(" %d", n_userData); 2703 printf("\n"); 2704 } 2705 } 2706 } 2707 } 2708 } 2709 function_tests++; 2710 #endif 2711 2712 return(test_ret); 2713 } 2714 2715 2716 static int 2717 test_htmlSAXParseFile(void) { 2718 int test_ret = 0; 2719 2720 #if defined(LIBXML_HTML_ENABLED) 2721 int mem_base; 2722 htmlDocPtr ret_val; 2723 const char * filename; /* the filename */ 2724 int n_filename; 2725 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 2726 int n_encoding; 2727 htmlSAXHandlerPtr sax; /* the SAX handler block */ 2728 int n_sax; 2729 void * userData; /* if using SAX, this pointer will be provided on callbacks. */ 2730 int n_userData; 2731 2732 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 2733 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2734 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { 2735 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) { 2736 mem_base = xmlMemBlocks(); 2737 filename = gen_filepath(n_filename, 0); 2738 encoding = gen_const_char_ptr(n_encoding, 1); 2739 sax = gen_htmlSAXHandlerPtr(n_sax, 2); 2740 userData = gen_userdata(n_userData, 3); 2741 2742 ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData); 2743 desret_htmlDocPtr(ret_val); 2744 call_tests++; 2745 des_filepath(n_filename, filename, 0); 2746 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 2747 des_htmlSAXHandlerPtr(n_sax, sax, 2); 2748 des_userdata(n_userData, userData, 3); 2749 xmlResetLastError(); 2750 if (mem_base != xmlMemBlocks()) { 2751 printf("Leak of %d blocks found in htmlSAXParseFile", 2752 xmlMemBlocks() - mem_base); 2753 test_ret++; 2754 printf(" %d", n_filename); 2755 printf(" %d", n_encoding); 2756 printf(" %d", n_sax); 2757 printf(" %d", n_userData); 2758 printf("\n"); 2759 } 2760 } 2761 } 2762 } 2763 } 2764 function_tests++; 2765 #endif 2766 2767 return(test_ret); 2768 } 2769 2770 2771 static int 2772 test_htmlTagLookup(void) { 2773 int test_ret = 0; 2774 2775 2776 /* missing type support */ 2777 return(test_ret); 2778 } 2779 2780 static int 2781 test_HTMLparser(void) { 2782 int test_ret = 0; 2783 2784 if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n"); 2785 test_ret += test_UTF8ToHtml(); 2786 test_ret += test_htmlAttrAllowed(); 2787 test_ret += test_htmlAutoCloseTag(); 2788 test_ret += test_htmlCreateMemoryParserCtxt(); 2789 test_ret += test_htmlCreatePushParserCtxt(); 2790 test_ret += test_htmlCtxtReadDoc(); 2791 test_ret += test_htmlCtxtReadFile(); 2792 test_ret += test_htmlCtxtReadMemory(); 2793 test_ret += test_htmlCtxtReset(); 2794 test_ret += test_htmlCtxtUseOptions(); 2795 test_ret += test_htmlElementAllowedHere(); 2796 test_ret += test_htmlElementStatusHere(); 2797 test_ret += test_htmlEncodeEntities(); 2798 test_ret += test_htmlEntityLookup(); 2799 test_ret += test_htmlEntityValueLookup(); 2800 test_ret += test_htmlHandleOmittedElem(); 2801 test_ret += test_htmlIsAutoClosed(); 2802 test_ret += test_htmlIsScriptAttribute(); 2803 test_ret += test_htmlNewParserCtxt(); 2804 test_ret += test_htmlNodeStatus(); 2805 test_ret += test_htmlParseCharRef(); 2806 test_ret += test_htmlParseChunk(); 2807 test_ret += test_htmlParseDoc(); 2808 test_ret += test_htmlParseDocument(); 2809 test_ret += test_htmlParseElement(); 2810 test_ret += test_htmlParseEntityRef(); 2811 test_ret += test_htmlParseFile(); 2812 test_ret += test_htmlReadDoc(); 2813 test_ret += test_htmlReadFile(); 2814 test_ret += test_htmlReadMemory(); 2815 test_ret += test_htmlSAXParseDoc(); 2816 test_ret += test_htmlSAXParseFile(); 2817 test_ret += test_htmlTagLookup(); 2818 2819 if (test_ret != 0) 2820 printf("Module HTMLparser: %d errors\n", test_ret); 2821 return(test_ret); 2822 } 2823 2824 static int 2825 test_htmlDocContentDumpFormatOutput(void) { 2826 int test_ret = 0; 2827 2828 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2829 int mem_base; 2830 xmlOutputBufferPtr buf; /* the HTML buffer output */ 2831 int n_buf; 2832 xmlDocPtr cur; /* the document */ 2833 int n_cur; 2834 char * encoding; /* the encoding string */ 2835 int n_encoding; 2836 int format; /* should formatting spaces been added */ 2837 int n_format; 2838 2839 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 2840 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2841 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2842 for (n_format = 0;n_format < gen_nb_int;n_format++) { 2843 mem_base = xmlMemBlocks(); 2844 buf = gen_xmlOutputBufferPtr(n_buf, 0); 2845 cur = gen_xmlDocPtr(n_cur, 1); 2846 encoding = gen_const_char_ptr(n_encoding, 2); 2847 format = gen_int(n_format, 3); 2848 2849 htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format); 2850 call_tests++; 2851 des_xmlOutputBufferPtr(n_buf, buf, 0); 2852 des_xmlDocPtr(n_cur, cur, 1); 2853 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 2854 des_int(n_format, format, 3); 2855 xmlResetLastError(); 2856 if (mem_base != xmlMemBlocks()) { 2857 printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput", 2858 xmlMemBlocks() - mem_base); 2859 test_ret++; 2860 printf(" %d", n_buf); 2861 printf(" %d", n_cur); 2862 printf(" %d", n_encoding); 2863 printf(" %d", n_format); 2864 printf("\n"); 2865 } 2866 } 2867 } 2868 } 2869 } 2870 function_tests++; 2871 #endif 2872 2873 return(test_ret); 2874 } 2875 2876 2877 static int 2878 test_htmlDocContentDumpOutput(void) { 2879 int test_ret = 0; 2880 2881 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2882 int mem_base; 2883 xmlOutputBufferPtr buf; /* the HTML buffer output */ 2884 int n_buf; 2885 xmlDocPtr cur; /* the document */ 2886 int n_cur; 2887 char * encoding; /* the encoding string */ 2888 int n_encoding; 2889 2890 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 2891 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2892 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 2893 mem_base = xmlMemBlocks(); 2894 buf = gen_xmlOutputBufferPtr(n_buf, 0); 2895 cur = gen_xmlDocPtr(n_cur, 1); 2896 encoding = gen_const_char_ptr(n_encoding, 2); 2897 2898 htmlDocContentDumpOutput(buf, cur, (const char *)encoding); 2899 call_tests++; 2900 des_xmlOutputBufferPtr(n_buf, buf, 0); 2901 des_xmlDocPtr(n_cur, cur, 1); 2902 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 2903 xmlResetLastError(); 2904 if (mem_base != xmlMemBlocks()) { 2905 printf("Leak of %d blocks found in htmlDocContentDumpOutput", 2906 xmlMemBlocks() - mem_base); 2907 test_ret++; 2908 printf(" %d", n_buf); 2909 printf(" %d", n_cur); 2910 printf(" %d", n_encoding); 2911 printf("\n"); 2912 } 2913 } 2914 } 2915 } 2916 function_tests++; 2917 #endif 2918 2919 return(test_ret); 2920 } 2921 2922 2923 static int 2924 test_htmlDocDump(void) { 2925 int test_ret = 0; 2926 2927 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2928 int mem_base; 2929 int ret_val; 2930 FILE * f; /* the FILE* */ 2931 int n_f; 2932 xmlDocPtr cur; /* the document */ 2933 int n_cur; 2934 2935 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 2936 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2937 mem_base = xmlMemBlocks(); 2938 f = gen_FILE_ptr(n_f, 0); 2939 cur = gen_xmlDocPtr(n_cur, 1); 2940 2941 ret_val = htmlDocDump(f, cur); 2942 desret_int(ret_val); 2943 call_tests++; 2944 des_FILE_ptr(n_f, f, 0); 2945 des_xmlDocPtr(n_cur, cur, 1); 2946 xmlResetLastError(); 2947 if (mem_base != xmlMemBlocks()) { 2948 printf("Leak of %d blocks found in htmlDocDump", 2949 xmlMemBlocks() - mem_base); 2950 test_ret++; 2951 printf(" %d", n_f); 2952 printf(" %d", n_cur); 2953 printf("\n"); 2954 } 2955 } 2956 } 2957 function_tests++; 2958 #endif 2959 2960 return(test_ret); 2961 } 2962 2963 2964 #define gen_nb_xmlChar_ptr_ptr 1 2965 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 2966 return(NULL); 2967 } 2968 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 2969 } 2970 2971 static int 2972 test_htmlDocDumpMemory(void) { 2973 int test_ret = 0; 2974 2975 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 2976 int mem_base; 2977 xmlDocPtr cur; /* the document */ 2978 int n_cur; 2979 xmlChar ** mem; /* OUT: the memory pointer */ 2980 int n_mem; 2981 int * size; /* OUT: the memory length */ 2982 int n_size; 2983 2984 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 2985 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 2986 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 2987 mem_base = xmlMemBlocks(); 2988 cur = gen_xmlDocPtr(n_cur, 0); 2989 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 2990 size = gen_int_ptr(n_size, 2); 2991 2992 htmlDocDumpMemory(cur, mem, size); 2993 call_tests++; 2994 des_xmlDocPtr(n_cur, cur, 0); 2995 des_xmlChar_ptr_ptr(n_mem, mem, 1); 2996 des_int_ptr(n_size, size, 2); 2997 xmlResetLastError(); 2998 if (mem_base != xmlMemBlocks()) { 2999 printf("Leak of %d blocks found in htmlDocDumpMemory", 3000 xmlMemBlocks() - mem_base); 3001 test_ret++; 3002 printf(" %d", n_cur); 3003 printf(" %d", n_mem); 3004 printf(" %d", n_size); 3005 printf("\n"); 3006 } 3007 } 3008 } 3009 } 3010 function_tests++; 3011 #endif 3012 3013 return(test_ret); 3014 } 3015 3016 3017 static int 3018 test_htmlDocDumpMemoryFormat(void) { 3019 int test_ret = 0; 3020 3021 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3022 int mem_base; 3023 xmlDocPtr cur; /* the document */ 3024 int n_cur; 3025 xmlChar ** mem; /* OUT: the memory pointer */ 3026 int n_mem; 3027 int * size; /* OUT: the memory length */ 3028 int n_size; 3029 int format; /* should formatting spaces been added */ 3030 int n_format; 3031 3032 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3033 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 3034 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 3035 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3036 mem_base = xmlMemBlocks(); 3037 cur = gen_xmlDocPtr(n_cur, 0); 3038 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 3039 size = gen_int_ptr(n_size, 2); 3040 format = gen_int(n_format, 3); 3041 3042 htmlDocDumpMemoryFormat(cur, mem, size, format); 3043 call_tests++; 3044 des_xmlDocPtr(n_cur, cur, 0); 3045 des_xmlChar_ptr_ptr(n_mem, mem, 1); 3046 des_int_ptr(n_size, size, 2); 3047 des_int(n_format, format, 3); 3048 xmlResetLastError(); 3049 if (mem_base != xmlMemBlocks()) { 3050 printf("Leak of %d blocks found in htmlDocDumpMemoryFormat", 3051 xmlMemBlocks() - mem_base); 3052 test_ret++; 3053 printf(" %d", n_cur); 3054 printf(" %d", n_mem); 3055 printf(" %d", n_size); 3056 printf(" %d", n_format); 3057 printf("\n"); 3058 } 3059 } 3060 } 3061 } 3062 } 3063 function_tests++; 3064 #endif 3065 3066 return(test_ret); 3067 } 3068 3069 3070 static int 3071 test_htmlGetMetaEncoding(void) { 3072 int test_ret = 0; 3073 3074 #if defined(LIBXML_HTML_ENABLED) 3075 int mem_base; 3076 const xmlChar * ret_val; 3077 htmlDocPtr doc; /* the document */ 3078 int n_doc; 3079 3080 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 3081 mem_base = xmlMemBlocks(); 3082 doc = gen_htmlDocPtr(n_doc, 0); 3083 3084 ret_val = htmlGetMetaEncoding(doc); 3085 desret_const_xmlChar_ptr(ret_val); 3086 call_tests++; 3087 des_htmlDocPtr(n_doc, doc, 0); 3088 xmlResetLastError(); 3089 if (mem_base != xmlMemBlocks()) { 3090 printf("Leak of %d blocks found in htmlGetMetaEncoding", 3091 xmlMemBlocks() - mem_base); 3092 test_ret++; 3093 printf(" %d", n_doc); 3094 printf("\n"); 3095 } 3096 } 3097 function_tests++; 3098 #endif 3099 3100 return(test_ret); 3101 } 3102 3103 3104 static int 3105 test_htmlIsBooleanAttr(void) { 3106 int test_ret = 0; 3107 3108 #if defined(LIBXML_HTML_ENABLED) 3109 int mem_base; 3110 int ret_val; 3111 xmlChar * name; /* the name of the attribute to check */ 3112 int n_name; 3113 3114 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 3115 mem_base = xmlMemBlocks(); 3116 name = gen_const_xmlChar_ptr(n_name, 0); 3117 3118 ret_val = htmlIsBooleanAttr((const xmlChar *)name); 3119 desret_int(ret_val); 3120 call_tests++; 3121 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 3122 xmlResetLastError(); 3123 if (mem_base != xmlMemBlocks()) { 3124 printf("Leak of %d blocks found in htmlIsBooleanAttr", 3125 xmlMemBlocks() - mem_base); 3126 test_ret++; 3127 printf(" %d", n_name); 3128 printf("\n"); 3129 } 3130 } 3131 function_tests++; 3132 #endif 3133 3134 return(test_ret); 3135 } 3136 3137 3138 static int 3139 test_htmlNewDoc(void) { 3140 int test_ret = 0; 3141 3142 #if defined(LIBXML_HTML_ENABLED) 3143 int mem_base; 3144 htmlDocPtr ret_val; 3145 xmlChar * URI; /* URI for the dtd, or NULL */ 3146 int n_URI; 3147 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ 3148 int n_ExternalID; 3149 3150 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 3151 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 3152 mem_base = xmlMemBlocks(); 3153 URI = gen_const_xmlChar_ptr(n_URI, 0); 3154 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); 3155 3156 ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID); 3157 desret_htmlDocPtr(ret_val); 3158 call_tests++; 3159 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 3160 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); 3161 xmlResetLastError(); 3162 if (mem_base != xmlMemBlocks()) { 3163 printf("Leak of %d blocks found in htmlNewDoc", 3164 xmlMemBlocks() - mem_base); 3165 test_ret++; 3166 printf(" %d", n_URI); 3167 printf(" %d", n_ExternalID); 3168 printf("\n"); 3169 } 3170 } 3171 } 3172 function_tests++; 3173 #endif 3174 3175 return(test_ret); 3176 } 3177 3178 3179 static int 3180 test_htmlNewDocNoDtD(void) { 3181 int test_ret = 0; 3182 3183 #if defined(LIBXML_HTML_ENABLED) 3184 int mem_base; 3185 htmlDocPtr ret_val; 3186 xmlChar * URI; /* URI for the dtd, or NULL */ 3187 int n_URI; 3188 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ 3189 int n_ExternalID; 3190 3191 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 3192 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 3193 mem_base = xmlMemBlocks(); 3194 URI = gen_const_xmlChar_ptr(n_URI, 0); 3195 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); 3196 3197 ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID); 3198 desret_htmlDocPtr(ret_val); 3199 call_tests++; 3200 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 3201 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); 3202 xmlResetLastError(); 3203 if (mem_base != xmlMemBlocks()) { 3204 printf("Leak of %d blocks found in htmlNewDocNoDtD", 3205 xmlMemBlocks() - mem_base); 3206 test_ret++; 3207 printf(" %d", n_URI); 3208 printf(" %d", n_ExternalID); 3209 printf("\n"); 3210 } 3211 } 3212 } 3213 function_tests++; 3214 #endif 3215 3216 return(test_ret); 3217 } 3218 3219 3220 static int 3221 test_htmlNodeDump(void) { 3222 int test_ret = 0; 3223 3224 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3225 int mem_base; 3226 int ret_val; 3227 xmlBufferPtr buf; /* the HTML buffer output */ 3228 int n_buf; 3229 xmlDocPtr doc; /* the document */ 3230 int n_doc; 3231 xmlNodePtr cur; /* the current node */ 3232 int n_cur; 3233 3234 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 3235 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3236 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3237 mem_base = xmlMemBlocks(); 3238 buf = gen_xmlBufferPtr(n_buf, 0); 3239 doc = gen_xmlDocPtr(n_doc, 1); 3240 cur = gen_xmlNodePtr(n_cur, 2); 3241 3242 ret_val = htmlNodeDump(buf, doc, cur); 3243 desret_int(ret_val); 3244 call_tests++; 3245 des_xmlBufferPtr(n_buf, buf, 0); 3246 des_xmlDocPtr(n_doc, doc, 1); 3247 des_xmlNodePtr(n_cur, cur, 2); 3248 xmlResetLastError(); 3249 if (mem_base != xmlMemBlocks()) { 3250 printf("Leak of %d blocks found in htmlNodeDump", 3251 xmlMemBlocks() - mem_base); 3252 test_ret++; 3253 printf(" %d", n_buf); 3254 printf(" %d", n_doc); 3255 printf(" %d", n_cur); 3256 printf("\n"); 3257 } 3258 } 3259 } 3260 } 3261 function_tests++; 3262 #endif 3263 3264 return(test_ret); 3265 } 3266 3267 3268 static int 3269 test_htmlNodeDumpFile(void) { 3270 int test_ret = 0; 3271 3272 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3273 int mem_base; 3274 FILE * out; /* the FILE pointer */ 3275 int n_out; 3276 xmlDocPtr doc; /* the document */ 3277 int n_doc; 3278 xmlNodePtr cur; /* the current node */ 3279 int n_cur; 3280 3281 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 3282 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3283 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3284 mem_base = xmlMemBlocks(); 3285 out = gen_FILE_ptr(n_out, 0); 3286 doc = gen_xmlDocPtr(n_doc, 1); 3287 cur = gen_xmlNodePtr(n_cur, 2); 3288 3289 htmlNodeDumpFile(out, doc, cur); 3290 call_tests++; 3291 des_FILE_ptr(n_out, out, 0); 3292 des_xmlDocPtr(n_doc, doc, 1); 3293 des_xmlNodePtr(n_cur, cur, 2); 3294 xmlResetLastError(); 3295 if (mem_base != xmlMemBlocks()) { 3296 printf("Leak of %d blocks found in htmlNodeDumpFile", 3297 xmlMemBlocks() - mem_base); 3298 test_ret++; 3299 printf(" %d", n_out); 3300 printf(" %d", n_doc); 3301 printf(" %d", n_cur); 3302 printf("\n"); 3303 } 3304 } 3305 } 3306 } 3307 function_tests++; 3308 #endif 3309 3310 return(test_ret); 3311 } 3312 3313 3314 static int 3315 test_htmlNodeDumpFileFormat(void) { 3316 int test_ret = 0; 3317 3318 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3319 int mem_base; 3320 int ret_val; 3321 FILE * out; /* the FILE pointer */ 3322 int n_out; 3323 xmlDocPtr doc; /* the document */ 3324 int n_doc; 3325 xmlNodePtr cur; /* the current node */ 3326 int n_cur; 3327 char * encoding; /* the document encoding */ 3328 int n_encoding; 3329 int format; /* should formatting spaces been added */ 3330 int n_format; 3331 3332 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 3333 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3334 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3335 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3336 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3337 mem_base = xmlMemBlocks(); 3338 out = gen_FILE_ptr(n_out, 0); 3339 doc = gen_xmlDocPtr(n_doc, 1); 3340 cur = gen_xmlNodePtr(n_cur, 2); 3341 encoding = gen_const_char_ptr(n_encoding, 3); 3342 format = gen_int(n_format, 4); 3343 3344 ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format); 3345 desret_int(ret_val); 3346 call_tests++; 3347 des_FILE_ptr(n_out, out, 0); 3348 des_xmlDocPtr(n_doc, doc, 1); 3349 des_xmlNodePtr(n_cur, cur, 2); 3350 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 3351 des_int(n_format, format, 4); 3352 xmlResetLastError(); 3353 if (mem_base != xmlMemBlocks()) { 3354 printf("Leak of %d blocks found in htmlNodeDumpFileFormat", 3355 xmlMemBlocks() - mem_base); 3356 test_ret++; 3357 printf(" %d", n_out); 3358 printf(" %d", n_doc); 3359 printf(" %d", n_cur); 3360 printf(" %d", n_encoding); 3361 printf(" %d", n_format); 3362 printf("\n"); 3363 } 3364 } 3365 } 3366 } 3367 } 3368 } 3369 function_tests++; 3370 #endif 3371 3372 return(test_ret); 3373 } 3374 3375 3376 static int 3377 test_htmlNodeDumpFormatOutput(void) { 3378 int test_ret = 0; 3379 3380 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3381 int mem_base; 3382 xmlOutputBufferPtr buf; /* the HTML buffer output */ 3383 int n_buf; 3384 xmlDocPtr doc; /* the document */ 3385 int n_doc; 3386 xmlNodePtr cur; /* the current node */ 3387 int n_cur; 3388 char * encoding; /* the encoding string */ 3389 int n_encoding; 3390 int format; /* should formatting spaces been added */ 3391 int n_format; 3392 3393 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 3394 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3395 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3396 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3397 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3398 mem_base = xmlMemBlocks(); 3399 buf = gen_xmlOutputBufferPtr(n_buf, 0); 3400 doc = gen_xmlDocPtr(n_doc, 1); 3401 cur = gen_xmlNodePtr(n_cur, 2); 3402 encoding = gen_const_char_ptr(n_encoding, 3); 3403 format = gen_int(n_format, 4); 3404 3405 htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format); 3406 call_tests++; 3407 des_xmlOutputBufferPtr(n_buf, buf, 0); 3408 des_xmlDocPtr(n_doc, doc, 1); 3409 des_xmlNodePtr(n_cur, cur, 2); 3410 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 3411 des_int(n_format, format, 4); 3412 xmlResetLastError(); 3413 if (mem_base != xmlMemBlocks()) { 3414 printf("Leak of %d blocks found in htmlNodeDumpFormatOutput", 3415 xmlMemBlocks() - mem_base); 3416 test_ret++; 3417 printf(" %d", n_buf); 3418 printf(" %d", n_doc); 3419 printf(" %d", n_cur); 3420 printf(" %d", n_encoding); 3421 printf(" %d", n_format); 3422 printf("\n"); 3423 } 3424 } 3425 } 3426 } 3427 } 3428 } 3429 function_tests++; 3430 #endif 3431 3432 return(test_ret); 3433 } 3434 3435 3436 static int 3437 test_htmlNodeDumpOutput(void) { 3438 int test_ret = 0; 3439 3440 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3441 int mem_base; 3442 xmlOutputBufferPtr buf; /* the HTML buffer output */ 3443 int n_buf; 3444 xmlDocPtr doc; /* the document */ 3445 int n_doc; 3446 xmlNodePtr cur; /* the current node */ 3447 int n_cur; 3448 char * encoding; /* the encoding string */ 3449 int n_encoding; 3450 3451 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 3452 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 3453 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 3454 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3455 mem_base = xmlMemBlocks(); 3456 buf = gen_xmlOutputBufferPtr(n_buf, 0); 3457 doc = gen_xmlDocPtr(n_doc, 1); 3458 cur = gen_xmlNodePtr(n_cur, 2); 3459 encoding = gen_const_char_ptr(n_encoding, 3); 3460 3461 htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding); 3462 call_tests++; 3463 des_xmlOutputBufferPtr(n_buf, buf, 0); 3464 des_xmlDocPtr(n_doc, doc, 1); 3465 des_xmlNodePtr(n_cur, cur, 2); 3466 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 3467 xmlResetLastError(); 3468 if (mem_base != xmlMemBlocks()) { 3469 printf("Leak of %d blocks found in htmlNodeDumpOutput", 3470 xmlMemBlocks() - mem_base); 3471 test_ret++; 3472 printf(" %d", n_buf); 3473 printf(" %d", n_doc); 3474 printf(" %d", n_cur); 3475 printf(" %d", n_encoding); 3476 printf("\n"); 3477 } 3478 } 3479 } 3480 } 3481 } 3482 function_tests++; 3483 #endif 3484 3485 return(test_ret); 3486 } 3487 3488 3489 static int 3490 test_htmlSaveFile(void) { 3491 int test_ret = 0; 3492 3493 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3494 int mem_base; 3495 int ret_val; 3496 const char * filename; /* the filename (or URL) */ 3497 int n_filename; 3498 xmlDocPtr cur; /* the document */ 3499 int n_cur; 3500 3501 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 3502 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3503 mem_base = xmlMemBlocks(); 3504 filename = gen_fileoutput(n_filename, 0); 3505 cur = gen_xmlDocPtr(n_cur, 1); 3506 3507 ret_val = htmlSaveFile(filename, cur); 3508 desret_int(ret_val); 3509 call_tests++; 3510 des_fileoutput(n_filename, filename, 0); 3511 des_xmlDocPtr(n_cur, cur, 1); 3512 xmlResetLastError(); 3513 if (mem_base != xmlMemBlocks()) { 3514 printf("Leak of %d blocks found in htmlSaveFile", 3515 xmlMemBlocks() - mem_base); 3516 test_ret++; 3517 printf(" %d", n_filename); 3518 printf(" %d", n_cur); 3519 printf("\n"); 3520 } 3521 } 3522 } 3523 function_tests++; 3524 #endif 3525 3526 return(test_ret); 3527 } 3528 3529 3530 static int 3531 test_htmlSaveFileEnc(void) { 3532 int test_ret = 0; 3533 3534 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3535 int mem_base; 3536 int ret_val; 3537 const char * filename; /* the filename */ 3538 int n_filename; 3539 xmlDocPtr cur; /* the document */ 3540 int n_cur; 3541 char * encoding; /* the document encoding */ 3542 int n_encoding; 3543 3544 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 3545 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3546 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3547 mem_base = xmlMemBlocks(); 3548 filename = gen_fileoutput(n_filename, 0); 3549 cur = gen_xmlDocPtr(n_cur, 1); 3550 encoding = gen_const_char_ptr(n_encoding, 2); 3551 3552 ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding); 3553 desret_int(ret_val); 3554 call_tests++; 3555 des_fileoutput(n_filename, filename, 0); 3556 des_xmlDocPtr(n_cur, cur, 1); 3557 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 3558 xmlResetLastError(); 3559 if (mem_base != xmlMemBlocks()) { 3560 printf("Leak of %d blocks found in htmlSaveFileEnc", 3561 xmlMemBlocks() - mem_base); 3562 test_ret++; 3563 printf(" %d", n_filename); 3564 printf(" %d", n_cur); 3565 printf(" %d", n_encoding); 3566 printf("\n"); 3567 } 3568 } 3569 } 3570 } 3571 function_tests++; 3572 #endif 3573 3574 return(test_ret); 3575 } 3576 3577 3578 static int 3579 test_htmlSaveFileFormat(void) { 3580 int test_ret = 0; 3581 3582 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 3583 int mem_base; 3584 int ret_val; 3585 const char * filename; /* the filename */ 3586 int n_filename; 3587 xmlDocPtr cur; /* the document */ 3588 int n_cur; 3589 char * encoding; /* the document encoding */ 3590 int n_encoding; 3591 int format; /* should formatting spaces been added */ 3592 int n_format; 3593 3594 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 3595 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 3596 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 3597 for (n_format = 0;n_format < gen_nb_int;n_format++) { 3598 mem_base = xmlMemBlocks(); 3599 filename = gen_fileoutput(n_filename, 0); 3600 cur = gen_xmlDocPtr(n_cur, 1); 3601 encoding = gen_const_char_ptr(n_encoding, 2); 3602 format = gen_int(n_format, 3); 3603 3604 ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format); 3605 desret_int(ret_val); 3606 call_tests++; 3607 des_fileoutput(n_filename, filename, 0); 3608 des_xmlDocPtr(n_cur, cur, 1); 3609 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 3610 des_int(n_format, format, 3); 3611 xmlResetLastError(); 3612 if (mem_base != xmlMemBlocks()) { 3613 printf("Leak of %d blocks found in htmlSaveFileFormat", 3614 xmlMemBlocks() - mem_base); 3615 test_ret++; 3616 printf(" %d", n_filename); 3617 printf(" %d", n_cur); 3618 printf(" %d", n_encoding); 3619 printf(" %d", n_format); 3620 printf("\n"); 3621 } 3622 } 3623 } 3624 } 3625 } 3626 function_tests++; 3627 #endif 3628 3629 return(test_ret); 3630 } 3631 3632 3633 static int 3634 test_htmlSetMetaEncoding(void) { 3635 int test_ret = 0; 3636 3637 #if defined(LIBXML_HTML_ENABLED) 3638 int mem_base; 3639 int ret_val; 3640 htmlDocPtr doc; /* the document */ 3641 int n_doc; 3642 xmlChar * encoding; /* the encoding string */ 3643 int n_encoding; 3644 3645 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { 3646 for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) { 3647 mem_base = xmlMemBlocks(); 3648 doc = gen_htmlDocPtr(n_doc, 0); 3649 encoding = gen_const_xmlChar_ptr(n_encoding, 1); 3650 3651 ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding); 3652 desret_int(ret_val); 3653 call_tests++; 3654 des_htmlDocPtr(n_doc, doc, 0); 3655 des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1); 3656 xmlResetLastError(); 3657 if (mem_base != xmlMemBlocks()) { 3658 printf("Leak of %d blocks found in htmlSetMetaEncoding", 3659 xmlMemBlocks() - mem_base); 3660 test_ret++; 3661 printf(" %d", n_doc); 3662 printf(" %d", n_encoding); 3663 printf("\n"); 3664 } 3665 } 3666 } 3667 function_tests++; 3668 #endif 3669 3670 return(test_ret); 3671 } 3672 3673 static int 3674 test_HTMLtree(void) { 3675 int test_ret = 0; 3676 3677 if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n"); 3678 test_ret += test_htmlDocContentDumpFormatOutput(); 3679 test_ret += test_htmlDocContentDumpOutput(); 3680 test_ret += test_htmlDocDump(); 3681 test_ret += test_htmlDocDumpMemory(); 3682 test_ret += test_htmlDocDumpMemoryFormat(); 3683 test_ret += test_htmlGetMetaEncoding(); 3684 test_ret += test_htmlIsBooleanAttr(); 3685 test_ret += test_htmlNewDoc(); 3686 test_ret += test_htmlNewDocNoDtD(); 3687 test_ret += test_htmlNodeDump(); 3688 test_ret += test_htmlNodeDumpFile(); 3689 test_ret += test_htmlNodeDumpFileFormat(); 3690 test_ret += test_htmlNodeDumpFormatOutput(); 3691 test_ret += test_htmlNodeDumpOutput(); 3692 test_ret += test_htmlSaveFile(); 3693 test_ret += test_htmlSaveFileEnc(); 3694 test_ret += test_htmlSaveFileFormat(); 3695 test_ret += test_htmlSetMetaEncoding(); 3696 3697 if (test_ret != 0) 3698 printf("Module HTMLtree: %d errors\n", test_ret); 3699 return(test_ret); 3700 } 3701 3702 static int 3703 test_docbDefaultSAXHandlerInit(void) { 3704 int test_ret = 0; 3705 3706 #if defined(LIBXML_DOCB_ENABLED) 3707 #ifdef LIBXML_DOCB_ENABLED 3708 int mem_base; 3709 3710 mem_base = xmlMemBlocks(); 3711 3712 docbDefaultSAXHandlerInit(); 3713 call_tests++; 3714 xmlResetLastError(); 3715 if (mem_base != xmlMemBlocks()) { 3716 printf("Leak of %d blocks found in docbDefaultSAXHandlerInit", 3717 xmlMemBlocks() - mem_base); 3718 test_ret++; 3719 printf("\n"); 3720 } 3721 function_tests++; 3722 #endif 3723 #endif 3724 3725 return(test_ret); 3726 } 3727 3728 3729 static int 3730 test_htmlDefaultSAXHandlerInit(void) { 3731 int test_ret = 0; 3732 3733 #if defined(LIBXML_HTML_ENABLED) 3734 #ifdef LIBXML_HTML_ENABLED 3735 int mem_base; 3736 3737 mem_base = xmlMemBlocks(); 3738 3739 htmlDefaultSAXHandlerInit(); 3740 call_tests++; 3741 xmlResetLastError(); 3742 if (mem_base != xmlMemBlocks()) { 3743 printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit", 3744 xmlMemBlocks() - mem_base); 3745 test_ret++; 3746 printf("\n"); 3747 } 3748 function_tests++; 3749 #endif 3750 #endif 3751 3752 return(test_ret); 3753 } 3754 3755 3756 static int 3757 test_xmlDefaultSAXHandlerInit(void) { 3758 int test_ret = 0; 3759 3760 int mem_base; 3761 3762 mem_base = xmlMemBlocks(); 3763 3764 xmlDefaultSAXHandlerInit(); 3765 call_tests++; 3766 xmlResetLastError(); 3767 if (mem_base != xmlMemBlocks()) { 3768 printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit", 3769 xmlMemBlocks() - mem_base); 3770 test_ret++; 3771 printf("\n"); 3772 } 3773 function_tests++; 3774 3775 return(test_ret); 3776 } 3777 3778 3779 #define gen_nb_xmlEnumerationPtr 1 3780 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 3781 return(NULL); 3782 } 3783 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 3784 } 3785 3786 static int 3787 test_xmlSAX2AttributeDecl(void) { 3788 int test_ret = 0; 3789 3790 int mem_base; 3791 void * ctx; /* the user data (XML parser context) */ 3792 int n_ctx; 3793 xmlChar * elem; /* the name of the element */ 3794 int n_elem; 3795 xmlChar * fullname; /* the attribute name */ 3796 int n_fullname; 3797 int type; /* the attribute type */ 3798 int n_type; 3799 int def; /* the type of default value */ 3800 int n_def; 3801 xmlChar * defaultValue; /* the attribute default value */ 3802 int n_defaultValue; 3803 xmlEnumerationPtr tree; /* the tree of enumerated value set */ 3804 int n_tree; 3805 3806 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3807 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 3808 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) { 3809 for (n_type = 0;n_type < gen_nb_int;n_type++) { 3810 for (n_def = 0;n_def < gen_nb_int;n_def++) { 3811 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) { 3812 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) { 3813 mem_base = xmlMemBlocks(); 3814 ctx = gen_void_ptr(n_ctx, 0); 3815 elem = gen_const_xmlChar_ptr(n_elem, 1); 3816 fullname = gen_const_xmlChar_ptr(n_fullname, 2); 3817 type = gen_int(n_type, 3); 3818 def = gen_int(n_def, 4); 3819 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5); 3820 tree = gen_xmlEnumerationPtr(n_tree, 6); 3821 3822 xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree); 3823 call_tests++; 3824 des_void_ptr(n_ctx, ctx, 0); 3825 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); 3826 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2); 3827 des_int(n_type, type, 3); 3828 des_int(n_def, def, 4); 3829 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5); 3830 des_xmlEnumerationPtr(n_tree, tree, 6); 3831 xmlResetLastError(); 3832 if (mem_base != xmlMemBlocks()) { 3833 printf("Leak of %d blocks found in xmlSAX2AttributeDecl", 3834 xmlMemBlocks() - mem_base); 3835 test_ret++; 3836 printf(" %d", n_ctx); 3837 printf(" %d", n_elem); 3838 printf(" %d", n_fullname); 3839 printf(" %d", n_type); 3840 printf(" %d", n_def); 3841 printf(" %d", n_defaultValue); 3842 printf(" %d", n_tree); 3843 printf("\n"); 3844 } 3845 } 3846 } 3847 } 3848 } 3849 } 3850 } 3851 } 3852 function_tests++; 3853 3854 return(test_ret); 3855 } 3856 3857 3858 static int 3859 test_xmlSAX2CDataBlock(void) { 3860 int test_ret = 0; 3861 3862 int mem_base; 3863 void * ctx; /* the user data (XML parser context) */ 3864 int n_ctx; 3865 xmlChar * value; /* The pcdata content */ 3866 int n_value; 3867 int len; /* the block length */ 3868 int n_len; 3869 3870 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3871 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 3872 for (n_len = 0;n_len < gen_nb_int;n_len++) { 3873 mem_base = xmlMemBlocks(); 3874 ctx = gen_void_ptr(n_ctx, 0); 3875 value = gen_const_xmlChar_ptr(n_value, 1); 3876 len = gen_int(n_len, 2); 3877 3878 xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len); 3879 call_tests++; 3880 des_void_ptr(n_ctx, ctx, 0); 3881 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 3882 des_int(n_len, len, 2); 3883 xmlResetLastError(); 3884 if (mem_base != xmlMemBlocks()) { 3885 printf("Leak of %d blocks found in xmlSAX2CDataBlock", 3886 xmlMemBlocks() - mem_base); 3887 test_ret++; 3888 printf(" %d", n_ctx); 3889 printf(" %d", n_value); 3890 printf(" %d", n_len); 3891 printf("\n"); 3892 } 3893 } 3894 } 3895 } 3896 function_tests++; 3897 3898 return(test_ret); 3899 } 3900 3901 3902 static int 3903 test_xmlSAX2Characters(void) { 3904 int test_ret = 0; 3905 3906 int mem_base; 3907 void * ctx; /* the user data (XML parser context) */ 3908 int n_ctx; 3909 xmlChar * ch; /* a xmlChar string */ 3910 int n_ch; 3911 int len; /* the number of xmlChar */ 3912 int n_len; 3913 3914 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3915 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) { 3916 for (n_len = 0;n_len < gen_nb_int;n_len++) { 3917 mem_base = xmlMemBlocks(); 3918 ctx = gen_void_ptr(n_ctx, 0); 3919 ch = gen_const_xmlChar_ptr(n_ch, 1); 3920 len = gen_int(n_len, 2); 3921 3922 xmlSAX2Characters(ctx, (const xmlChar *)ch, len); 3923 call_tests++; 3924 des_void_ptr(n_ctx, ctx, 0); 3925 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1); 3926 des_int(n_len, len, 2); 3927 xmlResetLastError(); 3928 if (mem_base != xmlMemBlocks()) { 3929 printf("Leak of %d blocks found in xmlSAX2Characters", 3930 xmlMemBlocks() - mem_base); 3931 test_ret++; 3932 printf(" %d", n_ctx); 3933 printf(" %d", n_ch); 3934 printf(" %d", n_len); 3935 printf("\n"); 3936 } 3937 } 3938 } 3939 } 3940 function_tests++; 3941 3942 return(test_ret); 3943 } 3944 3945 3946 static int 3947 test_xmlSAX2Comment(void) { 3948 int test_ret = 0; 3949 3950 int mem_base; 3951 void * ctx; /* the user data (XML parser context) */ 3952 int n_ctx; 3953 xmlChar * value; /* the xmlSAX2Comment content */ 3954 int n_value; 3955 3956 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3957 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 3958 mem_base = xmlMemBlocks(); 3959 ctx = gen_void_ptr(n_ctx, 0); 3960 value = gen_const_xmlChar_ptr(n_value, 1); 3961 3962 xmlSAX2Comment(ctx, (const xmlChar *)value); 3963 call_tests++; 3964 des_void_ptr(n_ctx, ctx, 0); 3965 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 3966 xmlResetLastError(); 3967 if (mem_base != xmlMemBlocks()) { 3968 printf("Leak of %d blocks found in xmlSAX2Comment", 3969 xmlMemBlocks() - mem_base); 3970 test_ret++; 3971 printf(" %d", n_ctx); 3972 printf(" %d", n_value); 3973 printf("\n"); 3974 } 3975 } 3976 } 3977 function_tests++; 3978 3979 return(test_ret); 3980 } 3981 3982 3983 static int 3984 test_xmlSAX2ElementDecl(void) { 3985 int test_ret = 0; 3986 3987 int mem_base; 3988 void * ctx; /* the user data (XML parser context) */ 3989 int n_ctx; 3990 xmlChar * name; /* the element name */ 3991 int n_name; 3992 int type; /* the element type */ 3993 int n_type; 3994 xmlElementContentPtr content; /* the element value tree */ 3995 int n_content; 3996 3997 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 3998 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 3999 for (n_type = 0;n_type < gen_nb_int;n_type++) { 4000 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 4001 mem_base = xmlMemBlocks(); 4002 ctx = gen_void_ptr(n_ctx, 0); 4003 name = gen_const_xmlChar_ptr(n_name, 1); 4004 type = gen_int(n_type, 2); 4005 content = gen_xmlElementContentPtr(n_content, 3); 4006 4007 xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content); 4008 call_tests++; 4009 des_void_ptr(n_ctx, ctx, 0); 4010 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4011 des_int(n_type, type, 2); 4012 des_xmlElementContentPtr(n_content, content, 3); 4013 xmlResetLastError(); 4014 if (mem_base != xmlMemBlocks()) { 4015 printf("Leak of %d blocks found in xmlSAX2ElementDecl", 4016 xmlMemBlocks() - mem_base); 4017 test_ret++; 4018 printf(" %d", n_ctx); 4019 printf(" %d", n_name); 4020 printf(" %d", n_type); 4021 printf(" %d", n_content); 4022 printf("\n"); 4023 } 4024 } 4025 } 4026 } 4027 } 4028 function_tests++; 4029 4030 return(test_ret); 4031 } 4032 4033 4034 static int 4035 test_xmlSAX2EndDocument(void) { 4036 int test_ret = 0; 4037 4038 int mem_base; 4039 void * ctx; /* the user data (XML parser context) */ 4040 int n_ctx; 4041 4042 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4043 mem_base = xmlMemBlocks(); 4044 ctx = gen_void_ptr(n_ctx, 0); 4045 4046 xmlSAX2EndDocument(ctx); 4047 call_tests++; 4048 des_void_ptr(n_ctx, ctx, 0); 4049 xmlResetLastError(); 4050 if (mem_base != xmlMemBlocks()) { 4051 printf("Leak of %d blocks found in xmlSAX2EndDocument", 4052 xmlMemBlocks() - mem_base); 4053 test_ret++; 4054 printf(" %d", n_ctx); 4055 printf("\n"); 4056 } 4057 } 4058 function_tests++; 4059 4060 return(test_ret); 4061 } 4062 4063 4064 static int 4065 test_xmlSAX2EndElement(void) { 4066 int test_ret = 0; 4067 4068 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) 4069 #ifdef LIBXML_SAX1_ENABLED 4070 int mem_base; 4071 void * ctx; /* the user data (XML parser context) */ 4072 int n_ctx; 4073 xmlChar * name; /* The element name */ 4074 int n_name; 4075 4076 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4077 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4078 mem_base = xmlMemBlocks(); 4079 ctx = gen_void_ptr(n_ctx, 0); 4080 name = gen_const_xmlChar_ptr(n_name, 1); 4081 4082 xmlSAX2EndElement(ctx, (const xmlChar *)name); 4083 call_tests++; 4084 des_void_ptr(n_ctx, ctx, 0); 4085 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4086 xmlResetLastError(); 4087 if (mem_base != xmlMemBlocks()) { 4088 printf("Leak of %d blocks found in xmlSAX2EndElement", 4089 xmlMemBlocks() - mem_base); 4090 test_ret++; 4091 printf(" %d", n_ctx); 4092 printf(" %d", n_name); 4093 printf("\n"); 4094 } 4095 } 4096 } 4097 function_tests++; 4098 #endif 4099 #endif 4100 4101 return(test_ret); 4102 } 4103 4104 4105 static int 4106 test_xmlSAX2EndElementNs(void) { 4107 int test_ret = 0; 4108 4109 int mem_base; 4110 void * ctx; /* the user data (XML parser context) */ 4111 int n_ctx; 4112 xmlChar * localname; /* the local name of the element */ 4113 int n_localname; 4114 xmlChar * prefix; /* the element namespace prefix if available */ 4115 int n_prefix; 4116 xmlChar * URI; /* the element namespace name if available */ 4117 int n_URI; 4118 4119 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4120 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) { 4121 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 4122 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 4123 mem_base = xmlMemBlocks(); 4124 ctx = gen_void_ptr(n_ctx, 0); 4125 localname = gen_const_xmlChar_ptr(n_localname, 1); 4126 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 4127 URI = gen_const_xmlChar_ptr(n_URI, 3); 4128 4129 xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI); 4130 call_tests++; 4131 des_void_ptr(n_ctx, ctx, 0); 4132 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1); 4133 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 4134 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3); 4135 xmlResetLastError(); 4136 if (mem_base != xmlMemBlocks()) { 4137 printf("Leak of %d blocks found in xmlSAX2EndElementNs", 4138 xmlMemBlocks() - mem_base); 4139 test_ret++; 4140 printf(" %d", n_ctx); 4141 printf(" %d", n_localname); 4142 printf(" %d", n_prefix); 4143 printf(" %d", n_URI); 4144 printf("\n"); 4145 } 4146 } 4147 } 4148 } 4149 } 4150 function_tests++; 4151 4152 return(test_ret); 4153 } 4154 4155 4156 static int 4157 test_xmlSAX2EntityDecl(void) { 4158 int test_ret = 0; 4159 4160 int mem_base; 4161 void * ctx; /* the user data (XML parser context) */ 4162 int n_ctx; 4163 xmlChar * name; /* the entity name */ 4164 int n_name; 4165 int type; /* the entity type */ 4166 int n_type; 4167 xmlChar * publicId; /* The public ID of the entity */ 4168 int n_publicId; 4169 xmlChar * systemId; /* The system ID of the entity */ 4170 int n_systemId; 4171 xmlChar * content; /* the entity value (without processing). */ 4172 int n_content; 4173 4174 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4175 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4176 for (n_type = 0;n_type < gen_nb_int;n_type++) { 4177 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 4178 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 4179 for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) { 4180 mem_base = xmlMemBlocks(); 4181 ctx = gen_void_ptr(n_ctx, 0); 4182 name = gen_const_xmlChar_ptr(n_name, 1); 4183 type = gen_int(n_type, 2); 4184 publicId = gen_const_xmlChar_ptr(n_publicId, 3); 4185 systemId = gen_const_xmlChar_ptr(n_systemId, 4); 4186 content = gen_xmlChar_ptr(n_content, 5); 4187 4188 xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content); 4189 call_tests++; 4190 des_void_ptr(n_ctx, ctx, 0); 4191 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4192 des_int(n_type, type, 2); 4193 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3); 4194 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4); 4195 des_xmlChar_ptr(n_content, content, 5); 4196 xmlResetLastError(); 4197 if (mem_base != xmlMemBlocks()) { 4198 printf("Leak of %d blocks found in xmlSAX2EntityDecl", 4199 xmlMemBlocks() - mem_base); 4200 test_ret++; 4201 printf(" %d", n_ctx); 4202 printf(" %d", n_name); 4203 printf(" %d", n_type); 4204 printf(" %d", n_publicId); 4205 printf(" %d", n_systemId); 4206 printf(" %d", n_content); 4207 printf("\n"); 4208 } 4209 } 4210 } 4211 } 4212 } 4213 } 4214 } 4215 function_tests++; 4216 4217 return(test_ret); 4218 } 4219 4220 4221 static int 4222 test_xmlSAX2ExternalSubset(void) { 4223 int test_ret = 0; 4224 4225 int mem_base; 4226 void * ctx; /* the user data (XML parser context) */ 4227 int n_ctx; 4228 xmlChar * name; /* the root element name */ 4229 int n_name; 4230 xmlChar * ExternalID; /* the external ID */ 4231 int n_ExternalID; 4232 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */ 4233 int n_SystemID; 4234 4235 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4236 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4237 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 4238 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 4239 mem_base = xmlMemBlocks(); 4240 ctx = gen_void_ptr(n_ctx, 0); 4241 name = gen_const_xmlChar_ptr(n_name, 1); 4242 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 4243 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 4244 4245 xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 4246 call_tests++; 4247 des_void_ptr(n_ctx, ctx, 0); 4248 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4249 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 4250 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 4251 xmlResetLastError(); 4252 if (mem_base != xmlMemBlocks()) { 4253 printf("Leak of %d blocks found in xmlSAX2ExternalSubset", 4254 xmlMemBlocks() - mem_base); 4255 test_ret++; 4256 printf(" %d", n_ctx); 4257 printf(" %d", n_name); 4258 printf(" %d", n_ExternalID); 4259 printf(" %d", n_SystemID); 4260 printf("\n"); 4261 } 4262 } 4263 } 4264 } 4265 } 4266 function_tests++; 4267 4268 return(test_ret); 4269 } 4270 4271 4272 static int 4273 test_xmlSAX2GetColumnNumber(void) { 4274 int test_ret = 0; 4275 4276 int mem_base; 4277 int ret_val; 4278 void * ctx; /* the user data (XML parser context) */ 4279 int n_ctx; 4280 4281 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4282 mem_base = xmlMemBlocks(); 4283 ctx = gen_void_ptr(n_ctx, 0); 4284 4285 ret_val = xmlSAX2GetColumnNumber(ctx); 4286 desret_int(ret_val); 4287 call_tests++; 4288 des_void_ptr(n_ctx, ctx, 0); 4289 xmlResetLastError(); 4290 if (mem_base != xmlMemBlocks()) { 4291 printf("Leak of %d blocks found in xmlSAX2GetColumnNumber", 4292 xmlMemBlocks() - mem_base); 4293 test_ret++; 4294 printf(" %d", n_ctx); 4295 printf("\n"); 4296 } 4297 } 4298 function_tests++; 4299 4300 return(test_ret); 4301 } 4302 4303 4304 static int 4305 test_xmlSAX2GetEntity(void) { 4306 int test_ret = 0; 4307 4308 int mem_base; 4309 xmlEntityPtr ret_val; 4310 void * ctx; /* the user data (XML parser context) */ 4311 int n_ctx; 4312 xmlChar * name; /* The entity name */ 4313 int n_name; 4314 4315 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4316 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4317 mem_base = xmlMemBlocks(); 4318 ctx = gen_void_ptr(n_ctx, 0); 4319 name = gen_const_xmlChar_ptr(n_name, 1); 4320 4321 ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name); 4322 desret_xmlEntityPtr(ret_val); 4323 call_tests++; 4324 des_void_ptr(n_ctx, ctx, 0); 4325 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4326 xmlResetLastError(); 4327 if (mem_base != xmlMemBlocks()) { 4328 printf("Leak of %d blocks found in xmlSAX2GetEntity", 4329 xmlMemBlocks() - mem_base); 4330 test_ret++; 4331 printf(" %d", n_ctx); 4332 printf(" %d", n_name); 4333 printf("\n"); 4334 } 4335 } 4336 } 4337 function_tests++; 4338 4339 return(test_ret); 4340 } 4341 4342 4343 static int 4344 test_xmlSAX2GetLineNumber(void) { 4345 int test_ret = 0; 4346 4347 int mem_base; 4348 int ret_val; 4349 void * ctx; /* the user data (XML parser context) */ 4350 int n_ctx; 4351 4352 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4353 mem_base = xmlMemBlocks(); 4354 ctx = gen_void_ptr(n_ctx, 0); 4355 4356 ret_val = xmlSAX2GetLineNumber(ctx); 4357 desret_int(ret_val); 4358 call_tests++; 4359 des_void_ptr(n_ctx, ctx, 0); 4360 xmlResetLastError(); 4361 if (mem_base != xmlMemBlocks()) { 4362 printf("Leak of %d blocks found in xmlSAX2GetLineNumber", 4363 xmlMemBlocks() - mem_base); 4364 test_ret++; 4365 printf(" %d", n_ctx); 4366 printf("\n"); 4367 } 4368 } 4369 function_tests++; 4370 4371 return(test_ret); 4372 } 4373 4374 4375 static int 4376 test_xmlSAX2GetParameterEntity(void) { 4377 int test_ret = 0; 4378 4379 int mem_base; 4380 xmlEntityPtr ret_val; 4381 void * ctx; /* the user data (XML parser context) */ 4382 int n_ctx; 4383 xmlChar * name; /* The entity name */ 4384 int n_name; 4385 4386 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4387 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4388 mem_base = xmlMemBlocks(); 4389 ctx = gen_void_ptr(n_ctx, 0); 4390 name = gen_const_xmlChar_ptr(n_name, 1); 4391 4392 ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name); 4393 desret_xmlEntityPtr(ret_val); 4394 call_tests++; 4395 des_void_ptr(n_ctx, ctx, 0); 4396 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4397 xmlResetLastError(); 4398 if (mem_base != xmlMemBlocks()) { 4399 printf("Leak of %d blocks found in xmlSAX2GetParameterEntity", 4400 xmlMemBlocks() - mem_base); 4401 test_ret++; 4402 printf(" %d", n_ctx); 4403 printf(" %d", n_name); 4404 printf("\n"); 4405 } 4406 } 4407 } 4408 function_tests++; 4409 4410 return(test_ret); 4411 } 4412 4413 4414 static int 4415 test_xmlSAX2GetPublicId(void) { 4416 int test_ret = 0; 4417 4418 int mem_base; 4419 const xmlChar * ret_val; 4420 void * ctx; /* the user data (XML parser context) */ 4421 int n_ctx; 4422 4423 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4424 mem_base = xmlMemBlocks(); 4425 ctx = gen_void_ptr(n_ctx, 0); 4426 4427 ret_val = xmlSAX2GetPublicId(ctx); 4428 desret_const_xmlChar_ptr(ret_val); 4429 call_tests++; 4430 des_void_ptr(n_ctx, ctx, 0); 4431 xmlResetLastError(); 4432 if (mem_base != xmlMemBlocks()) { 4433 printf("Leak of %d blocks found in xmlSAX2GetPublicId", 4434 xmlMemBlocks() - mem_base); 4435 test_ret++; 4436 printf(" %d", n_ctx); 4437 printf("\n"); 4438 } 4439 } 4440 function_tests++; 4441 4442 return(test_ret); 4443 } 4444 4445 4446 static int 4447 test_xmlSAX2GetSystemId(void) { 4448 int test_ret = 0; 4449 4450 int mem_base; 4451 const xmlChar * ret_val; 4452 void * ctx; /* the user data (XML parser context) */ 4453 int n_ctx; 4454 4455 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4456 mem_base = xmlMemBlocks(); 4457 ctx = gen_void_ptr(n_ctx, 0); 4458 4459 ret_val = xmlSAX2GetSystemId(ctx); 4460 desret_const_xmlChar_ptr(ret_val); 4461 call_tests++; 4462 des_void_ptr(n_ctx, ctx, 0); 4463 xmlResetLastError(); 4464 if (mem_base != xmlMemBlocks()) { 4465 printf("Leak of %d blocks found in xmlSAX2GetSystemId", 4466 xmlMemBlocks() - mem_base); 4467 test_ret++; 4468 printf(" %d", n_ctx); 4469 printf("\n"); 4470 } 4471 } 4472 function_tests++; 4473 4474 return(test_ret); 4475 } 4476 4477 4478 static int 4479 test_xmlSAX2HasExternalSubset(void) { 4480 int test_ret = 0; 4481 4482 int mem_base; 4483 int ret_val; 4484 void * ctx; /* the user data (XML parser context) */ 4485 int n_ctx; 4486 4487 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4488 mem_base = xmlMemBlocks(); 4489 ctx = gen_void_ptr(n_ctx, 0); 4490 4491 ret_val = xmlSAX2HasExternalSubset(ctx); 4492 desret_int(ret_val); 4493 call_tests++; 4494 des_void_ptr(n_ctx, ctx, 0); 4495 xmlResetLastError(); 4496 if (mem_base != xmlMemBlocks()) { 4497 printf("Leak of %d blocks found in xmlSAX2HasExternalSubset", 4498 xmlMemBlocks() - mem_base); 4499 test_ret++; 4500 printf(" %d", n_ctx); 4501 printf("\n"); 4502 } 4503 } 4504 function_tests++; 4505 4506 return(test_ret); 4507 } 4508 4509 4510 static int 4511 test_xmlSAX2HasInternalSubset(void) { 4512 int test_ret = 0; 4513 4514 int mem_base; 4515 int ret_val; 4516 void * ctx; /* the user data (XML parser context) */ 4517 int n_ctx; 4518 4519 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4520 mem_base = xmlMemBlocks(); 4521 ctx = gen_void_ptr(n_ctx, 0); 4522 4523 ret_val = xmlSAX2HasInternalSubset(ctx); 4524 desret_int(ret_val); 4525 call_tests++; 4526 des_void_ptr(n_ctx, ctx, 0); 4527 xmlResetLastError(); 4528 if (mem_base != xmlMemBlocks()) { 4529 printf("Leak of %d blocks found in xmlSAX2HasInternalSubset", 4530 xmlMemBlocks() - mem_base); 4531 test_ret++; 4532 printf(" %d", n_ctx); 4533 printf("\n"); 4534 } 4535 } 4536 function_tests++; 4537 4538 return(test_ret); 4539 } 4540 4541 4542 static int 4543 test_xmlSAX2IgnorableWhitespace(void) { 4544 int test_ret = 0; 4545 4546 int mem_base; 4547 void * ctx; /* the user data (XML parser context) */ 4548 int n_ctx; 4549 xmlChar * ch; /* a xmlChar string */ 4550 int n_ch; 4551 int len; /* the number of xmlChar */ 4552 int n_len; 4553 4554 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4555 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) { 4556 for (n_len = 0;n_len < gen_nb_int;n_len++) { 4557 mem_base = xmlMemBlocks(); 4558 ctx = gen_void_ptr(n_ctx, 0); 4559 ch = gen_const_xmlChar_ptr(n_ch, 1); 4560 len = gen_int(n_len, 2); 4561 4562 xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len); 4563 call_tests++; 4564 des_void_ptr(n_ctx, ctx, 0); 4565 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1); 4566 des_int(n_len, len, 2); 4567 xmlResetLastError(); 4568 if (mem_base != xmlMemBlocks()) { 4569 printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace", 4570 xmlMemBlocks() - mem_base); 4571 test_ret++; 4572 printf(" %d", n_ctx); 4573 printf(" %d", n_ch); 4574 printf(" %d", n_len); 4575 printf("\n"); 4576 } 4577 } 4578 } 4579 } 4580 function_tests++; 4581 4582 return(test_ret); 4583 } 4584 4585 4586 #define gen_nb_xmlSAXHandler_ptr 1 4587 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4588 return(NULL); 4589 } 4590 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4591 } 4592 4593 static int 4594 test_xmlSAX2InitDefaultSAXHandler(void) { 4595 int test_ret = 0; 4596 4597 int mem_base; 4598 xmlSAXHandler * hdlr; /* the SAX handler */ 4599 int n_hdlr; 4600 int warning; /* flag if non-zero sets the handler warning procedure */ 4601 int n_warning; 4602 4603 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 4604 for (n_warning = 0;n_warning < gen_nb_int;n_warning++) { 4605 mem_base = xmlMemBlocks(); 4606 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 4607 warning = gen_int(n_warning, 1); 4608 4609 xmlSAX2InitDefaultSAXHandler(hdlr, warning); 4610 call_tests++; 4611 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 4612 des_int(n_warning, warning, 1); 4613 xmlResetLastError(); 4614 if (mem_base != xmlMemBlocks()) { 4615 printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler", 4616 xmlMemBlocks() - mem_base); 4617 test_ret++; 4618 printf(" %d", n_hdlr); 4619 printf(" %d", n_warning); 4620 printf("\n"); 4621 } 4622 } 4623 } 4624 function_tests++; 4625 4626 return(test_ret); 4627 } 4628 4629 4630 static int 4631 test_xmlSAX2InitDocbDefaultSAXHandler(void) { 4632 int test_ret = 0; 4633 4634 #if defined(LIBXML_DOCB_ENABLED) 4635 int mem_base; 4636 xmlSAXHandler * hdlr; /* the SAX handler */ 4637 int n_hdlr; 4638 4639 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 4640 mem_base = xmlMemBlocks(); 4641 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 4642 4643 xmlSAX2InitDocbDefaultSAXHandler(hdlr); 4644 call_tests++; 4645 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 4646 xmlResetLastError(); 4647 if (mem_base != xmlMemBlocks()) { 4648 printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler", 4649 xmlMemBlocks() - mem_base); 4650 test_ret++; 4651 printf(" %d", n_hdlr); 4652 printf("\n"); 4653 } 4654 } 4655 function_tests++; 4656 #endif 4657 4658 return(test_ret); 4659 } 4660 4661 4662 static int 4663 test_xmlSAX2InitHtmlDefaultSAXHandler(void) { 4664 int test_ret = 0; 4665 4666 #if defined(LIBXML_HTML_ENABLED) 4667 int mem_base; 4668 xmlSAXHandler * hdlr; /* the SAX handler */ 4669 int n_hdlr; 4670 4671 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 4672 mem_base = xmlMemBlocks(); 4673 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 4674 4675 xmlSAX2InitHtmlDefaultSAXHandler(hdlr); 4676 call_tests++; 4677 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 4678 xmlResetLastError(); 4679 if (mem_base != xmlMemBlocks()) { 4680 printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler", 4681 xmlMemBlocks() - mem_base); 4682 test_ret++; 4683 printf(" %d", n_hdlr); 4684 printf("\n"); 4685 } 4686 } 4687 function_tests++; 4688 #endif 4689 4690 return(test_ret); 4691 } 4692 4693 4694 static int 4695 test_xmlSAX2InternalSubset(void) { 4696 int test_ret = 0; 4697 4698 int mem_base; 4699 void * ctx; /* the user data (XML parser context) */ 4700 int n_ctx; 4701 xmlChar * name; /* the root element name */ 4702 int n_name; 4703 xmlChar * ExternalID; /* the external ID */ 4704 int n_ExternalID; 4705 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */ 4706 int n_SystemID; 4707 4708 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4709 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4710 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 4711 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 4712 mem_base = xmlMemBlocks(); 4713 ctx = gen_void_ptr(n_ctx, 0); 4714 name = gen_const_xmlChar_ptr(n_name, 1); 4715 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 4716 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 4717 4718 xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 4719 call_tests++; 4720 des_void_ptr(n_ctx, ctx, 0); 4721 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4722 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 4723 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 4724 xmlResetLastError(); 4725 if (mem_base != xmlMemBlocks()) { 4726 printf("Leak of %d blocks found in xmlSAX2InternalSubset", 4727 xmlMemBlocks() - mem_base); 4728 test_ret++; 4729 printf(" %d", n_ctx); 4730 printf(" %d", n_name); 4731 printf(" %d", n_ExternalID); 4732 printf(" %d", n_SystemID); 4733 printf("\n"); 4734 } 4735 } 4736 } 4737 } 4738 } 4739 function_tests++; 4740 4741 return(test_ret); 4742 } 4743 4744 4745 static int 4746 test_xmlSAX2IsStandalone(void) { 4747 int test_ret = 0; 4748 4749 int mem_base; 4750 int ret_val; 4751 void * ctx; /* the user data (XML parser context) */ 4752 int n_ctx; 4753 4754 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4755 mem_base = xmlMemBlocks(); 4756 ctx = gen_void_ptr(n_ctx, 0); 4757 4758 ret_val = xmlSAX2IsStandalone(ctx); 4759 desret_int(ret_val); 4760 call_tests++; 4761 des_void_ptr(n_ctx, ctx, 0); 4762 xmlResetLastError(); 4763 if (mem_base != xmlMemBlocks()) { 4764 printf("Leak of %d blocks found in xmlSAX2IsStandalone", 4765 xmlMemBlocks() - mem_base); 4766 test_ret++; 4767 printf(" %d", n_ctx); 4768 printf("\n"); 4769 } 4770 } 4771 function_tests++; 4772 4773 return(test_ret); 4774 } 4775 4776 4777 static int 4778 test_xmlSAX2NotationDecl(void) { 4779 int test_ret = 0; 4780 4781 int mem_base; 4782 void * ctx; /* the user data (XML parser context) */ 4783 int n_ctx; 4784 xmlChar * name; /* The name of the notation */ 4785 int n_name; 4786 xmlChar * publicId; /* The public ID of the entity */ 4787 int n_publicId; 4788 xmlChar * systemId; /* The system ID of the entity */ 4789 int n_systemId; 4790 4791 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4792 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4793 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 4794 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 4795 mem_base = xmlMemBlocks(); 4796 ctx = gen_void_ptr(n_ctx, 0); 4797 name = gen_const_xmlChar_ptr(n_name, 1); 4798 publicId = gen_const_xmlChar_ptr(n_publicId, 2); 4799 systemId = gen_const_xmlChar_ptr(n_systemId, 3); 4800 4801 xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId); 4802 call_tests++; 4803 des_void_ptr(n_ctx, ctx, 0); 4804 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4805 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2); 4806 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3); 4807 xmlResetLastError(); 4808 if (mem_base != xmlMemBlocks()) { 4809 printf("Leak of %d blocks found in xmlSAX2NotationDecl", 4810 xmlMemBlocks() - mem_base); 4811 test_ret++; 4812 printf(" %d", n_ctx); 4813 printf(" %d", n_name); 4814 printf(" %d", n_publicId); 4815 printf(" %d", n_systemId); 4816 printf("\n"); 4817 } 4818 } 4819 } 4820 } 4821 } 4822 function_tests++; 4823 4824 return(test_ret); 4825 } 4826 4827 4828 static int 4829 test_xmlSAX2ProcessingInstruction(void) { 4830 int test_ret = 0; 4831 4832 int mem_base; 4833 void * ctx; /* the user data (XML parser context) */ 4834 int n_ctx; 4835 xmlChar * target; /* the target name */ 4836 int n_target; 4837 xmlChar * data; /* the PI data's */ 4838 int n_data; 4839 4840 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4841 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { 4842 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { 4843 mem_base = xmlMemBlocks(); 4844 ctx = gen_void_ptr(n_ctx, 0); 4845 target = gen_const_xmlChar_ptr(n_target, 1); 4846 data = gen_const_xmlChar_ptr(n_data, 2); 4847 4848 xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data); 4849 call_tests++; 4850 des_void_ptr(n_ctx, ctx, 0); 4851 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1); 4852 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2); 4853 xmlResetLastError(); 4854 if (mem_base != xmlMemBlocks()) { 4855 printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction", 4856 xmlMemBlocks() - mem_base); 4857 test_ret++; 4858 printf(" %d", n_ctx); 4859 printf(" %d", n_target); 4860 printf(" %d", n_data); 4861 printf("\n"); 4862 } 4863 } 4864 } 4865 } 4866 function_tests++; 4867 4868 return(test_ret); 4869 } 4870 4871 4872 static int 4873 test_xmlSAX2Reference(void) { 4874 int test_ret = 0; 4875 4876 int mem_base; 4877 void * ctx; /* the user data (XML parser context) */ 4878 int n_ctx; 4879 xmlChar * name; /* The entity name */ 4880 int n_name; 4881 4882 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4883 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 4884 mem_base = xmlMemBlocks(); 4885 ctx = gen_void_ptr(n_ctx, 0); 4886 name = gen_const_xmlChar_ptr(n_name, 1); 4887 4888 xmlSAX2Reference(ctx, (const xmlChar *)name); 4889 call_tests++; 4890 des_void_ptr(n_ctx, ctx, 0); 4891 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 4892 xmlResetLastError(); 4893 if (mem_base != xmlMemBlocks()) { 4894 printf("Leak of %d blocks found in xmlSAX2Reference", 4895 xmlMemBlocks() - mem_base); 4896 test_ret++; 4897 printf(" %d", n_ctx); 4898 printf(" %d", n_name); 4899 printf("\n"); 4900 } 4901 } 4902 } 4903 function_tests++; 4904 4905 return(test_ret); 4906 } 4907 4908 4909 static int 4910 test_xmlSAX2ResolveEntity(void) { 4911 int test_ret = 0; 4912 4913 int mem_base; 4914 xmlParserInputPtr ret_val; 4915 void * ctx; /* the user data (XML parser context) */ 4916 int n_ctx; 4917 xmlChar * publicId; /* The public ID of the entity */ 4918 int n_publicId; 4919 xmlChar * systemId; /* The system ID of the entity */ 4920 int n_systemId; 4921 4922 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4923 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 4924 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 4925 mem_base = xmlMemBlocks(); 4926 ctx = gen_void_ptr(n_ctx, 0); 4927 publicId = gen_const_xmlChar_ptr(n_publicId, 1); 4928 systemId = gen_const_xmlChar_ptr(n_systemId, 2); 4929 4930 ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId); 4931 desret_xmlParserInputPtr(ret_val); 4932 call_tests++; 4933 des_void_ptr(n_ctx, ctx, 0); 4934 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1); 4935 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2); 4936 xmlResetLastError(); 4937 if (mem_base != xmlMemBlocks()) { 4938 printf("Leak of %d blocks found in xmlSAX2ResolveEntity", 4939 xmlMemBlocks() - mem_base); 4940 test_ret++; 4941 printf(" %d", n_ctx); 4942 printf(" %d", n_publicId); 4943 printf(" %d", n_systemId); 4944 printf("\n"); 4945 } 4946 } 4947 } 4948 } 4949 function_tests++; 4950 4951 return(test_ret); 4952 } 4953 4954 4955 #define gen_nb_xmlSAXLocatorPtr 1 4956 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4957 return(NULL); 4958 } 4959 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 4960 } 4961 4962 static int 4963 test_xmlSAX2SetDocumentLocator(void) { 4964 int test_ret = 0; 4965 4966 int mem_base; 4967 void * ctx; /* the user data (XML parser context) */ 4968 int n_ctx; 4969 xmlSAXLocatorPtr loc; /* A SAX Locator */ 4970 int n_loc; 4971 4972 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 4973 for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) { 4974 mem_base = xmlMemBlocks(); 4975 ctx = gen_void_ptr(n_ctx, 0); 4976 loc = gen_xmlSAXLocatorPtr(n_loc, 1); 4977 4978 xmlSAX2SetDocumentLocator(ctx, loc); 4979 call_tests++; 4980 des_void_ptr(n_ctx, ctx, 0); 4981 des_xmlSAXLocatorPtr(n_loc, loc, 1); 4982 xmlResetLastError(); 4983 if (mem_base != xmlMemBlocks()) { 4984 printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator", 4985 xmlMemBlocks() - mem_base); 4986 test_ret++; 4987 printf(" %d", n_ctx); 4988 printf(" %d", n_loc); 4989 printf("\n"); 4990 } 4991 } 4992 } 4993 function_tests++; 4994 4995 return(test_ret); 4996 } 4997 4998 4999 static int 5000 test_xmlSAX2StartDocument(void) { 5001 int test_ret = 0; 5002 5003 int mem_base; 5004 void * ctx; /* the user data (XML parser context) */ 5005 int n_ctx; 5006 5007 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5008 mem_base = xmlMemBlocks(); 5009 ctx = gen_void_ptr(n_ctx, 0); 5010 5011 xmlSAX2StartDocument(ctx); 5012 call_tests++; 5013 des_void_ptr(n_ctx, ctx, 0); 5014 xmlResetLastError(); 5015 if (mem_base != xmlMemBlocks()) { 5016 printf("Leak of %d blocks found in xmlSAX2StartDocument", 5017 xmlMemBlocks() - mem_base); 5018 test_ret++; 5019 printf(" %d", n_ctx); 5020 printf("\n"); 5021 } 5022 } 5023 function_tests++; 5024 5025 return(test_ret); 5026 } 5027 5028 5029 static int 5030 test_xmlSAX2StartElement(void) { 5031 int test_ret = 0; 5032 5033 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) 5034 #ifdef LIBXML_SAX1_ENABLED 5035 int mem_base; 5036 void * ctx; /* the user data (XML parser context) */ 5037 int n_ctx; 5038 xmlChar * fullname; /* The element name, including namespace prefix */ 5039 int n_fullname; 5040 xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */ 5041 int n_atts; 5042 5043 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5044 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) { 5045 for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) { 5046 mem_base = xmlMemBlocks(); 5047 ctx = gen_void_ptr(n_ctx, 0); 5048 fullname = gen_const_xmlChar_ptr(n_fullname, 1); 5049 atts = gen_const_xmlChar_ptr_ptr(n_atts, 2); 5050 5051 xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts); 5052 call_tests++; 5053 des_void_ptr(n_ctx, ctx, 0); 5054 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1); 5055 des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2); 5056 xmlResetLastError(); 5057 if (mem_base != xmlMemBlocks()) { 5058 printf("Leak of %d blocks found in xmlSAX2StartElement", 5059 xmlMemBlocks() - mem_base); 5060 test_ret++; 5061 printf(" %d", n_ctx); 5062 printf(" %d", n_fullname); 5063 printf(" %d", n_atts); 5064 printf("\n"); 5065 } 5066 } 5067 } 5068 } 5069 function_tests++; 5070 #endif 5071 #endif 5072 5073 return(test_ret); 5074 } 5075 5076 5077 static int 5078 test_xmlSAX2StartElementNs(void) { 5079 int test_ret = 0; 5080 5081 int mem_base; 5082 void * ctx; /* the user data (XML parser context) */ 5083 int n_ctx; 5084 xmlChar * localname; /* the local name of the element */ 5085 int n_localname; 5086 xmlChar * prefix; /* the element namespace prefix if available */ 5087 int n_prefix; 5088 xmlChar * URI; /* the element namespace name if available */ 5089 int n_URI; 5090 int nb_namespaces; /* number of namespace definitions on that node */ 5091 int n_nb_namespaces; 5092 xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */ 5093 int n_namespaces; 5094 int nb_attributes; /* the number of attributes on that node */ 5095 int n_nb_attributes; 5096 int nb_defaulted; /* the number of defaulted attributes. */ 5097 int n_nb_defaulted; 5098 xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */ 5099 int n_attributes; 5100 5101 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5102 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) { 5103 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 5104 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 5105 for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) { 5106 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) { 5107 for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) { 5108 for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) { 5109 for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) { 5110 mem_base = xmlMemBlocks(); 5111 ctx = gen_void_ptr(n_ctx, 0); 5112 localname = gen_const_xmlChar_ptr(n_localname, 1); 5113 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 5114 URI = gen_const_xmlChar_ptr(n_URI, 3); 5115 nb_namespaces = gen_int(n_nb_namespaces, 4); 5116 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5); 5117 nb_attributes = gen_int(n_nb_attributes, 6); 5118 nb_defaulted = gen_int(n_nb_defaulted, 7); 5119 attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8); 5120 5121 xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes); 5122 call_tests++; 5123 des_void_ptr(n_ctx, ctx, 0); 5124 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1); 5125 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 5126 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3); 5127 des_int(n_nb_namespaces, nb_namespaces, 4); 5128 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5); 5129 des_int(n_nb_attributes, nb_attributes, 6); 5130 des_int(n_nb_defaulted, nb_defaulted, 7); 5131 des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8); 5132 xmlResetLastError(); 5133 if (mem_base != xmlMemBlocks()) { 5134 printf("Leak of %d blocks found in xmlSAX2StartElementNs", 5135 xmlMemBlocks() - mem_base); 5136 test_ret++; 5137 printf(" %d", n_ctx); 5138 printf(" %d", n_localname); 5139 printf(" %d", n_prefix); 5140 printf(" %d", n_URI); 5141 printf(" %d", n_nb_namespaces); 5142 printf(" %d", n_namespaces); 5143 printf(" %d", n_nb_attributes); 5144 printf(" %d", n_nb_defaulted); 5145 printf(" %d", n_attributes); 5146 printf("\n"); 5147 } 5148 } 5149 } 5150 } 5151 } 5152 } 5153 } 5154 } 5155 } 5156 } 5157 function_tests++; 5158 5159 return(test_ret); 5160 } 5161 5162 5163 static int 5164 test_xmlSAX2UnparsedEntityDecl(void) { 5165 int test_ret = 0; 5166 5167 int mem_base; 5168 void * ctx; /* the user data (XML parser context) */ 5169 int n_ctx; 5170 xmlChar * name; /* The name of the entity */ 5171 int n_name; 5172 xmlChar * publicId; /* The public ID of the entity */ 5173 int n_publicId; 5174 xmlChar * systemId; /* The system ID of the entity */ 5175 int n_systemId; 5176 xmlChar * notationName; /* the name of the notation */ 5177 int n_notationName; 5178 5179 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 5180 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 5181 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { 5182 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { 5183 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { 5184 mem_base = xmlMemBlocks(); 5185 ctx = gen_void_ptr(n_ctx, 0); 5186 name = gen_const_xmlChar_ptr(n_name, 1); 5187 publicId = gen_const_xmlChar_ptr(n_publicId, 2); 5188 systemId = gen_const_xmlChar_ptr(n_systemId, 3); 5189 notationName = gen_const_xmlChar_ptr(n_notationName, 4); 5190 5191 xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName); 5192 call_tests++; 5193 des_void_ptr(n_ctx, ctx, 0); 5194 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 5195 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2); 5196 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3); 5197 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4); 5198 xmlResetLastError(); 5199 if (mem_base != xmlMemBlocks()) { 5200 printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl", 5201 xmlMemBlocks() - mem_base); 5202 test_ret++; 5203 printf(" %d", n_ctx); 5204 printf(" %d", n_name); 5205 printf(" %d", n_publicId); 5206 printf(" %d", n_systemId); 5207 printf(" %d", n_notationName); 5208 printf("\n"); 5209 } 5210 } 5211 } 5212 } 5213 } 5214 } 5215 function_tests++; 5216 5217 return(test_ret); 5218 } 5219 5220 5221 static int 5222 test_xmlSAXDefaultVersion(void) { 5223 int test_ret = 0; 5224 5225 #if defined(LIBXML_SAX1_ENABLED) 5226 #ifdef LIBXML_SAX1_ENABLED 5227 int mem_base; 5228 int ret_val; 5229 int version; /* the version, 1 or 2 */ 5230 int n_version; 5231 5232 for (n_version = 0;n_version < gen_nb_int;n_version++) { 5233 mem_base = xmlMemBlocks(); 5234 version = gen_int(n_version, 0); 5235 5236 ret_val = xmlSAXDefaultVersion(version); 5237 desret_int(ret_val); 5238 call_tests++; 5239 des_int(n_version, version, 0); 5240 xmlResetLastError(); 5241 if (mem_base != xmlMemBlocks()) { 5242 printf("Leak of %d blocks found in xmlSAXDefaultVersion", 5243 xmlMemBlocks() - mem_base); 5244 test_ret++; 5245 printf(" %d", n_version); 5246 printf("\n"); 5247 } 5248 } 5249 function_tests++; 5250 #endif 5251 #endif 5252 5253 return(test_ret); 5254 } 5255 5256 5257 static int 5258 test_xmlSAXVersion(void) { 5259 int test_ret = 0; 5260 5261 int mem_base; 5262 int ret_val; 5263 xmlSAXHandler * hdlr; /* the SAX handler */ 5264 int n_hdlr; 5265 int version; /* the version, 1 or 2 */ 5266 int n_version; 5267 5268 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { 5269 for (n_version = 0;n_version < gen_nb_int;n_version++) { 5270 mem_base = xmlMemBlocks(); 5271 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); 5272 version = gen_int(n_version, 1); 5273 5274 ret_val = xmlSAXVersion(hdlr, version); 5275 desret_int(ret_val); 5276 call_tests++; 5277 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); 5278 des_int(n_version, version, 1); 5279 xmlResetLastError(); 5280 if (mem_base != xmlMemBlocks()) { 5281 printf("Leak of %d blocks found in xmlSAXVersion", 5282 xmlMemBlocks() - mem_base); 5283 test_ret++; 5284 printf(" %d", n_hdlr); 5285 printf(" %d", n_version); 5286 printf("\n"); 5287 } 5288 } 5289 } 5290 function_tests++; 5291 5292 return(test_ret); 5293 } 5294 5295 static int 5296 test_SAX2(void) { 5297 int test_ret = 0; 5298 5299 if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n"); 5300 test_ret += test_docbDefaultSAXHandlerInit(); 5301 test_ret += test_htmlDefaultSAXHandlerInit(); 5302 test_ret += test_xmlDefaultSAXHandlerInit(); 5303 test_ret += test_xmlSAX2AttributeDecl(); 5304 test_ret += test_xmlSAX2CDataBlock(); 5305 test_ret += test_xmlSAX2Characters(); 5306 test_ret += test_xmlSAX2Comment(); 5307 test_ret += test_xmlSAX2ElementDecl(); 5308 test_ret += test_xmlSAX2EndDocument(); 5309 test_ret += test_xmlSAX2EndElement(); 5310 test_ret += test_xmlSAX2EndElementNs(); 5311 test_ret += test_xmlSAX2EntityDecl(); 5312 test_ret += test_xmlSAX2ExternalSubset(); 5313 test_ret += test_xmlSAX2GetColumnNumber(); 5314 test_ret += test_xmlSAX2GetEntity(); 5315 test_ret += test_xmlSAX2GetLineNumber(); 5316 test_ret += test_xmlSAX2GetParameterEntity(); 5317 test_ret += test_xmlSAX2GetPublicId(); 5318 test_ret += test_xmlSAX2GetSystemId(); 5319 test_ret += test_xmlSAX2HasExternalSubset(); 5320 test_ret += test_xmlSAX2HasInternalSubset(); 5321 test_ret += test_xmlSAX2IgnorableWhitespace(); 5322 test_ret += test_xmlSAX2InitDefaultSAXHandler(); 5323 test_ret += test_xmlSAX2InitDocbDefaultSAXHandler(); 5324 test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler(); 5325 test_ret += test_xmlSAX2InternalSubset(); 5326 test_ret += test_xmlSAX2IsStandalone(); 5327 test_ret += test_xmlSAX2NotationDecl(); 5328 test_ret += test_xmlSAX2ProcessingInstruction(); 5329 test_ret += test_xmlSAX2Reference(); 5330 test_ret += test_xmlSAX2ResolveEntity(); 5331 test_ret += test_xmlSAX2SetDocumentLocator(); 5332 test_ret += test_xmlSAX2StartDocument(); 5333 test_ret += test_xmlSAX2StartElement(); 5334 test_ret += test_xmlSAX2StartElementNs(); 5335 test_ret += test_xmlSAX2UnparsedEntityDecl(); 5336 test_ret += test_xmlSAXDefaultVersion(); 5337 test_ret += test_xmlSAXVersion(); 5338 5339 if (test_ret != 0) 5340 printf("Module SAX2: %d errors\n", test_ret); 5341 return(test_ret); 5342 } 5343 5344 static int 5345 test_xmlC14NDocDumpMemory(void) { 5346 int test_ret = 0; 5347 5348 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5349 int mem_base; 5350 int ret_val; 5351 xmlDocPtr doc; /* the XML document for canonization */ 5352 int n_doc; 5353 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ 5354 int n_nodes; 5355 int mode; /* the c14n mode (see @xmlC14NMode) */ 5356 int n_mode; 5357 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) */ 5358 int n_inclusive_ns_prefixes; 5359 int with_comments; /* include comments in the result (!=0) or not (==0) */ 5360 int n_with_comments; 5361 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 */ 5362 int n_doc_txt_ptr; 5363 5364 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 5365 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { 5366 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 5367 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { 5368 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { 5369 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { 5370 mem_base = xmlMemBlocks(); 5371 doc = gen_xmlDocPtr(n_doc, 0); 5372 nodes = gen_xmlNodeSetPtr(n_nodes, 1); 5373 mode = gen_int(n_mode, 2); 5374 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); 5375 with_comments = gen_int(n_with_comments, 4); 5376 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5); 5377 5378 ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr); 5379 desret_int(ret_val); 5380 call_tests++; 5381 des_xmlDocPtr(n_doc, doc, 0); 5382 des_xmlNodeSetPtr(n_nodes, nodes, 1); 5383 des_int(n_mode, mode, 2); 5384 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); 5385 des_int(n_with_comments, with_comments, 4); 5386 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5); 5387 xmlResetLastError(); 5388 if (mem_base != xmlMemBlocks()) { 5389 printf("Leak of %d blocks found in xmlC14NDocDumpMemory", 5390 xmlMemBlocks() - mem_base); 5391 test_ret++; 5392 printf(" %d", n_doc); 5393 printf(" %d", n_nodes); 5394 printf(" %d", n_mode); 5395 printf(" %d", n_inclusive_ns_prefixes); 5396 printf(" %d", n_with_comments); 5397 printf(" %d", n_doc_txt_ptr); 5398 printf("\n"); 5399 } 5400 } 5401 } 5402 } 5403 } 5404 } 5405 } 5406 function_tests++; 5407 #endif 5408 5409 return(test_ret); 5410 } 5411 5412 5413 static int 5414 test_xmlC14NDocSave(void) { 5415 int test_ret = 0; 5416 5417 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5418 int mem_base; 5419 int ret_val; 5420 xmlDocPtr doc; /* the XML document for canonization */ 5421 int n_doc; 5422 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ 5423 int n_nodes; 5424 int mode; /* the c14n mode (see @xmlC14NMode) */ 5425 int n_mode; 5426 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) */ 5427 int n_inclusive_ns_prefixes; 5428 int with_comments; /* include comments in the result (!=0) or not (==0) */ 5429 int n_with_comments; 5430 const char * filename; /* the filename to store canonical XML image */ 5431 int n_filename; 5432 int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */ 5433 int n_compression; 5434 5435 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 5436 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { 5437 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 5438 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { 5439 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { 5440 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 5441 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { 5442 mem_base = xmlMemBlocks(); 5443 doc = gen_xmlDocPtr(n_doc, 0); 5444 nodes = gen_xmlNodeSetPtr(n_nodes, 1); 5445 mode = gen_int(n_mode, 2); 5446 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); 5447 with_comments = gen_int(n_with_comments, 4); 5448 filename = gen_fileoutput(n_filename, 5); 5449 compression = gen_int(n_compression, 6); 5450 5451 ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression); 5452 desret_int(ret_val); 5453 call_tests++; 5454 des_xmlDocPtr(n_doc, doc, 0); 5455 des_xmlNodeSetPtr(n_nodes, nodes, 1); 5456 des_int(n_mode, mode, 2); 5457 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); 5458 des_int(n_with_comments, with_comments, 4); 5459 des_fileoutput(n_filename, filename, 5); 5460 des_int(n_compression, compression, 6); 5461 xmlResetLastError(); 5462 if (mem_base != xmlMemBlocks()) { 5463 printf("Leak of %d blocks found in xmlC14NDocSave", 5464 xmlMemBlocks() - mem_base); 5465 test_ret++; 5466 printf(" %d", n_doc); 5467 printf(" %d", n_nodes); 5468 printf(" %d", n_mode); 5469 printf(" %d", n_inclusive_ns_prefixes); 5470 printf(" %d", n_with_comments); 5471 printf(" %d", n_filename); 5472 printf(" %d", n_compression); 5473 printf("\n"); 5474 } 5475 } 5476 } 5477 } 5478 } 5479 } 5480 } 5481 } 5482 function_tests++; 5483 #endif 5484 5485 return(test_ret); 5486 } 5487 5488 5489 static int 5490 test_xmlC14NDocSaveTo(void) { 5491 int test_ret = 0; 5492 5493 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5494 int mem_base; 5495 int ret_val; 5496 xmlDocPtr doc; /* the XML document for canonization */ 5497 int n_doc; 5498 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ 5499 int n_nodes; 5500 int mode; /* the c14n mode (see @xmlC14NMode) */ 5501 int n_mode; 5502 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) */ 5503 int n_inclusive_ns_prefixes; 5504 int with_comments; /* include comments in the result (!=0) or not (==0) */ 5505 int n_with_comments; 5506 xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */ 5507 int n_buf; 5508 5509 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 5510 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { 5511 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 5512 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { 5513 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { 5514 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 5515 mem_base = xmlMemBlocks(); 5516 doc = gen_xmlDocPtr(n_doc, 0); 5517 nodes = gen_xmlNodeSetPtr(n_nodes, 1); 5518 mode = gen_int(n_mode, 2); 5519 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); 5520 with_comments = gen_int(n_with_comments, 4); 5521 buf = gen_xmlOutputBufferPtr(n_buf, 5); 5522 5523 ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf); 5524 desret_int(ret_val); 5525 call_tests++; 5526 des_xmlDocPtr(n_doc, doc, 0); 5527 des_xmlNodeSetPtr(n_nodes, nodes, 1); 5528 des_int(n_mode, mode, 2); 5529 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); 5530 des_int(n_with_comments, with_comments, 4); 5531 des_xmlOutputBufferPtr(n_buf, buf, 5); 5532 xmlResetLastError(); 5533 if (mem_base != xmlMemBlocks()) { 5534 printf("Leak of %d blocks found in xmlC14NDocSaveTo", 5535 xmlMemBlocks() - mem_base); 5536 test_ret++; 5537 printf(" %d", n_doc); 5538 printf(" %d", n_nodes); 5539 printf(" %d", n_mode); 5540 printf(" %d", n_inclusive_ns_prefixes); 5541 printf(" %d", n_with_comments); 5542 printf(" %d", n_buf); 5543 printf("\n"); 5544 } 5545 } 5546 } 5547 } 5548 } 5549 } 5550 } 5551 function_tests++; 5552 #endif 5553 5554 return(test_ret); 5555 } 5556 5557 5558 static int 5559 test_xmlC14NExecute(void) { 5560 int test_ret = 0; 5561 5562 5563 /* missing type support */ 5564 return(test_ret); 5565 } 5566 5567 static int 5568 test_c14n(void) { 5569 int test_ret = 0; 5570 5571 if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n"); 5572 test_ret += test_xmlC14NDocDumpMemory(); 5573 test_ret += test_xmlC14NDocSave(); 5574 test_ret += test_xmlC14NDocSaveTo(); 5575 test_ret += test_xmlC14NExecute(); 5576 5577 if (test_ret != 0) 5578 printf("Module c14n: %d errors\n", test_ret); 5579 return(test_ret); 5580 } 5581 #ifdef LIBXML_CATALOG_ENABLED 5582 5583 #define gen_nb_xmlCatalogPtr 1 5584 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 5585 return(NULL); 5586 } 5587 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 5588 } 5589 #endif 5590 5591 5592 static int 5593 test_xmlACatalogAdd(void) { 5594 int test_ret = 0; 5595 5596 #if defined(LIBXML_CATALOG_ENABLED) 5597 int mem_base; 5598 int ret_val; 5599 xmlCatalogPtr catal; /* a Catalog */ 5600 int n_catal; 5601 xmlChar * type; /* the type of record to add to the catalog */ 5602 int n_type; 5603 xmlChar * orig; /* the system, public or prefix to match */ 5604 int n_orig; 5605 xmlChar * replace; /* the replacement value for the match */ 5606 int n_replace; 5607 5608 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5609 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { 5610 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { 5611 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { 5612 mem_base = xmlMemBlocks(); 5613 catal = gen_xmlCatalogPtr(n_catal, 0); 5614 type = gen_const_xmlChar_ptr(n_type, 1); 5615 orig = gen_const_xmlChar_ptr(n_orig, 2); 5616 replace = gen_const_xmlChar_ptr(n_replace, 3); 5617 5618 ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace); 5619 desret_int(ret_val); 5620 call_tests++; 5621 des_xmlCatalogPtr(n_catal, catal, 0); 5622 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1); 5623 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2); 5624 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3); 5625 xmlResetLastError(); 5626 if (mem_base != xmlMemBlocks()) { 5627 printf("Leak of %d blocks found in xmlACatalogAdd", 5628 xmlMemBlocks() - mem_base); 5629 test_ret++; 5630 printf(" %d", n_catal); 5631 printf(" %d", n_type); 5632 printf(" %d", n_orig); 5633 printf(" %d", n_replace); 5634 printf("\n"); 5635 } 5636 } 5637 } 5638 } 5639 } 5640 function_tests++; 5641 #endif 5642 5643 return(test_ret); 5644 } 5645 5646 5647 static int 5648 test_xmlACatalogDump(void) { 5649 int test_ret = 0; 5650 5651 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5652 int mem_base; 5653 xmlCatalogPtr catal; /* a Catalog */ 5654 int n_catal; 5655 FILE * out; /* the file. */ 5656 int n_out; 5657 5658 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5659 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 5660 mem_base = xmlMemBlocks(); 5661 catal = gen_xmlCatalogPtr(n_catal, 0); 5662 out = gen_FILE_ptr(n_out, 1); 5663 5664 xmlACatalogDump(catal, out); 5665 call_tests++; 5666 des_xmlCatalogPtr(n_catal, catal, 0); 5667 des_FILE_ptr(n_out, out, 1); 5668 xmlResetLastError(); 5669 if (mem_base != xmlMemBlocks()) { 5670 printf("Leak of %d blocks found in xmlACatalogDump", 5671 xmlMemBlocks() - mem_base); 5672 test_ret++; 5673 printf(" %d", n_catal); 5674 printf(" %d", n_out); 5675 printf("\n"); 5676 } 5677 } 5678 } 5679 function_tests++; 5680 #endif 5681 5682 return(test_ret); 5683 } 5684 5685 5686 static int 5687 test_xmlACatalogRemove(void) { 5688 int test_ret = 0; 5689 5690 #if defined(LIBXML_CATALOG_ENABLED) 5691 int mem_base; 5692 int ret_val; 5693 xmlCatalogPtr catal; /* a Catalog */ 5694 int n_catal; 5695 xmlChar * value; /* the value to remove */ 5696 int n_value; 5697 5698 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5699 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 5700 mem_base = xmlMemBlocks(); 5701 catal = gen_xmlCatalogPtr(n_catal, 0); 5702 value = gen_const_xmlChar_ptr(n_value, 1); 5703 5704 ret_val = xmlACatalogRemove(catal, (const xmlChar *)value); 5705 desret_int(ret_val); 5706 call_tests++; 5707 des_xmlCatalogPtr(n_catal, catal, 0); 5708 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 5709 xmlResetLastError(); 5710 if (mem_base != xmlMemBlocks()) { 5711 printf("Leak of %d blocks found in xmlACatalogRemove", 5712 xmlMemBlocks() - mem_base); 5713 test_ret++; 5714 printf(" %d", n_catal); 5715 printf(" %d", n_value); 5716 printf("\n"); 5717 } 5718 } 5719 } 5720 function_tests++; 5721 #endif 5722 5723 return(test_ret); 5724 } 5725 5726 5727 static int 5728 test_xmlACatalogResolve(void) { 5729 int test_ret = 0; 5730 5731 #if defined(LIBXML_CATALOG_ENABLED) 5732 int mem_base; 5733 xmlChar * ret_val; 5734 xmlCatalogPtr catal; /* a Catalog */ 5735 int n_catal; 5736 xmlChar * pubID; /* the public ID string */ 5737 int n_pubID; 5738 xmlChar * sysID; /* the system ID string */ 5739 int n_sysID; 5740 5741 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5742 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 5743 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 5744 mem_base = xmlMemBlocks(); 5745 catal = gen_xmlCatalogPtr(n_catal, 0); 5746 pubID = gen_const_xmlChar_ptr(n_pubID, 1); 5747 sysID = gen_const_xmlChar_ptr(n_sysID, 2); 5748 5749 ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID); 5750 desret_xmlChar_ptr(ret_val); 5751 call_tests++; 5752 des_xmlCatalogPtr(n_catal, catal, 0); 5753 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); 5754 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2); 5755 xmlResetLastError(); 5756 if (mem_base != xmlMemBlocks()) { 5757 printf("Leak of %d blocks found in xmlACatalogResolve", 5758 xmlMemBlocks() - mem_base); 5759 test_ret++; 5760 printf(" %d", n_catal); 5761 printf(" %d", n_pubID); 5762 printf(" %d", n_sysID); 5763 printf("\n"); 5764 } 5765 } 5766 } 5767 } 5768 function_tests++; 5769 #endif 5770 5771 return(test_ret); 5772 } 5773 5774 5775 static int 5776 test_xmlACatalogResolvePublic(void) { 5777 int test_ret = 0; 5778 5779 #if defined(LIBXML_CATALOG_ENABLED) 5780 int mem_base; 5781 xmlChar * ret_val; 5782 xmlCatalogPtr catal; /* a Catalog */ 5783 int n_catal; 5784 xmlChar * pubID; /* the public ID string */ 5785 int n_pubID; 5786 5787 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5788 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 5789 mem_base = xmlMemBlocks(); 5790 catal = gen_xmlCatalogPtr(n_catal, 0); 5791 pubID = gen_const_xmlChar_ptr(n_pubID, 1); 5792 5793 ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID); 5794 desret_xmlChar_ptr(ret_val); 5795 call_tests++; 5796 des_xmlCatalogPtr(n_catal, catal, 0); 5797 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); 5798 xmlResetLastError(); 5799 if (mem_base != xmlMemBlocks()) { 5800 printf("Leak of %d blocks found in xmlACatalogResolvePublic", 5801 xmlMemBlocks() - mem_base); 5802 test_ret++; 5803 printf(" %d", n_catal); 5804 printf(" %d", n_pubID); 5805 printf("\n"); 5806 } 5807 } 5808 } 5809 function_tests++; 5810 #endif 5811 5812 return(test_ret); 5813 } 5814 5815 5816 static int 5817 test_xmlACatalogResolveSystem(void) { 5818 int test_ret = 0; 5819 5820 #if defined(LIBXML_CATALOG_ENABLED) 5821 int mem_base; 5822 xmlChar * ret_val; 5823 xmlCatalogPtr catal; /* a Catalog */ 5824 int n_catal; 5825 xmlChar * sysID; /* the system ID string */ 5826 int n_sysID; 5827 5828 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5829 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 5830 mem_base = xmlMemBlocks(); 5831 catal = gen_xmlCatalogPtr(n_catal, 0); 5832 sysID = gen_const_xmlChar_ptr(n_sysID, 1); 5833 5834 ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID); 5835 desret_xmlChar_ptr(ret_val); 5836 call_tests++; 5837 des_xmlCatalogPtr(n_catal, catal, 0); 5838 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1); 5839 xmlResetLastError(); 5840 if (mem_base != xmlMemBlocks()) { 5841 printf("Leak of %d blocks found in xmlACatalogResolveSystem", 5842 xmlMemBlocks() - mem_base); 5843 test_ret++; 5844 printf(" %d", n_catal); 5845 printf(" %d", n_sysID); 5846 printf("\n"); 5847 } 5848 } 5849 } 5850 function_tests++; 5851 #endif 5852 5853 return(test_ret); 5854 } 5855 5856 5857 static int 5858 test_xmlACatalogResolveURI(void) { 5859 int test_ret = 0; 5860 5861 #if defined(LIBXML_CATALOG_ENABLED) 5862 int mem_base; 5863 xmlChar * ret_val; 5864 xmlCatalogPtr catal; /* a Catalog */ 5865 int n_catal; 5866 xmlChar * URI; /* the URI */ 5867 int n_URI; 5868 5869 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 5870 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 5871 mem_base = xmlMemBlocks(); 5872 catal = gen_xmlCatalogPtr(n_catal, 0); 5873 URI = gen_const_xmlChar_ptr(n_URI, 1); 5874 5875 ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI); 5876 desret_xmlChar_ptr(ret_val); 5877 call_tests++; 5878 des_xmlCatalogPtr(n_catal, catal, 0); 5879 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1); 5880 xmlResetLastError(); 5881 if (mem_base != xmlMemBlocks()) { 5882 printf("Leak of %d blocks found in xmlACatalogResolveURI", 5883 xmlMemBlocks() - mem_base); 5884 test_ret++; 5885 printf(" %d", n_catal); 5886 printf(" %d", n_URI); 5887 printf("\n"); 5888 } 5889 } 5890 } 5891 function_tests++; 5892 #endif 5893 5894 return(test_ret); 5895 } 5896 5897 5898 static int 5899 test_xmlCatalogAdd(void) { 5900 int test_ret = 0; 5901 5902 #if defined(LIBXML_CATALOG_ENABLED) 5903 int mem_base; 5904 int ret_val; 5905 xmlChar * type; /* the type of record to add to the catalog */ 5906 int n_type; 5907 xmlChar * orig; /* the system, public or prefix to match */ 5908 int n_orig; 5909 xmlChar * replace; /* the replacement value for the match */ 5910 int n_replace; 5911 5912 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { 5913 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { 5914 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { 5915 mem_base = xmlMemBlocks(); 5916 type = gen_const_xmlChar_ptr(n_type, 0); 5917 orig = gen_const_xmlChar_ptr(n_orig, 1); 5918 replace = gen_const_xmlChar_ptr(n_replace, 2); 5919 5920 ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace); 5921 desret_int(ret_val); 5922 call_tests++; 5923 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0); 5924 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1); 5925 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2); 5926 xmlResetLastError(); 5927 if (mem_base != xmlMemBlocks()) { 5928 printf("Leak of %d blocks found in xmlCatalogAdd", 5929 xmlMemBlocks() - mem_base); 5930 test_ret++; 5931 printf(" %d", n_type); 5932 printf(" %d", n_orig); 5933 printf(" %d", n_replace); 5934 printf("\n"); 5935 } 5936 } 5937 } 5938 } 5939 function_tests++; 5940 #endif 5941 5942 return(test_ret); 5943 } 5944 5945 5946 static int 5947 test_xmlCatalogCleanup(void) { 5948 int test_ret = 0; 5949 5950 #if defined(LIBXML_CATALOG_ENABLED) 5951 5952 5953 xmlCatalogCleanup(); 5954 call_tests++; 5955 xmlResetLastError(); 5956 function_tests++; 5957 #endif 5958 5959 return(test_ret); 5960 } 5961 5962 5963 static int 5964 test_xmlCatalogConvert(void) { 5965 int test_ret = 0; 5966 5967 #if defined(LIBXML_CATALOG_ENABLED) 5968 int ret_val; 5969 5970 5971 ret_val = xmlCatalogConvert(); 5972 desret_int(ret_val); 5973 call_tests++; 5974 xmlResetLastError(); 5975 function_tests++; 5976 #endif 5977 5978 return(test_ret); 5979 } 5980 5981 5982 static int 5983 test_xmlCatalogDump(void) { 5984 int test_ret = 0; 5985 5986 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 5987 int mem_base; 5988 FILE * out; /* the file. */ 5989 int n_out; 5990 5991 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { 5992 mem_base = xmlMemBlocks(); 5993 out = gen_FILE_ptr(n_out, 0); 5994 5995 xmlCatalogDump(out); 5996 call_tests++; 5997 des_FILE_ptr(n_out, out, 0); 5998 xmlResetLastError(); 5999 if (mem_base != xmlMemBlocks()) { 6000 printf("Leak of %d blocks found in xmlCatalogDump", 6001 xmlMemBlocks() - mem_base); 6002 test_ret++; 6003 printf(" %d", n_out); 6004 printf("\n"); 6005 } 6006 } 6007 function_tests++; 6008 #endif 6009 6010 return(test_ret); 6011 } 6012 6013 6014 static int 6015 test_xmlCatalogGetDefaults(void) { 6016 int test_ret = 0; 6017 6018 #if defined(LIBXML_CATALOG_ENABLED) 6019 int mem_base; 6020 xmlCatalogAllow ret_val; 6021 6022 mem_base = xmlMemBlocks(); 6023 6024 ret_val = xmlCatalogGetDefaults(); 6025 desret_xmlCatalogAllow(ret_val); 6026 call_tests++; 6027 xmlResetLastError(); 6028 if (mem_base != xmlMemBlocks()) { 6029 printf("Leak of %d blocks found in xmlCatalogGetDefaults", 6030 xmlMemBlocks() - mem_base); 6031 test_ret++; 6032 printf("\n"); 6033 } 6034 function_tests++; 6035 #endif 6036 6037 return(test_ret); 6038 } 6039 6040 6041 static int 6042 test_xmlCatalogIsEmpty(void) { 6043 int test_ret = 0; 6044 6045 #if defined(LIBXML_CATALOG_ENABLED) 6046 int mem_base; 6047 int ret_val; 6048 xmlCatalogPtr catal; /* should this create an SGML catalog */ 6049 int n_catal; 6050 6051 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 6052 mem_base = xmlMemBlocks(); 6053 catal = gen_xmlCatalogPtr(n_catal, 0); 6054 6055 ret_val = xmlCatalogIsEmpty(catal); 6056 desret_int(ret_val); 6057 call_tests++; 6058 des_xmlCatalogPtr(n_catal, catal, 0); 6059 xmlResetLastError(); 6060 if (mem_base != xmlMemBlocks()) { 6061 printf("Leak of %d blocks found in xmlCatalogIsEmpty", 6062 xmlMemBlocks() - mem_base); 6063 test_ret++; 6064 printf(" %d", n_catal); 6065 printf("\n"); 6066 } 6067 } 6068 function_tests++; 6069 #endif 6070 6071 return(test_ret); 6072 } 6073 6074 6075 static int 6076 test_xmlCatalogLocalResolve(void) { 6077 int test_ret = 0; 6078 6079 #if defined(LIBXML_CATALOG_ENABLED) 6080 int mem_base; 6081 xmlChar * ret_val; 6082 void * catalogs; /* a document's list of catalogs */ 6083 int n_catalogs; 6084 xmlChar * pubID; /* the public ID string */ 6085 int n_pubID; 6086 xmlChar * sysID; /* the system ID string */ 6087 int n_sysID; 6088 6089 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) { 6090 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 6091 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 6092 mem_base = xmlMemBlocks(); 6093 catalogs = gen_void_ptr(n_catalogs, 0); 6094 pubID = gen_const_xmlChar_ptr(n_pubID, 1); 6095 sysID = gen_const_xmlChar_ptr(n_sysID, 2); 6096 6097 ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID); 6098 desret_xmlChar_ptr(ret_val); 6099 call_tests++; 6100 des_void_ptr(n_catalogs, catalogs, 0); 6101 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); 6102 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2); 6103 xmlResetLastError(); 6104 if (mem_base != xmlMemBlocks()) { 6105 printf("Leak of %d blocks found in xmlCatalogLocalResolve", 6106 xmlMemBlocks() - mem_base); 6107 test_ret++; 6108 printf(" %d", n_catalogs); 6109 printf(" %d", n_pubID); 6110 printf(" %d", n_sysID); 6111 printf("\n"); 6112 } 6113 } 6114 } 6115 } 6116 function_tests++; 6117 #endif 6118 6119 return(test_ret); 6120 } 6121 6122 6123 static int 6124 test_xmlCatalogLocalResolveURI(void) { 6125 int test_ret = 0; 6126 6127 #if defined(LIBXML_CATALOG_ENABLED) 6128 int mem_base; 6129 xmlChar * ret_val; 6130 void * catalogs; /* a document's list of catalogs */ 6131 int n_catalogs; 6132 xmlChar * URI; /* the URI */ 6133 int n_URI; 6134 6135 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) { 6136 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 6137 mem_base = xmlMemBlocks(); 6138 catalogs = gen_void_ptr(n_catalogs, 0); 6139 URI = gen_const_xmlChar_ptr(n_URI, 1); 6140 6141 ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI); 6142 desret_xmlChar_ptr(ret_val); 6143 call_tests++; 6144 des_void_ptr(n_catalogs, catalogs, 0); 6145 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1); 6146 xmlResetLastError(); 6147 if (mem_base != xmlMemBlocks()) { 6148 printf("Leak of %d blocks found in xmlCatalogLocalResolveURI", 6149 xmlMemBlocks() - mem_base); 6150 test_ret++; 6151 printf(" %d", n_catalogs); 6152 printf(" %d", n_URI); 6153 printf("\n"); 6154 } 6155 } 6156 } 6157 function_tests++; 6158 #endif 6159 6160 return(test_ret); 6161 } 6162 6163 6164 static int 6165 test_xmlCatalogRemove(void) { 6166 int test_ret = 0; 6167 6168 #if defined(LIBXML_CATALOG_ENABLED) 6169 int ret_val; 6170 xmlChar * value; /* the value to remove */ 6171 int n_value; 6172 6173 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 6174 value = gen_const_xmlChar_ptr(n_value, 0); 6175 6176 ret_val = xmlCatalogRemove((const xmlChar *)value); 6177 desret_int(ret_val); 6178 call_tests++; 6179 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 6180 xmlResetLastError(); 6181 } 6182 function_tests++; 6183 #endif 6184 6185 return(test_ret); 6186 } 6187 6188 6189 static int 6190 test_xmlCatalogResolve(void) { 6191 int test_ret = 0; 6192 6193 #if defined(LIBXML_CATALOG_ENABLED) 6194 xmlChar * ret_val; 6195 xmlChar * pubID; /* the public ID string */ 6196 int n_pubID; 6197 xmlChar * sysID; /* the system ID string */ 6198 int n_sysID; 6199 6200 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 6201 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 6202 pubID = gen_const_xmlChar_ptr(n_pubID, 0); 6203 sysID = gen_const_xmlChar_ptr(n_sysID, 1); 6204 6205 ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID); 6206 desret_xmlChar_ptr(ret_val); 6207 call_tests++; 6208 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0); 6209 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1); 6210 xmlResetLastError(); 6211 } 6212 } 6213 function_tests++; 6214 #endif 6215 6216 return(test_ret); 6217 } 6218 6219 6220 static int 6221 test_xmlCatalogResolvePublic(void) { 6222 int test_ret = 0; 6223 6224 #if defined(LIBXML_CATALOG_ENABLED) 6225 int mem_base; 6226 xmlChar * ret_val; 6227 xmlChar * pubID; /* the public ID string */ 6228 int n_pubID; 6229 6230 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { 6231 mem_base = xmlMemBlocks(); 6232 pubID = gen_const_xmlChar_ptr(n_pubID, 0); 6233 6234 ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID); 6235 desret_xmlChar_ptr(ret_val); 6236 call_tests++; 6237 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0); 6238 xmlResetLastError(); 6239 if (mem_base != xmlMemBlocks()) { 6240 printf("Leak of %d blocks found in xmlCatalogResolvePublic", 6241 xmlMemBlocks() - mem_base); 6242 test_ret++; 6243 printf(" %d", n_pubID); 6244 printf("\n"); 6245 } 6246 } 6247 function_tests++; 6248 #endif 6249 6250 return(test_ret); 6251 } 6252 6253 6254 static int 6255 test_xmlCatalogResolveSystem(void) { 6256 int test_ret = 0; 6257 6258 #if defined(LIBXML_CATALOG_ENABLED) 6259 int mem_base; 6260 xmlChar * ret_val; 6261 xmlChar * sysID; /* the system ID string */ 6262 int n_sysID; 6263 6264 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { 6265 mem_base = xmlMemBlocks(); 6266 sysID = gen_const_xmlChar_ptr(n_sysID, 0); 6267 6268 ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID); 6269 desret_xmlChar_ptr(ret_val); 6270 call_tests++; 6271 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0); 6272 xmlResetLastError(); 6273 if (mem_base != xmlMemBlocks()) { 6274 printf("Leak of %d blocks found in xmlCatalogResolveSystem", 6275 xmlMemBlocks() - mem_base); 6276 test_ret++; 6277 printf(" %d", n_sysID); 6278 printf("\n"); 6279 } 6280 } 6281 function_tests++; 6282 #endif 6283 6284 return(test_ret); 6285 } 6286 6287 6288 static int 6289 test_xmlCatalogResolveURI(void) { 6290 int test_ret = 0; 6291 6292 #if defined(LIBXML_CATALOG_ENABLED) 6293 int mem_base; 6294 xmlChar * ret_val; 6295 xmlChar * URI; /* the URI */ 6296 int n_URI; 6297 6298 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 6299 mem_base = xmlMemBlocks(); 6300 URI = gen_const_xmlChar_ptr(n_URI, 0); 6301 6302 ret_val = xmlCatalogResolveURI((const xmlChar *)URI); 6303 desret_xmlChar_ptr(ret_val); 6304 call_tests++; 6305 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 6306 xmlResetLastError(); 6307 if (mem_base != xmlMemBlocks()) { 6308 printf("Leak of %d blocks found in xmlCatalogResolveURI", 6309 xmlMemBlocks() - mem_base); 6310 test_ret++; 6311 printf(" %d", n_URI); 6312 printf("\n"); 6313 } 6314 } 6315 function_tests++; 6316 #endif 6317 6318 return(test_ret); 6319 } 6320 6321 6322 static int 6323 test_xmlCatalogSetDefaultPrefer(void) { 6324 int test_ret = 0; 6325 6326 #if defined(LIBXML_CATALOG_ENABLED) 6327 int mem_base; 6328 xmlCatalogPrefer ret_val; 6329 xmlCatalogPrefer prefer; /* the default preference for delegation */ 6330 int n_prefer; 6331 6332 for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) { 6333 mem_base = xmlMemBlocks(); 6334 prefer = gen_xmlCatalogPrefer(n_prefer, 0); 6335 6336 ret_val = xmlCatalogSetDefaultPrefer(prefer); 6337 desret_xmlCatalogPrefer(ret_val); 6338 call_tests++; 6339 des_xmlCatalogPrefer(n_prefer, prefer, 0); 6340 xmlResetLastError(); 6341 if (mem_base != xmlMemBlocks()) { 6342 printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer", 6343 xmlMemBlocks() - mem_base); 6344 test_ret++; 6345 printf(" %d", n_prefer); 6346 printf("\n"); 6347 } 6348 } 6349 function_tests++; 6350 #endif 6351 6352 return(test_ret); 6353 } 6354 6355 6356 static int 6357 test_xmlCatalogSetDefaults(void) { 6358 int test_ret = 0; 6359 6360 #if defined(LIBXML_CATALOG_ENABLED) 6361 int mem_base; 6362 xmlCatalogAllow allow; /* what catalogs should be accepted */ 6363 int n_allow; 6364 6365 for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) { 6366 mem_base = xmlMemBlocks(); 6367 allow = gen_xmlCatalogAllow(n_allow, 0); 6368 6369 xmlCatalogSetDefaults(allow); 6370 call_tests++; 6371 des_xmlCatalogAllow(n_allow, allow, 0); 6372 xmlResetLastError(); 6373 if (mem_base != xmlMemBlocks()) { 6374 printf("Leak of %d blocks found in xmlCatalogSetDefaults", 6375 xmlMemBlocks() - mem_base); 6376 test_ret++; 6377 printf(" %d", n_allow); 6378 printf("\n"); 6379 } 6380 } 6381 function_tests++; 6382 #endif 6383 6384 return(test_ret); 6385 } 6386 6387 6388 static int 6389 test_xmlConvertSGMLCatalog(void) { 6390 int test_ret = 0; 6391 6392 #if defined(LIBXML_CATALOG_ENABLED) 6393 int mem_base; 6394 int ret_val; 6395 xmlCatalogPtr catal; /* the catalog */ 6396 int n_catal; 6397 6398 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { 6399 mem_base = xmlMemBlocks(); 6400 catal = gen_xmlCatalogPtr(n_catal, 0); 6401 6402 ret_val = xmlConvertSGMLCatalog(catal); 6403 desret_int(ret_val); 6404 call_tests++; 6405 des_xmlCatalogPtr(n_catal, catal, 0); 6406 xmlResetLastError(); 6407 if (mem_base != xmlMemBlocks()) { 6408 printf("Leak of %d blocks found in xmlConvertSGMLCatalog", 6409 xmlMemBlocks() - mem_base); 6410 test_ret++; 6411 printf(" %d", n_catal); 6412 printf("\n"); 6413 } 6414 } 6415 function_tests++; 6416 #endif 6417 6418 return(test_ret); 6419 } 6420 6421 6422 static int 6423 test_xmlInitializeCatalog(void) { 6424 int test_ret = 0; 6425 6426 #if defined(LIBXML_CATALOG_ENABLED) 6427 int mem_base; 6428 6429 mem_base = xmlMemBlocks(); 6430 6431 xmlInitializeCatalog(); 6432 call_tests++; 6433 xmlResetLastError(); 6434 if (mem_base != xmlMemBlocks()) { 6435 printf("Leak of %d blocks found in xmlInitializeCatalog", 6436 xmlMemBlocks() - mem_base); 6437 test_ret++; 6438 printf("\n"); 6439 } 6440 function_tests++; 6441 #endif 6442 6443 return(test_ret); 6444 } 6445 6446 6447 static int 6448 test_xmlLoadACatalog(void) { 6449 int test_ret = 0; 6450 6451 6452 /* missing type support */ 6453 return(test_ret); 6454 } 6455 6456 6457 static int 6458 test_xmlLoadCatalog(void) { 6459 int test_ret = 0; 6460 6461 #if defined(LIBXML_CATALOG_ENABLED) 6462 int ret_val; 6463 const char * filename; /* a file path */ 6464 int n_filename; 6465 6466 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 6467 filename = gen_filepath(n_filename, 0); 6468 6469 ret_val = xmlLoadCatalog(filename); 6470 desret_int(ret_val); 6471 call_tests++; 6472 des_filepath(n_filename, filename, 0); 6473 xmlResetLastError(); 6474 } 6475 function_tests++; 6476 #endif 6477 6478 return(test_ret); 6479 } 6480 6481 6482 static int 6483 test_xmlLoadCatalogs(void) { 6484 int test_ret = 0; 6485 6486 #if defined(LIBXML_CATALOG_ENABLED) 6487 char * pathss; /* a list of directories separated by a colon or a space. */ 6488 int n_pathss; 6489 6490 for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) { 6491 pathss = gen_const_char_ptr(n_pathss, 0); 6492 6493 xmlLoadCatalogs((const char *)pathss); 6494 call_tests++; 6495 des_const_char_ptr(n_pathss, (const char *)pathss, 0); 6496 xmlResetLastError(); 6497 } 6498 function_tests++; 6499 #endif 6500 6501 return(test_ret); 6502 } 6503 6504 6505 static int 6506 test_xmlLoadSGMLSuperCatalog(void) { 6507 int test_ret = 0; 6508 6509 6510 /* missing type support */ 6511 return(test_ret); 6512 } 6513 6514 6515 static int 6516 test_xmlNewCatalog(void) { 6517 int test_ret = 0; 6518 6519 6520 /* missing type support */ 6521 return(test_ret); 6522 } 6523 6524 6525 static int 6526 test_xmlParseCatalogFile(void) { 6527 int test_ret = 0; 6528 6529 #if defined(LIBXML_CATALOG_ENABLED) 6530 int mem_base; 6531 xmlDocPtr ret_val; 6532 const char * filename; /* the filename */ 6533 int n_filename; 6534 6535 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 6536 mem_base = xmlMemBlocks(); 6537 filename = gen_filepath(n_filename, 0); 6538 6539 ret_val = xmlParseCatalogFile(filename); 6540 desret_xmlDocPtr(ret_val); 6541 call_tests++; 6542 des_filepath(n_filename, filename, 0); 6543 xmlResetLastError(); 6544 if (mem_base != xmlMemBlocks()) { 6545 printf("Leak of %d blocks found in xmlParseCatalogFile", 6546 xmlMemBlocks() - mem_base); 6547 test_ret++; 6548 printf(" %d", n_filename); 6549 printf("\n"); 6550 } 6551 } 6552 function_tests++; 6553 #endif 6554 6555 return(test_ret); 6556 } 6557 6558 static int 6559 test_catalog(void) { 6560 int test_ret = 0; 6561 6562 if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n"); 6563 test_ret += test_xmlACatalogAdd(); 6564 test_ret += test_xmlACatalogDump(); 6565 test_ret += test_xmlACatalogRemove(); 6566 test_ret += test_xmlACatalogResolve(); 6567 test_ret += test_xmlACatalogResolvePublic(); 6568 test_ret += test_xmlACatalogResolveSystem(); 6569 test_ret += test_xmlACatalogResolveURI(); 6570 test_ret += test_xmlCatalogAdd(); 6571 test_ret += test_xmlCatalogCleanup(); 6572 test_ret += test_xmlCatalogConvert(); 6573 test_ret += test_xmlCatalogDump(); 6574 test_ret += test_xmlCatalogGetDefaults(); 6575 test_ret += test_xmlCatalogIsEmpty(); 6576 test_ret += test_xmlCatalogLocalResolve(); 6577 test_ret += test_xmlCatalogLocalResolveURI(); 6578 test_ret += test_xmlCatalogRemove(); 6579 test_ret += test_xmlCatalogResolve(); 6580 test_ret += test_xmlCatalogResolvePublic(); 6581 test_ret += test_xmlCatalogResolveSystem(); 6582 test_ret += test_xmlCatalogResolveURI(); 6583 test_ret += test_xmlCatalogSetDefaultPrefer(); 6584 test_ret += test_xmlCatalogSetDefaults(); 6585 test_ret += test_xmlConvertSGMLCatalog(); 6586 test_ret += test_xmlInitializeCatalog(); 6587 test_ret += test_xmlLoadACatalog(); 6588 test_ret += test_xmlLoadCatalog(); 6589 test_ret += test_xmlLoadCatalogs(); 6590 test_ret += test_xmlLoadSGMLSuperCatalog(); 6591 test_ret += test_xmlNewCatalog(); 6592 test_ret += test_xmlParseCatalogFile(); 6593 6594 if (test_ret != 0) 6595 printf("Module catalog: %d errors\n", test_ret); 6596 return(test_ret); 6597 } 6598 6599 #define gen_nb_const_xmlChRangeGroup_ptr 1 6600 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 6601 return(NULL); 6602 } 6603 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 6604 } 6605 6606 static int 6607 test_xmlCharInRange(void) { 6608 int test_ret = 0; 6609 6610 int mem_base; 6611 int ret_val; 6612 unsigned int val; /* character to be validated */ 6613 int n_val; 6614 xmlChRangeGroup * rptr; /* pointer to range to be used to validate */ 6615 int n_rptr; 6616 6617 for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) { 6618 for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) { 6619 mem_base = xmlMemBlocks(); 6620 val = gen_unsigned_int(n_val, 0); 6621 rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1); 6622 6623 ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr); 6624 desret_int(ret_val); 6625 call_tests++; 6626 des_unsigned_int(n_val, val, 0); 6627 des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1); 6628 xmlResetLastError(); 6629 if (mem_base != xmlMemBlocks()) { 6630 printf("Leak of %d blocks found in xmlCharInRange", 6631 xmlMemBlocks() - mem_base); 6632 test_ret++; 6633 printf(" %d", n_val); 6634 printf(" %d", n_rptr); 6635 printf("\n"); 6636 } 6637 } 6638 } 6639 function_tests++; 6640 6641 return(test_ret); 6642 } 6643 6644 6645 static int 6646 test_xmlIsBaseChar(void) { 6647 int test_ret = 0; 6648 6649 int mem_base; 6650 int ret_val; 6651 unsigned int ch; /* character to validate */ 6652 int n_ch; 6653 6654 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6655 mem_base = xmlMemBlocks(); 6656 ch = gen_unsigned_int(n_ch, 0); 6657 6658 ret_val = xmlIsBaseChar(ch); 6659 desret_int(ret_val); 6660 call_tests++; 6661 des_unsigned_int(n_ch, ch, 0); 6662 xmlResetLastError(); 6663 if (mem_base != xmlMemBlocks()) { 6664 printf("Leak of %d blocks found in xmlIsBaseChar", 6665 xmlMemBlocks() - mem_base); 6666 test_ret++; 6667 printf(" %d", n_ch); 6668 printf("\n"); 6669 } 6670 } 6671 function_tests++; 6672 6673 return(test_ret); 6674 } 6675 6676 6677 static int 6678 test_xmlIsBlank(void) { 6679 int test_ret = 0; 6680 6681 int mem_base; 6682 int ret_val; 6683 unsigned int ch; /* character to validate */ 6684 int n_ch; 6685 6686 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6687 mem_base = xmlMemBlocks(); 6688 ch = gen_unsigned_int(n_ch, 0); 6689 6690 ret_val = xmlIsBlank(ch); 6691 desret_int(ret_val); 6692 call_tests++; 6693 des_unsigned_int(n_ch, ch, 0); 6694 xmlResetLastError(); 6695 if (mem_base != xmlMemBlocks()) { 6696 printf("Leak of %d blocks found in xmlIsBlank", 6697 xmlMemBlocks() - mem_base); 6698 test_ret++; 6699 printf(" %d", n_ch); 6700 printf("\n"); 6701 } 6702 } 6703 function_tests++; 6704 6705 return(test_ret); 6706 } 6707 6708 6709 static int 6710 test_xmlIsChar(void) { 6711 int test_ret = 0; 6712 6713 int mem_base; 6714 int ret_val; 6715 unsigned int ch; /* character to validate */ 6716 int n_ch; 6717 6718 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6719 mem_base = xmlMemBlocks(); 6720 ch = gen_unsigned_int(n_ch, 0); 6721 6722 ret_val = xmlIsChar(ch); 6723 desret_int(ret_val); 6724 call_tests++; 6725 des_unsigned_int(n_ch, ch, 0); 6726 xmlResetLastError(); 6727 if (mem_base != xmlMemBlocks()) { 6728 printf("Leak of %d blocks found in xmlIsChar", 6729 xmlMemBlocks() - mem_base); 6730 test_ret++; 6731 printf(" %d", n_ch); 6732 printf("\n"); 6733 } 6734 } 6735 function_tests++; 6736 6737 return(test_ret); 6738 } 6739 6740 6741 static int 6742 test_xmlIsCombining(void) { 6743 int test_ret = 0; 6744 6745 int mem_base; 6746 int ret_val; 6747 unsigned int ch; /* character to validate */ 6748 int n_ch; 6749 6750 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6751 mem_base = xmlMemBlocks(); 6752 ch = gen_unsigned_int(n_ch, 0); 6753 6754 ret_val = xmlIsCombining(ch); 6755 desret_int(ret_val); 6756 call_tests++; 6757 des_unsigned_int(n_ch, ch, 0); 6758 xmlResetLastError(); 6759 if (mem_base != xmlMemBlocks()) { 6760 printf("Leak of %d blocks found in xmlIsCombining", 6761 xmlMemBlocks() - mem_base); 6762 test_ret++; 6763 printf(" %d", n_ch); 6764 printf("\n"); 6765 } 6766 } 6767 function_tests++; 6768 6769 return(test_ret); 6770 } 6771 6772 6773 static int 6774 test_xmlIsDigit(void) { 6775 int test_ret = 0; 6776 6777 int mem_base; 6778 int ret_val; 6779 unsigned int ch; /* character to validate */ 6780 int n_ch; 6781 6782 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6783 mem_base = xmlMemBlocks(); 6784 ch = gen_unsigned_int(n_ch, 0); 6785 6786 ret_val = xmlIsDigit(ch); 6787 desret_int(ret_val); 6788 call_tests++; 6789 des_unsigned_int(n_ch, ch, 0); 6790 xmlResetLastError(); 6791 if (mem_base != xmlMemBlocks()) { 6792 printf("Leak of %d blocks found in xmlIsDigit", 6793 xmlMemBlocks() - mem_base); 6794 test_ret++; 6795 printf(" %d", n_ch); 6796 printf("\n"); 6797 } 6798 } 6799 function_tests++; 6800 6801 return(test_ret); 6802 } 6803 6804 6805 static int 6806 test_xmlIsExtender(void) { 6807 int test_ret = 0; 6808 6809 int mem_base; 6810 int ret_val; 6811 unsigned int ch; /* character to validate */ 6812 int n_ch; 6813 6814 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6815 mem_base = xmlMemBlocks(); 6816 ch = gen_unsigned_int(n_ch, 0); 6817 6818 ret_val = xmlIsExtender(ch); 6819 desret_int(ret_val); 6820 call_tests++; 6821 des_unsigned_int(n_ch, ch, 0); 6822 xmlResetLastError(); 6823 if (mem_base != xmlMemBlocks()) { 6824 printf("Leak of %d blocks found in xmlIsExtender", 6825 xmlMemBlocks() - mem_base); 6826 test_ret++; 6827 printf(" %d", n_ch); 6828 printf("\n"); 6829 } 6830 } 6831 function_tests++; 6832 6833 return(test_ret); 6834 } 6835 6836 6837 static int 6838 test_xmlIsIdeographic(void) { 6839 int test_ret = 0; 6840 6841 int mem_base; 6842 int ret_val; 6843 unsigned int ch; /* character to validate */ 6844 int n_ch; 6845 6846 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6847 mem_base = xmlMemBlocks(); 6848 ch = gen_unsigned_int(n_ch, 0); 6849 6850 ret_val = xmlIsIdeographic(ch); 6851 desret_int(ret_val); 6852 call_tests++; 6853 des_unsigned_int(n_ch, ch, 0); 6854 xmlResetLastError(); 6855 if (mem_base != xmlMemBlocks()) { 6856 printf("Leak of %d blocks found in xmlIsIdeographic", 6857 xmlMemBlocks() - mem_base); 6858 test_ret++; 6859 printf(" %d", n_ch); 6860 printf("\n"); 6861 } 6862 } 6863 function_tests++; 6864 6865 return(test_ret); 6866 } 6867 6868 6869 static int 6870 test_xmlIsPubidChar(void) { 6871 int test_ret = 0; 6872 6873 int mem_base; 6874 int ret_val; 6875 unsigned int ch; /* character to validate */ 6876 int n_ch; 6877 6878 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { 6879 mem_base = xmlMemBlocks(); 6880 ch = gen_unsigned_int(n_ch, 0); 6881 6882 ret_val = xmlIsPubidChar(ch); 6883 desret_int(ret_val); 6884 call_tests++; 6885 des_unsigned_int(n_ch, ch, 0); 6886 xmlResetLastError(); 6887 if (mem_base != xmlMemBlocks()) { 6888 printf("Leak of %d blocks found in xmlIsPubidChar", 6889 xmlMemBlocks() - mem_base); 6890 test_ret++; 6891 printf(" %d", n_ch); 6892 printf("\n"); 6893 } 6894 } 6895 function_tests++; 6896 6897 return(test_ret); 6898 } 6899 6900 static int 6901 test_chvalid(void) { 6902 int test_ret = 0; 6903 6904 if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n"); 6905 test_ret += test_xmlCharInRange(); 6906 test_ret += test_xmlIsBaseChar(); 6907 test_ret += test_xmlIsBlank(); 6908 test_ret += test_xmlIsChar(); 6909 test_ret += test_xmlIsCombining(); 6910 test_ret += test_xmlIsDigit(); 6911 test_ret += test_xmlIsExtender(); 6912 test_ret += test_xmlIsIdeographic(); 6913 test_ret += test_xmlIsPubidChar(); 6914 6915 if (test_ret != 0) 6916 printf("Module chvalid: %d errors\n", test_ret); 6917 return(test_ret); 6918 } 6919 6920 static int 6921 test_xmlBoolToText(void) { 6922 int test_ret = 0; 6923 6924 #if defined(LIBXML_DEBUG_ENABLED) 6925 int mem_base; 6926 const char * ret_val; 6927 int boolval; /* a bool to turn into text */ 6928 int n_boolval; 6929 6930 for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) { 6931 mem_base = xmlMemBlocks(); 6932 boolval = gen_int(n_boolval, 0); 6933 6934 ret_val = xmlBoolToText(boolval); 6935 desret_const_char_ptr(ret_val); 6936 call_tests++; 6937 des_int(n_boolval, boolval, 0); 6938 xmlResetLastError(); 6939 if (mem_base != xmlMemBlocks()) { 6940 printf("Leak of %d blocks found in xmlBoolToText", 6941 xmlMemBlocks() - mem_base); 6942 test_ret++; 6943 printf(" %d", n_boolval); 6944 printf("\n"); 6945 } 6946 } 6947 function_tests++; 6948 #endif 6949 6950 return(test_ret); 6951 } 6952 6953 6954 static int 6955 test_xmlDebugCheckDocument(void) { 6956 int test_ret = 0; 6957 6958 #if defined(LIBXML_DEBUG_ENABLED) 6959 int mem_base; 6960 int ret_val; 6961 FILE * output; /* the FILE * for the output */ 6962 int n_output; 6963 xmlDocPtr doc; /* the document */ 6964 int n_doc; 6965 6966 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 6967 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 6968 mem_base = xmlMemBlocks(); 6969 output = gen_debug_FILE_ptr(n_output, 0); 6970 doc = gen_xmlDocPtr(n_doc, 1); 6971 6972 ret_val = xmlDebugCheckDocument(output, doc); 6973 desret_int(ret_val); 6974 call_tests++; 6975 des_debug_FILE_ptr(n_output, output, 0); 6976 des_xmlDocPtr(n_doc, doc, 1); 6977 xmlResetLastError(); 6978 if (mem_base != xmlMemBlocks()) { 6979 printf("Leak of %d blocks found in xmlDebugCheckDocument", 6980 xmlMemBlocks() - mem_base); 6981 test_ret++; 6982 printf(" %d", n_output); 6983 printf(" %d", n_doc); 6984 printf("\n"); 6985 } 6986 } 6987 } 6988 function_tests++; 6989 #endif 6990 6991 return(test_ret); 6992 } 6993 6994 6995 static int 6996 test_xmlDebugDumpAttr(void) { 6997 int test_ret = 0; 6998 6999 #if defined(LIBXML_DEBUG_ENABLED) 7000 int mem_base; 7001 FILE * output; /* the FILE * for the output */ 7002 int n_output; 7003 xmlAttrPtr attr; /* the attribute */ 7004 int n_attr; 7005 int depth; /* the indentation level. */ 7006 int n_depth; 7007 7008 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7009 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 7010 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7011 mem_base = xmlMemBlocks(); 7012 output = gen_debug_FILE_ptr(n_output, 0); 7013 attr = gen_xmlAttrPtr(n_attr, 1); 7014 depth = gen_int(n_depth, 2); 7015 7016 xmlDebugDumpAttr(output, attr, depth); 7017 call_tests++; 7018 des_debug_FILE_ptr(n_output, output, 0); 7019 des_xmlAttrPtr(n_attr, attr, 1); 7020 des_int(n_depth, depth, 2); 7021 xmlResetLastError(); 7022 if (mem_base != xmlMemBlocks()) { 7023 printf("Leak of %d blocks found in xmlDebugDumpAttr", 7024 xmlMemBlocks() - mem_base); 7025 test_ret++; 7026 printf(" %d", n_output); 7027 printf(" %d", n_attr); 7028 printf(" %d", n_depth); 7029 printf("\n"); 7030 } 7031 } 7032 } 7033 } 7034 function_tests++; 7035 #endif 7036 7037 return(test_ret); 7038 } 7039 7040 7041 static int 7042 test_xmlDebugDumpAttrList(void) { 7043 int test_ret = 0; 7044 7045 #if defined(LIBXML_DEBUG_ENABLED) 7046 int mem_base; 7047 FILE * output; /* the FILE * for the output */ 7048 int n_output; 7049 xmlAttrPtr attr; /* the attribute list */ 7050 int n_attr; 7051 int depth; /* the indentation level. */ 7052 int n_depth; 7053 7054 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7055 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 7056 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7057 mem_base = xmlMemBlocks(); 7058 output = gen_debug_FILE_ptr(n_output, 0); 7059 attr = gen_xmlAttrPtr(n_attr, 1); 7060 depth = gen_int(n_depth, 2); 7061 7062 xmlDebugDumpAttrList(output, attr, depth); 7063 call_tests++; 7064 des_debug_FILE_ptr(n_output, output, 0); 7065 des_xmlAttrPtr(n_attr, attr, 1); 7066 des_int(n_depth, depth, 2); 7067 xmlResetLastError(); 7068 if (mem_base != xmlMemBlocks()) { 7069 printf("Leak of %d blocks found in xmlDebugDumpAttrList", 7070 xmlMemBlocks() - mem_base); 7071 test_ret++; 7072 printf(" %d", n_output); 7073 printf(" %d", n_attr); 7074 printf(" %d", n_depth); 7075 printf("\n"); 7076 } 7077 } 7078 } 7079 } 7080 function_tests++; 7081 #endif 7082 7083 return(test_ret); 7084 } 7085 7086 7087 static int 7088 test_xmlDebugDumpDTD(void) { 7089 int test_ret = 0; 7090 7091 #if defined(LIBXML_DEBUG_ENABLED) 7092 int mem_base; 7093 FILE * output; /* the FILE * for the output */ 7094 int n_output; 7095 xmlDtdPtr dtd; /* the DTD */ 7096 int n_dtd; 7097 7098 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7099 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 7100 mem_base = xmlMemBlocks(); 7101 output = gen_debug_FILE_ptr(n_output, 0); 7102 dtd = gen_xmlDtdPtr(n_dtd, 1); 7103 7104 xmlDebugDumpDTD(output, dtd); 7105 call_tests++; 7106 des_debug_FILE_ptr(n_output, output, 0); 7107 des_xmlDtdPtr(n_dtd, dtd, 1); 7108 xmlResetLastError(); 7109 if (mem_base != xmlMemBlocks()) { 7110 printf("Leak of %d blocks found in xmlDebugDumpDTD", 7111 xmlMemBlocks() - mem_base); 7112 test_ret++; 7113 printf(" %d", n_output); 7114 printf(" %d", n_dtd); 7115 printf("\n"); 7116 } 7117 } 7118 } 7119 function_tests++; 7120 #endif 7121 7122 return(test_ret); 7123 } 7124 7125 7126 static int 7127 test_xmlDebugDumpDocument(void) { 7128 int test_ret = 0; 7129 7130 #if defined(LIBXML_DEBUG_ENABLED) 7131 int mem_base; 7132 FILE * output; /* the FILE * for the output */ 7133 int n_output; 7134 xmlDocPtr doc; /* the document */ 7135 int n_doc; 7136 7137 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7138 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 7139 mem_base = xmlMemBlocks(); 7140 output = gen_debug_FILE_ptr(n_output, 0); 7141 doc = gen_xmlDocPtr(n_doc, 1); 7142 7143 xmlDebugDumpDocument(output, doc); 7144 call_tests++; 7145 des_debug_FILE_ptr(n_output, output, 0); 7146 des_xmlDocPtr(n_doc, doc, 1); 7147 xmlResetLastError(); 7148 if (mem_base != xmlMemBlocks()) { 7149 printf("Leak of %d blocks found in xmlDebugDumpDocument", 7150 xmlMemBlocks() - mem_base); 7151 test_ret++; 7152 printf(" %d", n_output); 7153 printf(" %d", n_doc); 7154 printf("\n"); 7155 } 7156 } 7157 } 7158 function_tests++; 7159 #endif 7160 7161 return(test_ret); 7162 } 7163 7164 7165 static int 7166 test_xmlDebugDumpDocumentHead(void) { 7167 int test_ret = 0; 7168 7169 #if defined(LIBXML_DEBUG_ENABLED) 7170 int mem_base; 7171 FILE * output; /* the FILE * for the output */ 7172 int n_output; 7173 xmlDocPtr doc; /* the document */ 7174 int n_doc; 7175 7176 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7177 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 7178 mem_base = xmlMemBlocks(); 7179 output = gen_debug_FILE_ptr(n_output, 0); 7180 doc = gen_xmlDocPtr(n_doc, 1); 7181 7182 xmlDebugDumpDocumentHead(output, doc); 7183 call_tests++; 7184 des_debug_FILE_ptr(n_output, output, 0); 7185 des_xmlDocPtr(n_doc, doc, 1); 7186 xmlResetLastError(); 7187 if (mem_base != xmlMemBlocks()) { 7188 printf("Leak of %d blocks found in xmlDebugDumpDocumentHead", 7189 xmlMemBlocks() - mem_base); 7190 test_ret++; 7191 printf(" %d", n_output); 7192 printf(" %d", n_doc); 7193 printf("\n"); 7194 } 7195 } 7196 } 7197 function_tests++; 7198 #endif 7199 7200 return(test_ret); 7201 } 7202 7203 7204 static int 7205 test_xmlDebugDumpEntities(void) { 7206 int test_ret = 0; 7207 7208 #if defined(LIBXML_DEBUG_ENABLED) 7209 int mem_base; 7210 FILE * output; /* the FILE * for the output */ 7211 int n_output; 7212 xmlDocPtr doc; /* the document */ 7213 int n_doc; 7214 7215 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7216 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 7217 mem_base = xmlMemBlocks(); 7218 output = gen_debug_FILE_ptr(n_output, 0); 7219 doc = gen_xmlDocPtr(n_doc, 1); 7220 7221 xmlDebugDumpEntities(output, doc); 7222 call_tests++; 7223 des_debug_FILE_ptr(n_output, output, 0); 7224 des_xmlDocPtr(n_doc, doc, 1); 7225 xmlResetLastError(); 7226 if (mem_base != xmlMemBlocks()) { 7227 printf("Leak of %d blocks found in xmlDebugDumpEntities", 7228 xmlMemBlocks() - mem_base); 7229 test_ret++; 7230 printf(" %d", n_output); 7231 printf(" %d", n_doc); 7232 printf("\n"); 7233 } 7234 } 7235 } 7236 function_tests++; 7237 #endif 7238 7239 return(test_ret); 7240 } 7241 7242 7243 static int 7244 test_xmlDebugDumpNode(void) { 7245 int test_ret = 0; 7246 7247 #if defined(LIBXML_DEBUG_ENABLED) 7248 int mem_base; 7249 FILE * output; /* the FILE * for the output */ 7250 int n_output; 7251 xmlNodePtr node; /* the node */ 7252 int n_node; 7253 int depth; /* the indentation level. */ 7254 int n_depth; 7255 7256 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7257 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7258 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7259 mem_base = xmlMemBlocks(); 7260 output = gen_debug_FILE_ptr(n_output, 0); 7261 node = gen_xmlNodePtr(n_node, 1); 7262 depth = gen_int(n_depth, 2); 7263 7264 xmlDebugDumpNode(output, node, depth); 7265 call_tests++; 7266 des_debug_FILE_ptr(n_output, output, 0); 7267 des_xmlNodePtr(n_node, node, 1); 7268 des_int(n_depth, depth, 2); 7269 xmlResetLastError(); 7270 if (mem_base != xmlMemBlocks()) { 7271 printf("Leak of %d blocks found in xmlDebugDumpNode", 7272 xmlMemBlocks() - mem_base); 7273 test_ret++; 7274 printf(" %d", n_output); 7275 printf(" %d", n_node); 7276 printf(" %d", n_depth); 7277 printf("\n"); 7278 } 7279 } 7280 } 7281 } 7282 function_tests++; 7283 #endif 7284 7285 return(test_ret); 7286 } 7287 7288 7289 static int 7290 test_xmlDebugDumpNodeList(void) { 7291 int test_ret = 0; 7292 7293 #if defined(LIBXML_DEBUG_ENABLED) 7294 int mem_base; 7295 FILE * output; /* the FILE * for the output */ 7296 int n_output; 7297 xmlNodePtr node; /* the node list */ 7298 int n_node; 7299 int depth; /* the indentation level. */ 7300 int n_depth; 7301 7302 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7303 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7304 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7305 mem_base = xmlMemBlocks(); 7306 output = gen_debug_FILE_ptr(n_output, 0); 7307 node = gen_xmlNodePtr(n_node, 1); 7308 depth = gen_int(n_depth, 2); 7309 7310 xmlDebugDumpNodeList(output, node, depth); 7311 call_tests++; 7312 des_debug_FILE_ptr(n_output, output, 0); 7313 des_xmlNodePtr(n_node, node, 1); 7314 des_int(n_depth, depth, 2); 7315 xmlResetLastError(); 7316 if (mem_base != xmlMemBlocks()) { 7317 printf("Leak of %d blocks found in xmlDebugDumpNodeList", 7318 xmlMemBlocks() - mem_base); 7319 test_ret++; 7320 printf(" %d", n_output); 7321 printf(" %d", n_node); 7322 printf(" %d", n_depth); 7323 printf("\n"); 7324 } 7325 } 7326 } 7327 } 7328 function_tests++; 7329 #endif 7330 7331 return(test_ret); 7332 } 7333 7334 7335 static int 7336 test_xmlDebugDumpOneNode(void) { 7337 int test_ret = 0; 7338 7339 #if defined(LIBXML_DEBUG_ENABLED) 7340 int mem_base; 7341 FILE * output; /* the FILE * for the output */ 7342 int n_output; 7343 xmlNodePtr node; /* the node */ 7344 int n_node; 7345 int depth; /* the indentation level. */ 7346 int n_depth; 7347 7348 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7349 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7350 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 7351 mem_base = xmlMemBlocks(); 7352 output = gen_debug_FILE_ptr(n_output, 0); 7353 node = gen_xmlNodePtr(n_node, 1); 7354 depth = gen_int(n_depth, 2); 7355 7356 xmlDebugDumpOneNode(output, node, depth); 7357 call_tests++; 7358 des_debug_FILE_ptr(n_output, output, 0); 7359 des_xmlNodePtr(n_node, node, 1); 7360 des_int(n_depth, depth, 2); 7361 xmlResetLastError(); 7362 if (mem_base != xmlMemBlocks()) { 7363 printf("Leak of %d blocks found in xmlDebugDumpOneNode", 7364 xmlMemBlocks() - mem_base); 7365 test_ret++; 7366 printf(" %d", n_output); 7367 printf(" %d", n_node); 7368 printf(" %d", n_depth); 7369 printf("\n"); 7370 } 7371 } 7372 } 7373 } 7374 function_tests++; 7375 #endif 7376 7377 return(test_ret); 7378 } 7379 7380 7381 static int 7382 test_xmlDebugDumpString(void) { 7383 int test_ret = 0; 7384 7385 #if defined(LIBXML_DEBUG_ENABLED) 7386 int mem_base; 7387 FILE * output; /* the FILE * for the output */ 7388 int n_output; 7389 xmlChar * str; /* the string */ 7390 int n_str; 7391 7392 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7393 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 7394 mem_base = xmlMemBlocks(); 7395 output = gen_debug_FILE_ptr(n_output, 0); 7396 str = gen_const_xmlChar_ptr(n_str, 1); 7397 7398 xmlDebugDumpString(output, (const xmlChar *)str); 7399 call_tests++; 7400 des_debug_FILE_ptr(n_output, output, 0); 7401 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 7402 xmlResetLastError(); 7403 if (mem_base != xmlMemBlocks()) { 7404 printf("Leak of %d blocks found in xmlDebugDumpString", 7405 xmlMemBlocks() - mem_base); 7406 test_ret++; 7407 printf(" %d", n_output); 7408 printf(" %d", n_str); 7409 printf("\n"); 7410 } 7411 } 7412 } 7413 function_tests++; 7414 #endif 7415 7416 return(test_ret); 7417 } 7418 7419 7420 static int 7421 test_xmlLsCountNode(void) { 7422 int test_ret = 0; 7423 7424 #if defined(LIBXML_DEBUG_ENABLED) 7425 int mem_base; 7426 int ret_val; 7427 xmlNodePtr node; /* the node to count */ 7428 int n_node; 7429 7430 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7431 mem_base = xmlMemBlocks(); 7432 node = gen_xmlNodePtr(n_node, 0); 7433 7434 ret_val = xmlLsCountNode(node); 7435 desret_int(ret_val); 7436 call_tests++; 7437 des_xmlNodePtr(n_node, node, 0); 7438 xmlResetLastError(); 7439 if (mem_base != xmlMemBlocks()) { 7440 printf("Leak of %d blocks found in xmlLsCountNode", 7441 xmlMemBlocks() - mem_base); 7442 test_ret++; 7443 printf(" %d", n_node); 7444 printf("\n"); 7445 } 7446 } 7447 function_tests++; 7448 #endif 7449 7450 return(test_ret); 7451 } 7452 7453 7454 static int 7455 test_xmlLsOneNode(void) { 7456 int test_ret = 0; 7457 7458 #if defined(LIBXML_DEBUG_ENABLED) 7459 int mem_base; 7460 FILE * output; /* the FILE * for the output */ 7461 int n_output; 7462 xmlNodePtr node; /* the node to dump */ 7463 int n_node; 7464 7465 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { 7466 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7467 mem_base = xmlMemBlocks(); 7468 output = gen_debug_FILE_ptr(n_output, 0); 7469 node = gen_xmlNodePtr(n_node, 1); 7470 7471 xmlLsOneNode(output, node); 7472 call_tests++; 7473 des_debug_FILE_ptr(n_output, output, 0); 7474 des_xmlNodePtr(n_node, node, 1); 7475 xmlResetLastError(); 7476 if (mem_base != xmlMemBlocks()) { 7477 printf("Leak of %d blocks found in xmlLsOneNode", 7478 xmlMemBlocks() - mem_base); 7479 test_ret++; 7480 printf(" %d", n_output); 7481 printf(" %d", n_node); 7482 printf("\n"); 7483 } 7484 } 7485 } 7486 function_tests++; 7487 #endif 7488 7489 return(test_ret); 7490 } 7491 7492 7493 #define gen_nb_char_ptr 1 7494 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 7495 return(NULL); 7496 } 7497 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 7498 } 7499 7500 static int 7501 test_xmlShell(void) { 7502 int test_ret = 0; 7503 7504 7505 /* missing type support */ 7506 return(test_ret); 7507 } 7508 7509 7510 static int 7511 test_xmlShellBase(void) { 7512 int test_ret = 0; 7513 7514 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7515 int mem_base; 7516 int ret_val; 7517 xmlShellCtxtPtr ctxt; /* the shell context */ 7518 int n_ctxt; 7519 char * arg; /* unused */ 7520 int n_arg; 7521 xmlNodePtr node; /* a node */ 7522 int n_node; 7523 xmlNodePtr node2; /* unused */ 7524 int n_node2; 7525 7526 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7527 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7528 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7529 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7530 mem_base = xmlMemBlocks(); 7531 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7532 arg = gen_char_ptr(n_arg, 1); 7533 node = gen_xmlNodePtr(n_node, 2); 7534 node2 = gen_xmlNodePtr(n_node2, 3); 7535 7536 ret_val = xmlShellBase(ctxt, arg, node, node2); 7537 desret_int(ret_val); 7538 call_tests++; 7539 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7540 des_char_ptr(n_arg, arg, 1); 7541 des_xmlNodePtr(n_node, node, 2); 7542 des_xmlNodePtr(n_node2, node2, 3); 7543 xmlResetLastError(); 7544 if (mem_base != xmlMemBlocks()) { 7545 printf("Leak of %d blocks found in xmlShellBase", 7546 xmlMemBlocks() - mem_base); 7547 test_ret++; 7548 printf(" %d", n_ctxt); 7549 printf(" %d", n_arg); 7550 printf(" %d", n_node); 7551 printf(" %d", n_node2); 7552 printf("\n"); 7553 } 7554 } 7555 } 7556 } 7557 } 7558 function_tests++; 7559 #endif 7560 7561 return(test_ret); 7562 } 7563 7564 7565 static int 7566 test_xmlShellCat(void) { 7567 int test_ret = 0; 7568 7569 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 7570 int mem_base; 7571 int ret_val; 7572 xmlShellCtxtPtr ctxt; /* the shell context */ 7573 int n_ctxt; 7574 char * arg; /* unused */ 7575 int n_arg; 7576 xmlNodePtr node; /* a node */ 7577 int n_node; 7578 xmlNodePtr node2; /* unused */ 7579 int n_node2; 7580 7581 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7582 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7583 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7584 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7585 mem_base = xmlMemBlocks(); 7586 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7587 arg = gen_char_ptr(n_arg, 1); 7588 node = gen_xmlNodePtr(n_node, 2); 7589 node2 = gen_xmlNodePtr(n_node2, 3); 7590 7591 ret_val = xmlShellCat(ctxt, arg, node, node2); 7592 desret_int(ret_val); 7593 call_tests++; 7594 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7595 des_char_ptr(n_arg, arg, 1); 7596 des_xmlNodePtr(n_node, node, 2); 7597 des_xmlNodePtr(n_node2, node2, 3); 7598 xmlResetLastError(); 7599 if (mem_base != xmlMemBlocks()) { 7600 printf("Leak of %d blocks found in xmlShellCat", 7601 xmlMemBlocks() - mem_base); 7602 test_ret++; 7603 printf(" %d", n_ctxt); 7604 printf(" %d", n_arg); 7605 printf(" %d", n_node); 7606 printf(" %d", n_node2); 7607 printf("\n"); 7608 } 7609 } 7610 } 7611 } 7612 } 7613 function_tests++; 7614 #endif 7615 7616 return(test_ret); 7617 } 7618 7619 7620 static int 7621 test_xmlShellDir(void) { 7622 int test_ret = 0; 7623 7624 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7625 int mem_base; 7626 int ret_val; 7627 xmlShellCtxtPtr ctxt; /* the shell context */ 7628 int n_ctxt; 7629 char * arg; /* unused */ 7630 int n_arg; 7631 xmlNodePtr node; /* a node */ 7632 int n_node; 7633 xmlNodePtr node2; /* unused */ 7634 int n_node2; 7635 7636 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7637 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7638 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7639 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7640 mem_base = xmlMemBlocks(); 7641 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7642 arg = gen_char_ptr(n_arg, 1); 7643 node = gen_xmlNodePtr(n_node, 2); 7644 node2 = gen_xmlNodePtr(n_node2, 3); 7645 7646 ret_val = xmlShellDir(ctxt, arg, node, node2); 7647 desret_int(ret_val); 7648 call_tests++; 7649 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7650 des_char_ptr(n_arg, arg, 1); 7651 des_xmlNodePtr(n_node, node, 2); 7652 des_xmlNodePtr(n_node2, node2, 3); 7653 xmlResetLastError(); 7654 if (mem_base != xmlMemBlocks()) { 7655 printf("Leak of %d blocks found in xmlShellDir", 7656 xmlMemBlocks() - mem_base); 7657 test_ret++; 7658 printf(" %d", n_ctxt); 7659 printf(" %d", n_arg); 7660 printf(" %d", n_node); 7661 printf(" %d", n_node2); 7662 printf("\n"); 7663 } 7664 } 7665 } 7666 } 7667 } 7668 function_tests++; 7669 #endif 7670 7671 return(test_ret); 7672 } 7673 7674 7675 static int 7676 test_xmlShellDu(void) { 7677 int test_ret = 0; 7678 7679 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7680 int mem_base; 7681 int ret_val; 7682 xmlShellCtxtPtr ctxt; /* the shell context */ 7683 int n_ctxt; 7684 char * arg; /* unused */ 7685 int n_arg; 7686 xmlNodePtr tree; /* a node defining a subtree */ 7687 int n_tree; 7688 xmlNodePtr node2; /* unused */ 7689 int n_node2; 7690 7691 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7692 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7693 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 7694 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7695 mem_base = xmlMemBlocks(); 7696 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7697 arg = gen_char_ptr(n_arg, 1); 7698 tree = gen_xmlNodePtr(n_tree, 2); 7699 node2 = gen_xmlNodePtr(n_node2, 3); 7700 7701 ret_val = xmlShellDu(ctxt, arg, tree, node2); 7702 desret_int(ret_val); 7703 call_tests++; 7704 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7705 des_char_ptr(n_arg, arg, 1); 7706 des_xmlNodePtr(n_tree, tree, 2); 7707 des_xmlNodePtr(n_node2, node2, 3); 7708 xmlResetLastError(); 7709 if (mem_base != xmlMemBlocks()) { 7710 printf("Leak of %d blocks found in xmlShellDu", 7711 xmlMemBlocks() - mem_base); 7712 test_ret++; 7713 printf(" %d", n_ctxt); 7714 printf(" %d", n_arg); 7715 printf(" %d", n_tree); 7716 printf(" %d", n_node2); 7717 printf("\n"); 7718 } 7719 } 7720 } 7721 } 7722 } 7723 function_tests++; 7724 #endif 7725 7726 return(test_ret); 7727 } 7728 7729 7730 static int 7731 test_xmlShellList(void) { 7732 int test_ret = 0; 7733 7734 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7735 int mem_base; 7736 int ret_val; 7737 xmlShellCtxtPtr ctxt; /* the shell context */ 7738 int n_ctxt; 7739 char * arg; /* unused */ 7740 int n_arg; 7741 xmlNodePtr node; /* a node */ 7742 int n_node; 7743 xmlNodePtr node2; /* unused */ 7744 int n_node2; 7745 7746 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7747 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { 7748 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7749 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7750 mem_base = xmlMemBlocks(); 7751 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7752 arg = gen_char_ptr(n_arg, 1); 7753 node = gen_xmlNodePtr(n_node, 2); 7754 node2 = gen_xmlNodePtr(n_node2, 3); 7755 7756 ret_val = xmlShellList(ctxt, arg, node, node2); 7757 desret_int(ret_val); 7758 call_tests++; 7759 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7760 des_char_ptr(n_arg, arg, 1); 7761 des_xmlNodePtr(n_node, node, 2); 7762 des_xmlNodePtr(n_node2, node2, 3); 7763 xmlResetLastError(); 7764 if (mem_base != xmlMemBlocks()) { 7765 printf("Leak of %d blocks found in xmlShellList", 7766 xmlMemBlocks() - mem_base); 7767 test_ret++; 7768 printf(" %d", n_ctxt); 7769 printf(" %d", n_arg); 7770 printf(" %d", n_node); 7771 printf(" %d", n_node2); 7772 printf("\n"); 7773 } 7774 } 7775 } 7776 } 7777 } 7778 function_tests++; 7779 #endif 7780 7781 return(test_ret); 7782 } 7783 7784 7785 static int 7786 test_xmlShellLoad(void) { 7787 int test_ret = 0; 7788 7789 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7790 int mem_base; 7791 int ret_val; 7792 xmlShellCtxtPtr ctxt; /* the shell context */ 7793 int n_ctxt; 7794 char * filename; /* the file name */ 7795 int n_filename; 7796 xmlNodePtr node; /* unused */ 7797 int n_node; 7798 xmlNodePtr node2; /* unused */ 7799 int n_node2; 7800 7801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7802 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { 7803 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7804 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7805 mem_base = xmlMemBlocks(); 7806 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7807 filename = gen_char_ptr(n_filename, 1); 7808 node = gen_xmlNodePtr(n_node, 2); 7809 node2 = gen_xmlNodePtr(n_node2, 3); 7810 7811 ret_val = xmlShellLoad(ctxt, filename, node, node2); 7812 desret_int(ret_val); 7813 call_tests++; 7814 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7815 des_char_ptr(n_filename, filename, 1); 7816 des_xmlNodePtr(n_node, node, 2); 7817 des_xmlNodePtr(n_node2, node2, 3); 7818 xmlResetLastError(); 7819 if (mem_base != xmlMemBlocks()) { 7820 printf("Leak of %d blocks found in xmlShellLoad", 7821 xmlMemBlocks() - mem_base); 7822 test_ret++; 7823 printf(" %d", n_ctxt); 7824 printf(" %d", n_filename); 7825 printf(" %d", n_node); 7826 printf(" %d", n_node2); 7827 printf("\n"); 7828 } 7829 } 7830 } 7831 } 7832 } 7833 function_tests++; 7834 #endif 7835 7836 return(test_ret); 7837 } 7838 7839 7840 static int 7841 test_xmlShellPrintXPathResult(void) { 7842 int test_ret = 0; 7843 7844 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7845 int mem_base; 7846 xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */ 7847 int n_list; 7848 7849 for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) { 7850 mem_base = xmlMemBlocks(); 7851 list = gen_xmlXPathObjectPtr(n_list, 0); 7852 7853 xmlShellPrintXPathResult(list); 7854 call_tests++; 7855 des_xmlXPathObjectPtr(n_list, list, 0); 7856 xmlResetLastError(); 7857 if (mem_base != xmlMemBlocks()) { 7858 printf("Leak of %d blocks found in xmlShellPrintXPathResult", 7859 xmlMemBlocks() - mem_base); 7860 test_ret++; 7861 printf(" %d", n_list); 7862 printf("\n"); 7863 } 7864 } 7865 function_tests++; 7866 #endif 7867 7868 return(test_ret); 7869 } 7870 7871 7872 static int 7873 test_xmlShellPwd(void) { 7874 int test_ret = 0; 7875 7876 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) 7877 int mem_base; 7878 int ret_val; 7879 xmlShellCtxtPtr ctxt; /* the shell context */ 7880 int n_ctxt; 7881 char * buffer; /* the output buffer */ 7882 int n_buffer; 7883 xmlNodePtr node; /* a node */ 7884 int n_node; 7885 xmlNodePtr node2; /* unused */ 7886 int n_node2; 7887 7888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7889 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 7890 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7891 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7892 mem_base = xmlMemBlocks(); 7893 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7894 buffer = gen_char_ptr(n_buffer, 1); 7895 node = gen_xmlNodePtr(n_node, 2); 7896 node2 = gen_xmlNodePtr(n_node2, 3); 7897 7898 ret_val = xmlShellPwd(ctxt, buffer, node, node2); 7899 desret_int(ret_val); 7900 call_tests++; 7901 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7902 des_char_ptr(n_buffer, buffer, 1); 7903 des_xmlNodePtr(n_node, node, 2); 7904 des_xmlNodePtr(n_node2, node2, 3); 7905 xmlResetLastError(); 7906 if (mem_base != xmlMemBlocks()) { 7907 printf("Leak of %d blocks found in xmlShellPwd", 7908 xmlMemBlocks() - mem_base); 7909 test_ret++; 7910 printf(" %d", n_ctxt); 7911 printf(" %d", n_buffer); 7912 printf(" %d", n_node); 7913 printf(" %d", n_node2); 7914 printf("\n"); 7915 } 7916 } 7917 } 7918 } 7919 } 7920 function_tests++; 7921 #endif 7922 7923 return(test_ret); 7924 } 7925 7926 7927 static int 7928 test_xmlShellSave(void) { 7929 int test_ret = 0; 7930 7931 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 7932 int mem_base; 7933 int ret_val; 7934 xmlShellCtxtPtr ctxt; /* the shell context */ 7935 int n_ctxt; 7936 char * filename; /* the file name (optional) */ 7937 int n_filename; 7938 xmlNodePtr node; /* unused */ 7939 int n_node; 7940 xmlNodePtr node2; /* unused */ 7941 int n_node2; 7942 7943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7944 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { 7945 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 7946 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 7947 mem_base = xmlMemBlocks(); 7948 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 7949 filename = gen_char_ptr(n_filename, 1); 7950 node = gen_xmlNodePtr(n_node, 2); 7951 node2 = gen_xmlNodePtr(n_node2, 3); 7952 7953 ret_val = xmlShellSave(ctxt, filename, node, node2); 7954 desret_int(ret_val); 7955 call_tests++; 7956 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 7957 des_char_ptr(n_filename, filename, 1); 7958 des_xmlNodePtr(n_node, node, 2); 7959 des_xmlNodePtr(n_node2, node2, 3); 7960 xmlResetLastError(); 7961 if (mem_base != xmlMemBlocks()) { 7962 printf("Leak of %d blocks found in xmlShellSave", 7963 xmlMemBlocks() - mem_base); 7964 test_ret++; 7965 printf(" %d", n_ctxt); 7966 printf(" %d", n_filename); 7967 printf(" %d", n_node); 7968 printf(" %d", n_node2); 7969 printf("\n"); 7970 } 7971 } 7972 } 7973 } 7974 } 7975 function_tests++; 7976 #endif 7977 7978 return(test_ret); 7979 } 7980 7981 7982 static int 7983 test_xmlShellValidate(void) { 7984 int test_ret = 0; 7985 7986 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED) 7987 int mem_base; 7988 int ret_val; 7989 xmlShellCtxtPtr ctxt; /* the shell context */ 7990 int n_ctxt; 7991 char * dtd; /* the DTD URI (optional) */ 7992 int n_dtd; 7993 xmlNodePtr node; /* unused */ 7994 int n_node; 7995 xmlNodePtr node2; /* unused */ 7996 int n_node2; 7997 7998 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 7999 for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) { 8000 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 8001 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 8002 mem_base = xmlMemBlocks(); 8003 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 8004 dtd = gen_char_ptr(n_dtd, 1); 8005 node = gen_xmlNodePtr(n_node, 2); 8006 node2 = gen_xmlNodePtr(n_node2, 3); 8007 8008 ret_val = xmlShellValidate(ctxt, dtd, node, node2); 8009 desret_int(ret_val); 8010 call_tests++; 8011 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 8012 des_char_ptr(n_dtd, dtd, 1); 8013 des_xmlNodePtr(n_node, node, 2); 8014 des_xmlNodePtr(n_node2, node2, 3); 8015 xmlResetLastError(); 8016 if (mem_base != xmlMemBlocks()) { 8017 printf("Leak of %d blocks found in xmlShellValidate", 8018 xmlMemBlocks() - mem_base); 8019 test_ret++; 8020 printf(" %d", n_ctxt); 8021 printf(" %d", n_dtd); 8022 printf(" %d", n_node); 8023 printf(" %d", n_node2); 8024 printf("\n"); 8025 } 8026 } 8027 } 8028 } 8029 } 8030 function_tests++; 8031 #endif 8032 8033 return(test_ret); 8034 } 8035 8036 8037 static int 8038 test_xmlShellWrite(void) { 8039 int test_ret = 0; 8040 8041 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 8042 int mem_base; 8043 int ret_val; 8044 xmlShellCtxtPtr ctxt; /* the shell context */ 8045 int n_ctxt; 8046 char * filename; /* the file name */ 8047 int n_filename; 8048 xmlNodePtr node; /* a node in the tree */ 8049 int n_node; 8050 xmlNodePtr node2; /* unused */ 8051 int n_node2; 8052 8053 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { 8054 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { 8055 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 8056 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { 8057 mem_base = xmlMemBlocks(); 8058 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); 8059 filename = gen_char_ptr(n_filename, 1); 8060 node = gen_xmlNodePtr(n_node, 2); 8061 node2 = gen_xmlNodePtr(n_node2, 3); 8062 8063 ret_val = xmlShellWrite(ctxt, filename, node, node2); 8064 desret_int(ret_val); 8065 call_tests++; 8066 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); 8067 des_char_ptr(n_filename, filename, 1); 8068 des_xmlNodePtr(n_node, node, 2); 8069 des_xmlNodePtr(n_node2, node2, 3); 8070 xmlResetLastError(); 8071 if (mem_base != xmlMemBlocks()) { 8072 printf("Leak of %d blocks found in xmlShellWrite", 8073 xmlMemBlocks() - mem_base); 8074 test_ret++; 8075 printf(" %d", n_ctxt); 8076 printf(" %d", n_filename); 8077 printf(" %d", n_node); 8078 printf(" %d", n_node2); 8079 printf("\n"); 8080 } 8081 } 8082 } 8083 } 8084 } 8085 function_tests++; 8086 #endif 8087 8088 return(test_ret); 8089 } 8090 8091 static int 8092 test_debugXML(void) { 8093 int test_ret = 0; 8094 8095 if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n"); 8096 test_ret += test_xmlBoolToText(); 8097 test_ret += test_xmlDebugCheckDocument(); 8098 test_ret += test_xmlDebugDumpAttr(); 8099 test_ret += test_xmlDebugDumpAttrList(); 8100 test_ret += test_xmlDebugDumpDTD(); 8101 test_ret += test_xmlDebugDumpDocument(); 8102 test_ret += test_xmlDebugDumpDocumentHead(); 8103 test_ret += test_xmlDebugDumpEntities(); 8104 test_ret += test_xmlDebugDumpNode(); 8105 test_ret += test_xmlDebugDumpNodeList(); 8106 test_ret += test_xmlDebugDumpOneNode(); 8107 test_ret += test_xmlDebugDumpString(); 8108 test_ret += test_xmlLsCountNode(); 8109 test_ret += test_xmlLsOneNode(); 8110 test_ret += test_xmlShell(); 8111 test_ret += test_xmlShellBase(); 8112 test_ret += test_xmlShellCat(); 8113 test_ret += test_xmlShellDir(); 8114 test_ret += test_xmlShellDu(); 8115 test_ret += test_xmlShellList(); 8116 test_ret += test_xmlShellLoad(); 8117 test_ret += test_xmlShellPrintXPathResult(); 8118 test_ret += test_xmlShellPwd(); 8119 test_ret += test_xmlShellSave(); 8120 test_ret += test_xmlShellValidate(); 8121 test_ret += test_xmlShellWrite(); 8122 8123 if (test_ret != 0) 8124 printf("Module debugXML: %d errors\n", test_ret); 8125 return(test_ret); 8126 } 8127 8128 static int 8129 test_xmlDictCleanup(void) { 8130 int test_ret = 0; 8131 8132 int mem_base; 8133 8134 mem_base = xmlMemBlocks(); 8135 8136 xmlDictCleanup(); 8137 call_tests++; 8138 xmlResetLastError(); 8139 if (mem_base != xmlMemBlocks()) { 8140 printf("Leak of %d blocks found in xmlDictCleanup", 8141 xmlMemBlocks() - mem_base); 8142 test_ret++; 8143 printf("\n"); 8144 } 8145 function_tests++; 8146 8147 return(test_ret); 8148 } 8149 8150 8151 static int 8152 test_xmlDictCreate(void) { 8153 int test_ret = 0; 8154 8155 int mem_base; 8156 xmlDictPtr ret_val; 8157 8158 mem_base = xmlMemBlocks(); 8159 8160 ret_val = xmlDictCreate(); 8161 desret_xmlDictPtr(ret_val); 8162 call_tests++; 8163 xmlResetLastError(); 8164 if (mem_base != xmlMemBlocks()) { 8165 printf("Leak of %d blocks found in xmlDictCreate", 8166 xmlMemBlocks() - mem_base); 8167 test_ret++; 8168 printf("\n"); 8169 } 8170 function_tests++; 8171 8172 return(test_ret); 8173 } 8174 8175 8176 static int 8177 test_xmlDictCreateSub(void) { 8178 int test_ret = 0; 8179 8180 int mem_base; 8181 xmlDictPtr ret_val; 8182 xmlDictPtr sub; /* an existing dictionnary */ 8183 int n_sub; 8184 8185 for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) { 8186 mem_base = xmlMemBlocks(); 8187 sub = gen_xmlDictPtr(n_sub, 0); 8188 8189 ret_val = xmlDictCreateSub(sub); 8190 desret_xmlDictPtr(ret_val); 8191 call_tests++; 8192 des_xmlDictPtr(n_sub, sub, 0); 8193 xmlResetLastError(); 8194 if (mem_base != xmlMemBlocks()) { 8195 printf("Leak of %d blocks found in xmlDictCreateSub", 8196 xmlMemBlocks() - mem_base); 8197 test_ret++; 8198 printf(" %d", n_sub); 8199 printf("\n"); 8200 } 8201 } 8202 function_tests++; 8203 8204 return(test_ret); 8205 } 8206 8207 8208 static int 8209 test_xmlDictExists(void) { 8210 int test_ret = 0; 8211 8212 int mem_base; 8213 const xmlChar * ret_val; 8214 xmlDictPtr dict; /* the dictionnary */ 8215 int n_dict; 8216 xmlChar * name; /* the name of the userdata */ 8217 int n_name; 8218 int len; /* the length of the name, if -1 it is recomputed */ 8219 int n_len; 8220 8221 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8222 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 8223 for (n_len = 0;n_len < gen_nb_int;n_len++) { 8224 mem_base = xmlMemBlocks(); 8225 dict = gen_xmlDictPtr(n_dict, 0); 8226 name = gen_const_xmlChar_ptr(n_name, 1); 8227 len = gen_int(n_len, 2); 8228 8229 ret_val = xmlDictExists(dict, (const xmlChar *)name, len); 8230 desret_const_xmlChar_ptr(ret_val); 8231 call_tests++; 8232 des_xmlDictPtr(n_dict, dict, 0); 8233 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 8234 des_int(n_len, len, 2); 8235 xmlResetLastError(); 8236 if (mem_base != xmlMemBlocks()) { 8237 printf("Leak of %d blocks found in xmlDictExists", 8238 xmlMemBlocks() - mem_base); 8239 test_ret++; 8240 printf(" %d", n_dict); 8241 printf(" %d", n_name); 8242 printf(" %d", n_len); 8243 printf("\n"); 8244 } 8245 } 8246 } 8247 } 8248 function_tests++; 8249 8250 return(test_ret); 8251 } 8252 8253 8254 static int 8255 test_xmlDictLookup(void) { 8256 int test_ret = 0; 8257 8258 int mem_base; 8259 const xmlChar * ret_val; 8260 xmlDictPtr dict; /* the dictionnary */ 8261 int n_dict; 8262 xmlChar * name; /* the name of the userdata */ 8263 int n_name; 8264 int len; /* the length of the name, if -1 it is recomputed */ 8265 int n_len; 8266 8267 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8268 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 8269 for (n_len = 0;n_len < gen_nb_int;n_len++) { 8270 mem_base = xmlMemBlocks(); 8271 dict = gen_xmlDictPtr(n_dict, 0); 8272 name = gen_const_xmlChar_ptr(n_name, 1); 8273 len = gen_int(n_len, 2); 8274 8275 ret_val = xmlDictLookup(dict, (const xmlChar *)name, len); 8276 desret_const_xmlChar_ptr(ret_val); 8277 call_tests++; 8278 des_xmlDictPtr(n_dict, dict, 0); 8279 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 8280 des_int(n_len, len, 2); 8281 xmlResetLastError(); 8282 if (mem_base != xmlMemBlocks()) { 8283 printf("Leak of %d blocks found in xmlDictLookup", 8284 xmlMemBlocks() - mem_base); 8285 test_ret++; 8286 printf(" %d", n_dict); 8287 printf(" %d", n_name); 8288 printf(" %d", n_len); 8289 printf("\n"); 8290 } 8291 } 8292 } 8293 } 8294 function_tests++; 8295 8296 return(test_ret); 8297 } 8298 8299 8300 static int 8301 test_xmlDictOwns(void) { 8302 int test_ret = 0; 8303 8304 int mem_base; 8305 int ret_val; 8306 xmlDictPtr dict; /* the dictionnary */ 8307 int n_dict; 8308 xmlChar * str; /* the string */ 8309 int n_str; 8310 8311 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8312 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 8313 mem_base = xmlMemBlocks(); 8314 dict = gen_xmlDictPtr(n_dict, 0); 8315 str = gen_const_xmlChar_ptr(n_str, 1); 8316 8317 ret_val = xmlDictOwns(dict, (const xmlChar *)str); 8318 desret_int(ret_val); 8319 call_tests++; 8320 des_xmlDictPtr(n_dict, dict, 0); 8321 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 8322 xmlResetLastError(); 8323 if (mem_base != xmlMemBlocks()) { 8324 printf("Leak of %d blocks found in xmlDictOwns", 8325 xmlMemBlocks() - mem_base); 8326 test_ret++; 8327 printf(" %d", n_dict); 8328 printf(" %d", n_str); 8329 printf("\n"); 8330 } 8331 } 8332 } 8333 function_tests++; 8334 8335 return(test_ret); 8336 } 8337 8338 8339 static int 8340 test_xmlDictQLookup(void) { 8341 int test_ret = 0; 8342 8343 int mem_base; 8344 const xmlChar * ret_val; 8345 xmlDictPtr dict; /* the dictionnary */ 8346 int n_dict; 8347 xmlChar * prefix; /* the prefix */ 8348 int n_prefix; 8349 xmlChar * name; /* the name */ 8350 int n_name; 8351 8352 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8353 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 8354 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 8355 mem_base = xmlMemBlocks(); 8356 dict = gen_xmlDictPtr(n_dict, 0); 8357 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 8358 name = gen_const_xmlChar_ptr(n_name, 2); 8359 8360 ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name); 8361 desret_const_xmlChar_ptr(ret_val); 8362 call_tests++; 8363 des_xmlDictPtr(n_dict, dict, 0); 8364 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 8365 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 8366 xmlResetLastError(); 8367 if (mem_base != xmlMemBlocks()) { 8368 printf("Leak of %d blocks found in xmlDictQLookup", 8369 xmlMemBlocks() - mem_base); 8370 test_ret++; 8371 printf(" %d", n_dict); 8372 printf(" %d", n_prefix); 8373 printf(" %d", n_name); 8374 printf("\n"); 8375 } 8376 } 8377 } 8378 } 8379 function_tests++; 8380 8381 return(test_ret); 8382 } 8383 8384 8385 static int 8386 test_xmlDictReference(void) { 8387 int test_ret = 0; 8388 8389 int mem_base; 8390 int ret_val; 8391 xmlDictPtr dict; /* the dictionnary */ 8392 int n_dict; 8393 8394 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8395 mem_base = xmlMemBlocks(); 8396 dict = gen_xmlDictPtr(n_dict, 0); 8397 8398 ret_val = xmlDictReference(dict); 8399 xmlDictFree(dict); 8400 desret_int(ret_val); 8401 call_tests++; 8402 des_xmlDictPtr(n_dict, dict, 0); 8403 xmlResetLastError(); 8404 if (mem_base != xmlMemBlocks()) { 8405 printf("Leak of %d blocks found in xmlDictReference", 8406 xmlMemBlocks() - mem_base); 8407 test_ret++; 8408 printf(" %d", n_dict); 8409 printf("\n"); 8410 } 8411 } 8412 function_tests++; 8413 8414 return(test_ret); 8415 } 8416 8417 8418 static int 8419 test_xmlDictSize(void) { 8420 int test_ret = 0; 8421 8422 int mem_base; 8423 int ret_val; 8424 xmlDictPtr dict; /* the dictionnary */ 8425 int n_dict; 8426 8427 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { 8428 mem_base = xmlMemBlocks(); 8429 dict = gen_xmlDictPtr(n_dict, 0); 8430 8431 ret_val = xmlDictSize(dict); 8432 desret_int(ret_val); 8433 call_tests++; 8434 des_xmlDictPtr(n_dict, dict, 0); 8435 xmlResetLastError(); 8436 if (mem_base != xmlMemBlocks()) { 8437 printf("Leak of %d blocks found in xmlDictSize", 8438 xmlMemBlocks() - mem_base); 8439 test_ret++; 8440 printf(" %d", n_dict); 8441 printf("\n"); 8442 } 8443 } 8444 function_tests++; 8445 8446 return(test_ret); 8447 } 8448 8449 static int 8450 test_dict(void) { 8451 int test_ret = 0; 8452 8453 if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n"); 8454 test_ret += test_xmlDictCleanup(); 8455 test_ret += test_xmlDictCreate(); 8456 test_ret += test_xmlDictCreateSub(); 8457 test_ret += test_xmlDictExists(); 8458 test_ret += test_xmlDictLookup(); 8459 test_ret += test_xmlDictOwns(); 8460 test_ret += test_xmlDictQLookup(); 8461 test_ret += test_xmlDictReference(); 8462 test_ret += test_xmlDictSize(); 8463 8464 if (test_ret != 0) 8465 printf("Module dict: %d errors\n", test_ret); 8466 return(test_ret); 8467 } 8468 8469 static int 8470 test_UTF8Toisolat1(void) { 8471 int test_ret = 0; 8472 8473 #if defined(LIBXML_OUTPUT_ENABLED) 8474 #ifdef LIBXML_OUTPUT_ENABLED 8475 int mem_base; 8476 int ret_val; 8477 unsigned char * out; /* a pointer to an array of bytes to store the result */ 8478 int n_out; 8479 int * outlen; /* the length of @out */ 8480 int n_outlen; 8481 unsigned char * in; /* a pointer to an array of UTF-8 chars */ 8482 int n_in; 8483 int * inlen; /* the length of @in */ 8484 int n_inlen; 8485 8486 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 8487 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 8488 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 8489 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 8490 mem_base = xmlMemBlocks(); 8491 out = gen_unsigned_char_ptr(n_out, 0); 8492 outlen = gen_int_ptr(n_outlen, 1); 8493 in = gen_const_unsigned_char_ptr(n_in, 2); 8494 inlen = gen_int_ptr(n_inlen, 3); 8495 8496 ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen); 8497 desret_int(ret_val); 8498 call_tests++; 8499 des_unsigned_char_ptr(n_out, out, 0); 8500 des_int_ptr(n_outlen, outlen, 1); 8501 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 8502 des_int_ptr(n_inlen, inlen, 3); 8503 xmlResetLastError(); 8504 if (mem_base != xmlMemBlocks()) { 8505 printf("Leak of %d blocks found in UTF8Toisolat1", 8506 xmlMemBlocks() - mem_base); 8507 test_ret++; 8508 printf(" %d", n_out); 8509 printf(" %d", n_outlen); 8510 printf(" %d", n_in); 8511 printf(" %d", n_inlen); 8512 printf("\n"); 8513 } 8514 } 8515 } 8516 } 8517 } 8518 function_tests++; 8519 #endif 8520 #endif 8521 8522 return(test_ret); 8523 } 8524 8525 8526 static int 8527 test_isolat1ToUTF8(void) { 8528 int test_ret = 0; 8529 8530 int mem_base; 8531 int ret_val; 8532 unsigned char * out; /* a pointer to an array of bytes to store the result */ 8533 int n_out; 8534 int * outlen; /* the length of @out */ 8535 int n_outlen; 8536 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */ 8537 int n_in; 8538 int * inlen; /* the length of @in */ 8539 int n_inlen; 8540 8541 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { 8542 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { 8543 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 8544 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { 8545 mem_base = xmlMemBlocks(); 8546 out = gen_unsigned_char_ptr(n_out, 0); 8547 outlen = gen_int_ptr(n_outlen, 1); 8548 in = gen_const_unsigned_char_ptr(n_in, 2); 8549 inlen = gen_int_ptr(n_inlen, 3); 8550 8551 ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen); 8552 desret_int(ret_val); 8553 call_tests++; 8554 des_unsigned_char_ptr(n_out, out, 0); 8555 des_int_ptr(n_outlen, outlen, 1); 8556 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); 8557 des_int_ptr(n_inlen, inlen, 3); 8558 xmlResetLastError(); 8559 if (mem_base != xmlMemBlocks()) { 8560 printf("Leak of %d blocks found in isolat1ToUTF8", 8561 xmlMemBlocks() - mem_base); 8562 test_ret++; 8563 printf(" %d", n_out); 8564 printf(" %d", n_outlen); 8565 printf(" %d", n_in); 8566 printf(" %d", n_inlen); 8567 printf("\n"); 8568 } 8569 } 8570 } 8571 } 8572 } 8573 function_tests++; 8574 8575 return(test_ret); 8576 } 8577 8578 8579 static int 8580 test_xmlAddEncodingAlias(void) { 8581 int test_ret = 0; 8582 8583 int ret_val; 8584 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ 8585 int n_name; 8586 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ 8587 int n_alias; 8588 8589 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 8590 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { 8591 name = gen_const_char_ptr(n_name, 0); 8592 alias = gen_const_char_ptr(n_alias, 1); 8593 8594 ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias); 8595 desret_int(ret_val); 8596 call_tests++; 8597 des_const_char_ptr(n_name, (const char *)name, 0); 8598 des_const_char_ptr(n_alias, (const char *)alias, 1); 8599 xmlResetLastError(); 8600 } 8601 } 8602 function_tests++; 8603 8604 return(test_ret); 8605 } 8606 8607 8608 #define gen_nb_xmlCharEncodingHandler_ptr 1 8609 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 8610 return(NULL); 8611 } 8612 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 8613 } 8614 8615 static int 8616 test_xmlCharEncCloseFunc(void) { 8617 int test_ret = 0; 8618 8619 int mem_base; 8620 int ret_val; 8621 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ 8622 int n_handler; 8623 8624 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8625 mem_base = xmlMemBlocks(); 8626 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8627 8628 ret_val = xmlCharEncCloseFunc(handler); 8629 desret_int(ret_val); 8630 call_tests++; 8631 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8632 xmlResetLastError(); 8633 if (mem_base != xmlMemBlocks()) { 8634 printf("Leak of %d blocks found in xmlCharEncCloseFunc", 8635 xmlMemBlocks() - mem_base); 8636 test_ret++; 8637 printf(" %d", n_handler); 8638 printf("\n"); 8639 } 8640 } 8641 function_tests++; 8642 8643 return(test_ret); 8644 } 8645 8646 8647 static int 8648 test_xmlCharEncFirstLine(void) { 8649 int test_ret = 0; 8650 8651 int mem_base; 8652 int ret_val; 8653 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ 8654 int n_handler; 8655 xmlBufferPtr out; /* an xmlBuffer for the output. */ 8656 int n_out; 8657 xmlBufferPtr in; /* an xmlBuffer for the input */ 8658 int n_in; 8659 8660 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8661 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { 8662 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { 8663 mem_base = xmlMemBlocks(); 8664 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8665 out = gen_xmlBufferPtr(n_out, 1); 8666 in = gen_xmlBufferPtr(n_in, 2); 8667 8668 ret_val = xmlCharEncFirstLine(handler, out, in); 8669 desret_int(ret_val); 8670 call_tests++; 8671 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8672 des_xmlBufferPtr(n_out, out, 1); 8673 des_xmlBufferPtr(n_in, in, 2); 8674 xmlResetLastError(); 8675 if (mem_base != xmlMemBlocks()) { 8676 printf("Leak of %d blocks found in xmlCharEncFirstLine", 8677 xmlMemBlocks() - mem_base); 8678 test_ret++; 8679 printf(" %d", n_handler); 8680 printf(" %d", n_out); 8681 printf(" %d", n_in); 8682 printf("\n"); 8683 } 8684 } 8685 } 8686 } 8687 function_tests++; 8688 8689 return(test_ret); 8690 } 8691 8692 8693 static int 8694 test_xmlCharEncInFunc(void) { 8695 int test_ret = 0; 8696 8697 int mem_base; 8698 int ret_val; 8699 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */ 8700 int n_handler; 8701 xmlBufferPtr out; /* an xmlBuffer for the output. */ 8702 int n_out; 8703 xmlBufferPtr in; /* an xmlBuffer for the input */ 8704 int n_in; 8705 8706 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8707 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { 8708 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { 8709 mem_base = xmlMemBlocks(); 8710 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8711 out = gen_xmlBufferPtr(n_out, 1); 8712 in = gen_xmlBufferPtr(n_in, 2); 8713 8714 ret_val = xmlCharEncInFunc(handler, out, in); 8715 desret_int(ret_val); 8716 call_tests++; 8717 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8718 des_xmlBufferPtr(n_out, out, 1); 8719 des_xmlBufferPtr(n_in, in, 2); 8720 xmlResetLastError(); 8721 if (mem_base != xmlMemBlocks()) { 8722 printf("Leak of %d blocks found in xmlCharEncInFunc", 8723 xmlMemBlocks() - mem_base); 8724 test_ret++; 8725 printf(" %d", n_handler); 8726 printf(" %d", n_out); 8727 printf(" %d", n_in); 8728 printf("\n"); 8729 } 8730 } 8731 } 8732 } 8733 function_tests++; 8734 8735 return(test_ret); 8736 } 8737 8738 8739 static int 8740 test_xmlCharEncOutFunc(void) { 8741 int test_ret = 0; 8742 8743 int mem_base; 8744 int ret_val; 8745 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ 8746 int n_handler; 8747 xmlBufferPtr out; /* an xmlBuffer for the output. */ 8748 int n_out; 8749 xmlBufferPtr in; /* an xmlBuffer for the input */ 8750 int n_in; 8751 8752 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { 8753 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { 8754 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { 8755 mem_base = xmlMemBlocks(); 8756 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); 8757 out = gen_xmlBufferPtr(n_out, 1); 8758 in = gen_xmlBufferPtr(n_in, 2); 8759 8760 ret_val = xmlCharEncOutFunc(handler, out, in); 8761 desret_int(ret_val); 8762 call_tests++; 8763 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); 8764 des_xmlBufferPtr(n_out, out, 1); 8765 des_xmlBufferPtr(n_in, in, 2); 8766 xmlResetLastError(); 8767 if (mem_base != xmlMemBlocks()) { 8768 printf("Leak of %d blocks found in xmlCharEncOutFunc", 8769 xmlMemBlocks() - mem_base); 8770 test_ret++; 8771 printf(" %d", n_handler); 8772 printf(" %d", n_out); 8773 printf(" %d", n_in); 8774 printf("\n"); 8775 } 8776 } 8777 } 8778 } 8779 function_tests++; 8780 8781 return(test_ret); 8782 } 8783 8784 8785 static int 8786 test_xmlCleanupCharEncodingHandlers(void) { 8787 int test_ret = 0; 8788 8789 8790 8791 xmlCleanupCharEncodingHandlers(); 8792 call_tests++; 8793 xmlResetLastError(); 8794 function_tests++; 8795 8796 return(test_ret); 8797 } 8798 8799 8800 static int 8801 test_xmlCleanupEncodingAliases(void) { 8802 int test_ret = 0; 8803 8804 int mem_base; 8805 8806 mem_base = xmlMemBlocks(); 8807 8808 xmlCleanupEncodingAliases(); 8809 call_tests++; 8810 xmlResetLastError(); 8811 if (mem_base != xmlMemBlocks()) { 8812 printf("Leak of %d blocks found in xmlCleanupEncodingAliases", 8813 xmlMemBlocks() - mem_base); 8814 test_ret++; 8815 printf("\n"); 8816 } 8817 function_tests++; 8818 8819 return(test_ret); 8820 } 8821 8822 8823 static int 8824 test_xmlDelEncodingAlias(void) { 8825 int test_ret = 0; 8826 8827 int mem_base; 8828 int ret_val; 8829 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ 8830 int n_alias; 8831 8832 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { 8833 mem_base = xmlMemBlocks(); 8834 alias = gen_const_char_ptr(n_alias, 0); 8835 8836 ret_val = xmlDelEncodingAlias((const char *)alias); 8837 desret_int(ret_val); 8838 call_tests++; 8839 des_const_char_ptr(n_alias, (const char *)alias, 0); 8840 xmlResetLastError(); 8841 if (mem_base != xmlMemBlocks()) { 8842 printf("Leak of %d blocks found in xmlDelEncodingAlias", 8843 xmlMemBlocks() - mem_base); 8844 test_ret++; 8845 printf(" %d", n_alias); 8846 printf("\n"); 8847 } 8848 } 8849 function_tests++; 8850 8851 return(test_ret); 8852 } 8853 8854 8855 static int 8856 test_xmlDetectCharEncoding(void) { 8857 int test_ret = 0; 8858 8859 int mem_base; 8860 xmlCharEncoding ret_val; 8861 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). */ 8862 int n_in; 8863 int len; /* pointer to the length of the buffer */ 8864 int n_len; 8865 8866 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { 8867 for (n_len = 0;n_len < gen_nb_int;n_len++) { 8868 mem_base = xmlMemBlocks(); 8869 in = gen_const_unsigned_char_ptr(n_in, 0); 8870 len = gen_int(n_len, 1); 8871 8872 ret_val = xmlDetectCharEncoding((const unsigned char *)in, len); 8873 desret_xmlCharEncoding(ret_val); 8874 call_tests++; 8875 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0); 8876 des_int(n_len, len, 1); 8877 xmlResetLastError(); 8878 if (mem_base != xmlMemBlocks()) { 8879 printf("Leak of %d blocks found in xmlDetectCharEncoding", 8880 xmlMemBlocks() - mem_base); 8881 test_ret++; 8882 printf(" %d", n_in); 8883 printf(" %d", n_len); 8884 printf("\n"); 8885 } 8886 } 8887 } 8888 function_tests++; 8889 8890 return(test_ret); 8891 } 8892 8893 8894 static int 8895 test_xmlFindCharEncodingHandler(void) { 8896 int test_ret = 0; 8897 8898 8899 /* missing type support */ 8900 return(test_ret); 8901 } 8902 8903 8904 static int 8905 test_xmlGetCharEncodingHandler(void) { 8906 int test_ret = 0; 8907 8908 8909 /* missing type support */ 8910 return(test_ret); 8911 } 8912 8913 8914 static int 8915 test_xmlGetCharEncodingName(void) { 8916 int test_ret = 0; 8917 8918 int mem_base; 8919 const char * ret_val; 8920 xmlCharEncoding enc; /* the encoding */ 8921 int n_enc; 8922 8923 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 8924 mem_base = xmlMemBlocks(); 8925 enc = gen_xmlCharEncoding(n_enc, 0); 8926 8927 ret_val = xmlGetCharEncodingName(enc); 8928 desret_const_char_ptr(ret_val); 8929 call_tests++; 8930 des_xmlCharEncoding(n_enc, enc, 0); 8931 xmlResetLastError(); 8932 if (mem_base != xmlMemBlocks()) { 8933 printf("Leak of %d blocks found in xmlGetCharEncodingName", 8934 xmlMemBlocks() - mem_base); 8935 test_ret++; 8936 printf(" %d", n_enc); 8937 printf("\n"); 8938 } 8939 } 8940 function_tests++; 8941 8942 return(test_ret); 8943 } 8944 8945 8946 static int 8947 test_xmlGetEncodingAlias(void) { 8948 int test_ret = 0; 8949 8950 int mem_base; 8951 const char * ret_val; 8952 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ 8953 int n_alias; 8954 8955 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { 8956 mem_base = xmlMemBlocks(); 8957 alias = gen_const_char_ptr(n_alias, 0); 8958 8959 ret_val = xmlGetEncodingAlias((const char *)alias); 8960 desret_const_char_ptr(ret_val); 8961 call_tests++; 8962 des_const_char_ptr(n_alias, (const char *)alias, 0); 8963 xmlResetLastError(); 8964 if (mem_base != xmlMemBlocks()) { 8965 printf("Leak of %d blocks found in xmlGetEncodingAlias", 8966 xmlMemBlocks() - mem_base); 8967 test_ret++; 8968 printf(" %d", n_alias); 8969 printf("\n"); 8970 } 8971 } 8972 function_tests++; 8973 8974 return(test_ret); 8975 } 8976 8977 8978 static int 8979 test_xmlInitCharEncodingHandlers(void) { 8980 int test_ret = 0; 8981 8982 8983 8984 xmlInitCharEncodingHandlers(); 8985 call_tests++; 8986 xmlResetLastError(); 8987 function_tests++; 8988 8989 return(test_ret); 8990 } 8991 8992 8993 static int 8994 test_xmlNewCharEncodingHandler(void) { 8995 int test_ret = 0; 8996 8997 8998 /* missing type support */ 8999 return(test_ret); 9000 } 9001 9002 9003 static int 9004 test_xmlParseCharEncoding(void) { 9005 int test_ret = 0; 9006 9007 int mem_base; 9008 xmlCharEncoding ret_val; 9009 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ 9010 int n_name; 9011 9012 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 9013 mem_base = xmlMemBlocks(); 9014 name = gen_const_char_ptr(n_name, 0); 9015 9016 ret_val = xmlParseCharEncoding((const char *)name); 9017 desret_xmlCharEncoding(ret_val); 9018 call_tests++; 9019 des_const_char_ptr(n_name, (const char *)name, 0); 9020 xmlResetLastError(); 9021 if (mem_base != xmlMemBlocks()) { 9022 printf("Leak of %d blocks found in xmlParseCharEncoding", 9023 xmlMemBlocks() - mem_base); 9024 test_ret++; 9025 printf(" %d", n_name); 9026 printf("\n"); 9027 } 9028 } 9029 function_tests++; 9030 9031 return(test_ret); 9032 } 9033 9034 9035 #define gen_nb_xmlCharEncodingHandlerPtr 1 9036 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9037 return(NULL); 9038 } 9039 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9040 } 9041 9042 static int 9043 test_xmlRegisterCharEncodingHandler(void) { 9044 int test_ret = 0; 9045 9046 int mem_base; 9047 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */ 9048 int n_handler; 9049 9050 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { 9051 mem_base = xmlMemBlocks(); 9052 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0); 9053 9054 xmlRegisterCharEncodingHandler(handler); 9055 call_tests++; 9056 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0); 9057 xmlResetLastError(); 9058 if (mem_base != xmlMemBlocks()) { 9059 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler", 9060 xmlMemBlocks() - mem_base); 9061 test_ret++; 9062 printf(" %d", n_handler); 9063 printf("\n"); 9064 } 9065 } 9066 function_tests++; 9067 9068 return(test_ret); 9069 } 9070 9071 static int 9072 test_encoding(void) { 9073 int test_ret = 0; 9074 9075 if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n"); 9076 test_ret += test_UTF8Toisolat1(); 9077 test_ret += test_isolat1ToUTF8(); 9078 test_ret += test_xmlAddEncodingAlias(); 9079 test_ret += test_xmlCharEncCloseFunc(); 9080 test_ret += test_xmlCharEncFirstLine(); 9081 test_ret += test_xmlCharEncInFunc(); 9082 test_ret += test_xmlCharEncOutFunc(); 9083 test_ret += test_xmlCleanupCharEncodingHandlers(); 9084 test_ret += test_xmlCleanupEncodingAliases(); 9085 test_ret += test_xmlDelEncodingAlias(); 9086 test_ret += test_xmlDetectCharEncoding(); 9087 test_ret += test_xmlFindCharEncodingHandler(); 9088 test_ret += test_xmlGetCharEncodingHandler(); 9089 test_ret += test_xmlGetCharEncodingName(); 9090 test_ret += test_xmlGetEncodingAlias(); 9091 test_ret += test_xmlInitCharEncodingHandlers(); 9092 test_ret += test_xmlNewCharEncodingHandler(); 9093 test_ret += test_xmlParseCharEncoding(); 9094 test_ret += test_xmlRegisterCharEncodingHandler(); 9095 9096 if (test_ret != 0) 9097 printf("Module encoding: %d errors\n", test_ret); 9098 return(test_ret); 9099 } 9100 9101 static int 9102 test_xmlAddDocEntity(void) { 9103 int test_ret = 0; 9104 9105 int mem_base; 9106 xmlEntityPtr ret_val; 9107 xmlDocPtr doc; /* the document */ 9108 int n_doc; 9109 xmlChar * name; /* the entity name */ 9110 int n_name; 9111 int type; /* the entity type XML_xxx_yyy_ENTITY */ 9112 int n_type; 9113 xmlChar * ExternalID; /* the entity external ID if available */ 9114 int n_ExternalID; 9115 xmlChar * SystemID; /* the entity system ID if available */ 9116 int n_SystemID; 9117 xmlChar * content; /* the entity content */ 9118 int n_content; 9119 9120 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9121 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9122 for (n_type = 0;n_type < gen_nb_int;n_type++) { 9123 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 9124 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 9125 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 9126 mem_base = xmlMemBlocks(); 9127 doc = gen_xmlDocPtr(n_doc, 0); 9128 name = gen_const_xmlChar_ptr(n_name, 1); 9129 type = gen_int(n_type, 2); 9130 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); 9131 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); 9132 content = gen_const_xmlChar_ptr(n_content, 5); 9133 9134 ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); 9135 desret_xmlEntityPtr(ret_val); 9136 call_tests++; 9137 des_xmlDocPtr(n_doc, doc, 0); 9138 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9139 des_int(n_type, type, 2); 9140 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); 9141 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); 9142 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); 9143 xmlResetLastError(); 9144 if (mem_base != xmlMemBlocks()) { 9145 printf("Leak of %d blocks found in xmlAddDocEntity", 9146 xmlMemBlocks() - mem_base); 9147 test_ret++; 9148 printf(" %d", n_doc); 9149 printf(" %d", n_name); 9150 printf(" %d", n_type); 9151 printf(" %d", n_ExternalID); 9152 printf(" %d", n_SystemID); 9153 printf(" %d", n_content); 9154 printf("\n"); 9155 } 9156 } 9157 } 9158 } 9159 } 9160 } 9161 } 9162 function_tests++; 9163 9164 return(test_ret); 9165 } 9166 9167 9168 static int 9169 test_xmlAddDtdEntity(void) { 9170 int test_ret = 0; 9171 9172 int mem_base; 9173 xmlEntityPtr ret_val; 9174 xmlDocPtr doc; /* the document */ 9175 int n_doc; 9176 xmlChar * name; /* the entity name */ 9177 int n_name; 9178 int type; /* the entity type XML_xxx_yyy_ENTITY */ 9179 int n_type; 9180 xmlChar * ExternalID; /* the entity external ID if available */ 9181 int n_ExternalID; 9182 xmlChar * SystemID; /* the entity system ID if available */ 9183 int n_SystemID; 9184 xmlChar * content; /* the entity content */ 9185 int n_content; 9186 9187 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9188 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9189 for (n_type = 0;n_type < gen_nb_int;n_type++) { 9190 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 9191 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 9192 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 9193 mem_base = xmlMemBlocks(); 9194 doc = gen_xmlDocPtr(n_doc, 0); 9195 name = gen_const_xmlChar_ptr(n_name, 1); 9196 type = gen_int(n_type, 2); 9197 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); 9198 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); 9199 content = gen_const_xmlChar_ptr(n_content, 5); 9200 9201 ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); 9202 desret_xmlEntityPtr(ret_val); 9203 call_tests++; 9204 des_xmlDocPtr(n_doc, doc, 0); 9205 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9206 des_int(n_type, type, 2); 9207 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); 9208 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); 9209 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); 9210 xmlResetLastError(); 9211 if (mem_base != xmlMemBlocks()) { 9212 printf("Leak of %d blocks found in xmlAddDtdEntity", 9213 xmlMemBlocks() - mem_base); 9214 test_ret++; 9215 printf(" %d", n_doc); 9216 printf(" %d", n_name); 9217 printf(" %d", n_type); 9218 printf(" %d", n_ExternalID); 9219 printf(" %d", n_SystemID); 9220 printf(" %d", n_content); 9221 printf("\n"); 9222 } 9223 } 9224 } 9225 } 9226 } 9227 } 9228 } 9229 function_tests++; 9230 9231 return(test_ret); 9232 } 9233 9234 9235 static int 9236 test_xmlCleanupPredefinedEntities(void) { 9237 int test_ret = 0; 9238 9239 #if defined(LIBXML_LEGACY_ENABLED) 9240 #ifdef LIBXML_LEGACY_ENABLED 9241 int mem_base; 9242 9243 mem_base = xmlMemBlocks(); 9244 9245 xmlCleanupPredefinedEntities(); 9246 call_tests++; 9247 xmlResetLastError(); 9248 if (mem_base != xmlMemBlocks()) { 9249 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities", 9250 xmlMemBlocks() - mem_base); 9251 test_ret++; 9252 printf("\n"); 9253 } 9254 function_tests++; 9255 #endif 9256 #endif 9257 9258 return(test_ret); 9259 } 9260 9261 9262 #define gen_nb_xmlEntitiesTablePtr 1 9263 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9264 return(NULL); 9265 } 9266 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9267 } 9268 9269 static int 9270 test_xmlCopyEntitiesTable(void) { 9271 int test_ret = 0; 9272 9273 9274 /* missing type support */ 9275 return(test_ret); 9276 } 9277 9278 9279 static int 9280 test_xmlCreateEntitiesTable(void) { 9281 int test_ret = 0; 9282 9283 9284 /* missing type support */ 9285 return(test_ret); 9286 } 9287 9288 9289 static int 9290 test_xmlDumpEntitiesTable(void) { 9291 int test_ret = 0; 9292 9293 #if defined(LIBXML_OUTPUT_ENABLED) 9294 int mem_base; 9295 xmlBufferPtr buf; /* An XML buffer. */ 9296 int n_buf; 9297 xmlEntitiesTablePtr table; /* An entity table */ 9298 int n_table; 9299 9300 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 9301 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) { 9302 mem_base = xmlMemBlocks(); 9303 buf = gen_xmlBufferPtr(n_buf, 0); 9304 table = gen_xmlEntitiesTablePtr(n_table, 1); 9305 9306 xmlDumpEntitiesTable(buf, table); 9307 call_tests++; 9308 des_xmlBufferPtr(n_buf, buf, 0); 9309 des_xmlEntitiesTablePtr(n_table, table, 1); 9310 xmlResetLastError(); 9311 if (mem_base != xmlMemBlocks()) { 9312 printf("Leak of %d blocks found in xmlDumpEntitiesTable", 9313 xmlMemBlocks() - mem_base); 9314 test_ret++; 9315 printf(" %d", n_buf); 9316 printf(" %d", n_table); 9317 printf("\n"); 9318 } 9319 } 9320 } 9321 function_tests++; 9322 #endif 9323 9324 return(test_ret); 9325 } 9326 9327 9328 #define gen_nb_xmlEntityPtr 1 9329 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9330 return(NULL); 9331 } 9332 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 9333 } 9334 9335 static int 9336 test_xmlDumpEntityDecl(void) { 9337 int test_ret = 0; 9338 9339 #if defined(LIBXML_OUTPUT_ENABLED) 9340 int mem_base; 9341 xmlBufferPtr buf; /* An XML buffer. */ 9342 int n_buf; 9343 xmlEntityPtr ent; /* An entity table */ 9344 int n_ent; 9345 9346 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 9347 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) { 9348 mem_base = xmlMemBlocks(); 9349 buf = gen_xmlBufferPtr(n_buf, 0); 9350 ent = gen_xmlEntityPtr(n_ent, 1); 9351 9352 xmlDumpEntityDecl(buf, ent); 9353 call_tests++; 9354 des_xmlBufferPtr(n_buf, buf, 0); 9355 des_xmlEntityPtr(n_ent, ent, 1); 9356 xmlResetLastError(); 9357 if (mem_base != xmlMemBlocks()) { 9358 printf("Leak of %d blocks found in xmlDumpEntityDecl", 9359 xmlMemBlocks() - mem_base); 9360 test_ret++; 9361 printf(" %d", n_buf); 9362 printf(" %d", n_ent); 9363 printf("\n"); 9364 } 9365 } 9366 } 9367 function_tests++; 9368 #endif 9369 9370 return(test_ret); 9371 } 9372 9373 9374 static int 9375 test_xmlEncodeEntitiesReentrant(void) { 9376 int test_ret = 0; 9377 9378 int mem_base; 9379 xmlChar * ret_val; 9380 xmlDocPtr doc; /* the document containing the string */ 9381 int n_doc; 9382 xmlChar * input; /* A string to convert to XML. */ 9383 int n_input; 9384 9385 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9386 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { 9387 mem_base = xmlMemBlocks(); 9388 doc = gen_xmlDocPtr(n_doc, 0); 9389 input = gen_const_xmlChar_ptr(n_input, 1); 9390 9391 ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input); 9392 desret_xmlChar_ptr(ret_val); 9393 call_tests++; 9394 des_xmlDocPtr(n_doc, doc, 0); 9395 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1); 9396 xmlResetLastError(); 9397 if (mem_base != xmlMemBlocks()) { 9398 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant", 9399 xmlMemBlocks() - mem_base); 9400 test_ret++; 9401 printf(" %d", n_doc); 9402 printf(" %d", n_input); 9403 printf("\n"); 9404 } 9405 } 9406 } 9407 function_tests++; 9408 9409 return(test_ret); 9410 } 9411 9412 9413 static int 9414 test_xmlEncodeSpecialChars(void) { 9415 int test_ret = 0; 9416 9417 int mem_base; 9418 xmlChar * ret_val; 9419 xmlDocPtr doc; /* the document containing the string */ 9420 int n_doc; 9421 xmlChar * input; /* A string to convert to XML. */ 9422 int n_input; 9423 9424 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9425 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { 9426 mem_base = xmlMemBlocks(); 9427 doc = gen_xmlDocPtr(n_doc, 0); 9428 input = gen_const_xmlChar_ptr(n_input, 1); 9429 9430 ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input); 9431 desret_xmlChar_ptr(ret_val); 9432 call_tests++; 9433 des_xmlDocPtr(n_doc, doc, 0); 9434 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1); 9435 xmlResetLastError(); 9436 if (mem_base != xmlMemBlocks()) { 9437 printf("Leak of %d blocks found in xmlEncodeSpecialChars", 9438 xmlMemBlocks() - mem_base); 9439 test_ret++; 9440 printf(" %d", n_doc); 9441 printf(" %d", n_input); 9442 printf("\n"); 9443 } 9444 } 9445 } 9446 function_tests++; 9447 9448 return(test_ret); 9449 } 9450 9451 9452 static int 9453 test_xmlGetDocEntity(void) { 9454 int test_ret = 0; 9455 9456 int mem_base; 9457 xmlEntityPtr ret_val; 9458 xmlDocPtr doc; /* the document referencing the entity */ 9459 int n_doc; 9460 xmlChar * name; /* the entity name */ 9461 int n_name; 9462 9463 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9464 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9465 mem_base = xmlMemBlocks(); 9466 doc = gen_xmlDocPtr(n_doc, 0); 9467 name = gen_const_xmlChar_ptr(n_name, 1); 9468 9469 ret_val = xmlGetDocEntity(doc, (const xmlChar *)name); 9470 desret_xmlEntityPtr(ret_val); 9471 call_tests++; 9472 des_xmlDocPtr(n_doc, doc, 0); 9473 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9474 xmlResetLastError(); 9475 if (mem_base != xmlMemBlocks()) { 9476 printf("Leak of %d blocks found in xmlGetDocEntity", 9477 xmlMemBlocks() - mem_base); 9478 test_ret++; 9479 printf(" %d", n_doc); 9480 printf(" %d", n_name); 9481 printf("\n"); 9482 } 9483 } 9484 } 9485 function_tests++; 9486 9487 return(test_ret); 9488 } 9489 9490 9491 static int 9492 test_xmlGetDtdEntity(void) { 9493 int test_ret = 0; 9494 9495 int mem_base; 9496 xmlEntityPtr ret_val; 9497 xmlDocPtr doc; /* the document referencing the entity */ 9498 int n_doc; 9499 xmlChar * name; /* the entity name */ 9500 int n_name; 9501 9502 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9503 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9504 mem_base = xmlMemBlocks(); 9505 doc = gen_xmlDocPtr(n_doc, 0); 9506 name = gen_const_xmlChar_ptr(n_name, 1); 9507 9508 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name); 9509 desret_xmlEntityPtr(ret_val); 9510 call_tests++; 9511 des_xmlDocPtr(n_doc, doc, 0); 9512 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9513 xmlResetLastError(); 9514 if (mem_base != xmlMemBlocks()) { 9515 printf("Leak of %d blocks found in xmlGetDtdEntity", 9516 xmlMemBlocks() - mem_base); 9517 test_ret++; 9518 printf(" %d", n_doc); 9519 printf(" %d", n_name); 9520 printf("\n"); 9521 } 9522 } 9523 } 9524 function_tests++; 9525 9526 return(test_ret); 9527 } 9528 9529 9530 static int 9531 test_xmlGetParameterEntity(void) { 9532 int test_ret = 0; 9533 9534 int mem_base; 9535 xmlEntityPtr ret_val; 9536 xmlDocPtr doc; /* the document referencing the entity */ 9537 int n_doc; 9538 xmlChar * name; /* the entity name */ 9539 int n_name; 9540 9541 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9542 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9543 mem_base = xmlMemBlocks(); 9544 doc = gen_xmlDocPtr(n_doc, 0); 9545 name = gen_const_xmlChar_ptr(n_name, 1); 9546 9547 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name); 9548 desret_xmlEntityPtr(ret_val); 9549 call_tests++; 9550 des_xmlDocPtr(n_doc, doc, 0); 9551 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9552 xmlResetLastError(); 9553 if (mem_base != xmlMemBlocks()) { 9554 printf("Leak of %d blocks found in xmlGetParameterEntity", 9555 xmlMemBlocks() - mem_base); 9556 test_ret++; 9557 printf(" %d", n_doc); 9558 printf(" %d", n_name); 9559 printf("\n"); 9560 } 9561 } 9562 } 9563 function_tests++; 9564 9565 return(test_ret); 9566 } 9567 9568 9569 static int 9570 test_xmlGetPredefinedEntity(void) { 9571 int test_ret = 0; 9572 9573 int mem_base; 9574 xmlEntityPtr ret_val; 9575 xmlChar * name; /* the entity name */ 9576 int n_name; 9577 9578 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9579 mem_base = xmlMemBlocks(); 9580 name = gen_const_xmlChar_ptr(n_name, 0); 9581 9582 ret_val = xmlGetPredefinedEntity((const xmlChar *)name); 9583 desret_xmlEntityPtr(ret_val); 9584 call_tests++; 9585 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 9586 xmlResetLastError(); 9587 if (mem_base != xmlMemBlocks()) { 9588 printf("Leak of %d blocks found in xmlGetPredefinedEntity", 9589 xmlMemBlocks() - mem_base); 9590 test_ret++; 9591 printf(" %d", n_name); 9592 printf("\n"); 9593 } 9594 } 9595 function_tests++; 9596 9597 return(test_ret); 9598 } 9599 9600 9601 static int 9602 test_xmlInitializePredefinedEntities(void) { 9603 int test_ret = 0; 9604 9605 #if defined(LIBXML_LEGACY_ENABLED) 9606 #ifdef LIBXML_LEGACY_ENABLED 9607 int mem_base; 9608 9609 mem_base = xmlMemBlocks(); 9610 9611 xmlInitializePredefinedEntities(); 9612 call_tests++; 9613 xmlResetLastError(); 9614 if (mem_base != xmlMemBlocks()) { 9615 printf("Leak of %d blocks found in xmlInitializePredefinedEntities", 9616 xmlMemBlocks() - mem_base); 9617 test_ret++; 9618 printf("\n"); 9619 } 9620 function_tests++; 9621 #endif 9622 #endif 9623 9624 return(test_ret); 9625 } 9626 9627 9628 static int 9629 test_xmlNewEntity(void) { 9630 int test_ret = 0; 9631 9632 int mem_base; 9633 xmlEntityPtr ret_val; 9634 xmlDocPtr doc; /* the document */ 9635 int n_doc; 9636 xmlChar * name; /* the entity name */ 9637 int n_name; 9638 int type; /* the entity type XML_xxx_yyy_ENTITY */ 9639 int n_type; 9640 xmlChar * ExternalID; /* the entity external ID if available */ 9641 int n_ExternalID; 9642 xmlChar * SystemID; /* the entity system ID if available */ 9643 int n_SystemID; 9644 xmlChar * content; /* the entity content */ 9645 int n_content; 9646 9647 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 9648 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9649 for (n_type = 0;n_type < gen_nb_int;n_type++) { 9650 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 9651 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 9652 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 9653 mem_base = xmlMemBlocks(); 9654 doc = gen_xmlDocPtr(n_doc, 0); 9655 name = gen_const_xmlChar_ptr(n_name, 1); 9656 type = gen_int(n_type, 2); 9657 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); 9658 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); 9659 content = gen_const_xmlChar_ptr(n_content, 5); 9660 9661 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); 9662 desret_xmlEntityPtr(ret_val); 9663 call_tests++; 9664 des_xmlDocPtr(n_doc, doc, 0); 9665 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9666 des_int(n_type, type, 2); 9667 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); 9668 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); 9669 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); 9670 xmlResetLastError(); 9671 if (mem_base != xmlMemBlocks()) { 9672 printf("Leak of %d blocks found in xmlNewEntity", 9673 xmlMemBlocks() - mem_base); 9674 test_ret++; 9675 printf(" %d", n_doc); 9676 printf(" %d", n_name); 9677 printf(" %d", n_type); 9678 printf(" %d", n_ExternalID); 9679 printf(" %d", n_SystemID); 9680 printf(" %d", n_content); 9681 printf("\n"); 9682 } 9683 } 9684 } 9685 } 9686 } 9687 } 9688 } 9689 function_tests++; 9690 9691 return(test_ret); 9692 } 9693 9694 static int 9695 test_entities(void) { 9696 int test_ret = 0; 9697 9698 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n"); 9699 test_ret += test_xmlAddDocEntity(); 9700 test_ret += test_xmlAddDtdEntity(); 9701 test_ret += test_xmlCleanupPredefinedEntities(); 9702 test_ret += test_xmlCopyEntitiesTable(); 9703 test_ret += test_xmlCreateEntitiesTable(); 9704 test_ret += test_xmlDumpEntitiesTable(); 9705 test_ret += test_xmlDumpEntityDecl(); 9706 test_ret += test_xmlEncodeEntitiesReentrant(); 9707 test_ret += test_xmlEncodeSpecialChars(); 9708 test_ret += test_xmlGetDocEntity(); 9709 test_ret += test_xmlGetDtdEntity(); 9710 test_ret += test_xmlGetParameterEntity(); 9711 test_ret += test_xmlGetPredefinedEntity(); 9712 test_ret += test_xmlInitializePredefinedEntities(); 9713 test_ret += test_xmlNewEntity(); 9714 9715 if (test_ret != 0) 9716 printf("Module entities: %d errors\n", test_ret); 9717 return(test_ret); 9718 } 9719 9720 static int 9721 test_xmlHashAddEntry(void) { 9722 int test_ret = 0; 9723 9724 int mem_base; 9725 int ret_val; 9726 xmlHashTablePtr table; /* the hash table */ 9727 int n_table; 9728 xmlChar * name; /* the name of the userdata */ 9729 int n_name; 9730 void * userdata; /* a pointer to the userdata */ 9731 int n_userdata; 9732 9733 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9734 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9735 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 9736 mem_base = xmlMemBlocks(); 9737 table = gen_xmlHashTablePtr(n_table, 0); 9738 name = gen_const_xmlChar_ptr(n_name, 1); 9739 userdata = gen_userdata(n_userdata, 2); 9740 9741 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata); 9742 desret_int(ret_val); 9743 call_tests++; 9744 des_xmlHashTablePtr(n_table, table, 0); 9745 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9746 des_userdata(n_userdata, userdata, 2); 9747 xmlResetLastError(); 9748 if (mem_base != xmlMemBlocks()) { 9749 printf("Leak of %d blocks found in xmlHashAddEntry", 9750 xmlMemBlocks() - mem_base); 9751 test_ret++; 9752 printf(" %d", n_table); 9753 printf(" %d", n_name); 9754 printf(" %d", n_userdata); 9755 printf("\n"); 9756 } 9757 } 9758 } 9759 } 9760 function_tests++; 9761 9762 return(test_ret); 9763 } 9764 9765 9766 static int 9767 test_xmlHashAddEntry2(void) { 9768 int test_ret = 0; 9769 9770 int mem_base; 9771 int ret_val; 9772 xmlHashTablePtr table; /* the hash table */ 9773 int n_table; 9774 xmlChar * name; /* the name of the userdata */ 9775 int n_name; 9776 xmlChar * name2; /* a second name of the userdata */ 9777 int n_name2; 9778 void * userdata; /* a pointer to the userdata */ 9779 int n_userdata; 9780 9781 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9782 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9783 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 9784 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 9785 mem_base = xmlMemBlocks(); 9786 table = gen_xmlHashTablePtr(n_table, 0); 9787 name = gen_const_xmlChar_ptr(n_name, 1); 9788 name2 = gen_const_xmlChar_ptr(n_name2, 2); 9789 userdata = gen_userdata(n_userdata, 3); 9790 9791 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata); 9792 desret_int(ret_val); 9793 call_tests++; 9794 des_xmlHashTablePtr(n_table, table, 0); 9795 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9796 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 9797 des_userdata(n_userdata, userdata, 3); 9798 xmlResetLastError(); 9799 if (mem_base != xmlMemBlocks()) { 9800 printf("Leak of %d blocks found in xmlHashAddEntry2", 9801 xmlMemBlocks() - mem_base); 9802 test_ret++; 9803 printf(" %d", n_table); 9804 printf(" %d", n_name); 9805 printf(" %d", n_name2); 9806 printf(" %d", n_userdata); 9807 printf("\n"); 9808 } 9809 } 9810 } 9811 } 9812 } 9813 function_tests++; 9814 9815 return(test_ret); 9816 } 9817 9818 9819 static int 9820 test_xmlHashAddEntry3(void) { 9821 int test_ret = 0; 9822 9823 int mem_base; 9824 int ret_val; 9825 xmlHashTablePtr table; /* the hash table */ 9826 int n_table; 9827 xmlChar * name; /* the name of the userdata */ 9828 int n_name; 9829 xmlChar * name2; /* a second name of the userdata */ 9830 int n_name2; 9831 xmlChar * name3; /* a third name of the userdata */ 9832 int n_name3; 9833 void * userdata; /* a pointer to the userdata */ 9834 int n_userdata; 9835 9836 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9837 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9838 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 9839 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 9840 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 9841 mem_base = xmlMemBlocks(); 9842 table = gen_xmlHashTablePtr(n_table, 0); 9843 name = gen_const_xmlChar_ptr(n_name, 1); 9844 name2 = gen_const_xmlChar_ptr(n_name2, 2); 9845 name3 = gen_const_xmlChar_ptr(n_name3, 3); 9846 userdata = gen_userdata(n_userdata, 4); 9847 9848 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata); 9849 desret_int(ret_val); 9850 call_tests++; 9851 des_xmlHashTablePtr(n_table, table, 0); 9852 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9853 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 9854 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 9855 des_userdata(n_userdata, userdata, 4); 9856 xmlResetLastError(); 9857 if (mem_base != xmlMemBlocks()) { 9858 printf("Leak of %d blocks found in xmlHashAddEntry3", 9859 xmlMemBlocks() - mem_base); 9860 test_ret++; 9861 printf(" %d", n_table); 9862 printf(" %d", n_name); 9863 printf(" %d", n_name2); 9864 printf(" %d", n_name3); 9865 printf(" %d", n_userdata); 9866 printf("\n"); 9867 } 9868 } 9869 } 9870 } 9871 } 9872 } 9873 function_tests++; 9874 9875 return(test_ret); 9876 } 9877 9878 9879 static int 9880 test_xmlHashCopy(void) { 9881 int test_ret = 0; 9882 9883 9884 /* missing type support */ 9885 return(test_ret); 9886 } 9887 9888 9889 static int 9890 test_xmlHashCreate(void) { 9891 int test_ret = 0; 9892 9893 9894 /* missing type support */ 9895 return(test_ret); 9896 } 9897 9898 9899 static int 9900 test_xmlHashCreateDict(void) { 9901 int test_ret = 0; 9902 9903 9904 /* missing type support */ 9905 return(test_ret); 9906 } 9907 9908 9909 static int 9910 test_xmlHashLookup(void) { 9911 int test_ret = 0; 9912 9913 int mem_base; 9914 void * ret_val; 9915 xmlHashTablePtr table; /* the hash table */ 9916 int n_table; 9917 xmlChar * name; /* the name of the userdata */ 9918 int n_name; 9919 9920 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9921 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9922 mem_base = xmlMemBlocks(); 9923 table = gen_xmlHashTablePtr(n_table, 0); 9924 name = gen_const_xmlChar_ptr(n_name, 1); 9925 9926 ret_val = xmlHashLookup(table, (const xmlChar *)name); 9927 desret_void_ptr(ret_val); 9928 call_tests++; 9929 des_xmlHashTablePtr(n_table, table, 0); 9930 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9931 xmlResetLastError(); 9932 if (mem_base != xmlMemBlocks()) { 9933 printf("Leak of %d blocks found in xmlHashLookup", 9934 xmlMemBlocks() - mem_base); 9935 test_ret++; 9936 printf(" %d", n_table); 9937 printf(" %d", n_name); 9938 printf("\n"); 9939 } 9940 } 9941 } 9942 function_tests++; 9943 9944 return(test_ret); 9945 } 9946 9947 9948 static int 9949 test_xmlHashLookup2(void) { 9950 int test_ret = 0; 9951 9952 int mem_base; 9953 void * ret_val; 9954 xmlHashTablePtr table; /* the hash table */ 9955 int n_table; 9956 xmlChar * name; /* the name of the userdata */ 9957 int n_name; 9958 xmlChar * name2; /* a second name of the userdata */ 9959 int n_name2; 9960 9961 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 9962 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 9963 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 9964 mem_base = xmlMemBlocks(); 9965 table = gen_xmlHashTablePtr(n_table, 0); 9966 name = gen_const_xmlChar_ptr(n_name, 1); 9967 name2 = gen_const_xmlChar_ptr(n_name2, 2); 9968 9969 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2); 9970 desret_void_ptr(ret_val); 9971 call_tests++; 9972 des_xmlHashTablePtr(n_table, table, 0); 9973 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 9974 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 9975 xmlResetLastError(); 9976 if (mem_base != xmlMemBlocks()) { 9977 printf("Leak of %d blocks found in xmlHashLookup2", 9978 xmlMemBlocks() - mem_base); 9979 test_ret++; 9980 printf(" %d", n_table); 9981 printf(" %d", n_name); 9982 printf(" %d", n_name2); 9983 printf("\n"); 9984 } 9985 } 9986 } 9987 } 9988 function_tests++; 9989 9990 return(test_ret); 9991 } 9992 9993 9994 static int 9995 test_xmlHashLookup3(void) { 9996 int test_ret = 0; 9997 9998 int mem_base; 9999 void * ret_val; 10000 xmlHashTablePtr table; /* the hash table */ 10001 int n_table; 10002 xmlChar * name; /* the name of the userdata */ 10003 int n_name; 10004 xmlChar * name2; /* a second name of the userdata */ 10005 int n_name2; 10006 xmlChar * name3; /* a third name of the userdata */ 10007 int n_name3; 10008 10009 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10010 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10011 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10012 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10013 mem_base = xmlMemBlocks(); 10014 table = gen_xmlHashTablePtr(n_table, 0); 10015 name = gen_const_xmlChar_ptr(n_name, 1); 10016 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10017 name3 = gen_const_xmlChar_ptr(n_name3, 3); 10018 10019 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3); 10020 desret_void_ptr(ret_val); 10021 call_tests++; 10022 des_xmlHashTablePtr(n_table, table, 0); 10023 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10024 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10025 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 10026 xmlResetLastError(); 10027 if (mem_base != xmlMemBlocks()) { 10028 printf("Leak of %d blocks found in xmlHashLookup3", 10029 xmlMemBlocks() - mem_base); 10030 test_ret++; 10031 printf(" %d", n_table); 10032 printf(" %d", n_name); 10033 printf(" %d", n_name2); 10034 printf(" %d", n_name3); 10035 printf("\n"); 10036 } 10037 } 10038 } 10039 } 10040 } 10041 function_tests++; 10042 10043 return(test_ret); 10044 } 10045 10046 10047 static int 10048 test_xmlHashQLookup(void) { 10049 int test_ret = 0; 10050 10051 int mem_base; 10052 void * ret_val; 10053 xmlHashTablePtr table; /* the hash table */ 10054 int n_table; 10055 xmlChar * prefix; /* the prefix of the userdata */ 10056 int n_prefix; 10057 xmlChar * name; /* the name of the userdata */ 10058 int n_name; 10059 10060 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10061 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 10062 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10063 mem_base = xmlMemBlocks(); 10064 table = gen_xmlHashTablePtr(n_table, 0); 10065 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 10066 name = gen_const_xmlChar_ptr(n_name, 2); 10067 10068 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name); 10069 desret_void_ptr(ret_val); 10070 call_tests++; 10071 des_xmlHashTablePtr(n_table, table, 0); 10072 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 10073 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 10074 xmlResetLastError(); 10075 if (mem_base != xmlMemBlocks()) { 10076 printf("Leak of %d blocks found in xmlHashQLookup", 10077 xmlMemBlocks() - mem_base); 10078 test_ret++; 10079 printf(" %d", n_table); 10080 printf(" %d", n_prefix); 10081 printf(" %d", n_name); 10082 printf("\n"); 10083 } 10084 } 10085 } 10086 } 10087 function_tests++; 10088 10089 return(test_ret); 10090 } 10091 10092 10093 static int 10094 test_xmlHashQLookup2(void) { 10095 int test_ret = 0; 10096 10097 int mem_base; 10098 void * ret_val; 10099 xmlHashTablePtr table; /* the hash table */ 10100 int n_table; 10101 xmlChar * prefix; /* the prefix of the userdata */ 10102 int n_prefix; 10103 xmlChar * name; /* the name of the userdata */ 10104 int n_name; 10105 xmlChar * prefix2; /* the second prefix of the userdata */ 10106 int n_prefix2; 10107 xmlChar * name2; /* a second name of the userdata */ 10108 int n_name2; 10109 10110 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10111 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 10112 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10113 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) { 10114 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10115 mem_base = xmlMemBlocks(); 10116 table = gen_xmlHashTablePtr(n_table, 0); 10117 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 10118 name = gen_const_xmlChar_ptr(n_name, 2); 10119 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3); 10120 name2 = gen_const_xmlChar_ptr(n_name2, 4); 10121 10122 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2); 10123 desret_void_ptr(ret_val); 10124 call_tests++; 10125 des_xmlHashTablePtr(n_table, table, 0); 10126 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 10127 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 10128 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3); 10129 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4); 10130 xmlResetLastError(); 10131 if (mem_base != xmlMemBlocks()) { 10132 printf("Leak of %d blocks found in xmlHashQLookup2", 10133 xmlMemBlocks() - mem_base); 10134 test_ret++; 10135 printf(" %d", n_table); 10136 printf(" %d", n_prefix); 10137 printf(" %d", n_name); 10138 printf(" %d", n_prefix2); 10139 printf(" %d", n_name2); 10140 printf("\n"); 10141 } 10142 } 10143 } 10144 } 10145 } 10146 } 10147 function_tests++; 10148 10149 return(test_ret); 10150 } 10151 10152 10153 static int 10154 test_xmlHashQLookup3(void) { 10155 int test_ret = 0; 10156 10157 int mem_base; 10158 void * ret_val; 10159 xmlHashTablePtr table; /* the hash table */ 10160 int n_table; 10161 xmlChar * prefix; /* the prefix of the userdata */ 10162 int n_prefix; 10163 xmlChar * name; /* the name of the userdata */ 10164 int n_name; 10165 xmlChar * prefix2; /* the second prefix of the userdata */ 10166 int n_prefix2; 10167 xmlChar * name2; /* a second name of the userdata */ 10168 int n_name2; 10169 xmlChar * prefix3; /* the third prefix of the userdata */ 10170 int n_prefix3; 10171 xmlChar * name3; /* a third name of the userdata */ 10172 int n_name3; 10173 10174 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10175 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 10176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10177 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) { 10178 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10179 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) { 10180 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10181 mem_base = xmlMemBlocks(); 10182 table = gen_xmlHashTablePtr(n_table, 0); 10183 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 10184 name = gen_const_xmlChar_ptr(n_name, 2); 10185 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3); 10186 name2 = gen_const_xmlChar_ptr(n_name2, 4); 10187 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5); 10188 name3 = gen_const_xmlChar_ptr(n_name3, 6); 10189 10190 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3); 10191 desret_void_ptr(ret_val); 10192 call_tests++; 10193 des_xmlHashTablePtr(n_table, table, 0); 10194 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 10195 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 10196 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3); 10197 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4); 10198 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5); 10199 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6); 10200 xmlResetLastError(); 10201 if (mem_base != xmlMemBlocks()) { 10202 printf("Leak of %d blocks found in xmlHashQLookup3", 10203 xmlMemBlocks() - mem_base); 10204 test_ret++; 10205 printf(" %d", n_table); 10206 printf(" %d", n_prefix); 10207 printf(" %d", n_name); 10208 printf(" %d", n_prefix2); 10209 printf(" %d", n_name2); 10210 printf(" %d", n_prefix3); 10211 printf(" %d", n_name3); 10212 printf("\n"); 10213 } 10214 } 10215 } 10216 } 10217 } 10218 } 10219 } 10220 } 10221 function_tests++; 10222 10223 return(test_ret); 10224 } 10225 10226 10227 static int 10228 test_xmlHashRemoveEntry(void) { 10229 int test_ret = 0; 10230 10231 int mem_base; 10232 int ret_val; 10233 xmlHashTablePtr table; /* the hash table */ 10234 int n_table; 10235 xmlChar * name; /* the name of the userdata */ 10236 int n_name; 10237 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ 10238 int n_f; 10239 10240 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10241 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10242 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10243 mem_base = xmlMemBlocks(); 10244 table = gen_xmlHashTablePtr(n_table, 0); 10245 name = gen_const_xmlChar_ptr(n_name, 1); 10246 f = gen_xmlHashDeallocator(n_f, 2); 10247 10248 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f); 10249 desret_int(ret_val); 10250 call_tests++; 10251 des_xmlHashTablePtr(n_table, table, 0); 10252 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10253 des_xmlHashDeallocator(n_f, f, 2); 10254 xmlResetLastError(); 10255 if (mem_base != xmlMemBlocks()) { 10256 printf("Leak of %d blocks found in xmlHashRemoveEntry", 10257 xmlMemBlocks() - mem_base); 10258 test_ret++; 10259 printf(" %d", n_table); 10260 printf(" %d", n_name); 10261 printf(" %d", n_f); 10262 printf("\n"); 10263 } 10264 } 10265 } 10266 } 10267 function_tests++; 10268 10269 return(test_ret); 10270 } 10271 10272 10273 static int 10274 test_xmlHashRemoveEntry2(void) { 10275 int test_ret = 0; 10276 10277 int mem_base; 10278 int ret_val; 10279 xmlHashTablePtr table; /* the hash table */ 10280 int n_table; 10281 xmlChar * name; /* the name of the userdata */ 10282 int n_name; 10283 xmlChar * name2; /* a second name of the userdata */ 10284 int n_name2; 10285 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ 10286 int n_f; 10287 10288 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10289 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10290 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10291 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10292 mem_base = xmlMemBlocks(); 10293 table = gen_xmlHashTablePtr(n_table, 0); 10294 name = gen_const_xmlChar_ptr(n_name, 1); 10295 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10296 f = gen_xmlHashDeallocator(n_f, 3); 10297 10298 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f); 10299 desret_int(ret_val); 10300 call_tests++; 10301 des_xmlHashTablePtr(n_table, table, 0); 10302 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10303 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10304 des_xmlHashDeallocator(n_f, f, 3); 10305 xmlResetLastError(); 10306 if (mem_base != xmlMemBlocks()) { 10307 printf("Leak of %d blocks found in xmlHashRemoveEntry2", 10308 xmlMemBlocks() - mem_base); 10309 test_ret++; 10310 printf(" %d", n_table); 10311 printf(" %d", n_name); 10312 printf(" %d", n_name2); 10313 printf(" %d", n_f); 10314 printf("\n"); 10315 } 10316 } 10317 } 10318 } 10319 } 10320 function_tests++; 10321 10322 return(test_ret); 10323 } 10324 10325 10326 static int 10327 test_xmlHashRemoveEntry3(void) { 10328 int test_ret = 0; 10329 10330 int mem_base; 10331 int ret_val; 10332 xmlHashTablePtr table; /* the hash table */ 10333 int n_table; 10334 xmlChar * name; /* the name of the userdata */ 10335 int n_name; 10336 xmlChar * name2; /* a second name of the userdata */ 10337 int n_name2; 10338 xmlChar * name3; /* a third name of the userdata */ 10339 int n_name3; 10340 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ 10341 int n_f; 10342 10343 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10344 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10345 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10346 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10347 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10348 mem_base = xmlMemBlocks(); 10349 table = gen_xmlHashTablePtr(n_table, 0); 10350 name = gen_const_xmlChar_ptr(n_name, 1); 10351 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10352 name3 = gen_const_xmlChar_ptr(n_name3, 3); 10353 f = gen_xmlHashDeallocator(n_f, 4); 10354 10355 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f); 10356 desret_int(ret_val); 10357 call_tests++; 10358 des_xmlHashTablePtr(n_table, table, 0); 10359 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10360 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10361 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 10362 des_xmlHashDeallocator(n_f, f, 4); 10363 xmlResetLastError(); 10364 if (mem_base != xmlMemBlocks()) { 10365 printf("Leak of %d blocks found in xmlHashRemoveEntry3", 10366 xmlMemBlocks() - mem_base); 10367 test_ret++; 10368 printf(" %d", n_table); 10369 printf(" %d", n_name); 10370 printf(" %d", n_name2); 10371 printf(" %d", n_name3); 10372 printf(" %d", n_f); 10373 printf("\n"); 10374 } 10375 } 10376 } 10377 } 10378 } 10379 } 10380 function_tests++; 10381 10382 return(test_ret); 10383 } 10384 10385 10386 static int 10387 test_xmlHashScan(void) { 10388 int test_ret = 0; 10389 10390 10391 /* missing type support */ 10392 return(test_ret); 10393 } 10394 10395 10396 static int 10397 test_xmlHashScan3(void) { 10398 int test_ret = 0; 10399 10400 10401 /* missing type support */ 10402 return(test_ret); 10403 } 10404 10405 10406 static int 10407 test_xmlHashScanFull(void) { 10408 int test_ret = 0; 10409 10410 10411 /* missing type support */ 10412 return(test_ret); 10413 } 10414 10415 10416 static int 10417 test_xmlHashScanFull3(void) { 10418 int test_ret = 0; 10419 10420 10421 /* missing type support */ 10422 return(test_ret); 10423 } 10424 10425 10426 static int 10427 test_xmlHashSize(void) { 10428 int test_ret = 0; 10429 10430 int mem_base; 10431 int ret_val; 10432 xmlHashTablePtr table; /* the hash table */ 10433 int n_table; 10434 10435 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10436 mem_base = xmlMemBlocks(); 10437 table = gen_xmlHashTablePtr(n_table, 0); 10438 10439 ret_val = xmlHashSize(table); 10440 desret_int(ret_val); 10441 call_tests++; 10442 des_xmlHashTablePtr(n_table, table, 0); 10443 xmlResetLastError(); 10444 if (mem_base != xmlMemBlocks()) { 10445 printf("Leak of %d blocks found in xmlHashSize", 10446 xmlMemBlocks() - mem_base); 10447 test_ret++; 10448 printf(" %d", n_table); 10449 printf("\n"); 10450 } 10451 } 10452 function_tests++; 10453 10454 return(test_ret); 10455 } 10456 10457 10458 static int 10459 test_xmlHashUpdateEntry(void) { 10460 int test_ret = 0; 10461 10462 int mem_base; 10463 int ret_val; 10464 xmlHashTablePtr table; /* the hash table */ 10465 int n_table; 10466 xmlChar * name; /* the name of the userdata */ 10467 int n_name; 10468 void * userdata; /* a pointer to the userdata */ 10469 int n_userdata; 10470 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ 10471 int n_f; 10472 10473 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10474 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10475 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 10476 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10477 mem_base = xmlMemBlocks(); 10478 table = gen_xmlHashTablePtr(n_table, 0); 10479 name = gen_const_xmlChar_ptr(n_name, 1); 10480 userdata = gen_userdata(n_userdata, 2); 10481 f = gen_xmlHashDeallocator(n_f, 3); 10482 10483 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f); 10484 desret_int(ret_val); 10485 call_tests++; 10486 des_xmlHashTablePtr(n_table, table, 0); 10487 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10488 des_userdata(n_userdata, userdata, 2); 10489 des_xmlHashDeallocator(n_f, f, 3); 10490 xmlResetLastError(); 10491 if (mem_base != xmlMemBlocks()) { 10492 printf("Leak of %d blocks found in xmlHashUpdateEntry", 10493 xmlMemBlocks() - mem_base); 10494 test_ret++; 10495 printf(" %d", n_table); 10496 printf(" %d", n_name); 10497 printf(" %d", n_userdata); 10498 printf(" %d", n_f); 10499 printf("\n"); 10500 } 10501 } 10502 } 10503 } 10504 } 10505 function_tests++; 10506 10507 return(test_ret); 10508 } 10509 10510 10511 static int 10512 test_xmlHashUpdateEntry2(void) { 10513 int test_ret = 0; 10514 10515 int mem_base; 10516 int ret_val; 10517 xmlHashTablePtr table; /* the hash table */ 10518 int n_table; 10519 xmlChar * name; /* the name of the userdata */ 10520 int n_name; 10521 xmlChar * name2; /* a second name of the userdata */ 10522 int n_name2; 10523 void * userdata; /* a pointer to the userdata */ 10524 int n_userdata; 10525 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ 10526 int n_f; 10527 10528 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10529 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10530 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10531 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 10532 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10533 mem_base = xmlMemBlocks(); 10534 table = gen_xmlHashTablePtr(n_table, 0); 10535 name = gen_const_xmlChar_ptr(n_name, 1); 10536 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10537 userdata = gen_userdata(n_userdata, 3); 10538 f = gen_xmlHashDeallocator(n_f, 4); 10539 10540 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f); 10541 desret_int(ret_val); 10542 call_tests++; 10543 des_xmlHashTablePtr(n_table, table, 0); 10544 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10545 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10546 des_userdata(n_userdata, userdata, 3); 10547 des_xmlHashDeallocator(n_f, f, 4); 10548 xmlResetLastError(); 10549 if (mem_base != xmlMemBlocks()) { 10550 printf("Leak of %d blocks found in xmlHashUpdateEntry2", 10551 xmlMemBlocks() - mem_base); 10552 test_ret++; 10553 printf(" %d", n_table); 10554 printf(" %d", n_name); 10555 printf(" %d", n_name2); 10556 printf(" %d", n_userdata); 10557 printf(" %d", n_f); 10558 printf("\n"); 10559 } 10560 } 10561 } 10562 } 10563 } 10564 } 10565 function_tests++; 10566 10567 return(test_ret); 10568 } 10569 10570 10571 static int 10572 test_xmlHashUpdateEntry3(void) { 10573 int test_ret = 0; 10574 10575 int mem_base; 10576 int ret_val; 10577 xmlHashTablePtr table; /* the hash table */ 10578 int n_table; 10579 xmlChar * name; /* the name of the userdata */ 10580 int n_name; 10581 xmlChar * name2; /* a second name of the userdata */ 10582 int n_name2; 10583 xmlChar * name3; /* a third name of the userdata */ 10584 int n_name3; 10585 void * userdata; /* a pointer to the userdata */ 10586 int n_userdata; 10587 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ 10588 int n_f; 10589 10590 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { 10591 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 10592 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { 10593 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { 10594 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { 10595 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { 10596 mem_base = xmlMemBlocks(); 10597 table = gen_xmlHashTablePtr(n_table, 0); 10598 name = gen_const_xmlChar_ptr(n_name, 1); 10599 name2 = gen_const_xmlChar_ptr(n_name2, 2); 10600 name3 = gen_const_xmlChar_ptr(n_name3, 3); 10601 userdata = gen_userdata(n_userdata, 4); 10602 f = gen_xmlHashDeallocator(n_f, 5); 10603 10604 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f); 10605 desret_int(ret_val); 10606 call_tests++; 10607 des_xmlHashTablePtr(n_table, table, 0); 10608 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 10609 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); 10610 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); 10611 des_userdata(n_userdata, userdata, 4); 10612 des_xmlHashDeallocator(n_f, f, 5); 10613 xmlResetLastError(); 10614 if (mem_base != xmlMemBlocks()) { 10615 printf("Leak of %d blocks found in xmlHashUpdateEntry3", 10616 xmlMemBlocks() - mem_base); 10617 test_ret++; 10618 printf(" %d", n_table); 10619 printf(" %d", n_name); 10620 printf(" %d", n_name2); 10621 printf(" %d", n_name3); 10622 printf(" %d", n_userdata); 10623 printf(" %d", n_f); 10624 printf("\n"); 10625 } 10626 } 10627 } 10628 } 10629 } 10630 } 10631 } 10632 function_tests++; 10633 10634 return(test_ret); 10635 } 10636 10637 static int 10638 test_hash(void) { 10639 int test_ret = 0; 10640 10641 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n"); 10642 test_ret += test_xmlHashAddEntry(); 10643 test_ret += test_xmlHashAddEntry2(); 10644 test_ret += test_xmlHashAddEntry3(); 10645 test_ret += test_xmlHashCopy(); 10646 test_ret += test_xmlHashCreate(); 10647 test_ret += test_xmlHashCreateDict(); 10648 test_ret += test_xmlHashLookup(); 10649 test_ret += test_xmlHashLookup2(); 10650 test_ret += test_xmlHashLookup3(); 10651 test_ret += test_xmlHashQLookup(); 10652 test_ret += test_xmlHashQLookup2(); 10653 test_ret += test_xmlHashQLookup3(); 10654 test_ret += test_xmlHashRemoveEntry(); 10655 test_ret += test_xmlHashRemoveEntry2(); 10656 test_ret += test_xmlHashRemoveEntry3(); 10657 test_ret += test_xmlHashScan(); 10658 test_ret += test_xmlHashScan3(); 10659 test_ret += test_xmlHashScanFull(); 10660 test_ret += test_xmlHashScanFull3(); 10661 test_ret += test_xmlHashSize(); 10662 test_ret += test_xmlHashUpdateEntry(); 10663 test_ret += test_xmlHashUpdateEntry2(); 10664 test_ret += test_xmlHashUpdateEntry3(); 10665 10666 if (test_ret != 0) 10667 printf("Module hash: %d errors\n", test_ret); 10668 return(test_ret); 10669 } 10670 10671 #define gen_nb_xmlLinkPtr 1 10672 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10673 return(NULL); 10674 } 10675 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10676 } 10677 10678 static int 10679 test_xmlLinkGetData(void) { 10680 int test_ret = 0; 10681 10682 int mem_base; 10683 void * ret_val; 10684 xmlLinkPtr lk; /* a link */ 10685 int n_lk; 10686 10687 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) { 10688 mem_base = xmlMemBlocks(); 10689 lk = gen_xmlLinkPtr(n_lk, 0); 10690 10691 ret_val = xmlLinkGetData(lk); 10692 desret_void_ptr(ret_val); 10693 call_tests++; 10694 des_xmlLinkPtr(n_lk, lk, 0); 10695 xmlResetLastError(); 10696 if (mem_base != xmlMemBlocks()) { 10697 printf("Leak of %d blocks found in xmlLinkGetData", 10698 xmlMemBlocks() - mem_base); 10699 test_ret++; 10700 printf(" %d", n_lk); 10701 printf("\n"); 10702 } 10703 } 10704 function_tests++; 10705 10706 return(test_ret); 10707 } 10708 10709 10710 static int 10711 test_xmlListAppend(void) { 10712 int test_ret = 0; 10713 10714 int mem_base; 10715 int ret_val; 10716 xmlListPtr l; /* a list */ 10717 int n_l; 10718 void * data; /* the data */ 10719 int n_data; 10720 10721 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10722 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 10723 mem_base = xmlMemBlocks(); 10724 l = gen_xmlListPtr(n_l, 0); 10725 data = gen_userdata(n_data, 1); 10726 10727 ret_val = xmlListAppend(l, data); 10728 desret_int(ret_val); 10729 call_tests++; 10730 des_xmlListPtr(n_l, l, 0); 10731 des_userdata(n_data, data, 1); 10732 xmlResetLastError(); 10733 if (mem_base != xmlMemBlocks()) { 10734 printf("Leak of %d blocks found in xmlListAppend", 10735 xmlMemBlocks() - mem_base); 10736 test_ret++; 10737 printf(" %d", n_l); 10738 printf(" %d", n_data); 10739 printf("\n"); 10740 } 10741 } 10742 } 10743 function_tests++; 10744 10745 return(test_ret); 10746 } 10747 10748 10749 static int 10750 test_xmlListClear(void) { 10751 int test_ret = 0; 10752 10753 int mem_base; 10754 xmlListPtr l; /* a list */ 10755 int n_l; 10756 10757 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10758 mem_base = xmlMemBlocks(); 10759 l = gen_xmlListPtr(n_l, 0); 10760 10761 xmlListClear(l); 10762 call_tests++; 10763 des_xmlListPtr(n_l, l, 0); 10764 xmlResetLastError(); 10765 if (mem_base != xmlMemBlocks()) { 10766 printf("Leak of %d blocks found in xmlListClear", 10767 xmlMemBlocks() - mem_base); 10768 test_ret++; 10769 printf(" %d", n_l); 10770 printf("\n"); 10771 } 10772 } 10773 function_tests++; 10774 10775 return(test_ret); 10776 } 10777 10778 10779 #define gen_nb_const_xmlListPtr 1 10780 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10781 return(NULL); 10782 } 10783 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 10784 } 10785 10786 static int 10787 test_xmlListCopy(void) { 10788 int test_ret = 0; 10789 10790 int mem_base; 10791 int ret_val; 10792 xmlListPtr cur; /* the new list */ 10793 int n_cur; 10794 xmlListPtr old; /* the old list */ 10795 int n_old; 10796 10797 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) { 10798 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) { 10799 mem_base = xmlMemBlocks(); 10800 cur = gen_xmlListPtr(n_cur, 0); 10801 old = gen_const_xmlListPtr(n_old, 1); 10802 10803 ret_val = xmlListCopy(cur, (const xmlListPtr)old); 10804 desret_int(ret_val); 10805 call_tests++; 10806 des_xmlListPtr(n_cur, cur, 0); 10807 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1); 10808 xmlResetLastError(); 10809 if (mem_base != xmlMemBlocks()) { 10810 printf("Leak of %d blocks found in xmlListCopy", 10811 xmlMemBlocks() - mem_base); 10812 test_ret++; 10813 printf(" %d", n_cur); 10814 printf(" %d", n_old); 10815 printf("\n"); 10816 } 10817 } 10818 } 10819 function_tests++; 10820 10821 return(test_ret); 10822 } 10823 10824 10825 static int 10826 test_xmlListCreate(void) { 10827 int test_ret = 0; 10828 10829 10830 /* missing type support */ 10831 return(test_ret); 10832 } 10833 10834 10835 static int 10836 test_xmlListDup(void) { 10837 int test_ret = 0; 10838 10839 10840 /* missing type support */ 10841 return(test_ret); 10842 } 10843 10844 10845 static int 10846 test_xmlListEmpty(void) { 10847 int test_ret = 0; 10848 10849 int mem_base; 10850 int ret_val; 10851 xmlListPtr l; /* a list */ 10852 int n_l; 10853 10854 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10855 mem_base = xmlMemBlocks(); 10856 l = gen_xmlListPtr(n_l, 0); 10857 10858 ret_val = xmlListEmpty(l); 10859 desret_int(ret_val); 10860 call_tests++; 10861 des_xmlListPtr(n_l, l, 0); 10862 xmlResetLastError(); 10863 if (mem_base != xmlMemBlocks()) { 10864 printf("Leak of %d blocks found in xmlListEmpty", 10865 xmlMemBlocks() - mem_base); 10866 test_ret++; 10867 printf(" %d", n_l); 10868 printf("\n"); 10869 } 10870 } 10871 function_tests++; 10872 10873 return(test_ret); 10874 } 10875 10876 10877 static int 10878 test_xmlListEnd(void) { 10879 int test_ret = 0; 10880 10881 10882 /* missing type support */ 10883 return(test_ret); 10884 } 10885 10886 10887 static int 10888 test_xmlListFront(void) { 10889 int test_ret = 0; 10890 10891 10892 /* missing type support */ 10893 return(test_ret); 10894 } 10895 10896 10897 static int 10898 test_xmlListInsert(void) { 10899 int test_ret = 0; 10900 10901 int mem_base; 10902 int ret_val; 10903 xmlListPtr l; /* a list */ 10904 int n_l; 10905 void * data; /* the data */ 10906 int n_data; 10907 10908 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10909 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 10910 mem_base = xmlMemBlocks(); 10911 l = gen_xmlListPtr(n_l, 0); 10912 data = gen_userdata(n_data, 1); 10913 10914 ret_val = xmlListInsert(l, data); 10915 desret_int(ret_val); 10916 call_tests++; 10917 des_xmlListPtr(n_l, l, 0); 10918 des_userdata(n_data, data, 1); 10919 xmlResetLastError(); 10920 if (mem_base != xmlMemBlocks()) { 10921 printf("Leak of %d blocks found in xmlListInsert", 10922 xmlMemBlocks() - mem_base); 10923 test_ret++; 10924 printf(" %d", n_l); 10925 printf(" %d", n_data); 10926 printf("\n"); 10927 } 10928 } 10929 } 10930 function_tests++; 10931 10932 return(test_ret); 10933 } 10934 10935 10936 static int 10937 test_xmlListMerge(void) { 10938 int test_ret = 0; 10939 10940 int mem_base; 10941 xmlListPtr l1; /* the original list */ 10942 int n_l1; 10943 xmlListPtr l2; /* the new list */ 10944 int n_l2; 10945 10946 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) { 10947 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) { 10948 mem_base = xmlMemBlocks(); 10949 l1 = gen_xmlListPtr(n_l1, 0); 10950 l2 = gen_xmlListPtr(n_l2, 1); 10951 10952 xmlListMerge(l1, l2); 10953 call_tests++; 10954 des_xmlListPtr(n_l1, l1, 0); 10955 des_xmlListPtr(n_l2, l2, 1); 10956 xmlResetLastError(); 10957 if (mem_base != xmlMemBlocks()) { 10958 printf("Leak of %d blocks found in xmlListMerge", 10959 xmlMemBlocks() - mem_base); 10960 test_ret++; 10961 printf(" %d", n_l1); 10962 printf(" %d", n_l2); 10963 printf("\n"); 10964 } 10965 } 10966 } 10967 function_tests++; 10968 10969 return(test_ret); 10970 } 10971 10972 10973 static int 10974 test_xmlListPopBack(void) { 10975 int test_ret = 0; 10976 10977 int mem_base; 10978 xmlListPtr l; /* a list */ 10979 int n_l; 10980 10981 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 10982 mem_base = xmlMemBlocks(); 10983 l = gen_xmlListPtr(n_l, 0); 10984 10985 xmlListPopBack(l); 10986 call_tests++; 10987 des_xmlListPtr(n_l, l, 0); 10988 xmlResetLastError(); 10989 if (mem_base != xmlMemBlocks()) { 10990 printf("Leak of %d blocks found in xmlListPopBack", 10991 xmlMemBlocks() - mem_base); 10992 test_ret++; 10993 printf(" %d", n_l); 10994 printf("\n"); 10995 } 10996 } 10997 function_tests++; 10998 10999 return(test_ret); 11000 } 11001 11002 11003 static int 11004 test_xmlListPopFront(void) { 11005 int test_ret = 0; 11006 11007 int mem_base; 11008 xmlListPtr l; /* a list */ 11009 int n_l; 11010 11011 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11012 mem_base = xmlMemBlocks(); 11013 l = gen_xmlListPtr(n_l, 0); 11014 11015 xmlListPopFront(l); 11016 call_tests++; 11017 des_xmlListPtr(n_l, l, 0); 11018 xmlResetLastError(); 11019 if (mem_base != xmlMemBlocks()) { 11020 printf("Leak of %d blocks found in xmlListPopFront", 11021 xmlMemBlocks() - mem_base); 11022 test_ret++; 11023 printf(" %d", n_l); 11024 printf("\n"); 11025 } 11026 } 11027 function_tests++; 11028 11029 return(test_ret); 11030 } 11031 11032 11033 static int 11034 test_xmlListPushBack(void) { 11035 int test_ret = 0; 11036 11037 int mem_base; 11038 int ret_val; 11039 xmlListPtr l; /* a list */ 11040 int n_l; 11041 void * data; /* new data */ 11042 int n_data; 11043 11044 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11045 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11046 mem_base = xmlMemBlocks(); 11047 l = gen_xmlListPtr(n_l, 0); 11048 data = gen_userdata(n_data, 1); 11049 11050 ret_val = xmlListPushBack(l, data); 11051 desret_int(ret_val); 11052 call_tests++; 11053 des_xmlListPtr(n_l, l, 0); 11054 des_userdata(n_data, data, 1); 11055 xmlResetLastError(); 11056 if (mem_base != xmlMemBlocks()) { 11057 printf("Leak of %d blocks found in xmlListPushBack", 11058 xmlMemBlocks() - mem_base); 11059 test_ret++; 11060 printf(" %d", n_l); 11061 printf(" %d", n_data); 11062 printf("\n"); 11063 } 11064 } 11065 } 11066 function_tests++; 11067 11068 return(test_ret); 11069 } 11070 11071 11072 static int 11073 test_xmlListPushFront(void) { 11074 int test_ret = 0; 11075 11076 int mem_base; 11077 int ret_val; 11078 xmlListPtr l; /* a list */ 11079 int n_l; 11080 void * data; /* new data */ 11081 int n_data; 11082 11083 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11084 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11085 mem_base = xmlMemBlocks(); 11086 l = gen_xmlListPtr(n_l, 0); 11087 data = gen_userdata(n_data, 1); 11088 11089 ret_val = xmlListPushFront(l, data); 11090 desret_int(ret_val); 11091 call_tests++; 11092 des_xmlListPtr(n_l, l, 0); 11093 des_userdata(n_data, data, 1); 11094 xmlResetLastError(); 11095 if (mem_base != xmlMemBlocks()) { 11096 printf("Leak of %d blocks found in xmlListPushFront", 11097 xmlMemBlocks() - mem_base); 11098 test_ret++; 11099 printf(" %d", n_l); 11100 printf(" %d", n_data); 11101 printf("\n"); 11102 } 11103 } 11104 } 11105 function_tests++; 11106 11107 return(test_ret); 11108 } 11109 11110 11111 static int 11112 test_xmlListRemoveAll(void) { 11113 int test_ret = 0; 11114 11115 int mem_base; 11116 int ret_val; 11117 xmlListPtr l; /* a list */ 11118 int n_l; 11119 void * data; /* list data */ 11120 int n_data; 11121 11122 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11123 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11124 mem_base = xmlMemBlocks(); 11125 l = gen_xmlListPtr(n_l, 0); 11126 data = gen_userdata(n_data, 1); 11127 11128 ret_val = xmlListRemoveAll(l, data); 11129 desret_int(ret_val); 11130 call_tests++; 11131 des_xmlListPtr(n_l, l, 0); 11132 des_userdata(n_data, data, 1); 11133 xmlResetLastError(); 11134 if (mem_base != xmlMemBlocks()) { 11135 printf("Leak of %d blocks found in xmlListRemoveAll", 11136 xmlMemBlocks() - mem_base); 11137 test_ret++; 11138 printf(" %d", n_l); 11139 printf(" %d", n_data); 11140 printf("\n"); 11141 } 11142 } 11143 } 11144 function_tests++; 11145 11146 return(test_ret); 11147 } 11148 11149 11150 static int 11151 test_xmlListRemoveFirst(void) { 11152 int test_ret = 0; 11153 11154 int mem_base; 11155 int ret_val; 11156 xmlListPtr l; /* a list */ 11157 int n_l; 11158 void * data; /* list data */ 11159 int n_data; 11160 11161 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11162 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11163 mem_base = xmlMemBlocks(); 11164 l = gen_xmlListPtr(n_l, 0); 11165 data = gen_userdata(n_data, 1); 11166 11167 ret_val = xmlListRemoveFirst(l, data); 11168 desret_int(ret_val); 11169 call_tests++; 11170 des_xmlListPtr(n_l, l, 0); 11171 des_userdata(n_data, data, 1); 11172 xmlResetLastError(); 11173 if (mem_base != xmlMemBlocks()) { 11174 printf("Leak of %d blocks found in xmlListRemoveFirst", 11175 xmlMemBlocks() - mem_base); 11176 test_ret++; 11177 printf(" %d", n_l); 11178 printf(" %d", n_data); 11179 printf("\n"); 11180 } 11181 } 11182 } 11183 function_tests++; 11184 11185 return(test_ret); 11186 } 11187 11188 11189 static int 11190 test_xmlListRemoveLast(void) { 11191 int test_ret = 0; 11192 11193 int mem_base; 11194 int ret_val; 11195 xmlListPtr l; /* a list */ 11196 int n_l; 11197 void * data; /* list data */ 11198 int n_data; 11199 11200 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11201 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11202 mem_base = xmlMemBlocks(); 11203 l = gen_xmlListPtr(n_l, 0); 11204 data = gen_userdata(n_data, 1); 11205 11206 ret_val = xmlListRemoveLast(l, data); 11207 desret_int(ret_val); 11208 call_tests++; 11209 des_xmlListPtr(n_l, l, 0); 11210 des_userdata(n_data, data, 1); 11211 xmlResetLastError(); 11212 if (mem_base != xmlMemBlocks()) { 11213 printf("Leak of %d blocks found in xmlListRemoveLast", 11214 xmlMemBlocks() - mem_base); 11215 test_ret++; 11216 printf(" %d", n_l); 11217 printf(" %d", n_data); 11218 printf("\n"); 11219 } 11220 } 11221 } 11222 function_tests++; 11223 11224 return(test_ret); 11225 } 11226 11227 11228 static int 11229 test_xmlListReverse(void) { 11230 int test_ret = 0; 11231 11232 int mem_base; 11233 xmlListPtr l; /* a list */ 11234 int n_l; 11235 11236 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11237 mem_base = xmlMemBlocks(); 11238 l = gen_xmlListPtr(n_l, 0); 11239 11240 xmlListReverse(l); 11241 call_tests++; 11242 des_xmlListPtr(n_l, l, 0); 11243 xmlResetLastError(); 11244 if (mem_base != xmlMemBlocks()) { 11245 printf("Leak of %d blocks found in xmlListReverse", 11246 xmlMemBlocks() - mem_base); 11247 test_ret++; 11248 printf(" %d", n_l); 11249 printf("\n"); 11250 } 11251 } 11252 function_tests++; 11253 11254 return(test_ret); 11255 } 11256 11257 11258 static int 11259 test_xmlListReverseSearch(void) { 11260 int test_ret = 0; 11261 11262 int mem_base; 11263 void * ret_val; 11264 xmlListPtr l; /* a list */ 11265 int n_l; 11266 void * data; /* a search value */ 11267 int n_data; 11268 11269 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11270 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11271 mem_base = xmlMemBlocks(); 11272 l = gen_xmlListPtr(n_l, 0); 11273 data = gen_userdata(n_data, 1); 11274 11275 ret_val = xmlListReverseSearch(l, data); 11276 desret_void_ptr(ret_val); 11277 call_tests++; 11278 des_xmlListPtr(n_l, l, 0); 11279 des_userdata(n_data, data, 1); 11280 xmlResetLastError(); 11281 if (mem_base != xmlMemBlocks()) { 11282 printf("Leak of %d blocks found in xmlListReverseSearch", 11283 xmlMemBlocks() - mem_base); 11284 test_ret++; 11285 printf(" %d", n_l); 11286 printf(" %d", n_data); 11287 printf("\n"); 11288 } 11289 } 11290 } 11291 function_tests++; 11292 11293 return(test_ret); 11294 } 11295 11296 11297 static int 11298 test_xmlListReverseWalk(void) { 11299 int test_ret = 0; 11300 11301 11302 /* missing type support */ 11303 return(test_ret); 11304 } 11305 11306 11307 static int 11308 test_xmlListSearch(void) { 11309 int test_ret = 0; 11310 11311 int mem_base; 11312 void * ret_val; 11313 xmlListPtr l; /* a list */ 11314 int n_l; 11315 void * data; /* a search value */ 11316 int n_data; 11317 11318 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11319 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 11320 mem_base = xmlMemBlocks(); 11321 l = gen_xmlListPtr(n_l, 0); 11322 data = gen_userdata(n_data, 1); 11323 11324 ret_val = xmlListSearch(l, data); 11325 desret_void_ptr(ret_val); 11326 call_tests++; 11327 des_xmlListPtr(n_l, l, 0); 11328 des_userdata(n_data, data, 1); 11329 xmlResetLastError(); 11330 if (mem_base != xmlMemBlocks()) { 11331 printf("Leak of %d blocks found in xmlListSearch", 11332 xmlMemBlocks() - mem_base); 11333 test_ret++; 11334 printf(" %d", n_l); 11335 printf(" %d", n_data); 11336 printf("\n"); 11337 } 11338 } 11339 } 11340 function_tests++; 11341 11342 return(test_ret); 11343 } 11344 11345 11346 static int 11347 test_xmlListSize(void) { 11348 int test_ret = 0; 11349 11350 int mem_base; 11351 int ret_val; 11352 xmlListPtr l; /* a list */ 11353 int n_l; 11354 11355 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11356 mem_base = xmlMemBlocks(); 11357 l = gen_xmlListPtr(n_l, 0); 11358 11359 ret_val = xmlListSize(l); 11360 desret_int(ret_val); 11361 call_tests++; 11362 des_xmlListPtr(n_l, l, 0); 11363 xmlResetLastError(); 11364 if (mem_base != xmlMemBlocks()) { 11365 printf("Leak of %d blocks found in xmlListSize", 11366 xmlMemBlocks() - mem_base); 11367 test_ret++; 11368 printf(" %d", n_l); 11369 printf("\n"); 11370 } 11371 } 11372 function_tests++; 11373 11374 return(test_ret); 11375 } 11376 11377 11378 static int 11379 test_xmlListSort(void) { 11380 int test_ret = 0; 11381 11382 int mem_base; 11383 xmlListPtr l; /* a list */ 11384 int n_l; 11385 11386 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { 11387 mem_base = xmlMemBlocks(); 11388 l = gen_xmlListPtr(n_l, 0); 11389 11390 xmlListSort(l); 11391 call_tests++; 11392 des_xmlListPtr(n_l, l, 0); 11393 xmlResetLastError(); 11394 if (mem_base != xmlMemBlocks()) { 11395 printf("Leak of %d blocks found in xmlListSort", 11396 xmlMemBlocks() - mem_base); 11397 test_ret++; 11398 printf(" %d", n_l); 11399 printf("\n"); 11400 } 11401 } 11402 function_tests++; 11403 11404 return(test_ret); 11405 } 11406 11407 11408 static int 11409 test_xmlListWalk(void) { 11410 int test_ret = 0; 11411 11412 11413 /* missing type support */ 11414 return(test_ret); 11415 } 11416 11417 static int 11418 test_list(void) { 11419 int test_ret = 0; 11420 11421 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n"); 11422 test_ret += test_xmlLinkGetData(); 11423 test_ret += test_xmlListAppend(); 11424 test_ret += test_xmlListClear(); 11425 test_ret += test_xmlListCopy(); 11426 test_ret += test_xmlListCreate(); 11427 test_ret += test_xmlListDup(); 11428 test_ret += test_xmlListEmpty(); 11429 test_ret += test_xmlListEnd(); 11430 test_ret += test_xmlListFront(); 11431 test_ret += test_xmlListInsert(); 11432 test_ret += test_xmlListMerge(); 11433 test_ret += test_xmlListPopBack(); 11434 test_ret += test_xmlListPopFront(); 11435 test_ret += test_xmlListPushBack(); 11436 test_ret += test_xmlListPushFront(); 11437 test_ret += test_xmlListRemoveAll(); 11438 test_ret += test_xmlListRemoveFirst(); 11439 test_ret += test_xmlListRemoveLast(); 11440 test_ret += test_xmlListReverse(); 11441 test_ret += test_xmlListReverseSearch(); 11442 test_ret += test_xmlListReverseWalk(); 11443 test_ret += test_xmlListSearch(); 11444 test_ret += test_xmlListSize(); 11445 test_ret += test_xmlListSort(); 11446 test_ret += test_xmlListWalk(); 11447 11448 if (test_ret != 0) 11449 printf("Module list: %d errors\n", test_ret); 11450 return(test_ret); 11451 } 11452 11453 static int 11454 test_xmlNanoFTPCheckResponse(void) { 11455 int test_ret = 0; 11456 11457 #if defined(LIBXML_FTP_ENABLED) 11458 int mem_base; 11459 int ret_val; 11460 void * ctx; /* an FTP context */ 11461 int n_ctx; 11462 11463 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11464 mem_base = xmlMemBlocks(); 11465 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11466 11467 ret_val = xmlNanoFTPCheckResponse(ctx); 11468 desret_int(ret_val); 11469 call_tests++; 11470 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11471 xmlResetLastError(); 11472 if (mem_base != xmlMemBlocks()) { 11473 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse", 11474 xmlMemBlocks() - mem_base); 11475 test_ret++; 11476 printf(" %d", n_ctx); 11477 printf("\n"); 11478 } 11479 } 11480 function_tests++; 11481 #endif 11482 11483 return(test_ret); 11484 } 11485 11486 11487 static int 11488 test_xmlNanoFTPCleanup(void) { 11489 int test_ret = 0; 11490 11491 #if defined(LIBXML_FTP_ENABLED) 11492 int mem_base; 11493 11494 mem_base = xmlMemBlocks(); 11495 11496 xmlNanoFTPCleanup(); 11497 call_tests++; 11498 xmlResetLastError(); 11499 if (mem_base != xmlMemBlocks()) { 11500 printf("Leak of %d blocks found in xmlNanoFTPCleanup", 11501 xmlMemBlocks() - mem_base); 11502 test_ret++; 11503 printf("\n"); 11504 } 11505 function_tests++; 11506 #endif 11507 11508 return(test_ret); 11509 } 11510 11511 11512 static int 11513 test_xmlNanoFTPCloseConnection(void) { 11514 int test_ret = 0; 11515 11516 #if defined(LIBXML_FTP_ENABLED) 11517 int mem_base; 11518 int ret_val; 11519 void * ctx; /* an FTP context */ 11520 int n_ctx; 11521 11522 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11523 mem_base = xmlMemBlocks(); 11524 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11525 11526 ret_val = xmlNanoFTPCloseConnection(ctx); 11527 desret_int(ret_val); 11528 call_tests++; 11529 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11530 xmlResetLastError(); 11531 if (mem_base != xmlMemBlocks()) { 11532 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection", 11533 xmlMemBlocks() - mem_base); 11534 test_ret++; 11535 printf(" %d", n_ctx); 11536 printf("\n"); 11537 } 11538 } 11539 function_tests++; 11540 #endif 11541 11542 return(test_ret); 11543 } 11544 11545 11546 static int 11547 test_xmlNanoFTPCwd(void) { 11548 int test_ret = 0; 11549 11550 #if defined(LIBXML_FTP_ENABLED) 11551 int mem_base; 11552 int ret_val; 11553 void * ctx; /* an FTP context */ 11554 int n_ctx; 11555 char * directory; /* a directory on the server */ 11556 int n_directory; 11557 11558 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11559 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) { 11560 mem_base = xmlMemBlocks(); 11561 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11562 directory = gen_const_char_ptr(n_directory, 1); 11563 11564 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory); 11565 desret_int(ret_val); 11566 call_tests++; 11567 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11568 des_const_char_ptr(n_directory, (const char *)directory, 1); 11569 xmlResetLastError(); 11570 if (mem_base != xmlMemBlocks()) { 11571 printf("Leak of %d blocks found in xmlNanoFTPCwd", 11572 xmlMemBlocks() - mem_base); 11573 test_ret++; 11574 printf(" %d", n_ctx); 11575 printf(" %d", n_directory); 11576 printf("\n"); 11577 } 11578 } 11579 } 11580 function_tests++; 11581 #endif 11582 11583 return(test_ret); 11584 } 11585 11586 11587 static int 11588 test_xmlNanoFTPDele(void) { 11589 int test_ret = 0; 11590 11591 #if defined(LIBXML_FTP_ENABLED) 11592 int mem_base; 11593 int ret_val; 11594 void * ctx; /* an FTP context */ 11595 int n_ctx; 11596 const char * file; /* a file or directory on the server */ 11597 int n_file; 11598 11599 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11600 for (n_file = 0;n_file < gen_nb_filepath;n_file++) { 11601 mem_base = xmlMemBlocks(); 11602 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11603 file = gen_filepath(n_file, 1); 11604 11605 ret_val = xmlNanoFTPDele(ctx, file); 11606 desret_int(ret_val); 11607 call_tests++; 11608 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11609 des_filepath(n_file, file, 1); 11610 xmlResetLastError(); 11611 if (mem_base != xmlMemBlocks()) { 11612 printf("Leak of %d blocks found in xmlNanoFTPDele", 11613 xmlMemBlocks() - mem_base); 11614 test_ret++; 11615 printf(" %d", n_ctx); 11616 printf(" %d", n_file); 11617 printf("\n"); 11618 } 11619 } 11620 } 11621 function_tests++; 11622 #endif 11623 11624 return(test_ret); 11625 } 11626 11627 11628 static int 11629 test_xmlNanoFTPGet(void) { 11630 int test_ret = 0; 11631 11632 11633 /* missing type support */ 11634 return(test_ret); 11635 } 11636 11637 11638 static int 11639 test_xmlNanoFTPGetConnection(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 11648 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11649 mem_base = xmlMemBlocks(); 11650 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11651 11652 ret_val = xmlNanoFTPGetConnection(ctx); 11653 desret_int(ret_val); 11654 call_tests++; 11655 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11656 xmlResetLastError(); 11657 if (mem_base != xmlMemBlocks()) { 11658 printf("Leak of %d blocks found in xmlNanoFTPGetConnection", 11659 xmlMemBlocks() - mem_base); 11660 test_ret++; 11661 printf(" %d", n_ctx); 11662 printf("\n"); 11663 } 11664 } 11665 function_tests++; 11666 #endif 11667 11668 return(test_ret); 11669 } 11670 11671 11672 static int 11673 test_xmlNanoFTPGetResponse(void) { 11674 int test_ret = 0; 11675 11676 #if defined(LIBXML_FTP_ENABLED) 11677 int mem_base; 11678 int ret_val; 11679 void * ctx; /* an FTP context */ 11680 int n_ctx; 11681 11682 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11683 mem_base = xmlMemBlocks(); 11684 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11685 11686 ret_val = xmlNanoFTPGetResponse(ctx); 11687 desret_int(ret_val); 11688 call_tests++; 11689 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11690 xmlResetLastError(); 11691 if (mem_base != xmlMemBlocks()) { 11692 printf("Leak of %d blocks found in xmlNanoFTPGetResponse", 11693 xmlMemBlocks() - mem_base); 11694 test_ret++; 11695 printf(" %d", n_ctx); 11696 printf("\n"); 11697 } 11698 } 11699 function_tests++; 11700 #endif 11701 11702 return(test_ret); 11703 } 11704 11705 11706 static int 11707 test_xmlNanoFTPGetSocket(void) { 11708 int test_ret = 0; 11709 11710 #if defined(LIBXML_FTP_ENABLED) 11711 int mem_base; 11712 int ret_val; 11713 void * ctx; /* an FTP context */ 11714 int n_ctx; 11715 const char * filename; /* the file to retrieve (or NULL if path is in context). */ 11716 int n_filename; 11717 11718 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11719 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 11720 mem_base = xmlMemBlocks(); 11721 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11722 filename = gen_filepath(n_filename, 1); 11723 11724 ret_val = xmlNanoFTPGetSocket(ctx, filename); 11725 desret_int(ret_val); 11726 call_tests++; 11727 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11728 des_filepath(n_filename, filename, 1); 11729 xmlResetLastError(); 11730 if (mem_base != xmlMemBlocks()) { 11731 printf("Leak of %d blocks found in xmlNanoFTPGetSocket", 11732 xmlMemBlocks() - mem_base); 11733 test_ret++; 11734 printf(" %d", n_ctx); 11735 printf(" %d", n_filename); 11736 printf("\n"); 11737 } 11738 } 11739 } 11740 function_tests++; 11741 #endif 11742 11743 return(test_ret); 11744 } 11745 11746 11747 static int 11748 test_xmlNanoFTPInit(void) { 11749 int test_ret = 0; 11750 11751 #if defined(LIBXML_FTP_ENABLED) 11752 int mem_base; 11753 11754 mem_base = xmlMemBlocks(); 11755 11756 xmlNanoFTPInit(); 11757 call_tests++; 11758 xmlResetLastError(); 11759 if (mem_base != xmlMemBlocks()) { 11760 printf("Leak of %d blocks found in xmlNanoFTPInit", 11761 xmlMemBlocks() - mem_base); 11762 test_ret++; 11763 printf("\n"); 11764 } 11765 function_tests++; 11766 #endif 11767 11768 return(test_ret); 11769 } 11770 11771 11772 static int 11773 test_xmlNanoFTPList(void) { 11774 int test_ret = 0; 11775 11776 11777 /* missing type support */ 11778 return(test_ret); 11779 } 11780 11781 11782 static int 11783 test_xmlNanoFTPNewCtxt(void) { 11784 int test_ret = 0; 11785 11786 #if defined(LIBXML_FTP_ENABLED) 11787 int mem_base; 11788 void * ret_val; 11789 const char * URL; /* The URL used to initialize the context */ 11790 int n_URL; 11791 11792 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 11793 mem_base = xmlMemBlocks(); 11794 URL = gen_filepath(n_URL, 0); 11795 11796 ret_val = xmlNanoFTPNewCtxt(URL); 11797 desret_xmlNanoFTPCtxtPtr(ret_val); 11798 call_tests++; 11799 des_filepath(n_URL, URL, 0); 11800 xmlResetLastError(); 11801 if (mem_base != xmlMemBlocks()) { 11802 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt", 11803 xmlMemBlocks() - mem_base); 11804 test_ret++; 11805 printf(" %d", n_URL); 11806 printf("\n"); 11807 } 11808 } 11809 function_tests++; 11810 #endif 11811 11812 return(test_ret); 11813 } 11814 11815 11816 static int 11817 test_xmlNanoFTPOpen(void) { 11818 int test_ret = 0; 11819 11820 #if defined(LIBXML_FTP_ENABLED) 11821 int mem_base; 11822 void * ret_val; 11823 const char * URL; /* the URL to the resource */ 11824 int n_URL; 11825 11826 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 11827 mem_base = xmlMemBlocks(); 11828 URL = gen_filepath(n_URL, 0); 11829 11830 ret_val = xmlNanoFTPOpen(URL); 11831 desret_xmlNanoFTPCtxtPtr(ret_val); 11832 call_tests++; 11833 des_filepath(n_URL, URL, 0); 11834 xmlResetLastError(); 11835 if (mem_base != xmlMemBlocks()) { 11836 printf("Leak of %d blocks found in xmlNanoFTPOpen", 11837 xmlMemBlocks() - mem_base); 11838 test_ret++; 11839 printf(" %d", n_URL); 11840 printf("\n"); 11841 } 11842 } 11843 function_tests++; 11844 #endif 11845 11846 return(test_ret); 11847 } 11848 11849 11850 static int 11851 test_xmlNanoFTPProxy(void) { 11852 int test_ret = 0; 11853 11854 #if defined(LIBXML_FTP_ENABLED) 11855 char * host; /* the proxy host name */ 11856 int n_host; 11857 int port; /* the proxy port */ 11858 int n_port; 11859 char * user; /* the proxy user name */ 11860 int n_user; 11861 char * passwd; /* the proxy password */ 11862 int n_passwd; 11863 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */ 11864 int n_type; 11865 11866 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) { 11867 for (n_port = 0;n_port < gen_nb_int;n_port++) { 11868 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) { 11869 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) { 11870 for (n_type = 0;n_type < gen_nb_int;n_type++) { 11871 host = gen_const_char_ptr(n_host, 0); 11872 port = gen_int(n_port, 1); 11873 user = gen_const_char_ptr(n_user, 2); 11874 passwd = gen_const_char_ptr(n_passwd, 3); 11875 type = gen_int(n_type, 4); 11876 11877 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type); 11878 call_tests++; 11879 des_const_char_ptr(n_host, (const char *)host, 0); 11880 des_int(n_port, port, 1); 11881 des_const_char_ptr(n_user, (const char *)user, 2); 11882 des_const_char_ptr(n_passwd, (const char *)passwd, 3); 11883 des_int(n_type, type, 4); 11884 xmlResetLastError(); 11885 } 11886 } 11887 } 11888 } 11889 } 11890 function_tests++; 11891 #endif 11892 11893 return(test_ret); 11894 } 11895 11896 11897 static int 11898 test_xmlNanoFTPQuit(void) { 11899 int test_ret = 0; 11900 11901 #if defined(LIBXML_FTP_ENABLED) 11902 int mem_base; 11903 int ret_val; 11904 void * ctx; /* an FTP context */ 11905 int n_ctx; 11906 11907 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11908 mem_base = xmlMemBlocks(); 11909 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11910 11911 ret_val = xmlNanoFTPQuit(ctx); 11912 desret_int(ret_val); 11913 call_tests++; 11914 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11915 xmlResetLastError(); 11916 if (mem_base != xmlMemBlocks()) { 11917 printf("Leak of %d blocks found in xmlNanoFTPQuit", 11918 xmlMemBlocks() - mem_base); 11919 test_ret++; 11920 printf(" %d", n_ctx); 11921 printf("\n"); 11922 } 11923 } 11924 function_tests++; 11925 #endif 11926 11927 return(test_ret); 11928 } 11929 11930 11931 static int 11932 test_xmlNanoFTPRead(void) { 11933 int test_ret = 0; 11934 11935 #if defined(LIBXML_FTP_ENABLED) 11936 int mem_base; 11937 int ret_val; 11938 void * ctx; /* the FTP context */ 11939 int n_ctx; 11940 void * dest; /* a buffer */ 11941 int n_dest; 11942 int len; /* the buffer length */ 11943 int n_len; 11944 11945 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 11946 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) { 11947 for (n_len = 0;n_len < gen_nb_int;n_len++) { 11948 mem_base = xmlMemBlocks(); 11949 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 11950 dest = gen_void_ptr(n_dest, 1); 11951 len = gen_int(n_len, 2); 11952 11953 ret_val = xmlNanoFTPRead(ctx, dest, len); 11954 desret_int(ret_val); 11955 call_tests++; 11956 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 11957 des_void_ptr(n_dest, dest, 1); 11958 des_int(n_len, len, 2); 11959 xmlResetLastError(); 11960 if (mem_base != xmlMemBlocks()) { 11961 printf("Leak of %d blocks found in xmlNanoFTPRead", 11962 xmlMemBlocks() - mem_base); 11963 test_ret++; 11964 printf(" %d", n_ctx); 11965 printf(" %d", n_dest); 11966 printf(" %d", n_len); 11967 printf("\n"); 11968 } 11969 } 11970 } 11971 } 11972 function_tests++; 11973 #endif 11974 11975 return(test_ret); 11976 } 11977 11978 11979 static int 11980 test_xmlNanoFTPScanProxy(void) { 11981 int test_ret = 0; 11982 11983 #if defined(LIBXML_FTP_ENABLED) 11984 const char * URL; /* The proxy URL used to initialize the proxy context */ 11985 int n_URL; 11986 11987 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 11988 URL = gen_filepath(n_URL, 0); 11989 11990 xmlNanoFTPScanProxy(URL); 11991 call_tests++; 11992 des_filepath(n_URL, URL, 0); 11993 xmlResetLastError(); 11994 } 11995 function_tests++; 11996 #endif 11997 11998 return(test_ret); 11999 } 12000 12001 12002 static int 12003 test_xmlNanoFTPUpdateURL(void) { 12004 int test_ret = 0; 12005 12006 #if defined(LIBXML_FTP_ENABLED) 12007 int mem_base; 12008 int ret_val; 12009 void * ctx; /* an FTP context */ 12010 int n_ctx; 12011 const char * URL; /* The URL used to update the context */ 12012 int n_URL; 12013 12014 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { 12015 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12016 mem_base = xmlMemBlocks(); 12017 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); 12018 URL = gen_filepath(n_URL, 1); 12019 12020 ret_val = xmlNanoFTPUpdateURL(ctx, URL); 12021 desret_int(ret_val); 12022 call_tests++; 12023 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); 12024 des_filepath(n_URL, URL, 1); 12025 xmlResetLastError(); 12026 if (mem_base != xmlMemBlocks()) { 12027 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL", 12028 xmlMemBlocks() - mem_base); 12029 test_ret++; 12030 printf(" %d", n_ctx); 12031 printf(" %d", n_URL); 12032 printf("\n"); 12033 } 12034 } 12035 } 12036 function_tests++; 12037 #endif 12038 12039 return(test_ret); 12040 } 12041 12042 static int 12043 test_nanoftp(void) { 12044 int test_ret = 0; 12045 12046 if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n"); 12047 test_ret += test_xmlNanoFTPCheckResponse(); 12048 test_ret += test_xmlNanoFTPCleanup(); 12049 test_ret += test_xmlNanoFTPCloseConnection(); 12050 test_ret += test_xmlNanoFTPCwd(); 12051 test_ret += test_xmlNanoFTPDele(); 12052 test_ret += test_xmlNanoFTPGet(); 12053 test_ret += test_xmlNanoFTPGetConnection(); 12054 test_ret += test_xmlNanoFTPGetResponse(); 12055 test_ret += test_xmlNanoFTPGetSocket(); 12056 test_ret += test_xmlNanoFTPInit(); 12057 test_ret += test_xmlNanoFTPList(); 12058 test_ret += test_xmlNanoFTPNewCtxt(); 12059 test_ret += test_xmlNanoFTPOpen(); 12060 test_ret += test_xmlNanoFTPProxy(); 12061 test_ret += test_xmlNanoFTPQuit(); 12062 test_ret += test_xmlNanoFTPRead(); 12063 test_ret += test_xmlNanoFTPScanProxy(); 12064 test_ret += test_xmlNanoFTPUpdateURL(); 12065 12066 if (test_ret != 0) 12067 printf("Module nanoftp: %d errors\n", test_ret); 12068 return(test_ret); 12069 } 12070 12071 static int 12072 test_xmlNanoHTTPAuthHeader(void) { 12073 int test_ret = 0; 12074 12075 #if defined(LIBXML_HTTP_ENABLED) 12076 int mem_base; 12077 const char * ret_val; 12078 void * ctx; /* the HTTP context */ 12079 int n_ctx; 12080 12081 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12082 mem_base = xmlMemBlocks(); 12083 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12084 12085 ret_val = xmlNanoHTTPAuthHeader(ctx); 12086 desret_const_char_ptr(ret_val); 12087 call_tests++; 12088 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12089 xmlResetLastError(); 12090 if (mem_base != xmlMemBlocks()) { 12091 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader", 12092 xmlMemBlocks() - mem_base); 12093 test_ret++; 12094 printf(" %d", n_ctx); 12095 printf("\n"); 12096 } 12097 } 12098 function_tests++; 12099 #endif 12100 12101 return(test_ret); 12102 } 12103 12104 12105 static int 12106 test_xmlNanoHTTPCleanup(void) { 12107 int test_ret = 0; 12108 12109 #if defined(LIBXML_HTTP_ENABLED) 12110 int mem_base; 12111 12112 mem_base = xmlMemBlocks(); 12113 12114 xmlNanoHTTPCleanup(); 12115 call_tests++; 12116 xmlResetLastError(); 12117 if (mem_base != xmlMemBlocks()) { 12118 printf("Leak of %d blocks found in xmlNanoHTTPCleanup", 12119 xmlMemBlocks() - mem_base); 12120 test_ret++; 12121 printf("\n"); 12122 } 12123 function_tests++; 12124 #endif 12125 12126 return(test_ret); 12127 } 12128 12129 12130 static int 12131 test_xmlNanoHTTPContentLength(void) { 12132 int test_ret = 0; 12133 12134 #if defined(LIBXML_HTTP_ENABLED) 12135 int mem_base; 12136 int ret_val; 12137 void * ctx; /* the HTTP context */ 12138 int n_ctx; 12139 12140 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12141 mem_base = xmlMemBlocks(); 12142 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12143 12144 ret_val = xmlNanoHTTPContentLength(ctx); 12145 desret_int(ret_val); 12146 call_tests++; 12147 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12148 xmlResetLastError(); 12149 if (mem_base != xmlMemBlocks()) { 12150 printf("Leak of %d blocks found in xmlNanoHTTPContentLength", 12151 xmlMemBlocks() - mem_base); 12152 test_ret++; 12153 printf(" %d", n_ctx); 12154 printf("\n"); 12155 } 12156 } 12157 function_tests++; 12158 #endif 12159 12160 return(test_ret); 12161 } 12162 12163 12164 static int 12165 test_xmlNanoHTTPEncoding(void) { 12166 int test_ret = 0; 12167 12168 #if defined(LIBXML_HTTP_ENABLED) 12169 int mem_base; 12170 const char * ret_val; 12171 void * ctx; /* the HTTP context */ 12172 int n_ctx; 12173 12174 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12175 mem_base = xmlMemBlocks(); 12176 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12177 12178 ret_val = xmlNanoHTTPEncoding(ctx); 12179 desret_const_char_ptr(ret_val); 12180 call_tests++; 12181 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12182 xmlResetLastError(); 12183 if (mem_base != xmlMemBlocks()) { 12184 printf("Leak of %d blocks found in xmlNanoHTTPEncoding", 12185 xmlMemBlocks() - mem_base); 12186 test_ret++; 12187 printf(" %d", n_ctx); 12188 printf("\n"); 12189 } 12190 } 12191 function_tests++; 12192 #endif 12193 12194 return(test_ret); 12195 } 12196 12197 12198 #define gen_nb_char_ptr_ptr 1 12199 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 12200 return(NULL); 12201 } 12202 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 12203 } 12204 12205 static int 12206 test_xmlNanoHTTPFetch(void) { 12207 int test_ret = 0; 12208 12209 #if defined(LIBXML_HTTP_ENABLED) 12210 int mem_base; 12211 int ret_val; 12212 const char * URL; /* The URL to load */ 12213 int n_URL; 12214 const char * filename; /* the filename where the content should be saved */ 12215 int n_filename; 12216 char ** contentType; /* if available the Content-Type information will be returned at that location */ 12217 int n_contentType; 12218 12219 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) { 12220 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 12221 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { 12222 mem_base = xmlMemBlocks(); 12223 URL = gen_fileoutput(n_URL, 0); 12224 filename = gen_fileoutput(n_filename, 1); 12225 contentType = gen_char_ptr_ptr(n_contentType, 2); 12226 12227 ret_val = xmlNanoHTTPFetch(URL, filename, contentType); 12228 desret_int(ret_val); 12229 call_tests++; 12230 des_fileoutput(n_URL, URL, 0); 12231 des_fileoutput(n_filename, filename, 1); 12232 des_char_ptr_ptr(n_contentType, contentType, 2); 12233 xmlResetLastError(); 12234 if (mem_base != xmlMemBlocks()) { 12235 printf("Leak of %d blocks found in xmlNanoHTTPFetch", 12236 xmlMemBlocks() - mem_base); 12237 test_ret++; 12238 printf(" %d", n_URL); 12239 printf(" %d", n_filename); 12240 printf(" %d", n_contentType); 12241 printf("\n"); 12242 } 12243 } 12244 } 12245 } 12246 function_tests++; 12247 #endif 12248 12249 return(test_ret); 12250 } 12251 12252 12253 static int 12254 test_xmlNanoHTTPInit(void) { 12255 int test_ret = 0; 12256 12257 #if defined(LIBXML_HTTP_ENABLED) 12258 int mem_base; 12259 12260 mem_base = xmlMemBlocks(); 12261 12262 xmlNanoHTTPInit(); 12263 call_tests++; 12264 xmlResetLastError(); 12265 if (mem_base != xmlMemBlocks()) { 12266 printf("Leak of %d blocks found in xmlNanoHTTPInit", 12267 xmlMemBlocks() - mem_base); 12268 test_ret++; 12269 printf("\n"); 12270 } 12271 function_tests++; 12272 #endif 12273 12274 return(test_ret); 12275 } 12276 12277 12278 static int 12279 test_xmlNanoHTTPMimeType(void) { 12280 int test_ret = 0; 12281 12282 #if defined(LIBXML_HTTP_ENABLED) 12283 int mem_base; 12284 const char * ret_val; 12285 void * ctx; /* the HTTP context */ 12286 int n_ctx; 12287 12288 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12289 mem_base = xmlMemBlocks(); 12290 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12291 12292 ret_val = xmlNanoHTTPMimeType(ctx); 12293 desret_const_char_ptr(ret_val); 12294 call_tests++; 12295 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12296 xmlResetLastError(); 12297 if (mem_base != xmlMemBlocks()) { 12298 printf("Leak of %d blocks found in xmlNanoHTTPMimeType", 12299 xmlMemBlocks() - mem_base); 12300 test_ret++; 12301 printf(" %d", n_ctx); 12302 printf("\n"); 12303 } 12304 } 12305 function_tests++; 12306 #endif 12307 12308 return(test_ret); 12309 } 12310 12311 12312 static int 12313 test_xmlNanoHTTPOpen(void) { 12314 int test_ret = 0; 12315 12316 #if defined(LIBXML_HTTP_ENABLED) 12317 int mem_base; 12318 void * ret_val; 12319 const char * URL; /* The URL to load */ 12320 int n_URL; 12321 char ** contentType; /* if available the Content-Type information will be returned at that location */ 12322 int n_contentType; 12323 12324 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12325 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { 12326 mem_base = xmlMemBlocks(); 12327 URL = gen_filepath(n_URL, 0); 12328 contentType = gen_char_ptr_ptr(n_contentType, 1); 12329 12330 ret_val = xmlNanoHTTPOpen(URL, contentType); 12331 desret_xmlNanoHTTPCtxtPtr(ret_val); 12332 call_tests++; 12333 des_filepath(n_URL, URL, 0); 12334 des_char_ptr_ptr(n_contentType, contentType, 1); 12335 xmlResetLastError(); 12336 if (mem_base != xmlMemBlocks()) { 12337 printf("Leak of %d blocks found in xmlNanoHTTPOpen", 12338 xmlMemBlocks() - mem_base); 12339 test_ret++; 12340 printf(" %d", n_URL); 12341 printf(" %d", n_contentType); 12342 printf("\n"); 12343 } 12344 } 12345 } 12346 function_tests++; 12347 #endif 12348 12349 return(test_ret); 12350 } 12351 12352 12353 static int 12354 test_xmlNanoHTTPOpenRedir(void) { 12355 int test_ret = 0; 12356 12357 #if defined(LIBXML_HTTP_ENABLED) 12358 int mem_base; 12359 void * ret_val; 12360 const char * URL; /* The URL to load */ 12361 int n_URL; 12362 char ** contentType; /* if available the Content-Type information will be returned at that location */ 12363 int n_contentType; 12364 char ** redir; /* if available the redirected URL will be returned */ 12365 int n_redir; 12366 12367 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12368 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { 12369 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) { 12370 mem_base = xmlMemBlocks(); 12371 URL = gen_filepath(n_URL, 0); 12372 contentType = gen_char_ptr_ptr(n_contentType, 1); 12373 redir = gen_char_ptr_ptr(n_redir, 2); 12374 12375 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir); 12376 desret_xmlNanoHTTPCtxtPtr(ret_val); 12377 call_tests++; 12378 des_filepath(n_URL, URL, 0); 12379 des_char_ptr_ptr(n_contentType, contentType, 1); 12380 des_char_ptr_ptr(n_redir, redir, 2); 12381 xmlResetLastError(); 12382 if (mem_base != xmlMemBlocks()) { 12383 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir", 12384 xmlMemBlocks() - mem_base); 12385 test_ret++; 12386 printf(" %d", n_URL); 12387 printf(" %d", n_contentType); 12388 printf(" %d", n_redir); 12389 printf("\n"); 12390 } 12391 } 12392 } 12393 } 12394 function_tests++; 12395 #endif 12396 12397 return(test_ret); 12398 } 12399 12400 12401 static int 12402 test_xmlNanoHTTPRead(void) { 12403 int test_ret = 0; 12404 12405 #if defined(LIBXML_HTTP_ENABLED) 12406 int mem_base; 12407 int ret_val; 12408 void * ctx; /* the HTTP context */ 12409 int n_ctx; 12410 void * dest; /* a buffer */ 12411 int n_dest; 12412 int len; /* the buffer length */ 12413 int n_len; 12414 12415 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12416 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) { 12417 for (n_len = 0;n_len < gen_nb_int;n_len++) { 12418 mem_base = xmlMemBlocks(); 12419 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12420 dest = gen_void_ptr(n_dest, 1); 12421 len = gen_int(n_len, 2); 12422 12423 ret_val = xmlNanoHTTPRead(ctx, dest, len); 12424 desret_int(ret_val); 12425 call_tests++; 12426 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12427 des_void_ptr(n_dest, dest, 1); 12428 des_int(n_len, len, 2); 12429 xmlResetLastError(); 12430 if (mem_base != xmlMemBlocks()) { 12431 printf("Leak of %d blocks found in xmlNanoHTTPRead", 12432 xmlMemBlocks() - mem_base); 12433 test_ret++; 12434 printf(" %d", n_ctx); 12435 printf(" %d", n_dest); 12436 printf(" %d", n_len); 12437 printf("\n"); 12438 } 12439 } 12440 } 12441 } 12442 function_tests++; 12443 #endif 12444 12445 return(test_ret); 12446 } 12447 12448 12449 static int 12450 test_xmlNanoHTTPRedir(void) { 12451 int test_ret = 0; 12452 12453 12454 /* missing type support */ 12455 return(test_ret); 12456 } 12457 12458 12459 static int 12460 test_xmlNanoHTTPReturnCode(void) { 12461 int test_ret = 0; 12462 12463 #if defined(LIBXML_HTTP_ENABLED) 12464 int mem_base; 12465 int ret_val; 12466 void * ctx; /* the HTTP context */ 12467 int n_ctx; 12468 12469 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { 12470 mem_base = xmlMemBlocks(); 12471 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); 12472 12473 ret_val = xmlNanoHTTPReturnCode(ctx); 12474 desret_int(ret_val); 12475 call_tests++; 12476 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); 12477 xmlResetLastError(); 12478 if (mem_base != xmlMemBlocks()) { 12479 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode", 12480 xmlMemBlocks() - mem_base); 12481 test_ret++; 12482 printf(" %d", n_ctx); 12483 printf("\n"); 12484 } 12485 } 12486 function_tests++; 12487 #endif 12488 12489 return(test_ret); 12490 } 12491 12492 12493 static int 12494 test_xmlNanoHTTPSave(void) { 12495 int test_ret = 0; 12496 12497 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 12498 int mem_base; 12499 int ret_val; 12500 void * ctxt; /* the HTTP context */ 12501 int n_ctxt; 12502 const char * filename; /* the filename where the content should be saved */ 12503 int n_filename; 12504 12505 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) { 12506 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 12507 mem_base = xmlMemBlocks(); 12508 ctxt = gen_void_ptr(n_ctxt, 0); 12509 filename = gen_fileoutput(n_filename, 1); 12510 12511 ret_val = xmlNanoHTTPSave(ctxt, filename); 12512 desret_int(ret_val); 12513 call_tests++; 12514 des_void_ptr(n_ctxt, ctxt, 0); 12515 des_fileoutput(n_filename, filename, 1); 12516 xmlResetLastError(); 12517 if (mem_base != xmlMemBlocks()) { 12518 printf("Leak of %d blocks found in xmlNanoHTTPSave", 12519 xmlMemBlocks() - mem_base); 12520 test_ret++; 12521 printf(" %d", n_ctxt); 12522 printf(" %d", n_filename); 12523 printf("\n"); 12524 } 12525 } 12526 } 12527 function_tests++; 12528 #endif 12529 12530 return(test_ret); 12531 } 12532 12533 12534 static int 12535 test_xmlNanoHTTPScanProxy(void) { 12536 int test_ret = 0; 12537 12538 #if defined(LIBXML_HTTP_ENABLED) 12539 const char * URL; /* The proxy URL used to initialize the proxy context */ 12540 int n_URL; 12541 12542 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12543 URL = gen_filepath(n_URL, 0); 12544 12545 xmlNanoHTTPScanProxy(URL); 12546 call_tests++; 12547 des_filepath(n_URL, URL, 0); 12548 xmlResetLastError(); 12549 } 12550 function_tests++; 12551 #endif 12552 12553 return(test_ret); 12554 } 12555 12556 static int 12557 test_nanohttp(void) { 12558 int test_ret = 0; 12559 12560 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n"); 12561 test_ret += test_xmlNanoHTTPAuthHeader(); 12562 test_ret += test_xmlNanoHTTPCleanup(); 12563 test_ret += test_xmlNanoHTTPContentLength(); 12564 test_ret += test_xmlNanoHTTPEncoding(); 12565 test_ret += test_xmlNanoHTTPFetch(); 12566 test_ret += test_xmlNanoHTTPInit(); 12567 test_ret += test_xmlNanoHTTPMimeType(); 12568 test_ret += test_xmlNanoHTTPOpen(); 12569 test_ret += test_xmlNanoHTTPOpenRedir(); 12570 test_ret += test_xmlNanoHTTPRead(); 12571 test_ret += test_xmlNanoHTTPRedir(); 12572 test_ret += test_xmlNanoHTTPReturnCode(); 12573 test_ret += test_xmlNanoHTTPSave(); 12574 test_ret += test_xmlNanoHTTPScanProxy(); 12575 12576 if (test_ret != 0) 12577 printf("Module nanohttp: %d errors\n", test_ret); 12578 return(test_ret); 12579 } 12580 12581 static int 12582 test_xmlByteConsumed(void) { 12583 int test_ret = 0; 12584 12585 int mem_base; 12586 long ret_val; 12587 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12588 int n_ctxt; 12589 12590 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12591 mem_base = xmlMemBlocks(); 12592 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12593 12594 ret_val = xmlByteConsumed(ctxt); 12595 desret_long(ret_val); 12596 call_tests++; 12597 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12598 xmlResetLastError(); 12599 if (mem_base != xmlMemBlocks()) { 12600 printf("Leak of %d blocks found in xmlByteConsumed", 12601 xmlMemBlocks() - mem_base); 12602 test_ret++; 12603 printf(" %d", n_ctxt); 12604 printf("\n"); 12605 } 12606 } 12607 function_tests++; 12608 12609 return(test_ret); 12610 } 12611 12612 12613 static int 12614 test_xmlClearNodeInfoSeq(void) { 12615 int test_ret = 0; 12616 12617 int mem_base; 12618 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ 12619 int n_seq; 12620 12621 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) { 12622 mem_base = xmlMemBlocks(); 12623 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0); 12624 12625 xmlClearNodeInfoSeq(seq); 12626 call_tests++; 12627 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0); 12628 xmlResetLastError(); 12629 if (mem_base != xmlMemBlocks()) { 12630 printf("Leak of %d blocks found in xmlClearNodeInfoSeq", 12631 xmlMemBlocks() - mem_base); 12632 test_ret++; 12633 printf(" %d", n_seq); 12634 printf("\n"); 12635 } 12636 } 12637 function_tests++; 12638 12639 return(test_ret); 12640 } 12641 12642 12643 static int 12644 test_xmlClearParserCtxt(void) { 12645 int test_ret = 0; 12646 12647 int mem_base; 12648 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12649 int n_ctxt; 12650 12651 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12652 mem_base = xmlMemBlocks(); 12653 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12654 12655 xmlClearParserCtxt(ctxt); 12656 call_tests++; 12657 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12658 xmlResetLastError(); 12659 if (mem_base != xmlMemBlocks()) { 12660 printf("Leak of %d blocks found in xmlClearParserCtxt", 12661 xmlMemBlocks() - mem_base); 12662 test_ret++; 12663 printf(" %d", n_ctxt); 12664 printf("\n"); 12665 } 12666 } 12667 function_tests++; 12668 12669 return(test_ret); 12670 } 12671 12672 12673 static int 12674 test_xmlCreateDocParserCtxt(void) { 12675 int test_ret = 0; 12676 12677 int mem_base; 12678 xmlParserCtxtPtr ret_val; 12679 xmlChar * cur; /* a pointer to an array of xmlChar */ 12680 int n_cur; 12681 12682 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 12683 mem_base = xmlMemBlocks(); 12684 cur = gen_const_xmlChar_ptr(n_cur, 0); 12685 12686 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur); 12687 desret_xmlParserCtxtPtr(ret_val); 12688 call_tests++; 12689 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 12690 xmlResetLastError(); 12691 if (mem_base != xmlMemBlocks()) { 12692 printf("Leak of %d blocks found in xmlCreateDocParserCtxt", 12693 xmlMemBlocks() - mem_base); 12694 test_ret++; 12695 printf(" %d", n_cur); 12696 printf("\n"); 12697 } 12698 } 12699 function_tests++; 12700 12701 return(test_ret); 12702 } 12703 12704 12705 static int 12706 test_xmlCreatePushParserCtxt(void) { 12707 int test_ret = 0; 12708 12709 #if defined(LIBXML_PUSH_ENABLED) 12710 int mem_base; 12711 xmlParserCtxtPtr ret_val; 12712 xmlSAXHandlerPtr sax; /* a SAX handler */ 12713 int n_sax; 12714 void * user_data; /* The user data returned on SAX callbacks */ 12715 int n_user_data; 12716 char * chunk; /* a pointer to an array of chars */ 12717 int n_chunk; 12718 int size; /* number of chars in the array */ 12719 int n_size; 12720 const char * filename; /* an optional file name or URI */ 12721 int n_filename; 12722 12723 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 12724 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 12725 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 12726 for (n_size = 0;n_size < gen_nb_int;n_size++) { 12727 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 12728 mem_base = xmlMemBlocks(); 12729 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 12730 user_data = gen_userdata(n_user_data, 1); 12731 chunk = gen_const_char_ptr(n_chunk, 2); 12732 size = gen_int(n_size, 3); 12733 filename = gen_fileoutput(n_filename, 4); 12734 12735 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename); 12736 desret_xmlParserCtxtPtr(ret_val); 12737 call_tests++; 12738 des_xmlSAXHandlerPtr(n_sax, sax, 0); 12739 des_userdata(n_user_data, user_data, 1); 12740 des_const_char_ptr(n_chunk, (const char *)chunk, 2); 12741 des_int(n_size, size, 3); 12742 des_fileoutput(n_filename, filename, 4); 12743 xmlResetLastError(); 12744 if (mem_base != xmlMemBlocks()) { 12745 printf("Leak of %d blocks found in xmlCreatePushParserCtxt", 12746 xmlMemBlocks() - mem_base); 12747 test_ret++; 12748 printf(" %d", n_sax); 12749 printf(" %d", n_user_data); 12750 printf(" %d", n_chunk); 12751 printf(" %d", n_size); 12752 printf(" %d", n_filename); 12753 printf("\n"); 12754 } 12755 } 12756 } 12757 } 12758 } 12759 } 12760 function_tests++; 12761 #endif 12762 12763 return(test_ret); 12764 } 12765 12766 12767 static int 12768 test_xmlCtxtReadDoc(void) { 12769 int test_ret = 0; 12770 12771 int mem_base; 12772 xmlDocPtr ret_val; 12773 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12774 int n_ctxt; 12775 xmlChar * cur; /* a pointer to a zero terminated string */ 12776 int n_cur; 12777 const char * URL; /* the base URL to use for the document */ 12778 int n_URL; 12779 char * encoding; /* the document encoding, or NULL */ 12780 int n_encoding; 12781 int options; /* a combination of xmlParserOption */ 12782 int n_options; 12783 12784 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12785 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 12786 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12787 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12788 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 12789 mem_base = xmlMemBlocks(); 12790 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12791 cur = gen_const_xmlChar_ptr(n_cur, 1); 12792 URL = gen_filepath(n_URL, 2); 12793 encoding = gen_const_char_ptr(n_encoding, 3); 12794 options = gen_parseroptions(n_options, 4); 12795 12796 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options); 12797 desret_xmlDocPtr(ret_val); 12798 call_tests++; 12799 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12800 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 12801 des_filepath(n_URL, URL, 2); 12802 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 12803 des_parseroptions(n_options, options, 4); 12804 xmlResetLastError(); 12805 if (mem_base != xmlMemBlocks()) { 12806 printf("Leak of %d blocks found in xmlCtxtReadDoc", 12807 xmlMemBlocks() - mem_base); 12808 test_ret++; 12809 printf(" %d", n_ctxt); 12810 printf(" %d", n_cur); 12811 printf(" %d", n_URL); 12812 printf(" %d", n_encoding); 12813 printf(" %d", n_options); 12814 printf("\n"); 12815 } 12816 } 12817 } 12818 } 12819 } 12820 } 12821 function_tests++; 12822 12823 return(test_ret); 12824 } 12825 12826 12827 static int 12828 test_xmlCtxtReadFile(void) { 12829 int test_ret = 0; 12830 12831 int mem_base; 12832 xmlDocPtr ret_val; 12833 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12834 int n_ctxt; 12835 const char * filename; /* a file or URL */ 12836 int n_filename; 12837 char * encoding; /* the document encoding, or NULL */ 12838 int n_encoding; 12839 int options; /* a combination of xmlParserOption */ 12840 int n_options; 12841 12842 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12843 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 12844 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12845 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 12846 mem_base = xmlMemBlocks(); 12847 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12848 filename = gen_filepath(n_filename, 1); 12849 encoding = gen_const_char_ptr(n_encoding, 2); 12850 options = gen_parseroptions(n_options, 3); 12851 12852 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options); 12853 desret_xmlDocPtr(ret_val); 12854 call_tests++; 12855 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12856 des_filepath(n_filename, filename, 1); 12857 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 12858 des_parseroptions(n_options, options, 3); 12859 xmlResetLastError(); 12860 if (mem_base != xmlMemBlocks()) { 12861 printf("Leak of %d blocks found in xmlCtxtReadFile", 12862 xmlMemBlocks() - mem_base); 12863 test_ret++; 12864 printf(" %d", n_ctxt); 12865 printf(" %d", n_filename); 12866 printf(" %d", n_encoding); 12867 printf(" %d", n_options); 12868 printf("\n"); 12869 } 12870 } 12871 } 12872 } 12873 } 12874 function_tests++; 12875 12876 return(test_ret); 12877 } 12878 12879 12880 static int 12881 test_xmlCtxtReadMemory(void) { 12882 int test_ret = 0; 12883 12884 int mem_base; 12885 xmlDocPtr ret_val; 12886 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12887 int n_ctxt; 12888 char * buffer; /* a pointer to a char array */ 12889 int n_buffer; 12890 int size; /* the size of the array */ 12891 int n_size; 12892 const char * URL; /* the base URL to use for the document */ 12893 int n_URL; 12894 char * encoding; /* the document encoding, or NULL */ 12895 int n_encoding; 12896 int options; /* a combination of xmlParserOption */ 12897 int n_options; 12898 12899 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12900 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 12901 for (n_size = 0;n_size < gen_nb_int;n_size++) { 12902 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 12903 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12904 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 12905 mem_base = xmlMemBlocks(); 12906 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12907 buffer = gen_const_char_ptr(n_buffer, 1); 12908 size = gen_int(n_size, 2); 12909 URL = gen_filepath(n_URL, 3); 12910 encoding = gen_const_char_ptr(n_encoding, 4); 12911 options = gen_parseroptions(n_options, 5); 12912 12913 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options); 12914 desret_xmlDocPtr(ret_val); 12915 call_tests++; 12916 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12917 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 12918 des_int(n_size, size, 2); 12919 des_filepath(n_URL, URL, 3); 12920 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 12921 des_parseroptions(n_options, options, 5); 12922 xmlResetLastError(); 12923 if (mem_base != xmlMemBlocks()) { 12924 printf("Leak of %d blocks found in xmlCtxtReadMemory", 12925 xmlMemBlocks() - mem_base); 12926 test_ret++; 12927 printf(" %d", n_ctxt); 12928 printf(" %d", n_buffer); 12929 printf(" %d", n_size); 12930 printf(" %d", n_URL); 12931 printf(" %d", n_encoding); 12932 printf(" %d", n_options); 12933 printf("\n"); 12934 } 12935 } 12936 } 12937 } 12938 } 12939 } 12940 } 12941 function_tests++; 12942 12943 return(test_ret); 12944 } 12945 12946 12947 static int 12948 test_xmlCtxtReset(void) { 12949 int test_ret = 0; 12950 12951 int mem_base; 12952 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12953 int n_ctxt; 12954 12955 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12956 mem_base = xmlMemBlocks(); 12957 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 12958 12959 xmlCtxtReset(ctxt); 12960 call_tests++; 12961 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 12962 xmlResetLastError(); 12963 if (mem_base != xmlMemBlocks()) { 12964 printf("Leak of %d blocks found in xmlCtxtReset", 12965 xmlMemBlocks() - mem_base); 12966 test_ret++; 12967 printf(" %d", n_ctxt); 12968 printf("\n"); 12969 } 12970 } 12971 function_tests++; 12972 12973 return(test_ret); 12974 } 12975 12976 12977 static int 12978 test_xmlCtxtResetPush(void) { 12979 int test_ret = 0; 12980 12981 int mem_base; 12982 int ret_val; 12983 xmlParserCtxtPtr ctxt; /* an XML parser context */ 12984 int n_ctxt; 12985 char * chunk; /* a pointer to an array of chars */ 12986 int n_chunk; 12987 int size; /* number of chars in the array */ 12988 int n_size; 12989 const char * filename; /* an optional file name or URI */ 12990 int n_filename; 12991 char * encoding; /* the document encoding, or NULL */ 12992 int n_encoding; 12993 12994 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 12995 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 12996 for (n_size = 0;n_size < gen_nb_int;n_size++) { 12997 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 12998 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 12999 mem_base = xmlMemBlocks(); 13000 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13001 chunk = gen_const_char_ptr(n_chunk, 1); 13002 size = gen_int(n_size, 2); 13003 filename = gen_filepath(n_filename, 3); 13004 encoding = gen_const_char_ptr(n_encoding, 4); 13005 13006 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding); 13007 desret_int(ret_val); 13008 call_tests++; 13009 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13010 des_const_char_ptr(n_chunk, (const char *)chunk, 1); 13011 des_int(n_size, size, 2); 13012 des_filepath(n_filename, filename, 3); 13013 des_const_char_ptr(n_encoding, (const char *)encoding, 4); 13014 xmlResetLastError(); 13015 if (mem_base != xmlMemBlocks()) { 13016 printf("Leak of %d blocks found in xmlCtxtResetPush", 13017 xmlMemBlocks() - mem_base); 13018 test_ret++; 13019 printf(" %d", n_ctxt); 13020 printf(" %d", n_chunk); 13021 printf(" %d", n_size); 13022 printf(" %d", n_filename); 13023 printf(" %d", n_encoding); 13024 printf("\n"); 13025 } 13026 } 13027 } 13028 } 13029 } 13030 } 13031 function_tests++; 13032 13033 return(test_ret); 13034 } 13035 13036 13037 static int 13038 test_xmlCtxtUseOptions(void) { 13039 int test_ret = 0; 13040 13041 int mem_base; 13042 int ret_val; 13043 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13044 int n_ctxt; 13045 int options; /* a combination of xmlParserOption */ 13046 int n_options; 13047 13048 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13049 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 13050 mem_base = xmlMemBlocks(); 13051 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13052 options = gen_parseroptions(n_options, 1); 13053 13054 ret_val = xmlCtxtUseOptions(ctxt, options); 13055 desret_int(ret_val); 13056 call_tests++; 13057 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13058 des_parseroptions(n_options, options, 1); 13059 xmlResetLastError(); 13060 if (mem_base != xmlMemBlocks()) { 13061 printf("Leak of %d blocks found in xmlCtxtUseOptions", 13062 xmlMemBlocks() - mem_base); 13063 test_ret++; 13064 printf(" %d", n_ctxt); 13065 printf(" %d", n_options); 13066 printf("\n"); 13067 } 13068 } 13069 } 13070 function_tests++; 13071 13072 return(test_ret); 13073 } 13074 13075 13076 static int 13077 test_xmlGetExternalEntityLoader(void) { 13078 int test_ret = 0; 13079 13080 13081 /* missing type support */ 13082 return(test_ret); 13083 } 13084 13085 13086 static int 13087 test_xmlGetFeature(void) { 13088 int test_ret = 0; 13089 13090 #if defined(LIBXML_LEGACY_ENABLED) 13091 #ifdef LIBXML_LEGACY_ENABLED 13092 int mem_base; 13093 int ret_val; 13094 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ 13095 int n_ctxt; 13096 char * name; /* the feature name */ 13097 int n_name; 13098 void * result; /* location to store the result */ 13099 int n_result; 13100 13101 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13102 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 13103 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) { 13104 mem_base = xmlMemBlocks(); 13105 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13106 name = gen_const_char_ptr(n_name, 1); 13107 result = gen_void_ptr(n_result, 2); 13108 13109 ret_val = xmlGetFeature(ctxt, (const char *)name, result); 13110 desret_int(ret_val); 13111 call_tests++; 13112 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13113 des_const_char_ptr(n_name, (const char *)name, 1); 13114 des_void_ptr(n_result, result, 2); 13115 xmlResetLastError(); 13116 if (mem_base != xmlMemBlocks()) { 13117 printf("Leak of %d blocks found in xmlGetFeature", 13118 xmlMemBlocks() - mem_base); 13119 test_ret++; 13120 printf(" %d", n_ctxt); 13121 printf(" %d", n_name); 13122 printf(" %d", n_result); 13123 printf("\n"); 13124 } 13125 } 13126 } 13127 } 13128 function_tests++; 13129 #endif 13130 #endif 13131 13132 return(test_ret); 13133 } 13134 13135 13136 #define gen_nb_const_char_ptr_ptr 1 13137 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13138 return(NULL); 13139 } 13140 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13141 } 13142 13143 static int 13144 test_xmlGetFeaturesList(void) { 13145 int test_ret = 0; 13146 13147 #if defined(LIBXML_LEGACY_ENABLED) 13148 #ifdef LIBXML_LEGACY_ENABLED 13149 int mem_base; 13150 int ret_val; 13151 int * len; /* the length of the features name array (input/output) */ 13152 int n_len; 13153 char ** result; /* an array of string to be filled with the features name. */ 13154 int n_result; 13155 13156 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 13157 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) { 13158 mem_base = xmlMemBlocks(); 13159 len = gen_int_ptr(n_len, 0); 13160 result = gen_const_char_ptr_ptr(n_result, 1); 13161 13162 ret_val = xmlGetFeaturesList(len, (const char **)result); 13163 desret_int(ret_val); 13164 call_tests++; 13165 des_int_ptr(n_len, len, 0); 13166 des_const_char_ptr_ptr(n_result, (const char **)result, 1); 13167 xmlResetLastError(); 13168 if (mem_base != xmlMemBlocks()) { 13169 printf("Leak of %d blocks found in xmlGetFeaturesList", 13170 xmlMemBlocks() - mem_base); 13171 test_ret++; 13172 printf(" %d", n_len); 13173 printf(" %d", n_result); 13174 printf("\n"); 13175 } 13176 } 13177 } 13178 function_tests++; 13179 #endif 13180 #endif 13181 13182 return(test_ret); 13183 } 13184 13185 13186 static int 13187 test_xmlHasFeature(void) { 13188 int test_ret = 0; 13189 13190 int mem_base; 13191 int ret_val; 13192 xmlFeature feature; /* the feature to be examined */ 13193 int n_feature; 13194 13195 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) { 13196 mem_base = xmlMemBlocks(); 13197 feature = gen_xmlFeature(n_feature, 0); 13198 13199 ret_val = xmlHasFeature(feature); 13200 desret_int(ret_val); 13201 call_tests++; 13202 des_xmlFeature(n_feature, feature, 0); 13203 xmlResetLastError(); 13204 if (mem_base != xmlMemBlocks()) { 13205 printf("Leak of %d blocks found in xmlHasFeature", 13206 xmlMemBlocks() - mem_base); 13207 test_ret++; 13208 printf(" %d", n_feature); 13209 printf("\n"); 13210 } 13211 } 13212 function_tests++; 13213 13214 return(test_ret); 13215 } 13216 13217 13218 static int 13219 test_xmlIOParseDTD(void) { 13220 int test_ret = 0; 13221 13222 #if defined(LIBXML_VALID_ENABLED) 13223 #ifdef LIBXML_VALID_ENABLED 13224 xmlDtdPtr ret_val; 13225 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */ 13226 int n_sax; 13227 xmlParserInputBufferPtr input; /* an Input Buffer */ 13228 int n_input; 13229 xmlCharEncoding enc; /* the charset encoding if known */ 13230 int n_enc; 13231 13232 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 13233 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 13234 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 13235 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 13236 input = gen_xmlParserInputBufferPtr(n_input, 1); 13237 enc = gen_xmlCharEncoding(n_enc, 2); 13238 13239 ret_val = xmlIOParseDTD(sax, input, enc); 13240 input = NULL; 13241 desret_xmlDtdPtr(ret_val); 13242 call_tests++; 13243 des_xmlSAXHandlerPtr(n_sax, sax, 0); 13244 des_xmlParserInputBufferPtr(n_input, input, 1); 13245 des_xmlCharEncoding(n_enc, enc, 2); 13246 xmlResetLastError(); 13247 } 13248 } 13249 } 13250 function_tests++; 13251 #endif 13252 #endif 13253 13254 return(test_ret); 13255 } 13256 13257 13258 static int 13259 test_xmlInitNodeInfoSeq(void) { 13260 int test_ret = 0; 13261 13262 int mem_base; 13263 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ 13264 int n_seq; 13265 13266 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) { 13267 mem_base = xmlMemBlocks(); 13268 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0); 13269 13270 xmlInitNodeInfoSeq(seq); 13271 call_tests++; 13272 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0); 13273 xmlResetLastError(); 13274 if (mem_base != xmlMemBlocks()) { 13275 printf("Leak of %d blocks found in xmlInitNodeInfoSeq", 13276 xmlMemBlocks() - mem_base); 13277 test_ret++; 13278 printf(" %d", n_seq); 13279 printf("\n"); 13280 } 13281 } 13282 function_tests++; 13283 13284 return(test_ret); 13285 } 13286 13287 13288 static int 13289 test_xmlInitParser(void) { 13290 int test_ret = 0; 13291 13292 int mem_base; 13293 13294 mem_base = xmlMemBlocks(); 13295 13296 xmlInitParser(); 13297 call_tests++; 13298 xmlResetLastError(); 13299 if (mem_base != xmlMemBlocks()) { 13300 printf("Leak of %d blocks found in xmlInitParser", 13301 xmlMemBlocks() - mem_base); 13302 test_ret++; 13303 printf("\n"); 13304 } 13305 function_tests++; 13306 13307 return(test_ret); 13308 } 13309 13310 13311 static int 13312 test_xmlInitParserCtxt(void) { 13313 int test_ret = 0; 13314 13315 int mem_base; 13316 int ret_val; 13317 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13318 int n_ctxt; 13319 13320 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13321 mem_base = xmlMemBlocks(); 13322 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13323 13324 ret_val = xmlInitParserCtxt(ctxt); 13325 desret_int(ret_val); 13326 call_tests++; 13327 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13328 xmlResetLastError(); 13329 if (mem_base != xmlMemBlocks()) { 13330 printf("Leak of %d blocks found in xmlInitParserCtxt", 13331 xmlMemBlocks() - mem_base); 13332 test_ret++; 13333 printf(" %d", n_ctxt); 13334 printf("\n"); 13335 } 13336 } 13337 function_tests++; 13338 13339 return(test_ret); 13340 } 13341 13342 13343 static int 13344 test_xmlKeepBlanksDefault(void) { 13345 int test_ret = 0; 13346 13347 int mem_base; 13348 int ret_val; 13349 int val; /* int 0 or 1 */ 13350 int n_val; 13351 13352 for (n_val = 0;n_val < gen_nb_int;n_val++) { 13353 mem_base = xmlMemBlocks(); 13354 val = gen_int(n_val, 0); 13355 13356 ret_val = xmlKeepBlanksDefault(val); 13357 desret_int(ret_val); 13358 call_tests++; 13359 des_int(n_val, val, 0); 13360 xmlResetLastError(); 13361 if (mem_base != xmlMemBlocks()) { 13362 printf("Leak of %d blocks found in xmlKeepBlanksDefault", 13363 xmlMemBlocks() - mem_base); 13364 test_ret++; 13365 printf(" %d", n_val); 13366 printf("\n"); 13367 } 13368 } 13369 function_tests++; 13370 13371 return(test_ret); 13372 } 13373 13374 13375 static int 13376 test_xmlLineNumbersDefault(void) { 13377 int test_ret = 0; 13378 13379 int mem_base; 13380 int ret_val; 13381 int val; /* int 0 or 1 */ 13382 int n_val; 13383 13384 for (n_val = 0;n_val < gen_nb_int;n_val++) { 13385 mem_base = xmlMemBlocks(); 13386 val = gen_int(n_val, 0); 13387 13388 ret_val = xmlLineNumbersDefault(val); 13389 desret_int(ret_val); 13390 call_tests++; 13391 des_int(n_val, val, 0); 13392 xmlResetLastError(); 13393 if (mem_base != xmlMemBlocks()) { 13394 printf("Leak of %d blocks found in xmlLineNumbersDefault", 13395 xmlMemBlocks() - mem_base); 13396 test_ret++; 13397 printf(" %d", n_val); 13398 printf("\n"); 13399 } 13400 } 13401 function_tests++; 13402 13403 return(test_ret); 13404 } 13405 13406 13407 static int 13408 test_xmlLoadExternalEntity(void) { 13409 int test_ret = 0; 13410 13411 int mem_base; 13412 xmlParserInputPtr ret_val; 13413 const char * URL; /* the URL for the entity to load */ 13414 int n_URL; 13415 char * ID; /* the Public ID for the entity to load */ 13416 int n_ID; 13417 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */ 13418 int n_ctxt; 13419 13420 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 13421 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) { 13422 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13423 mem_base = xmlMemBlocks(); 13424 URL = gen_filepath(n_URL, 0); 13425 ID = gen_const_char_ptr(n_ID, 1); 13426 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2); 13427 13428 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt); 13429 desret_xmlParserInputPtr(ret_val); 13430 call_tests++; 13431 des_filepath(n_URL, URL, 0); 13432 des_const_char_ptr(n_ID, (const char *)ID, 1); 13433 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2); 13434 xmlResetLastError(); 13435 if (mem_base != xmlMemBlocks()) { 13436 printf("Leak of %d blocks found in xmlLoadExternalEntity", 13437 xmlMemBlocks() - mem_base); 13438 test_ret++; 13439 printf(" %d", n_URL); 13440 printf(" %d", n_ID); 13441 printf(" %d", n_ctxt); 13442 printf("\n"); 13443 } 13444 } 13445 } 13446 } 13447 function_tests++; 13448 13449 return(test_ret); 13450 } 13451 13452 13453 static int 13454 test_xmlNewIOInputStream(void) { 13455 int test_ret = 0; 13456 13457 int mem_base; 13458 xmlParserInputPtr ret_val; 13459 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13460 int n_ctxt; 13461 xmlParserInputBufferPtr input; /* an I/O Input */ 13462 int n_input; 13463 xmlCharEncoding enc; /* the charset encoding if known */ 13464 int n_enc; 13465 13466 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13467 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 13468 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 13469 mem_base = xmlMemBlocks(); 13470 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13471 input = gen_xmlParserInputBufferPtr(n_input, 1); 13472 enc = gen_xmlCharEncoding(n_enc, 2); 13473 13474 ret_val = xmlNewIOInputStream(ctxt, input, enc); 13475 if (ret_val != NULL) input = NULL; 13476 desret_xmlParserInputPtr(ret_val); 13477 call_tests++; 13478 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13479 des_xmlParserInputBufferPtr(n_input, input, 1); 13480 des_xmlCharEncoding(n_enc, enc, 2); 13481 xmlResetLastError(); 13482 if (mem_base != xmlMemBlocks()) { 13483 printf("Leak of %d blocks found in xmlNewIOInputStream", 13484 xmlMemBlocks() - mem_base); 13485 test_ret++; 13486 printf(" %d", n_ctxt); 13487 printf(" %d", n_input); 13488 printf(" %d", n_enc); 13489 printf("\n"); 13490 } 13491 } 13492 } 13493 } 13494 function_tests++; 13495 13496 return(test_ret); 13497 } 13498 13499 13500 static int 13501 test_xmlNewParserCtxt(void) { 13502 int test_ret = 0; 13503 13504 int mem_base; 13505 xmlParserCtxtPtr ret_val; 13506 13507 mem_base = xmlMemBlocks(); 13508 13509 ret_val = xmlNewParserCtxt(); 13510 desret_xmlParserCtxtPtr(ret_val); 13511 call_tests++; 13512 xmlResetLastError(); 13513 if (mem_base != xmlMemBlocks()) { 13514 printf("Leak of %d blocks found in xmlNewParserCtxt", 13515 xmlMemBlocks() - mem_base); 13516 test_ret++; 13517 printf("\n"); 13518 } 13519 function_tests++; 13520 13521 return(test_ret); 13522 } 13523 13524 13525 #define gen_nb_xmlNodePtr_ptr 1 13526 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13527 return(NULL); 13528 } 13529 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 13530 } 13531 13532 static int 13533 test_xmlParseBalancedChunkMemory(void) { 13534 int test_ret = 0; 13535 13536 #if defined(LIBXML_SAX1_ENABLED) 13537 #ifdef LIBXML_SAX1_ENABLED 13538 int mem_base; 13539 int ret_val; 13540 xmlDocPtr doc; /* the document the chunk pertains to */ 13541 int n_doc; 13542 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ 13543 int n_sax; 13544 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ 13545 int n_user_data; 13546 int depth; /* Used for loop detection, use 0 */ 13547 int n_depth; 13548 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */ 13549 int n_string; 13550 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13551 int n_lst; 13552 13553 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 13554 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 13555 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 13556 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 13557 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 13558 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 13559 mem_base = xmlMemBlocks(); 13560 doc = gen_xmlDocPtr(n_doc, 0); 13561 sax = gen_xmlSAXHandlerPtr(n_sax, 1); 13562 user_data = gen_userdata(n_user_data, 2); 13563 depth = gen_int(n_depth, 3); 13564 string = gen_const_xmlChar_ptr(n_string, 4); 13565 lst = gen_xmlNodePtr_ptr(n_lst, 5); 13566 13567 #ifdef LIBXML_SAX1_ENABLED 13568 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 13569 #endif 13570 13571 13572 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst); 13573 desret_int(ret_val); 13574 call_tests++; 13575 des_xmlDocPtr(n_doc, doc, 0); 13576 des_xmlSAXHandlerPtr(n_sax, sax, 1); 13577 des_userdata(n_user_data, user_data, 2); 13578 des_int(n_depth, depth, 3); 13579 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4); 13580 des_xmlNodePtr_ptr(n_lst, lst, 5); 13581 xmlResetLastError(); 13582 if (mem_base != xmlMemBlocks()) { 13583 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory", 13584 xmlMemBlocks() - mem_base); 13585 test_ret++; 13586 printf(" %d", n_doc); 13587 printf(" %d", n_sax); 13588 printf(" %d", n_user_data); 13589 printf(" %d", n_depth); 13590 printf(" %d", n_string); 13591 printf(" %d", n_lst); 13592 printf("\n"); 13593 } 13594 } 13595 } 13596 } 13597 } 13598 } 13599 } 13600 function_tests++; 13601 #endif 13602 #endif 13603 13604 return(test_ret); 13605 } 13606 13607 13608 static int 13609 test_xmlParseBalancedChunkMemoryRecover(void) { 13610 int test_ret = 0; 13611 13612 #if defined(LIBXML_SAX1_ENABLED) 13613 #ifdef LIBXML_SAX1_ENABLED 13614 int mem_base; 13615 int ret_val; 13616 xmlDocPtr doc; /* the document the chunk pertains to */ 13617 int n_doc; 13618 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ 13619 int n_sax; 13620 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ 13621 int n_user_data; 13622 int depth; /* Used for loop detection, use 0 */ 13623 int n_depth; 13624 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */ 13625 int n_string; 13626 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13627 int n_lst; 13628 int recover; /* return nodes even if the data is broken (use 0) */ 13629 int n_recover; 13630 13631 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 13632 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 13633 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 13634 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 13635 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 13636 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 13637 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) { 13638 mem_base = xmlMemBlocks(); 13639 doc = gen_xmlDocPtr(n_doc, 0); 13640 sax = gen_xmlSAXHandlerPtr(n_sax, 1); 13641 user_data = gen_userdata(n_user_data, 2); 13642 depth = gen_int(n_depth, 3); 13643 string = gen_const_xmlChar_ptr(n_string, 4); 13644 lst = gen_xmlNodePtr_ptr(n_lst, 5); 13645 recover = gen_int(n_recover, 6); 13646 13647 #ifdef LIBXML_SAX1_ENABLED 13648 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 13649 #endif 13650 13651 13652 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover); 13653 desret_int(ret_val); 13654 call_tests++; 13655 des_xmlDocPtr(n_doc, doc, 0); 13656 des_xmlSAXHandlerPtr(n_sax, sax, 1); 13657 des_userdata(n_user_data, user_data, 2); 13658 des_int(n_depth, depth, 3); 13659 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4); 13660 des_xmlNodePtr_ptr(n_lst, lst, 5); 13661 des_int(n_recover, recover, 6); 13662 xmlResetLastError(); 13663 if (mem_base != xmlMemBlocks()) { 13664 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover", 13665 xmlMemBlocks() - mem_base); 13666 test_ret++; 13667 printf(" %d", n_doc); 13668 printf(" %d", n_sax); 13669 printf(" %d", n_user_data); 13670 printf(" %d", n_depth); 13671 printf(" %d", n_string); 13672 printf(" %d", n_lst); 13673 printf(" %d", n_recover); 13674 printf("\n"); 13675 } 13676 } 13677 } 13678 } 13679 } 13680 } 13681 } 13682 } 13683 function_tests++; 13684 #endif 13685 #endif 13686 13687 return(test_ret); 13688 } 13689 13690 13691 static int 13692 test_xmlParseChunk(void) { 13693 int test_ret = 0; 13694 13695 #if defined(LIBXML_PUSH_ENABLED) 13696 int mem_base; 13697 int ret_val; 13698 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13699 int n_ctxt; 13700 char * chunk; /* an char array */ 13701 int n_chunk; 13702 int size; /* the size in byte of the chunk */ 13703 int n_size; 13704 int terminate; /* last chunk indicator */ 13705 int n_terminate; 13706 13707 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13708 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { 13709 for (n_size = 0;n_size < gen_nb_int;n_size++) { 13710 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { 13711 mem_base = xmlMemBlocks(); 13712 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13713 chunk = gen_const_char_ptr(n_chunk, 1); 13714 size = gen_int(n_size, 2); 13715 terminate = gen_int(n_terminate, 3); 13716 13717 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate); 13718 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 13719 desret_int(ret_val); 13720 call_tests++; 13721 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13722 des_const_char_ptr(n_chunk, (const char *)chunk, 1); 13723 des_int(n_size, size, 2); 13724 des_int(n_terminate, terminate, 3); 13725 xmlResetLastError(); 13726 if (mem_base != xmlMemBlocks()) { 13727 printf("Leak of %d blocks found in xmlParseChunk", 13728 xmlMemBlocks() - mem_base); 13729 test_ret++; 13730 printf(" %d", n_ctxt); 13731 printf(" %d", n_chunk); 13732 printf(" %d", n_size); 13733 printf(" %d", n_terminate); 13734 printf("\n"); 13735 } 13736 } 13737 } 13738 } 13739 } 13740 function_tests++; 13741 #endif 13742 13743 return(test_ret); 13744 } 13745 13746 13747 static int 13748 test_xmlParseCtxtExternalEntity(void) { 13749 int test_ret = 0; 13750 13751 int mem_base; 13752 int ret_val; 13753 xmlParserCtxtPtr ctx; /* the existing parsing context */ 13754 int n_ctx; 13755 xmlChar * URL; /* the URL for the entity to load */ 13756 int n_URL; 13757 xmlChar * ID; /* the System ID for the entity to load */ 13758 int n_ID; 13759 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 13760 int n_lst; 13761 13762 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) { 13763 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { 13764 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 13765 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 13766 mem_base = xmlMemBlocks(); 13767 ctx = gen_xmlParserCtxtPtr(n_ctx, 0); 13768 URL = gen_const_xmlChar_ptr(n_URL, 1); 13769 ID = gen_const_xmlChar_ptr(n_ID, 2); 13770 lst = gen_xmlNodePtr_ptr(n_lst, 3); 13771 13772 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst); 13773 desret_int(ret_val); 13774 call_tests++; 13775 des_xmlParserCtxtPtr(n_ctx, ctx, 0); 13776 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1); 13777 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2); 13778 des_xmlNodePtr_ptr(n_lst, lst, 3); 13779 xmlResetLastError(); 13780 if (mem_base != xmlMemBlocks()) { 13781 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity", 13782 xmlMemBlocks() - mem_base); 13783 test_ret++; 13784 printf(" %d", n_ctx); 13785 printf(" %d", n_URL); 13786 printf(" %d", n_ID); 13787 printf(" %d", n_lst); 13788 printf("\n"); 13789 } 13790 } 13791 } 13792 } 13793 } 13794 function_tests++; 13795 13796 return(test_ret); 13797 } 13798 13799 13800 static int 13801 test_xmlParseDTD(void) { 13802 int test_ret = 0; 13803 13804 #if defined(LIBXML_VALID_ENABLED) 13805 #ifdef LIBXML_VALID_ENABLED 13806 int mem_base; 13807 xmlDtdPtr ret_val; 13808 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */ 13809 int n_ExternalID; 13810 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */ 13811 int n_SystemID; 13812 13813 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 13814 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 13815 mem_base = xmlMemBlocks(); 13816 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0); 13817 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1); 13818 13819 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID); 13820 desret_xmlDtdPtr(ret_val); 13821 call_tests++; 13822 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0); 13823 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1); 13824 xmlResetLastError(); 13825 if (mem_base != xmlMemBlocks()) { 13826 printf("Leak of %d blocks found in xmlParseDTD", 13827 xmlMemBlocks() - mem_base); 13828 test_ret++; 13829 printf(" %d", n_ExternalID); 13830 printf(" %d", n_SystemID); 13831 printf("\n"); 13832 } 13833 } 13834 } 13835 function_tests++; 13836 #endif 13837 #endif 13838 13839 return(test_ret); 13840 } 13841 13842 13843 static int 13844 test_xmlParseDoc(void) { 13845 int test_ret = 0; 13846 13847 #if defined(LIBXML_SAX1_ENABLED) 13848 #ifdef LIBXML_SAX1_ENABLED 13849 int mem_base; 13850 xmlDocPtr ret_val; 13851 xmlChar * cur; /* a pointer to an array of xmlChar */ 13852 int n_cur; 13853 13854 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 13855 mem_base = xmlMemBlocks(); 13856 cur = gen_const_xmlChar_ptr(n_cur, 0); 13857 13858 ret_val = xmlParseDoc((const xmlChar *)cur); 13859 desret_xmlDocPtr(ret_val); 13860 call_tests++; 13861 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 13862 xmlResetLastError(); 13863 if (mem_base != xmlMemBlocks()) { 13864 printf("Leak of %d blocks found in xmlParseDoc", 13865 xmlMemBlocks() - mem_base); 13866 test_ret++; 13867 printf(" %d", n_cur); 13868 printf("\n"); 13869 } 13870 } 13871 function_tests++; 13872 #endif 13873 #endif 13874 13875 return(test_ret); 13876 } 13877 13878 13879 static int 13880 test_xmlParseDocument(void) { 13881 int test_ret = 0; 13882 13883 int mem_base; 13884 int ret_val; 13885 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13886 int n_ctxt; 13887 13888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13889 mem_base = xmlMemBlocks(); 13890 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13891 13892 ret_val = xmlParseDocument(ctxt); 13893 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 13894 desret_int(ret_val); 13895 call_tests++; 13896 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13897 xmlResetLastError(); 13898 if (mem_base != xmlMemBlocks()) { 13899 printf("Leak of %d blocks found in xmlParseDocument", 13900 xmlMemBlocks() - mem_base); 13901 test_ret++; 13902 printf(" %d", n_ctxt); 13903 printf("\n"); 13904 } 13905 } 13906 function_tests++; 13907 13908 return(test_ret); 13909 } 13910 13911 13912 static int 13913 test_xmlParseEntity(void) { 13914 int test_ret = 0; 13915 13916 #if defined(LIBXML_SAX1_ENABLED) 13917 #ifdef LIBXML_SAX1_ENABLED 13918 int mem_base; 13919 xmlDocPtr ret_val; 13920 const char * filename; /* the filename */ 13921 int n_filename; 13922 13923 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 13924 mem_base = xmlMemBlocks(); 13925 filename = gen_filepath(n_filename, 0); 13926 13927 ret_val = xmlParseEntity(filename); 13928 desret_xmlDocPtr(ret_val); 13929 call_tests++; 13930 des_filepath(n_filename, filename, 0); 13931 xmlResetLastError(); 13932 if (mem_base != xmlMemBlocks()) { 13933 printf("Leak of %d blocks found in xmlParseEntity", 13934 xmlMemBlocks() - mem_base); 13935 test_ret++; 13936 printf(" %d", n_filename); 13937 printf("\n"); 13938 } 13939 } 13940 function_tests++; 13941 #endif 13942 #endif 13943 13944 return(test_ret); 13945 } 13946 13947 13948 static int 13949 test_xmlParseExtParsedEnt(void) { 13950 int test_ret = 0; 13951 13952 int mem_base; 13953 int ret_val; 13954 xmlParserCtxtPtr ctxt; /* an XML parser context */ 13955 int n_ctxt; 13956 13957 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 13958 mem_base = xmlMemBlocks(); 13959 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 13960 13961 ret_val = xmlParseExtParsedEnt(ctxt); 13962 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} 13963 desret_int(ret_val); 13964 call_tests++; 13965 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 13966 xmlResetLastError(); 13967 if (mem_base != xmlMemBlocks()) { 13968 printf("Leak of %d blocks found in xmlParseExtParsedEnt", 13969 xmlMemBlocks() - mem_base); 13970 test_ret++; 13971 printf(" %d", n_ctxt); 13972 printf("\n"); 13973 } 13974 } 13975 function_tests++; 13976 13977 return(test_ret); 13978 } 13979 13980 13981 static int 13982 test_xmlParseExternalEntity(void) { 13983 int test_ret = 0; 13984 13985 #if defined(LIBXML_SAX1_ENABLED) 13986 #ifdef LIBXML_SAX1_ENABLED 13987 int mem_base; 13988 int ret_val; 13989 xmlDocPtr doc; /* the document the chunk pertains to */ 13990 int n_doc; 13991 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ 13992 int n_sax; 13993 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ 13994 int n_user_data; 13995 int depth; /* Used for loop detection, use 0 */ 13996 int n_depth; 13997 xmlChar * URL; /* the URL for the entity to load */ 13998 int n_URL; 13999 xmlChar * ID; /* the System ID for the entity to load */ 14000 int n_ID; 14001 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 14002 int n_lst; 14003 14004 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 14005 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14006 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 14007 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { 14008 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { 14009 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 14010 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 14011 mem_base = xmlMemBlocks(); 14012 doc = gen_xmlDocPtr(n_doc, 0); 14013 sax = gen_xmlSAXHandlerPtr(n_sax, 1); 14014 user_data = gen_userdata(n_user_data, 2); 14015 depth = gen_int(n_depth, 3); 14016 URL = gen_const_xmlChar_ptr(n_URL, 4); 14017 ID = gen_const_xmlChar_ptr(n_ID, 5); 14018 lst = gen_xmlNodePtr_ptr(n_lst, 6); 14019 14020 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst); 14021 desret_int(ret_val); 14022 call_tests++; 14023 des_xmlDocPtr(n_doc, doc, 0); 14024 des_xmlSAXHandlerPtr(n_sax, sax, 1); 14025 des_userdata(n_user_data, user_data, 2); 14026 des_int(n_depth, depth, 3); 14027 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4); 14028 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5); 14029 des_xmlNodePtr_ptr(n_lst, lst, 6); 14030 xmlResetLastError(); 14031 if (mem_base != xmlMemBlocks()) { 14032 printf("Leak of %d blocks found in xmlParseExternalEntity", 14033 xmlMemBlocks() - mem_base); 14034 test_ret++; 14035 printf(" %d", n_doc); 14036 printf(" %d", n_sax); 14037 printf(" %d", n_user_data); 14038 printf(" %d", n_depth); 14039 printf(" %d", n_URL); 14040 printf(" %d", n_ID); 14041 printf(" %d", n_lst); 14042 printf("\n"); 14043 } 14044 } 14045 } 14046 } 14047 } 14048 } 14049 } 14050 } 14051 function_tests++; 14052 #endif 14053 #endif 14054 14055 return(test_ret); 14056 } 14057 14058 14059 static int 14060 test_xmlParseFile(void) { 14061 int test_ret = 0; 14062 14063 #if defined(LIBXML_SAX1_ENABLED) 14064 #ifdef LIBXML_SAX1_ENABLED 14065 int mem_base; 14066 xmlDocPtr ret_val; 14067 const char * filename; /* the filename */ 14068 int n_filename; 14069 14070 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14071 mem_base = xmlMemBlocks(); 14072 filename = gen_filepath(n_filename, 0); 14073 14074 ret_val = xmlParseFile(filename); 14075 desret_xmlDocPtr(ret_val); 14076 call_tests++; 14077 des_filepath(n_filename, filename, 0); 14078 xmlResetLastError(); 14079 if (mem_base != xmlMemBlocks()) { 14080 printf("Leak of %d blocks found in xmlParseFile", 14081 xmlMemBlocks() - mem_base); 14082 test_ret++; 14083 printf(" %d", n_filename); 14084 printf("\n"); 14085 } 14086 } 14087 function_tests++; 14088 #endif 14089 #endif 14090 14091 return(test_ret); 14092 } 14093 14094 14095 static int 14096 test_xmlParseInNodeContext(void) { 14097 int test_ret = 0; 14098 14099 int mem_base; 14100 xmlParserErrors ret_val; 14101 xmlNodePtr node; /* the context node */ 14102 int n_node; 14103 char * data; /* the input string */ 14104 int n_data; 14105 int datalen; /* the input string length in bytes */ 14106 int n_datalen; 14107 int options; /* a combination of xmlParserOption */ 14108 int n_options; 14109 xmlNodePtr * lst; /* the return value for the set of parsed nodes */ 14110 int n_lst; 14111 14112 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 14113 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { 14114 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) { 14115 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14116 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { 14117 mem_base = xmlMemBlocks(); 14118 node = gen_xmlNodePtr(n_node, 0); 14119 data = gen_const_char_ptr(n_data, 1); 14120 datalen = gen_int(n_datalen, 2); 14121 options = gen_parseroptions(n_options, 3); 14122 lst = gen_xmlNodePtr_ptr(n_lst, 4); 14123 14124 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst); 14125 desret_xmlParserErrors(ret_val); 14126 call_tests++; 14127 des_xmlNodePtr(n_node, node, 0); 14128 des_const_char_ptr(n_data, (const char *)data, 1); 14129 des_int(n_datalen, datalen, 2); 14130 des_parseroptions(n_options, options, 3); 14131 des_xmlNodePtr_ptr(n_lst, lst, 4); 14132 xmlResetLastError(); 14133 if (mem_base != xmlMemBlocks()) { 14134 printf("Leak of %d blocks found in xmlParseInNodeContext", 14135 xmlMemBlocks() - mem_base); 14136 test_ret++; 14137 printf(" %d", n_node); 14138 printf(" %d", n_data); 14139 printf(" %d", n_datalen); 14140 printf(" %d", n_options); 14141 printf(" %d", n_lst); 14142 printf("\n"); 14143 } 14144 } 14145 } 14146 } 14147 } 14148 } 14149 function_tests++; 14150 14151 return(test_ret); 14152 } 14153 14154 14155 static int 14156 test_xmlParseMemory(void) { 14157 int test_ret = 0; 14158 14159 #if defined(LIBXML_SAX1_ENABLED) 14160 #ifdef LIBXML_SAX1_ENABLED 14161 int mem_base; 14162 xmlDocPtr ret_val; 14163 char * buffer; /* an pointer to a char array */ 14164 int n_buffer; 14165 int size; /* the size of the array */ 14166 int n_size; 14167 14168 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14169 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14170 mem_base = xmlMemBlocks(); 14171 buffer = gen_const_char_ptr(n_buffer, 0); 14172 size = gen_int(n_size, 1); 14173 14174 ret_val = xmlParseMemory((const char *)buffer, size); 14175 desret_xmlDocPtr(ret_val); 14176 call_tests++; 14177 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 14178 des_int(n_size, size, 1); 14179 xmlResetLastError(); 14180 if (mem_base != xmlMemBlocks()) { 14181 printf("Leak of %d blocks found in xmlParseMemory", 14182 xmlMemBlocks() - mem_base); 14183 test_ret++; 14184 printf(" %d", n_buffer); 14185 printf(" %d", n_size); 14186 printf("\n"); 14187 } 14188 } 14189 } 14190 function_tests++; 14191 #endif 14192 #endif 14193 14194 return(test_ret); 14195 } 14196 14197 14198 #define gen_nb_const_xmlParserNodeInfoPtr 1 14199 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14200 return(NULL); 14201 } 14202 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14203 } 14204 14205 static int 14206 test_xmlParserAddNodeInfo(void) { 14207 int test_ret = 0; 14208 14209 int mem_base; 14210 xmlParserCtxtPtr ctxt; /* an XML parser context */ 14211 int n_ctxt; 14212 xmlParserNodeInfoPtr info; /* a node info sequence pointer */ 14213 int n_info; 14214 14215 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 14216 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) { 14217 mem_base = xmlMemBlocks(); 14218 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 14219 info = gen_const_xmlParserNodeInfoPtr(n_info, 1); 14220 14221 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info); 14222 call_tests++; 14223 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 14224 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1); 14225 xmlResetLastError(); 14226 if (mem_base != xmlMemBlocks()) { 14227 printf("Leak of %d blocks found in xmlParserAddNodeInfo", 14228 xmlMemBlocks() - mem_base); 14229 test_ret++; 14230 printf(" %d", n_ctxt); 14231 printf(" %d", n_info); 14232 printf("\n"); 14233 } 14234 } 14235 } 14236 function_tests++; 14237 14238 return(test_ret); 14239 } 14240 14241 14242 #define gen_nb_const_xmlParserCtxtPtr 1 14243 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14244 return(NULL); 14245 } 14246 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14247 } 14248 14249 #define gen_nb_const_xmlNodePtr 1 14250 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14251 return(NULL); 14252 } 14253 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14254 } 14255 14256 static int 14257 test_xmlParserFindNodeInfo(void) { 14258 int test_ret = 0; 14259 14260 int mem_base; 14261 const xmlParserNodeInfo * ret_val; 14262 xmlParserCtxtPtr ctx; /* an XML parser context */ 14263 int n_ctx; 14264 xmlNodePtr node; /* an XML node within the tree */ 14265 int n_node; 14266 14267 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) { 14268 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 14269 mem_base = xmlMemBlocks(); 14270 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0); 14271 node = gen_const_xmlNodePtr(n_node, 1); 14272 14273 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node); 14274 desret_const_xmlParserNodeInfo_ptr(ret_val); 14275 call_tests++; 14276 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0); 14277 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); 14278 xmlResetLastError(); 14279 if (mem_base != xmlMemBlocks()) { 14280 printf("Leak of %d blocks found in xmlParserFindNodeInfo", 14281 xmlMemBlocks() - mem_base); 14282 test_ret++; 14283 printf(" %d", n_ctx); 14284 printf(" %d", n_node); 14285 printf("\n"); 14286 } 14287 } 14288 } 14289 function_tests++; 14290 14291 return(test_ret); 14292 } 14293 14294 14295 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1 14296 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14297 return(NULL); 14298 } 14299 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14300 } 14301 14302 static int 14303 test_xmlParserFindNodeInfoIndex(void) { 14304 int test_ret = 0; 14305 14306 int mem_base; 14307 unsigned long ret_val; 14308 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ 14309 int n_seq; 14310 xmlNodePtr node; /* an XML node pointer */ 14311 int n_node; 14312 14313 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) { 14314 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 14315 mem_base = xmlMemBlocks(); 14316 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0); 14317 node = gen_const_xmlNodePtr(n_node, 1); 14318 14319 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node); 14320 desret_unsigned_long(ret_val); 14321 call_tests++; 14322 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0); 14323 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); 14324 xmlResetLastError(); 14325 if (mem_base != xmlMemBlocks()) { 14326 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex", 14327 xmlMemBlocks() - mem_base); 14328 test_ret++; 14329 printf(" %d", n_seq); 14330 printf(" %d", n_node); 14331 printf("\n"); 14332 } 14333 } 14334 } 14335 function_tests++; 14336 14337 return(test_ret); 14338 } 14339 14340 14341 #define gen_nb_xmlParserInputPtr 1 14342 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14343 return(NULL); 14344 } 14345 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 14346 } 14347 14348 static int 14349 test_xmlParserInputGrow(void) { 14350 int test_ret = 0; 14351 14352 int mem_base; 14353 int ret_val; 14354 xmlParserInputPtr in; /* an XML parser input */ 14355 int n_in; 14356 int len; /* an indicative size for the lookahead */ 14357 int n_len; 14358 14359 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { 14360 for (n_len = 0;n_len < gen_nb_int;n_len++) { 14361 mem_base = xmlMemBlocks(); 14362 in = gen_xmlParserInputPtr(n_in, 0); 14363 len = gen_int(n_len, 1); 14364 14365 ret_val = xmlParserInputGrow(in, len); 14366 desret_int(ret_val); 14367 call_tests++; 14368 des_xmlParserInputPtr(n_in, in, 0); 14369 des_int(n_len, len, 1); 14370 xmlResetLastError(); 14371 if (mem_base != xmlMemBlocks()) { 14372 printf("Leak of %d blocks found in xmlParserInputGrow", 14373 xmlMemBlocks() - mem_base); 14374 test_ret++; 14375 printf(" %d", n_in); 14376 printf(" %d", n_len); 14377 printf("\n"); 14378 } 14379 } 14380 } 14381 function_tests++; 14382 14383 return(test_ret); 14384 } 14385 14386 14387 static int 14388 test_xmlParserInputRead(void) { 14389 int test_ret = 0; 14390 14391 int mem_base; 14392 int ret_val; 14393 xmlParserInputPtr in; /* an XML parser input */ 14394 int n_in; 14395 int len; /* an indicative size for the lookahead */ 14396 int n_len; 14397 14398 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { 14399 for (n_len = 0;n_len < gen_nb_int;n_len++) { 14400 mem_base = xmlMemBlocks(); 14401 in = gen_xmlParserInputPtr(n_in, 0); 14402 len = gen_int(n_len, 1); 14403 14404 ret_val = xmlParserInputRead(in, len); 14405 desret_int(ret_val); 14406 call_tests++; 14407 des_xmlParserInputPtr(n_in, in, 0); 14408 des_int(n_len, len, 1); 14409 xmlResetLastError(); 14410 if (mem_base != xmlMemBlocks()) { 14411 printf("Leak of %d blocks found in xmlParserInputRead", 14412 xmlMemBlocks() - mem_base); 14413 test_ret++; 14414 printf(" %d", n_in); 14415 printf(" %d", n_len); 14416 printf("\n"); 14417 } 14418 } 14419 } 14420 function_tests++; 14421 14422 return(test_ret); 14423 } 14424 14425 14426 static int 14427 test_xmlPedanticParserDefault(void) { 14428 int test_ret = 0; 14429 14430 int mem_base; 14431 int ret_val; 14432 int val; /* int 0 or 1 */ 14433 int n_val; 14434 14435 for (n_val = 0;n_val < gen_nb_int;n_val++) { 14436 mem_base = xmlMemBlocks(); 14437 val = gen_int(n_val, 0); 14438 14439 ret_val = xmlPedanticParserDefault(val); 14440 desret_int(ret_val); 14441 call_tests++; 14442 des_int(n_val, val, 0); 14443 xmlResetLastError(); 14444 if (mem_base != xmlMemBlocks()) { 14445 printf("Leak of %d blocks found in xmlPedanticParserDefault", 14446 xmlMemBlocks() - mem_base); 14447 test_ret++; 14448 printf(" %d", n_val); 14449 printf("\n"); 14450 } 14451 } 14452 function_tests++; 14453 14454 return(test_ret); 14455 } 14456 14457 14458 static int 14459 test_xmlReadDoc(void) { 14460 int test_ret = 0; 14461 14462 int mem_base; 14463 xmlDocPtr ret_val; 14464 xmlChar * cur; /* a pointer to a zero terminated string */ 14465 int n_cur; 14466 const char * URL; /* the base URL to use for the document */ 14467 int n_URL; 14468 char * encoding; /* the document encoding, or NULL */ 14469 int n_encoding; 14470 int options; /* a combination of xmlParserOption */ 14471 int n_options; 14472 14473 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 14474 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 14475 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 14476 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14477 mem_base = xmlMemBlocks(); 14478 cur = gen_const_xmlChar_ptr(n_cur, 0); 14479 URL = gen_filepath(n_URL, 1); 14480 encoding = gen_const_char_ptr(n_encoding, 2); 14481 options = gen_parseroptions(n_options, 3); 14482 14483 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options); 14484 desret_xmlDocPtr(ret_val); 14485 call_tests++; 14486 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 14487 des_filepath(n_URL, URL, 1); 14488 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 14489 des_parseroptions(n_options, options, 3); 14490 xmlResetLastError(); 14491 if (mem_base != xmlMemBlocks()) { 14492 printf("Leak of %d blocks found in xmlReadDoc", 14493 xmlMemBlocks() - mem_base); 14494 test_ret++; 14495 printf(" %d", n_cur); 14496 printf(" %d", n_URL); 14497 printf(" %d", n_encoding); 14498 printf(" %d", n_options); 14499 printf("\n"); 14500 } 14501 } 14502 } 14503 } 14504 } 14505 function_tests++; 14506 14507 return(test_ret); 14508 } 14509 14510 14511 static int 14512 test_xmlReadFile(void) { 14513 int test_ret = 0; 14514 14515 int mem_base; 14516 xmlDocPtr ret_val; 14517 const char * filename; /* a file or URL */ 14518 int n_filename; 14519 char * encoding; /* the document encoding, or NULL */ 14520 int n_encoding; 14521 int options; /* a combination of xmlParserOption */ 14522 int n_options; 14523 14524 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14525 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 14526 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14527 mem_base = xmlMemBlocks(); 14528 filename = gen_filepath(n_filename, 0); 14529 encoding = gen_const_char_ptr(n_encoding, 1); 14530 options = gen_parseroptions(n_options, 2); 14531 14532 ret_val = xmlReadFile(filename, (const char *)encoding, options); 14533 desret_xmlDocPtr(ret_val); 14534 call_tests++; 14535 des_filepath(n_filename, filename, 0); 14536 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 14537 des_parseroptions(n_options, options, 2); 14538 xmlResetLastError(); 14539 if (mem_base != xmlMemBlocks()) { 14540 printf("Leak of %d blocks found in xmlReadFile", 14541 xmlMemBlocks() - mem_base); 14542 test_ret++; 14543 printf(" %d", n_filename); 14544 printf(" %d", n_encoding); 14545 printf(" %d", n_options); 14546 printf("\n"); 14547 } 14548 } 14549 } 14550 } 14551 function_tests++; 14552 14553 return(test_ret); 14554 } 14555 14556 14557 static int 14558 test_xmlReadMemory(void) { 14559 int test_ret = 0; 14560 14561 int mem_base; 14562 xmlDocPtr ret_val; 14563 char * buffer; /* a pointer to a char array */ 14564 int n_buffer; 14565 int size; /* the size of the array */ 14566 int n_size; 14567 const char * URL; /* the base URL to use for the document */ 14568 int n_URL; 14569 char * encoding; /* the document encoding, or NULL */ 14570 int n_encoding; 14571 int options; /* a combination of xmlParserOption */ 14572 int n_options; 14573 14574 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14575 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14576 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 14577 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 14578 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 14579 mem_base = xmlMemBlocks(); 14580 buffer = gen_const_char_ptr(n_buffer, 0); 14581 size = gen_int(n_size, 1); 14582 URL = gen_filepath(n_URL, 2); 14583 encoding = gen_const_char_ptr(n_encoding, 3); 14584 options = gen_parseroptions(n_options, 4); 14585 14586 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options); 14587 desret_xmlDocPtr(ret_val); 14588 call_tests++; 14589 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 14590 des_int(n_size, size, 1); 14591 des_filepath(n_URL, URL, 2); 14592 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 14593 des_parseroptions(n_options, options, 4); 14594 xmlResetLastError(); 14595 if (mem_base != xmlMemBlocks()) { 14596 printf("Leak of %d blocks found in xmlReadMemory", 14597 xmlMemBlocks() - mem_base); 14598 test_ret++; 14599 printf(" %d", n_buffer); 14600 printf(" %d", n_size); 14601 printf(" %d", n_URL); 14602 printf(" %d", n_encoding); 14603 printf(" %d", n_options); 14604 printf("\n"); 14605 } 14606 } 14607 } 14608 } 14609 } 14610 } 14611 function_tests++; 14612 14613 return(test_ret); 14614 } 14615 14616 14617 static int 14618 test_xmlRecoverDoc(void) { 14619 int test_ret = 0; 14620 14621 #if defined(LIBXML_SAX1_ENABLED) 14622 #ifdef LIBXML_SAX1_ENABLED 14623 int mem_base; 14624 xmlDocPtr ret_val; 14625 xmlChar * cur; /* a pointer to an array of xmlChar */ 14626 int n_cur; 14627 14628 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 14629 mem_base = xmlMemBlocks(); 14630 cur = gen_const_xmlChar_ptr(n_cur, 0); 14631 14632 ret_val = xmlRecoverDoc((const xmlChar *)cur); 14633 desret_xmlDocPtr(ret_val); 14634 call_tests++; 14635 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 14636 xmlResetLastError(); 14637 if (mem_base != xmlMemBlocks()) { 14638 printf("Leak of %d blocks found in xmlRecoverDoc", 14639 xmlMemBlocks() - mem_base); 14640 test_ret++; 14641 printf(" %d", n_cur); 14642 printf("\n"); 14643 } 14644 } 14645 function_tests++; 14646 #endif 14647 #endif 14648 14649 return(test_ret); 14650 } 14651 14652 14653 static int 14654 test_xmlRecoverFile(void) { 14655 int test_ret = 0; 14656 14657 #if defined(LIBXML_SAX1_ENABLED) 14658 #ifdef LIBXML_SAX1_ENABLED 14659 int mem_base; 14660 xmlDocPtr ret_val; 14661 const char * filename; /* the filename */ 14662 int n_filename; 14663 14664 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14665 mem_base = xmlMemBlocks(); 14666 filename = gen_filepath(n_filename, 0); 14667 14668 ret_val = xmlRecoverFile(filename); 14669 desret_xmlDocPtr(ret_val); 14670 call_tests++; 14671 des_filepath(n_filename, filename, 0); 14672 xmlResetLastError(); 14673 if (mem_base != xmlMemBlocks()) { 14674 printf("Leak of %d blocks found in xmlRecoverFile", 14675 xmlMemBlocks() - mem_base); 14676 test_ret++; 14677 printf(" %d", n_filename); 14678 printf("\n"); 14679 } 14680 } 14681 function_tests++; 14682 #endif 14683 #endif 14684 14685 return(test_ret); 14686 } 14687 14688 14689 static int 14690 test_xmlRecoverMemory(void) { 14691 int test_ret = 0; 14692 14693 #if defined(LIBXML_SAX1_ENABLED) 14694 #ifdef LIBXML_SAX1_ENABLED 14695 int mem_base; 14696 xmlDocPtr ret_val; 14697 char * buffer; /* an pointer to a char array */ 14698 int n_buffer; 14699 int size; /* the size of the array */ 14700 int n_size; 14701 14702 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 14703 for (n_size = 0;n_size < gen_nb_int;n_size++) { 14704 mem_base = xmlMemBlocks(); 14705 buffer = gen_const_char_ptr(n_buffer, 0); 14706 size = gen_int(n_size, 1); 14707 14708 ret_val = xmlRecoverMemory((const char *)buffer, size); 14709 desret_xmlDocPtr(ret_val); 14710 call_tests++; 14711 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 14712 des_int(n_size, size, 1); 14713 xmlResetLastError(); 14714 if (mem_base != xmlMemBlocks()) { 14715 printf("Leak of %d blocks found in xmlRecoverMemory", 14716 xmlMemBlocks() - mem_base); 14717 test_ret++; 14718 printf(" %d", n_buffer); 14719 printf(" %d", n_size); 14720 printf("\n"); 14721 } 14722 } 14723 } 14724 function_tests++; 14725 #endif 14726 #endif 14727 14728 return(test_ret); 14729 } 14730 14731 14732 static int 14733 test_xmlSAXParseDTD(void) { 14734 int test_ret = 0; 14735 14736 #if defined(LIBXML_VALID_ENABLED) 14737 #ifdef LIBXML_SAX1_ENABLED 14738 int mem_base; 14739 xmlDtdPtr ret_val; 14740 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14741 int n_sax; 14742 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */ 14743 int n_ExternalID; 14744 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */ 14745 int n_SystemID; 14746 14747 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14748 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 14749 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 14750 mem_base = xmlMemBlocks(); 14751 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14752 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); 14753 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2); 14754 14755 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 14756 desret_xmlDtdPtr(ret_val); 14757 call_tests++; 14758 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14759 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); 14760 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2); 14761 xmlResetLastError(); 14762 if (mem_base != xmlMemBlocks()) { 14763 printf("Leak of %d blocks found in xmlSAXParseDTD", 14764 xmlMemBlocks() - mem_base); 14765 test_ret++; 14766 printf(" %d", n_sax); 14767 printf(" %d", n_ExternalID); 14768 printf(" %d", n_SystemID); 14769 printf("\n"); 14770 } 14771 } 14772 } 14773 } 14774 function_tests++; 14775 #endif 14776 #endif 14777 14778 return(test_ret); 14779 } 14780 14781 14782 static int 14783 test_xmlSAXParseDoc(void) { 14784 int test_ret = 0; 14785 14786 #if defined(LIBXML_SAX1_ENABLED) 14787 #ifdef LIBXML_SAX1_ENABLED 14788 int mem_base; 14789 xmlDocPtr ret_val; 14790 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14791 int n_sax; 14792 xmlChar * cur; /* a pointer to an array of xmlChar */ 14793 int n_cur; 14794 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 14795 int n_recovery; 14796 14797 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14798 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 14799 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14800 mem_base = xmlMemBlocks(); 14801 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14802 cur = gen_const_xmlChar_ptr(n_cur, 1); 14803 recovery = gen_int(n_recovery, 2); 14804 14805 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery); 14806 desret_xmlDocPtr(ret_val); 14807 call_tests++; 14808 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14809 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 14810 des_int(n_recovery, recovery, 2); 14811 xmlResetLastError(); 14812 if (mem_base != xmlMemBlocks()) { 14813 printf("Leak of %d blocks found in xmlSAXParseDoc", 14814 xmlMemBlocks() - mem_base); 14815 test_ret++; 14816 printf(" %d", n_sax); 14817 printf(" %d", n_cur); 14818 printf(" %d", n_recovery); 14819 printf("\n"); 14820 } 14821 } 14822 } 14823 } 14824 function_tests++; 14825 #endif 14826 #endif 14827 14828 return(test_ret); 14829 } 14830 14831 14832 static int 14833 test_xmlSAXParseEntity(void) { 14834 int test_ret = 0; 14835 14836 #if defined(LIBXML_SAX1_ENABLED) 14837 #ifdef LIBXML_SAX1_ENABLED 14838 int mem_base; 14839 xmlDocPtr ret_val; 14840 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14841 int n_sax; 14842 const char * filename; /* the filename */ 14843 int n_filename; 14844 14845 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14846 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14847 mem_base = xmlMemBlocks(); 14848 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14849 filename = gen_filepath(n_filename, 1); 14850 14851 ret_val = xmlSAXParseEntity(sax, filename); 14852 desret_xmlDocPtr(ret_val); 14853 call_tests++; 14854 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14855 des_filepath(n_filename, filename, 1); 14856 xmlResetLastError(); 14857 if (mem_base != xmlMemBlocks()) { 14858 printf("Leak of %d blocks found in xmlSAXParseEntity", 14859 xmlMemBlocks() - mem_base); 14860 test_ret++; 14861 printf(" %d", n_sax); 14862 printf(" %d", n_filename); 14863 printf("\n"); 14864 } 14865 } 14866 } 14867 function_tests++; 14868 #endif 14869 #endif 14870 14871 return(test_ret); 14872 } 14873 14874 14875 static int 14876 test_xmlSAXParseFile(void) { 14877 int test_ret = 0; 14878 14879 #if defined(LIBXML_SAX1_ENABLED) 14880 #ifdef LIBXML_SAX1_ENABLED 14881 int mem_base; 14882 xmlDocPtr ret_val; 14883 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14884 int n_sax; 14885 const char * filename; /* the filename */ 14886 int n_filename; 14887 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 14888 int n_recovery; 14889 14890 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14891 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14892 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14893 mem_base = xmlMemBlocks(); 14894 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14895 filename = gen_filepath(n_filename, 1); 14896 recovery = gen_int(n_recovery, 2); 14897 14898 ret_val = xmlSAXParseFile(sax, filename, recovery); 14899 desret_xmlDocPtr(ret_val); 14900 call_tests++; 14901 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14902 des_filepath(n_filename, filename, 1); 14903 des_int(n_recovery, recovery, 2); 14904 xmlResetLastError(); 14905 if (mem_base != xmlMemBlocks()) { 14906 printf("Leak of %d blocks found in xmlSAXParseFile", 14907 xmlMemBlocks() - mem_base); 14908 test_ret++; 14909 printf(" %d", n_sax); 14910 printf(" %d", n_filename); 14911 printf(" %d", n_recovery); 14912 printf("\n"); 14913 } 14914 } 14915 } 14916 } 14917 function_tests++; 14918 #endif 14919 #endif 14920 14921 return(test_ret); 14922 } 14923 14924 14925 static int 14926 test_xmlSAXParseFileWithData(void) { 14927 int test_ret = 0; 14928 14929 #if defined(LIBXML_SAX1_ENABLED) 14930 #ifdef LIBXML_SAX1_ENABLED 14931 int mem_base; 14932 xmlDocPtr ret_val; 14933 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14934 int n_sax; 14935 const char * filename; /* the filename */ 14936 int n_filename; 14937 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 14938 int n_recovery; 14939 void * data; /* the userdata */ 14940 int n_data; 14941 14942 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 14943 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 14944 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 14945 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 14946 mem_base = xmlMemBlocks(); 14947 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 14948 filename = gen_filepath(n_filename, 1); 14949 recovery = gen_int(n_recovery, 2); 14950 data = gen_userdata(n_data, 3); 14951 14952 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data); 14953 desret_xmlDocPtr(ret_val); 14954 call_tests++; 14955 des_xmlSAXHandlerPtr(n_sax, sax, 0); 14956 des_filepath(n_filename, filename, 1); 14957 des_int(n_recovery, recovery, 2); 14958 des_userdata(n_data, data, 3); 14959 xmlResetLastError(); 14960 if (mem_base != xmlMemBlocks()) { 14961 printf("Leak of %d blocks found in xmlSAXParseFileWithData", 14962 xmlMemBlocks() - mem_base); 14963 test_ret++; 14964 printf(" %d", n_sax); 14965 printf(" %d", n_filename); 14966 printf(" %d", n_recovery); 14967 printf(" %d", n_data); 14968 printf("\n"); 14969 } 14970 } 14971 } 14972 } 14973 } 14974 function_tests++; 14975 #endif 14976 #endif 14977 14978 return(test_ret); 14979 } 14980 14981 14982 static int 14983 test_xmlSAXParseMemory(void) { 14984 int test_ret = 0; 14985 14986 #if defined(LIBXML_SAX1_ENABLED) 14987 #ifdef LIBXML_SAX1_ENABLED 14988 int mem_base; 14989 xmlDocPtr ret_val; 14990 xmlSAXHandlerPtr sax; /* the SAX handler block */ 14991 int n_sax; 14992 char * buffer; /* an pointer to a char array */ 14993 int n_buffer; 14994 int size; /* the size of the array */ 14995 int n_size; 14996 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */ 14997 int n_recovery; 14998 14999 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15000 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15001 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15002 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 15003 mem_base = xmlMemBlocks(); 15004 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15005 buffer = gen_const_char_ptr(n_buffer, 1); 15006 size = gen_int(n_size, 2); 15007 recovery = gen_int(n_recovery, 3); 15008 15009 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery); 15010 desret_xmlDocPtr(ret_val); 15011 call_tests++; 15012 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15013 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 15014 des_int(n_size, size, 2); 15015 des_int(n_recovery, recovery, 3); 15016 xmlResetLastError(); 15017 if (mem_base != xmlMemBlocks()) { 15018 printf("Leak of %d blocks found in xmlSAXParseMemory", 15019 xmlMemBlocks() - mem_base); 15020 test_ret++; 15021 printf(" %d", n_sax); 15022 printf(" %d", n_buffer); 15023 printf(" %d", n_size); 15024 printf(" %d", n_recovery); 15025 printf("\n"); 15026 } 15027 } 15028 } 15029 } 15030 } 15031 function_tests++; 15032 #endif 15033 #endif 15034 15035 return(test_ret); 15036 } 15037 15038 15039 static int 15040 test_xmlSAXParseMemoryWithData(void) { 15041 int test_ret = 0; 15042 15043 #if defined(LIBXML_SAX1_ENABLED) 15044 #ifdef LIBXML_SAX1_ENABLED 15045 int mem_base; 15046 xmlDocPtr ret_val; 15047 xmlSAXHandlerPtr sax; /* the SAX handler block */ 15048 int n_sax; 15049 char * buffer; /* an pointer to a char array */ 15050 int n_buffer; 15051 int size; /* the size of the array */ 15052 int n_size; 15053 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ 15054 int n_recovery; 15055 void * data; /* the userdata */ 15056 int n_data; 15057 15058 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15059 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15060 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15061 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { 15062 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 15063 mem_base = xmlMemBlocks(); 15064 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15065 buffer = gen_const_char_ptr(n_buffer, 1); 15066 size = gen_int(n_size, 2); 15067 recovery = gen_int(n_recovery, 3); 15068 data = gen_userdata(n_data, 4); 15069 15070 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data); 15071 desret_xmlDocPtr(ret_val); 15072 call_tests++; 15073 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15074 des_const_char_ptr(n_buffer, (const char *)buffer, 1); 15075 des_int(n_size, size, 2); 15076 des_int(n_recovery, recovery, 3); 15077 des_userdata(n_data, data, 4); 15078 xmlResetLastError(); 15079 if (mem_base != xmlMemBlocks()) { 15080 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData", 15081 xmlMemBlocks() - mem_base); 15082 test_ret++; 15083 printf(" %d", n_sax); 15084 printf(" %d", n_buffer); 15085 printf(" %d", n_size); 15086 printf(" %d", n_recovery); 15087 printf(" %d", n_data); 15088 printf("\n"); 15089 } 15090 } 15091 } 15092 } 15093 } 15094 } 15095 function_tests++; 15096 #endif 15097 #endif 15098 15099 return(test_ret); 15100 } 15101 15102 15103 static int 15104 test_xmlSAXUserParseFile(void) { 15105 int test_ret = 0; 15106 15107 #if defined(LIBXML_SAX1_ENABLED) 15108 #ifdef LIBXML_SAX1_ENABLED 15109 int mem_base; 15110 int ret_val; 15111 xmlSAXHandlerPtr sax; /* a SAX handler */ 15112 int n_sax; 15113 void * user_data; /* The user data returned on SAX callbacks */ 15114 int n_user_data; 15115 const char * filename; /* a file name */ 15116 int n_filename; 15117 15118 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15119 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 15120 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 15121 mem_base = xmlMemBlocks(); 15122 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15123 user_data = gen_userdata(n_user_data, 1); 15124 filename = gen_filepath(n_filename, 2); 15125 15126 #ifdef LIBXML_SAX1_ENABLED 15127 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 15128 #endif 15129 15130 15131 ret_val = xmlSAXUserParseFile(sax, user_data, filename); 15132 desret_int(ret_val); 15133 call_tests++; 15134 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15135 des_userdata(n_user_data, user_data, 1); 15136 des_filepath(n_filename, filename, 2); 15137 xmlResetLastError(); 15138 if (mem_base != xmlMemBlocks()) { 15139 printf("Leak of %d blocks found in xmlSAXUserParseFile", 15140 xmlMemBlocks() - mem_base); 15141 test_ret++; 15142 printf(" %d", n_sax); 15143 printf(" %d", n_user_data); 15144 printf(" %d", n_filename); 15145 printf("\n"); 15146 } 15147 } 15148 } 15149 } 15150 function_tests++; 15151 #endif 15152 #endif 15153 15154 return(test_ret); 15155 } 15156 15157 15158 static int 15159 test_xmlSAXUserParseMemory(void) { 15160 int test_ret = 0; 15161 15162 #if defined(LIBXML_SAX1_ENABLED) 15163 #ifdef LIBXML_SAX1_ENABLED 15164 int mem_base; 15165 int ret_val; 15166 xmlSAXHandlerPtr sax; /* a SAX handler */ 15167 int n_sax; 15168 void * user_data; /* The user data returned on SAX callbacks */ 15169 int n_user_data; 15170 char * buffer; /* an in-memory XML document input */ 15171 int n_buffer; 15172 int size; /* the length of the XML document in bytes */ 15173 int n_size; 15174 15175 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { 15176 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { 15177 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15178 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15179 mem_base = xmlMemBlocks(); 15180 sax = gen_xmlSAXHandlerPtr(n_sax, 0); 15181 user_data = gen_userdata(n_user_data, 1); 15182 buffer = gen_const_char_ptr(n_buffer, 2); 15183 size = gen_int(n_size, 3); 15184 15185 #ifdef LIBXML_SAX1_ENABLED 15186 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; 15187 #endif 15188 15189 15190 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size); 15191 desret_int(ret_val); 15192 call_tests++; 15193 des_xmlSAXHandlerPtr(n_sax, sax, 0); 15194 des_userdata(n_user_data, user_data, 1); 15195 des_const_char_ptr(n_buffer, (const char *)buffer, 2); 15196 des_int(n_size, size, 3); 15197 xmlResetLastError(); 15198 if (mem_base != xmlMemBlocks()) { 15199 printf("Leak of %d blocks found in xmlSAXUserParseMemory", 15200 xmlMemBlocks() - mem_base); 15201 test_ret++; 15202 printf(" %d", n_sax); 15203 printf(" %d", n_user_data); 15204 printf(" %d", n_buffer); 15205 printf(" %d", n_size); 15206 printf("\n"); 15207 } 15208 } 15209 } 15210 } 15211 } 15212 function_tests++; 15213 #endif 15214 #endif 15215 15216 return(test_ret); 15217 } 15218 15219 15220 static int 15221 test_xmlSetExternalEntityLoader(void) { 15222 int test_ret = 0; 15223 15224 15225 /* missing type support */ 15226 return(test_ret); 15227 } 15228 15229 15230 static int 15231 test_xmlSetFeature(void) { 15232 int test_ret = 0; 15233 15234 #if defined(LIBXML_LEGACY_ENABLED) 15235 #ifdef LIBXML_LEGACY_ENABLED 15236 int mem_base; 15237 int ret_val; 15238 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ 15239 int n_ctxt; 15240 char * name; /* the feature name */ 15241 int n_name; 15242 void * value; /* pointer to the location of the new value */ 15243 int n_value; 15244 15245 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15246 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 15247 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) { 15248 mem_base = xmlMemBlocks(); 15249 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15250 name = gen_const_char_ptr(n_name, 1); 15251 value = gen_void_ptr(n_value, 2); 15252 15253 ret_val = xmlSetFeature(ctxt, (const char *)name, value); 15254 desret_int(ret_val); 15255 call_tests++; 15256 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15257 des_const_char_ptr(n_name, (const char *)name, 1); 15258 des_void_ptr(n_value, value, 2); 15259 xmlResetLastError(); 15260 if (mem_base != xmlMemBlocks()) { 15261 printf("Leak of %d blocks found in xmlSetFeature", 15262 xmlMemBlocks() - mem_base); 15263 test_ret++; 15264 printf(" %d", n_ctxt); 15265 printf(" %d", n_name); 15266 printf(" %d", n_value); 15267 printf("\n"); 15268 } 15269 } 15270 } 15271 } 15272 function_tests++; 15273 #endif 15274 #endif 15275 15276 return(test_ret); 15277 } 15278 15279 15280 static int 15281 test_xmlSetupParserForBuffer(void) { 15282 int test_ret = 0; 15283 15284 #if defined(LIBXML_SAX1_ENABLED) 15285 #ifdef LIBXML_SAX1_ENABLED 15286 int mem_base; 15287 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15288 int n_ctxt; 15289 xmlChar * buffer; /* a xmlChar * buffer */ 15290 int n_buffer; 15291 const char * filename; /* a file name */ 15292 int n_filename; 15293 15294 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15295 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { 15296 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 15297 mem_base = xmlMemBlocks(); 15298 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15299 buffer = gen_const_xmlChar_ptr(n_buffer, 1); 15300 filename = gen_filepath(n_filename, 2); 15301 15302 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename); 15303 call_tests++; 15304 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15305 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1); 15306 des_filepath(n_filename, filename, 2); 15307 xmlResetLastError(); 15308 if (mem_base != xmlMemBlocks()) { 15309 printf("Leak of %d blocks found in xmlSetupParserForBuffer", 15310 xmlMemBlocks() - mem_base); 15311 test_ret++; 15312 printf(" %d", n_ctxt); 15313 printf(" %d", n_buffer); 15314 printf(" %d", n_filename); 15315 printf("\n"); 15316 } 15317 } 15318 } 15319 } 15320 function_tests++; 15321 #endif 15322 #endif 15323 15324 return(test_ret); 15325 } 15326 15327 15328 static int 15329 test_xmlStopParser(void) { 15330 int test_ret = 0; 15331 15332 #ifdef LIBXML_PUSH_ENABLED 15333 int mem_base; 15334 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15335 int n_ctxt; 15336 15337 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15338 mem_base = xmlMemBlocks(); 15339 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15340 15341 xmlStopParser(ctxt); 15342 call_tests++; 15343 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15344 xmlResetLastError(); 15345 if (mem_base != xmlMemBlocks()) { 15346 printf("Leak of %d blocks found in xmlStopParser", 15347 xmlMemBlocks() - mem_base); 15348 test_ret++; 15349 printf(" %d", n_ctxt); 15350 printf("\n"); 15351 } 15352 } 15353 function_tests++; 15354 #endif 15355 15356 return(test_ret); 15357 } 15358 15359 15360 static int 15361 test_xmlSubstituteEntitiesDefault(void) { 15362 int test_ret = 0; 15363 15364 int mem_base; 15365 int ret_val; 15366 int val; /* int 0 or 1 */ 15367 int n_val; 15368 15369 for (n_val = 0;n_val < gen_nb_int;n_val++) { 15370 mem_base = xmlMemBlocks(); 15371 val = gen_int(n_val, 0); 15372 15373 ret_val = xmlSubstituteEntitiesDefault(val); 15374 desret_int(ret_val); 15375 call_tests++; 15376 des_int(n_val, val, 0); 15377 xmlResetLastError(); 15378 if (mem_base != xmlMemBlocks()) { 15379 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault", 15380 xmlMemBlocks() - mem_base); 15381 test_ret++; 15382 printf(" %d", n_val); 15383 printf("\n"); 15384 } 15385 } 15386 function_tests++; 15387 15388 return(test_ret); 15389 } 15390 15391 static int 15392 test_parser(void) { 15393 int test_ret = 0; 15394 15395 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n"); 15396 test_ret += test_xmlByteConsumed(); 15397 test_ret += test_xmlClearNodeInfoSeq(); 15398 test_ret += test_xmlClearParserCtxt(); 15399 test_ret += test_xmlCreateDocParserCtxt(); 15400 test_ret += test_xmlCreatePushParserCtxt(); 15401 test_ret += test_xmlCtxtReadDoc(); 15402 test_ret += test_xmlCtxtReadFile(); 15403 test_ret += test_xmlCtxtReadMemory(); 15404 test_ret += test_xmlCtxtReset(); 15405 test_ret += test_xmlCtxtResetPush(); 15406 test_ret += test_xmlCtxtUseOptions(); 15407 test_ret += test_xmlGetExternalEntityLoader(); 15408 test_ret += test_xmlGetFeature(); 15409 test_ret += test_xmlGetFeaturesList(); 15410 test_ret += test_xmlHasFeature(); 15411 test_ret += test_xmlIOParseDTD(); 15412 test_ret += test_xmlInitNodeInfoSeq(); 15413 test_ret += test_xmlInitParser(); 15414 test_ret += test_xmlInitParserCtxt(); 15415 test_ret += test_xmlKeepBlanksDefault(); 15416 test_ret += test_xmlLineNumbersDefault(); 15417 test_ret += test_xmlLoadExternalEntity(); 15418 test_ret += test_xmlNewIOInputStream(); 15419 test_ret += test_xmlNewParserCtxt(); 15420 test_ret += test_xmlParseBalancedChunkMemory(); 15421 test_ret += test_xmlParseBalancedChunkMemoryRecover(); 15422 test_ret += test_xmlParseChunk(); 15423 test_ret += test_xmlParseCtxtExternalEntity(); 15424 test_ret += test_xmlParseDTD(); 15425 test_ret += test_xmlParseDoc(); 15426 test_ret += test_xmlParseDocument(); 15427 test_ret += test_xmlParseEntity(); 15428 test_ret += test_xmlParseExtParsedEnt(); 15429 test_ret += test_xmlParseExternalEntity(); 15430 test_ret += test_xmlParseFile(); 15431 test_ret += test_xmlParseInNodeContext(); 15432 test_ret += test_xmlParseMemory(); 15433 test_ret += test_xmlParserAddNodeInfo(); 15434 test_ret += test_xmlParserFindNodeInfo(); 15435 test_ret += test_xmlParserFindNodeInfoIndex(); 15436 test_ret += test_xmlParserInputGrow(); 15437 test_ret += test_xmlParserInputRead(); 15438 test_ret += test_xmlPedanticParserDefault(); 15439 test_ret += test_xmlReadDoc(); 15440 test_ret += test_xmlReadFile(); 15441 test_ret += test_xmlReadMemory(); 15442 test_ret += test_xmlRecoverDoc(); 15443 test_ret += test_xmlRecoverFile(); 15444 test_ret += test_xmlRecoverMemory(); 15445 test_ret += test_xmlSAXParseDTD(); 15446 test_ret += test_xmlSAXParseDoc(); 15447 test_ret += test_xmlSAXParseEntity(); 15448 test_ret += test_xmlSAXParseFile(); 15449 test_ret += test_xmlSAXParseFileWithData(); 15450 test_ret += test_xmlSAXParseMemory(); 15451 test_ret += test_xmlSAXParseMemoryWithData(); 15452 test_ret += test_xmlSAXUserParseFile(); 15453 test_ret += test_xmlSAXUserParseMemory(); 15454 test_ret += test_xmlSetExternalEntityLoader(); 15455 test_ret += test_xmlSetFeature(); 15456 test_ret += test_xmlSetupParserForBuffer(); 15457 test_ret += test_xmlStopParser(); 15458 test_ret += test_xmlSubstituteEntitiesDefault(); 15459 15460 if (test_ret != 0) 15461 printf("Module parser: %d errors\n", test_ret); 15462 return(test_ret); 15463 } 15464 15465 static int 15466 test_htmlCreateFileParserCtxt(void) { 15467 int test_ret = 0; 15468 15469 #if defined(LIBXML_HTML_ENABLED) 15470 int mem_base; 15471 htmlParserCtxtPtr ret_val; 15472 const char * filename; /* the filename */ 15473 int n_filename; 15474 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ 15475 int n_encoding; 15476 15477 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 15478 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 15479 mem_base = xmlMemBlocks(); 15480 filename = gen_fileoutput(n_filename, 0); 15481 encoding = gen_const_char_ptr(n_encoding, 1); 15482 15483 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding); 15484 desret_htmlParserCtxtPtr(ret_val); 15485 call_tests++; 15486 des_fileoutput(n_filename, filename, 0); 15487 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 15488 xmlResetLastError(); 15489 if (mem_base != xmlMemBlocks()) { 15490 printf("Leak of %d blocks found in htmlCreateFileParserCtxt", 15491 xmlMemBlocks() - mem_base); 15492 test_ret++; 15493 printf(" %d", n_filename); 15494 printf(" %d", n_encoding); 15495 printf("\n"); 15496 } 15497 } 15498 } 15499 function_tests++; 15500 #endif 15501 15502 return(test_ret); 15503 } 15504 15505 15506 static int 15507 test_htmlInitAutoClose(void) { 15508 int test_ret = 0; 15509 15510 #if defined(LIBXML_HTML_ENABLED) 15511 int mem_base; 15512 15513 mem_base = xmlMemBlocks(); 15514 15515 htmlInitAutoClose(); 15516 call_tests++; 15517 xmlResetLastError(); 15518 if (mem_base != xmlMemBlocks()) { 15519 printf("Leak of %d blocks found in htmlInitAutoClose", 15520 xmlMemBlocks() - mem_base); 15521 test_ret++; 15522 printf("\n"); 15523 } 15524 function_tests++; 15525 #endif 15526 15527 return(test_ret); 15528 } 15529 15530 15531 static int 15532 test_inputPop(void) { 15533 int test_ret = 0; 15534 15535 int mem_base; 15536 xmlParserInputPtr ret_val; 15537 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15538 int n_ctxt; 15539 15540 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15541 mem_base = xmlMemBlocks(); 15542 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15543 15544 ret_val = inputPop(ctxt); 15545 desret_xmlParserInputPtr(ret_val); 15546 call_tests++; 15547 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15548 xmlResetLastError(); 15549 if (mem_base != xmlMemBlocks()) { 15550 printf("Leak of %d blocks found in inputPop", 15551 xmlMemBlocks() - mem_base); 15552 test_ret++; 15553 printf(" %d", n_ctxt); 15554 printf("\n"); 15555 } 15556 } 15557 function_tests++; 15558 15559 return(test_ret); 15560 } 15561 15562 15563 static int 15564 test_inputPush(void) { 15565 int test_ret = 0; 15566 15567 int mem_base; 15568 int ret_val; 15569 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15570 int n_ctxt; 15571 xmlParserInputPtr value; /* the parser input */ 15572 int n_value; 15573 15574 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15575 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) { 15576 mem_base = xmlMemBlocks(); 15577 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15578 value = gen_xmlParserInputPtr(n_value, 1); 15579 15580 ret_val = inputPush(ctxt, value); 15581 desret_int(ret_val); 15582 call_tests++; 15583 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15584 des_xmlParserInputPtr(n_value, value, 1); 15585 xmlResetLastError(); 15586 if (mem_base != xmlMemBlocks()) { 15587 printf("Leak of %d blocks found in inputPush", 15588 xmlMemBlocks() - mem_base); 15589 test_ret++; 15590 printf(" %d", n_ctxt); 15591 printf(" %d", n_value); 15592 printf("\n"); 15593 } 15594 } 15595 } 15596 function_tests++; 15597 15598 return(test_ret); 15599 } 15600 15601 15602 static int 15603 test_namePop(void) { 15604 int test_ret = 0; 15605 15606 int mem_base; 15607 const xmlChar * ret_val; 15608 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15609 int n_ctxt; 15610 15611 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15612 mem_base = xmlMemBlocks(); 15613 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15614 15615 ret_val = namePop(ctxt); 15616 desret_const_xmlChar_ptr(ret_val); 15617 call_tests++; 15618 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15619 xmlResetLastError(); 15620 if (mem_base != xmlMemBlocks()) { 15621 printf("Leak of %d blocks found in namePop", 15622 xmlMemBlocks() - mem_base); 15623 test_ret++; 15624 printf(" %d", n_ctxt); 15625 printf("\n"); 15626 } 15627 } 15628 function_tests++; 15629 15630 return(test_ret); 15631 } 15632 15633 15634 static int 15635 test_namePush(void) { 15636 int test_ret = 0; 15637 15638 int mem_base; 15639 int ret_val; 15640 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15641 int n_ctxt; 15642 xmlChar * value; /* the element name */ 15643 int n_value; 15644 15645 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15646 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 15647 mem_base = xmlMemBlocks(); 15648 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15649 value = gen_const_xmlChar_ptr(n_value, 1); 15650 15651 ret_val = namePush(ctxt, (const xmlChar *)value); 15652 desret_int(ret_val); 15653 call_tests++; 15654 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15655 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 15656 xmlResetLastError(); 15657 if (mem_base != xmlMemBlocks()) { 15658 printf("Leak of %d blocks found in namePush", 15659 xmlMemBlocks() - mem_base); 15660 test_ret++; 15661 printf(" %d", n_ctxt); 15662 printf(" %d", n_value); 15663 printf("\n"); 15664 } 15665 } 15666 } 15667 function_tests++; 15668 15669 return(test_ret); 15670 } 15671 15672 15673 static int 15674 test_nodePop(void) { 15675 int test_ret = 0; 15676 15677 int mem_base; 15678 xmlNodePtr ret_val; 15679 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15680 int n_ctxt; 15681 15682 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15683 mem_base = xmlMemBlocks(); 15684 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15685 15686 ret_val = nodePop(ctxt); 15687 desret_xmlNodePtr(ret_val); 15688 call_tests++; 15689 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15690 xmlResetLastError(); 15691 if (mem_base != xmlMemBlocks()) { 15692 printf("Leak of %d blocks found in nodePop", 15693 xmlMemBlocks() - mem_base); 15694 test_ret++; 15695 printf(" %d", n_ctxt); 15696 printf("\n"); 15697 } 15698 } 15699 function_tests++; 15700 15701 return(test_ret); 15702 } 15703 15704 15705 static int 15706 test_nodePush(void) { 15707 int test_ret = 0; 15708 15709 int mem_base; 15710 int ret_val; 15711 xmlParserCtxtPtr ctxt; /* an XML parser context */ 15712 int n_ctxt; 15713 xmlNodePtr value; /* the element node */ 15714 int n_value; 15715 15716 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 15717 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) { 15718 mem_base = xmlMemBlocks(); 15719 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 15720 value = gen_xmlNodePtr(n_value, 1); 15721 15722 ret_val = nodePush(ctxt, value); 15723 desret_int(ret_val); 15724 call_tests++; 15725 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 15726 des_xmlNodePtr(n_value, value, 1); 15727 xmlResetLastError(); 15728 if (mem_base != xmlMemBlocks()) { 15729 printf("Leak of %d blocks found in nodePush", 15730 xmlMemBlocks() - mem_base); 15731 test_ret++; 15732 printf(" %d", n_ctxt); 15733 printf(" %d", n_value); 15734 printf("\n"); 15735 } 15736 } 15737 } 15738 function_tests++; 15739 15740 return(test_ret); 15741 } 15742 15743 15744 static int 15745 test_xmlCheckLanguageID(void) { 15746 int test_ret = 0; 15747 15748 int mem_base; 15749 int ret_val; 15750 xmlChar * lang; /* pointer to the string value */ 15751 int n_lang; 15752 15753 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { 15754 mem_base = xmlMemBlocks(); 15755 lang = gen_const_xmlChar_ptr(n_lang, 0); 15756 15757 ret_val = xmlCheckLanguageID((const xmlChar *)lang); 15758 desret_int(ret_val); 15759 call_tests++; 15760 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0); 15761 xmlResetLastError(); 15762 if (mem_base != xmlMemBlocks()) { 15763 printf("Leak of %d blocks found in xmlCheckLanguageID", 15764 xmlMemBlocks() - mem_base); 15765 test_ret++; 15766 printf(" %d", n_lang); 15767 printf("\n"); 15768 } 15769 } 15770 function_tests++; 15771 15772 return(test_ret); 15773 } 15774 15775 15776 static int 15777 test_xmlCopyChar(void) { 15778 int test_ret = 0; 15779 15780 int mem_base; 15781 int ret_val; 15782 int len; /* Ignored, compatibility */ 15783 int n_len; 15784 xmlChar * out; /* pointer to an array of xmlChar */ 15785 int n_out; 15786 int val; /* the char value */ 15787 int n_val; 15788 15789 for (n_len = 0;n_len < gen_nb_int;n_len++) { 15790 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) { 15791 for (n_val = 0;n_val < gen_nb_int;n_val++) { 15792 mem_base = xmlMemBlocks(); 15793 len = gen_int(n_len, 0); 15794 out = gen_xmlChar_ptr(n_out, 1); 15795 val = gen_int(n_val, 2); 15796 15797 ret_val = xmlCopyChar(len, out, val); 15798 desret_int(ret_val); 15799 call_tests++; 15800 des_int(n_len, len, 0); 15801 des_xmlChar_ptr(n_out, out, 1); 15802 des_int(n_val, val, 2); 15803 xmlResetLastError(); 15804 if (mem_base != xmlMemBlocks()) { 15805 printf("Leak of %d blocks found in xmlCopyChar", 15806 xmlMemBlocks() - mem_base); 15807 test_ret++; 15808 printf(" %d", n_len); 15809 printf(" %d", n_out); 15810 printf(" %d", n_val); 15811 printf("\n"); 15812 } 15813 } 15814 } 15815 } 15816 function_tests++; 15817 15818 return(test_ret); 15819 } 15820 15821 15822 static int 15823 test_xmlCopyCharMultiByte(void) { 15824 int test_ret = 0; 15825 15826 int mem_base; 15827 int ret_val; 15828 xmlChar * out; /* pointer to an array of xmlChar */ 15829 int n_out; 15830 int val; /* the char value */ 15831 int n_val; 15832 15833 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) { 15834 for (n_val = 0;n_val < gen_nb_int;n_val++) { 15835 mem_base = xmlMemBlocks(); 15836 out = gen_xmlChar_ptr(n_out, 0); 15837 val = gen_int(n_val, 1); 15838 15839 ret_val = xmlCopyCharMultiByte(out, val); 15840 desret_int(ret_val); 15841 call_tests++; 15842 des_xmlChar_ptr(n_out, out, 0); 15843 des_int(n_val, val, 1); 15844 xmlResetLastError(); 15845 if (mem_base != xmlMemBlocks()) { 15846 printf("Leak of %d blocks found in xmlCopyCharMultiByte", 15847 xmlMemBlocks() - mem_base); 15848 test_ret++; 15849 printf(" %d", n_out); 15850 printf(" %d", n_val); 15851 printf("\n"); 15852 } 15853 } 15854 } 15855 function_tests++; 15856 15857 return(test_ret); 15858 } 15859 15860 15861 static int 15862 test_xmlCreateEntityParserCtxt(void) { 15863 int test_ret = 0; 15864 15865 int mem_base; 15866 xmlParserCtxtPtr ret_val; 15867 xmlChar * URL; /* the entity URL */ 15868 int n_URL; 15869 xmlChar * ID; /* the entity PUBLIC ID */ 15870 int n_ID; 15871 xmlChar * base; /* a possible base for the target URI */ 15872 int n_base; 15873 15874 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { 15875 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 15876 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { 15877 mem_base = xmlMemBlocks(); 15878 URL = gen_const_xmlChar_ptr(n_URL, 0); 15879 ID = gen_const_xmlChar_ptr(n_ID, 1); 15880 base = gen_const_xmlChar_ptr(n_base, 2); 15881 15882 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base); 15883 desret_xmlParserCtxtPtr(ret_val); 15884 call_tests++; 15885 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0); 15886 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1); 15887 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2); 15888 xmlResetLastError(); 15889 if (mem_base != xmlMemBlocks()) { 15890 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt", 15891 xmlMemBlocks() - mem_base); 15892 test_ret++; 15893 printf(" %d", n_URL); 15894 printf(" %d", n_ID); 15895 printf(" %d", n_base); 15896 printf("\n"); 15897 } 15898 } 15899 } 15900 } 15901 function_tests++; 15902 15903 return(test_ret); 15904 } 15905 15906 15907 static int 15908 test_xmlCreateFileParserCtxt(void) { 15909 int test_ret = 0; 15910 15911 int mem_base; 15912 xmlParserCtxtPtr ret_val; 15913 const char * filename; /* the filename */ 15914 int n_filename; 15915 15916 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 15917 mem_base = xmlMemBlocks(); 15918 filename = gen_fileoutput(n_filename, 0); 15919 15920 ret_val = xmlCreateFileParserCtxt(filename); 15921 desret_xmlParserCtxtPtr(ret_val); 15922 call_tests++; 15923 des_fileoutput(n_filename, filename, 0); 15924 xmlResetLastError(); 15925 if (mem_base != xmlMemBlocks()) { 15926 printf("Leak of %d blocks found in xmlCreateFileParserCtxt", 15927 xmlMemBlocks() - mem_base); 15928 test_ret++; 15929 printf(" %d", n_filename); 15930 printf("\n"); 15931 } 15932 } 15933 function_tests++; 15934 15935 return(test_ret); 15936 } 15937 15938 15939 static int 15940 test_xmlCreateMemoryParserCtxt(void) { 15941 int test_ret = 0; 15942 15943 int mem_base; 15944 xmlParserCtxtPtr ret_val; 15945 char * buffer; /* a pointer to a char array */ 15946 int n_buffer; 15947 int size; /* the size of the array */ 15948 int n_size; 15949 15950 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 15951 for (n_size = 0;n_size < gen_nb_int;n_size++) { 15952 mem_base = xmlMemBlocks(); 15953 buffer = gen_const_char_ptr(n_buffer, 0); 15954 size = gen_int(n_size, 1); 15955 15956 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size); 15957 desret_xmlParserCtxtPtr(ret_val); 15958 call_tests++; 15959 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 15960 des_int(n_size, size, 1); 15961 xmlResetLastError(); 15962 if (mem_base != xmlMemBlocks()) { 15963 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt", 15964 xmlMemBlocks() - mem_base); 15965 test_ret++; 15966 printf(" %d", n_buffer); 15967 printf(" %d", n_size); 15968 printf("\n"); 15969 } 15970 } 15971 } 15972 function_tests++; 15973 15974 return(test_ret); 15975 } 15976 15977 15978 static int 15979 test_xmlCreateURLParserCtxt(void) { 15980 int test_ret = 0; 15981 15982 int mem_base; 15983 xmlParserCtxtPtr ret_val; 15984 const char * filename; /* the filename or URL */ 15985 int n_filename; 15986 int options; /* a combination of xmlParserOption */ 15987 int n_options; 15988 15989 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 15990 for (n_options = 0;n_options < gen_nb_int;n_options++) { 15991 mem_base = xmlMemBlocks(); 15992 filename = gen_fileoutput(n_filename, 0); 15993 options = gen_int(n_options, 1); 15994 15995 ret_val = xmlCreateURLParserCtxt(filename, options); 15996 desret_xmlParserCtxtPtr(ret_val); 15997 call_tests++; 15998 des_fileoutput(n_filename, filename, 0); 15999 des_int(n_options, options, 1); 16000 xmlResetLastError(); 16001 if (mem_base != xmlMemBlocks()) { 16002 printf("Leak of %d blocks found in xmlCreateURLParserCtxt", 16003 xmlMemBlocks() - mem_base); 16004 test_ret++; 16005 printf(" %d", n_filename); 16006 printf(" %d", n_options); 16007 printf("\n"); 16008 } 16009 } 16010 } 16011 function_tests++; 16012 16013 return(test_ret); 16014 } 16015 16016 16017 static int 16018 test_xmlCurrentChar(void) { 16019 int test_ret = 0; 16020 16021 int mem_base; 16022 int ret_val; 16023 xmlParserCtxtPtr ctxt; /* the XML parser context */ 16024 int n_ctxt; 16025 int * len; /* pointer to the length of the char read */ 16026 int n_len; 16027 16028 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16029 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 16030 mem_base = xmlMemBlocks(); 16031 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16032 len = gen_int_ptr(n_len, 1); 16033 16034 ret_val = xmlCurrentChar(ctxt, len); 16035 desret_int(ret_val); 16036 call_tests++; 16037 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16038 des_int_ptr(n_len, len, 1); 16039 xmlResetLastError(); 16040 if (mem_base != xmlMemBlocks()) { 16041 printf("Leak of %d blocks found in xmlCurrentChar", 16042 xmlMemBlocks() - mem_base); 16043 test_ret++; 16044 printf(" %d", n_ctxt); 16045 printf(" %d", n_len); 16046 printf("\n"); 16047 } 16048 } 16049 } 16050 function_tests++; 16051 16052 return(test_ret); 16053 } 16054 16055 16056 static int 16057 test_xmlErrMemory(void) { 16058 int test_ret = 0; 16059 16060 int mem_base; 16061 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16062 int n_ctxt; 16063 char * extra; /* extra informations */ 16064 int n_extra; 16065 16066 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16067 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) { 16068 mem_base = xmlMemBlocks(); 16069 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16070 extra = gen_const_char_ptr(n_extra, 1); 16071 16072 xmlErrMemory(ctxt, (const char *)extra); 16073 call_tests++; 16074 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16075 des_const_char_ptr(n_extra, (const char *)extra, 1); 16076 xmlResetLastError(); 16077 if (mem_base != xmlMemBlocks()) { 16078 printf("Leak of %d blocks found in xmlErrMemory", 16079 xmlMemBlocks() - mem_base); 16080 test_ret++; 16081 printf(" %d", n_ctxt); 16082 printf(" %d", n_extra); 16083 printf("\n"); 16084 } 16085 } 16086 } 16087 function_tests++; 16088 16089 return(test_ret); 16090 } 16091 16092 16093 static int 16094 test_xmlIsLetter(void) { 16095 int test_ret = 0; 16096 16097 int mem_base; 16098 int ret_val; 16099 int c; /* an unicode character (int) */ 16100 int n_c; 16101 16102 for (n_c = 0;n_c < gen_nb_int;n_c++) { 16103 mem_base = xmlMemBlocks(); 16104 c = gen_int(n_c, 0); 16105 16106 ret_val = xmlIsLetter(c); 16107 desret_int(ret_val); 16108 call_tests++; 16109 des_int(n_c, c, 0); 16110 xmlResetLastError(); 16111 if (mem_base != xmlMemBlocks()) { 16112 printf("Leak of %d blocks found in xmlIsLetter", 16113 xmlMemBlocks() - mem_base); 16114 test_ret++; 16115 printf(" %d", n_c); 16116 printf("\n"); 16117 } 16118 } 16119 function_tests++; 16120 16121 return(test_ret); 16122 } 16123 16124 16125 static int 16126 test_xmlNewEntityInputStream(void) { 16127 int test_ret = 0; 16128 16129 int mem_base; 16130 xmlParserInputPtr ret_val; 16131 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16132 int n_ctxt; 16133 xmlEntityPtr entity; /* an Entity pointer */ 16134 int n_entity; 16135 16136 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16137 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) { 16138 mem_base = xmlMemBlocks(); 16139 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16140 entity = gen_xmlEntityPtr(n_entity, 1); 16141 16142 ret_val = xmlNewEntityInputStream(ctxt, entity); 16143 desret_xmlParserInputPtr(ret_val); 16144 call_tests++; 16145 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16146 des_xmlEntityPtr(n_entity, entity, 1); 16147 xmlResetLastError(); 16148 if (mem_base != xmlMemBlocks()) { 16149 printf("Leak of %d blocks found in xmlNewEntityInputStream", 16150 xmlMemBlocks() - mem_base); 16151 test_ret++; 16152 printf(" %d", n_ctxt); 16153 printf(" %d", n_entity); 16154 printf("\n"); 16155 } 16156 } 16157 } 16158 function_tests++; 16159 16160 return(test_ret); 16161 } 16162 16163 16164 static int 16165 test_xmlNewInputFromFile(void) { 16166 int test_ret = 0; 16167 16168 int mem_base; 16169 xmlParserInputPtr ret_val; 16170 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16171 int n_ctxt; 16172 const char * filename; /* the filename to use as entity */ 16173 int n_filename; 16174 16175 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16176 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 16177 mem_base = xmlMemBlocks(); 16178 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16179 filename = gen_filepath(n_filename, 1); 16180 16181 ret_val = xmlNewInputFromFile(ctxt, filename); 16182 desret_xmlParserInputPtr(ret_val); 16183 call_tests++; 16184 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16185 des_filepath(n_filename, filename, 1); 16186 xmlResetLastError(); 16187 if (mem_base != xmlMemBlocks()) { 16188 printf("Leak of %d blocks found in xmlNewInputFromFile", 16189 xmlMemBlocks() - mem_base); 16190 test_ret++; 16191 printf(" %d", n_ctxt); 16192 printf(" %d", n_filename); 16193 printf("\n"); 16194 } 16195 } 16196 } 16197 function_tests++; 16198 16199 return(test_ret); 16200 } 16201 16202 16203 static int 16204 test_xmlNewInputStream(void) { 16205 int test_ret = 0; 16206 16207 int mem_base; 16208 xmlParserInputPtr ret_val; 16209 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16210 int n_ctxt; 16211 16212 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16213 mem_base = xmlMemBlocks(); 16214 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16215 16216 ret_val = xmlNewInputStream(ctxt); 16217 desret_xmlParserInputPtr(ret_val); 16218 call_tests++; 16219 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16220 xmlResetLastError(); 16221 if (mem_base != xmlMemBlocks()) { 16222 printf("Leak of %d blocks found in xmlNewInputStream", 16223 xmlMemBlocks() - mem_base); 16224 test_ret++; 16225 printf(" %d", n_ctxt); 16226 printf("\n"); 16227 } 16228 } 16229 function_tests++; 16230 16231 return(test_ret); 16232 } 16233 16234 16235 static int 16236 test_xmlNewStringInputStream(void) { 16237 int test_ret = 0; 16238 16239 int mem_base; 16240 xmlParserInputPtr ret_val; 16241 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16242 int n_ctxt; 16243 xmlChar * buffer; /* an memory buffer */ 16244 int n_buffer; 16245 16246 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16247 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { 16248 mem_base = xmlMemBlocks(); 16249 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16250 buffer = gen_const_xmlChar_ptr(n_buffer, 1); 16251 16252 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer); 16253 desret_xmlParserInputPtr(ret_val); 16254 call_tests++; 16255 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16256 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1); 16257 xmlResetLastError(); 16258 if (mem_base != xmlMemBlocks()) { 16259 printf("Leak of %d blocks found in xmlNewStringInputStream", 16260 xmlMemBlocks() - mem_base); 16261 test_ret++; 16262 printf(" %d", n_ctxt); 16263 printf(" %d", n_buffer); 16264 printf("\n"); 16265 } 16266 } 16267 } 16268 function_tests++; 16269 16270 return(test_ret); 16271 } 16272 16273 16274 static int 16275 test_xmlNextChar(void) { 16276 int test_ret = 0; 16277 16278 int mem_base; 16279 xmlParserCtxtPtr ctxt; /* the XML parser context */ 16280 int n_ctxt; 16281 16282 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16283 mem_base = xmlMemBlocks(); 16284 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16285 16286 xmlNextChar(ctxt); 16287 call_tests++; 16288 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16289 xmlResetLastError(); 16290 if (mem_base != xmlMemBlocks()) { 16291 printf("Leak of %d blocks found in xmlNextChar", 16292 xmlMemBlocks() - mem_base); 16293 test_ret++; 16294 printf(" %d", n_ctxt); 16295 printf("\n"); 16296 } 16297 } 16298 function_tests++; 16299 16300 return(test_ret); 16301 } 16302 16303 16304 static int 16305 test_xmlParserInputShrink(void) { 16306 int test_ret = 0; 16307 16308 int mem_base; 16309 xmlParserInputPtr in; /* an XML parser input */ 16310 int n_in; 16311 16312 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { 16313 mem_base = xmlMemBlocks(); 16314 in = gen_xmlParserInputPtr(n_in, 0); 16315 16316 xmlParserInputShrink(in); 16317 call_tests++; 16318 des_xmlParserInputPtr(n_in, in, 0); 16319 xmlResetLastError(); 16320 if (mem_base != xmlMemBlocks()) { 16321 printf("Leak of %d blocks found in xmlParserInputShrink", 16322 xmlMemBlocks() - mem_base); 16323 test_ret++; 16324 printf(" %d", n_in); 16325 printf("\n"); 16326 } 16327 } 16328 function_tests++; 16329 16330 return(test_ret); 16331 } 16332 16333 16334 static int 16335 test_xmlPopInput(void) { 16336 int test_ret = 0; 16337 16338 int mem_base; 16339 xmlChar ret_val; 16340 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16341 int n_ctxt; 16342 16343 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16344 mem_base = xmlMemBlocks(); 16345 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16346 16347 ret_val = xmlPopInput(ctxt); 16348 desret_xmlChar(ret_val); 16349 call_tests++; 16350 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16351 xmlResetLastError(); 16352 if (mem_base != xmlMemBlocks()) { 16353 printf("Leak of %d blocks found in xmlPopInput", 16354 xmlMemBlocks() - mem_base); 16355 test_ret++; 16356 printf(" %d", n_ctxt); 16357 printf("\n"); 16358 } 16359 } 16360 function_tests++; 16361 16362 return(test_ret); 16363 } 16364 16365 16366 static int 16367 test_xmlPushInput(void) { 16368 int test_ret = 0; 16369 16370 int mem_base; 16371 int ret_val; 16372 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16373 int n_ctxt; 16374 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */ 16375 int n_input; 16376 16377 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16378 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 16379 mem_base = xmlMemBlocks(); 16380 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16381 input = gen_xmlParserInputPtr(n_input, 1); 16382 16383 ret_val = xmlPushInput(ctxt, input); 16384 desret_int(ret_val); 16385 call_tests++; 16386 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16387 des_xmlParserInputPtr(n_input, input, 1); 16388 xmlResetLastError(); 16389 if (mem_base != xmlMemBlocks()) { 16390 printf("Leak of %d blocks found in xmlPushInput", 16391 xmlMemBlocks() - mem_base); 16392 test_ret++; 16393 printf(" %d", n_ctxt); 16394 printf(" %d", n_input); 16395 printf("\n"); 16396 } 16397 } 16398 } 16399 function_tests++; 16400 16401 return(test_ret); 16402 } 16403 16404 16405 static int 16406 test_xmlSetEntityReferenceFunc(void) { 16407 int test_ret = 0; 16408 16409 16410 /* missing type support */ 16411 return(test_ret); 16412 } 16413 16414 16415 static int 16416 test_xmlSplitQName(void) { 16417 int test_ret = 0; 16418 16419 int mem_base; 16420 xmlChar * ret_val; 16421 xmlParserCtxtPtr ctxt; /* an XML parser context */ 16422 int n_ctxt; 16423 xmlChar * name; /* an XML parser context */ 16424 int n_name; 16425 xmlChar ** prefix; /* a xmlChar ** */ 16426 int n_prefix; 16427 16428 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16429 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 16430 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) { 16431 mem_base = xmlMemBlocks(); 16432 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16433 name = gen_const_xmlChar_ptr(n_name, 1); 16434 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2); 16435 16436 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix); 16437 desret_xmlChar_ptr(ret_val); 16438 call_tests++; 16439 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16440 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 16441 des_xmlChar_ptr_ptr(n_prefix, prefix, 2); 16442 xmlResetLastError(); 16443 if (mem_base != xmlMemBlocks()) { 16444 printf("Leak of %d blocks found in xmlSplitQName", 16445 xmlMemBlocks() - mem_base); 16446 test_ret++; 16447 printf(" %d", n_ctxt); 16448 printf(" %d", n_name); 16449 printf(" %d", n_prefix); 16450 printf("\n"); 16451 } 16452 } 16453 } 16454 } 16455 function_tests++; 16456 16457 return(test_ret); 16458 } 16459 16460 16461 static int 16462 test_xmlStringCurrentChar(void) { 16463 int test_ret = 0; 16464 16465 int mem_base; 16466 int ret_val; 16467 xmlParserCtxtPtr ctxt; /* the XML parser context */ 16468 int n_ctxt; 16469 xmlChar * cur; /* pointer to the beginning of the char */ 16470 int n_cur; 16471 int * len; /* pointer to the length of the char read */ 16472 int n_len; 16473 16474 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16475 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 16476 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 16477 mem_base = xmlMemBlocks(); 16478 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16479 cur = gen_const_xmlChar_ptr(n_cur, 1); 16480 len = gen_int_ptr(n_len, 2); 16481 16482 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len); 16483 desret_int(ret_val); 16484 call_tests++; 16485 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16486 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 16487 des_int_ptr(n_len, len, 2); 16488 xmlResetLastError(); 16489 if (mem_base != xmlMemBlocks()) { 16490 printf("Leak of %d blocks found in xmlStringCurrentChar", 16491 xmlMemBlocks() - mem_base); 16492 test_ret++; 16493 printf(" %d", n_ctxt); 16494 printf(" %d", n_cur); 16495 printf(" %d", n_len); 16496 printf("\n"); 16497 } 16498 } 16499 } 16500 } 16501 function_tests++; 16502 16503 return(test_ret); 16504 } 16505 16506 16507 static int 16508 test_xmlStringDecodeEntities(void) { 16509 int test_ret = 0; 16510 16511 int mem_base; 16512 xmlChar * ret_val; 16513 xmlParserCtxtPtr ctxt; /* the parser context */ 16514 int n_ctxt; 16515 xmlChar * str; /* the input string */ 16516 int n_str; 16517 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */ 16518 int n_what; 16519 xmlChar end; /* an end marker xmlChar, 0 if none */ 16520 int n_end; 16521 xmlChar end2; /* an end marker xmlChar, 0 if none */ 16522 int n_end2; 16523 xmlChar end3; /* an end marker xmlChar, 0 if none */ 16524 int n_end3; 16525 16526 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16527 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 16528 for (n_what = 0;n_what < gen_nb_int;n_what++) { 16529 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) { 16530 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) { 16531 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) { 16532 mem_base = xmlMemBlocks(); 16533 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16534 str = gen_const_xmlChar_ptr(n_str, 1); 16535 what = gen_int(n_what, 2); 16536 end = gen_xmlChar(n_end, 3); 16537 end2 = gen_xmlChar(n_end2, 4); 16538 end3 = gen_xmlChar(n_end3, 5); 16539 16540 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3); 16541 desret_xmlChar_ptr(ret_val); 16542 call_tests++; 16543 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16544 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 16545 des_int(n_what, what, 2); 16546 des_xmlChar(n_end, end, 3); 16547 des_xmlChar(n_end2, end2, 4); 16548 des_xmlChar(n_end3, end3, 5); 16549 xmlResetLastError(); 16550 if (mem_base != xmlMemBlocks()) { 16551 printf("Leak of %d blocks found in xmlStringDecodeEntities", 16552 xmlMemBlocks() - mem_base); 16553 test_ret++; 16554 printf(" %d", n_ctxt); 16555 printf(" %d", n_str); 16556 printf(" %d", n_what); 16557 printf(" %d", n_end); 16558 printf(" %d", n_end2); 16559 printf(" %d", n_end3); 16560 printf("\n"); 16561 } 16562 } 16563 } 16564 } 16565 } 16566 } 16567 } 16568 function_tests++; 16569 16570 return(test_ret); 16571 } 16572 16573 16574 static int 16575 test_xmlStringLenDecodeEntities(void) { 16576 int test_ret = 0; 16577 16578 int mem_base; 16579 xmlChar * ret_val; 16580 xmlParserCtxtPtr ctxt; /* the parser context */ 16581 int n_ctxt; 16582 xmlChar * str; /* the input string */ 16583 int n_str; 16584 int len; /* the string length */ 16585 int n_len; 16586 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */ 16587 int n_what; 16588 xmlChar end; /* an end marker xmlChar, 0 if none */ 16589 int n_end; 16590 xmlChar end2; /* an end marker xmlChar, 0 if none */ 16591 int n_end2; 16592 xmlChar end3; /* an end marker xmlChar, 0 if none */ 16593 int n_end3; 16594 16595 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16596 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 16597 for (n_len = 0;n_len < gen_nb_int;n_len++) { 16598 for (n_what = 0;n_what < gen_nb_int;n_what++) { 16599 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) { 16600 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) { 16601 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) { 16602 mem_base = xmlMemBlocks(); 16603 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16604 str = gen_const_xmlChar_ptr(n_str, 1); 16605 len = gen_int(n_len, 2); 16606 what = gen_int(n_what, 3); 16607 end = gen_xmlChar(n_end, 4); 16608 end2 = gen_xmlChar(n_end2, 5); 16609 end3 = gen_xmlChar(n_end3, 6); 16610 16611 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3); 16612 desret_xmlChar_ptr(ret_val); 16613 call_tests++; 16614 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16615 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 16616 des_int(n_len, len, 2); 16617 des_int(n_what, what, 3); 16618 des_xmlChar(n_end, end, 4); 16619 des_xmlChar(n_end2, end2, 5); 16620 des_xmlChar(n_end3, end3, 6); 16621 xmlResetLastError(); 16622 if (mem_base != xmlMemBlocks()) { 16623 printf("Leak of %d blocks found in xmlStringLenDecodeEntities", 16624 xmlMemBlocks() - mem_base); 16625 test_ret++; 16626 printf(" %d", n_ctxt); 16627 printf(" %d", n_str); 16628 printf(" %d", n_len); 16629 printf(" %d", n_what); 16630 printf(" %d", n_end); 16631 printf(" %d", n_end2); 16632 printf(" %d", n_end3); 16633 printf("\n"); 16634 } 16635 } 16636 } 16637 } 16638 } 16639 } 16640 } 16641 } 16642 function_tests++; 16643 16644 return(test_ret); 16645 } 16646 16647 16648 static int 16649 test_xmlSwitchEncoding(void) { 16650 int test_ret = 0; 16651 16652 int mem_base; 16653 int ret_val; 16654 xmlParserCtxtPtr ctxt; /* the parser context */ 16655 int n_ctxt; 16656 xmlCharEncoding enc; /* the encoding value (number) */ 16657 int n_enc; 16658 16659 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16660 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 16661 mem_base = xmlMemBlocks(); 16662 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16663 enc = gen_xmlCharEncoding(n_enc, 1); 16664 16665 ret_val = xmlSwitchEncoding(ctxt, enc); 16666 desret_int(ret_val); 16667 call_tests++; 16668 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16669 des_xmlCharEncoding(n_enc, enc, 1); 16670 xmlResetLastError(); 16671 if (mem_base != xmlMemBlocks()) { 16672 printf("Leak of %d blocks found in xmlSwitchEncoding", 16673 xmlMemBlocks() - mem_base); 16674 test_ret++; 16675 printf(" %d", n_ctxt); 16676 printf(" %d", n_enc); 16677 printf("\n"); 16678 } 16679 } 16680 } 16681 function_tests++; 16682 16683 return(test_ret); 16684 } 16685 16686 16687 static int 16688 test_xmlSwitchInputEncoding(void) { 16689 int test_ret = 0; 16690 16691 int mem_base; 16692 int ret_val; 16693 xmlParserCtxtPtr ctxt; /* the parser context */ 16694 int n_ctxt; 16695 xmlParserInputPtr input; /* the input stream */ 16696 int n_input; 16697 xmlCharEncodingHandlerPtr handler; /* the encoding handler */ 16698 int n_handler; 16699 16700 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16701 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 16702 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { 16703 mem_base = xmlMemBlocks(); 16704 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16705 input = gen_xmlParserInputPtr(n_input, 1); 16706 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2); 16707 16708 ret_val = xmlSwitchInputEncoding(ctxt, input, handler); 16709 desret_int(ret_val); 16710 call_tests++; 16711 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16712 des_xmlParserInputPtr(n_input, input, 1); 16713 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2); 16714 xmlResetLastError(); 16715 if (mem_base != xmlMemBlocks()) { 16716 printf("Leak of %d blocks found in xmlSwitchInputEncoding", 16717 xmlMemBlocks() - mem_base); 16718 test_ret++; 16719 printf(" %d", n_ctxt); 16720 printf(" %d", n_input); 16721 printf(" %d", n_handler); 16722 printf("\n"); 16723 } 16724 } 16725 } 16726 } 16727 function_tests++; 16728 16729 return(test_ret); 16730 } 16731 16732 16733 static int 16734 test_xmlSwitchToEncoding(void) { 16735 int test_ret = 0; 16736 16737 int mem_base; 16738 int ret_val; 16739 xmlParserCtxtPtr ctxt; /* the parser context */ 16740 int n_ctxt; 16741 xmlCharEncodingHandlerPtr handler; /* the encoding handler */ 16742 int n_handler; 16743 16744 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 16745 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { 16746 mem_base = xmlMemBlocks(); 16747 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 16748 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1); 16749 16750 ret_val = xmlSwitchToEncoding(ctxt, handler); 16751 desret_int(ret_val); 16752 call_tests++; 16753 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 16754 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1); 16755 xmlResetLastError(); 16756 if (mem_base != xmlMemBlocks()) { 16757 printf("Leak of %d blocks found in xmlSwitchToEncoding", 16758 xmlMemBlocks() - mem_base); 16759 test_ret++; 16760 printf(" %d", n_ctxt); 16761 printf(" %d", n_handler); 16762 printf("\n"); 16763 } 16764 } 16765 } 16766 function_tests++; 16767 16768 return(test_ret); 16769 } 16770 16771 static int 16772 test_parserInternals(void) { 16773 int test_ret = 0; 16774 16775 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n"); 16776 test_ret += test_htmlCreateFileParserCtxt(); 16777 test_ret += test_htmlInitAutoClose(); 16778 test_ret += test_inputPop(); 16779 test_ret += test_inputPush(); 16780 test_ret += test_namePop(); 16781 test_ret += test_namePush(); 16782 test_ret += test_nodePop(); 16783 test_ret += test_nodePush(); 16784 test_ret += test_xmlCheckLanguageID(); 16785 test_ret += test_xmlCopyChar(); 16786 test_ret += test_xmlCopyCharMultiByte(); 16787 test_ret += test_xmlCreateEntityParserCtxt(); 16788 test_ret += test_xmlCreateFileParserCtxt(); 16789 test_ret += test_xmlCreateMemoryParserCtxt(); 16790 test_ret += test_xmlCreateURLParserCtxt(); 16791 test_ret += test_xmlCurrentChar(); 16792 test_ret += test_xmlErrMemory(); 16793 test_ret += test_xmlIsLetter(); 16794 test_ret += test_xmlNewEntityInputStream(); 16795 test_ret += test_xmlNewInputFromFile(); 16796 test_ret += test_xmlNewInputStream(); 16797 test_ret += test_xmlNewStringInputStream(); 16798 test_ret += test_xmlNextChar(); 16799 test_ret += test_xmlParserInputShrink(); 16800 test_ret += test_xmlPopInput(); 16801 test_ret += test_xmlPushInput(); 16802 test_ret += test_xmlSetEntityReferenceFunc(); 16803 test_ret += test_xmlSplitQName(); 16804 test_ret += test_xmlStringCurrentChar(); 16805 test_ret += test_xmlStringDecodeEntities(); 16806 test_ret += test_xmlStringLenDecodeEntities(); 16807 test_ret += test_xmlSwitchEncoding(); 16808 test_ret += test_xmlSwitchInputEncoding(); 16809 test_ret += test_xmlSwitchToEncoding(); 16810 16811 if (test_ret != 0) 16812 printf("Module parserInternals: %d errors\n", test_ret); 16813 return(test_ret); 16814 } 16815 16816 static int 16817 test_xmlPatternFromRoot(void) { 16818 int test_ret = 0; 16819 16820 #if defined(LIBXML_PATTERN_ENABLED) 16821 int mem_base; 16822 int ret_val; 16823 xmlPatternPtr comp; /* the precompiled pattern */ 16824 int n_comp; 16825 16826 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16827 mem_base = xmlMemBlocks(); 16828 comp = gen_xmlPatternPtr(n_comp, 0); 16829 16830 ret_val = xmlPatternFromRoot(comp); 16831 desret_int(ret_val); 16832 call_tests++; 16833 des_xmlPatternPtr(n_comp, comp, 0); 16834 xmlResetLastError(); 16835 if (mem_base != xmlMemBlocks()) { 16836 printf("Leak of %d blocks found in xmlPatternFromRoot", 16837 xmlMemBlocks() - mem_base); 16838 test_ret++; 16839 printf(" %d", n_comp); 16840 printf("\n"); 16841 } 16842 } 16843 function_tests++; 16844 #endif 16845 16846 return(test_ret); 16847 } 16848 16849 16850 static int 16851 test_xmlPatternGetStreamCtxt(void) { 16852 int test_ret = 0; 16853 16854 16855 /* missing type support */ 16856 return(test_ret); 16857 } 16858 16859 16860 static int 16861 test_xmlPatternMatch(void) { 16862 int test_ret = 0; 16863 16864 #if defined(LIBXML_PATTERN_ENABLED) 16865 int mem_base; 16866 int ret_val; 16867 xmlPatternPtr comp; /* the precompiled pattern */ 16868 int n_comp; 16869 xmlNodePtr node; /* a node */ 16870 int n_node; 16871 16872 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16873 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 16874 mem_base = xmlMemBlocks(); 16875 comp = gen_xmlPatternPtr(n_comp, 0); 16876 node = gen_xmlNodePtr(n_node, 1); 16877 16878 ret_val = xmlPatternMatch(comp, node); 16879 desret_int(ret_val); 16880 call_tests++; 16881 des_xmlPatternPtr(n_comp, comp, 0); 16882 des_xmlNodePtr(n_node, node, 1); 16883 xmlResetLastError(); 16884 if (mem_base != xmlMemBlocks()) { 16885 printf("Leak of %d blocks found in xmlPatternMatch", 16886 xmlMemBlocks() - mem_base); 16887 test_ret++; 16888 printf(" %d", n_comp); 16889 printf(" %d", n_node); 16890 printf("\n"); 16891 } 16892 } 16893 } 16894 function_tests++; 16895 #endif 16896 16897 return(test_ret); 16898 } 16899 16900 16901 static int 16902 test_xmlPatternMaxDepth(void) { 16903 int test_ret = 0; 16904 16905 #if defined(LIBXML_PATTERN_ENABLED) 16906 int mem_base; 16907 int ret_val; 16908 xmlPatternPtr comp; /* the precompiled pattern */ 16909 int n_comp; 16910 16911 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16912 mem_base = xmlMemBlocks(); 16913 comp = gen_xmlPatternPtr(n_comp, 0); 16914 16915 ret_val = xmlPatternMaxDepth(comp); 16916 desret_int(ret_val); 16917 call_tests++; 16918 des_xmlPatternPtr(n_comp, comp, 0); 16919 xmlResetLastError(); 16920 if (mem_base != xmlMemBlocks()) { 16921 printf("Leak of %d blocks found in xmlPatternMaxDepth", 16922 xmlMemBlocks() - mem_base); 16923 test_ret++; 16924 printf(" %d", n_comp); 16925 printf("\n"); 16926 } 16927 } 16928 function_tests++; 16929 #endif 16930 16931 return(test_ret); 16932 } 16933 16934 16935 static int 16936 test_xmlPatternMinDepth(void) { 16937 int test_ret = 0; 16938 16939 #if defined(LIBXML_PATTERN_ENABLED) 16940 int mem_base; 16941 int ret_val; 16942 xmlPatternPtr comp; /* the precompiled pattern */ 16943 int n_comp; 16944 16945 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16946 mem_base = xmlMemBlocks(); 16947 comp = gen_xmlPatternPtr(n_comp, 0); 16948 16949 ret_val = xmlPatternMinDepth(comp); 16950 desret_int(ret_val); 16951 call_tests++; 16952 des_xmlPatternPtr(n_comp, comp, 0); 16953 xmlResetLastError(); 16954 if (mem_base != xmlMemBlocks()) { 16955 printf("Leak of %d blocks found in xmlPatternMinDepth", 16956 xmlMemBlocks() - mem_base); 16957 test_ret++; 16958 printf(" %d", n_comp); 16959 printf("\n"); 16960 } 16961 } 16962 function_tests++; 16963 #endif 16964 16965 return(test_ret); 16966 } 16967 16968 16969 static int 16970 test_xmlPatternStreamable(void) { 16971 int test_ret = 0; 16972 16973 #if defined(LIBXML_PATTERN_ENABLED) 16974 int mem_base; 16975 int ret_val; 16976 xmlPatternPtr comp; /* the precompiled pattern */ 16977 int n_comp; 16978 16979 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { 16980 mem_base = xmlMemBlocks(); 16981 comp = gen_xmlPatternPtr(n_comp, 0); 16982 16983 ret_val = xmlPatternStreamable(comp); 16984 desret_int(ret_val); 16985 call_tests++; 16986 des_xmlPatternPtr(n_comp, comp, 0); 16987 xmlResetLastError(); 16988 if (mem_base != xmlMemBlocks()) { 16989 printf("Leak of %d blocks found in xmlPatternStreamable", 16990 xmlMemBlocks() - mem_base); 16991 test_ret++; 16992 printf(" %d", n_comp); 16993 printf("\n"); 16994 } 16995 } 16996 function_tests++; 16997 #endif 16998 16999 return(test_ret); 17000 } 17001 17002 17003 static int 17004 test_xmlPatterncompile(void) { 17005 int test_ret = 0; 17006 17007 17008 /* missing type support */ 17009 return(test_ret); 17010 } 17011 17012 #ifdef LIBXML_PATTERN_ENABLED 17013 17014 #define gen_nb_xmlStreamCtxtPtr 1 17015 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17016 return(NULL); 17017 } 17018 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17019 } 17020 #endif 17021 17022 17023 static int 17024 test_xmlStreamPop(void) { 17025 int test_ret = 0; 17026 17027 #if defined(LIBXML_PATTERN_ENABLED) 17028 int mem_base; 17029 int ret_val; 17030 xmlStreamCtxtPtr stream; /* the stream context */ 17031 int n_stream; 17032 17033 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17034 mem_base = xmlMemBlocks(); 17035 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17036 17037 ret_val = xmlStreamPop(stream); 17038 desret_int(ret_val); 17039 call_tests++; 17040 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17041 xmlResetLastError(); 17042 if (mem_base != xmlMemBlocks()) { 17043 printf("Leak of %d blocks found in xmlStreamPop", 17044 xmlMemBlocks() - mem_base); 17045 test_ret++; 17046 printf(" %d", n_stream); 17047 printf("\n"); 17048 } 17049 } 17050 function_tests++; 17051 #endif 17052 17053 return(test_ret); 17054 } 17055 17056 17057 static int 17058 test_xmlStreamPush(void) { 17059 int test_ret = 0; 17060 17061 #if defined(LIBXML_PATTERN_ENABLED) 17062 int mem_base; 17063 int ret_val; 17064 xmlStreamCtxtPtr stream; /* the stream context */ 17065 int n_stream; 17066 xmlChar * name; /* the current name */ 17067 int n_name; 17068 xmlChar * ns; /* the namespace name */ 17069 int n_ns; 17070 17071 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17072 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 17073 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 17074 mem_base = xmlMemBlocks(); 17075 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17076 name = gen_const_xmlChar_ptr(n_name, 1); 17077 ns = gen_const_xmlChar_ptr(n_ns, 2); 17078 17079 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns); 17080 desret_int(ret_val); 17081 call_tests++; 17082 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17083 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 17084 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); 17085 xmlResetLastError(); 17086 if (mem_base != xmlMemBlocks()) { 17087 printf("Leak of %d blocks found in xmlStreamPush", 17088 xmlMemBlocks() - mem_base); 17089 test_ret++; 17090 printf(" %d", n_stream); 17091 printf(" %d", n_name); 17092 printf(" %d", n_ns); 17093 printf("\n"); 17094 } 17095 } 17096 } 17097 } 17098 function_tests++; 17099 #endif 17100 17101 return(test_ret); 17102 } 17103 17104 17105 static int 17106 test_xmlStreamPushAttr(void) { 17107 int test_ret = 0; 17108 17109 #if defined(LIBXML_PATTERN_ENABLED) 17110 int mem_base; 17111 int ret_val; 17112 xmlStreamCtxtPtr stream; /* the stream context */ 17113 int n_stream; 17114 xmlChar * name; /* the current name */ 17115 int n_name; 17116 xmlChar * ns; /* the namespace name */ 17117 int n_ns; 17118 17119 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17120 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 17121 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 17122 mem_base = xmlMemBlocks(); 17123 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17124 name = gen_const_xmlChar_ptr(n_name, 1); 17125 ns = gen_const_xmlChar_ptr(n_ns, 2); 17126 17127 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns); 17128 desret_int(ret_val); 17129 call_tests++; 17130 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17131 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 17132 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); 17133 xmlResetLastError(); 17134 if (mem_base != xmlMemBlocks()) { 17135 printf("Leak of %d blocks found in xmlStreamPushAttr", 17136 xmlMemBlocks() - mem_base); 17137 test_ret++; 17138 printf(" %d", n_stream); 17139 printf(" %d", n_name); 17140 printf(" %d", n_ns); 17141 printf("\n"); 17142 } 17143 } 17144 } 17145 } 17146 function_tests++; 17147 #endif 17148 17149 return(test_ret); 17150 } 17151 17152 17153 static int 17154 test_xmlStreamPushNode(void) { 17155 int test_ret = 0; 17156 17157 #if defined(LIBXML_PATTERN_ENABLED) 17158 int mem_base; 17159 int ret_val; 17160 xmlStreamCtxtPtr stream; /* the stream context */ 17161 int n_stream; 17162 xmlChar * name; /* the current name */ 17163 int n_name; 17164 xmlChar * ns; /* the namespace name */ 17165 int n_ns; 17166 int nodeType; /* the type of the node being pushed */ 17167 int n_nodeType; 17168 17169 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { 17170 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 17171 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 17172 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) { 17173 mem_base = xmlMemBlocks(); 17174 stream = gen_xmlStreamCtxtPtr(n_stream, 0); 17175 name = gen_const_xmlChar_ptr(n_name, 1); 17176 ns = gen_const_xmlChar_ptr(n_ns, 2); 17177 nodeType = gen_int(n_nodeType, 3); 17178 17179 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType); 17180 desret_int(ret_val); 17181 call_tests++; 17182 des_xmlStreamCtxtPtr(n_stream, stream, 0); 17183 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 17184 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); 17185 des_int(n_nodeType, nodeType, 3); 17186 xmlResetLastError(); 17187 if (mem_base != xmlMemBlocks()) { 17188 printf("Leak of %d blocks found in xmlStreamPushNode", 17189 xmlMemBlocks() - mem_base); 17190 test_ret++; 17191 printf(" %d", n_stream); 17192 printf(" %d", n_name); 17193 printf(" %d", n_ns); 17194 printf(" %d", n_nodeType); 17195 printf("\n"); 17196 } 17197 } 17198 } 17199 } 17200 } 17201 function_tests++; 17202 #endif 17203 17204 return(test_ret); 17205 } 17206 17207 17208 static int 17209 test_xmlStreamWantsAnyNode(void) { 17210 int test_ret = 0; 17211 17212 #if defined(LIBXML_PATTERN_ENABLED) 17213 int mem_base; 17214 int ret_val; 17215 xmlStreamCtxtPtr streamCtxt; /* the stream context */ 17216 int n_streamCtxt; 17217 17218 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) { 17219 mem_base = xmlMemBlocks(); 17220 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0); 17221 17222 ret_val = xmlStreamWantsAnyNode(streamCtxt); 17223 desret_int(ret_val); 17224 call_tests++; 17225 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0); 17226 xmlResetLastError(); 17227 if (mem_base != xmlMemBlocks()) { 17228 printf("Leak of %d blocks found in xmlStreamWantsAnyNode", 17229 xmlMemBlocks() - mem_base); 17230 test_ret++; 17231 printf(" %d", n_streamCtxt); 17232 printf("\n"); 17233 } 17234 } 17235 function_tests++; 17236 #endif 17237 17238 return(test_ret); 17239 } 17240 17241 static int 17242 test_pattern(void) { 17243 int test_ret = 0; 17244 17245 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n"); 17246 test_ret += test_xmlPatternFromRoot(); 17247 test_ret += test_xmlPatternGetStreamCtxt(); 17248 test_ret += test_xmlPatternMatch(); 17249 test_ret += test_xmlPatternMaxDepth(); 17250 test_ret += test_xmlPatternMinDepth(); 17251 test_ret += test_xmlPatternStreamable(); 17252 test_ret += test_xmlPatterncompile(); 17253 test_ret += test_xmlStreamPop(); 17254 test_ret += test_xmlStreamPush(); 17255 test_ret += test_xmlStreamPushAttr(); 17256 test_ret += test_xmlStreamPushNode(); 17257 test_ret += test_xmlStreamWantsAnyNode(); 17258 17259 if (test_ret != 0) 17260 printf("Module pattern: %d errors\n", test_ret); 17261 return(test_ret); 17262 } 17263 #ifdef LIBXML_SCHEMAS_ENABLED 17264 17265 #define gen_nb_xmlRelaxNGPtr 1 17266 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17267 return(NULL); 17268 } 17269 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17270 } 17271 #endif 17272 17273 17274 static int 17275 test_xmlRelaxNGDump(void) { 17276 int test_ret = 0; 17277 17278 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 17279 int mem_base; 17280 FILE * output; /* the file output */ 17281 int n_output; 17282 xmlRelaxNGPtr schema; /* a schema structure */ 17283 int n_schema; 17284 17285 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { 17286 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { 17287 mem_base = xmlMemBlocks(); 17288 output = gen_FILE_ptr(n_output, 0); 17289 schema = gen_xmlRelaxNGPtr(n_schema, 1); 17290 17291 xmlRelaxNGDump(output, schema); 17292 call_tests++; 17293 des_FILE_ptr(n_output, output, 0); 17294 des_xmlRelaxNGPtr(n_schema, schema, 1); 17295 xmlResetLastError(); 17296 if (mem_base != xmlMemBlocks()) { 17297 printf("Leak of %d blocks found in xmlRelaxNGDump", 17298 xmlMemBlocks() - mem_base); 17299 test_ret++; 17300 printf(" %d", n_output); 17301 printf(" %d", n_schema); 17302 printf("\n"); 17303 } 17304 } 17305 } 17306 function_tests++; 17307 #endif 17308 17309 return(test_ret); 17310 } 17311 17312 17313 static int 17314 test_xmlRelaxNGDumpTree(void) { 17315 int test_ret = 0; 17316 17317 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) 17318 int mem_base; 17319 FILE * output; /* the file output */ 17320 int n_output; 17321 xmlRelaxNGPtr schema; /* a schema structure */ 17322 int n_schema; 17323 17324 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { 17325 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { 17326 mem_base = xmlMemBlocks(); 17327 output = gen_FILE_ptr(n_output, 0); 17328 schema = gen_xmlRelaxNGPtr(n_schema, 1); 17329 17330 xmlRelaxNGDumpTree(output, schema); 17331 call_tests++; 17332 des_FILE_ptr(n_output, output, 0); 17333 des_xmlRelaxNGPtr(n_schema, schema, 1); 17334 xmlResetLastError(); 17335 if (mem_base != xmlMemBlocks()) { 17336 printf("Leak of %d blocks found in xmlRelaxNGDumpTree", 17337 xmlMemBlocks() - mem_base); 17338 test_ret++; 17339 printf(" %d", n_output); 17340 printf(" %d", n_schema); 17341 printf("\n"); 17342 } 17343 } 17344 } 17345 function_tests++; 17346 #endif 17347 17348 return(test_ret); 17349 } 17350 17351 #ifdef LIBXML_SCHEMAS_ENABLED 17352 17353 #define gen_nb_xmlRelaxNGParserCtxtPtr 1 17354 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17355 return(NULL); 17356 } 17357 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17358 } 17359 #endif 17360 17361 #ifdef LIBXML_SCHEMAS_ENABLED 17362 17363 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1 17364 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17365 return(NULL); 17366 } 17367 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17368 } 17369 #endif 17370 17371 #ifdef LIBXML_SCHEMAS_ENABLED 17372 17373 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1 17374 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17375 return(NULL); 17376 } 17377 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17378 } 17379 #endif 17380 17381 17382 static int 17383 test_xmlRelaxNGGetParserErrors(void) { 17384 int test_ret = 0; 17385 17386 #if defined(LIBXML_SCHEMAS_ENABLED) 17387 int mem_base; 17388 int ret_val; 17389 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */ 17390 int n_ctxt; 17391 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */ 17392 int n_err; 17393 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */ 17394 int n_warn; 17395 void ** ctx; /* contextual data for the callbacks result */ 17396 int n_ctx; 17397 17398 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) { 17399 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) { 17400 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) { 17401 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { 17402 mem_base = xmlMemBlocks(); 17403 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0); 17404 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1); 17405 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2); 17406 ctx = gen_void_ptr_ptr(n_ctx, 3); 17407 17408 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx); 17409 desret_int(ret_val); 17410 call_tests++; 17411 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0); 17412 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1); 17413 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2); 17414 des_void_ptr_ptr(n_ctx, ctx, 3); 17415 xmlResetLastError(); 17416 if (mem_base != xmlMemBlocks()) { 17417 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors", 17418 xmlMemBlocks() - mem_base); 17419 test_ret++; 17420 printf(" %d", n_ctxt); 17421 printf(" %d", n_err); 17422 printf(" %d", n_warn); 17423 printf(" %d", n_ctx); 17424 printf("\n"); 17425 } 17426 } 17427 } 17428 } 17429 } 17430 function_tests++; 17431 #endif 17432 17433 return(test_ret); 17434 } 17435 17436 #ifdef LIBXML_SCHEMAS_ENABLED 17437 17438 #define gen_nb_xmlRelaxNGValidCtxtPtr 1 17439 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17440 return(NULL); 17441 } 17442 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 17443 } 17444 #endif 17445 17446 17447 static int 17448 test_xmlRelaxNGGetValidErrors(void) { 17449 int test_ret = 0; 17450 17451 #if defined(LIBXML_SCHEMAS_ENABLED) 17452 int mem_base; 17453 int ret_val; 17454 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ 17455 int n_ctxt; 17456 xmlRelaxNGValidityErrorFunc * err; /* the error function result */ 17457 int n_err; 17458 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */ 17459 int n_warn; 17460 void ** ctx; /* the functions context result */ 17461 int n_ctx; 17462 17463 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17464 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) { 17465 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) { 17466 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { 17467 mem_base = xmlMemBlocks(); 17468 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17469 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1); 17470 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2); 17471 ctx = gen_void_ptr_ptr(n_ctx, 3); 17472 17473 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx); 17474 desret_int(ret_val); 17475 call_tests++; 17476 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17477 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1); 17478 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2); 17479 des_void_ptr_ptr(n_ctx, ctx, 3); 17480 xmlResetLastError(); 17481 if (mem_base != xmlMemBlocks()) { 17482 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors", 17483 xmlMemBlocks() - mem_base); 17484 test_ret++; 17485 printf(" %d", n_ctxt); 17486 printf(" %d", n_err); 17487 printf(" %d", n_warn); 17488 printf(" %d", n_ctx); 17489 printf("\n"); 17490 } 17491 } 17492 } 17493 } 17494 } 17495 function_tests++; 17496 #endif 17497 17498 return(test_ret); 17499 } 17500 17501 17502 static int 17503 test_xmlRelaxNGInitTypes(void) { 17504 int test_ret = 0; 17505 17506 #if defined(LIBXML_SCHEMAS_ENABLED) 17507 int mem_base; 17508 int ret_val; 17509 17510 mem_base = xmlMemBlocks(); 17511 17512 ret_val = xmlRelaxNGInitTypes(); 17513 desret_int(ret_val); 17514 call_tests++; 17515 xmlResetLastError(); 17516 if (mem_base != xmlMemBlocks()) { 17517 printf("Leak of %d blocks found in xmlRelaxNGInitTypes", 17518 xmlMemBlocks() - mem_base); 17519 test_ret++; 17520 printf("\n"); 17521 } 17522 function_tests++; 17523 #endif 17524 17525 return(test_ret); 17526 } 17527 17528 17529 static int 17530 test_xmlRelaxNGNewDocParserCtxt(void) { 17531 int test_ret = 0; 17532 17533 #if defined(LIBXML_SCHEMAS_ENABLED) 17534 int mem_base; 17535 xmlRelaxNGParserCtxtPtr ret_val; 17536 xmlDocPtr doc; /* a preparsed document tree */ 17537 int n_doc; 17538 17539 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17540 mem_base = xmlMemBlocks(); 17541 doc = gen_xmlDocPtr(n_doc, 0); 17542 17543 ret_val = xmlRelaxNGNewDocParserCtxt(doc); 17544 desret_xmlRelaxNGParserCtxtPtr(ret_val); 17545 call_tests++; 17546 des_xmlDocPtr(n_doc, doc, 0); 17547 xmlResetLastError(); 17548 if (mem_base != xmlMemBlocks()) { 17549 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt", 17550 xmlMemBlocks() - mem_base); 17551 test_ret++; 17552 printf(" %d", n_doc); 17553 printf("\n"); 17554 } 17555 } 17556 function_tests++; 17557 #endif 17558 17559 return(test_ret); 17560 } 17561 17562 17563 static int 17564 test_xmlRelaxNGNewMemParserCtxt(void) { 17565 int test_ret = 0; 17566 17567 #if defined(LIBXML_SCHEMAS_ENABLED) 17568 int mem_base; 17569 xmlRelaxNGParserCtxtPtr ret_val; 17570 char * buffer; /* a pointer to a char array containing the schemas */ 17571 int n_buffer; 17572 int size; /* the size of the array */ 17573 int n_size; 17574 17575 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 17576 for (n_size = 0;n_size < gen_nb_int;n_size++) { 17577 mem_base = xmlMemBlocks(); 17578 buffer = gen_const_char_ptr(n_buffer, 0); 17579 size = gen_int(n_size, 1); 17580 17581 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size); 17582 desret_xmlRelaxNGParserCtxtPtr(ret_val); 17583 call_tests++; 17584 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 17585 des_int(n_size, size, 1); 17586 xmlResetLastError(); 17587 if (mem_base != xmlMemBlocks()) { 17588 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt", 17589 xmlMemBlocks() - mem_base); 17590 test_ret++; 17591 printf(" %d", n_buffer); 17592 printf(" %d", n_size); 17593 printf("\n"); 17594 } 17595 } 17596 } 17597 function_tests++; 17598 #endif 17599 17600 return(test_ret); 17601 } 17602 17603 17604 static int 17605 test_xmlRelaxNGNewParserCtxt(void) { 17606 int test_ret = 0; 17607 17608 #if defined(LIBXML_SCHEMAS_ENABLED) 17609 int mem_base; 17610 xmlRelaxNGParserCtxtPtr ret_val; 17611 char * URL; /* the location of the schema */ 17612 int n_URL; 17613 17614 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) { 17615 mem_base = xmlMemBlocks(); 17616 URL = gen_const_char_ptr(n_URL, 0); 17617 17618 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL); 17619 desret_xmlRelaxNGParserCtxtPtr(ret_val); 17620 call_tests++; 17621 des_const_char_ptr(n_URL, (const char *)URL, 0); 17622 xmlResetLastError(); 17623 if (mem_base != xmlMemBlocks()) { 17624 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt", 17625 xmlMemBlocks() - mem_base); 17626 test_ret++; 17627 printf(" %d", n_URL); 17628 printf("\n"); 17629 } 17630 } 17631 function_tests++; 17632 #endif 17633 17634 return(test_ret); 17635 } 17636 17637 17638 static int 17639 test_xmlRelaxNGNewValidCtxt(void) { 17640 int test_ret = 0; 17641 17642 17643 /* missing type support */ 17644 return(test_ret); 17645 } 17646 17647 17648 static int 17649 test_xmlRelaxNGParse(void) { 17650 int test_ret = 0; 17651 17652 17653 /* missing type support */ 17654 return(test_ret); 17655 } 17656 17657 17658 static int 17659 test_xmlRelaxNGSetParserErrors(void) { 17660 int test_ret = 0; 17661 17662 17663 /* missing type support */ 17664 return(test_ret); 17665 } 17666 17667 17668 static int 17669 test_xmlRelaxNGSetParserStructuredErrors(void) { 17670 int test_ret = 0; 17671 17672 17673 /* missing type support */ 17674 return(test_ret); 17675 } 17676 17677 17678 static int 17679 test_xmlRelaxNGSetValidErrors(void) { 17680 int test_ret = 0; 17681 17682 17683 /* missing type support */ 17684 return(test_ret); 17685 } 17686 17687 17688 static int 17689 test_xmlRelaxNGSetValidStructuredErrors(void) { 17690 int test_ret = 0; 17691 17692 17693 /* missing type support */ 17694 return(test_ret); 17695 } 17696 17697 17698 static int 17699 test_xmlRelaxNGValidateDoc(void) { 17700 int test_ret = 0; 17701 17702 #if defined(LIBXML_SCHEMAS_ENABLED) 17703 int mem_base; 17704 int ret_val; 17705 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ 17706 int n_ctxt; 17707 xmlDocPtr doc; /* a parsed document tree */ 17708 int n_doc; 17709 17710 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17711 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17712 mem_base = xmlMemBlocks(); 17713 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17714 doc = gen_xmlDocPtr(n_doc, 1); 17715 17716 ret_val = xmlRelaxNGValidateDoc(ctxt, doc); 17717 desret_int(ret_val); 17718 call_tests++; 17719 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17720 des_xmlDocPtr(n_doc, doc, 1); 17721 xmlResetLastError(); 17722 if (mem_base != xmlMemBlocks()) { 17723 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc", 17724 xmlMemBlocks() - mem_base); 17725 test_ret++; 17726 printf(" %d", n_ctxt); 17727 printf(" %d", n_doc); 17728 printf("\n"); 17729 } 17730 } 17731 } 17732 function_tests++; 17733 #endif 17734 17735 return(test_ret); 17736 } 17737 17738 17739 static int 17740 test_xmlRelaxNGValidateFullElement(void) { 17741 int test_ret = 0; 17742 17743 #if defined(LIBXML_SCHEMAS_ENABLED) 17744 int mem_base; 17745 int ret_val; 17746 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ 17747 int n_ctxt; 17748 xmlDocPtr doc; /* a document instance */ 17749 int n_doc; 17750 xmlNodePtr elem; /* an element instance */ 17751 int n_elem; 17752 17753 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17754 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17755 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 17756 mem_base = xmlMemBlocks(); 17757 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17758 doc = gen_xmlDocPtr(n_doc, 1); 17759 elem = gen_xmlNodePtr(n_elem, 2); 17760 17761 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem); 17762 desret_int(ret_val); 17763 call_tests++; 17764 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17765 des_xmlDocPtr(n_doc, doc, 1); 17766 des_xmlNodePtr(n_elem, elem, 2); 17767 xmlResetLastError(); 17768 if (mem_base != xmlMemBlocks()) { 17769 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement", 17770 xmlMemBlocks() - mem_base); 17771 test_ret++; 17772 printf(" %d", n_ctxt); 17773 printf(" %d", n_doc); 17774 printf(" %d", n_elem); 17775 printf("\n"); 17776 } 17777 } 17778 } 17779 } 17780 function_tests++; 17781 #endif 17782 17783 return(test_ret); 17784 } 17785 17786 17787 static int 17788 test_xmlRelaxNGValidatePopElement(void) { 17789 int test_ret = 0; 17790 17791 #if defined(LIBXML_SCHEMAS_ENABLED) 17792 int mem_base; 17793 int ret_val; 17794 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ 17795 int n_ctxt; 17796 xmlDocPtr doc; /* a document instance */ 17797 int n_doc; 17798 xmlNodePtr elem; /* an element instance */ 17799 int n_elem; 17800 17801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17802 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17803 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 17804 mem_base = xmlMemBlocks(); 17805 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17806 doc = gen_xmlDocPtr(n_doc, 1); 17807 elem = gen_xmlNodePtr(n_elem, 2); 17808 17809 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem); 17810 desret_int(ret_val); 17811 call_tests++; 17812 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17813 des_xmlDocPtr(n_doc, doc, 1); 17814 des_xmlNodePtr(n_elem, elem, 2); 17815 xmlResetLastError(); 17816 if (mem_base != xmlMemBlocks()) { 17817 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement", 17818 xmlMemBlocks() - mem_base); 17819 test_ret++; 17820 printf(" %d", n_ctxt); 17821 printf(" %d", n_doc); 17822 printf(" %d", n_elem); 17823 printf("\n"); 17824 } 17825 } 17826 } 17827 } 17828 function_tests++; 17829 #endif 17830 17831 return(test_ret); 17832 } 17833 17834 17835 static int 17836 test_xmlRelaxNGValidatePushCData(void) { 17837 int test_ret = 0; 17838 17839 #if defined(LIBXML_SCHEMAS_ENABLED) 17840 int mem_base; 17841 int ret_val; 17842 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ 17843 int n_ctxt; 17844 xmlChar * data; /* some character data read */ 17845 int n_data; 17846 int len; /* the lenght of the data */ 17847 int n_len; 17848 17849 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17850 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { 17851 for (n_len = 0;n_len < gen_nb_int;n_len++) { 17852 mem_base = xmlMemBlocks(); 17853 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17854 data = gen_const_xmlChar_ptr(n_data, 1); 17855 len = gen_int(n_len, 2); 17856 17857 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len); 17858 desret_int(ret_val); 17859 call_tests++; 17860 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17861 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1); 17862 des_int(n_len, len, 2); 17863 xmlResetLastError(); 17864 if (mem_base != xmlMemBlocks()) { 17865 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData", 17866 xmlMemBlocks() - mem_base); 17867 test_ret++; 17868 printf(" %d", n_ctxt); 17869 printf(" %d", n_data); 17870 printf(" %d", n_len); 17871 printf("\n"); 17872 } 17873 } 17874 } 17875 } 17876 function_tests++; 17877 #endif 17878 17879 return(test_ret); 17880 } 17881 17882 17883 static int 17884 test_xmlRelaxNGValidatePushElement(void) { 17885 int test_ret = 0; 17886 17887 #if defined(LIBXML_SCHEMAS_ENABLED) 17888 int mem_base; 17889 int ret_val; 17890 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ 17891 int n_ctxt; 17892 xmlDocPtr doc; /* a document instance */ 17893 int n_doc; 17894 xmlNodePtr elem; /* an element instance */ 17895 int n_elem; 17896 17897 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { 17898 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 17899 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 17900 mem_base = xmlMemBlocks(); 17901 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); 17902 doc = gen_xmlDocPtr(n_doc, 1); 17903 elem = gen_xmlNodePtr(n_elem, 2); 17904 17905 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem); 17906 desret_int(ret_val); 17907 call_tests++; 17908 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); 17909 des_xmlDocPtr(n_doc, doc, 1); 17910 des_xmlNodePtr(n_elem, elem, 2); 17911 xmlResetLastError(); 17912 if (mem_base != xmlMemBlocks()) { 17913 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement", 17914 xmlMemBlocks() - mem_base); 17915 test_ret++; 17916 printf(" %d", n_ctxt); 17917 printf(" %d", n_doc); 17918 printf(" %d", n_elem); 17919 printf("\n"); 17920 } 17921 } 17922 } 17923 } 17924 function_tests++; 17925 #endif 17926 17927 return(test_ret); 17928 } 17929 17930 17931 static int 17932 test_xmlRelaxParserSetFlag(void) { 17933 int test_ret = 0; 17934 17935 #if defined(LIBXML_SCHEMAS_ENABLED) 17936 int mem_base; 17937 int ret_val; 17938 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */ 17939 int n_ctxt; 17940 int flags; /* a set of flags values */ 17941 int n_flags; 17942 17943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) { 17944 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 17945 mem_base = xmlMemBlocks(); 17946 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0); 17947 flags = gen_int(n_flags, 1); 17948 17949 ret_val = xmlRelaxParserSetFlag(ctxt, flags); 17950 desret_int(ret_val); 17951 call_tests++; 17952 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0); 17953 des_int(n_flags, flags, 1); 17954 xmlResetLastError(); 17955 if (mem_base != xmlMemBlocks()) { 17956 printf("Leak of %d blocks found in xmlRelaxParserSetFlag", 17957 xmlMemBlocks() - mem_base); 17958 test_ret++; 17959 printf(" %d", n_ctxt); 17960 printf(" %d", n_flags); 17961 printf("\n"); 17962 } 17963 } 17964 } 17965 function_tests++; 17966 #endif 17967 17968 return(test_ret); 17969 } 17970 17971 static int 17972 test_relaxng(void) { 17973 int test_ret = 0; 17974 17975 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n"); 17976 test_ret += test_xmlRelaxNGDump(); 17977 test_ret += test_xmlRelaxNGDumpTree(); 17978 test_ret += test_xmlRelaxNGGetParserErrors(); 17979 test_ret += test_xmlRelaxNGGetValidErrors(); 17980 test_ret += test_xmlRelaxNGInitTypes(); 17981 test_ret += test_xmlRelaxNGNewDocParserCtxt(); 17982 test_ret += test_xmlRelaxNGNewMemParserCtxt(); 17983 test_ret += test_xmlRelaxNGNewParserCtxt(); 17984 test_ret += test_xmlRelaxNGNewValidCtxt(); 17985 test_ret += test_xmlRelaxNGParse(); 17986 test_ret += test_xmlRelaxNGSetParserErrors(); 17987 test_ret += test_xmlRelaxNGSetParserStructuredErrors(); 17988 test_ret += test_xmlRelaxNGSetValidErrors(); 17989 test_ret += test_xmlRelaxNGSetValidStructuredErrors(); 17990 test_ret += test_xmlRelaxNGValidateDoc(); 17991 test_ret += test_xmlRelaxNGValidateFullElement(); 17992 test_ret += test_xmlRelaxNGValidatePopElement(); 17993 test_ret += test_xmlRelaxNGValidatePushCData(); 17994 test_ret += test_xmlRelaxNGValidatePushElement(); 17995 test_ret += test_xmlRelaxParserSetFlag(); 17996 17997 if (test_ret != 0) 17998 printf("Module relaxng: %d errors\n", test_ret); 17999 return(test_ret); 18000 } 18001 static int 18002 test_schemasInternals(void) { 18003 int test_ret = 0; 18004 18005 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n"); 18006 18007 if (test_ret != 0) 18008 printf("Module schemasInternals: %d errors\n", test_ret); 18009 return(test_ret); 18010 } 18011 18012 static int 18013 test_xmlSchematronNewDocParserCtxt(void) { 18014 int test_ret = 0; 18015 18016 18017 /* missing type support */ 18018 return(test_ret); 18019 } 18020 18021 18022 static int 18023 test_xmlSchematronNewMemParserCtxt(void) { 18024 int test_ret = 0; 18025 18026 18027 /* missing type support */ 18028 return(test_ret); 18029 } 18030 18031 18032 static int 18033 test_xmlSchematronNewParserCtxt(void) { 18034 int test_ret = 0; 18035 18036 18037 /* missing type support */ 18038 return(test_ret); 18039 } 18040 18041 #ifdef LIBXML_SCHEMATRON_ENABLED 18042 18043 #define gen_nb_xmlSchematronPtr 1 18044 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18045 return(NULL); 18046 } 18047 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18048 } 18049 #endif 18050 18051 18052 static int 18053 test_xmlSchematronNewValidCtxt(void) { 18054 int test_ret = 0; 18055 18056 18057 /* missing type support */ 18058 return(test_ret); 18059 } 18060 18061 #ifdef LIBXML_SCHEMATRON_ENABLED 18062 18063 #define gen_nb_xmlSchematronParserCtxtPtr 1 18064 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18065 return(NULL); 18066 } 18067 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18068 } 18069 #endif 18070 18071 18072 static int 18073 test_xmlSchematronParse(void) { 18074 int test_ret = 0; 18075 18076 18077 /* missing type support */ 18078 return(test_ret); 18079 } 18080 18081 #ifdef LIBXML_SCHEMATRON_ENABLED 18082 18083 #define gen_nb_xmlSchematronValidCtxtPtr 1 18084 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18085 return(NULL); 18086 } 18087 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18088 } 18089 #endif 18090 18091 18092 static int 18093 test_xmlSchematronSetValidStructuredErrors(void) { 18094 int test_ret = 0; 18095 18096 18097 /* missing type support */ 18098 return(test_ret); 18099 } 18100 18101 18102 static int 18103 test_xmlSchematronValidateDoc(void) { 18104 int test_ret = 0; 18105 18106 #if defined(LIBXML_SCHEMATRON_ENABLED) 18107 int mem_base; 18108 int ret_val; 18109 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */ 18110 int n_ctxt; 18111 xmlDocPtr instance; /* the document instace tree */ 18112 int n_instance; 18113 18114 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) { 18115 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) { 18116 mem_base = xmlMemBlocks(); 18117 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0); 18118 instance = gen_xmlDocPtr(n_instance, 1); 18119 18120 ret_val = xmlSchematronValidateDoc(ctxt, instance); 18121 desret_int(ret_val); 18122 call_tests++; 18123 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0); 18124 des_xmlDocPtr(n_instance, instance, 1); 18125 xmlResetLastError(); 18126 if (mem_base != xmlMemBlocks()) { 18127 printf("Leak of %d blocks found in xmlSchematronValidateDoc", 18128 xmlMemBlocks() - mem_base); 18129 test_ret++; 18130 printf(" %d", n_ctxt); 18131 printf(" %d", n_instance); 18132 printf("\n"); 18133 } 18134 } 18135 } 18136 function_tests++; 18137 #endif 18138 18139 return(test_ret); 18140 } 18141 18142 static int 18143 test_schematron(void) { 18144 int test_ret = 0; 18145 18146 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n"); 18147 test_ret += test_xmlSchematronNewDocParserCtxt(); 18148 test_ret += test_xmlSchematronNewMemParserCtxt(); 18149 test_ret += test_xmlSchematronNewParserCtxt(); 18150 test_ret += test_xmlSchematronNewValidCtxt(); 18151 test_ret += test_xmlSchematronParse(); 18152 test_ret += test_xmlSchematronSetValidStructuredErrors(); 18153 test_ret += test_xmlSchematronValidateDoc(); 18154 18155 if (test_ret != 0) 18156 printf("Module schematron: %d errors\n", test_ret); 18157 return(test_ret); 18158 } 18159 18160 static int 18161 test_xmlAddChild(void) { 18162 int test_ret = 0; 18163 18164 int mem_base; 18165 xmlNodePtr ret_val; 18166 xmlNodePtr parent; /* the parent node */ 18167 int n_parent; 18168 xmlNodePtr cur; /* the child node */ 18169 int n_cur; 18170 18171 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 18172 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { 18173 mem_base = xmlMemBlocks(); 18174 parent = gen_xmlNodePtr(n_parent, 0); 18175 cur = gen_xmlNodePtr_in(n_cur, 1); 18176 18177 ret_val = xmlAddChild(parent, cur); 18178 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; } 18179 desret_xmlNodePtr(ret_val); 18180 call_tests++; 18181 des_xmlNodePtr(n_parent, parent, 0); 18182 des_xmlNodePtr_in(n_cur, cur, 1); 18183 xmlResetLastError(); 18184 if (mem_base != xmlMemBlocks()) { 18185 printf("Leak of %d blocks found in xmlAddChild", 18186 xmlMemBlocks() - mem_base); 18187 test_ret++; 18188 printf(" %d", n_parent); 18189 printf(" %d", n_cur); 18190 printf("\n"); 18191 } 18192 } 18193 } 18194 function_tests++; 18195 18196 return(test_ret); 18197 } 18198 18199 18200 static int 18201 test_xmlAddChildList(void) { 18202 int test_ret = 0; 18203 18204 int mem_base; 18205 xmlNodePtr ret_val; 18206 xmlNodePtr parent; /* the parent node */ 18207 int n_parent; 18208 xmlNodePtr cur; /* the first node in the list */ 18209 int n_cur; 18210 18211 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 18212 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { 18213 mem_base = xmlMemBlocks(); 18214 parent = gen_xmlNodePtr(n_parent, 0); 18215 cur = gen_xmlNodePtr_in(n_cur, 1); 18216 18217 ret_val = xmlAddChildList(parent, cur); 18218 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; } 18219 desret_xmlNodePtr(ret_val); 18220 call_tests++; 18221 des_xmlNodePtr(n_parent, parent, 0); 18222 des_xmlNodePtr_in(n_cur, cur, 1); 18223 xmlResetLastError(); 18224 if (mem_base != xmlMemBlocks()) { 18225 printf("Leak of %d blocks found in xmlAddChildList", 18226 xmlMemBlocks() - mem_base); 18227 test_ret++; 18228 printf(" %d", n_parent); 18229 printf(" %d", n_cur); 18230 printf("\n"); 18231 } 18232 } 18233 } 18234 function_tests++; 18235 18236 return(test_ret); 18237 } 18238 18239 18240 static int 18241 test_xmlAddNextSibling(void) { 18242 int test_ret = 0; 18243 18244 int mem_base; 18245 xmlNodePtr ret_val; 18246 xmlNodePtr cur; /* the child node */ 18247 int n_cur; 18248 xmlNodePtr elem; /* the new node */ 18249 int n_elem; 18250 18251 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 18252 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { 18253 mem_base = xmlMemBlocks(); 18254 cur = gen_xmlNodePtr(n_cur, 0); 18255 elem = gen_xmlNodePtr_in(n_elem, 1); 18256 18257 ret_val = xmlAddNextSibling(cur, elem); 18258 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } 18259 desret_xmlNodePtr(ret_val); 18260 call_tests++; 18261 des_xmlNodePtr(n_cur, cur, 0); 18262 des_xmlNodePtr_in(n_elem, elem, 1); 18263 xmlResetLastError(); 18264 if (mem_base != xmlMemBlocks()) { 18265 printf("Leak of %d blocks found in xmlAddNextSibling", 18266 xmlMemBlocks() - mem_base); 18267 test_ret++; 18268 printf(" %d", n_cur); 18269 printf(" %d", n_elem); 18270 printf("\n"); 18271 } 18272 } 18273 } 18274 function_tests++; 18275 18276 return(test_ret); 18277 } 18278 18279 18280 static int 18281 test_xmlAddPrevSibling(void) { 18282 int test_ret = 0; 18283 18284 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 18285 int mem_base; 18286 xmlNodePtr ret_val; 18287 xmlNodePtr cur; /* the child node */ 18288 int n_cur; 18289 xmlNodePtr elem; /* the new node */ 18290 int n_elem; 18291 18292 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 18293 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { 18294 mem_base = xmlMemBlocks(); 18295 cur = gen_xmlNodePtr(n_cur, 0); 18296 elem = gen_xmlNodePtr_in(n_elem, 1); 18297 18298 ret_val = xmlAddPrevSibling(cur, elem); 18299 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } 18300 desret_xmlNodePtr(ret_val); 18301 call_tests++; 18302 des_xmlNodePtr(n_cur, cur, 0); 18303 des_xmlNodePtr_in(n_elem, elem, 1); 18304 xmlResetLastError(); 18305 if (mem_base != xmlMemBlocks()) { 18306 printf("Leak of %d blocks found in xmlAddPrevSibling", 18307 xmlMemBlocks() - mem_base); 18308 test_ret++; 18309 printf(" %d", n_cur); 18310 printf(" %d", n_elem); 18311 printf("\n"); 18312 } 18313 } 18314 } 18315 function_tests++; 18316 #endif 18317 18318 return(test_ret); 18319 } 18320 18321 18322 static int 18323 test_xmlAddSibling(void) { 18324 int test_ret = 0; 18325 18326 int mem_base; 18327 xmlNodePtr ret_val; 18328 xmlNodePtr cur; /* the child node */ 18329 int n_cur; 18330 xmlNodePtr elem; /* the new node */ 18331 int n_elem; 18332 18333 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 18334 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { 18335 mem_base = xmlMemBlocks(); 18336 cur = gen_xmlNodePtr(n_cur, 0); 18337 elem = gen_xmlNodePtr_in(n_elem, 1); 18338 18339 ret_val = xmlAddSibling(cur, elem); 18340 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } 18341 desret_xmlNodePtr(ret_val); 18342 call_tests++; 18343 des_xmlNodePtr(n_cur, cur, 0); 18344 des_xmlNodePtr_in(n_elem, elem, 1); 18345 xmlResetLastError(); 18346 if (mem_base != xmlMemBlocks()) { 18347 printf("Leak of %d blocks found in xmlAddSibling", 18348 xmlMemBlocks() - mem_base); 18349 test_ret++; 18350 printf(" %d", n_cur); 18351 printf(" %d", n_elem); 18352 printf("\n"); 18353 } 18354 } 18355 } 18356 function_tests++; 18357 18358 return(test_ret); 18359 } 18360 18361 18362 static int 18363 test_xmlAttrSerializeTxtContent(void) { 18364 int test_ret = 0; 18365 18366 #if defined(LIBXML_OUTPUT_ENABLED) 18367 #ifdef LIBXML_OUTPUT_ENABLED 18368 int mem_base; 18369 xmlBufferPtr buf; /* the XML buffer output */ 18370 int n_buf; 18371 xmlDocPtr doc; /* the document */ 18372 int n_doc; 18373 xmlAttrPtr attr; /* the attribute node */ 18374 int n_attr; 18375 xmlChar * string; /* the text content */ 18376 int n_string; 18377 18378 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18379 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 18380 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 18381 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 18382 mem_base = xmlMemBlocks(); 18383 buf = gen_xmlBufferPtr(n_buf, 0); 18384 doc = gen_xmlDocPtr(n_doc, 1); 18385 attr = gen_xmlAttrPtr(n_attr, 2); 18386 string = gen_const_xmlChar_ptr(n_string, 3); 18387 18388 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string); 18389 call_tests++; 18390 des_xmlBufferPtr(n_buf, buf, 0); 18391 des_xmlDocPtr(n_doc, doc, 1); 18392 des_xmlAttrPtr(n_attr, attr, 2); 18393 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3); 18394 xmlResetLastError(); 18395 if (mem_base != xmlMemBlocks()) { 18396 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent", 18397 xmlMemBlocks() - mem_base); 18398 test_ret++; 18399 printf(" %d", n_buf); 18400 printf(" %d", n_doc); 18401 printf(" %d", n_attr); 18402 printf(" %d", n_string); 18403 printf("\n"); 18404 } 18405 } 18406 } 18407 } 18408 } 18409 function_tests++; 18410 #endif 18411 #endif 18412 18413 return(test_ret); 18414 } 18415 18416 18417 static int 18418 test_xmlBufferAdd(void) { 18419 int test_ret = 0; 18420 18421 int mem_base; 18422 int ret_val; 18423 xmlBufferPtr buf; /* the buffer to dump */ 18424 int n_buf; 18425 xmlChar * str; /* the #xmlChar string */ 18426 int n_str; 18427 int len; /* the number of #xmlChar to add */ 18428 int n_len; 18429 18430 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18431 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 18432 for (n_len = 0;n_len < gen_nb_int;n_len++) { 18433 mem_base = xmlMemBlocks(); 18434 buf = gen_xmlBufferPtr(n_buf, 0); 18435 str = gen_const_xmlChar_ptr(n_str, 1); 18436 len = gen_int(n_len, 2); 18437 18438 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len); 18439 desret_int(ret_val); 18440 call_tests++; 18441 des_xmlBufferPtr(n_buf, buf, 0); 18442 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 18443 des_int(n_len, len, 2); 18444 xmlResetLastError(); 18445 if (mem_base != xmlMemBlocks()) { 18446 printf("Leak of %d blocks found in xmlBufferAdd", 18447 xmlMemBlocks() - mem_base); 18448 test_ret++; 18449 printf(" %d", n_buf); 18450 printf(" %d", n_str); 18451 printf(" %d", n_len); 18452 printf("\n"); 18453 } 18454 } 18455 } 18456 } 18457 function_tests++; 18458 18459 return(test_ret); 18460 } 18461 18462 18463 static int 18464 test_xmlBufferAddHead(void) { 18465 int test_ret = 0; 18466 18467 int mem_base; 18468 int ret_val; 18469 xmlBufferPtr buf; /* the buffer */ 18470 int n_buf; 18471 xmlChar * str; /* the #xmlChar string */ 18472 int n_str; 18473 int len; /* the number of #xmlChar to add */ 18474 int n_len; 18475 18476 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18477 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 18478 for (n_len = 0;n_len < gen_nb_int;n_len++) { 18479 mem_base = xmlMemBlocks(); 18480 buf = gen_xmlBufferPtr(n_buf, 0); 18481 str = gen_const_xmlChar_ptr(n_str, 1); 18482 len = gen_int(n_len, 2); 18483 18484 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len); 18485 desret_int(ret_val); 18486 call_tests++; 18487 des_xmlBufferPtr(n_buf, buf, 0); 18488 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 18489 des_int(n_len, len, 2); 18490 xmlResetLastError(); 18491 if (mem_base != xmlMemBlocks()) { 18492 printf("Leak of %d blocks found in xmlBufferAddHead", 18493 xmlMemBlocks() - mem_base); 18494 test_ret++; 18495 printf(" %d", n_buf); 18496 printf(" %d", n_str); 18497 printf(" %d", n_len); 18498 printf("\n"); 18499 } 18500 } 18501 } 18502 } 18503 function_tests++; 18504 18505 return(test_ret); 18506 } 18507 18508 18509 static int 18510 test_xmlBufferCCat(void) { 18511 int test_ret = 0; 18512 18513 int mem_base; 18514 int ret_val; 18515 xmlBufferPtr buf; /* the buffer to dump */ 18516 int n_buf; 18517 char * str; /* the C char string */ 18518 int n_str; 18519 18520 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18521 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { 18522 mem_base = xmlMemBlocks(); 18523 buf = gen_xmlBufferPtr(n_buf, 0); 18524 str = gen_const_char_ptr(n_str, 1); 18525 18526 ret_val = xmlBufferCCat(buf, (const char *)str); 18527 desret_int(ret_val); 18528 call_tests++; 18529 des_xmlBufferPtr(n_buf, buf, 0); 18530 des_const_char_ptr(n_str, (const char *)str, 1); 18531 xmlResetLastError(); 18532 if (mem_base != xmlMemBlocks()) { 18533 printf("Leak of %d blocks found in xmlBufferCCat", 18534 xmlMemBlocks() - mem_base); 18535 test_ret++; 18536 printf(" %d", n_buf); 18537 printf(" %d", n_str); 18538 printf("\n"); 18539 } 18540 } 18541 } 18542 function_tests++; 18543 18544 return(test_ret); 18545 } 18546 18547 18548 static int 18549 test_xmlBufferCat(void) { 18550 int test_ret = 0; 18551 18552 int mem_base; 18553 int ret_val; 18554 xmlBufferPtr buf; /* the buffer to add to */ 18555 int n_buf; 18556 xmlChar * str; /* the #xmlChar string */ 18557 int n_str; 18558 18559 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18560 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 18561 mem_base = xmlMemBlocks(); 18562 buf = gen_xmlBufferPtr(n_buf, 0); 18563 str = gen_const_xmlChar_ptr(n_str, 1); 18564 18565 ret_val = xmlBufferCat(buf, (const xmlChar *)str); 18566 desret_int(ret_val); 18567 call_tests++; 18568 des_xmlBufferPtr(n_buf, buf, 0); 18569 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); 18570 xmlResetLastError(); 18571 if (mem_base != xmlMemBlocks()) { 18572 printf("Leak of %d blocks found in xmlBufferCat", 18573 xmlMemBlocks() - mem_base); 18574 test_ret++; 18575 printf(" %d", n_buf); 18576 printf(" %d", n_str); 18577 printf("\n"); 18578 } 18579 } 18580 } 18581 function_tests++; 18582 18583 return(test_ret); 18584 } 18585 18586 18587 #define gen_nb_const_xmlBufferPtr 1 18588 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18589 return(NULL); 18590 } 18591 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 18592 } 18593 18594 static int 18595 test_xmlBufferContent(void) { 18596 int test_ret = 0; 18597 18598 int mem_base; 18599 const xmlChar * ret_val; 18600 xmlBufferPtr buf; /* the buffer */ 18601 int n_buf; 18602 18603 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) { 18604 mem_base = xmlMemBlocks(); 18605 buf = gen_const_xmlBufferPtr(n_buf, 0); 18606 18607 ret_val = xmlBufferContent((const xmlBufferPtr)buf); 18608 desret_const_xmlChar_ptr(ret_val); 18609 call_tests++; 18610 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0); 18611 xmlResetLastError(); 18612 if (mem_base != xmlMemBlocks()) { 18613 printf("Leak of %d blocks found in xmlBufferContent", 18614 xmlMemBlocks() - mem_base); 18615 test_ret++; 18616 printf(" %d", n_buf); 18617 printf("\n"); 18618 } 18619 } 18620 function_tests++; 18621 18622 return(test_ret); 18623 } 18624 18625 18626 static int 18627 test_xmlBufferCreate(void) { 18628 int test_ret = 0; 18629 18630 int mem_base; 18631 xmlBufferPtr ret_val; 18632 18633 mem_base = xmlMemBlocks(); 18634 18635 ret_val = xmlBufferCreate(); 18636 desret_xmlBufferPtr(ret_val); 18637 call_tests++; 18638 xmlResetLastError(); 18639 if (mem_base != xmlMemBlocks()) { 18640 printf("Leak of %d blocks found in xmlBufferCreate", 18641 xmlMemBlocks() - mem_base); 18642 test_ret++; 18643 printf("\n"); 18644 } 18645 function_tests++; 18646 18647 return(test_ret); 18648 } 18649 18650 18651 static int 18652 test_xmlBufferCreateSize(void) { 18653 int test_ret = 0; 18654 18655 18656 /* missing type support */ 18657 return(test_ret); 18658 } 18659 18660 18661 static int 18662 test_xmlBufferCreateStatic(void) { 18663 int test_ret = 0; 18664 18665 18666 /* missing type support */ 18667 return(test_ret); 18668 } 18669 18670 18671 static int 18672 test_xmlBufferEmpty(void) { 18673 int test_ret = 0; 18674 18675 int mem_base; 18676 xmlBufferPtr buf; /* the buffer */ 18677 int n_buf; 18678 18679 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18680 mem_base = xmlMemBlocks(); 18681 buf = gen_xmlBufferPtr(n_buf, 0); 18682 18683 xmlBufferEmpty(buf); 18684 call_tests++; 18685 des_xmlBufferPtr(n_buf, buf, 0); 18686 xmlResetLastError(); 18687 if (mem_base != xmlMemBlocks()) { 18688 printf("Leak of %d blocks found in xmlBufferEmpty", 18689 xmlMemBlocks() - mem_base); 18690 test_ret++; 18691 printf(" %d", n_buf); 18692 printf("\n"); 18693 } 18694 } 18695 function_tests++; 18696 18697 return(test_ret); 18698 } 18699 18700 18701 static int 18702 test_xmlBufferGrow(void) { 18703 int test_ret = 0; 18704 18705 int mem_base; 18706 int ret_val; 18707 xmlBufferPtr buf; /* the buffer */ 18708 int n_buf; 18709 unsigned int len; /* the minimum free size to allocate */ 18710 int n_len; 18711 18712 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18713 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) { 18714 mem_base = xmlMemBlocks(); 18715 buf = gen_xmlBufferPtr(n_buf, 0); 18716 len = gen_unsigned_int(n_len, 1); 18717 18718 ret_val = xmlBufferGrow(buf, len); 18719 desret_int(ret_val); 18720 call_tests++; 18721 des_xmlBufferPtr(n_buf, buf, 0); 18722 des_unsigned_int(n_len, len, 1); 18723 xmlResetLastError(); 18724 if (mem_base != xmlMemBlocks()) { 18725 printf("Leak of %d blocks found in xmlBufferGrow", 18726 xmlMemBlocks() - mem_base); 18727 test_ret++; 18728 printf(" %d", n_buf); 18729 printf(" %d", n_len); 18730 printf("\n"); 18731 } 18732 } 18733 } 18734 function_tests++; 18735 18736 return(test_ret); 18737 } 18738 18739 18740 static int 18741 test_xmlBufferLength(void) { 18742 int test_ret = 0; 18743 18744 int mem_base; 18745 int ret_val; 18746 xmlBufferPtr buf; /* the buffer */ 18747 int n_buf; 18748 18749 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) { 18750 mem_base = xmlMemBlocks(); 18751 buf = gen_const_xmlBufferPtr(n_buf, 0); 18752 18753 ret_val = xmlBufferLength((const xmlBufferPtr)buf); 18754 desret_int(ret_val); 18755 call_tests++; 18756 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0); 18757 xmlResetLastError(); 18758 if (mem_base != xmlMemBlocks()) { 18759 printf("Leak of %d blocks found in xmlBufferLength", 18760 xmlMemBlocks() - mem_base); 18761 test_ret++; 18762 printf(" %d", n_buf); 18763 printf("\n"); 18764 } 18765 } 18766 function_tests++; 18767 18768 return(test_ret); 18769 } 18770 18771 18772 static int 18773 test_xmlBufferResize(void) { 18774 int test_ret = 0; 18775 18776 int mem_base; 18777 int ret_val; 18778 xmlBufferPtr buf; /* the buffer to resize */ 18779 int n_buf; 18780 unsigned int size; /* the desired size */ 18781 int n_size; 18782 18783 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18784 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) { 18785 mem_base = xmlMemBlocks(); 18786 buf = gen_xmlBufferPtr(n_buf, 0); 18787 size = gen_unsigned_int(n_size, 1); 18788 18789 ret_val = xmlBufferResize(buf, size); 18790 desret_int(ret_val); 18791 call_tests++; 18792 des_xmlBufferPtr(n_buf, buf, 0); 18793 des_unsigned_int(n_size, size, 1); 18794 xmlResetLastError(); 18795 if (mem_base != xmlMemBlocks()) { 18796 printf("Leak of %d blocks found in xmlBufferResize", 18797 xmlMemBlocks() - mem_base); 18798 test_ret++; 18799 printf(" %d", n_buf); 18800 printf(" %d", n_size); 18801 printf("\n"); 18802 } 18803 } 18804 } 18805 function_tests++; 18806 18807 return(test_ret); 18808 } 18809 18810 18811 static int 18812 test_xmlBufferSetAllocationScheme(void) { 18813 int test_ret = 0; 18814 18815 int mem_base; 18816 xmlBufferPtr buf; /* the buffer to tune */ 18817 int n_buf; 18818 xmlBufferAllocationScheme scheme; /* allocation scheme to use */ 18819 int n_scheme; 18820 18821 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18822 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) { 18823 mem_base = xmlMemBlocks(); 18824 buf = gen_xmlBufferPtr(n_buf, 0); 18825 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1); 18826 18827 xmlBufferSetAllocationScheme(buf, scheme); 18828 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;} 18829 call_tests++; 18830 des_xmlBufferPtr(n_buf, buf, 0); 18831 des_xmlBufferAllocationScheme(n_scheme, scheme, 1); 18832 xmlResetLastError(); 18833 if (mem_base != xmlMemBlocks()) { 18834 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme", 18835 xmlMemBlocks() - mem_base); 18836 test_ret++; 18837 printf(" %d", n_buf); 18838 printf(" %d", n_scheme); 18839 printf("\n"); 18840 } 18841 } 18842 } 18843 function_tests++; 18844 18845 return(test_ret); 18846 } 18847 18848 18849 static int 18850 test_xmlBufferShrink(void) { 18851 int test_ret = 0; 18852 18853 int mem_base; 18854 int ret_val; 18855 xmlBufferPtr buf; /* the buffer to dump */ 18856 int n_buf; 18857 unsigned int len; /* the number of xmlChar to remove */ 18858 int n_len; 18859 18860 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18861 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) { 18862 mem_base = xmlMemBlocks(); 18863 buf = gen_xmlBufferPtr(n_buf, 0); 18864 len = gen_unsigned_int(n_len, 1); 18865 18866 ret_val = xmlBufferShrink(buf, len); 18867 desret_int(ret_val); 18868 call_tests++; 18869 des_xmlBufferPtr(n_buf, buf, 0); 18870 des_unsigned_int(n_len, len, 1); 18871 xmlResetLastError(); 18872 if (mem_base != xmlMemBlocks()) { 18873 printf("Leak of %d blocks found in xmlBufferShrink", 18874 xmlMemBlocks() - mem_base); 18875 test_ret++; 18876 printf(" %d", n_buf); 18877 printf(" %d", n_len); 18878 printf("\n"); 18879 } 18880 } 18881 } 18882 function_tests++; 18883 18884 return(test_ret); 18885 } 18886 18887 18888 static int 18889 test_xmlBufferWriteCHAR(void) { 18890 int test_ret = 0; 18891 18892 int mem_base; 18893 xmlBufferPtr buf; /* the XML buffer */ 18894 int n_buf; 18895 xmlChar * string; /* the string to add */ 18896 int n_string; 18897 18898 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18899 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 18900 mem_base = xmlMemBlocks(); 18901 buf = gen_xmlBufferPtr(n_buf, 0); 18902 string = gen_const_xmlChar_ptr(n_string, 1); 18903 18904 xmlBufferWriteCHAR(buf, (const xmlChar *)string); 18905 call_tests++; 18906 des_xmlBufferPtr(n_buf, buf, 0); 18907 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1); 18908 xmlResetLastError(); 18909 if (mem_base != xmlMemBlocks()) { 18910 printf("Leak of %d blocks found in xmlBufferWriteCHAR", 18911 xmlMemBlocks() - mem_base); 18912 test_ret++; 18913 printf(" %d", n_buf); 18914 printf(" %d", n_string); 18915 printf("\n"); 18916 } 18917 } 18918 } 18919 function_tests++; 18920 18921 return(test_ret); 18922 } 18923 18924 18925 static int 18926 test_xmlBufferWriteChar(void) { 18927 int test_ret = 0; 18928 18929 int mem_base; 18930 xmlBufferPtr buf; /* the XML buffer output */ 18931 int n_buf; 18932 char * string; /* the string to add */ 18933 int n_string; 18934 18935 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18936 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) { 18937 mem_base = xmlMemBlocks(); 18938 buf = gen_xmlBufferPtr(n_buf, 0); 18939 string = gen_const_char_ptr(n_string, 1); 18940 18941 xmlBufferWriteChar(buf, (const char *)string); 18942 call_tests++; 18943 des_xmlBufferPtr(n_buf, buf, 0); 18944 des_const_char_ptr(n_string, (const char *)string, 1); 18945 xmlResetLastError(); 18946 if (mem_base != xmlMemBlocks()) { 18947 printf("Leak of %d blocks found in xmlBufferWriteChar", 18948 xmlMemBlocks() - mem_base); 18949 test_ret++; 18950 printf(" %d", n_buf); 18951 printf(" %d", n_string); 18952 printf("\n"); 18953 } 18954 } 18955 } 18956 function_tests++; 18957 18958 return(test_ret); 18959 } 18960 18961 18962 static int 18963 test_xmlBufferWriteQuotedString(void) { 18964 int test_ret = 0; 18965 18966 int mem_base; 18967 xmlBufferPtr buf; /* the XML buffer output */ 18968 int n_buf; 18969 xmlChar * string; /* the string to add */ 18970 int n_string; 18971 18972 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 18973 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { 18974 mem_base = xmlMemBlocks(); 18975 buf = gen_xmlBufferPtr(n_buf, 0); 18976 string = gen_const_xmlChar_ptr(n_string, 1); 18977 18978 xmlBufferWriteQuotedString(buf, (const xmlChar *)string); 18979 call_tests++; 18980 des_xmlBufferPtr(n_buf, buf, 0); 18981 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1); 18982 xmlResetLastError(); 18983 if (mem_base != xmlMemBlocks()) { 18984 printf("Leak of %d blocks found in xmlBufferWriteQuotedString", 18985 xmlMemBlocks() - mem_base); 18986 test_ret++; 18987 printf(" %d", n_buf); 18988 printf(" %d", n_string); 18989 printf("\n"); 18990 } 18991 } 18992 } 18993 function_tests++; 18994 18995 return(test_ret); 18996 } 18997 18998 18999 static int 19000 test_xmlBuildQName(void) { 19001 int test_ret = 0; 19002 19003 int mem_base; 19004 xmlChar * ret_val; 19005 xmlChar * ncname; /* the Name */ 19006 int n_ncname; 19007 xmlChar * prefix; /* the prefix */ 19008 int n_prefix; 19009 xmlChar * memory; /* preallocated memory */ 19010 int n_memory; 19011 int len; /* preallocated memory length */ 19012 int n_len; 19013 19014 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) { 19015 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 19016 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) { 19017 for (n_len = 0;n_len < gen_nb_int;n_len++) { 19018 mem_base = xmlMemBlocks(); 19019 ncname = gen_const_xmlChar_ptr(n_ncname, 0); 19020 prefix = gen_const_xmlChar_ptr(n_prefix, 1); 19021 memory = gen_xmlChar_ptr(n_memory, 2); 19022 len = gen_int(n_len, 3); 19023 19024 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len); 19025 if ((ret_val != NULL) && (ret_val != ncname) && 19026 (ret_val != prefix) && (ret_val != memory)) 19027 xmlFree(ret_val); 19028 ret_val = NULL; 19029 desret_xmlChar_ptr(ret_val); 19030 call_tests++; 19031 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0); 19032 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); 19033 des_xmlChar_ptr(n_memory, memory, 2); 19034 des_int(n_len, len, 3); 19035 xmlResetLastError(); 19036 if (mem_base != xmlMemBlocks()) { 19037 printf("Leak of %d blocks found in xmlBuildQName", 19038 xmlMemBlocks() - mem_base); 19039 test_ret++; 19040 printf(" %d", n_ncname); 19041 printf(" %d", n_prefix); 19042 printf(" %d", n_memory); 19043 printf(" %d", n_len); 19044 printf("\n"); 19045 } 19046 } 19047 } 19048 } 19049 } 19050 function_tests++; 19051 19052 return(test_ret); 19053 } 19054 19055 19056 static int 19057 test_xmlChildElementCount(void) { 19058 int test_ret = 0; 19059 19060 #if defined(LIBXML_TREE_ENABLED) 19061 int mem_base; 19062 unsigned long ret_val; 19063 xmlNodePtr parent; /* the parent node */ 19064 int n_parent; 19065 19066 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 19067 mem_base = xmlMemBlocks(); 19068 parent = gen_xmlNodePtr(n_parent, 0); 19069 19070 ret_val = xmlChildElementCount(parent); 19071 desret_unsigned_long(ret_val); 19072 call_tests++; 19073 des_xmlNodePtr(n_parent, parent, 0); 19074 xmlResetLastError(); 19075 if (mem_base != xmlMemBlocks()) { 19076 printf("Leak of %d blocks found in xmlChildElementCount", 19077 xmlMemBlocks() - mem_base); 19078 test_ret++; 19079 printf(" %d", n_parent); 19080 printf("\n"); 19081 } 19082 } 19083 function_tests++; 19084 #endif 19085 19086 return(test_ret); 19087 } 19088 19089 19090 static int 19091 test_xmlCopyDoc(void) { 19092 int test_ret = 0; 19093 19094 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 19095 int mem_base; 19096 xmlDocPtr ret_val; 19097 xmlDocPtr doc; /* the document */ 19098 int n_doc; 19099 int recursive; /* if not zero do a recursive copy. */ 19100 int n_recursive; 19101 19102 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19103 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) { 19104 mem_base = xmlMemBlocks(); 19105 doc = gen_xmlDocPtr(n_doc, 0); 19106 recursive = gen_int(n_recursive, 1); 19107 19108 ret_val = xmlCopyDoc(doc, recursive); 19109 desret_xmlDocPtr(ret_val); 19110 call_tests++; 19111 des_xmlDocPtr(n_doc, doc, 0); 19112 des_int(n_recursive, recursive, 1); 19113 xmlResetLastError(); 19114 if (mem_base != xmlMemBlocks()) { 19115 printf("Leak of %d blocks found in xmlCopyDoc", 19116 xmlMemBlocks() - mem_base); 19117 test_ret++; 19118 printf(" %d", n_doc); 19119 printf(" %d", n_recursive); 19120 printf("\n"); 19121 } 19122 } 19123 } 19124 function_tests++; 19125 #endif 19126 19127 return(test_ret); 19128 } 19129 19130 19131 static int 19132 test_xmlCopyDtd(void) { 19133 int test_ret = 0; 19134 19135 #if defined(LIBXML_TREE_ENABLED) 19136 int mem_base; 19137 xmlDtdPtr ret_val; 19138 xmlDtdPtr dtd; /* the dtd */ 19139 int n_dtd; 19140 19141 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 19142 mem_base = xmlMemBlocks(); 19143 dtd = gen_xmlDtdPtr(n_dtd, 0); 19144 19145 ret_val = xmlCopyDtd(dtd); 19146 desret_xmlDtdPtr(ret_val); 19147 call_tests++; 19148 des_xmlDtdPtr(n_dtd, dtd, 0); 19149 xmlResetLastError(); 19150 if (mem_base != xmlMemBlocks()) { 19151 printf("Leak of %d blocks found in xmlCopyDtd", 19152 xmlMemBlocks() - mem_base); 19153 test_ret++; 19154 printf(" %d", n_dtd); 19155 printf("\n"); 19156 } 19157 } 19158 function_tests++; 19159 #endif 19160 19161 return(test_ret); 19162 } 19163 19164 19165 static int 19166 test_xmlCopyNamespace(void) { 19167 int test_ret = 0; 19168 19169 int mem_base; 19170 xmlNsPtr ret_val; 19171 xmlNsPtr cur; /* the namespace */ 19172 int n_cur; 19173 19174 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) { 19175 mem_base = xmlMemBlocks(); 19176 cur = gen_xmlNsPtr(n_cur, 0); 19177 19178 ret_val = xmlCopyNamespace(cur); 19179 if (ret_val != NULL) xmlFreeNs(ret_val); 19180 desret_xmlNsPtr(ret_val); 19181 call_tests++; 19182 des_xmlNsPtr(n_cur, cur, 0); 19183 xmlResetLastError(); 19184 if (mem_base != xmlMemBlocks()) { 19185 printf("Leak of %d blocks found in xmlCopyNamespace", 19186 xmlMemBlocks() - mem_base); 19187 test_ret++; 19188 printf(" %d", n_cur); 19189 printf("\n"); 19190 } 19191 } 19192 function_tests++; 19193 19194 return(test_ret); 19195 } 19196 19197 19198 static int 19199 test_xmlCopyNamespaceList(void) { 19200 int test_ret = 0; 19201 19202 int mem_base; 19203 xmlNsPtr ret_val; 19204 xmlNsPtr cur; /* the first namespace */ 19205 int n_cur; 19206 19207 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) { 19208 mem_base = xmlMemBlocks(); 19209 cur = gen_xmlNsPtr(n_cur, 0); 19210 19211 ret_val = xmlCopyNamespaceList(cur); 19212 if (ret_val != NULL) xmlFreeNsList(ret_val); 19213 desret_xmlNsPtr(ret_val); 19214 call_tests++; 19215 des_xmlNsPtr(n_cur, cur, 0); 19216 xmlResetLastError(); 19217 if (mem_base != xmlMemBlocks()) { 19218 printf("Leak of %d blocks found in xmlCopyNamespaceList", 19219 xmlMemBlocks() - mem_base); 19220 test_ret++; 19221 printf(" %d", n_cur); 19222 printf("\n"); 19223 } 19224 } 19225 function_tests++; 19226 19227 return(test_ret); 19228 } 19229 19230 19231 static int 19232 test_xmlCopyNode(void) { 19233 int test_ret = 0; 19234 19235 int mem_base; 19236 xmlNodePtr ret_val; 19237 xmlNodePtr node; /* the node */ 19238 int n_node; 19239 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */ 19240 int n_extended; 19241 19242 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 19243 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) { 19244 mem_base = xmlMemBlocks(); 19245 node = gen_const_xmlNodePtr(n_node, 0); 19246 extended = gen_int(n_extended, 1); 19247 19248 ret_val = xmlCopyNode((const xmlNodePtr)node, extended); 19249 desret_xmlNodePtr(ret_val); 19250 call_tests++; 19251 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0); 19252 des_int(n_extended, extended, 1); 19253 xmlResetLastError(); 19254 if (mem_base != xmlMemBlocks()) { 19255 printf("Leak of %d blocks found in xmlCopyNode", 19256 xmlMemBlocks() - mem_base); 19257 test_ret++; 19258 printf(" %d", n_node); 19259 printf(" %d", n_extended); 19260 printf("\n"); 19261 } 19262 } 19263 } 19264 function_tests++; 19265 19266 return(test_ret); 19267 } 19268 19269 19270 static int 19271 test_xmlCopyNodeList(void) { 19272 int test_ret = 0; 19273 19274 int mem_base; 19275 xmlNodePtr ret_val; 19276 xmlNodePtr node; /* the first node in the list. */ 19277 int n_node; 19278 19279 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 19280 mem_base = xmlMemBlocks(); 19281 node = gen_const_xmlNodePtr(n_node, 0); 19282 19283 ret_val = xmlCopyNodeList((const xmlNodePtr)node); 19284 desret_xmlNodePtr(ret_val); 19285 call_tests++; 19286 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0); 19287 xmlResetLastError(); 19288 if (mem_base != xmlMemBlocks()) { 19289 printf("Leak of %d blocks found in xmlCopyNodeList", 19290 xmlMemBlocks() - mem_base); 19291 test_ret++; 19292 printf(" %d", n_node); 19293 printf("\n"); 19294 } 19295 } 19296 function_tests++; 19297 19298 return(test_ret); 19299 } 19300 19301 19302 static int 19303 test_xmlCopyProp(void) { 19304 int test_ret = 0; 19305 19306 int mem_base; 19307 xmlAttrPtr ret_val; 19308 xmlNodePtr target; /* the element where the attribute will be grafted */ 19309 int n_target; 19310 xmlAttrPtr cur; /* the attribute */ 19311 int n_cur; 19312 19313 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) { 19314 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { 19315 mem_base = xmlMemBlocks(); 19316 target = gen_xmlNodePtr(n_target, 0); 19317 cur = gen_xmlAttrPtr(n_cur, 1); 19318 19319 ret_val = xmlCopyProp(target, cur); 19320 desret_xmlAttrPtr(ret_val); 19321 call_tests++; 19322 des_xmlNodePtr(n_target, target, 0); 19323 des_xmlAttrPtr(n_cur, cur, 1); 19324 xmlResetLastError(); 19325 if (mem_base != xmlMemBlocks()) { 19326 printf("Leak of %d blocks found in xmlCopyProp", 19327 xmlMemBlocks() - mem_base); 19328 test_ret++; 19329 printf(" %d", n_target); 19330 printf(" %d", n_cur); 19331 printf("\n"); 19332 } 19333 } 19334 } 19335 function_tests++; 19336 19337 return(test_ret); 19338 } 19339 19340 19341 static int 19342 test_xmlCopyPropList(void) { 19343 int test_ret = 0; 19344 19345 int mem_base; 19346 xmlAttrPtr ret_val; 19347 xmlNodePtr target; /* the element where the attributes will be grafted */ 19348 int n_target; 19349 xmlAttrPtr cur; /* the first attribute */ 19350 int n_cur; 19351 19352 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) { 19353 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { 19354 mem_base = xmlMemBlocks(); 19355 target = gen_xmlNodePtr(n_target, 0); 19356 cur = gen_xmlAttrPtr(n_cur, 1); 19357 19358 ret_val = xmlCopyPropList(target, cur); 19359 desret_xmlAttrPtr(ret_val); 19360 call_tests++; 19361 des_xmlNodePtr(n_target, target, 0); 19362 des_xmlAttrPtr(n_cur, cur, 1); 19363 xmlResetLastError(); 19364 if (mem_base != xmlMemBlocks()) { 19365 printf("Leak of %d blocks found in xmlCopyPropList", 19366 xmlMemBlocks() - mem_base); 19367 test_ret++; 19368 printf(" %d", n_target); 19369 printf(" %d", n_cur); 19370 printf("\n"); 19371 } 19372 } 19373 } 19374 function_tests++; 19375 19376 return(test_ret); 19377 } 19378 19379 19380 static int 19381 test_xmlCreateIntSubset(void) { 19382 int test_ret = 0; 19383 19384 int mem_base; 19385 xmlDtdPtr ret_val; 19386 xmlDocPtr doc; /* the document pointer */ 19387 int n_doc; 19388 xmlChar * name; /* the DTD name */ 19389 int n_name; 19390 xmlChar * ExternalID; /* the external (PUBLIC) ID */ 19391 int n_ExternalID; 19392 xmlChar * SystemID; /* the system ID */ 19393 int n_SystemID; 19394 19395 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19396 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 19397 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 19398 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 19399 mem_base = xmlMemBlocks(); 19400 doc = gen_xmlDocPtr(n_doc, 0); 19401 name = gen_const_xmlChar_ptr(n_name, 1); 19402 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 19403 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 19404 19405 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 19406 desret_xmlDtdPtr(ret_val); 19407 call_tests++; 19408 des_xmlDocPtr(n_doc, doc, 0); 19409 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 19410 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 19411 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 19412 xmlResetLastError(); 19413 if (mem_base != xmlMemBlocks()) { 19414 printf("Leak of %d blocks found in xmlCreateIntSubset", 19415 xmlMemBlocks() - mem_base); 19416 test_ret++; 19417 printf(" %d", n_doc); 19418 printf(" %d", n_name); 19419 printf(" %d", n_ExternalID); 19420 printf(" %d", n_SystemID); 19421 printf("\n"); 19422 } 19423 } 19424 } 19425 } 19426 } 19427 function_tests++; 19428 19429 return(test_ret); 19430 } 19431 19432 19433 #define gen_nb_xmlDOMWrapCtxtPtr 1 19434 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 19435 return(NULL); 19436 } 19437 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 19438 } 19439 19440 static int 19441 test_xmlDOMWrapAdoptNode(void) { 19442 int test_ret = 0; 19443 19444 int mem_base; 19445 int ret_val; 19446 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */ 19447 int n_ctxt; 19448 xmlDocPtr sourceDoc; /* the optional sourceDoc */ 19449 int n_sourceDoc; 19450 xmlNodePtr node; /* the node to start with */ 19451 int n_node; 19452 xmlDocPtr destDoc; /* the destination doc */ 19453 int n_destDoc; 19454 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */ 19455 int n_destParent; 19456 int options; /* option flags */ 19457 int n_options; 19458 19459 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19460 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) { 19461 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19462 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) { 19463 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) { 19464 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19465 mem_base = xmlMemBlocks(); 19466 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19467 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1); 19468 node = gen_xmlNodePtr(n_node, 2); 19469 destDoc = gen_xmlDocPtr(n_destDoc, 3); 19470 destParent = gen_xmlNodePtr(n_destParent, 4); 19471 options = gen_int(n_options, 5); 19472 19473 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options); 19474 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;} 19475 desret_int(ret_val); 19476 call_tests++; 19477 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19478 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1); 19479 des_xmlNodePtr(n_node, node, 2); 19480 des_xmlDocPtr(n_destDoc, destDoc, 3); 19481 des_xmlNodePtr(n_destParent, destParent, 4); 19482 des_int(n_options, options, 5); 19483 xmlResetLastError(); 19484 if (mem_base != xmlMemBlocks()) { 19485 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode", 19486 xmlMemBlocks() - mem_base); 19487 test_ret++; 19488 printf(" %d", n_ctxt); 19489 printf(" %d", n_sourceDoc); 19490 printf(" %d", n_node); 19491 printf(" %d", n_destDoc); 19492 printf(" %d", n_destParent); 19493 printf(" %d", n_options); 19494 printf("\n"); 19495 } 19496 } 19497 } 19498 } 19499 } 19500 } 19501 } 19502 function_tests++; 19503 19504 return(test_ret); 19505 } 19506 19507 19508 static int 19509 test_xmlDOMWrapCloneNode(void) { 19510 int test_ret = 0; 19511 19512 int mem_base; 19513 int ret_val; 19514 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */ 19515 int n_ctxt; 19516 xmlDocPtr sourceDoc; /* the optional sourceDoc */ 19517 int n_sourceDoc; 19518 xmlNodePtr node; /* the node to start with */ 19519 int n_node; 19520 xmlNodePtr * resNode; /* the clone of the given @node */ 19521 int n_resNode; 19522 xmlDocPtr destDoc; /* the destination doc */ 19523 int n_destDoc; 19524 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */ 19525 int n_destParent; 19526 int deep; /* descend into child if set */ 19527 int n_deep; 19528 int options; /* option flags */ 19529 int n_options; 19530 19531 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19532 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) { 19533 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19534 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) { 19535 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) { 19536 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) { 19537 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) { 19538 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19539 mem_base = xmlMemBlocks(); 19540 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19541 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1); 19542 node = gen_xmlNodePtr(n_node, 2); 19543 resNode = gen_xmlNodePtr_ptr(n_resNode, 3); 19544 destDoc = gen_xmlDocPtr(n_destDoc, 4); 19545 destParent = gen_xmlNodePtr(n_destParent, 5); 19546 deep = gen_int(n_deep, 6); 19547 options = gen_int(n_options, 7); 19548 19549 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options); 19550 desret_int(ret_val); 19551 call_tests++; 19552 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19553 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1); 19554 des_xmlNodePtr(n_node, node, 2); 19555 des_xmlNodePtr_ptr(n_resNode, resNode, 3); 19556 des_xmlDocPtr(n_destDoc, destDoc, 4); 19557 des_xmlNodePtr(n_destParent, destParent, 5); 19558 des_int(n_deep, deep, 6); 19559 des_int(n_options, options, 7); 19560 xmlResetLastError(); 19561 if (mem_base != xmlMemBlocks()) { 19562 printf("Leak of %d blocks found in xmlDOMWrapCloneNode", 19563 xmlMemBlocks() - mem_base); 19564 test_ret++; 19565 printf(" %d", n_ctxt); 19566 printf(" %d", n_sourceDoc); 19567 printf(" %d", n_node); 19568 printf(" %d", n_resNode); 19569 printf(" %d", n_destDoc); 19570 printf(" %d", n_destParent); 19571 printf(" %d", n_deep); 19572 printf(" %d", n_options); 19573 printf("\n"); 19574 } 19575 } 19576 } 19577 } 19578 } 19579 } 19580 } 19581 } 19582 } 19583 function_tests++; 19584 19585 return(test_ret); 19586 } 19587 19588 19589 static int 19590 test_xmlDOMWrapNewCtxt(void) { 19591 int test_ret = 0; 19592 19593 19594 /* missing type support */ 19595 return(test_ret); 19596 } 19597 19598 19599 static int 19600 test_xmlDOMWrapReconcileNamespaces(void) { 19601 int test_ret = 0; 19602 19603 int mem_base; 19604 int ret_val; 19605 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */ 19606 int n_ctxt; 19607 xmlNodePtr elem; /* the element-node */ 19608 int n_elem; 19609 int options; /* option flags */ 19610 int n_options; 19611 19612 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19613 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 19614 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19615 mem_base = xmlMemBlocks(); 19616 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19617 elem = gen_xmlNodePtr(n_elem, 1); 19618 options = gen_int(n_options, 2); 19619 19620 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options); 19621 desret_int(ret_val); 19622 call_tests++; 19623 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19624 des_xmlNodePtr(n_elem, elem, 1); 19625 des_int(n_options, options, 2); 19626 xmlResetLastError(); 19627 if (mem_base != xmlMemBlocks()) { 19628 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces", 19629 xmlMemBlocks() - mem_base); 19630 test_ret++; 19631 printf(" %d", n_ctxt); 19632 printf(" %d", n_elem); 19633 printf(" %d", n_options); 19634 printf("\n"); 19635 } 19636 } 19637 } 19638 } 19639 function_tests++; 19640 19641 return(test_ret); 19642 } 19643 19644 19645 static int 19646 test_xmlDOMWrapRemoveNode(void) { 19647 int test_ret = 0; 19648 19649 int mem_base; 19650 int ret_val; 19651 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */ 19652 int n_ctxt; 19653 xmlDocPtr doc; /* the doc */ 19654 int n_doc; 19655 xmlNodePtr node; /* the node to be removed. */ 19656 int n_node; 19657 int options; /* set of options, unused at the moment */ 19658 int n_options; 19659 19660 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { 19661 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19662 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 19663 for (n_options = 0;n_options < gen_nb_int;n_options++) { 19664 mem_base = xmlMemBlocks(); 19665 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); 19666 doc = gen_xmlDocPtr(n_doc, 1); 19667 node = gen_xmlNodePtr(n_node, 2); 19668 options = gen_int(n_options, 3); 19669 19670 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options); 19671 desret_int(ret_val); 19672 call_tests++; 19673 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); 19674 des_xmlDocPtr(n_doc, doc, 1); 19675 des_xmlNodePtr(n_node, node, 2); 19676 des_int(n_options, options, 3); 19677 xmlResetLastError(); 19678 if (mem_base != xmlMemBlocks()) { 19679 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode", 19680 xmlMemBlocks() - mem_base); 19681 test_ret++; 19682 printf(" %d", n_ctxt); 19683 printf(" %d", n_doc); 19684 printf(" %d", n_node); 19685 printf(" %d", n_options); 19686 printf("\n"); 19687 } 19688 } 19689 } 19690 } 19691 } 19692 function_tests++; 19693 19694 return(test_ret); 19695 } 19696 19697 19698 static int 19699 test_xmlDocCopyNode(void) { 19700 int test_ret = 0; 19701 19702 int mem_base; 19703 xmlNodePtr ret_val; 19704 xmlNodePtr node; /* the node */ 19705 int n_node; 19706 xmlDocPtr doc; /* the document */ 19707 int n_doc; 19708 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */ 19709 int n_extended; 19710 19711 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 19712 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19713 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) { 19714 mem_base = xmlMemBlocks(); 19715 node = gen_const_xmlNodePtr(n_node, 0); 19716 doc = gen_xmlDocPtr(n_doc, 1); 19717 extended = gen_int(n_extended, 2); 19718 19719 ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended); 19720 desret_xmlNodePtr(ret_val); 19721 call_tests++; 19722 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0); 19723 des_xmlDocPtr(n_doc, doc, 1); 19724 des_int(n_extended, extended, 2); 19725 xmlResetLastError(); 19726 if (mem_base != xmlMemBlocks()) { 19727 printf("Leak of %d blocks found in xmlDocCopyNode", 19728 xmlMemBlocks() - mem_base); 19729 test_ret++; 19730 printf(" %d", n_node); 19731 printf(" %d", n_doc); 19732 printf(" %d", n_extended); 19733 printf("\n"); 19734 } 19735 } 19736 } 19737 } 19738 function_tests++; 19739 19740 return(test_ret); 19741 } 19742 19743 19744 static int 19745 test_xmlDocCopyNodeList(void) { 19746 int test_ret = 0; 19747 19748 int mem_base; 19749 xmlNodePtr ret_val; 19750 xmlDocPtr doc; /* the target document */ 19751 int n_doc; 19752 xmlNodePtr node; /* the first node in the list. */ 19753 int n_node; 19754 19755 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 19756 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { 19757 mem_base = xmlMemBlocks(); 19758 doc = gen_xmlDocPtr(n_doc, 0); 19759 node = gen_const_xmlNodePtr(n_node, 1); 19760 19761 ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node); 19762 desret_xmlNodePtr(ret_val); 19763 call_tests++; 19764 des_xmlDocPtr(n_doc, doc, 0); 19765 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); 19766 xmlResetLastError(); 19767 if (mem_base != xmlMemBlocks()) { 19768 printf("Leak of %d blocks found in xmlDocCopyNodeList", 19769 xmlMemBlocks() - mem_base); 19770 test_ret++; 19771 printf(" %d", n_doc); 19772 printf(" %d", n_node); 19773 printf("\n"); 19774 } 19775 } 19776 } 19777 function_tests++; 19778 19779 return(test_ret); 19780 } 19781 19782 19783 static int 19784 test_xmlDocDump(void) { 19785 int test_ret = 0; 19786 19787 #if defined(LIBXML_OUTPUT_ENABLED) 19788 int mem_base; 19789 int ret_val; 19790 FILE * f; /* the FILE* */ 19791 int n_f; 19792 xmlDocPtr cur; /* the document */ 19793 int n_cur; 19794 19795 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 19796 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 19797 mem_base = xmlMemBlocks(); 19798 f = gen_FILE_ptr(n_f, 0); 19799 cur = gen_xmlDocPtr(n_cur, 1); 19800 19801 ret_val = xmlDocDump(f, cur); 19802 desret_int(ret_val); 19803 call_tests++; 19804 des_FILE_ptr(n_f, f, 0); 19805 des_xmlDocPtr(n_cur, cur, 1); 19806 xmlResetLastError(); 19807 if (mem_base != xmlMemBlocks()) { 19808 printf("Leak of %d blocks found in xmlDocDump", 19809 xmlMemBlocks() - mem_base); 19810 test_ret++; 19811 printf(" %d", n_f); 19812 printf(" %d", n_cur); 19813 printf("\n"); 19814 } 19815 } 19816 } 19817 function_tests++; 19818 #endif 19819 19820 return(test_ret); 19821 } 19822 19823 19824 static int 19825 test_xmlDocDumpFormatMemory(void) { 19826 int test_ret = 0; 19827 19828 #if defined(LIBXML_OUTPUT_ENABLED) 19829 int mem_base; 19830 xmlDocPtr cur; /* the document */ 19831 int n_cur; 19832 xmlChar ** mem; /* OUT: the memory pointer */ 19833 int n_mem; 19834 int * size; /* OUT: the memory length */ 19835 int n_size; 19836 int format; /* should formatting spaces been added */ 19837 int n_format; 19838 19839 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 19840 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 19841 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 19842 for (n_format = 0;n_format < gen_nb_int;n_format++) { 19843 mem_base = xmlMemBlocks(); 19844 cur = gen_xmlDocPtr(n_cur, 0); 19845 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 19846 size = gen_int_ptr(n_size, 2); 19847 format = gen_int(n_format, 3); 19848 19849 xmlDocDumpFormatMemory(cur, mem, size, format); 19850 call_tests++; 19851 des_xmlDocPtr(n_cur, cur, 0); 19852 des_xmlChar_ptr_ptr(n_mem, mem, 1); 19853 des_int_ptr(n_size, size, 2); 19854 des_int(n_format, format, 3); 19855 xmlResetLastError(); 19856 if (mem_base != xmlMemBlocks()) { 19857 printf("Leak of %d blocks found in xmlDocDumpFormatMemory", 19858 xmlMemBlocks() - mem_base); 19859 test_ret++; 19860 printf(" %d", n_cur); 19861 printf(" %d", n_mem); 19862 printf(" %d", n_size); 19863 printf(" %d", n_format); 19864 printf("\n"); 19865 } 19866 } 19867 } 19868 } 19869 } 19870 function_tests++; 19871 #endif 19872 19873 return(test_ret); 19874 } 19875 19876 19877 static int 19878 test_xmlDocDumpFormatMemoryEnc(void) { 19879 int test_ret = 0; 19880 19881 #if defined(LIBXML_OUTPUT_ENABLED) 19882 int mem_base; 19883 xmlDocPtr out_doc; /* Document to generate XML text from */ 19884 int n_out_doc; 19885 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */ 19886 int n_doc_txt_ptr; 19887 int * doc_txt_len; /* Length of the generated XML text */ 19888 int n_doc_txt_len; 19889 char * txt_encoding; /* Character encoding to use when generating XML text */ 19890 int n_txt_encoding; 19891 int format; /* should formatting spaces been added */ 19892 int n_format; 19893 19894 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) { 19895 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { 19896 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) { 19897 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) { 19898 for (n_format = 0;n_format < gen_nb_int;n_format++) { 19899 mem_base = xmlMemBlocks(); 19900 out_doc = gen_xmlDocPtr(n_out_doc, 0); 19901 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1); 19902 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2); 19903 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3); 19904 format = gen_int(n_format, 4); 19905 19906 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format); 19907 call_tests++; 19908 des_xmlDocPtr(n_out_doc, out_doc, 0); 19909 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1); 19910 des_int_ptr(n_doc_txt_len, doc_txt_len, 2); 19911 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3); 19912 des_int(n_format, format, 4); 19913 xmlResetLastError(); 19914 if (mem_base != xmlMemBlocks()) { 19915 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc", 19916 xmlMemBlocks() - mem_base); 19917 test_ret++; 19918 printf(" %d", n_out_doc); 19919 printf(" %d", n_doc_txt_ptr); 19920 printf(" %d", n_doc_txt_len); 19921 printf(" %d", n_txt_encoding); 19922 printf(" %d", n_format); 19923 printf("\n"); 19924 } 19925 } 19926 } 19927 } 19928 } 19929 } 19930 function_tests++; 19931 #endif 19932 19933 return(test_ret); 19934 } 19935 19936 19937 static int 19938 test_xmlDocDumpMemory(void) { 19939 int test_ret = 0; 19940 19941 #if defined(LIBXML_OUTPUT_ENABLED) 19942 int mem_base; 19943 xmlDocPtr cur; /* the document */ 19944 int n_cur; 19945 xmlChar ** mem; /* OUT: the memory pointer */ 19946 int n_mem; 19947 int * size; /* OUT: the memory length */ 19948 int n_size; 19949 19950 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 19951 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { 19952 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { 19953 mem_base = xmlMemBlocks(); 19954 cur = gen_xmlDocPtr(n_cur, 0); 19955 mem = gen_xmlChar_ptr_ptr(n_mem, 1); 19956 size = gen_int_ptr(n_size, 2); 19957 19958 xmlDocDumpMemory(cur, mem, size); 19959 call_tests++; 19960 des_xmlDocPtr(n_cur, cur, 0); 19961 des_xmlChar_ptr_ptr(n_mem, mem, 1); 19962 des_int_ptr(n_size, size, 2); 19963 xmlResetLastError(); 19964 if (mem_base != xmlMemBlocks()) { 19965 printf("Leak of %d blocks found in xmlDocDumpMemory", 19966 xmlMemBlocks() - mem_base); 19967 test_ret++; 19968 printf(" %d", n_cur); 19969 printf(" %d", n_mem); 19970 printf(" %d", n_size); 19971 printf("\n"); 19972 } 19973 } 19974 } 19975 } 19976 function_tests++; 19977 #endif 19978 19979 return(test_ret); 19980 } 19981 19982 19983 static int 19984 test_xmlDocDumpMemoryEnc(void) { 19985 int test_ret = 0; 19986 19987 #if defined(LIBXML_OUTPUT_ENABLED) 19988 int mem_base; 19989 xmlDocPtr out_doc; /* Document to generate XML text from */ 19990 int n_out_doc; 19991 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */ 19992 int n_doc_txt_ptr; 19993 int * doc_txt_len; /* Length of the generated XML text */ 19994 int n_doc_txt_len; 19995 char * txt_encoding; /* Character encoding to use when generating XML text */ 19996 int n_txt_encoding; 19997 19998 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) { 19999 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { 20000 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) { 20001 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) { 20002 mem_base = xmlMemBlocks(); 20003 out_doc = gen_xmlDocPtr(n_out_doc, 0); 20004 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1); 20005 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2); 20006 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3); 20007 20008 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding); 20009 call_tests++; 20010 des_xmlDocPtr(n_out_doc, out_doc, 0); 20011 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1); 20012 des_int_ptr(n_doc_txt_len, doc_txt_len, 2); 20013 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3); 20014 xmlResetLastError(); 20015 if (mem_base != xmlMemBlocks()) { 20016 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc", 20017 xmlMemBlocks() - mem_base); 20018 test_ret++; 20019 printf(" %d", n_out_doc); 20020 printf(" %d", n_doc_txt_ptr); 20021 printf(" %d", n_doc_txt_len); 20022 printf(" %d", n_txt_encoding); 20023 printf("\n"); 20024 } 20025 } 20026 } 20027 } 20028 } 20029 function_tests++; 20030 #endif 20031 20032 return(test_ret); 20033 } 20034 20035 20036 static int 20037 test_xmlDocFormatDump(void) { 20038 int test_ret = 0; 20039 20040 #if defined(LIBXML_OUTPUT_ENABLED) 20041 int mem_base; 20042 int ret_val; 20043 FILE * f; /* the FILE* */ 20044 int n_f; 20045 xmlDocPtr cur; /* the document */ 20046 int n_cur; 20047 int format; /* should formatting spaces been added */ 20048 int n_format; 20049 20050 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 20051 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 20052 for (n_format = 0;n_format < gen_nb_int;n_format++) { 20053 mem_base = xmlMemBlocks(); 20054 f = gen_FILE_ptr(n_f, 0); 20055 cur = gen_xmlDocPtr(n_cur, 1); 20056 format = gen_int(n_format, 2); 20057 20058 ret_val = xmlDocFormatDump(f, cur, format); 20059 desret_int(ret_val); 20060 call_tests++; 20061 des_FILE_ptr(n_f, f, 0); 20062 des_xmlDocPtr(n_cur, cur, 1); 20063 des_int(n_format, format, 2); 20064 xmlResetLastError(); 20065 if (mem_base != xmlMemBlocks()) { 20066 printf("Leak of %d blocks found in xmlDocFormatDump", 20067 xmlMemBlocks() - mem_base); 20068 test_ret++; 20069 printf(" %d", n_f); 20070 printf(" %d", n_cur); 20071 printf(" %d", n_format); 20072 printf("\n"); 20073 } 20074 } 20075 } 20076 } 20077 function_tests++; 20078 #endif 20079 20080 return(test_ret); 20081 } 20082 20083 20084 static int 20085 test_xmlDocGetRootElement(void) { 20086 int test_ret = 0; 20087 20088 int mem_base; 20089 xmlNodePtr ret_val; 20090 xmlDocPtr doc; /* the document */ 20091 int n_doc; 20092 20093 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20094 mem_base = xmlMemBlocks(); 20095 doc = gen_xmlDocPtr(n_doc, 0); 20096 20097 ret_val = xmlDocGetRootElement(doc); 20098 desret_xmlNodePtr(ret_val); 20099 call_tests++; 20100 des_xmlDocPtr(n_doc, doc, 0); 20101 xmlResetLastError(); 20102 if (mem_base != xmlMemBlocks()) { 20103 printf("Leak of %d blocks found in xmlDocGetRootElement", 20104 xmlMemBlocks() - mem_base); 20105 test_ret++; 20106 printf(" %d", n_doc); 20107 printf("\n"); 20108 } 20109 } 20110 function_tests++; 20111 20112 return(test_ret); 20113 } 20114 20115 20116 static int 20117 test_xmlDocSetRootElement(void) { 20118 int test_ret = 0; 20119 20120 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) 20121 int mem_base; 20122 xmlNodePtr ret_val; 20123 xmlDocPtr doc; /* the document */ 20124 int n_doc; 20125 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. */ 20126 int n_root; 20127 20128 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20129 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) { 20130 mem_base = xmlMemBlocks(); 20131 doc = gen_xmlDocPtr(n_doc, 0); 20132 root = gen_xmlNodePtr_in(n_root, 1); 20133 20134 ret_val = xmlDocSetRootElement(doc, root); 20135 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; } 20136 desret_xmlNodePtr(ret_val); 20137 call_tests++; 20138 des_xmlDocPtr(n_doc, doc, 0); 20139 des_xmlNodePtr_in(n_root, root, 1); 20140 xmlResetLastError(); 20141 if (mem_base != xmlMemBlocks()) { 20142 printf("Leak of %d blocks found in xmlDocSetRootElement", 20143 xmlMemBlocks() - mem_base); 20144 test_ret++; 20145 printf(" %d", n_doc); 20146 printf(" %d", n_root); 20147 printf("\n"); 20148 } 20149 } 20150 } 20151 function_tests++; 20152 #endif 20153 20154 return(test_ret); 20155 } 20156 20157 20158 static int 20159 test_xmlElemDump(void) { 20160 int test_ret = 0; 20161 20162 #if defined(LIBXML_OUTPUT_ENABLED) 20163 int mem_base; 20164 FILE * f; /* the FILE * for the output */ 20165 int n_f; 20166 xmlDocPtr doc; /* the document */ 20167 int n_doc; 20168 xmlNodePtr cur; /* the current node */ 20169 int n_cur; 20170 20171 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { 20172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20173 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 20174 mem_base = xmlMemBlocks(); 20175 f = gen_FILE_ptr(n_f, 0); 20176 doc = gen_xmlDocPtr(n_doc, 1); 20177 cur = gen_xmlNodePtr(n_cur, 2); 20178 20179 xmlElemDump(f, doc, cur); 20180 call_tests++; 20181 des_FILE_ptr(n_f, f, 0); 20182 des_xmlDocPtr(n_doc, doc, 1); 20183 des_xmlNodePtr(n_cur, cur, 2); 20184 xmlResetLastError(); 20185 if (mem_base != xmlMemBlocks()) { 20186 printf("Leak of %d blocks found in xmlElemDump", 20187 xmlMemBlocks() - mem_base); 20188 test_ret++; 20189 printf(" %d", n_f); 20190 printf(" %d", n_doc); 20191 printf(" %d", n_cur); 20192 printf("\n"); 20193 } 20194 } 20195 } 20196 } 20197 function_tests++; 20198 #endif 20199 20200 return(test_ret); 20201 } 20202 20203 20204 static int 20205 test_xmlFirstElementChild(void) { 20206 int test_ret = 0; 20207 20208 #if defined(LIBXML_TREE_ENABLED) 20209 int mem_base; 20210 xmlNodePtr ret_val; 20211 xmlNodePtr parent; /* the parent node */ 20212 int n_parent; 20213 20214 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 20215 mem_base = xmlMemBlocks(); 20216 parent = gen_xmlNodePtr(n_parent, 0); 20217 20218 ret_val = xmlFirstElementChild(parent); 20219 desret_xmlNodePtr(ret_val); 20220 call_tests++; 20221 des_xmlNodePtr(n_parent, parent, 0); 20222 xmlResetLastError(); 20223 if (mem_base != xmlMemBlocks()) { 20224 printf("Leak of %d blocks found in xmlFirstElementChild", 20225 xmlMemBlocks() - mem_base); 20226 test_ret++; 20227 printf(" %d", n_parent); 20228 printf("\n"); 20229 } 20230 } 20231 function_tests++; 20232 #endif 20233 20234 return(test_ret); 20235 } 20236 20237 20238 static int 20239 test_xmlGetBufferAllocationScheme(void) { 20240 int test_ret = 0; 20241 20242 int mem_base; 20243 xmlBufferAllocationScheme ret_val; 20244 20245 mem_base = xmlMemBlocks(); 20246 20247 ret_val = xmlGetBufferAllocationScheme(); 20248 desret_xmlBufferAllocationScheme(ret_val); 20249 call_tests++; 20250 xmlResetLastError(); 20251 if (mem_base != xmlMemBlocks()) { 20252 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme", 20253 xmlMemBlocks() - mem_base); 20254 test_ret++; 20255 printf("\n"); 20256 } 20257 function_tests++; 20258 20259 return(test_ret); 20260 } 20261 20262 20263 static int 20264 test_xmlGetCompressMode(void) { 20265 int test_ret = 0; 20266 20267 int mem_base; 20268 int ret_val; 20269 20270 mem_base = xmlMemBlocks(); 20271 20272 ret_val = xmlGetCompressMode(); 20273 desret_int(ret_val); 20274 call_tests++; 20275 xmlResetLastError(); 20276 if (mem_base != xmlMemBlocks()) { 20277 printf("Leak of %d blocks found in xmlGetCompressMode", 20278 xmlMemBlocks() - mem_base); 20279 test_ret++; 20280 printf("\n"); 20281 } 20282 function_tests++; 20283 20284 return(test_ret); 20285 } 20286 20287 20288 static int 20289 test_xmlGetDocCompressMode(void) { 20290 int test_ret = 0; 20291 20292 int mem_base; 20293 int ret_val; 20294 xmlDocPtr doc; /* the document */ 20295 int n_doc; 20296 20297 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20298 mem_base = xmlMemBlocks(); 20299 doc = gen_xmlDocPtr(n_doc, 0); 20300 20301 ret_val = xmlGetDocCompressMode(doc); 20302 desret_int(ret_val); 20303 call_tests++; 20304 des_xmlDocPtr(n_doc, doc, 0); 20305 xmlResetLastError(); 20306 if (mem_base != xmlMemBlocks()) { 20307 printf("Leak of %d blocks found in xmlGetDocCompressMode", 20308 xmlMemBlocks() - mem_base); 20309 test_ret++; 20310 printf(" %d", n_doc); 20311 printf("\n"); 20312 } 20313 } 20314 function_tests++; 20315 20316 return(test_ret); 20317 } 20318 20319 20320 static int 20321 test_xmlGetIntSubset(void) { 20322 int test_ret = 0; 20323 20324 int mem_base; 20325 xmlDtdPtr ret_val; 20326 xmlDocPtr doc; /* the document pointer */ 20327 int n_doc; 20328 20329 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20330 mem_base = xmlMemBlocks(); 20331 doc = gen_xmlDocPtr(n_doc, 0); 20332 20333 ret_val = xmlGetIntSubset(doc); 20334 desret_xmlDtdPtr(ret_val); 20335 call_tests++; 20336 des_xmlDocPtr(n_doc, doc, 0); 20337 xmlResetLastError(); 20338 if (mem_base != xmlMemBlocks()) { 20339 printf("Leak of %d blocks found in xmlGetIntSubset", 20340 xmlMemBlocks() - mem_base); 20341 test_ret++; 20342 printf(" %d", n_doc); 20343 printf("\n"); 20344 } 20345 } 20346 function_tests++; 20347 20348 return(test_ret); 20349 } 20350 20351 20352 static int 20353 test_xmlGetLastChild(void) { 20354 int test_ret = 0; 20355 20356 int mem_base; 20357 xmlNodePtr ret_val; 20358 xmlNodePtr parent; /* the parent node */ 20359 int n_parent; 20360 20361 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 20362 mem_base = xmlMemBlocks(); 20363 parent = gen_xmlNodePtr(n_parent, 0); 20364 20365 ret_val = xmlGetLastChild(parent); 20366 desret_xmlNodePtr(ret_val); 20367 call_tests++; 20368 des_xmlNodePtr(n_parent, parent, 0); 20369 xmlResetLastError(); 20370 if (mem_base != xmlMemBlocks()) { 20371 printf("Leak of %d blocks found in xmlGetLastChild", 20372 xmlMemBlocks() - mem_base); 20373 test_ret++; 20374 printf(" %d", n_parent); 20375 printf("\n"); 20376 } 20377 } 20378 function_tests++; 20379 20380 return(test_ret); 20381 } 20382 20383 20384 static int 20385 test_xmlGetLineNo(void) { 20386 int test_ret = 0; 20387 20388 int mem_base; 20389 long ret_val; 20390 xmlNodePtr node; /* valid node */ 20391 int n_node; 20392 20393 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20394 mem_base = xmlMemBlocks(); 20395 node = gen_xmlNodePtr(n_node, 0); 20396 20397 ret_val = xmlGetLineNo(node); 20398 desret_long(ret_val); 20399 call_tests++; 20400 des_xmlNodePtr(n_node, node, 0); 20401 xmlResetLastError(); 20402 if (mem_base != xmlMemBlocks()) { 20403 printf("Leak of %d blocks found in xmlGetLineNo", 20404 xmlMemBlocks() - mem_base); 20405 test_ret++; 20406 printf(" %d", n_node); 20407 printf("\n"); 20408 } 20409 } 20410 function_tests++; 20411 20412 return(test_ret); 20413 } 20414 20415 20416 static int 20417 test_xmlGetNoNsProp(void) { 20418 int test_ret = 0; 20419 20420 int mem_base; 20421 xmlChar * ret_val; 20422 xmlNodePtr node; /* the node */ 20423 int n_node; 20424 xmlChar * name; /* the attribute name */ 20425 int n_name; 20426 20427 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20428 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20429 mem_base = xmlMemBlocks(); 20430 node = gen_xmlNodePtr(n_node, 0); 20431 name = gen_const_xmlChar_ptr(n_name, 1); 20432 20433 ret_val = xmlGetNoNsProp(node, (const xmlChar *)name); 20434 desret_xmlChar_ptr(ret_val); 20435 call_tests++; 20436 des_xmlNodePtr(n_node, node, 0); 20437 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20438 xmlResetLastError(); 20439 if (mem_base != xmlMemBlocks()) { 20440 printf("Leak of %d blocks found in xmlGetNoNsProp", 20441 xmlMemBlocks() - mem_base); 20442 test_ret++; 20443 printf(" %d", n_node); 20444 printf(" %d", n_name); 20445 printf("\n"); 20446 } 20447 } 20448 } 20449 function_tests++; 20450 20451 return(test_ret); 20452 } 20453 20454 20455 static int 20456 test_xmlGetNodePath(void) { 20457 int test_ret = 0; 20458 20459 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) 20460 int mem_base; 20461 xmlChar * ret_val; 20462 xmlNodePtr node; /* a node */ 20463 int n_node; 20464 20465 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20466 mem_base = xmlMemBlocks(); 20467 node = gen_xmlNodePtr(n_node, 0); 20468 20469 ret_val = xmlGetNodePath(node); 20470 desret_xmlChar_ptr(ret_val); 20471 call_tests++; 20472 des_xmlNodePtr(n_node, node, 0); 20473 xmlResetLastError(); 20474 if (mem_base != xmlMemBlocks()) { 20475 printf("Leak of %d blocks found in xmlGetNodePath", 20476 xmlMemBlocks() - mem_base); 20477 test_ret++; 20478 printf(" %d", n_node); 20479 printf("\n"); 20480 } 20481 } 20482 function_tests++; 20483 #endif 20484 20485 return(test_ret); 20486 } 20487 20488 20489 static int 20490 test_xmlGetNsList(void) { 20491 int test_ret = 0; 20492 20493 20494 /* missing type support */ 20495 return(test_ret); 20496 } 20497 20498 20499 static int 20500 test_xmlGetNsProp(void) { 20501 int test_ret = 0; 20502 20503 int mem_base; 20504 xmlChar * ret_val; 20505 xmlNodePtr node; /* the node */ 20506 int n_node; 20507 xmlChar * name; /* the attribute name */ 20508 int n_name; 20509 xmlChar * nameSpace; /* the URI of the namespace */ 20510 int n_nameSpace; 20511 20512 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20513 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20514 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { 20515 mem_base = xmlMemBlocks(); 20516 node = gen_xmlNodePtr(n_node, 0); 20517 name = gen_const_xmlChar_ptr(n_name, 1); 20518 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); 20519 20520 ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace); 20521 desret_xmlChar_ptr(ret_val); 20522 call_tests++; 20523 des_xmlNodePtr(n_node, node, 0); 20524 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20525 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); 20526 xmlResetLastError(); 20527 if (mem_base != xmlMemBlocks()) { 20528 printf("Leak of %d blocks found in xmlGetNsProp", 20529 xmlMemBlocks() - mem_base); 20530 test_ret++; 20531 printf(" %d", n_node); 20532 printf(" %d", n_name); 20533 printf(" %d", n_nameSpace); 20534 printf("\n"); 20535 } 20536 } 20537 } 20538 } 20539 function_tests++; 20540 20541 return(test_ret); 20542 } 20543 20544 20545 static int 20546 test_xmlGetProp(void) { 20547 int test_ret = 0; 20548 20549 int mem_base; 20550 xmlChar * ret_val; 20551 xmlNodePtr node; /* the node */ 20552 int n_node; 20553 xmlChar * name; /* the attribute name */ 20554 int n_name; 20555 20556 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20557 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20558 mem_base = xmlMemBlocks(); 20559 node = gen_xmlNodePtr(n_node, 0); 20560 name = gen_const_xmlChar_ptr(n_name, 1); 20561 20562 ret_val = xmlGetProp(node, (const xmlChar *)name); 20563 desret_xmlChar_ptr(ret_val); 20564 call_tests++; 20565 des_xmlNodePtr(n_node, node, 0); 20566 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20567 xmlResetLastError(); 20568 if (mem_base != xmlMemBlocks()) { 20569 printf("Leak of %d blocks found in xmlGetProp", 20570 xmlMemBlocks() - mem_base); 20571 test_ret++; 20572 printf(" %d", n_node); 20573 printf(" %d", n_name); 20574 printf("\n"); 20575 } 20576 } 20577 } 20578 function_tests++; 20579 20580 return(test_ret); 20581 } 20582 20583 20584 static int 20585 test_xmlHasNsProp(void) { 20586 int test_ret = 0; 20587 20588 int mem_base; 20589 xmlAttrPtr ret_val; 20590 xmlNodePtr node; /* the node */ 20591 int n_node; 20592 xmlChar * name; /* the attribute name */ 20593 int n_name; 20594 xmlChar * nameSpace; /* the URI of the namespace */ 20595 int n_nameSpace; 20596 20597 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20598 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20599 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { 20600 mem_base = xmlMemBlocks(); 20601 node = gen_xmlNodePtr(n_node, 0); 20602 name = gen_const_xmlChar_ptr(n_name, 1); 20603 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); 20604 20605 ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace); 20606 desret_xmlAttrPtr(ret_val); 20607 call_tests++; 20608 des_xmlNodePtr(n_node, node, 0); 20609 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20610 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); 20611 xmlResetLastError(); 20612 if (mem_base != xmlMemBlocks()) { 20613 printf("Leak of %d blocks found in xmlHasNsProp", 20614 xmlMemBlocks() - mem_base); 20615 test_ret++; 20616 printf(" %d", n_node); 20617 printf(" %d", n_name); 20618 printf(" %d", n_nameSpace); 20619 printf("\n"); 20620 } 20621 } 20622 } 20623 } 20624 function_tests++; 20625 20626 return(test_ret); 20627 } 20628 20629 20630 static int 20631 test_xmlHasProp(void) { 20632 int test_ret = 0; 20633 20634 int mem_base; 20635 xmlAttrPtr ret_val; 20636 xmlNodePtr node; /* the node */ 20637 int n_node; 20638 xmlChar * name; /* the attribute name */ 20639 int n_name; 20640 20641 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20642 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20643 mem_base = xmlMemBlocks(); 20644 node = gen_xmlNodePtr(n_node, 0); 20645 name = gen_const_xmlChar_ptr(n_name, 1); 20646 20647 ret_val = xmlHasProp(node, (const xmlChar *)name); 20648 desret_xmlAttrPtr(ret_val); 20649 call_tests++; 20650 des_xmlNodePtr(n_node, node, 0); 20651 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20652 xmlResetLastError(); 20653 if (mem_base != xmlMemBlocks()) { 20654 printf("Leak of %d blocks found in xmlHasProp", 20655 xmlMemBlocks() - mem_base); 20656 test_ret++; 20657 printf(" %d", n_node); 20658 printf(" %d", n_name); 20659 printf("\n"); 20660 } 20661 } 20662 } 20663 function_tests++; 20664 20665 return(test_ret); 20666 } 20667 20668 20669 static int 20670 test_xmlIsBlankNode(void) { 20671 int test_ret = 0; 20672 20673 int mem_base; 20674 int ret_val; 20675 xmlNodePtr node; /* the node */ 20676 int n_node; 20677 20678 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 20679 mem_base = xmlMemBlocks(); 20680 node = gen_xmlNodePtr(n_node, 0); 20681 20682 ret_val = xmlIsBlankNode(node); 20683 desret_int(ret_val); 20684 call_tests++; 20685 des_xmlNodePtr(n_node, node, 0); 20686 xmlResetLastError(); 20687 if (mem_base != xmlMemBlocks()) { 20688 printf("Leak of %d blocks found in xmlIsBlankNode", 20689 xmlMemBlocks() - mem_base); 20690 test_ret++; 20691 printf(" %d", n_node); 20692 printf("\n"); 20693 } 20694 } 20695 function_tests++; 20696 20697 return(test_ret); 20698 } 20699 20700 20701 static int 20702 test_xmlIsXHTML(void) { 20703 int test_ret = 0; 20704 20705 int mem_base; 20706 int ret_val; 20707 xmlChar * systemID; /* the system identifier */ 20708 int n_systemID; 20709 xmlChar * publicID; /* the public identifier */ 20710 int n_publicID; 20711 20712 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) { 20713 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) { 20714 mem_base = xmlMemBlocks(); 20715 systemID = gen_const_xmlChar_ptr(n_systemID, 0); 20716 publicID = gen_const_xmlChar_ptr(n_publicID, 1); 20717 20718 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID); 20719 desret_int(ret_val); 20720 call_tests++; 20721 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0); 20722 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1); 20723 xmlResetLastError(); 20724 if (mem_base != xmlMemBlocks()) { 20725 printf("Leak of %d blocks found in xmlIsXHTML", 20726 xmlMemBlocks() - mem_base); 20727 test_ret++; 20728 printf(" %d", n_systemID); 20729 printf(" %d", n_publicID); 20730 printf("\n"); 20731 } 20732 } 20733 } 20734 function_tests++; 20735 20736 return(test_ret); 20737 } 20738 20739 20740 static int 20741 test_xmlLastElementChild(void) { 20742 int test_ret = 0; 20743 20744 #if defined(LIBXML_TREE_ENABLED) 20745 int mem_base; 20746 xmlNodePtr ret_val; 20747 xmlNodePtr parent; /* the parent node */ 20748 int n_parent; 20749 20750 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 20751 mem_base = xmlMemBlocks(); 20752 parent = gen_xmlNodePtr(n_parent, 0); 20753 20754 ret_val = xmlLastElementChild(parent); 20755 desret_xmlNodePtr(ret_val); 20756 call_tests++; 20757 des_xmlNodePtr(n_parent, parent, 0); 20758 xmlResetLastError(); 20759 if (mem_base != xmlMemBlocks()) { 20760 printf("Leak of %d blocks found in xmlLastElementChild", 20761 xmlMemBlocks() - mem_base); 20762 test_ret++; 20763 printf(" %d", n_parent); 20764 printf("\n"); 20765 } 20766 } 20767 function_tests++; 20768 #endif 20769 20770 return(test_ret); 20771 } 20772 20773 20774 static int 20775 test_xmlNewCDataBlock(void) { 20776 int test_ret = 0; 20777 20778 int mem_base; 20779 xmlNodePtr ret_val; 20780 xmlDocPtr doc; /* the document */ 20781 int n_doc; 20782 xmlChar * content; /* the CDATA block content content */ 20783 int n_content; 20784 int len; /* the length of the block */ 20785 int n_len; 20786 20787 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20788 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 20789 for (n_len = 0;n_len < gen_nb_int;n_len++) { 20790 mem_base = xmlMemBlocks(); 20791 doc = gen_xmlDocPtr(n_doc, 0); 20792 content = gen_const_xmlChar_ptr(n_content, 1); 20793 len = gen_int(n_len, 2); 20794 20795 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len); 20796 desret_xmlNodePtr(ret_val); 20797 call_tests++; 20798 des_xmlDocPtr(n_doc, doc, 0); 20799 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 20800 des_int(n_len, len, 2); 20801 xmlResetLastError(); 20802 if (mem_base != xmlMemBlocks()) { 20803 printf("Leak of %d blocks found in xmlNewCDataBlock", 20804 xmlMemBlocks() - mem_base); 20805 test_ret++; 20806 printf(" %d", n_doc); 20807 printf(" %d", n_content); 20808 printf(" %d", n_len); 20809 printf("\n"); 20810 } 20811 } 20812 } 20813 } 20814 function_tests++; 20815 20816 return(test_ret); 20817 } 20818 20819 20820 static int 20821 test_xmlNewCharRef(void) { 20822 int test_ret = 0; 20823 20824 int mem_base; 20825 xmlNodePtr ret_val; 20826 xmlDocPtr doc; /* the document */ 20827 int n_doc; 20828 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */ 20829 int n_name; 20830 20831 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20832 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20833 mem_base = xmlMemBlocks(); 20834 doc = gen_xmlDocPtr(n_doc, 0); 20835 name = gen_const_xmlChar_ptr(n_name, 1); 20836 20837 ret_val = xmlNewCharRef(doc, (const xmlChar *)name); 20838 desret_xmlNodePtr(ret_val); 20839 call_tests++; 20840 des_xmlDocPtr(n_doc, doc, 0); 20841 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 20842 xmlResetLastError(); 20843 if (mem_base != xmlMemBlocks()) { 20844 printf("Leak of %d blocks found in xmlNewCharRef", 20845 xmlMemBlocks() - mem_base); 20846 test_ret++; 20847 printf(" %d", n_doc); 20848 printf(" %d", n_name); 20849 printf("\n"); 20850 } 20851 } 20852 } 20853 function_tests++; 20854 20855 return(test_ret); 20856 } 20857 20858 20859 static int 20860 test_xmlNewChild(void) { 20861 int test_ret = 0; 20862 20863 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 20864 #ifdef LIBXML_TREE_ENABLED 20865 int mem_base; 20866 xmlNodePtr ret_val; 20867 xmlNodePtr parent; /* the parent node */ 20868 int n_parent; 20869 xmlNsPtr ns; /* a namespace if any */ 20870 int n_ns; 20871 xmlChar * name; /* the name of the child */ 20872 int n_name; 20873 xmlChar * content; /* the XML content of the child if any. */ 20874 int n_content; 20875 20876 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 20877 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 20878 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 20879 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 20880 mem_base = xmlMemBlocks(); 20881 parent = gen_xmlNodePtr(n_parent, 0); 20882 ns = gen_xmlNsPtr(n_ns, 1); 20883 name = gen_const_xmlChar_ptr(n_name, 2); 20884 content = gen_const_xmlChar_ptr(n_content, 3); 20885 20886 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content); 20887 desret_xmlNodePtr(ret_val); 20888 call_tests++; 20889 des_xmlNodePtr(n_parent, parent, 0); 20890 des_xmlNsPtr(n_ns, ns, 1); 20891 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 20892 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 20893 xmlResetLastError(); 20894 if (mem_base != xmlMemBlocks()) { 20895 printf("Leak of %d blocks found in xmlNewChild", 20896 xmlMemBlocks() - mem_base); 20897 test_ret++; 20898 printf(" %d", n_parent); 20899 printf(" %d", n_ns); 20900 printf(" %d", n_name); 20901 printf(" %d", n_content); 20902 printf("\n"); 20903 } 20904 } 20905 } 20906 } 20907 } 20908 function_tests++; 20909 #endif 20910 #endif 20911 20912 return(test_ret); 20913 } 20914 20915 20916 static int 20917 test_xmlNewComment(void) { 20918 int test_ret = 0; 20919 20920 int mem_base; 20921 xmlNodePtr ret_val; 20922 xmlChar * content; /* the comment content */ 20923 int n_content; 20924 20925 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 20926 mem_base = xmlMemBlocks(); 20927 content = gen_const_xmlChar_ptr(n_content, 0); 20928 20929 ret_val = xmlNewComment((const xmlChar *)content); 20930 desret_xmlNodePtr(ret_val); 20931 call_tests++; 20932 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); 20933 xmlResetLastError(); 20934 if (mem_base != xmlMemBlocks()) { 20935 printf("Leak of %d blocks found in xmlNewComment", 20936 xmlMemBlocks() - mem_base); 20937 test_ret++; 20938 printf(" %d", n_content); 20939 printf("\n"); 20940 } 20941 } 20942 function_tests++; 20943 20944 return(test_ret); 20945 } 20946 20947 20948 static int 20949 test_xmlNewDoc(void) { 20950 int test_ret = 0; 20951 20952 int mem_base; 20953 xmlDocPtr ret_val; 20954 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */ 20955 int n_version; 20956 20957 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) { 20958 mem_base = xmlMemBlocks(); 20959 version = gen_const_xmlChar_ptr(n_version, 0); 20960 20961 ret_val = xmlNewDoc((const xmlChar *)version); 20962 desret_xmlDocPtr(ret_val); 20963 call_tests++; 20964 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0); 20965 xmlResetLastError(); 20966 if (mem_base != xmlMemBlocks()) { 20967 printf("Leak of %d blocks found in xmlNewDoc", 20968 xmlMemBlocks() - mem_base); 20969 test_ret++; 20970 printf(" %d", n_version); 20971 printf("\n"); 20972 } 20973 } 20974 function_tests++; 20975 20976 return(test_ret); 20977 } 20978 20979 20980 static int 20981 test_xmlNewDocComment(void) { 20982 int test_ret = 0; 20983 20984 int mem_base; 20985 xmlNodePtr ret_val; 20986 xmlDocPtr doc; /* the document */ 20987 int n_doc; 20988 xmlChar * content; /* the comment content */ 20989 int n_content; 20990 20991 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 20992 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 20993 mem_base = xmlMemBlocks(); 20994 doc = gen_xmlDocPtr(n_doc, 0); 20995 content = gen_const_xmlChar_ptr(n_content, 1); 20996 20997 ret_val = xmlNewDocComment(doc, (const xmlChar *)content); 20998 desret_xmlNodePtr(ret_val); 20999 call_tests++; 21000 des_xmlDocPtr(n_doc, doc, 0); 21001 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21002 xmlResetLastError(); 21003 if (mem_base != xmlMemBlocks()) { 21004 printf("Leak of %d blocks found in xmlNewDocComment", 21005 xmlMemBlocks() - mem_base); 21006 test_ret++; 21007 printf(" %d", n_doc); 21008 printf(" %d", n_content); 21009 printf("\n"); 21010 } 21011 } 21012 } 21013 function_tests++; 21014 21015 return(test_ret); 21016 } 21017 21018 21019 static int 21020 test_xmlNewDocFragment(void) { 21021 int test_ret = 0; 21022 21023 #if defined(LIBXML_TREE_ENABLED) 21024 int mem_base; 21025 xmlNodePtr ret_val; 21026 xmlDocPtr doc; /* the document owning the fragment */ 21027 int n_doc; 21028 21029 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21030 mem_base = xmlMemBlocks(); 21031 doc = gen_xmlDocPtr(n_doc, 0); 21032 21033 ret_val = xmlNewDocFragment(doc); 21034 desret_xmlNodePtr(ret_val); 21035 call_tests++; 21036 des_xmlDocPtr(n_doc, doc, 0); 21037 xmlResetLastError(); 21038 if (mem_base != xmlMemBlocks()) { 21039 printf("Leak of %d blocks found in xmlNewDocFragment", 21040 xmlMemBlocks() - mem_base); 21041 test_ret++; 21042 printf(" %d", n_doc); 21043 printf("\n"); 21044 } 21045 } 21046 function_tests++; 21047 #endif 21048 21049 return(test_ret); 21050 } 21051 21052 21053 static int 21054 test_xmlNewDocNode(void) { 21055 int test_ret = 0; 21056 21057 int mem_base; 21058 xmlNodePtr ret_val; 21059 xmlDocPtr doc; /* the document */ 21060 int n_doc; 21061 xmlNsPtr ns; /* namespace if any */ 21062 int n_ns; 21063 xmlChar * name; /* the node name */ 21064 int n_name; 21065 xmlChar * content; /* the XML text content if any */ 21066 int n_content; 21067 21068 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21069 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21070 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21071 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21072 mem_base = xmlMemBlocks(); 21073 doc = gen_xmlDocPtr(n_doc, 0); 21074 ns = gen_xmlNsPtr(n_ns, 1); 21075 name = gen_const_xmlChar_ptr(n_name, 2); 21076 content = gen_const_xmlChar_ptr(n_content, 3); 21077 21078 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content); 21079 desret_xmlNodePtr(ret_val); 21080 call_tests++; 21081 des_xmlDocPtr(n_doc, doc, 0); 21082 des_xmlNsPtr(n_ns, ns, 1); 21083 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21084 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21085 xmlResetLastError(); 21086 if (mem_base != xmlMemBlocks()) { 21087 printf("Leak of %d blocks found in xmlNewDocNode", 21088 xmlMemBlocks() - mem_base); 21089 test_ret++; 21090 printf(" %d", n_doc); 21091 printf(" %d", n_ns); 21092 printf(" %d", n_name); 21093 printf(" %d", n_content); 21094 printf("\n"); 21095 } 21096 } 21097 } 21098 } 21099 } 21100 function_tests++; 21101 21102 return(test_ret); 21103 } 21104 21105 21106 static int 21107 test_xmlNewDocNodeEatName(void) { 21108 int test_ret = 0; 21109 21110 int mem_base; 21111 xmlNodePtr ret_val; 21112 xmlDocPtr doc; /* the document */ 21113 int n_doc; 21114 xmlNsPtr ns; /* namespace if any */ 21115 int n_ns; 21116 xmlChar * name; /* the node name */ 21117 int n_name; 21118 xmlChar * content; /* the XML text content if any */ 21119 int n_content; 21120 21121 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21122 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21123 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { 21124 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21125 mem_base = xmlMemBlocks(); 21126 doc = gen_xmlDocPtr(n_doc, 0); 21127 ns = gen_xmlNsPtr(n_ns, 1); 21128 name = gen_eaten_name(n_name, 2); 21129 content = gen_const_xmlChar_ptr(n_content, 3); 21130 21131 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content); 21132 desret_xmlNodePtr(ret_val); 21133 call_tests++; 21134 des_xmlDocPtr(n_doc, doc, 0); 21135 des_xmlNsPtr(n_ns, ns, 1); 21136 des_eaten_name(n_name, name, 2); 21137 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21138 xmlResetLastError(); 21139 if (mem_base != xmlMemBlocks()) { 21140 printf("Leak of %d blocks found in xmlNewDocNodeEatName", 21141 xmlMemBlocks() - mem_base); 21142 test_ret++; 21143 printf(" %d", n_doc); 21144 printf(" %d", n_ns); 21145 printf(" %d", n_name); 21146 printf(" %d", n_content); 21147 printf("\n"); 21148 } 21149 } 21150 } 21151 } 21152 } 21153 function_tests++; 21154 21155 return(test_ret); 21156 } 21157 21158 21159 static int 21160 test_xmlNewDocPI(void) { 21161 int test_ret = 0; 21162 21163 int mem_base; 21164 xmlNodePtr ret_val; 21165 xmlDocPtr doc; /* the target document */ 21166 int n_doc; 21167 xmlChar * name; /* the processing instruction name */ 21168 int n_name; 21169 xmlChar * content; /* the PI content */ 21170 int n_content; 21171 21172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21173 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21174 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21175 mem_base = xmlMemBlocks(); 21176 doc = gen_xmlDocPtr(n_doc, 0); 21177 name = gen_const_xmlChar_ptr(n_name, 1); 21178 content = gen_const_xmlChar_ptr(n_content, 2); 21179 21180 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content); 21181 desret_xmlNodePtr(ret_val); 21182 call_tests++; 21183 des_xmlDocPtr(n_doc, doc, 0); 21184 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21185 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); 21186 xmlResetLastError(); 21187 if (mem_base != xmlMemBlocks()) { 21188 printf("Leak of %d blocks found in xmlNewDocPI", 21189 xmlMemBlocks() - mem_base); 21190 test_ret++; 21191 printf(" %d", n_doc); 21192 printf(" %d", n_name); 21193 printf(" %d", n_content); 21194 printf("\n"); 21195 } 21196 } 21197 } 21198 } 21199 function_tests++; 21200 21201 return(test_ret); 21202 } 21203 21204 21205 static int 21206 test_xmlNewDocProp(void) { 21207 int test_ret = 0; 21208 21209 int mem_base; 21210 xmlAttrPtr ret_val; 21211 xmlDocPtr doc; /* the document */ 21212 int n_doc; 21213 xmlChar * name; /* the name of the attribute */ 21214 int n_name; 21215 xmlChar * value; /* the value of the attribute */ 21216 int n_value; 21217 21218 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21219 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21220 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21221 mem_base = xmlMemBlocks(); 21222 doc = gen_xmlDocPtr(n_doc, 0); 21223 name = gen_const_xmlChar_ptr(n_name, 1); 21224 value = gen_const_xmlChar_ptr(n_value, 2); 21225 21226 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value); 21227 desret_xmlAttrPtr(ret_val); 21228 call_tests++; 21229 des_xmlDocPtr(n_doc, doc, 0); 21230 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21231 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); 21232 xmlResetLastError(); 21233 if (mem_base != xmlMemBlocks()) { 21234 printf("Leak of %d blocks found in xmlNewDocProp", 21235 xmlMemBlocks() - mem_base); 21236 test_ret++; 21237 printf(" %d", n_doc); 21238 printf(" %d", n_name); 21239 printf(" %d", n_value); 21240 printf("\n"); 21241 } 21242 } 21243 } 21244 } 21245 function_tests++; 21246 21247 return(test_ret); 21248 } 21249 21250 21251 static int 21252 test_xmlNewDocRawNode(void) { 21253 int test_ret = 0; 21254 21255 #if defined(LIBXML_TREE_ENABLED) 21256 #ifdef LIBXML_TREE_ENABLED 21257 int mem_base; 21258 xmlNodePtr ret_val; 21259 xmlDocPtr doc; /* the document */ 21260 int n_doc; 21261 xmlNsPtr ns; /* namespace if any */ 21262 int n_ns; 21263 xmlChar * name; /* the node name */ 21264 int n_name; 21265 xmlChar * content; /* the text content if any */ 21266 int n_content; 21267 21268 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21269 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21270 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21271 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21272 mem_base = xmlMemBlocks(); 21273 doc = gen_xmlDocPtr(n_doc, 0); 21274 ns = gen_xmlNsPtr(n_ns, 1); 21275 name = gen_const_xmlChar_ptr(n_name, 2); 21276 content = gen_const_xmlChar_ptr(n_content, 3); 21277 21278 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content); 21279 desret_xmlNodePtr(ret_val); 21280 call_tests++; 21281 des_xmlDocPtr(n_doc, doc, 0); 21282 des_xmlNsPtr(n_ns, ns, 1); 21283 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21284 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21285 xmlResetLastError(); 21286 if (mem_base != xmlMemBlocks()) { 21287 printf("Leak of %d blocks found in xmlNewDocRawNode", 21288 xmlMemBlocks() - mem_base); 21289 test_ret++; 21290 printf(" %d", n_doc); 21291 printf(" %d", n_ns); 21292 printf(" %d", n_name); 21293 printf(" %d", n_content); 21294 printf("\n"); 21295 } 21296 } 21297 } 21298 } 21299 } 21300 function_tests++; 21301 #endif 21302 #endif 21303 21304 return(test_ret); 21305 } 21306 21307 21308 static int 21309 test_xmlNewDocText(void) { 21310 int test_ret = 0; 21311 21312 int mem_base; 21313 xmlNodePtr ret_val; 21314 xmlDocPtr doc; /* the document */ 21315 int n_doc; 21316 xmlChar * content; /* the text content */ 21317 int n_content; 21318 21319 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21320 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21321 mem_base = xmlMemBlocks(); 21322 doc = gen_xmlDocPtr(n_doc, 0); 21323 content = gen_const_xmlChar_ptr(n_content, 1); 21324 21325 ret_val = xmlNewDocText(doc, (const xmlChar *)content); 21326 desret_xmlNodePtr(ret_val); 21327 call_tests++; 21328 des_xmlDocPtr(n_doc, doc, 0); 21329 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21330 xmlResetLastError(); 21331 if (mem_base != xmlMemBlocks()) { 21332 printf("Leak of %d blocks found in xmlNewDocText", 21333 xmlMemBlocks() - mem_base); 21334 test_ret++; 21335 printf(" %d", n_doc); 21336 printf(" %d", n_content); 21337 printf("\n"); 21338 } 21339 } 21340 } 21341 function_tests++; 21342 21343 return(test_ret); 21344 } 21345 21346 21347 static int 21348 test_xmlNewDocTextLen(void) { 21349 int test_ret = 0; 21350 21351 int mem_base; 21352 xmlNodePtr ret_val; 21353 xmlDocPtr doc; /* the document */ 21354 int n_doc; 21355 xmlChar * content; /* the text content */ 21356 int n_content; 21357 int len; /* the text len. */ 21358 int n_len; 21359 21360 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21361 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21362 for (n_len = 0;n_len < gen_nb_int;n_len++) { 21363 mem_base = xmlMemBlocks(); 21364 doc = gen_xmlDocPtr(n_doc, 0); 21365 content = gen_const_xmlChar_ptr(n_content, 1); 21366 len = gen_int(n_len, 2); 21367 21368 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len); 21369 desret_xmlNodePtr(ret_val); 21370 call_tests++; 21371 des_xmlDocPtr(n_doc, doc, 0); 21372 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21373 des_int(n_len, len, 2); 21374 xmlResetLastError(); 21375 if (mem_base != xmlMemBlocks()) { 21376 printf("Leak of %d blocks found in xmlNewDocTextLen", 21377 xmlMemBlocks() - mem_base); 21378 test_ret++; 21379 printf(" %d", n_doc); 21380 printf(" %d", n_content); 21381 printf(" %d", n_len); 21382 printf("\n"); 21383 } 21384 } 21385 } 21386 } 21387 function_tests++; 21388 21389 return(test_ret); 21390 } 21391 21392 21393 static int 21394 test_xmlNewDtd(void) { 21395 int test_ret = 0; 21396 21397 int mem_base; 21398 xmlDtdPtr ret_val; 21399 xmlDocPtr doc; /* the document pointer */ 21400 int n_doc; 21401 xmlChar * name; /* the DTD name */ 21402 int n_name; 21403 xmlChar * ExternalID; /* the external ID */ 21404 int n_ExternalID; 21405 xmlChar * SystemID; /* the system ID */ 21406 int n_SystemID; 21407 21408 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21409 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21410 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { 21411 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { 21412 mem_base = xmlMemBlocks(); 21413 doc = gen_xmlDocPtr(n_doc, 0); 21414 name = gen_const_xmlChar_ptr(n_name, 1); 21415 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); 21416 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); 21417 21418 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); 21419 desret_xmlDtdPtr(ret_val); 21420 call_tests++; 21421 des_xmlDocPtr(n_doc, doc, 0); 21422 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21423 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); 21424 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); 21425 xmlResetLastError(); 21426 if (mem_base != xmlMemBlocks()) { 21427 printf("Leak of %d blocks found in xmlNewDtd", 21428 xmlMemBlocks() - mem_base); 21429 test_ret++; 21430 printf(" %d", n_doc); 21431 printf(" %d", n_name); 21432 printf(" %d", n_ExternalID); 21433 printf(" %d", n_SystemID); 21434 printf("\n"); 21435 } 21436 } 21437 } 21438 } 21439 } 21440 function_tests++; 21441 21442 return(test_ret); 21443 } 21444 21445 21446 static int 21447 test_xmlNewNode(void) { 21448 int test_ret = 0; 21449 21450 int mem_base; 21451 xmlNodePtr ret_val; 21452 xmlNsPtr ns; /* namespace if any */ 21453 int n_ns; 21454 xmlChar * name; /* the node name */ 21455 int n_name; 21456 21457 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21458 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21459 mem_base = xmlMemBlocks(); 21460 ns = gen_xmlNsPtr(n_ns, 0); 21461 name = gen_const_xmlChar_ptr(n_name, 1); 21462 21463 ret_val = xmlNewNode(ns, (const xmlChar *)name); 21464 desret_xmlNodePtr(ret_val); 21465 call_tests++; 21466 des_xmlNsPtr(n_ns, ns, 0); 21467 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21468 xmlResetLastError(); 21469 if (mem_base != xmlMemBlocks()) { 21470 printf("Leak of %d blocks found in xmlNewNode", 21471 xmlMemBlocks() - mem_base); 21472 test_ret++; 21473 printf(" %d", n_ns); 21474 printf(" %d", n_name); 21475 printf("\n"); 21476 } 21477 } 21478 } 21479 function_tests++; 21480 21481 return(test_ret); 21482 } 21483 21484 21485 static int 21486 test_xmlNewNodeEatName(void) { 21487 int test_ret = 0; 21488 21489 int mem_base; 21490 xmlNodePtr ret_val; 21491 xmlNsPtr ns; /* namespace if any */ 21492 int n_ns; 21493 xmlChar * name; /* the node name */ 21494 int n_name; 21495 21496 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21497 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { 21498 mem_base = xmlMemBlocks(); 21499 ns = gen_xmlNsPtr(n_ns, 0); 21500 name = gen_eaten_name(n_name, 1); 21501 21502 ret_val = xmlNewNodeEatName(ns, name); 21503 desret_xmlNodePtr(ret_val); 21504 call_tests++; 21505 des_xmlNsPtr(n_ns, ns, 0); 21506 des_eaten_name(n_name, name, 1); 21507 xmlResetLastError(); 21508 if (mem_base != xmlMemBlocks()) { 21509 printf("Leak of %d blocks found in xmlNewNodeEatName", 21510 xmlMemBlocks() - mem_base); 21511 test_ret++; 21512 printf(" %d", n_ns); 21513 printf(" %d", n_name); 21514 printf("\n"); 21515 } 21516 } 21517 } 21518 function_tests++; 21519 21520 return(test_ret); 21521 } 21522 21523 21524 static int 21525 test_xmlNewNs(void) { 21526 int test_ret = 0; 21527 21528 int mem_base; 21529 xmlNsPtr ret_val; 21530 xmlNodePtr node; /* the element carrying the namespace */ 21531 int n_node; 21532 xmlChar * href; /* the URI associated */ 21533 int n_href; 21534 xmlChar * prefix; /* the prefix for the namespace */ 21535 int n_prefix; 21536 21537 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21538 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) { 21539 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 21540 mem_base = xmlMemBlocks(); 21541 node = gen_xmlNodePtr(n_node, 0); 21542 href = gen_const_xmlChar_ptr(n_href, 1); 21543 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 21544 21545 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix); 21546 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val); 21547 desret_xmlNsPtr(ret_val); 21548 call_tests++; 21549 des_xmlNodePtr(n_node, node, 0); 21550 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1); 21551 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 21552 xmlResetLastError(); 21553 if (mem_base != xmlMemBlocks()) { 21554 printf("Leak of %d blocks found in xmlNewNs", 21555 xmlMemBlocks() - mem_base); 21556 test_ret++; 21557 printf(" %d", n_node); 21558 printf(" %d", n_href); 21559 printf(" %d", n_prefix); 21560 printf("\n"); 21561 } 21562 } 21563 } 21564 } 21565 function_tests++; 21566 21567 return(test_ret); 21568 } 21569 21570 21571 static int 21572 test_xmlNewNsProp(void) { 21573 int test_ret = 0; 21574 21575 int mem_base; 21576 xmlAttrPtr ret_val; 21577 xmlNodePtr node; /* the holding node */ 21578 int n_node; 21579 xmlNsPtr ns; /* the namespace */ 21580 int n_ns; 21581 xmlChar * name; /* the name of the attribute */ 21582 int n_name; 21583 xmlChar * value; /* the value of the attribute */ 21584 int n_value; 21585 21586 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21587 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21588 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21589 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21590 mem_base = xmlMemBlocks(); 21591 node = gen_xmlNodePtr(n_node, 0); 21592 ns = gen_xmlNsPtr(n_ns, 1); 21593 name = gen_const_xmlChar_ptr(n_name, 2); 21594 value = gen_const_xmlChar_ptr(n_value, 3); 21595 21596 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value); 21597 desret_xmlAttrPtr(ret_val); 21598 call_tests++; 21599 des_xmlNodePtr(n_node, node, 0); 21600 des_xmlNsPtr(n_ns, ns, 1); 21601 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21602 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 21603 xmlResetLastError(); 21604 if (mem_base != xmlMemBlocks()) { 21605 printf("Leak of %d blocks found in xmlNewNsProp", 21606 xmlMemBlocks() - mem_base); 21607 test_ret++; 21608 printf(" %d", n_node); 21609 printf(" %d", n_ns); 21610 printf(" %d", n_name); 21611 printf(" %d", n_value); 21612 printf("\n"); 21613 } 21614 } 21615 } 21616 } 21617 } 21618 function_tests++; 21619 21620 return(test_ret); 21621 } 21622 21623 21624 static int 21625 test_xmlNewNsPropEatName(void) { 21626 int test_ret = 0; 21627 21628 int mem_base; 21629 xmlAttrPtr ret_val; 21630 xmlNodePtr node; /* the holding node */ 21631 int n_node; 21632 xmlNsPtr ns; /* the namespace */ 21633 int n_ns; 21634 xmlChar * name; /* the name of the attribute */ 21635 int n_name; 21636 xmlChar * value; /* the value of the attribute */ 21637 int n_value; 21638 21639 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21640 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21641 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { 21642 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21643 mem_base = xmlMemBlocks(); 21644 node = gen_xmlNodePtr(n_node, 0); 21645 ns = gen_xmlNsPtr(n_ns, 1); 21646 name = gen_eaten_name(n_name, 2); 21647 value = gen_const_xmlChar_ptr(n_value, 3); 21648 21649 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value); 21650 desret_xmlAttrPtr(ret_val); 21651 call_tests++; 21652 des_xmlNodePtr(n_node, node, 0); 21653 des_xmlNsPtr(n_ns, ns, 1); 21654 des_eaten_name(n_name, name, 2); 21655 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 21656 xmlResetLastError(); 21657 if (mem_base != xmlMemBlocks()) { 21658 printf("Leak of %d blocks found in xmlNewNsPropEatName", 21659 xmlMemBlocks() - mem_base); 21660 test_ret++; 21661 printf(" %d", n_node); 21662 printf(" %d", n_ns); 21663 printf(" %d", n_name); 21664 printf(" %d", n_value); 21665 printf("\n"); 21666 } 21667 } 21668 } 21669 } 21670 } 21671 function_tests++; 21672 21673 return(test_ret); 21674 } 21675 21676 21677 static int 21678 test_xmlNewPI(void) { 21679 int test_ret = 0; 21680 21681 int mem_base; 21682 xmlNodePtr ret_val; 21683 xmlChar * name; /* the processing instruction name */ 21684 int n_name; 21685 xmlChar * content; /* the PI content */ 21686 int n_content; 21687 21688 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21689 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21690 mem_base = xmlMemBlocks(); 21691 name = gen_const_xmlChar_ptr(n_name, 0); 21692 content = gen_const_xmlChar_ptr(n_content, 1); 21693 21694 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content); 21695 desret_xmlNodePtr(ret_val); 21696 call_tests++; 21697 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 21698 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21699 xmlResetLastError(); 21700 if (mem_base != xmlMemBlocks()) { 21701 printf("Leak of %d blocks found in xmlNewPI", 21702 xmlMemBlocks() - mem_base); 21703 test_ret++; 21704 printf(" %d", n_name); 21705 printf(" %d", n_content); 21706 printf("\n"); 21707 } 21708 } 21709 } 21710 function_tests++; 21711 21712 return(test_ret); 21713 } 21714 21715 21716 static int 21717 test_xmlNewProp(void) { 21718 int test_ret = 0; 21719 21720 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 21721 #ifdef LIBXML_TREE_ENABLED 21722 int mem_base; 21723 xmlAttrPtr ret_val; 21724 xmlNodePtr node; /* the holding node */ 21725 int n_node; 21726 xmlChar * name; /* the name of the attribute */ 21727 int n_name; 21728 xmlChar * value; /* the value of the attribute */ 21729 int n_value; 21730 21731 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21732 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21733 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 21734 mem_base = xmlMemBlocks(); 21735 node = gen_xmlNodePtr(n_node, 0); 21736 name = gen_const_xmlChar_ptr(n_name, 1); 21737 value = gen_const_xmlChar_ptr(n_value, 2); 21738 21739 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value); 21740 desret_xmlAttrPtr(ret_val); 21741 call_tests++; 21742 des_xmlNodePtr(n_node, node, 0); 21743 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21744 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); 21745 xmlResetLastError(); 21746 if (mem_base != xmlMemBlocks()) { 21747 printf("Leak of %d blocks found in xmlNewProp", 21748 xmlMemBlocks() - mem_base); 21749 test_ret++; 21750 printf(" %d", n_node); 21751 printf(" %d", n_name); 21752 printf(" %d", n_value); 21753 printf("\n"); 21754 } 21755 } 21756 } 21757 } 21758 function_tests++; 21759 #endif 21760 #endif 21761 21762 return(test_ret); 21763 } 21764 21765 21766 static int 21767 test_xmlNewReference(void) { 21768 int test_ret = 0; 21769 21770 int mem_base; 21771 xmlNodePtr ret_val; 21772 xmlDocPtr doc; /* the document */ 21773 int n_doc; 21774 xmlChar * name; /* the reference name, or the reference string with & and ; */ 21775 int n_name; 21776 21777 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 21778 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21779 mem_base = xmlMemBlocks(); 21780 doc = gen_xmlDocPtr(n_doc, 0); 21781 name = gen_const_xmlChar_ptr(n_name, 1); 21782 21783 ret_val = xmlNewReference(doc, (const xmlChar *)name); 21784 desret_xmlNodePtr(ret_val); 21785 call_tests++; 21786 des_xmlDocPtr(n_doc, doc, 0); 21787 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 21788 xmlResetLastError(); 21789 if (mem_base != xmlMemBlocks()) { 21790 printf("Leak of %d blocks found in xmlNewReference", 21791 xmlMemBlocks() - mem_base); 21792 test_ret++; 21793 printf(" %d", n_doc); 21794 printf(" %d", n_name); 21795 printf("\n"); 21796 } 21797 } 21798 } 21799 function_tests++; 21800 21801 return(test_ret); 21802 } 21803 21804 21805 static int 21806 test_xmlNewText(void) { 21807 int test_ret = 0; 21808 21809 int mem_base; 21810 xmlNodePtr ret_val; 21811 xmlChar * content; /* the text content */ 21812 int n_content; 21813 21814 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21815 mem_base = xmlMemBlocks(); 21816 content = gen_const_xmlChar_ptr(n_content, 0); 21817 21818 ret_val = xmlNewText((const xmlChar *)content); 21819 desret_xmlNodePtr(ret_val); 21820 call_tests++; 21821 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); 21822 xmlResetLastError(); 21823 if (mem_base != xmlMemBlocks()) { 21824 printf("Leak of %d blocks found in xmlNewText", 21825 xmlMemBlocks() - mem_base); 21826 test_ret++; 21827 printf(" %d", n_content); 21828 printf("\n"); 21829 } 21830 } 21831 function_tests++; 21832 21833 return(test_ret); 21834 } 21835 21836 21837 static int 21838 test_xmlNewTextChild(void) { 21839 int test_ret = 0; 21840 21841 #if defined(LIBXML_TREE_ENABLED) 21842 #ifdef LIBXML_TREE_ENABLED 21843 int mem_base; 21844 xmlNodePtr ret_val; 21845 xmlNodePtr parent; /* the parent node */ 21846 int n_parent; 21847 xmlNsPtr ns; /* a namespace if any */ 21848 int n_ns; 21849 xmlChar * name; /* the name of the child */ 21850 int n_name; 21851 xmlChar * content; /* the text content of the child if any. */ 21852 int n_content; 21853 21854 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { 21855 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 21856 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 21857 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21858 mem_base = xmlMemBlocks(); 21859 parent = gen_xmlNodePtr(n_parent, 0); 21860 ns = gen_xmlNsPtr(n_ns, 1); 21861 name = gen_const_xmlChar_ptr(n_name, 2); 21862 content = gen_const_xmlChar_ptr(n_content, 3); 21863 21864 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content); 21865 desret_xmlNodePtr(ret_val); 21866 call_tests++; 21867 des_xmlNodePtr(n_parent, parent, 0); 21868 des_xmlNsPtr(n_ns, ns, 1); 21869 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 21870 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); 21871 xmlResetLastError(); 21872 if (mem_base != xmlMemBlocks()) { 21873 printf("Leak of %d blocks found in xmlNewTextChild", 21874 xmlMemBlocks() - mem_base); 21875 test_ret++; 21876 printf(" %d", n_parent); 21877 printf(" %d", n_ns); 21878 printf(" %d", n_name); 21879 printf(" %d", n_content); 21880 printf("\n"); 21881 } 21882 } 21883 } 21884 } 21885 } 21886 function_tests++; 21887 #endif 21888 #endif 21889 21890 return(test_ret); 21891 } 21892 21893 21894 static int 21895 test_xmlNewTextLen(void) { 21896 int test_ret = 0; 21897 21898 int mem_base; 21899 xmlNodePtr ret_val; 21900 xmlChar * content; /* the text content */ 21901 int n_content; 21902 int len; /* the text len. */ 21903 int n_len; 21904 21905 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21906 for (n_len = 0;n_len < gen_nb_int;n_len++) { 21907 mem_base = xmlMemBlocks(); 21908 content = gen_const_xmlChar_ptr(n_content, 0); 21909 len = gen_int(n_len, 1); 21910 21911 ret_val = xmlNewTextLen((const xmlChar *)content, len); 21912 desret_xmlNodePtr(ret_val); 21913 call_tests++; 21914 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); 21915 des_int(n_len, len, 1); 21916 xmlResetLastError(); 21917 if (mem_base != xmlMemBlocks()) { 21918 printf("Leak of %d blocks found in xmlNewTextLen", 21919 xmlMemBlocks() - mem_base); 21920 test_ret++; 21921 printf(" %d", n_content); 21922 printf(" %d", n_len); 21923 printf("\n"); 21924 } 21925 } 21926 } 21927 function_tests++; 21928 21929 return(test_ret); 21930 } 21931 21932 21933 static int 21934 test_xmlNextElementSibling(void) { 21935 int test_ret = 0; 21936 21937 #if defined(LIBXML_TREE_ENABLED) 21938 int mem_base; 21939 xmlNodePtr ret_val; 21940 xmlNodePtr node; /* the current node */ 21941 int n_node; 21942 21943 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 21944 mem_base = xmlMemBlocks(); 21945 node = gen_xmlNodePtr(n_node, 0); 21946 21947 ret_val = xmlNextElementSibling(node); 21948 desret_xmlNodePtr(ret_val); 21949 call_tests++; 21950 des_xmlNodePtr(n_node, node, 0); 21951 xmlResetLastError(); 21952 if (mem_base != xmlMemBlocks()) { 21953 printf("Leak of %d blocks found in xmlNextElementSibling", 21954 xmlMemBlocks() - mem_base); 21955 test_ret++; 21956 printf(" %d", n_node); 21957 printf("\n"); 21958 } 21959 } 21960 function_tests++; 21961 #endif 21962 21963 return(test_ret); 21964 } 21965 21966 21967 static int 21968 test_xmlNodeAddContent(void) { 21969 int test_ret = 0; 21970 21971 int mem_base; 21972 xmlNodePtr cur; /* the node being modified */ 21973 int n_cur; 21974 xmlChar * content; /* extra content */ 21975 int n_content; 21976 21977 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 21978 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 21979 mem_base = xmlMemBlocks(); 21980 cur = gen_xmlNodePtr(n_cur, 0); 21981 content = gen_const_xmlChar_ptr(n_content, 1); 21982 21983 xmlNodeAddContent(cur, (const xmlChar *)content); 21984 call_tests++; 21985 des_xmlNodePtr(n_cur, cur, 0); 21986 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 21987 xmlResetLastError(); 21988 if (mem_base != xmlMemBlocks()) { 21989 printf("Leak of %d blocks found in xmlNodeAddContent", 21990 xmlMemBlocks() - mem_base); 21991 test_ret++; 21992 printf(" %d", n_cur); 21993 printf(" %d", n_content); 21994 printf("\n"); 21995 } 21996 } 21997 } 21998 function_tests++; 21999 22000 return(test_ret); 22001 } 22002 22003 22004 static int 22005 test_xmlNodeAddContentLen(void) { 22006 int test_ret = 0; 22007 22008 int mem_base; 22009 xmlNodePtr cur; /* the node being modified */ 22010 int n_cur; 22011 xmlChar * content; /* extra content */ 22012 int n_content; 22013 int len; /* the size of @content */ 22014 int n_len; 22015 22016 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22017 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22018 for (n_len = 0;n_len < gen_nb_int;n_len++) { 22019 mem_base = xmlMemBlocks(); 22020 cur = gen_xmlNodePtr(n_cur, 0); 22021 content = gen_const_xmlChar_ptr(n_content, 1); 22022 len = gen_int(n_len, 2); 22023 22024 xmlNodeAddContentLen(cur, (const xmlChar *)content, len); 22025 call_tests++; 22026 des_xmlNodePtr(n_cur, cur, 0); 22027 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22028 des_int(n_len, len, 2); 22029 xmlResetLastError(); 22030 if (mem_base != xmlMemBlocks()) { 22031 printf("Leak of %d blocks found in xmlNodeAddContentLen", 22032 xmlMemBlocks() - mem_base); 22033 test_ret++; 22034 printf(" %d", n_cur); 22035 printf(" %d", n_content); 22036 printf(" %d", n_len); 22037 printf("\n"); 22038 } 22039 } 22040 } 22041 } 22042 function_tests++; 22043 22044 return(test_ret); 22045 } 22046 22047 22048 static int 22049 test_xmlNodeBufGetContent(void) { 22050 int test_ret = 0; 22051 22052 int mem_base; 22053 int ret_val; 22054 xmlBufferPtr buffer; /* a buffer */ 22055 int n_buffer; 22056 xmlNodePtr cur; /* the node being read */ 22057 int n_cur; 22058 22059 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { 22060 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22061 mem_base = xmlMemBlocks(); 22062 buffer = gen_xmlBufferPtr(n_buffer, 0); 22063 cur = gen_xmlNodePtr(n_cur, 1); 22064 22065 ret_val = xmlNodeBufGetContent(buffer, cur); 22066 desret_int(ret_val); 22067 call_tests++; 22068 des_xmlBufferPtr(n_buffer, buffer, 0); 22069 des_xmlNodePtr(n_cur, cur, 1); 22070 xmlResetLastError(); 22071 if (mem_base != xmlMemBlocks()) { 22072 printf("Leak of %d blocks found in xmlNodeBufGetContent", 22073 xmlMemBlocks() - mem_base); 22074 test_ret++; 22075 printf(" %d", n_buffer); 22076 printf(" %d", n_cur); 22077 printf("\n"); 22078 } 22079 } 22080 } 22081 function_tests++; 22082 22083 return(test_ret); 22084 } 22085 22086 22087 static int 22088 test_xmlNodeDump(void) { 22089 int test_ret = 0; 22090 22091 #if defined(LIBXML_OUTPUT_ENABLED) 22092 int mem_base; 22093 int ret_val; 22094 xmlBufferPtr buf; /* the XML buffer output */ 22095 int n_buf; 22096 xmlDocPtr doc; /* the document */ 22097 int n_doc; 22098 xmlNodePtr cur; /* the current node */ 22099 int n_cur; 22100 int level; /* the imbrication level for indenting */ 22101 int n_level; 22102 int format; /* is formatting allowed */ 22103 int n_format; 22104 22105 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 22106 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22107 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22108 for (n_level = 0;n_level < gen_nb_int;n_level++) { 22109 for (n_format = 0;n_format < gen_nb_int;n_format++) { 22110 mem_base = xmlMemBlocks(); 22111 buf = gen_xmlBufferPtr(n_buf, 0); 22112 doc = gen_xmlDocPtr(n_doc, 1); 22113 cur = gen_xmlNodePtr(n_cur, 2); 22114 level = gen_int(n_level, 3); 22115 format = gen_int(n_format, 4); 22116 22117 ret_val = xmlNodeDump(buf, doc, cur, level, format); 22118 desret_int(ret_val); 22119 call_tests++; 22120 des_xmlBufferPtr(n_buf, buf, 0); 22121 des_xmlDocPtr(n_doc, doc, 1); 22122 des_xmlNodePtr(n_cur, cur, 2); 22123 des_int(n_level, level, 3); 22124 des_int(n_format, format, 4); 22125 xmlResetLastError(); 22126 if (mem_base != xmlMemBlocks()) { 22127 printf("Leak of %d blocks found in xmlNodeDump", 22128 xmlMemBlocks() - mem_base); 22129 test_ret++; 22130 printf(" %d", n_buf); 22131 printf(" %d", n_doc); 22132 printf(" %d", n_cur); 22133 printf(" %d", n_level); 22134 printf(" %d", n_format); 22135 printf("\n"); 22136 } 22137 } 22138 } 22139 } 22140 } 22141 } 22142 function_tests++; 22143 #endif 22144 22145 return(test_ret); 22146 } 22147 22148 22149 static int 22150 test_xmlNodeDumpOutput(void) { 22151 int test_ret = 0; 22152 22153 #if defined(LIBXML_OUTPUT_ENABLED) 22154 int mem_base; 22155 xmlOutputBufferPtr buf; /* the XML buffer output */ 22156 int n_buf; 22157 xmlDocPtr doc; /* the document */ 22158 int n_doc; 22159 xmlNodePtr cur; /* the current node */ 22160 int n_cur; 22161 int level; /* the imbrication level for indenting */ 22162 int n_level; 22163 int format; /* is formatting allowed */ 22164 int n_format; 22165 char * encoding; /* an optional encoding string */ 22166 int n_encoding; 22167 22168 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 22169 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22170 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22171 for (n_level = 0;n_level < gen_nb_int;n_level++) { 22172 for (n_format = 0;n_format < gen_nb_int;n_format++) { 22173 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 22174 mem_base = xmlMemBlocks(); 22175 buf = gen_xmlOutputBufferPtr(n_buf, 0); 22176 doc = gen_xmlDocPtr(n_doc, 1); 22177 cur = gen_xmlNodePtr(n_cur, 2); 22178 level = gen_int(n_level, 3); 22179 format = gen_int(n_format, 4); 22180 encoding = gen_const_char_ptr(n_encoding, 5); 22181 22182 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding); 22183 call_tests++; 22184 des_xmlOutputBufferPtr(n_buf, buf, 0); 22185 des_xmlDocPtr(n_doc, doc, 1); 22186 des_xmlNodePtr(n_cur, cur, 2); 22187 des_int(n_level, level, 3); 22188 des_int(n_format, format, 4); 22189 des_const_char_ptr(n_encoding, (const char *)encoding, 5); 22190 xmlResetLastError(); 22191 if (mem_base != xmlMemBlocks()) { 22192 printf("Leak of %d blocks found in xmlNodeDumpOutput", 22193 xmlMemBlocks() - mem_base); 22194 test_ret++; 22195 printf(" %d", n_buf); 22196 printf(" %d", n_doc); 22197 printf(" %d", n_cur); 22198 printf(" %d", n_level); 22199 printf(" %d", n_format); 22200 printf(" %d", n_encoding); 22201 printf("\n"); 22202 } 22203 } 22204 } 22205 } 22206 } 22207 } 22208 } 22209 function_tests++; 22210 #endif 22211 22212 return(test_ret); 22213 } 22214 22215 22216 static int 22217 test_xmlNodeGetBase(void) { 22218 int test_ret = 0; 22219 22220 int mem_base; 22221 xmlChar * ret_val; 22222 xmlDocPtr doc; /* the document the node pertains to */ 22223 int n_doc; 22224 xmlNodePtr cur; /* the node being checked */ 22225 int n_cur; 22226 22227 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22228 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22229 mem_base = xmlMemBlocks(); 22230 doc = gen_xmlDocPtr(n_doc, 0); 22231 cur = gen_xmlNodePtr(n_cur, 1); 22232 22233 ret_val = xmlNodeGetBase(doc, cur); 22234 desret_xmlChar_ptr(ret_val); 22235 call_tests++; 22236 des_xmlDocPtr(n_doc, doc, 0); 22237 des_xmlNodePtr(n_cur, cur, 1); 22238 xmlResetLastError(); 22239 if (mem_base != xmlMemBlocks()) { 22240 printf("Leak of %d blocks found in xmlNodeGetBase", 22241 xmlMemBlocks() - mem_base); 22242 test_ret++; 22243 printf(" %d", n_doc); 22244 printf(" %d", n_cur); 22245 printf("\n"); 22246 } 22247 } 22248 } 22249 function_tests++; 22250 22251 return(test_ret); 22252 } 22253 22254 22255 static int 22256 test_xmlNodeGetContent(void) { 22257 int test_ret = 0; 22258 22259 int mem_base; 22260 xmlChar * ret_val; 22261 xmlNodePtr cur; /* the node being read */ 22262 int n_cur; 22263 22264 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22265 mem_base = xmlMemBlocks(); 22266 cur = gen_xmlNodePtr(n_cur, 0); 22267 22268 ret_val = xmlNodeGetContent(cur); 22269 desret_xmlChar_ptr(ret_val); 22270 call_tests++; 22271 des_xmlNodePtr(n_cur, cur, 0); 22272 xmlResetLastError(); 22273 if (mem_base != xmlMemBlocks()) { 22274 printf("Leak of %d blocks found in xmlNodeGetContent", 22275 xmlMemBlocks() - mem_base); 22276 test_ret++; 22277 printf(" %d", n_cur); 22278 printf("\n"); 22279 } 22280 } 22281 function_tests++; 22282 22283 return(test_ret); 22284 } 22285 22286 22287 static int 22288 test_xmlNodeGetLang(void) { 22289 int test_ret = 0; 22290 22291 int mem_base; 22292 xmlChar * ret_val; 22293 xmlNodePtr cur; /* the node being checked */ 22294 int n_cur; 22295 22296 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22297 mem_base = xmlMemBlocks(); 22298 cur = gen_xmlNodePtr(n_cur, 0); 22299 22300 ret_val = xmlNodeGetLang(cur); 22301 desret_xmlChar_ptr(ret_val); 22302 call_tests++; 22303 des_xmlNodePtr(n_cur, cur, 0); 22304 xmlResetLastError(); 22305 if (mem_base != xmlMemBlocks()) { 22306 printf("Leak of %d blocks found in xmlNodeGetLang", 22307 xmlMemBlocks() - mem_base); 22308 test_ret++; 22309 printf(" %d", n_cur); 22310 printf("\n"); 22311 } 22312 } 22313 function_tests++; 22314 22315 return(test_ret); 22316 } 22317 22318 22319 static int 22320 test_xmlNodeGetSpacePreserve(void) { 22321 int test_ret = 0; 22322 22323 int mem_base; 22324 int ret_val; 22325 xmlNodePtr cur; /* the node being checked */ 22326 int n_cur; 22327 22328 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22329 mem_base = xmlMemBlocks(); 22330 cur = gen_xmlNodePtr(n_cur, 0); 22331 22332 ret_val = xmlNodeGetSpacePreserve(cur); 22333 desret_int(ret_val); 22334 call_tests++; 22335 des_xmlNodePtr(n_cur, cur, 0); 22336 xmlResetLastError(); 22337 if (mem_base != xmlMemBlocks()) { 22338 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve", 22339 xmlMemBlocks() - mem_base); 22340 test_ret++; 22341 printf(" %d", n_cur); 22342 printf("\n"); 22343 } 22344 } 22345 function_tests++; 22346 22347 return(test_ret); 22348 } 22349 22350 22351 static int 22352 test_xmlNodeIsText(void) { 22353 int test_ret = 0; 22354 22355 int mem_base; 22356 int ret_val; 22357 xmlNodePtr node; /* the node */ 22358 int n_node; 22359 22360 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 22361 mem_base = xmlMemBlocks(); 22362 node = gen_xmlNodePtr(n_node, 0); 22363 22364 ret_val = xmlNodeIsText(node); 22365 desret_int(ret_val); 22366 call_tests++; 22367 des_xmlNodePtr(n_node, node, 0); 22368 xmlResetLastError(); 22369 if (mem_base != xmlMemBlocks()) { 22370 printf("Leak of %d blocks found in xmlNodeIsText", 22371 xmlMemBlocks() - mem_base); 22372 test_ret++; 22373 printf(" %d", n_node); 22374 printf("\n"); 22375 } 22376 } 22377 function_tests++; 22378 22379 return(test_ret); 22380 } 22381 22382 22383 static int 22384 test_xmlNodeListGetRawString(void) { 22385 int test_ret = 0; 22386 22387 #if defined(LIBXML_TREE_ENABLED) 22388 int mem_base; 22389 xmlChar * ret_val; 22390 xmlDocPtr doc; /* the document */ 22391 int n_doc; 22392 xmlNodePtr list; /* a Node list */ 22393 int n_list; 22394 int inLine; /* should we replace entity contents or show their external form */ 22395 int n_inLine; 22396 22397 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22398 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { 22399 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { 22400 mem_base = xmlMemBlocks(); 22401 doc = gen_xmlDocPtr(n_doc, 0); 22402 list = gen_xmlNodePtr(n_list, 1); 22403 inLine = gen_int(n_inLine, 2); 22404 22405 ret_val = xmlNodeListGetRawString(doc, list, inLine); 22406 desret_xmlChar_ptr(ret_val); 22407 call_tests++; 22408 des_xmlDocPtr(n_doc, doc, 0); 22409 des_xmlNodePtr(n_list, list, 1); 22410 des_int(n_inLine, inLine, 2); 22411 xmlResetLastError(); 22412 if (mem_base != xmlMemBlocks()) { 22413 printf("Leak of %d blocks found in xmlNodeListGetRawString", 22414 xmlMemBlocks() - mem_base); 22415 test_ret++; 22416 printf(" %d", n_doc); 22417 printf(" %d", n_list); 22418 printf(" %d", n_inLine); 22419 printf("\n"); 22420 } 22421 } 22422 } 22423 } 22424 function_tests++; 22425 #endif 22426 22427 return(test_ret); 22428 } 22429 22430 22431 static int 22432 test_xmlNodeListGetString(void) { 22433 int test_ret = 0; 22434 22435 int mem_base; 22436 xmlChar * ret_val; 22437 xmlDocPtr doc; /* the document */ 22438 int n_doc; 22439 xmlNodePtr list; /* a Node list */ 22440 int n_list; 22441 int inLine; /* should we replace entity contents or show their external form */ 22442 int n_inLine; 22443 22444 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22445 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { 22446 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { 22447 mem_base = xmlMemBlocks(); 22448 doc = gen_xmlDocPtr(n_doc, 0); 22449 list = gen_xmlNodePtr(n_list, 1); 22450 inLine = gen_int(n_inLine, 2); 22451 22452 ret_val = xmlNodeListGetString(doc, list, inLine); 22453 desret_xmlChar_ptr(ret_val); 22454 call_tests++; 22455 des_xmlDocPtr(n_doc, doc, 0); 22456 des_xmlNodePtr(n_list, list, 1); 22457 des_int(n_inLine, inLine, 2); 22458 xmlResetLastError(); 22459 if (mem_base != xmlMemBlocks()) { 22460 printf("Leak of %d blocks found in xmlNodeListGetString", 22461 xmlMemBlocks() - mem_base); 22462 test_ret++; 22463 printf(" %d", n_doc); 22464 printf(" %d", n_list); 22465 printf(" %d", n_inLine); 22466 printf("\n"); 22467 } 22468 } 22469 } 22470 } 22471 function_tests++; 22472 22473 return(test_ret); 22474 } 22475 22476 22477 static int 22478 test_xmlNodeSetBase(void) { 22479 int test_ret = 0; 22480 22481 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) 22482 int mem_base; 22483 xmlNodePtr cur; /* the node being changed */ 22484 int n_cur; 22485 xmlChar * uri; /* the new base URI */ 22486 int n_uri; 22487 22488 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22489 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) { 22490 mem_base = xmlMemBlocks(); 22491 cur = gen_xmlNodePtr(n_cur, 0); 22492 uri = gen_const_xmlChar_ptr(n_uri, 1); 22493 22494 xmlNodeSetBase(cur, (const xmlChar *)uri); 22495 call_tests++; 22496 des_xmlNodePtr(n_cur, cur, 0); 22497 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1); 22498 xmlResetLastError(); 22499 if (mem_base != xmlMemBlocks()) { 22500 printf("Leak of %d blocks found in xmlNodeSetBase", 22501 xmlMemBlocks() - mem_base); 22502 test_ret++; 22503 printf(" %d", n_cur); 22504 printf(" %d", n_uri); 22505 printf("\n"); 22506 } 22507 } 22508 } 22509 function_tests++; 22510 #endif 22511 22512 return(test_ret); 22513 } 22514 22515 22516 static int 22517 test_xmlNodeSetContent(void) { 22518 int test_ret = 0; 22519 22520 int mem_base; 22521 xmlNodePtr cur; /* the node being modified */ 22522 int n_cur; 22523 xmlChar * content; /* the new value of the content */ 22524 int n_content; 22525 22526 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22527 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22528 mem_base = xmlMemBlocks(); 22529 cur = gen_xmlNodePtr(n_cur, 0); 22530 content = gen_const_xmlChar_ptr(n_content, 1); 22531 22532 xmlNodeSetContent(cur, (const xmlChar *)content); 22533 call_tests++; 22534 des_xmlNodePtr(n_cur, cur, 0); 22535 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22536 xmlResetLastError(); 22537 if (mem_base != xmlMemBlocks()) { 22538 printf("Leak of %d blocks found in xmlNodeSetContent", 22539 xmlMemBlocks() - mem_base); 22540 test_ret++; 22541 printf(" %d", n_cur); 22542 printf(" %d", n_content); 22543 printf("\n"); 22544 } 22545 } 22546 } 22547 function_tests++; 22548 22549 return(test_ret); 22550 } 22551 22552 22553 static int 22554 test_xmlNodeSetContentLen(void) { 22555 int test_ret = 0; 22556 22557 #if defined(LIBXML_TREE_ENABLED) 22558 int mem_base; 22559 xmlNodePtr cur; /* the node being modified */ 22560 int n_cur; 22561 xmlChar * content; /* the new value of the content */ 22562 int n_content; 22563 int len; /* the size of @content */ 22564 int n_len; 22565 22566 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22567 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 22568 for (n_len = 0;n_len < gen_nb_int;n_len++) { 22569 mem_base = xmlMemBlocks(); 22570 cur = gen_xmlNodePtr(n_cur, 0); 22571 content = gen_const_xmlChar_ptr(n_content, 1); 22572 len = gen_int(n_len, 2); 22573 22574 xmlNodeSetContentLen(cur, (const xmlChar *)content, len); 22575 call_tests++; 22576 des_xmlNodePtr(n_cur, cur, 0); 22577 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 22578 des_int(n_len, len, 2); 22579 xmlResetLastError(); 22580 if (mem_base != xmlMemBlocks()) { 22581 printf("Leak of %d blocks found in xmlNodeSetContentLen", 22582 xmlMemBlocks() - mem_base); 22583 test_ret++; 22584 printf(" %d", n_cur); 22585 printf(" %d", n_content); 22586 printf(" %d", n_len); 22587 printf("\n"); 22588 } 22589 } 22590 } 22591 } 22592 function_tests++; 22593 #endif 22594 22595 return(test_ret); 22596 } 22597 22598 22599 static int 22600 test_xmlNodeSetLang(void) { 22601 int test_ret = 0; 22602 22603 #if defined(LIBXML_TREE_ENABLED) 22604 int mem_base; 22605 xmlNodePtr cur; /* the node being changed */ 22606 int n_cur; 22607 xmlChar * lang; /* the language description */ 22608 int n_lang; 22609 22610 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22611 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { 22612 mem_base = xmlMemBlocks(); 22613 cur = gen_xmlNodePtr(n_cur, 0); 22614 lang = gen_const_xmlChar_ptr(n_lang, 1); 22615 22616 xmlNodeSetLang(cur, (const xmlChar *)lang); 22617 call_tests++; 22618 des_xmlNodePtr(n_cur, cur, 0); 22619 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1); 22620 xmlResetLastError(); 22621 if (mem_base != xmlMemBlocks()) { 22622 printf("Leak of %d blocks found in xmlNodeSetLang", 22623 xmlMemBlocks() - mem_base); 22624 test_ret++; 22625 printf(" %d", n_cur); 22626 printf(" %d", n_lang); 22627 printf("\n"); 22628 } 22629 } 22630 } 22631 function_tests++; 22632 #endif 22633 22634 return(test_ret); 22635 } 22636 22637 22638 static int 22639 test_xmlNodeSetName(void) { 22640 int test_ret = 0; 22641 22642 #if defined(LIBXML_TREE_ENABLED) 22643 int mem_base; 22644 xmlNodePtr cur; /* the node being changed */ 22645 int n_cur; 22646 xmlChar * name; /* the new tag name */ 22647 int n_name; 22648 22649 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22650 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 22651 mem_base = xmlMemBlocks(); 22652 cur = gen_xmlNodePtr(n_cur, 0); 22653 name = gen_const_xmlChar_ptr(n_name, 1); 22654 22655 xmlNodeSetName(cur, (const xmlChar *)name); 22656 call_tests++; 22657 des_xmlNodePtr(n_cur, cur, 0); 22658 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 22659 xmlResetLastError(); 22660 if (mem_base != xmlMemBlocks()) { 22661 printf("Leak of %d blocks found in xmlNodeSetName", 22662 xmlMemBlocks() - mem_base); 22663 test_ret++; 22664 printf(" %d", n_cur); 22665 printf(" %d", n_name); 22666 printf("\n"); 22667 } 22668 } 22669 } 22670 function_tests++; 22671 #endif 22672 22673 return(test_ret); 22674 } 22675 22676 22677 static int 22678 test_xmlNodeSetSpacePreserve(void) { 22679 int test_ret = 0; 22680 22681 #if defined(LIBXML_TREE_ENABLED) 22682 int mem_base; 22683 xmlNodePtr cur; /* the node being changed */ 22684 int n_cur; 22685 int val; /* the xml:space value ("0": default, 1: "preserve") */ 22686 int n_val; 22687 22688 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { 22689 for (n_val = 0;n_val < gen_nb_int;n_val++) { 22690 mem_base = xmlMemBlocks(); 22691 cur = gen_xmlNodePtr(n_cur, 0); 22692 val = gen_int(n_val, 1); 22693 22694 xmlNodeSetSpacePreserve(cur, val); 22695 call_tests++; 22696 des_xmlNodePtr(n_cur, cur, 0); 22697 des_int(n_val, val, 1); 22698 xmlResetLastError(); 22699 if (mem_base != xmlMemBlocks()) { 22700 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve", 22701 xmlMemBlocks() - mem_base); 22702 test_ret++; 22703 printf(" %d", n_cur); 22704 printf(" %d", n_val); 22705 printf("\n"); 22706 } 22707 } 22708 } 22709 function_tests++; 22710 #endif 22711 22712 return(test_ret); 22713 } 22714 22715 22716 static int 22717 test_xmlPreviousElementSibling(void) { 22718 int test_ret = 0; 22719 22720 #if defined(LIBXML_TREE_ENABLED) 22721 int mem_base; 22722 xmlNodePtr ret_val; 22723 xmlNodePtr node; /* the current node */ 22724 int n_node; 22725 22726 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 22727 mem_base = xmlMemBlocks(); 22728 node = gen_xmlNodePtr(n_node, 0); 22729 22730 ret_val = xmlPreviousElementSibling(node); 22731 desret_xmlNodePtr(ret_val); 22732 call_tests++; 22733 des_xmlNodePtr(n_node, node, 0); 22734 xmlResetLastError(); 22735 if (mem_base != xmlMemBlocks()) { 22736 printf("Leak of %d blocks found in xmlPreviousElementSibling", 22737 xmlMemBlocks() - mem_base); 22738 test_ret++; 22739 printf(" %d", n_node); 22740 printf("\n"); 22741 } 22742 } 22743 function_tests++; 22744 #endif 22745 22746 return(test_ret); 22747 } 22748 22749 22750 static int 22751 test_xmlReconciliateNs(void) { 22752 int test_ret = 0; 22753 22754 #if defined(LIBXML_TREE_ENABLED) 22755 #ifdef LIBXML_TREE_ENABLED 22756 int mem_base; 22757 int ret_val; 22758 xmlDocPtr doc; /* the document */ 22759 int n_doc; 22760 xmlNodePtr tree; /* a node defining the subtree to reconciliate */ 22761 int n_tree; 22762 22763 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 22764 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 22765 mem_base = xmlMemBlocks(); 22766 doc = gen_xmlDocPtr(n_doc, 0); 22767 tree = gen_xmlNodePtr(n_tree, 1); 22768 22769 ret_val = xmlReconciliateNs(doc, tree); 22770 desret_int(ret_val); 22771 call_tests++; 22772 des_xmlDocPtr(n_doc, doc, 0); 22773 des_xmlNodePtr(n_tree, tree, 1); 22774 xmlResetLastError(); 22775 if (mem_base != xmlMemBlocks()) { 22776 printf("Leak of %d blocks found in xmlReconciliateNs", 22777 xmlMemBlocks() - mem_base); 22778 test_ret++; 22779 printf(" %d", n_doc); 22780 printf(" %d", n_tree); 22781 printf("\n"); 22782 } 22783 } 22784 } 22785 function_tests++; 22786 #endif 22787 #endif 22788 22789 return(test_ret); 22790 } 22791 22792 22793 static int 22794 test_xmlRemoveProp(void) { 22795 int test_ret = 0; 22796 22797 int mem_base; 22798 int ret_val; 22799 xmlAttrPtr cur; /* an attribute */ 22800 int n_cur; 22801 22802 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { 22803 mem_base = xmlMemBlocks(); 22804 cur = gen_xmlAttrPtr(n_cur, 0); 22805 22806 ret_val = xmlRemoveProp(cur); 22807 cur = NULL; 22808 desret_int(ret_val); 22809 call_tests++; 22810 des_xmlAttrPtr(n_cur, cur, 0); 22811 xmlResetLastError(); 22812 if (mem_base != xmlMemBlocks()) { 22813 printf("Leak of %d blocks found in xmlRemoveProp", 22814 xmlMemBlocks() - mem_base); 22815 test_ret++; 22816 printf(" %d", n_cur); 22817 printf("\n"); 22818 } 22819 } 22820 function_tests++; 22821 22822 return(test_ret); 22823 } 22824 22825 22826 static int 22827 test_xmlReplaceNode(void) { 22828 int test_ret = 0; 22829 22830 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) 22831 int mem_base; 22832 xmlNodePtr ret_val; 22833 xmlNodePtr old; /* the old node */ 22834 int n_old; 22835 xmlNodePtr cur; /* the node */ 22836 int n_cur; 22837 22838 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) { 22839 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { 22840 mem_base = xmlMemBlocks(); 22841 old = gen_xmlNodePtr(n_old, 0); 22842 cur = gen_xmlNodePtr_in(n_cur, 1); 22843 22844 ret_val = xmlReplaceNode(old, cur); 22845 if (cur != NULL) { 22846 xmlUnlinkNode(cur); 22847 xmlFreeNode(cur) ; cur = NULL ; } 22848 if (old != NULL) { 22849 xmlUnlinkNode(old); 22850 xmlFreeNode(old) ; old = NULL ; } 22851 ret_val = NULL; 22852 desret_xmlNodePtr(ret_val); 22853 call_tests++; 22854 des_xmlNodePtr(n_old, old, 0); 22855 des_xmlNodePtr_in(n_cur, cur, 1); 22856 xmlResetLastError(); 22857 if (mem_base != xmlMemBlocks()) { 22858 printf("Leak of %d blocks found in xmlReplaceNode", 22859 xmlMemBlocks() - mem_base); 22860 test_ret++; 22861 printf(" %d", n_old); 22862 printf(" %d", n_cur); 22863 printf("\n"); 22864 } 22865 } 22866 } 22867 function_tests++; 22868 #endif 22869 22870 return(test_ret); 22871 } 22872 22873 22874 static int 22875 test_xmlSaveFile(void) { 22876 int test_ret = 0; 22877 22878 #if defined(LIBXML_OUTPUT_ENABLED) 22879 int mem_base; 22880 int ret_val; 22881 const char * filename; /* the filename (or URL) */ 22882 int n_filename; 22883 xmlDocPtr cur; /* the document */ 22884 int n_cur; 22885 22886 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 22887 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 22888 mem_base = xmlMemBlocks(); 22889 filename = gen_fileoutput(n_filename, 0); 22890 cur = gen_xmlDocPtr(n_cur, 1); 22891 22892 ret_val = xmlSaveFile(filename, cur); 22893 desret_int(ret_val); 22894 call_tests++; 22895 des_fileoutput(n_filename, filename, 0); 22896 des_xmlDocPtr(n_cur, cur, 1); 22897 xmlResetLastError(); 22898 if (mem_base != xmlMemBlocks()) { 22899 printf("Leak of %d blocks found in xmlSaveFile", 22900 xmlMemBlocks() - mem_base); 22901 test_ret++; 22902 printf(" %d", n_filename); 22903 printf(" %d", n_cur); 22904 printf("\n"); 22905 } 22906 } 22907 } 22908 function_tests++; 22909 #endif 22910 22911 return(test_ret); 22912 } 22913 22914 22915 static int 22916 test_xmlSaveFileEnc(void) { 22917 int test_ret = 0; 22918 22919 #if defined(LIBXML_OUTPUT_ENABLED) 22920 int mem_base; 22921 int ret_val; 22922 const char * filename; /* the filename (or URL) */ 22923 int n_filename; 22924 xmlDocPtr cur; /* the document */ 22925 int n_cur; 22926 char * encoding; /* the name of an encoding (or NULL) */ 22927 int n_encoding; 22928 22929 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 22930 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 22931 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 22932 mem_base = xmlMemBlocks(); 22933 filename = gen_fileoutput(n_filename, 0); 22934 cur = gen_xmlDocPtr(n_cur, 1); 22935 encoding = gen_const_char_ptr(n_encoding, 2); 22936 22937 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding); 22938 desret_int(ret_val); 22939 call_tests++; 22940 des_fileoutput(n_filename, filename, 0); 22941 des_xmlDocPtr(n_cur, cur, 1); 22942 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 22943 xmlResetLastError(); 22944 if (mem_base != xmlMemBlocks()) { 22945 printf("Leak of %d blocks found in xmlSaveFileEnc", 22946 xmlMemBlocks() - mem_base); 22947 test_ret++; 22948 printf(" %d", n_filename); 22949 printf(" %d", n_cur); 22950 printf(" %d", n_encoding); 22951 printf("\n"); 22952 } 22953 } 22954 } 22955 } 22956 function_tests++; 22957 #endif 22958 22959 return(test_ret); 22960 } 22961 22962 22963 static int 22964 test_xmlSaveFileTo(void) { 22965 int test_ret = 0; 22966 22967 #if defined(LIBXML_OUTPUT_ENABLED) 22968 int mem_base; 22969 int ret_val; 22970 xmlOutputBufferPtr buf; /* an output I/O buffer */ 22971 int n_buf; 22972 xmlDocPtr cur; /* the document */ 22973 int n_cur; 22974 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ 22975 int n_encoding; 22976 22977 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 22978 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 22979 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 22980 mem_base = xmlMemBlocks(); 22981 buf = gen_xmlOutputBufferPtr(n_buf, 0); 22982 cur = gen_xmlDocPtr(n_cur, 1); 22983 encoding = gen_const_char_ptr(n_encoding, 2); 22984 22985 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding); 22986 buf = NULL; 22987 desret_int(ret_val); 22988 call_tests++; 22989 des_xmlOutputBufferPtr(n_buf, buf, 0); 22990 des_xmlDocPtr(n_cur, cur, 1); 22991 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 22992 xmlResetLastError(); 22993 if (mem_base != xmlMemBlocks()) { 22994 printf("Leak of %d blocks found in xmlSaveFileTo", 22995 xmlMemBlocks() - mem_base); 22996 test_ret++; 22997 printf(" %d", n_buf); 22998 printf(" %d", n_cur); 22999 printf(" %d", n_encoding); 23000 printf("\n"); 23001 } 23002 } 23003 } 23004 } 23005 function_tests++; 23006 #endif 23007 23008 return(test_ret); 23009 } 23010 23011 23012 static int 23013 test_xmlSaveFormatFile(void) { 23014 int test_ret = 0; 23015 23016 #if defined(LIBXML_OUTPUT_ENABLED) 23017 int mem_base; 23018 int ret_val; 23019 const char * filename; /* the filename (or URL) */ 23020 int n_filename; 23021 xmlDocPtr cur; /* the document */ 23022 int n_cur; 23023 int format; /* should formatting spaces been added */ 23024 int n_format; 23025 23026 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 23027 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23028 for (n_format = 0;n_format < gen_nb_int;n_format++) { 23029 mem_base = xmlMemBlocks(); 23030 filename = gen_fileoutput(n_filename, 0); 23031 cur = gen_xmlDocPtr(n_cur, 1); 23032 format = gen_int(n_format, 2); 23033 23034 ret_val = xmlSaveFormatFile(filename, cur, format); 23035 desret_int(ret_val); 23036 call_tests++; 23037 des_fileoutput(n_filename, filename, 0); 23038 des_xmlDocPtr(n_cur, cur, 1); 23039 des_int(n_format, format, 2); 23040 xmlResetLastError(); 23041 if (mem_base != xmlMemBlocks()) { 23042 printf("Leak of %d blocks found in xmlSaveFormatFile", 23043 xmlMemBlocks() - mem_base); 23044 test_ret++; 23045 printf(" %d", n_filename); 23046 printf(" %d", n_cur); 23047 printf(" %d", n_format); 23048 printf("\n"); 23049 } 23050 } 23051 } 23052 } 23053 function_tests++; 23054 #endif 23055 23056 return(test_ret); 23057 } 23058 23059 23060 static int 23061 test_xmlSaveFormatFileEnc(void) { 23062 int test_ret = 0; 23063 23064 #if defined(LIBXML_OUTPUT_ENABLED) 23065 int mem_base; 23066 int ret_val; 23067 const char * filename; /* the filename or URL to output */ 23068 int n_filename; 23069 xmlDocPtr cur; /* the document being saved */ 23070 int n_cur; 23071 char * encoding; /* the name of the encoding to use or NULL. */ 23072 int n_encoding; 23073 int format; /* should formatting spaces be added. */ 23074 int n_format; 23075 23076 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { 23077 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23078 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 23079 for (n_format = 0;n_format < gen_nb_int;n_format++) { 23080 mem_base = xmlMemBlocks(); 23081 filename = gen_fileoutput(n_filename, 0); 23082 cur = gen_xmlDocPtr(n_cur, 1); 23083 encoding = gen_const_char_ptr(n_encoding, 2); 23084 format = gen_int(n_format, 3); 23085 23086 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format); 23087 desret_int(ret_val); 23088 call_tests++; 23089 des_fileoutput(n_filename, filename, 0); 23090 des_xmlDocPtr(n_cur, cur, 1); 23091 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 23092 des_int(n_format, format, 3); 23093 xmlResetLastError(); 23094 if (mem_base != xmlMemBlocks()) { 23095 printf("Leak of %d blocks found in xmlSaveFormatFileEnc", 23096 xmlMemBlocks() - mem_base); 23097 test_ret++; 23098 printf(" %d", n_filename); 23099 printf(" %d", n_cur); 23100 printf(" %d", n_encoding); 23101 printf(" %d", n_format); 23102 printf("\n"); 23103 } 23104 } 23105 } 23106 } 23107 } 23108 function_tests++; 23109 #endif 23110 23111 return(test_ret); 23112 } 23113 23114 23115 static int 23116 test_xmlSaveFormatFileTo(void) { 23117 int test_ret = 0; 23118 23119 #if defined(LIBXML_OUTPUT_ENABLED) 23120 int mem_base; 23121 int ret_val; 23122 xmlOutputBufferPtr buf; /* an output I/O buffer */ 23123 int n_buf; 23124 xmlDocPtr cur; /* the document */ 23125 int n_cur; 23126 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ 23127 int n_encoding; 23128 int format; /* should formatting spaces been added */ 23129 int n_format; 23130 23131 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { 23132 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { 23133 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 23134 for (n_format = 0;n_format < gen_nb_int;n_format++) { 23135 mem_base = xmlMemBlocks(); 23136 buf = gen_xmlOutputBufferPtr(n_buf, 0); 23137 cur = gen_xmlDocPtr(n_cur, 1); 23138 encoding = gen_const_char_ptr(n_encoding, 2); 23139 format = gen_int(n_format, 3); 23140 23141 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format); 23142 buf = NULL; 23143 desret_int(ret_val); 23144 call_tests++; 23145 des_xmlOutputBufferPtr(n_buf, buf, 0); 23146 des_xmlDocPtr(n_cur, cur, 1); 23147 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 23148 des_int(n_format, format, 3); 23149 xmlResetLastError(); 23150 if (mem_base != xmlMemBlocks()) { 23151 printf("Leak of %d blocks found in xmlSaveFormatFileTo", 23152 xmlMemBlocks() - mem_base); 23153 test_ret++; 23154 printf(" %d", n_buf); 23155 printf(" %d", n_cur); 23156 printf(" %d", n_encoding); 23157 printf(" %d", n_format); 23158 printf("\n"); 23159 } 23160 } 23161 } 23162 } 23163 } 23164 function_tests++; 23165 #endif 23166 23167 return(test_ret); 23168 } 23169 23170 23171 static int 23172 test_xmlSearchNs(void) { 23173 int test_ret = 0; 23174 23175 int mem_base; 23176 xmlNsPtr ret_val; 23177 xmlDocPtr doc; /* the document */ 23178 int n_doc; 23179 xmlNodePtr node; /* the current node */ 23180 int n_node; 23181 xmlChar * nameSpace; /* the namespace prefix */ 23182 int n_nameSpace; 23183 23184 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23185 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23186 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { 23187 mem_base = xmlMemBlocks(); 23188 doc = gen_xmlDocPtr(n_doc, 0); 23189 node = gen_xmlNodePtr(n_node, 1); 23190 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); 23191 23192 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace); 23193 desret_xmlNsPtr(ret_val); 23194 call_tests++; 23195 des_xmlDocPtr(n_doc, doc, 0); 23196 des_xmlNodePtr(n_node, node, 1); 23197 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); 23198 xmlResetLastError(); 23199 if (mem_base != xmlMemBlocks()) { 23200 printf("Leak of %d blocks found in xmlSearchNs", 23201 xmlMemBlocks() - mem_base); 23202 test_ret++; 23203 printf(" %d", n_doc); 23204 printf(" %d", n_node); 23205 printf(" %d", n_nameSpace); 23206 printf("\n"); 23207 } 23208 } 23209 } 23210 } 23211 function_tests++; 23212 23213 return(test_ret); 23214 } 23215 23216 23217 static int 23218 test_xmlSearchNsByHref(void) { 23219 int test_ret = 0; 23220 23221 int mem_base; 23222 xmlNsPtr ret_val; 23223 xmlDocPtr doc; /* the document */ 23224 int n_doc; 23225 xmlNodePtr node; /* the current node */ 23226 int n_node; 23227 xmlChar * href; /* the namespace value */ 23228 int n_href; 23229 23230 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23231 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23232 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) { 23233 mem_base = xmlMemBlocks(); 23234 doc = gen_xmlDocPtr(n_doc, 0); 23235 node = gen_xmlNodePtr(n_node, 1); 23236 href = gen_const_xmlChar_ptr(n_href, 2); 23237 23238 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href); 23239 desret_xmlNsPtr(ret_val); 23240 call_tests++; 23241 des_xmlDocPtr(n_doc, doc, 0); 23242 des_xmlNodePtr(n_node, node, 1); 23243 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2); 23244 xmlResetLastError(); 23245 if (mem_base != xmlMemBlocks()) { 23246 printf("Leak of %d blocks found in xmlSearchNsByHref", 23247 xmlMemBlocks() - mem_base); 23248 test_ret++; 23249 printf(" %d", n_doc); 23250 printf(" %d", n_node); 23251 printf(" %d", n_href); 23252 printf("\n"); 23253 } 23254 } 23255 } 23256 } 23257 function_tests++; 23258 23259 return(test_ret); 23260 } 23261 23262 23263 static int 23264 test_xmlSetBufferAllocationScheme(void) { 23265 int test_ret = 0; 23266 23267 int mem_base; 23268 xmlBufferAllocationScheme scheme; /* allocation method to use */ 23269 int n_scheme; 23270 23271 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) { 23272 mem_base = xmlMemBlocks(); 23273 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0); 23274 23275 xmlSetBufferAllocationScheme(scheme); 23276 call_tests++; 23277 des_xmlBufferAllocationScheme(n_scheme, scheme, 0); 23278 xmlResetLastError(); 23279 if (mem_base != xmlMemBlocks()) { 23280 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme", 23281 xmlMemBlocks() - mem_base); 23282 test_ret++; 23283 printf(" %d", n_scheme); 23284 printf("\n"); 23285 } 23286 } 23287 function_tests++; 23288 23289 return(test_ret); 23290 } 23291 23292 23293 static int 23294 test_xmlSetCompressMode(void) { 23295 int test_ret = 0; 23296 23297 int mem_base; 23298 int mode; /* the compression ratio */ 23299 int n_mode; 23300 23301 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 23302 mem_base = xmlMemBlocks(); 23303 mode = gen_int(n_mode, 0); 23304 23305 xmlSetCompressMode(mode); 23306 call_tests++; 23307 des_int(n_mode, mode, 0); 23308 xmlResetLastError(); 23309 if (mem_base != xmlMemBlocks()) { 23310 printf("Leak of %d blocks found in xmlSetCompressMode", 23311 xmlMemBlocks() - mem_base); 23312 test_ret++; 23313 printf(" %d", n_mode); 23314 printf("\n"); 23315 } 23316 } 23317 function_tests++; 23318 23319 return(test_ret); 23320 } 23321 23322 23323 static int 23324 test_xmlSetDocCompressMode(void) { 23325 int test_ret = 0; 23326 23327 int mem_base; 23328 xmlDocPtr doc; /* the document */ 23329 int n_doc; 23330 int mode; /* the compression ratio */ 23331 int n_mode; 23332 23333 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23334 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { 23335 mem_base = xmlMemBlocks(); 23336 doc = gen_xmlDocPtr(n_doc, 0); 23337 mode = gen_int(n_mode, 1); 23338 23339 xmlSetDocCompressMode(doc, mode); 23340 call_tests++; 23341 des_xmlDocPtr(n_doc, doc, 0); 23342 des_int(n_mode, mode, 1); 23343 xmlResetLastError(); 23344 if (mem_base != xmlMemBlocks()) { 23345 printf("Leak of %d blocks found in xmlSetDocCompressMode", 23346 xmlMemBlocks() - mem_base); 23347 test_ret++; 23348 printf(" %d", n_doc); 23349 printf(" %d", n_mode); 23350 printf("\n"); 23351 } 23352 } 23353 } 23354 function_tests++; 23355 23356 return(test_ret); 23357 } 23358 23359 23360 static int 23361 test_xmlSetNs(void) { 23362 int test_ret = 0; 23363 23364 int mem_base; 23365 xmlNodePtr node; /* a node in the document */ 23366 int n_node; 23367 xmlNsPtr ns; /* a namespace pointer */ 23368 int n_ns; 23369 23370 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23371 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 23372 mem_base = xmlMemBlocks(); 23373 node = gen_xmlNodePtr(n_node, 0); 23374 ns = gen_xmlNsPtr(n_ns, 1); 23375 23376 xmlSetNs(node, ns); 23377 call_tests++; 23378 des_xmlNodePtr(n_node, node, 0); 23379 des_xmlNsPtr(n_ns, ns, 1); 23380 xmlResetLastError(); 23381 if (mem_base != xmlMemBlocks()) { 23382 printf("Leak of %d blocks found in xmlSetNs", 23383 xmlMemBlocks() - mem_base); 23384 test_ret++; 23385 printf(" %d", n_node); 23386 printf(" %d", n_ns); 23387 printf("\n"); 23388 } 23389 } 23390 } 23391 function_tests++; 23392 23393 return(test_ret); 23394 } 23395 23396 23397 static int 23398 test_xmlSetNsProp(void) { 23399 int test_ret = 0; 23400 23401 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) 23402 int mem_base; 23403 xmlAttrPtr ret_val; 23404 xmlNodePtr node; /* the node */ 23405 int n_node; 23406 xmlNsPtr ns; /* the namespace definition */ 23407 int n_ns; 23408 xmlChar * name; /* the attribute name */ 23409 int n_name; 23410 xmlChar * value; /* the attribute value */ 23411 int n_value; 23412 23413 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23414 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 23415 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23416 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23417 mem_base = xmlMemBlocks(); 23418 node = gen_xmlNodePtr(n_node, 0); 23419 ns = gen_xmlNsPtr(n_ns, 1); 23420 name = gen_const_xmlChar_ptr(n_name, 2); 23421 value = gen_const_xmlChar_ptr(n_value, 3); 23422 23423 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value); 23424 desret_xmlAttrPtr(ret_val); 23425 call_tests++; 23426 des_xmlNodePtr(n_node, node, 0); 23427 des_xmlNsPtr(n_ns, ns, 1); 23428 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 23429 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 23430 xmlResetLastError(); 23431 if (mem_base != xmlMemBlocks()) { 23432 printf("Leak of %d blocks found in xmlSetNsProp", 23433 xmlMemBlocks() - mem_base); 23434 test_ret++; 23435 printf(" %d", n_node); 23436 printf(" %d", n_ns); 23437 printf(" %d", n_name); 23438 printf(" %d", n_value); 23439 printf("\n"); 23440 } 23441 } 23442 } 23443 } 23444 } 23445 function_tests++; 23446 #endif 23447 23448 return(test_ret); 23449 } 23450 23451 23452 static int 23453 test_xmlSetProp(void) { 23454 int test_ret = 0; 23455 23456 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) 23457 int mem_base; 23458 xmlAttrPtr ret_val; 23459 xmlNodePtr node; /* the node */ 23460 int n_node; 23461 xmlChar * name; /* the attribute name (a QName) */ 23462 int n_name; 23463 xmlChar * value; /* the attribute value */ 23464 int n_value; 23465 23466 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23467 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23468 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23469 mem_base = xmlMemBlocks(); 23470 node = gen_xmlNodePtr(n_node, 0); 23471 name = gen_const_xmlChar_ptr(n_name, 1); 23472 value = gen_const_xmlChar_ptr(n_value, 2); 23473 23474 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value); 23475 desret_xmlAttrPtr(ret_val); 23476 call_tests++; 23477 des_xmlNodePtr(n_node, node, 0); 23478 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 23479 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); 23480 xmlResetLastError(); 23481 if (mem_base != xmlMemBlocks()) { 23482 printf("Leak of %d blocks found in xmlSetProp", 23483 xmlMemBlocks() - mem_base); 23484 test_ret++; 23485 printf(" %d", n_node); 23486 printf(" %d", n_name); 23487 printf(" %d", n_value); 23488 printf("\n"); 23489 } 23490 } 23491 } 23492 } 23493 function_tests++; 23494 #endif 23495 23496 return(test_ret); 23497 } 23498 23499 23500 static int 23501 test_xmlSplitQName2(void) { 23502 int test_ret = 0; 23503 23504 int mem_base; 23505 xmlChar * ret_val; 23506 xmlChar * name; /* the full QName */ 23507 int n_name; 23508 xmlChar ** prefix; /* a xmlChar ** */ 23509 int n_prefix; 23510 23511 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23512 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) { 23513 mem_base = xmlMemBlocks(); 23514 name = gen_const_xmlChar_ptr(n_name, 0); 23515 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1); 23516 23517 ret_val = xmlSplitQName2((const xmlChar *)name, prefix); 23518 desret_xmlChar_ptr(ret_val); 23519 call_tests++; 23520 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 23521 des_xmlChar_ptr_ptr(n_prefix, prefix, 1); 23522 xmlResetLastError(); 23523 if (mem_base != xmlMemBlocks()) { 23524 printf("Leak of %d blocks found in xmlSplitQName2", 23525 xmlMemBlocks() - mem_base); 23526 test_ret++; 23527 printf(" %d", n_name); 23528 printf(" %d", n_prefix); 23529 printf("\n"); 23530 } 23531 } 23532 } 23533 function_tests++; 23534 23535 return(test_ret); 23536 } 23537 23538 23539 static int 23540 test_xmlSplitQName3(void) { 23541 int test_ret = 0; 23542 23543 int mem_base; 23544 const xmlChar * ret_val; 23545 xmlChar * name; /* the full QName */ 23546 int n_name; 23547 int * len; /* an int * */ 23548 int n_len; 23549 23550 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23551 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 23552 mem_base = xmlMemBlocks(); 23553 name = gen_const_xmlChar_ptr(n_name, 0); 23554 len = gen_int_ptr(n_len, 1); 23555 23556 ret_val = xmlSplitQName3((const xmlChar *)name, len); 23557 desret_const_xmlChar_ptr(ret_val); 23558 call_tests++; 23559 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 23560 des_int_ptr(n_len, len, 1); 23561 xmlResetLastError(); 23562 if (mem_base != xmlMemBlocks()) { 23563 printf("Leak of %d blocks found in xmlSplitQName3", 23564 xmlMemBlocks() - mem_base); 23565 test_ret++; 23566 printf(" %d", n_name); 23567 printf(" %d", n_len); 23568 printf("\n"); 23569 } 23570 } 23571 } 23572 function_tests++; 23573 23574 return(test_ret); 23575 } 23576 23577 23578 static int 23579 test_xmlStringGetNodeList(void) { 23580 int test_ret = 0; 23581 23582 int mem_base; 23583 xmlNodePtr ret_val; 23584 xmlDocPtr doc; /* the document */ 23585 int n_doc; 23586 xmlChar * value; /* the value of the attribute */ 23587 int n_value; 23588 23589 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23590 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23591 mem_base = xmlMemBlocks(); 23592 doc = gen_xmlDocPtr(n_doc, 0); 23593 value = gen_const_xmlChar_ptr(n_value, 1); 23594 23595 ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value); 23596 desret_xmlNodePtr(ret_val); 23597 call_tests++; 23598 des_xmlDocPtr(n_doc, doc, 0); 23599 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 23600 xmlResetLastError(); 23601 if (mem_base != xmlMemBlocks()) { 23602 printf("Leak of %d blocks found in xmlStringGetNodeList", 23603 xmlMemBlocks() - mem_base); 23604 test_ret++; 23605 printf(" %d", n_doc); 23606 printf(" %d", n_value); 23607 printf("\n"); 23608 } 23609 } 23610 } 23611 function_tests++; 23612 23613 return(test_ret); 23614 } 23615 23616 23617 static int 23618 test_xmlStringLenGetNodeList(void) { 23619 int test_ret = 0; 23620 23621 int mem_base; 23622 xmlNodePtr ret_val; 23623 xmlDocPtr doc; /* the document */ 23624 int n_doc; 23625 xmlChar * value; /* the value of the text */ 23626 int n_value; 23627 int len; /* the length of the string value */ 23628 int n_len; 23629 23630 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 23631 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23632 for (n_len = 0;n_len < gen_nb_int;n_len++) { 23633 mem_base = xmlMemBlocks(); 23634 doc = gen_xmlDocPtr(n_doc, 0); 23635 value = gen_const_xmlChar_ptr(n_value, 1); 23636 len = gen_int(n_len, 2); 23637 23638 ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len); 23639 desret_xmlNodePtr(ret_val); 23640 call_tests++; 23641 des_xmlDocPtr(n_doc, doc, 0); 23642 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 23643 des_int(n_len, len, 2); 23644 xmlResetLastError(); 23645 if (mem_base != xmlMemBlocks()) { 23646 printf("Leak of %d blocks found in xmlStringLenGetNodeList", 23647 xmlMemBlocks() - mem_base); 23648 test_ret++; 23649 printf(" %d", n_doc); 23650 printf(" %d", n_value); 23651 printf(" %d", n_len); 23652 printf("\n"); 23653 } 23654 } 23655 } 23656 } 23657 function_tests++; 23658 23659 return(test_ret); 23660 } 23661 23662 23663 static int 23664 test_xmlTextConcat(void) { 23665 int test_ret = 0; 23666 23667 int mem_base; 23668 int ret_val; 23669 xmlNodePtr node; /* the node */ 23670 int n_node; 23671 xmlChar * content; /* the content */ 23672 int n_content; 23673 int len; /* @content length */ 23674 int n_len; 23675 23676 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23677 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { 23678 for (n_len = 0;n_len < gen_nb_int;n_len++) { 23679 mem_base = xmlMemBlocks(); 23680 node = gen_xmlNodePtr(n_node, 0); 23681 content = gen_const_xmlChar_ptr(n_content, 1); 23682 len = gen_int(n_len, 2); 23683 23684 ret_val = xmlTextConcat(node, (const xmlChar *)content, len); 23685 desret_int(ret_val); 23686 call_tests++; 23687 des_xmlNodePtr(n_node, node, 0); 23688 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); 23689 des_int(n_len, len, 2); 23690 xmlResetLastError(); 23691 if (mem_base != xmlMemBlocks()) { 23692 printf("Leak of %d blocks found in xmlTextConcat", 23693 xmlMemBlocks() - mem_base); 23694 test_ret++; 23695 printf(" %d", n_node); 23696 printf(" %d", n_content); 23697 printf(" %d", n_len); 23698 printf("\n"); 23699 } 23700 } 23701 } 23702 } 23703 function_tests++; 23704 23705 return(test_ret); 23706 } 23707 23708 23709 static int 23710 test_xmlTextMerge(void) { 23711 int test_ret = 0; 23712 23713 int mem_base; 23714 xmlNodePtr ret_val; 23715 xmlNodePtr first; /* the first text node */ 23716 int n_first; 23717 xmlNodePtr second; /* the second text node being merged */ 23718 int n_second; 23719 23720 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) { 23721 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) { 23722 mem_base = xmlMemBlocks(); 23723 first = gen_xmlNodePtr_in(n_first, 0); 23724 second = gen_xmlNodePtr_in(n_second, 1); 23725 23726 ret_val = xmlTextMerge(first, second); 23727 if ((first != NULL) && (first->type != XML_TEXT_NODE)) { 23728 xmlUnlinkNode(second); 23729 xmlFreeNode(second) ; second = NULL ; } 23730 desret_xmlNodePtr(ret_val); 23731 call_tests++; 23732 des_xmlNodePtr_in(n_first, first, 0); 23733 des_xmlNodePtr_in(n_second, second, 1); 23734 xmlResetLastError(); 23735 if (mem_base != xmlMemBlocks()) { 23736 printf("Leak of %d blocks found in xmlTextMerge", 23737 xmlMemBlocks() - mem_base); 23738 test_ret++; 23739 printf(" %d", n_first); 23740 printf(" %d", n_second); 23741 printf("\n"); 23742 } 23743 } 23744 } 23745 function_tests++; 23746 23747 return(test_ret); 23748 } 23749 23750 23751 static int 23752 test_xmlUnsetNsProp(void) { 23753 int test_ret = 0; 23754 23755 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23756 int mem_base; 23757 int ret_val; 23758 xmlNodePtr node; /* the node */ 23759 int n_node; 23760 xmlNsPtr ns; /* the namespace definition */ 23761 int n_ns; 23762 xmlChar * name; /* the attribute name */ 23763 int n_name; 23764 23765 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23766 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 23767 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23768 mem_base = xmlMemBlocks(); 23769 node = gen_xmlNodePtr(n_node, 0); 23770 ns = gen_xmlNsPtr(n_ns, 1); 23771 name = gen_const_xmlChar_ptr(n_name, 2); 23772 23773 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name); 23774 desret_int(ret_val); 23775 call_tests++; 23776 des_xmlNodePtr(n_node, node, 0); 23777 des_xmlNsPtr(n_ns, ns, 1); 23778 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 23779 xmlResetLastError(); 23780 if (mem_base != xmlMemBlocks()) { 23781 printf("Leak of %d blocks found in xmlUnsetNsProp", 23782 xmlMemBlocks() - mem_base); 23783 test_ret++; 23784 printf(" %d", n_node); 23785 printf(" %d", n_ns); 23786 printf(" %d", n_name); 23787 printf("\n"); 23788 } 23789 } 23790 } 23791 } 23792 function_tests++; 23793 #endif 23794 23795 return(test_ret); 23796 } 23797 23798 23799 static int 23800 test_xmlUnsetProp(void) { 23801 int test_ret = 0; 23802 23803 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23804 int mem_base; 23805 int ret_val; 23806 xmlNodePtr node; /* the node */ 23807 int n_node; 23808 xmlChar * name; /* the attribute name */ 23809 int n_name; 23810 23811 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 23812 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 23813 mem_base = xmlMemBlocks(); 23814 node = gen_xmlNodePtr(n_node, 0); 23815 name = gen_const_xmlChar_ptr(n_name, 1); 23816 23817 ret_val = xmlUnsetProp(node, (const xmlChar *)name); 23818 desret_int(ret_val); 23819 call_tests++; 23820 des_xmlNodePtr(n_node, node, 0); 23821 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 23822 xmlResetLastError(); 23823 if (mem_base != xmlMemBlocks()) { 23824 printf("Leak of %d blocks found in xmlUnsetProp", 23825 xmlMemBlocks() - mem_base); 23826 test_ret++; 23827 printf(" %d", n_node); 23828 printf(" %d", n_name); 23829 printf("\n"); 23830 } 23831 } 23832 } 23833 function_tests++; 23834 #endif 23835 23836 return(test_ret); 23837 } 23838 23839 23840 static int 23841 test_xmlValidateNCName(void) { 23842 int test_ret = 0; 23843 23844 #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) 23845 #ifdef LIBXML_TREE_ENABLED 23846 int mem_base; 23847 int ret_val; 23848 xmlChar * value; /* the value to check */ 23849 int n_value; 23850 int space; /* allow spaces in front and end of the string */ 23851 int n_space; 23852 23853 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23854 for (n_space = 0;n_space < gen_nb_int;n_space++) { 23855 mem_base = xmlMemBlocks(); 23856 value = gen_const_xmlChar_ptr(n_value, 0); 23857 space = gen_int(n_space, 1); 23858 23859 ret_val = xmlValidateNCName((const xmlChar *)value, space); 23860 desret_int(ret_val); 23861 call_tests++; 23862 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 23863 des_int(n_space, space, 1); 23864 xmlResetLastError(); 23865 if (mem_base != xmlMemBlocks()) { 23866 printf("Leak of %d blocks found in xmlValidateNCName", 23867 xmlMemBlocks() - mem_base); 23868 test_ret++; 23869 printf(" %d", n_value); 23870 printf(" %d", n_space); 23871 printf("\n"); 23872 } 23873 } 23874 } 23875 function_tests++; 23876 #endif 23877 #endif 23878 23879 return(test_ret); 23880 } 23881 23882 23883 static int 23884 test_xmlValidateNMToken(void) { 23885 int test_ret = 0; 23886 23887 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23888 #ifdef LIBXML_TREE_ENABLED 23889 int mem_base; 23890 int ret_val; 23891 xmlChar * value; /* the value to check */ 23892 int n_value; 23893 int space; /* allow spaces in front and end of the string */ 23894 int n_space; 23895 23896 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23897 for (n_space = 0;n_space < gen_nb_int;n_space++) { 23898 mem_base = xmlMemBlocks(); 23899 value = gen_const_xmlChar_ptr(n_value, 0); 23900 space = gen_int(n_space, 1); 23901 23902 ret_val = xmlValidateNMToken((const xmlChar *)value, space); 23903 desret_int(ret_val); 23904 call_tests++; 23905 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 23906 des_int(n_space, space, 1); 23907 xmlResetLastError(); 23908 if (mem_base != xmlMemBlocks()) { 23909 printf("Leak of %d blocks found in xmlValidateNMToken", 23910 xmlMemBlocks() - mem_base); 23911 test_ret++; 23912 printf(" %d", n_value); 23913 printf(" %d", n_space); 23914 printf("\n"); 23915 } 23916 } 23917 } 23918 function_tests++; 23919 #endif 23920 #endif 23921 23922 return(test_ret); 23923 } 23924 23925 23926 static int 23927 test_xmlValidateName(void) { 23928 int test_ret = 0; 23929 23930 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23931 #ifdef LIBXML_TREE_ENABLED 23932 int mem_base; 23933 int ret_val; 23934 xmlChar * value; /* the value to check */ 23935 int n_value; 23936 int space; /* allow spaces in front and end of the string */ 23937 int n_space; 23938 23939 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23940 for (n_space = 0;n_space < gen_nb_int;n_space++) { 23941 mem_base = xmlMemBlocks(); 23942 value = gen_const_xmlChar_ptr(n_value, 0); 23943 space = gen_int(n_space, 1); 23944 23945 ret_val = xmlValidateName((const xmlChar *)value, space); 23946 desret_int(ret_val); 23947 call_tests++; 23948 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 23949 des_int(n_space, space, 1); 23950 xmlResetLastError(); 23951 if (mem_base != xmlMemBlocks()) { 23952 printf("Leak of %d blocks found in xmlValidateName", 23953 xmlMemBlocks() - mem_base); 23954 test_ret++; 23955 printf(" %d", n_value); 23956 printf(" %d", n_space); 23957 printf("\n"); 23958 } 23959 } 23960 } 23961 function_tests++; 23962 #endif 23963 #endif 23964 23965 return(test_ret); 23966 } 23967 23968 23969 static int 23970 test_xmlValidateQName(void) { 23971 int test_ret = 0; 23972 23973 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 23974 #ifdef LIBXML_TREE_ENABLED 23975 int mem_base; 23976 int ret_val; 23977 xmlChar * value; /* the value to check */ 23978 int n_value; 23979 int space; /* allow spaces in front and end of the string */ 23980 int n_space; 23981 23982 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 23983 for (n_space = 0;n_space < gen_nb_int;n_space++) { 23984 mem_base = xmlMemBlocks(); 23985 value = gen_const_xmlChar_ptr(n_value, 0); 23986 space = gen_int(n_space, 1); 23987 23988 ret_val = xmlValidateQName((const xmlChar *)value, space); 23989 desret_int(ret_val); 23990 call_tests++; 23991 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 23992 des_int(n_space, space, 1); 23993 xmlResetLastError(); 23994 if (mem_base != xmlMemBlocks()) { 23995 printf("Leak of %d blocks found in xmlValidateQName", 23996 xmlMemBlocks() - mem_base); 23997 test_ret++; 23998 printf(" %d", n_value); 23999 printf(" %d", n_space); 24000 printf("\n"); 24001 } 24002 } 24003 } 24004 function_tests++; 24005 #endif 24006 #endif 24007 24008 return(test_ret); 24009 } 24010 24011 static int 24012 test_tree(void) { 24013 int test_ret = 0; 24014 24015 if (quiet == 0) printf("Testing tree : 138 of 157 functions ...\n"); 24016 test_ret += test_xmlAddChild(); 24017 test_ret += test_xmlAddChildList(); 24018 test_ret += test_xmlAddNextSibling(); 24019 test_ret += test_xmlAddPrevSibling(); 24020 test_ret += test_xmlAddSibling(); 24021 test_ret += test_xmlAttrSerializeTxtContent(); 24022 test_ret += test_xmlBufferAdd(); 24023 test_ret += test_xmlBufferAddHead(); 24024 test_ret += test_xmlBufferCCat(); 24025 test_ret += test_xmlBufferCat(); 24026 test_ret += test_xmlBufferContent(); 24027 test_ret += test_xmlBufferCreate(); 24028 test_ret += test_xmlBufferCreateSize(); 24029 test_ret += test_xmlBufferCreateStatic(); 24030 test_ret += test_xmlBufferEmpty(); 24031 test_ret += test_xmlBufferGrow(); 24032 test_ret += test_xmlBufferLength(); 24033 test_ret += test_xmlBufferResize(); 24034 test_ret += test_xmlBufferSetAllocationScheme(); 24035 test_ret += test_xmlBufferShrink(); 24036 test_ret += test_xmlBufferWriteCHAR(); 24037 test_ret += test_xmlBufferWriteChar(); 24038 test_ret += test_xmlBufferWriteQuotedString(); 24039 test_ret += test_xmlBuildQName(); 24040 test_ret += test_xmlChildElementCount(); 24041 test_ret += test_xmlCopyDoc(); 24042 test_ret += test_xmlCopyDtd(); 24043 test_ret += test_xmlCopyNamespace(); 24044 test_ret += test_xmlCopyNamespaceList(); 24045 test_ret += test_xmlCopyNode(); 24046 test_ret += test_xmlCopyNodeList(); 24047 test_ret += test_xmlCopyProp(); 24048 test_ret += test_xmlCopyPropList(); 24049 test_ret += test_xmlCreateIntSubset(); 24050 test_ret += test_xmlDOMWrapAdoptNode(); 24051 test_ret += test_xmlDOMWrapCloneNode(); 24052 test_ret += test_xmlDOMWrapNewCtxt(); 24053 test_ret += test_xmlDOMWrapReconcileNamespaces(); 24054 test_ret += test_xmlDOMWrapRemoveNode(); 24055 test_ret += test_xmlDocCopyNode(); 24056 test_ret += test_xmlDocCopyNodeList(); 24057 test_ret += test_xmlDocDump(); 24058 test_ret += test_xmlDocDumpFormatMemory(); 24059 test_ret += test_xmlDocDumpFormatMemoryEnc(); 24060 test_ret += test_xmlDocDumpMemory(); 24061 test_ret += test_xmlDocDumpMemoryEnc(); 24062 test_ret += test_xmlDocFormatDump(); 24063 test_ret += test_xmlDocGetRootElement(); 24064 test_ret += test_xmlDocSetRootElement(); 24065 test_ret += test_xmlElemDump(); 24066 test_ret += test_xmlFirstElementChild(); 24067 test_ret += test_xmlGetBufferAllocationScheme(); 24068 test_ret += test_xmlGetCompressMode(); 24069 test_ret += test_xmlGetDocCompressMode(); 24070 test_ret += test_xmlGetIntSubset(); 24071 test_ret += test_xmlGetLastChild(); 24072 test_ret += test_xmlGetLineNo(); 24073 test_ret += test_xmlGetNoNsProp(); 24074 test_ret += test_xmlGetNodePath(); 24075 test_ret += test_xmlGetNsList(); 24076 test_ret += test_xmlGetNsProp(); 24077 test_ret += test_xmlGetProp(); 24078 test_ret += test_xmlHasNsProp(); 24079 test_ret += test_xmlHasProp(); 24080 test_ret += test_xmlIsBlankNode(); 24081 test_ret += test_xmlIsXHTML(); 24082 test_ret += test_xmlLastElementChild(); 24083 test_ret += test_xmlNewCDataBlock(); 24084 test_ret += test_xmlNewCharRef(); 24085 test_ret += test_xmlNewChild(); 24086 test_ret += test_xmlNewComment(); 24087 test_ret += test_xmlNewDoc(); 24088 test_ret += test_xmlNewDocComment(); 24089 test_ret += test_xmlNewDocFragment(); 24090 test_ret += test_xmlNewDocNode(); 24091 test_ret += test_xmlNewDocNodeEatName(); 24092 test_ret += test_xmlNewDocPI(); 24093 test_ret += test_xmlNewDocProp(); 24094 test_ret += test_xmlNewDocRawNode(); 24095 test_ret += test_xmlNewDocText(); 24096 test_ret += test_xmlNewDocTextLen(); 24097 test_ret += test_xmlNewDtd(); 24098 test_ret += test_xmlNewNode(); 24099 test_ret += test_xmlNewNodeEatName(); 24100 test_ret += test_xmlNewNs(); 24101 test_ret += test_xmlNewNsProp(); 24102 test_ret += test_xmlNewNsPropEatName(); 24103 test_ret += test_xmlNewPI(); 24104 test_ret += test_xmlNewProp(); 24105 test_ret += test_xmlNewReference(); 24106 test_ret += test_xmlNewText(); 24107 test_ret += test_xmlNewTextChild(); 24108 test_ret += test_xmlNewTextLen(); 24109 test_ret += test_xmlNextElementSibling(); 24110 test_ret += test_xmlNodeAddContent(); 24111 test_ret += test_xmlNodeAddContentLen(); 24112 test_ret += test_xmlNodeBufGetContent(); 24113 test_ret += test_xmlNodeDump(); 24114 test_ret += test_xmlNodeDumpOutput(); 24115 test_ret += test_xmlNodeGetBase(); 24116 test_ret += test_xmlNodeGetContent(); 24117 test_ret += test_xmlNodeGetLang(); 24118 test_ret += test_xmlNodeGetSpacePreserve(); 24119 test_ret += test_xmlNodeIsText(); 24120 test_ret += test_xmlNodeListGetRawString(); 24121 test_ret += test_xmlNodeListGetString(); 24122 test_ret += test_xmlNodeSetBase(); 24123 test_ret += test_xmlNodeSetContent(); 24124 test_ret += test_xmlNodeSetContentLen(); 24125 test_ret += test_xmlNodeSetLang(); 24126 test_ret += test_xmlNodeSetName(); 24127 test_ret += test_xmlNodeSetSpacePreserve(); 24128 test_ret += test_xmlPreviousElementSibling(); 24129 test_ret += test_xmlReconciliateNs(); 24130 test_ret += test_xmlRemoveProp(); 24131 test_ret += test_xmlReplaceNode(); 24132 test_ret += test_xmlSaveFile(); 24133 test_ret += test_xmlSaveFileEnc(); 24134 test_ret += test_xmlSaveFileTo(); 24135 test_ret += test_xmlSaveFormatFile(); 24136 test_ret += test_xmlSaveFormatFileEnc(); 24137 test_ret += test_xmlSaveFormatFileTo(); 24138 test_ret += test_xmlSearchNs(); 24139 test_ret += test_xmlSearchNsByHref(); 24140 test_ret += test_xmlSetBufferAllocationScheme(); 24141 test_ret += test_xmlSetCompressMode(); 24142 test_ret += test_xmlSetDocCompressMode(); 24143 test_ret += test_xmlSetNs(); 24144 test_ret += test_xmlSetNsProp(); 24145 test_ret += test_xmlSetProp(); 24146 test_ret += test_xmlSplitQName2(); 24147 test_ret += test_xmlSplitQName3(); 24148 test_ret += test_xmlStringGetNodeList(); 24149 test_ret += test_xmlStringLenGetNodeList(); 24150 test_ret += test_xmlTextConcat(); 24151 test_ret += test_xmlTextMerge(); 24152 test_ret += test_xmlUnsetNsProp(); 24153 test_ret += test_xmlUnsetProp(); 24154 test_ret += test_xmlValidateNCName(); 24155 test_ret += test_xmlValidateNMToken(); 24156 test_ret += test_xmlValidateName(); 24157 test_ret += test_xmlValidateQName(); 24158 24159 if (test_ret != 0) 24160 printf("Module tree: %d errors\n", test_ret); 24161 return(test_ret); 24162 } 24163 24164 static int 24165 test_xmlBuildRelativeURI(void) { 24166 int test_ret = 0; 24167 24168 int mem_base; 24169 xmlChar * ret_val; 24170 xmlChar * URI; /* the URI reference under consideration */ 24171 int n_URI; 24172 xmlChar * base; /* the base value */ 24173 int n_base; 24174 24175 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 24176 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { 24177 mem_base = xmlMemBlocks(); 24178 URI = gen_const_xmlChar_ptr(n_URI, 0); 24179 base = gen_const_xmlChar_ptr(n_base, 1); 24180 24181 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base); 24182 desret_xmlChar_ptr(ret_val); 24183 call_tests++; 24184 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 24185 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1); 24186 xmlResetLastError(); 24187 if (mem_base != xmlMemBlocks()) { 24188 printf("Leak of %d blocks found in xmlBuildRelativeURI", 24189 xmlMemBlocks() - mem_base); 24190 test_ret++; 24191 printf(" %d", n_URI); 24192 printf(" %d", n_base); 24193 printf("\n"); 24194 } 24195 } 24196 } 24197 function_tests++; 24198 24199 return(test_ret); 24200 } 24201 24202 24203 static int 24204 test_xmlBuildURI(void) { 24205 int test_ret = 0; 24206 24207 int mem_base; 24208 xmlChar * ret_val; 24209 xmlChar * URI; /* the URI instance found in the document */ 24210 int n_URI; 24211 xmlChar * base; /* the base value */ 24212 int n_base; 24213 24214 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { 24215 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { 24216 mem_base = xmlMemBlocks(); 24217 URI = gen_const_xmlChar_ptr(n_URI, 0); 24218 base = gen_const_xmlChar_ptr(n_base, 1); 24219 24220 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base); 24221 desret_xmlChar_ptr(ret_val); 24222 call_tests++; 24223 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); 24224 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1); 24225 xmlResetLastError(); 24226 if (mem_base != xmlMemBlocks()) { 24227 printf("Leak of %d blocks found in xmlBuildURI", 24228 xmlMemBlocks() - mem_base); 24229 test_ret++; 24230 printf(" %d", n_URI); 24231 printf(" %d", n_base); 24232 printf("\n"); 24233 } 24234 } 24235 } 24236 function_tests++; 24237 24238 return(test_ret); 24239 } 24240 24241 24242 static int 24243 test_xmlCanonicPath(void) { 24244 int test_ret = 0; 24245 24246 int mem_base; 24247 xmlChar * ret_val; 24248 xmlChar * path; /* the resource locator in a filesystem notation */ 24249 int n_path; 24250 24251 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { 24252 mem_base = xmlMemBlocks(); 24253 path = gen_const_xmlChar_ptr(n_path, 0); 24254 24255 ret_val = xmlCanonicPath((const xmlChar *)path); 24256 desret_xmlChar_ptr(ret_val); 24257 call_tests++; 24258 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); 24259 xmlResetLastError(); 24260 if (mem_base != xmlMemBlocks()) { 24261 printf("Leak of %d blocks found in xmlCanonicPath", 24262 xmlMemBlocks() - mem_base); 24263 test_ret++; 24264 printf(" %d", n_path); 24265 printf("\n"); 24266 } 24267 } 24268 function_tests++; 24269 24270 return(test_ret); 24271 } 24272 24273 24274 static int 24275 test_xmlCreateURI(void) { 24276 int test_ret = 0; 24277 24278 24279 /* missing type support */ 24280 return(test_ret); 24281 } 24282 24283 24284 static int 24285 test_xmlNormalizeURIPath(void) { 24286 int test_ret = 0; 24287 24288 int mem_base; 24289 int ret_val; 24290 char * path; /* pointer to the path string */ 24291 int n_path; 24292 24293 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) { 24294 mem_base = xmlMemBlocks(); 24295 path = gen_char_ptr(n_path, 0); 24296 24297 ret_val = xmlNormalizeURIPath(path); 24298 desret_int(ret_val); 24299 call_tests++; 24300 des_char_ptr(n_path, path, 0); 24301 xmlResetLastError(); 24302 if (mem_base != xmlMemBlocks()) { 24303 printf("Leak of %d blocks found in xmlNormalizeURIPath", 24304 xmlMemBlocks() - mem_base); 24305 test_ret++; 24306 printf(" %d", n_path); 24307 printf("\n"); 24308 } 24309 } 24310 function_tests++; 24311 24312 return(test_ret); 24313 } 24314 24315 24316 static int 24317 test_xmlParseURI(void) { 24318 int test_ret = 0; 24319 24320 24321 /* missing type support */ 24322 return(test_ret); 24323 } 24324 24325 24326 static int 24327 test_xmlParseURIRaw(void) { 24328 int test_ret = 0; 24329 24330 24331 /* missing type support */ 24332 return(test_ret); 24333 } 24334 24335 24336 #define gen_nb_xmlURIPtr 1 24337 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24338 return(NULL); 24339 } 24340 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24341 } 24342 24343 static int 24344 test_xmlParseURIReference(void) { 24345 int test_ret = 0; 24346 24347 int mem_base; 24348 int ret_val; 24349 xmlURIPtr uri; /* pointer to an URI structure */ 24350 int n_uri; 24351 char * str; /* the string to analyze */ 24352 int n_str; 24353 24354 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { 24355 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { 24356 mem_base = xmlMemBlocks(); 24357 uri = gen_xmlURIPtr(n_uri, 0); 24358 str = gen_const_char_ptr(n_str, 1); 24359 24360 ret_val = xmlParseURIReference(uri, (const char *)str); 24361 desret_int(ret_val); 24362 call_tests++; 24363 des_xmlURIPtr(n_uri, uri, 0); 24364 des_const_char_ptr(n_str, (const char *)str, 1); 24365 xmlResetLastError(); 24366 if (mem_base != xmlMemBlocks()) { 24367 printf("Leak of %d blocks found in xmlParseURIReference", 24368 xmlMemBlocks() - mem_base); 24369 test_ret++; 24370 printf(" %d", n_uri); 24371 printf(" %d", n_str); 24372 printf("\n"); 24373 } 24374 } 24375 } 24376 function_tests++; 24377 24378 return(test_ret); 24379 } 24380 24381 24382 static int 24383 test_xmlPathToURI(void) { 24384 int test_ret = 0; 24385 24386 int mem_base; 24387 xmlChar * ret_val; 24388 xmlChar * path; /* the resource locator in a filesystem notation */ 24389 int n_path; 24390 24391 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { 24392 mem_base = xmlMemBlocks(); 24393 path = gen_const_xmlChar_ptr(n_path, 0); 24394 24395 ret_val = xmlPathToURI((const xmlChar *)path); 24396 desret_xmlChar_ptr(ret_val); 24397 call_tests++; 24398 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); 24399 xmlResetLastError(); 24400 if (mem_base != xmlMemBlocks()) { 24401 printf("Leak of %d blocks found in xmlPathToURI", 24402 xmlMemBlocks() - mem_base); 24403 test_ret++; 24404 printf(" %d", n_path); 24405 printf("\n"); 24406 } 24407 } 24408 function_tests++; 24409 24410 return(test_ret); 24411 } 24412 24413 24414 static int 24415 test_xmlPrintURI(void) { 24416 int test_ret = 0; 24417 24418 int mem_base; 24419 FILE * stream; /* a FILE* for the output */ 24420 int n_stream; 24421 xmlURIPtr uri; /* pointer to an xmlURI */ 24422 int n_uri; 24423 24424 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) { 24425 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { 24426 mem_base = xmlMemBlocks(); 24427 stream = gen_FILE_ptr(n_stream, 0); 24428 uri = gen_xmlURIPtr(n_uri, 1); 24429 24430 xmlPrintURI(stream, uri); 24431 call_tests++; 24432 des_FILE_ptr(n_stream, stream, 0); 24433 des_xmlURIPtr(n_uri, uri, 1); 24434 xmlResetLastError(); 24435 if (mem_base != xmlMemBlocks()) { 24436 printf("Leak of %d blocks found in xmlPrintURI", 24437 xmlMemBlocks() - mem_base); 24438 test_ret++; 24439 printf(" %d", n_stream); 24440 printf(" %d", n_uri); 24441 printf("\n"); 24442 } 24443 } 24444 } 24445 function_tests++; 24446 24447 return(test_ret); 24448 } 24449 24450 24451 static int 24452 test_xmlSaveUri(void) { 24453 int test_ret = 0; 24454 24455 int mem_base; 24456 xmlChar * ret_val; 24457 xmlURIPtr uri; /* pointer to an xmlURI */ 24458 int n_uri; 24459 24460 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { 24461 mem_base = xmlMemBlocks(); 24462 uri = gen_xmlURIPtr(n_uri, 0); 24463 24464 ret_val = xmlSaveUri(uri); 24465 desret_xmlChar_ptr(ret_val); 24466 call_tests++; 24467 des_xmlURIPtr(n_uri, uri, 0); 24468 xmlResetLastError(); 24469 if (mem_base != xmlMemBlocks()) { 24470 printf("Leak of %d blocks found in xmlSaveUri", 24471 xmlMemBlocks() - mem_base); 24472 test_ret++; 24473 printf(" %d", n_uri); 24474 printf("\n"); 24475 } 24476 } 24477 function_tests++; 24478 24479 return(test_ret); 24480 } 24481 24482 24483 static int 24484 test_xmlURIEscape(void) { 24485 int test_ret = 0; 24486 24487 int mem_base; 24488 xmlChar * ret_val; 24489 xmlChar * str; /* the string of the URI to escape */ 24490 int n_str; 24491 24492 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 24493 mem_base = xmlMemBlocks(); 24494 str = gen_const_xmlChar_ptr(n_str, 0); 24495 24496 ret_val = xmlURIEscape((const xmlChar *)str); 24497 desret_xmlChar_ptr(ret_val); 24498 call_tests++; 24499 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); 24500 xmlResetLastError(); 24501 if (mem_base != xmlMemBlocks()) { 24502 printf("Leak of %d blocks found in xmlURIEscape", 24503 xmlMemBlocks() - mem_base); 24504 test_ret++; 24505 printf(" %d", n_str); 24506 printf("\n"); 24507 } 24508 } 24509 function_tests++; 24510 24511 return(test_ret); 24512 } 24513 24514 24515 static int 24516 test_xmlURIEscapeStr(void) { 24517 int test_ret = 0; 24518 24519 int mem_base; 24520 xmlChar * ret_val; 24521 xmlChar * str; /* string to escape */ 24522 int n_str; 24523 xmlChar * list; /* exception list string of chars not to escape */ 24524 int n_list; 24525 24526 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { 24527 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) { 24528 mem_base = xmlMemBlocks(); 24529 str = gen_const_xmlChar_ptr(n_str, 0); 24530 list = gen_const_xmlChar_ptr(n_list, 1); 24531 24532 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list); 24533 desret_xmlChar_ptr(ret_val); 24534 call_tests++; 24535 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); 24536 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1); 24537 xmlResetLastError(); 24538 if (mem_base != xmlMemBlocks()) { 24539 printf("Leak of %d blocks found in xmlURIEscapeStr", 24540 xmlMemBlocks() - mem_base); 24541 test_ret++; 24542 printf(" %d", n_str); 24543 printf(" %d", n_list); 24544 printf("\n"); 24545 } 24546 } 24547 } 24548 function_tests++; 24549 24550 return(test_ret); 24551 } 24552 24553 24554 static int 24555 test_xmlURIUnescapeString(void) { 24556 int test_ret = 0; 24557 24558 24559 /* missing type support */ 24560 return(test_ret); 24561 } 24562 24563 static int 24564 test_uri(void) { 24565 int test_ret = 0; 24566 24567 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n"); 24568 test_ret += test_xmlBuildRelativeURI(); 24569 test_ret += test_xmlBuildURI(); 24570 test_ret += test_xmlCanonicPath(); 24571 test_ret += test_xmlCreateURI(); 24572 test_ret += test_xmlNormalizeURIPath(); 24573 test_ret += test_xmlParseURI(); 24574 test_ret += test_xmlParseURIRaw(); 24575 test_ret += test_xmlParseURIReference(); 24576 test_ret += test_xmlPathToURI(); 24577 test_ret += test_xmlPrintURI(); 24578 test_ret += test_xmlSaveUri(); 24579 test_ret += test_xmlURIEscape(); 24580 test_ret += test_xmlURIEscapeStr(); 24581 test_ret += test_xmlURIUnescapeString(); 24582 24583 if (test_ret != 0) 24584 printf("Module uri: %d errors\n", test_ret); 24585 return(test_ret); 24586 } 24587 24588 static int 24589 test_xmlAddAttributeDecl(void) { 24590 int test_ret = 0; 24591 24592 int mem_base; 24593 xmlAttributePtr ret_val; 24594 xmlValidCtxtPtr ctxt; /* the validation context */ 24595 int n_ctxt; 24596 xmlDtdPtr dtd; /* pointer to the DTD */ 24597 int n_dtd; 24598 xmlChar * elem; /* the element name */ 24599 int n_elem; 24600 xmlChar * name; /* the attribute name */ 24601 int n_name; 24602 xmlChar * ns; /* the attribute namespace prefix */ 24603 int n_ns; 24604 xmlAttributeType type; /* the attribute type */ 24605 int n_type; 24606 xmlAttributeDefault def; /* the attribute default type */ 24607 int n_def; 24608 xmlChar * defaultValue; /* the attribute default value */ 24609 int n_defaultValue; 24610 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */ 24611 int n_tree; 24612 24613 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 24614 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 24615 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 24616 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 24617 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { 24618 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) { 24619 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) { 24620 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) { 24621 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) { 24622 mem_base = xmlMemBlocks(); 24623 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 24624 dtd = gen_xmlDtdPtr(n_dtd, 1); 24625 elem = gen_const_xmlChar_ptr(n_elem, 2); 24626 name = gen_const_xmlChar_ptr(n_name, 3); 24627 ns = gen_const_xmlChar_ptr(n_ns, 4); 24628 type = gen_xmlAttributeType(n_type, 5); 24629 def = gen_xmlAttributeDefault(n_def, 6); 24630 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7); 24631 tree = gen_xmlEnumerationPtr(n_tree, 8); 24632 24633 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree); 24634 desret_xmlAttributePtr(ret_val); 24635 call_tests++; 24636 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 24637 des_xmlDtdPtr(n_dtd, dtd, 1); 24638 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2); 24639 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); 24640 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4); 24641 des_xmlAttributeType(n_type, type, 5); 24642 des_xmlAttributeDefault(n_def, def, 6); 24643 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7); 24644 des_xmlEnumerationPtr(n_tree, tree, 8); 24645 xmlResetLastError(); 24646 if (mem_base != xmlMemBlocks()) { 24647 printf("Leak of %d blocks found in xmlAddAttributeDecl", 24648 xmlMemBlocks() - mem_base); 24649 test_ret++; 24650 printf(" %d", n_ctxt); 24651 printf(" %d", n_dtd); 24652 printf(" %d", n_elem); 24653 printf(" %d", n_name); 24654 printf(" %d", n_ns); 24655 printf(" %d", n_type); 24656 printf(" %d", n_def); 24657 printf(" %d", n_defaultValue); 24658 printf(" %d", n_tree); 24659 printf("\n"); 24660 } 24661 } 24662 } 24663 } 24664 } 24665 } 24666 } 24667 } 24668 } 24669 } 24670 function_tests++; 24671 24672 return(test_ret); 24673 } 24674 24675 24676 static int 24677 test_xmlAddElementDecl(void) { 24678 int test_ret = 0; 24679 24680 int mem_base; 24681 xmlElementPtr ret_val; 24682 xmlValidCtxtPtr ctxt; /* the validation context */ 24683 int n_ctxt; 24684 xmlDtdPtr dtd; /* pointer to the DTD */ 24685 int n_dtd; 24686 xmlChar * name; /* the entity name */ 24687 int n_name; 24688 xmlElementTypeVal type; /* the element type */ 24689 int n_type; 24690 xmlElementContentPtr content; /* the element content tree or NULL */ 24691 int n_content; 24692 24693 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 24694 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 24695 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 24696 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) { 24697 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 24698 mem_base = xmlMemBlocks(); 24699 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 24700 dtd = gen_xmlDtdPtr(n_dtd, 1); 24701 name = gen_const_xmlChar_ptr(n_name, 2); 24702 type = gen_xmlElementTypeVal(n_type, 3); 24703 content = gen_xmlElementContentPtr(n_content, 4); 24704 24705 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content); 24706 desret_xmlElementPtr(ret_val); 24707 call_tests++; 24708 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 24709 des_xmlDtdPtr(n_dtd, dtd, 1); 24710 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 24711 des_xmlElementTypeVal(n_type, type, 3); 24712 des_xmlElementContentPtr(n_content, content, 4); 24713 xmlResetLastError(); 24714 if (mem_base != xmlMemBlocks()) { 24715 printf("Leak of %d blocks found in xmlAddElementDecl", 24716 xmlMemBlocks() - mem_base); 24717 test_ret++; 24718 printf(" %d", n_ctxt); 24719 printf(" %d", n_dtd); 24720 printf(" %d", n_name); 24721 printf(" %d", n_type); 24722 printf(" %d", n_content); 24723 printf("\n"); 24724 } 24725 } 24726 } 24727 } 24728 } 24729 } 24730 function_tests++; 24731 24732 return(test_ret); 24733 } 24734 24735 24736 static int 24737 test_xmlAddID(void) { 24738 int test_ret = 0; 24739 24740 24741 /* missing type support */ 24742 return(test_ret); 24743 } 24744 24745 24746 static int 24747 test_xmlAddNotationDecl(void) { 24748 int test_ret = 0; 24749 24750 24751 /* missing type support */ 24752 return(test_ret); 24753 } 24754 24755 24756 static int 24757 test_xmlAddRef(void) { 24758 int test_ret = 0; 24759 24760 24761 /* missing type support */ 24762 return(test_ret); 24763 } 24764 24765 24766 #define gen_nb_xmlAttributeTablePtr 1 24767 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24768 return(NULL); 24769 } 24770 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24771 } 24772 24773 static int 24774 test_xmlCopyAttributeTable(void) { 24775 int test_ret = 0; 24776 24777 24778 /* missing type support */ 24779 return(test_ret); 24780 } 24781 24782 24783 static int 24784 test_xmlCopyDocElementContent(void) { 24785 int test_ret = 0; 24786 24787 int mem_base; 24788 xmlElementContentPtr ret_val; 24789 xmlDocPtr doc; /* the document owning the element declaration */ 24790 int n_doc; 24791 xmlElementContentPtr cur; /* An element content pointer. */ 24792 int n_cur; 24793 24794 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 24795 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) { 24796 mem_base = xmlMemBlocks(); 24797 doc = gen_xmlDocPtr(n_doc, 0); 24798 cur = gen_xmlElementContentPtr(n_cur, 1); 24799 24800 ret_val = xmlCopyDocElementContent(doc, cur); 24801 desret_xmlElementContentPtr(ret_val); 24802 call_tests++; 24803 des_xmlDocPtr(n_doc, doc, 0); 24804 des_xmlElementContentPtr(n_cur, cur, 1); 24805 xmlResetLastError(); 24806 if (mem_base != xmlMemBlocks()) { 24807 printf("Leak of %d blocks found in xmlCopyDocElementContent", 24808 xmlMemBlocks() - mem_base); 24809 test_ret++; 24810 printf(" %d", n_doc); 24811 printf(" %d", n_cur); 24812 printf("\n"); 24813 } 24814 } 24815 } 24816 function_tests++; 24817 24818 return(test_ret); 24819 } 24820 24821 24822 static int 24823 test_xmlCopyElementContent(void) { 24824 int test_ret = 0; 24825 24826 int mem_base; 24827 xmlElementContentPtr ret_val; 24828 xmlElementContentPtr cur; /* An element content pointer. */ 24829 int n_cur; 24830 24831 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) { 24832 mem_base = xmlMemBlocks(); 24833 cur = gen_xmlElementContentPtr(n_cur, 0); 24834 24835 ret_val = xmlCopyElementContent(cur); 24836 desret_xmlElementContentPtr(ret_val); 24837 call_tests++; 24838 des_xmlElementContentPtr(n_cur, cur, 0); 24839 xmlResetLastError(); 24840 if (mem_base != xmlMemBlocks()) { 24841 printf("Leak of %d blocks found in xmlCopyElementContent", 24842 xmlMemBlocks() - mem_base); 24843 test_ret++; 24844 printf(" %d", n_cur); 24845 printf("\n"); 24846 } 24847 } 24848 function_tests++; 24849 24850 return(test_ret); 24851 } 24852 24853 24854 #define gen_nb_xmlElementTablePtr 1 24855 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24856 return(NULL); 24857 } 24858 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24859 } 24860 24861 static int 24862 test_xmlCopyElementTable(void) { 24863 int test_ret = 0; 24864 24865 24866 /* missing type support */ 24867 return(test_ret); 24868 } 24869 24870 24871 static int 24872 test_xmlCopyEnumeration(void) { 24873 int test_ret = 0; 24874 24875 24876 /* missing type support */ 24877 return(test_ret); 24878 } 24879 24880 24881 #define gen_nb_xmlNotationTablePtr 1 24882 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24883 return(NULL); 24884 } 24885 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24886 } 24887 24888 static int 24889 test_xmlCopyNotationTable(void) { 24890 int test_ret = 0; 24891 24892 24893 /* missing type support */ 24894 return(test_ret); 24895 } 24896 24897 24898 static int 24899 test_xmlCreateEnumeration(void) { 24900 int test_ret = 0; 24901 24902 24903 /* missing type support */ 24904 return(test_ret); 24905 } 24906 24907 24908 #define gen_nb_xmlAttributePtr 1 24909 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24910 return(NULL); 24911 } 24912 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24913 } 24914 24915 static int 24916 test_xmlDumpAttributeDecl(void) { 24917 int test_ret = 0; 24918 24919 #if defined(LIBXML_OUTPUT_ENABLED) 24920 int mem_base; 24921 xmlBufferPtr buf; /* the XML buffer output */ 24922 int n_buf; 24923 xmlAttributePtr attr; /* An attribute declaration */ 24924 int n_attr; 24925 24926 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 24927 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) { 24928 mem_base = xmlMemBlocks(); 24929 buf = gen_xmlBufferPtr(n_buf, 0); 24930 attr = gen_xmlAttributePtr(n_attr, 1); 24931 24932 xmlDumpAttributeDecl(buf, attr); 24933 call_tests++; 24934 des_xmlBufferPtr(n_buf, buf, 0); 24935 des_xmlAttributePtr(n_attr, attr, 1); 24936 xmlResetLastError(); 24937 if (mem_base != xmlMemBlocks()) { 24938 printf("Leak of %d blocks found in xmlDumpAttributeDecl", 24939 xmlMemBlocks() - mem_base); 24940 test_ret++; 24941 printf(" %d", n_buf); 24942 printf(" %d", n_attr); 24943 printf("\n"); 24944 } 24945 } 24946 } 24947 function_tests++; 24948 #endif 24949 24950 return(test_ret); 24951 } 24952 24953 24954 static int 24955 test_xmlDumpAttributeTable(void) { 24956 int test_ret = 0; 24957 24958 #if defined(LIBXML_OUTPUT_ENABLED) 24959 int mem_base; 24960 xmlBufferPtr buf; /* the XML buffer output */ 24961 int n_buf; 24962 xmlAttributeTablePtr table; /* An attribute table */ 24963 int n_table; 24964 24965 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 24966 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) { 24967 mem_base = xmlMemBlocks(); 24968 buf = gen_xmlBufferPtr(n_buf, 0); 24969 table = gen_xmlAttributeTablePtr(n_table, 1); 24970 24971 xmlDumpAttributeTable(buf, table); 24972 call_tests++; 24973 des_xmlBufferPtr(n_buf, buf, 0); 24974 des_xmlAttributeTablePtr(n_table, table, 1); 24975 xmlResetLastError(); 24976 if (mem_base != xmlMemBlocks()) { 24977 printf("Leak of %d blocks found in xmlDumpAttributeTable", 24978 xmlMemBlocks() - mem_base); 24979 test_ret++; 24980 printf(" %d", n_buf); 24981 printf(" %d", n_table); 24982 printf("\n"); 24983 } 24984 } 24985 } 24986 function_tests++; 24987 #endif 24988 24989 return(test_ret); 24990 } 24991 24992 24993 #define gen_nb_xmlElementPtr 1 24994 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24995 return(NULL); 24996 } 24997 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 24998 } 24999 25000 static int 25001 test_xmlDumpElementDecl(void) { 25002 int test_ret = 0; 25003 25004 #if defined(LIBXML_OUTPUT_ENABLED) 25005 int mem_base; 25006 xmlBufferPtr buf; /* the XML buffer output */ 25007 int n_buf; 25008 xmlElementPtr elem; /* An element table */ 25009 int n_elem; 25010 25011 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25012 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { 25013 mem_base = xmlMemBlocks(); 25014 buf = gen_xmlBufferPtr(n_buf, 0); 25015 elem = gen_xmlElementPtr(n_elem, 1); 25016 25017 xmlDumpElementDecl(buf, elem); 25018 call_tests++; 25019 des_xmlBufferPtr(n_buf, buf, 0); 25020 des_xmlElementPtr(n_elem, elem, 1); 25021 xmlResetLastError(); 25022 if (mem_base != xmlMemBlocks()) { 25023 printf("Leak of %d blocks found in xmlDumpElementDecl", 25024 xmlMemBlocks() - mem_base); 25025 test_ret++; 25026 printf(" %d", n_buf); 25027 printf(" %d", n_elem); 25028 printf("\n"); 25029 } 25030 } 25031 } 25032 function_tests++; 25033 #endif 25034 25035 return(test_ret); 25036 } 25037 25038 25039 static int 25040 test_xmlDumpElementTable(void) { 25041 int test_ret = 0; 25042 25043 #if defined(LIBXML_OUTPUT_ENABLED) 25044 int mem_base; 25045 xmlBufferPtr buf; /* the XML buffer output */ 25046 int n_buf; 25047 xmlElementTablePtr table; /* An element table */ 25048 int n_table; 25049 25050 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25051 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) { 25052 mem_base = xmlMemBlocks(); 25053 buf = gen_xmlBufferPtr(n_buf, 0); 25054 table = gen_xmlElementTablePtr(n_table, 1); 25055 25056 xmlDumpElementTable(buf, table); 25057 call_tests++; 25058 des_xmlBufferPtr(n_buf, buf, 0); 25059 des_xmlElementTablePtr(n_table, table, 1); 25060 xmlResetLastError(); 25061 if (mem_base != xmlMemBlocks()) { 25062 printf("Leak of %d blocks found in xmlDumpElementTable", 25063 xmlMemBlocks() - mem_base); 25064 test_ret++; 25065 printf(" %d", n_buf); 25066 printf(" %d", n_table); 25067 printf("\n"); 25068 } 25069 } 25070 } 25071 function_tests++; 25072 #endif 25073 25074 return(test_ret); 25075 } 25076 25077 25078 #define gen_nb_xmlNotationPtr 1 25079 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25080 return(NULL); 25081 } 25082 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25083 } 25084 25085 static int 25086 test_xmlDumpNotationDecl(void) { 25087 int test_ret = 0; 25088 25089 #if defined(LIBXML_OUTPUT_ENABLED) 25090 int mem_base; 25091 xmlBufferPtr buf; /* the XML buffer output */ 25092 int n_buf; 25093 xmlNotationPtr nota; /* A notation declaration */ 25094 int n_nota; 25095 25096 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25097 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) { 25098 mem_base = xmlMemBlocks(); 25099 buf = gen_xmlBufferPtr(n_buf, 0); 25100 nota = gen_xmlNotationPtr(n_nota, 1); 25101 25102 xmlDumpNotationDecl(buf, nota); 25103 call_tests++; 25104 des_xmlBufferPtr(n_buf, buf, 0); 25105 des_xmlNotationPtr(n_nota, nota, 1); 25106 xmlResetLastError(); 25107 if (mem_base != xmlMemBlocks()) { 25108 printf("Leak of %d blocks found in xmlDumpNotationDecl", 25109 xmlMemBlocks() - mem_base); 25110 test_ret++; 25111 printf(" %d", n_buf); 25112 printf(" %d", n_nota); 25113 printf("\n"); 25114 } 25115 } 25116 } 25117 function_tests++; 25118 #endif 25119 25120 return(test_ret); 25121 } 25122 25123 25124 static int 25125 test_xmlDumpNotationTable(void) { 25126 int test_ret = 0; 25127 25128 #if defined(LIBXML_OUTPUT_ENABLED) 25129 int mem_base; 25130 xmlBufferPtr buf; /* the XML buffer output */ 25131 int n_buf; 25132 xmlNotationTablePtr table; /* A notation table */ 25133 int n_table; 25134 25135 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { 25136 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) { 25137 mem_base = xmlMemBlocks(); 25138 buf = gen_xmlBufferPtr(n_buf, 0); 25139 table = gen_xmlNotationTablePtr(n_table, 1); 25140 25141 xmlDumpNotationTable(buf, table); 25142 call_tests++; 25143 des_xmlBufferPtr(n_buf, buf, 0); 25144 des_xmlNotationTablePtr(n_table, table, 1); 25145 xmlResetLastError(); 25146 if (mem_base != xmlMemBlocks()) { 25147 printf("Leak of %d blocks found in xmlDumpNotationTable", 25148 xmlMemBlocks() - mem_base); 25149 test_ret++; 25150 printf(" %d", n_buf); 25151 printf(" %d", n_table); 25152 printf("\n"); 25153 } 25154 } 25155 } 25156 function_tests++; 25157 #endif 25158 25159 return(test_ret); 25160 } 25161 25162 25163 static int 25164 test_xmlGetDtdAttrDesc(void) { 25165 int test_ret = 0; 25166 25167 int mem_base; 25168 xmlAttributePtr ret_val; 25169 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25170 int n_dtd; 25171 xmlChar * elem; /* the element name */ 25172 int n_elem; 25173 xmlChar * name; /* the attribute name */ 25174 int n_name; 25175 25176 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25177 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 25178 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25179 mem_base = xmlMemBlocks(); 25180 dtd = gen_xmlDtdPtr(n_dtd, 0); 25181 elem = gen_const_xmlChar_ptr(n_elem, 1); 25182 name = gen_const_xmlChar_ptr(n_name, 2); 25183 25184 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name); 25185 desret_xmlAttributePtr(ret_val); 25186 call_tests++; 25187 des_xmlDtdPtr(n_dtd, dtd, 0); 25188 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); 25189 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 25190 xmlResetLastError(); 25191 if (mem_base != xmlMemBlocks()) { 25192 printf("Leak of %d blocks found in xmlGetDtdAttrDesc", 25193 xmlMemBlocks() - mem_base); 25194 test_ret++; 25195 printf(" %d", n_dtd); 25196 printf(" %d", n_elem); 25197 printf(" %d", n_name); 25198 printf("\n"); 25199 } 25200 } 25201 } 25202 } 25203 function_tests++; 25204 25205 return(test_ret); 25206 } 25207 25208 25209 static int 25210 test_xmlGetDtdElementDesc(void) { 25211 int test_ret = 0; 25212 25213 int mem_base; 25214 xmlElementPtr ret_val; 25215 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25216 int n_dtd; 25217 xmlChar * name; /* the element name */ 25218 int n_name; 25219 25220 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25221 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25222 mem_base = xmlMemBlocks(); 25223 dtd = gen_xmlDtdPtr(n_dtd, 0); 25224 name = gen_const_xmlChar_ptr(n_name, 1); 25225 25226 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name); 25227 desret_xmlElementPtr(ret_val); 25228 call_tests++; 25229 des_xmlDtdPtr(n_dtd, dtd, 0); 25230 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25231 xmlResetLastError(); 25232 if (mem_base != xmlMemBlocks()) { 25233 printf("Leak of %d blocks found in xmlGetDtdElementDesc", 25234 xmlMemBlocks() - mem_base); 25235 test_ret++; 25236 printf(" %d", n_dtd); 25237 printf(" %d", n_name); 25238 printf("\n"); 25239 } 25240 } 25241 } 25242 function_tests++; 25243 25244 return(test_ret); 25245 } 25246 25247 25248 static int 25249 test_xmlGetDtdNotationDesc(void) { 25250 int test_ret = 0; 25251 25252 25253 /* missing type support */ 25254 return(test_ret); 25255 } 25256 25257 25258 static int 25259 test_xmlGetDtdQAttrDesc(void) { 25260 int test_ret = 0; 25261 25262 int mem_base; 25263 xmlAttributePtr ret_val; 25264 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25265 int n_dtd; 25266 xmlChar * elem; /* the element name */ 25267 int n_elem; 25268 xmlChar * name; /* the attribute name */ 25269 int n_name; 25270 xmlChar * prefix; /* the attribute namespace prefix */ 25271 int n_prefix; 25272 25273 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25274 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { 25275 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25276 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 25277 mem_base = xmlMemBlocks(); 25278 dtd = gen_xmlDtdPtr(n_dtd, 0); 25279 elem = gen_const_xmlChar_ptr(n_elem, 1); 25280 name = gen_const_xmlChar_ptr(n_name, 2); 25281 prefix = gen_const_xmlChar_ptr(n_prefix, 3); 25282 25283 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix); 25284 desret_xmlAttributePtr(ret_val); 25285 call_tests++; 25286 des_xmlDtdPtr(n_dtd, dtd, 0); 25287 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); 25288 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 25289 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3); 25290 xmlResetLastError(); 25291 if (mem_base != xmlMemBlocks()) { 25292 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc", 25293 xmlMemBlocks() - mem_base); 25294 test_ret++; 25295 printf(" %d", n_dtd); 25296 printf(" %d", n_elem); 25297 printf(" %d", n_name); 25298 printf(" %d", n_prefix); 25299 printf("\n"); 25300 } 25301 } 25302 } 25303 } 25304 } 25305 function_tests++; 25306 25307 return(test_ret); 25308 } 25309 25310 25311 static int 25312 test_xmlGetDtdQElementDesc(void) { 25313 int test_ret = 0; 25314 25315 int mem_base; 25316 xmlElementPtr ret_val; 25317 xmlDtdPtr dtd; /* a pointer to the DtD to search */ 25318 int n_dtd; 25319 xmlChar * name; /* the element name */ 25320 int n_name; 25321 xmlChar * prefix; /* the element namespace prefix */ 25322 int n_prefix; 25323 25324 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 25325 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25326 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 25327 mem_base = xmlMemBlocks(); 25328 dtd = gen_xmlDtdPtr(n_dtd, 0); 25329 name = gen_const_xmlChar_ptr(n_name, 1); 25330 prefix = gen_const_xmlChar_ptr(n_prefix, 2); 25331 25332 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix); 25333 desret_xmlElementPtr(ret_val); 25334 call_tests++; 25335 des_xmlDtdPtr(n_dtd, dtd, 0); 25336 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25337 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); 25338 xmlResetLastError(); 25339 if (mem_base != xmlMemBlocks()) { 25340 printf("Leak of %d blocks found in xmlGetDtdQElementDesc", 25341 xmlMemBlocks() - mem_base); 25342 test_ret++; 25343 printf(" %d", n_dtd); 25344 printf(" %d", n_name); 25345 printf(" %d", n_prefix); 25346 printf("\n"); 25347 } 25348 } 25349 } 25350 } 25351 function_tests++; 25352 25353 return(test_ret); 25354 } 25355 25356 25357 static int 25358 test_xmlGetID(void) { 25359 int test_ret = 0; 25360 25361 int mem_base; 25362 xmlAttrPtr ret_val; 25363 xmlDocPtr doc; /* pointer to the document */ 25364 int n_doc; 25365 xmlChar * ID; /* the ID value */ 25366 int n_ID; 25367 25368 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25369 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { 25370 mem_base = xmlMemBlocks(); 25371 doc = gen_xmlDocPtr(n_doc, 0); 25372 ID = gen_const_xmlChar_ptr(n_ID, 1); 25373 25374 ret_val = xmlGetID(doc, (const xmlChar *)ID); 25375 desret_xmlAttrPtr(ret_val); 25376 call_tests++; 25377 des_xmlDocPtr(n_doc, doc, 0); 25378 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1); 25379 xmlResetLastError(); 25380 if (mem_base != xmlMemBlocks()) { 25381 printf("Leak of %d blocks found in xmlGetID", 25382 xmlMemBlocks() - mem_base); 25383 test_ret++; 25384 printf(" %d", n_doc); 25385 printf(" %d", n_ID); 25386 printf("\n"); 25387 } 25388 } 25389 } 25390 function_tests++; 25391 25392 return(test_ret); 25393 } 25394 25395 25396 static int 25397 test_xmlGetRefs(void) { 25398 int test_ret = 0; 25399 25400 25401 /* missing type support */ 25402 return(test_ret); 25403 } 25404 25405 25406 static int 25407 test_xmlIsID(void) { 25408 int test_ret = 0; 25409 25410 int mem_base; 25411 int ret_val; 25412 xmlDocPtr doc; /* the document */ 25413 int n_doc; 25414 xmlNodePtr elem; /* the element carrying the attribute */ 25415 int n_elem; 25416 xmlAttrPtr attr; /* the attribute */ 25417 int n_attr; 25418 25419 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25420 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 25421 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25422 mem_base = xmlMemBlocks(); 25423 doc = gen_xmlDocPtr(n_doc, 0); 25424 elem = gen_xmlNodePtr(n_elem, 1); 25425 attr = gen_xmlAttrPtr(n_attr, 2); 25426 25427 ret_val = xmlIsID(doc, elem, attr); 25428 desret_int(ret_val); 25429 call_tests++; 25430 des_xmlDocPtr(n_doc, doc, 0); 25431 des_xmlNodePtr(n_elem, elem, 1); 25432 des_xmlAttrPtr(n_attr, attr, 2); 25433 xmlResetLastError(); 25434 if (mem_base != xmlMemBlocks()) { 25435 printf("Leak of %d blocks found in xmlIsID", 25436 xmlMemBlocks() - mem_base); 25437 test_ret++; 25438 printf(" %d", n_doc); 25439 printf(" %d", n_elem); 25440 printf(" %d", n_attr); 25441 printf("\n"); 25442 } 25443 } 25444 } 25445 } 25446 function_tests++; 25447 25448 return(test_ret); 25449 } 25450 25451 25452 static int 25453 test_xmlIsMixedElement(void) { 25454 int test_ret = 0; 25455 25456 int mem_base; 25457 int ret_val; 25458 xmlDocPtr doc; /* the document */ 25459 int n_doc; 25460 xmlChar * name; /* the element name */ 25461 int n_name; 25462 25463 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25464 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25465 mem_base = xmlMemBlocks(); 25466 doc = gen_xmlDocPtr(n_doc, 0); 25467 name = gen_const_xmlChar_ptr(n_name, 1); 25468 25469 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name); 25470 desret_int(ret_val); 25471 call_tests++; 25472 des_xmlDocPtr(n_doc, doc, 0); 25473 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25474 xmlResetLastError(); 25475 if (mem_base != xmlMemBlocks()) { 25476 printf("Leak of %d blocks found in xmlIsMixedElement", 25477 xmlMemBlocks() - mem_base); 25478 test_ret++; 25479 printf(" %d", n_doc); 25480 printf(" %d", n_name); 25481 printf("\n"); 25482 } 25483 } 25484 } 25485 function_tests++; 25486 25487 return(test_ret); 25488 } 25489 25490 25491 static int 25492 test_xmlIsRef(void) { 25493 int test_ret = 0; 25494 25495 int mem_base; 25496 int ret_val; 25497 xmlDocPtr doc; /* the document */ 25498 int n_doc; 25499 xmlNodePtr elem; /* the element carrying the attribute */ 25500 int n_elem; 25501 xmlAttrPtr attr; /* the attribute */ 25502 int n_attr; 25503 25504 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25505 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 25506 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25507 mem_base = xmlMemBlocks(); 25508 doc = gen_xmlDocPtr(n_doc, 0); 25509 elem = gen_xmlNodePtr(n_elem, 1); 25510 attr = gen_xmlAttrPtr(n_attr, 2); 25511 25512 ret_val = xmlIsRef(doc, elem, attr); 25513 desret_int(ret_val); 25514 call_tests++; 25515 des_xmlDocPtr(n_doc, doc, 0); 25516 des_xmlNodePtr(n_elem, elem, 1); 25517 des_xmlAttrPtr(n_attr, attr, 2); 25518 xmlResetLastError(); 25519 if (mem_base != xmlMemBlocks()) { 25520 printf("Leak of %d blocks found in xmlIsRef", 25521 xmlMemBlocks() - mem_base); 25522 test_ret++; 25523 printf(" %d", n_doc); 25524 printf(" %d", n_elem); 25525 printf(" %d", n_attr); 25526 printf("\n"); 25527 } 25528 } 25529 } 25530 } 25531 function_tests++; 25532 25533 return(test_ret); 25534 } 25535 25536 25537 static int 25538 test_xmlNewDocElementContent(void) { 25539 int test_ret = 0; 25540 25541 int mem_base; 25542 xmlElementContentPtr ret_val; 25543 xmlDocPtr doc; /* the document */ 25544 int n_doc; 25545 xmlChar * name; /* the subelement name or NULL */ 25546 int n_name; 25547 xmlElementContentType type; /* the type of element content decl */ 25548 int n_type; 25549 25550 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25551 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25552 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) { 25553 mem_base = xmlMemBlocks(); 25554 doc = gen_xmlDocPtr(n_doc, 0); 25555 name = gen_const_xmlChar_ptr(n_name, 1); 25556 type = gen_xmlElementContentType(n_type, 2); 25557 25558 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type); 25559 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL; 25560 desret_xmlElementContentPtr(ret_val); 25561 call_tests++; 25562 des_xmlDocPtr(n_doc, doc, 0); 25563 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); 25564 des_xmlElementContentType(n_type, type, 2); 25565 xmlResetLastError(); 25566 if (mem_base != xmlMemBlocks()) { 25567 printf("Leak of %d blocks found in xmlNewDocElementContent", 25568 xmlMemBlocks() - mem_base); 25569 test_ret++; 25570 printf(" %d", n_doc); 25571 printf(" %d", n_name); 25572 printf(" %d", n_type); 25573 printf("\n"); 25574 } 25575 } 25576 } 25577 } 25578 function_tests++; 25579 25580 return(test_ret); 25581 } 25582 25583 25584 static int 25585 test_xmlNewElementContent(void) { 25586 int test_ret = 0; 25587 25588 int mem_base; 25589 xmlElementContentPtr ret_val; 25590 xmlChar * name; /* the subelement name or NULL */ 25591 int n_name; 25592 xmlElementContentType type; /* the type of element content decl */ 25593 int n_type; 25594 25595 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25596 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) { 25597 mem_base = xmlMemBlocks(); 25598 name = gen_const_xmlChar_ptr(n_name, 0); 25599 type = gen_xmlElementContentType(n_type, 1); 25600 25601 ret_val = xmlNewElementContent((const xmlChar *)name, type); 25602 desret_xmlElementContentPtr(ret_val); 25603 call_tests++; 25604 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); 25605 des_xmlElementContentType(n_type, type, 1); 25606 xmlResetLastError(); 25607 if (mem_base != xmlMemBlocks()) { 25608 printf("Leak of %d blocks found in xmlNewElementContent", 25609 xmlMemBlocks() - mem_base); 25610 test_ret++; 25611 printf(" %d", n_name); 25612 printf(" %d", n_type); 25613 printf("\n"); 25614 } 25615 } 25616 } 25617 function_tests++; 25618 25619 return(test_ret); 25620 } 25621 25622 25623 static int 25624 test_xmlNewValidCtxt(void) { 25625 int test_ret = 0; 25626 25627 25628 /* missing type support */ 25629 return(test_ret); 25630 } 25631 25632 25633 static int 25634 test_xmlRemoveID(void) { 25635 int test_ret = 0; 25636 25637 int mem_base; 25638 int ret_val; 25639 xmlDocPtr doc; /* the document */ 25640 int n_doc; 25641 xmlAttrPtr attr; /* the attribute */ 25642 int n_attr; 25643 25644 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25645 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25646 mem_base = xmlMemBlocks(); 25647 doc = gen_xmlDocPtr(n_doc, 0); 25648 attr = gen_xmlAttrPtr(n_attr, 1); 25649 25650 ret_val = xmlRemoveID(doc, attr); 25651 desret_int(ret_val); 25652 call_tests++; 25653 des_xmlDocPtr(n_doc, doc, 0); 25654 des_xmlAttrPtr(n_attr, attr, 1); 25655 xmlResetLastError(); 25656 if (mem_base != xmlMemBlocks()) { 25657 printf("Leak of %d blocks found in xmlRemoveID", 25658 xmlMemBlocks() - mem_base); 25659 test_ret++; 25660 printf(" %d", n_doc); 25661 printf(" %d", n_attr); 25662 printf("\n"); 25663 } 25664 } 25665 } 25666 function_tests++; 25667 25668 return(test_ret); 25669 } 25670 25671 25672 static int 25673 test_xmlRemoveRef(void) { 25674 int test_ret = 0; 25675 25676 int mem_base; 25677 int ret_val; 25678 xmlDocPtr doc; /* the document */ 25679 int n_doc; 25680 xmlAttrPtr attr; /* the attribute */ 25681 int n_attr; 25682 25683 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25684 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 25685 mem_base = xmlMemBlocks(); 25686 doc = gen_xmlDocPtr(n_doc, 0); 25687 attr = gen_xmlAttrPtr(n_attr, 1); 25688 25689 ret_val = xmlRemoveRef(doc, attr); 25690 desret_int(ret_val); 25691 call_tests++; 25692 des_xmlDocPtr(n_doc, doc, 0); 25693 des_xmlAttrPtr(n_attr, attr, 1); 25694 xmlResetLastError(); 25695 if (mem_base != xmlMemBlocks()) { 25696 printf("Leak of %d blocks found in xmlRemoveRef", 25697 xmlMemBlocks() - mem_base); 25698 test_ret++; 25699 printf(" %d", n_doc); 25700 printf(" %d", n_attr); 25701 printf("\n"); 25702 } 25703 } 25704 } 25705 function_tests++; 25706 25707 return(test_ret); 25708 } 25709 25710 25711 static int 25712 test_xmlSnprintfElementContent(void) { 25713 int test_ret = 0; 25714 25715 int mem_base; 25716 char * buf; /* an output buffer */ 25717 int n_buf; 25718 int size; /* the buffer size */ 25719 int n_size; 25720 xmlElementContentPtr content; /* An element table */ 25721 int n_content; 25722 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */ 25723 int n_englob; 25724 25725 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) { 25726 for (n_size = 0;n_size < gen_nb_int;n_size++) { 25727 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 25728 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) { 25729 mem_base = xmlMemBlocks(); 25730 buf = gen_char_ptr(n_buf, 0); 25731 size = gen_int(n_size, 1); 25732 content = gen_xmlElementContentPtr(n_content, 2); 25733 englob = gen_int(n_englob, 3); 25734 25735 xmlSnprintfElementContent(buf, size, content, englob); 25736 call_tests++; 25737 des_char_ptr(n_buf, buf, 0); 25738 des_int(n_size, size, 1); 25739 des_xmlElementContentPtr(n_content, content, 2); 25740 des_int(n_englob, englob, 3); 25741 xmlResetLastError(); 25742 if (mem_base != xmlMemBlocks()) { 25743 printf("Leak of %d blocks found in xmlSnprintfElementContent", 25744 xmlMemBlocks() - mem_base); 25745 test_ret++; 25746 printf(" %d", n_buf); 25747 printf(" %d", n_size); 25748 printf(" %d", n_content); 25749 printf(" %d", n_englob); 25750 printf("\n"); 25751 } 25752 } 25753 } 25754 } 25755 } 25756 function_tests++; 25757 25758 return(test_ret); 25759 } 25760 25761 25762 static int 25763 test_xmlSprintfElementContent(void) { 25764 int test_ret = 0; 25765 25766 #if defined(LIBXML_OUTPUT_ENABLED) 25767 #ifdef LIBXML_OUTPUT_ENABLED 25768 int mem_base; 25769 char * buf; /* an output buffer */ 25770 int n_buf; 25771 xmlElementContentPtr content; /* An element table */ 25772 int n_content; 25773 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */ 25774 int n_englob; 25775 25776 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) { 25777 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { 25778 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) { 25779 mem_base = xmlMemBlocks(); 25780 buf = gen_char_ptr(n_buf, 0); 25781 content = gen_xmlElementContentPtr(n_content, 1); 25782 englob = gen_int(n_englob, 2); 25783 25784 xmlSprintfElementContent(buf, content, englob); 25785 call_tests++; 25786 des_char_ptr(n_buf, buf, 0); 25787 des_xmlElementContentPtr(n_content, content, 1); 25788 des_int(n_englob, englob, 2); 25789 xmlResetLastError(); 25790 if (mem_base != xmlMemBlocks()) { 25791 printf("Leak of %d blocks found in xmlSprintfElementContent", 25792 xmlMemBlocks() - mem_base); 25793 test_ret++; 25794 printf(" %d", n_buf); 25795 printf(" %d", n_content); 25796 printf(" %d", n_englob); 25797 printf("\n"); 25798 } 25799 } 25800 } 25801 } 25802 function_tests++; 25803 #endif 25804 #endif 25805 25806 return(test_ret); 25807 } 25808 25809 25810 static int 25811 test_xmlValidBuildContentModel(void) { 25812 int test_ret = 0; 25813 25814 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 25815 int mem_base; 25816 int ret_val; 25817 xmlValidCtxtPtr ctxt; /* a validation context */ 25818 int n_ctxt; 25819 xmlElementPtr elem; /* an element declaration node */ 25820 int n_elem; 25821 25822 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 25823 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { 25824 mem_base = xmlMemBlocks(); 25825 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 25826 elem = gen_xmlElementPtr(n_elem, 1); 25827 25828 ret_val = xmlValidBuildContentModel(ctxt, elem); 25829 desret_int(ret_val); 25830 call_tests++; 25831 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 25832 des_xmlElementPtr(n_elem, elem, 1); 25833 xmlResetLastError(); 25834 if (mem_base != xmlMemBlocks()) { 25835 printf("Leak of %d blocks found in xmlValidBuildContentModel", 25836 xmlMemBlocks() - mem_base); 25837 test_ret++; 25838 printf(" %d", n_ctxt); 25839 printf(" %d", n_elem); 25840 printf("\n"); 25841 } 25842 } 25843 } 25844 function_tests++; 25845 #endif 25846 25847 return(test_ret); 25848 } 25849 25850 25851 static int 25852 test_xmlValidCtxtNormalizeAttributeValue(void) { 25853 int test_ret = 0; 25854 25855 #if defined(LIBXML_VALID_ENABLED) 25856 int mem_base; 25857 xmlChar * ret_val; 25858 xmlValidCtxtPtr ctxt; /* the validation context or NULL */ 25859 int n_ctxt; 25860 xmlDocPtr doc; /* the document */ 25861 int n_doc; 25862 xmlNodePtr elem; /* the parent */ 25863 int n_elem; 25864 xmlChar * name; /* the attribute name */ 25865 int n_name; 25866 xmlChar * value; /* the attribute value */ 25867 int n_value; 25868 25869 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 25870 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 25871 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 25872 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 25873 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 25874 mem_base = xmlMemBlocks(); 25875 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 25876 doc = gen_xmlDocPtr(n_doc, 1); 25877 elem = gen_xmlNodePtr(n_elem, 2); 25878 name = gen_const_xmlChar_ptr(n_name, 3); 25879 value = gen_const_xmlChar_ptr(n_value, 4); 25880 25881 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value); 25882 desret_xmlChar_ptr(ret_val); 25883 call_tests++; 25884 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 25885 des_xmlDocPtr(n_doc, doc, 1); 25886 des_xmlNodePtr(n_elem, elem, 2); 25887 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); 25888 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4); 25889 xmlResetLastError(); 25890 if (mem_base != xmlMemBlocks()) { 25891 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue", 25892 xmlMemBlocks() - mem_base); 25893 test_ret++; 25894 printf(" %d", n_ctxt); 25895 printf(" %d", n_doc); 25896 printf(" %d", n_elem); 25897 printf(" %d", n_name); 25898 printf(" %d", n_value); 25899 printf("\n"); 25900 } 25901 } 25902 } 25903 } 25904 } 25905 } 25906 function_tests++; 25907 #endif 25908 25909 return(test_ret); 25910 } 25911 25912 25913 #define gen_nb_xmlElementContent_ptr 1 25914 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25915 return(NULL); 25916 } 25917 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 25918 } 25919 25920 static int 25921 test_xmlValidGetPotentialChildren(void) { 25922 int test_ret = 0; 25923 25924 #if defined(LIBXML_VALID_ENABLED) 25925 #ifdef LIBXML_VALID_ENABLED 25926 int mem_base; 25927 int ret_val; 25928 xmlElementContent * ctree; /* an element content tree */ 25929 int n_ctree; 25930 xmlChar ** names; /* an array to store the list of child names */ 25931 int n_names; 25932 int * len; /* a pointer to the number of element in the list */ 25933 int n_len; 25934 int max; /* the size of the array */ 25935 int n_max; 25936 25937 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) { 25938 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { 25939 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { 25940 for (n_max = 0;n_max < gen_nb_int;n_max++) { 25941 mem_base = xmlMemBlocks(); 25942 ctree = gen_xmlElementContent_ptr(n_ctree, 0); 25943 names = gen_const_xmlChar_ptr_ptr(n_names, 1); 25944 len = gen_int_ptr(n_len, 2); 25945 max = gen_int(n_max, 3); 25946 25947 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max); 25948 desret_int(ret_val); 25949 call_tests++; 25950 des_xmlElementContent_ptr(n_ctree, ctree, 0); 25951 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1); 25952 des_int_ptr(n_len, len, 2); 25953 des_int(n_max, max, 3); 25954 xmlResetLastError(); 25955 if (mem_base != xmlMemBlocks()) { 25956 printf("Leak of %d blocks found in xmlValidGetPotentialChildren", 25957 xmlMemBlocks() - mem_base); 25958 test_ret++; 25959 printf(" %d", n_ctree); 25960 printf(" %d", n_names); 25961 printf(" %d", n_len); 25962 printf(" %d", n_max); 25963 printf("\n"); 25964 } 25965 } 25966 } 25967 } 25968 } 25969 function_tests++; 25970 #endif 25971 #endif 25972 25973 return(test_ret); 25974 } 25975 25976 25977 static int 25978 test_xmlValidGetValidElements(void) { 25979 int test_ret = 0; 25980 25981 #if defined(LIBXML_VALID_ENABLED) 25982 #ifdef LIBXML_VALID_ENABLED 25983 int mem_base; 25984 int ret_val; 25985 xmlNode * prev; /* an element to insert after */ 25986 int n_prev; 25987 xmlNode * next; /* an element to insert next */ 25988 int n_next; 25989 xmlChar ** names; /* an array to store the list of child names */ 25990 int n_names; 25991 int max; /* the size of the array */ 25992 int n_max; 25993 25994 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) { 25995 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) { 25996 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { 25997 for (n_max = 0;n_max < gen_nb_int;n_max++) { 25998 mem_base = xmlMemBlocks(); 25999 prev = gen_xmlNodePtr(n_prev, 0); 26000 next = gen_xmlNodePtr(n_next, 1); 26001 names = gen_const_xmlChar_ptr_ptr(n_names, 2); 26002 max = gen_int(n_max, 3); 26003 26004 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max); 26005 desret_int(ret_val); 26006 call_tests++; 26007 des_xmlNodePtr(n_prev, prev, 0); 26008 des_xmlNodePtr(n_next, next, 1); 26009 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2); 26010 des_int(n_max, max, 3); 26011 xmlResetLastError(); 26012 if (mem_base != xmlMemBlocks()) { 26013 printf("Leak of %d blocks found in xmlValidGetValidElements", 26014 xmlMemBlocks() - mem_base); 26015 test_ret++; 26016 printf(" %d", n_prev); 26017 printf(" %d", n_next); 26018 printf(" %d", n_names); 26019 printf(" %d", n_max); 26020 printf("\n"); 26021 } 26022 } 26023 } 26024 } 26025 } 26026 function_tests++; 26027 #endif 26028 #endif 26029 26030 return(test_ret); 26031 } 26032 26033 26034 static int 26035 test_xmlValidNormalizeAttributeValue(void) { 26036 int test_ret = 0; 26037 26038 #if defined(LIBXML_VALID_ENABLED) 26039 int mem_base; 26040 xmlChar * ret_val; 26041 xmlDocPtr doc; /* the document */ 26042 int n_doc; 26043 xmlNodePtr elem; /* the parent */ 26044 int n_elem; 26045 xmlChar * name; /* the attribute name */ 26046 int n_name; 26047 xmlChar * value; /* the attribute value */ 26048 int n_value; 26049 26050 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26051 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26052 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { 26053 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26054 mem_base = xmlMemBlocks(); 26055 doc = gen_xmlDocPtr(n_doc, 0); 26056 elem = gen_xmlNodePtr(n_elem, 1); 26057 name = gen_const_xmlChar_ptr(n_name, 2); 26058 value = gen_const_xmlChar_ptr(n_value, 3); 26059 26060 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value); 26061 desret_xmlChar_ptr(ret_val); 26062 call_tests++; 26063 des_xmlDocPtr(n_doc, doc, 0); 26064 des_xmlNodePtr(n_elem, elem, 1); 26065 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); 26066 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); 26067 xmlResetLastError(); 26068 if (mem_base != xmlMemBlocks()) { 26069 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue", 26070 xmlMemBlocks() - mem_base); 26071 test_ret++; 26072 printf(" %d", n_doc); 26073 printf(" %d", n_elem); 26074 printf(" %d", n_name); 26075 printf(" %d", n_value); 26076 printf("\n"); 26077 } 26078 } 26079 } 26080 } 26081 } 26082 function_tests++; 26083 #endif 26084 26085 return(test_ret); 26086 } 26087 26088 26089 static int 26090 test_xmlValidateAttributeDecl(void) { 26091 int test_ret = 0; 26092 26093 #if defined(LIBXML_VALID_ENABLED) 26094 int mem_base; 26095 int ret_val; 26096 xmlValidCtxtPtr ctxt; /* the validation context */ 26097 int n_ctxt; 26098 xmlDocPtr doc; /* a document instance */ 26099 int n_doc; 26100 xmlAttributePtr attr; /* an attribute definition */ 26101 int n_attr; 26102 26103 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26104 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26105 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) { 26106 mem_base = xmlMemBlocks(); 26107 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26108 doc = gen_xmlDocPtr(n_doc, 1); 26109 attr = gen_xmlAttributePtr(n_attr, 2); 26110 26111 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr); 26112 desret_int(ret_val); 26113 call_tests++; 26114 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26115 des_xmlDocPtr(n_doc, doc, 1); 26116 des_xmlAttributePtr(n_attr, attr, 2); 26117 xmlResetLastError(); 26118 if (mem_base != xmlMemBlocks()) { 26119 printf("Leak of %d blocks found in xmlValidateAttributeDecl", 26120 xmlMemBlocks() - mem_base); 26121 test_ret++; 26122 printf(" %d", n_ctxt); 26123 printf(" %d", n_doc); 26124 printf(" %d", n_attr); 26125 printf("\n"); 26126 } 26127 } 26128 } 26129 } 26130 function_tests++; 26131 #endif 26132 26133 return(test_ret); 26134 } 26135 26136 26137 static int 26138 test_xmlValidateAttributeValue(void) { 26139 int test_ret = 0; 26140 26141 #if defined(LIBXML_VALID_ENABLED) 26142 int mem_base; 26143 int ret_val; 26144 xmlAttributeType type; /* an attribute type */ 26145 int n_type; 26146 xmlChar * value; /* an attribute value */ 26147 int n_value; 26148 26149 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) { 26150 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26151 mem_base = xmlMemBlocks(); 26152 type = gen_xmlAttributeType(n_type, 0); 26153 value = gen_const_xmlChar_ptr(n_value, 1); 26154 26155 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value); 26156 desret_int(ret_val); 26157 call_tests++; 26158 des_xmlAttributeType(n_type, type, 0); 26159 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); 26160 xmlResetLastError(); 26161 if (mem_base != xmlMemBlocks()) { 26162 printf("Leak of %d blocks found in xmlValidateAttributeValue", 26163 xmlMemBlocks() - mem_base); 26164 test_ret++; 26165 printf(" %d", n_type); 26166 printf(" %d", n_value); 26167 printf("\n"); 26168 } 26169 } 26170 } 26171 function_tests++; 26172 #endif 26173 26174 return(test_ret); 26175 } 26176 26177 26178 static int 26179 test_xmlValidateDocument(void) { 26180 int test_ret = 0; 26181 26182 #if defined(LIBXML_VALID_ENABLED) 26183 int mem_base; 26184 int ret_val; 26185 xmlValidCtxtPtr ctxt; /* the validation context */ 26186 int n_ctxt; 26187 xmlDocPtr doc; /* a document instance */ 26188 int n_doc; 26189 26190 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26191 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26192 mem_base = xmlMemBlocks(); 26193 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26194 doc = gen_xmlDocPtr(n_doc, 1); 26195 26196 ret_val = xmlValidateDocument(ctxt, doc); 26197 desret_int(ret_val); 26198 call_tests++; 26199 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26200 des_xmlDocPtr(n_doc, doc, 1); 26201 xmlResetLastError(); 26202 if (mem_base != xmlMemBlocks()) { 26203 printf("Leak of %d blocks found in xmlValidateDocument", 26204 xmlMemBlocks() - mem_base); 26205 test_ret++; 26206 printf(" %d", n_ctxt); 26207 printf(" %d", n_doc); 26208 printf("\n"); 26209 } 26210 } 26211 } 26212 function_tests++; 26213 #endif 26214 26215 return(test_ret); 26216 } 26217 26218 26219 static int 26220 test_xmlValidateDocumentFinal(void) { 26221 int test_ret = 0; 26222 26223 #if defined(LIBXML_VALID_ENABLED) 26224 int mem_base; 26225 int ret_val; 26226 xmlValidCtxtPtr ctxt; /* the validation context */ 26227 int n_ctxt; 26228 xmlDocPtr doc; /* a document instance */ 26229 int n_doc; 26230 26231 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26232 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26233 mem_base = xmlMemBlocks(); 26234 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26235 doc = gen_xmlDocPtr(n_doc, 1); 26236 26237 ret_val = xmlValidateDocumentFinal(ctxt, doc); 26238 desret_int(ret_val); 26239 call_tests++; 26240 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26241 des_xmlDocPtr(n_doc, doc, 1); 26242 xmlResetLastError(); 26243 if (mem_base != xmlMemBlocks()) { 26244 printf("Leak of %d blocks found in xmlValidateDocumentFinal", 26245 xmlMemBlocks() - mem_base); 26246 test_ret++; 26247 printf(" %d", n_ctxt); 26248 printf(" %d", n_doc); 26249 printf("\n"); 26250 } 26251 } 26252 } 26253 function_tests++; 26254 #endif 26255 26256 return(test_ret); 26257 } 26258 26259 26260 static int 26261 test_xmlValidateDtd(void) { 26262 int test_ret = 0; 26263 26264 #if defined(LIBXML_VALID_ENABLED) 26265 int mem_base; 26266 int ret_val; 26267 xmlValidCtxtPtr ctxt; /* the validation context */ 26268 int n_ctxt; 26269 xmlDocPtr doc; /* a document instance */ 26270 int n_doc; 26271 xmlDtdPtr dtd; /* a dtd instance */ 26272 int n_dtd; 26273 26274 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26275 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26276 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { 26277 mem_base = xmlMemBlocks(); 26278 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26279 doc = gen_xmlDocPtr(n_doc, 1); 26280 dtd = gen_xmlDtdPtr(n_dtd, 2); 26281 26282 ret_val = xmlValidateDtd(ctxt, doc, dtd); 26283 desret_int(ret_val); 26284 call_tests++; 26285 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26286 des_xmlDocPtr(n_doc, doc, 1); 26287 des_xmlDtdPtr(n_dtd, dtd, 2); 26288 xmlResetLastError(); 26289 if (mem_base != xmlMemBlocks()) { 26290 printf("Leak of %d blocks found in xmlValidateDtd", 26291 xmlMemBlocks() - mem_base); 26292 test_ret++; 26293 printf(" %d", n_ctxt); 26294 printf(" %d", n_doc); 26295 printf(" %d", n_dtd); 26296 printf("\n"); 26297 } 26298 } 26299 } 26300 } 26301 function_tests++; 26302 #endif 26303 26304 return(test_ret); 26305 } 26306 26307 26308 static int 26309 test_xmlValidateDtdFinal(void) { 26310 int test_ret = 0; 26311 26312 #if defined(LIBXML_VALID_ENABLED) 26313 int mem_base; 26314 int ret_val; 26315 xmlValidCtxtPtr ctxt; /* the validation context */ 26316 int n_ctxt; 26317 xmlDocPtr doc; /* a document instance */ 26318 int n_doc; 26319 26320 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26321 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26322 mem_base = xmlMemBlocks(); 26323 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26324 doc = gen_xmlDocPtr(n_doc, 1); 26325 26326 ret_val = xmlValidateDtdFinal(ctxt, doc); 26327 desret_int(ret_val); 26328 call_tests++; 26329 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26330 des_xmlDocPtr(n_doc, doc, 1); 26331 xmlResetLastError(); 26332 if (mem_base != xmlMemBlocks()) { 26333 printf("Leak of %d blocks found in xmlValidateDtdFinal", 26334 xmlMemBlocks() - mem_base); 26335 test_ret++; 26336 printf(" %d", n_ctxt); 26337 printf(" %d", n_doc); 26338 printf("\n"); 26339 } 26340 } 26341 } 26342 function_tests++; 26343 #endif 26344 26345 return(test_ret); 26346 } 26347 26348 26349 static int 26350 test_xmlValidateElement(void) { 26351 int test_ret = 0; 26352 26353 #if defined(LIBXML_VALID_ENABLED) 26354 int mem_base; 26355 int ret_val; 26356 xmlValidCtxtPtr ctxt; /* the validation context */ 26357 int n_ctxt; 26358 xmlDocPtr doc; /* a document instance */ 26359 int n_doc; 26360 xmlNodePtr elem; /* an element instance */ 26361 int n_elem; 26362 26363 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26364 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26365 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26366 mem_base = xmlMemBlocks(); 26367 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26368 doc = gen_xmlDocPtr(n_doc, 1); 26369 elem = gen_xmlNodePtr(n_elem, 2); 26370 26371 ret_val = xmlValidateElement(ctxt, doc, elem); 26372 desret_int(ret_val); 26373 call_tests++; 26374 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26375 des_xmlDocPtr(n_doc, doc, 1); 26376 des_xmlNodePtr(n_elem, elem, 2); 26377 xmlResetLastError(); 26378 if (mem_base != xmlMemBlocks()) { 26379 printf("Leak of %d blocks found in xmlValidateElement", 26380 xmlMemBlocks() - mem_base); 26381 test_ret++; 26382 printf(" %d", n_ctxt); 26383 printf(" %d", n_doc); 26384 printf(" %d", n_elem); 26385 printf("\n"); 26386 } 26387 } 26388 } 26389 } 26390 function_tests++; 26391 #endif 26392 26393 return(test_ret); 26394 } 26395 26396 26397 static int 26398 test_xmlValidateElementDecl(void) { 26399 int test_ret = 0; 26400 26401 #if defined(LIBXML_VALID_ENABLED) 26402 int mem_base; 26403 int ret_val; 26404 xmlValidCtxtPtr ctxt; /* the validation context */ 26405 int n_ctxt; 26406 xmlDocPtr doc; /* a document instance */ 26407 int n_doc; 26408 xmlElementPtr elem; /* an element definition */ 26409 int n_elem; 26410 26411 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26412 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26413 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { 26414 mem_base = xmlMemBlocks(); 26415 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26416 doc = gen_xmlDocPtr(n_doc, 1); 26417 elem = gen_xmlElementPtr(n_elem, 2); 26418 26419 ret_val = xmlValidateElementDecl(ctxt, doc, elem); 26420 desret_int(ret_val); 26421 call_tests++; 26422 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26423 des_xmlDocPtr(n_doc, doc, 1); 26424 des_xmlElementPtr(n_elem, elem, 2); 26425 xmlResetLastError(); 26426 if (mem_base != xmlMemBlocks()) { 26427 printf("Leak of %d blocks found in xmlValidateElementDecl", 26428 xmlMemBlocks() - mem_base); 26429 test_ret++; 26430 printf(" %d", n_ctxt); 26431 printf(" %d", n_doc); 26432 printf(" %d", n_elem); 26433 printf("\n"); 26434 } 26435 } 26436 } 26437 } 26438 function_tests++; 26439 #endif 26440 26441 return(test_ret); 26442 } 26443 26444 26445 static int 26446 test_xmlValidateNameValue(void) { 26447 int test_ret = 0; 26448 26449 #if defined(LIBXML_VALID_ENABLED) 26450 int mem_base; 26451 int ret_val; 26452 xmlChar * value; /* an Name value */ 26453 int n_value; 26454 26455 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26456 mem_base = xmlMemBlocks(); 26457 value = gen_const_xmlChar_ptr(n_value, 0); 26458 26459 ret_val = xmlValidateNameValue((const xmlChar *)value); 26460 desret_int(ret_val); 26461 call_tests++; 26462 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26463 xmlResetLastError(); 26464 if (mem_base != xmlMemBlocks()) { 26465 printf("Leak of %d blocks found in xmlValidateNameValue", 26466 xmlMemBlocks() - mem_base); 26467 test_ret++; 26468 printf(" %d", n_value); 26469 printf("\n"); 26470 } 26471 } 26472 function_tests++; 26473 #endif 26474 26475 return(test_ret); 26476 } 26477 26478 26479 static int 26480 test_xmlValidateNamesValue(void) { 26481 int test_ret = 0; 26482 26483 #if defined(LIBXML_VALID_ENABLED) 26484 int mem_base; 26485 int ret_val; 26486 xmlChar * value; /* an Names value */ 26487 int n_value; 26488 26489 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26490 mem_base = xmlMemBlocks(); 26491 value = gen_const_xmlChar_ptr(n_value, 0); 26492 26493 ret_val = xmlValidateNamesValue((const xmlChar *)value); 26494 desret_int(ret_val); 26495 call_tests++; 26496 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26497 xmlResetLastError(); 26498 if (mem_base != xmlMemBlocks()) { 26499 printf("Leak of %d blocks found in xmlValidateNamesValue", 26500 xmlMemBlocks() - mem_base); 26501 test_ret++; 26502 printf(" %d", n_value); 26503 printf("\n"); 26504 } 26505 } 26506 function_tests++; 26507 #endif 26508 26509 return(test_ret); 26510 } 26511 26512 26513 static int 26514 test_xmlValidateNmtokenValue(void) { 26515 int test_ret = 0; 26516 26517 #if defined(LIBXML_VALID_ENABLED) 26518 int mem_base; 26519 int ret_val; 26520 xmlChar * value; /* an Nmtoken value */ 26521 int n_value; 26522 26523 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26524 mem_base = xmlMemBlocks(); 26525 value = gen_const_xmlChar_ptr(n_value, 0); 26526 26527 ret_val = xmlValidateNmtokenValue((const xmlChar *)value); 26528 desret_int(ret_val); 26529 call_tests++; 26530 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26531 xmlResetLastError(); 26532 if (mem_base != xmlMemBlocks()) { 26533 printf("Leak of %d blocks found in xmlValidateNmtokenValue", 26534 xmlMemBlocks() - mem_base); 26535 test_ret++; 26536 printf(" %d", n_value); 26537 printf("\n"); 26538 } 26539 } 26540 function_tests++; 26541 #endif 26542 26543 return(test_ret); 26544 } 26545 26546 26547 static int 26548 test_xmlValidateNmtokensValue(void) { 26549 int test_ret = 0; 26550 26551 #if defined(LIBXML_VALID_ENABLED) 26552 int mem_base; 26553 int ret_val; 26554 xmlChar * value; /* an Nmtokens value */ 26555 int n_value; 26556 26557 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26558 mem_base = xmlMemBlocks(); 26559 value = gen_const_xmlChar_ptr(n_value, 0); 26560 26561 ret_val = xmlValidateNmtokensValue((const xmlChar *)value); 26562 desret_int(ret_val); 26563 call_tests++; 26564 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); 26565 xmlResetLastError(); 26566 if (mem_base != xmlMemBlocks()) { 26567 printf("Leak of %d blocks found in xmlValidateNmtokensValue", 26568 xmlMemBlocks() - mem_base); 26569 test_ret++; 26570 printf(" %d", n_value); 26571 printf("\n"); 26572 } 26573 } 26574 function_tests++; 26575 #endif 26576 26577 return(test_ret); 26578 } 26579 26580 26581 static int 26582 test_xmlValidateNotationDecl(void) { 26583 int test_ret = 0; 26584 26585 #if defined(LIBXML_VALID_ENABLED) 26586 int mem_base; 26587 int ret_val; 26588 xmlValidCtxtPtr ctxt; /* the validation context */ 26589 int n_ctxt; 26590 xmlDocPtr doc; /* a document instance */ 26591 int n_doc; 26592 xmlNotationPtr nota; /* a notation definition */ 26593 int n_nota; 26594 26595 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26596 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26597 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) { 26598 mem_base = xmlMemBlocks(); 26599 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26600 doc = gen_xmlDocPtr(n_doc, 1); 26601 nota = gen_xmlNotationPtr(n_nota, 2); 26602 26603 ret_val = xmlValidateNotationDecl(ctxt, doc, nota); 26604 desret_int(ret_val); 26605 call_tests++; 26606 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26607 des_xmlDocPtr(n_doc, doc, 1); 26608 des_xmlNotationPtr(n_nota, nota, 2); 26609 xmlResetLastError(); 26610 if (mem_base != xmlMemBlocks()) { 26611 printf("Leak of %d blocks found in xmlValidateNotationDecl", 26612 xmlMemBlocks() - mem_base); 26613 test_ret++; 26614 printf(" %d", n_ctxt); 26615 printf(" %d", n_doc); 26616 printf(" %d", n_nota); 26617 printf("\n"); 26618 } 26619 } 26620 } 26621 } 26622 function_tests++; 26623 #endif 26624 26625 return(test_ret); 26626 } 26627 26628 26629 static int 26630 test_xmlValidateNotationUse(void) { 26631 int test_ret = 0; 26632 26633 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) 26634 int mem_base; 26635 int ret_val; 26636 xmlValidCtxtPtr ctxt; /* the validation context */ 26637 int n_ctxt; 26638 xmlDocPtr doc; /* the document */ 26639 int n_doc; 26640 xmlChar * notationName; /* the notation name to check */ 26641 int n_notationName; 26642 26643 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26644 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26645 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { 26646 mem_base = xmlMemBlocks(); 26647 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26648 doc = gen_xmlDocPtr(n_doc, 1); 26649 notationName = gen_const_xmlChar_ptr(n_notationName, 2); 26650 26651 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName); 26652 desret_int(ret_val); 26653 call_tests++; 26654 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26655 des_xmlDocPtr(n_doc, doc, 1); 26656 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2); 26657 xmlResetLastError(); 26658 if (mem_base != xmlMemBlocks()) { 26659 printf("Leak of %d blocks found in xmlValidateNotationUse", 26660 xmlMemBlocks() - mem_base); 26661 test_ret++; 26662 printf(" %d", n_ctxt); 26663 printf(" %d", n_doc); 26664 printf(" %d", n_notationName); 26665 printf("\n"); 26666 } 26667 } 26668 } 26669 } 26670 function_tests++; 26671 #endif 26672 26673 return(test_ret); 26674 } 26675 26676 26677 static int 26678 test_xmlValidateOneAttribute(void) { 26679 int test_ret = 0; 26680 26681 #if defined(LIBXML_VALID_ENABLED) 26682 int mem_base; 26683 int ret_val; 26684 xmlValidCtxtPtr ctxt; /* the validation context */ 26685 int n_ctxt; 26686 xmlDocPtr doc; /* a document instance */ 26687 int n_doc; 26688 xmlNodePtr elem; /* an element instance */ 26689 int n_elem; 26690 xmlAttrPtr attr; /* an attribute instance */ 26691 int n_attr; 26692 xmlChar * value; /* the attribute value (without entities processing) */ 26693 int n_value; 26694 26695 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26696 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26697 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26698 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { 26699 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26700 mem_base = xmlMemBlocks(); 26701 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26702 doc = gen_xmlDocPtr(n_doc, 1); 26703 elem = gen_xmlNodePtr(n_elem, 2); 26704 attr = gen_xmlAttrPtr(n_attr, 3); 26705 value = gen_const_xmlChar_ptr(n_value, 4); 26706 26707 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value); 26708 desret_int(ret_val); 26709 call_tests++; 26710 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26711 des_xmlDocPtr(n_doc, doc, 1); 26712 des_xmlNodePtr(n_elem, elem, 2); 26713 des_xmlAttrPtr(n_attr, attr, 3); 26714 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4); 26715 xmlResetLastError(); 26716 if (mem_base != xmlMemBlocks()) { 26717 printf("Leak of %d blocks found in xmlValidateOneAttribute", 26718 xmlMemBlocks() - mem_base); 26719 test_ret++; 26720 printf(" %d", n_ctxt); 26721 printf(" %d", n_doc); 26722 printf(" %d", n_elem); 26723 printf(" %d", n_attr); 26724 printf(" %d", n_value); 26725 printf("\n"); 26726 } 26727 } 26728 } 26729 } 26730 } 26731 } 26732 function_tests++; 26733 #endif 26734 26735 return(test_ret); 26736 } 26737 26738 26739 static int 26740 test_xmlValidateOneElement(void) { 26741 int test_ret = 0; 26742 26743 #if defined(LIBXML_VALID_ENABLED) 26744 int mem_base; 26745 int ret_val; 26746 xmlValidCtxtPtr ctxt; /* the validation context */ 26747 int n_ctxt; 26748 xmlDocPtr doc; /* a document instance */ 26749 int n_doc; 26750 xmlNodePtr elem; /* an element instance */ 26751 int n_elem; 26752 26753 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26754 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26755 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26756 mem_base = xmlMemBlocks(); 26757 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26758 doc = gen_xmlDocPtr(n_doc, 1); 26759 elem = gen_xmlNodePtr(n_elem, 2); 26760 26761 ret_val = xmlValidateOneElement(ctxt, doc, elem); 26762 desret_int(ret_val); 26763 call_tests++; 26764 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26765 des_xmlDocPtr(n_doc, doc, 1); 26766 des_xmlNodePtr(n_elem, elem, 2); 26767 xmlResetLastError(); 26768 if (mem_base != xmlMemBlocks()) { 26769 printf("Leak of %d blocks found in xmlValidateOneElement", 26770 xmlMemBlocks() - mem_base); 26771 test_ret++; 26772 printf(" %d", n_ctxt); 26773 printf(" %d", n_doc); 26774 printf(" %d", n_elem); 26775 printf("\n"); 26776 } 26777 } 26778 } 26779 } 26780 function_tests++; 26781 #endif 26782 26783 return(test_ret); 26784 } 26785 26786 26787 static int 26788 test_xmlValidateOneNamespace(void) { 26789 int test_ret = 0; 26790 26791 #if defined(LIBXML_VALID_ENABLED) 26792 int mem_base; 26793 int ret_val; 26794 xmlValidCtxtPtr ctxt; /* the validation context */ 26795 int n_ctxt; 26796 xmlDocPtr doc; /* a document instance */ 26797 int n_doc; 26798 xmlNodePtr elem; /* an element instance */ 26799 int n_elem; 26800 xmlChar * prefix; /* the namespace prefix */ 26801 int n_prefix; 26802 xmlNsPtr ns; /* an namespace declaration instance */ 26803 int n_ns; 26804 xmlChar * value; /* the attribute value (without entities processing) */ 26805 int n_value; 26806 26807 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26808 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26809 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26810 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { 26811 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { 26812 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { 26813 mem_base = xmlMemBlocks(); 26814 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26815 doc = gen_xmlDocPtr(n_doc, 1); 26816 elem = gen_xmlNodePtr(n_elem, 2); 26817 prefix = gen_const_xmlChar_ptr(n_prefix, 3); 26818 ns = gen_xmlNsPtr(n_ns, 4); 26819 value = gen_const_xmlChar_ptr(n_value, 5); 26820 26821 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value); 26822 desret_int(ret_val); 26823 call_tests++; 26824 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26825 des_xmlDocPtr(n_doc, doc, 1); 26826 des_xmlNodePtr(n_elem, elem, 2); 26827 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3); 26828 des_xmlNsPtr(n_ns, ns, 4); 26829 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5); 26830 xmlResetLastError(); 26831 if (mem_base != xmlMemBlocks()) { 26832 printf("Leak of %d blocks found in xmlValidateOneNamespace", 26833 xmlMemBlocks() - mem_base); 26834 test_ret++; 26835 printf(" %d", n_ctxt); 26836 printf(" %d", n_doc); 26837 printf(" %d", n_elem); 26838 printf(" %d", n_prefix); 26839 printf(" %d", n_ns); 26840 printf(" %d", n_value); 26841 printf("\n"); 26842 } 26843 } 26844 } 26845 } 26846 } 26847 } 26848 } 26849 function_tests++; 26850 #endif 26851 26852 return(test_ret); 26853 } 26854 26855 26856 static int 26857 test_xmlValidatePopElement(void) { 26858 int test_ret = 0; 26859 26860 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 26861 int mem_base; 26862 int ret_val; 26863 xmlValidCtxtPtr ctxt; /* the validation context */ 26864 int n_ctxt; 26865 xmlDocPtr doc; /* a document instance */ 26866 int n_doc; 26867 xmlNodePtr elem; /* an element instance */ 26868 int n_elem; 26869 xmlChar * qname; /* the qualified name as appearing in the serialization */ 26870 int n_qname; 26871 26872 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26873 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26874 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26875 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { 26876 mem_base = xmlMemBlocks(); 26877 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26878 doc = gen_xmlDocPtr(n_doc, 1); 26879 elem = gen_xmlNodePtr(n_elem, 2); 26880 qname = gen_const_xmlChar_ptr(n_qname, 3); 26881 26882 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname); 26883 desret_int(ret_val); 26884 call_tests++; 26885 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26886 des_xmlDocPtr(n_doc, doc, 1); 26887 des_xmlNodePtr(n_elem, elem, 2); 26888 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3); 26889 xmlResetLastError(); 26890 if (mem_base != xmlMemBlocks()) { 26891 printf("Leak of %d blocks found in xmlValidatePopElement", 26892 xmlMemBlocks() - mem_base); 26893 test_ret++; 26894 printf(" %d", n_ctxt); 26895 printf(" %d", n_doc); 26896 printf(" %d", n_elem); 26897 printf(" %d", n_qname); 26898 printf("\n"); 26899 } 26900 } 26901 } 26902 } 26903 } 26904 function_tests++; 26905 #endif 26906 26907 return(test_ret); 26908 } 26909 26910 26911 static int 26912 test_xmlValidatePushCData(void) { 26913 int test_ret = 0; 26914 26915 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 26916 int mem_base; 26917 int ret_val; 26918 xmlValidCtxtPtr ctxt; /* the validation context */ 26919 int n_ctxt; 26920 xmlChar * data; /* some character data read */ 26921 int n_data; 26922 int len; /* the lenght of the data */ 26923 int n_len; 26924 26925 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26926 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { 26927 for (n_len = 0;n_len < gen_nb_int;n_len++) { 26928 mem_base = xmlMemBlocks(); 26929 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26930 data = gen_const_xmlChar_ptr(n_data, 1); 26931 len = gen_int(n_len, 2); 26932 26933 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len); 26934 desret_int(ret_val); 26935 call_tests++; 26936 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26937 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1); 26938 des_int(n_len, len, 2); 26939 xmlResetLastError(); 26940 if (mem_base != xmlMemBlocks()) { 26941 printf("Leak of %d blocks found in xmlValidatePushCData", 26942 xmlMemBlocks() - mem_base); 26943 test_ret++; 26944 printf(" %d", n_ctxt); 26945 printf(" %d", n_data); 26946 printf(" %d", n_len); 26947 printf("\n"); 26948 } 26949 } 26950 } 26951 } 26952 function_tests++; 26953 #endif 26954 26955 return(test_ret); 26956 } 26957 26958 26959 static int 26960 test_xmlValidatePushElement(void) { 26961 int test_ret = 0; 26962 26963 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) 26964 int mem_base; 26965 int ret_val; 26966 xmlValidCtxtPtr ctxt; /* the validation context */ 26967 int n_ctxt; 26968 xmlDocPtr doc; /* a document instance */ 26969 int n_doc; 26970 xmlNodePtr elem; /* an element instance */ 26971 int n_elem; 26972 xmlChar * qname; /* the qualified name as appearing in the serialization */ 26973 int n_qname; 26974 26975 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 26976 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 26977 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { 26978 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { 26979 mem_base = xmlMemBlocks(); 26980 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 26981 doc = gen_xmlDocPtr(n_doc, 1); 26982 elem = gen_xmlNodePtr(n_elem, 2); 26983 qname = gen_const_xmlChar_ptr(n_qname, 3); 26984 26985 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname); 26986 desret_int(ret_val); 26987 call_tests++; 26988 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 26989 des_xmlDocPtr(n_doc, doc, 1); 26990 des_xmlNodePtr(n_elem, elem, 2); 26991 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3); 26992 xmlResetLastError(); 26993 if (mem_base != xmlMemBlocks()) { 26994 printf("Leak of %d blocks found in xmlValidatePushElement", 26995 xmlMemBlocks() - mem_base); 26996 test_ret++; 26997 printf(" %d", n_ctxt); 26998 printf(" %d", n_doc); 26999 printf(" %d", n_elem); 27000 printf(" %d", n_qname); 27001 printf("\n"); 27002 } 27003 } 27004 } 27005 } 27006 } 27007 function_tests++; 27008 #endif 27009 27010 return(test_ret); 27011 } 27012 27013 27014 static int 27015 test_xmlValidateRoot(void) { 27016 int test_ret = 0; 27017 27018 #if defined(LIBXML_VALID_ENABLED) 27019 int mem_base; 27020 int ret_val; 27021 xmlValidCtxtPtr ctxt; /* the validation context */ 27022 int n_ctxt; 27023 xmlDocPtr doc; /* a document instance */ 27024 int n_doc; 27025 27026 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { 27027 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27028 mem_base = xmlMemBlocks(); 27029 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); 27030 doc = gen_xmlDocPtr(n_doc, 1); 27031 27032 ret_val = xmlValidateRoot(ctxt, doc); 27033 desret_int(ret_val); 27034 call_tests++; 27035 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); 27036 des_xmlDocPtr(n_doc, doc, 1); 27037 xmlResetLastError(); 27038 if (mem_base != xmlMemBlocks()) { 27039 printf("Leak of %d blocks found in xmlValidateRoot", 27040 xmlMemBlocks() - mem_base); 27041 test_ret++; 27042 printf(" %d", n_ctxt); 27043 printf(" %d", n_doc); 27044 printf("\n"); 27045 } 27046 } 27047 } 27048 function_tests++; 27049 #endif 27050 27051 return(test_ret); 27052 } 27053 27054 static int 27055 test_valid(void) { 27056 int test_ret = 0; 27057 27058 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n"); 27059 test_ret += test_xmlAddAttributeDecl(); 27060 test_ret += test_xmlAddElementDecl(); 27061 test_ret += test_xmlAddID(); 27062 test_ret += test_xmlAddNotationDecl(); 27063 test_ret += test_xmlAddRef(); 27064 test_ret += test_xmlCopyAttributeTable(); 27065 test_ret += test_xmlCopyDocElementContent(); 27066 test_ret += test_xmlCopyElementContent(); 27067 test_ret += test_xmlCopyElementTable(); 27068 test_ret += test_xmlCopyEnumeration(); 27069 test_ret += test_xmlCopyNotationTable(); 27070 test_ret += test_xmlCreateEnumeration(); 27071 test_ret += test_xmlDumpAttributeDecl(); 27072 test_ret += test_xmlDumpAttributeTable(); 27073 test_ret += test_xmlDumpElementDecl(); 27074 test_ret += test_xmlDumpElementTable(); 27075 test_ret += test_xmlDumpNotationDecl(); 27076 test_ret += test_xmlDumpNotationTable(); 27077 test_ret += test_xmlGetDtdAttrDesc(); 27078 test_ret += test_xmlGetDtdElementDesc(); 27079 test_ret += test_xmlGetDtdNotationDesc(); 27080 test_ret += test_xmlGetDtdQAttrDesc(); 27081 test_ret += test_xmlGetDtdQElementDesc(); 27082 test_ret += test_xmlGetID(); 27083 test_ret += test_xmlGetRefs(); 27084 test_ret += test_xmlIsID(); 27085 test_ret += test_xmlIsMixedElement(); 27086 test_ret += test_xmlIsRef(); 27087 test_ret += test_xmlNewDocElementContent(); 27088 test_ret += test_xmlNewElementContent(); 27089 test_ret += test_xmlNewValidCtxt(); 27090 test_ret += test_xmlRemoveID(); 27091 test_ret += test_xmlRemoveRef(); 27092 test_ret += test_xmlSnprintfElementContent(); 27093 test_ret += test_xmlSprintfElementContent(); 27094 test_ret += test_xmlValidBuildContentModel(); 27095 test_ret += test_xmlValidCtxtNormalizeAttributeValue(); 27096 test_ret += test_xmlValidGetPotentialChildren(); 27097 test_ret += test_xmlValidGetValidElements(); 27098 test_ret += test_xmlValidNormalizeAttributeValue(); 27099 test_ret += test_xmlValidateAttributeDecl(); 27100 test_ret += test_xmlValidateAttributeValue(); 27101 test_ret += test_xmlValidateDocument(); 27102 test_ret += test_xmlValidateDocumentFinal(); 27103 test_ret += test_xmlValidateDtd(); 27104 test_ret += test_xmlValidateDtdFinal(); 27105 test_ret += test_xmlValidateElement(); 27106 test_ret += test_xmlValidateElementDecl(); 27107 test_ret += test_xmlValidateNameValue(); 27108 test_ret += test_xmlValidateNamesValue(); 27109 test_ret += test_xmlValidateNmtokenValue(); 27110 test_ret += test_xmlValidateNmtokensValue(); 27111 test_ret += test_xmlValidateNotationDecl(); 27112 test_ret += test_xmlValidateNotationUse(); 27113 test_ret += test_xmlValidateOneAttribute(); 27114 test_ret += test_xmlValidateOneElement(); 27115 test_ret += test_xmlValidateOneNamespace(); 27116 test_ret += test_xmlValidatePopElement(); 27117 test_ret += test_xmlValidatePushCData(); 27118 test_ret += test_xmlValidatePushElement(); 27119 test_ret += test_xmlValidateRoot(); 27120 27121 if (test_ret != 0) 27122 printf("Module valid: %d errors\n", test_ret); 27123 return(test_ret); 27124 } 27125 27126 static int 27127 test_xmlXIncludeNewContext(void) { 27128 int test_ret = 0; 27129 27130 27131 /* missing type support */ 27132 return(test_ret); 27133 } 27134 27135 27136 static int 27137 test_xmlXIncludeProcess(void) { 27138 int test_ret = 0; 27139 27140 #if defined(LIBXML_XINCLUDE_ENABLED) 27141 int mem_base; 27142 int ret_val; 27143 xmlDocPtr doc; /* an XML document */ 27144 int n_doc; 27145 27146 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27147 mem_base = xmlMemBlocks(); 27148 doc = gen_xmlDocPtr(n_doc, 0); 27149 27150 ret_val = xmlXIncludeProcess(doc); 27151 desret_int(ret_val); 27152 call_tests++; 27153 des_xmlDocPtr(n_doc, doc, 0); 27154 xmlResetLastError(); 27155 if (mem_base != xmlMemBlocks()) { 27156 printf("Leak of %d blocks found in xmlXIncludeProcess", 27157 xmlMemBlocks() - mem_base); 27158 test_ret++; 27159 printf(" %d", n_doc); 27160 printf("\n"); 27161 } 27162 } 27163 function_tests++; 27164 #endif 27165 27166 return(test_ret); 27167 } 27168 27169 27170 static int 27171 test_xmlXIncludeProcessFlags(void) { 27172 int test_ret = 0; 27173 27174 #if defined(LIBXML_XINCLUDE_ENABLED) 27175 int mem_base; 27176 int ret_val; 27177 xmlDocPtr doc; /* an XML document */ 27178 int n_doc; 27179 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27180 int n_flags; 27181 27182 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27183 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27184 mem_base = xmlMemBlocks(); 27185 doc = gen_xmlDocPtr(n_doc, 0); 27186 flags = gen_int(n_flags, 1); 27187 27188 ret_val = xmlXIncludeProcessFlags(doc, flags); 27189 desret_int(ret_val); 27190 call_tests++; 27191 des_xmlDocPtr(n_doc, doc, 0); 27192 des_int(n_flags, flags, 1); 27193 xmlResetLastError(); 27194 if (mem_base != xmlMemBlocks()) { 27195 printf("Leak of %d blocks found in xmlXIncludeProcessFlags", 27196 xmlMemBlocks() - mem_base); 27197 test_ret++; 27198 printf(" %d", n_doc); 27199 printf(" %d", n_flags); 27200 printf("\n"); 27201 } 27202 } 27203 } 27204 function_tests++; 27205 #endif 27206 27207 return(test_ret); 27208 } 27209 27210 27211 static int 27212 test_xmlXIncludeProcessFlagsData(void) { 27213 int test_ret = 0; 27214 27215 #if defined(LIBXML_XINCLUDE_ENABLED) 27216 int mem_base; 27217 int ret_val; 27218 xmlDocPtr doc; /* an XML document */ 27219 int n_doc; 27220 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27221 int n_flags; 27222 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ 27223 int n_data; 27224 27225 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { 27226 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27227 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 27228 mem_base = xmlMemBlocks(); 27229 doc = gen_xmlDocPtr(n_doc, 0); 27230 flags = gen_int(n_flags, 1); 27231 data = gen_userdata(n_data, 2); 27232 27233 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data); 27234 desret_int(ret_val); 27235 call_tests++; 27236 des_xmlDocPtr(n_doc, doc, 0); 27237 des_int(n_flags, flags, 1); 27238 des_userdata(n_data, data, 2); 27239 xmlResetLastError(); 27240 if (mem_base != xmlMemBlocks()) { 27241 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData", 27242 xmlMemBlocks() - mem_base); 27243 test_ret++; 27244 printf(" %d", n_doc); 27245 printf(" %d", n_flags); 27246 printf(" %d", n_data); 27247 printf("\n"); 27248 } 27249 } 27250 } 27251 } 27252 function_tests++; 27253 #endif 27254 27255 return(test_ret); 27256 } 27257 27258 #ifdef LIBXML_XINCLUDE_ENABLED 27259 27260 #define gen_nb_xmlXIncludeCtxtPtr 1 27261 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 27262 return(NULL); 27263 } 27264 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 27265 } 27266 #endif 27267 27268 27269 static int 27270 test_xmlXIncludeProcessNode(void) { 27271 int test_ret = 0; 27272 27273 #if defined(LIBXML_XINCLUDE_ENABLED) 27274 int mem_base; 27275 int ret_val; 27276 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */ 27277 int n_ctxt; 27278 xmlNodePtr node; /* a node in an XML document */ 27279 int n_node; 27280 27281 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) { 27282 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { 27283 mem_base = xmlMemBlocks(); 27284 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0); 27285 node = gen_xmlNodePtr(n_node, 1); 27286 27287 ret_val = xmlXIncludeProcessNode(ctxt, node); 27288 desret_int(ret_val); 27289 call_tests++; 27290 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0); 27291 des_xmlNodePtr(n_node, node, 1); 27292 xmlResetLastError(); 27293 if (mem_base != xmlMemBlocks()) { 27294 printf("Leak of %d blocks found in xmlXIncludeProcessNode", 27295 xmlMemBlocks() - mem_base); 27296 test_ret++; 27297 printf(" %d", n_ctxt); 27298 printf(" %d", n_node); 27299 printf("\n"); 27300 } 27301 } 27302 } 27303 function_tests++; 27304 #endif 27305 27306 return(test_ret); 27307 } 27308 27309 27310 static int 27311 test_xmlXIncludeProcessTree(void) { 27312 int test_ret = 0; 27313 27314 #if defined(LIBXML_XINCLUDE_ENABLED) 27315 int mem_base; 27316 int ret_val; 27317 xmlNodePtr tree; /* a node in an XML document */ 27318 int n_tree; 27319 27320 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 27321 mem_base = xmlMemBlocks(); 27322 tree = gen_xmlNodePtr(n_tree, 0); 27323 27324 ret_val = xmlXIncludeProcessTree(tree); 27325 desret_int(ret_val); 27326 call_tests++; 27327 des_xmlNodePtr(n_tree, tree, 0); 27328 xmlResetLastError(); 27329 if (mem_base != xmlMemBlocks()) { 27330 printf("Leak of %d blocks found in xmlXIncludeProcessTree", 27331 xmlMemBlocks() - mem_base); 27332 test_ret++; 27333 printf(" %d", n_tree); 27334 printf("\n"); 27335 } 27336 } 27337 function_tests++; 27338 #endif 27339 27340 return(test_ret); 27341 } 27342 27343 27344 static int 27345 test_xmlXIncludeProcessTreeFlags(void) { 27346 int test_ret = 0; 27347 27348 #if defined(LIBXML_XINCLUDE_ENABLED) 27349 int mem_base; 27350 int ret_val; 27351 xmlNodePtr tree; /* a node in an XML document */ 27352 int n_tree; 27353 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27354 int n_flags; 27355 27356 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 27357 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27358 mem_base = xmlMemBlocks(); 27359 tree = gen_xmlNodePtr(n_tree, 0); 27360 flags = gen_int(n_flags, 1); 27361 27362 ret_val = xmlXIncludeProcessTreeFlags(tree, flags); 27363 desret_int(ret_val); 27364 call_tests++; 27365 des_xmlNodePtr(n_tree, tree, 0); 27366 des_int(n_flags, flags, 1); 27367 xmlResetLastError(); 27368 if (mem_base != xmlMemBlocks()) { 27369 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags", 27370 xmlMemBlocks() - mem_base); 27371 test_ret++; 27372 printf(" %d", n_tree); 27373 printf(" %d", n_flags); 27374 printf("\n"); 27375 } 27376 } 27377 } 27378 function_tests++; 27379 #endif 27380 27381 return(test_ret); 27382 } 27383 27384 27385 static int 27386 test_xmlXIncludeProcessTreeFlagsData(void) { 27387 int test_ret = 0; 27388 27389 #if defined(LIBXML_XINCLUDE_ENABLED) 27390 int mem_base; 27391 int ret_val; 27392 xmlNodePtr tree; /* an XML node */ 27393 int n_tree; 27394 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27395 int n_flags; 27396 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ 27397 int n_data; 27398 27399 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { 27400 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27401 for (n_data = 0;n_data < gen_nb_userdata;n_data++) { 27402 mem_base = xmlMemBlocks(); 27403 tree = gen_xmlNodePtr(n_tree, 0); 27404 flags = gen_int(n_flags, 1); 27405 data = gen_userdata(n_data, 2); 27406 27407 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data); 27408 desret_int(ret_val); 27409 call_tests++; 27410 des_xmlNodePtr(n_tree, tree, 0); 27411 des_int(n_flags, flags, 1); 27412 des_userdata(n_data, data, 2); 27413 xmlResetLastError(); 27414 if (mem_base != xmlMemBlocks()) { 27415 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData", 27416 xmlMemBlocks() - mem_base); 27417 test_ret++; 27418 printf(" %d", n_tree); 27419 printf(" %d", n_flags); 27420 printf(" %d", n_data); 27421 printf("\n"); 27422 } 27423 } 27424 } 27425 } 27426 function_tests++; 27427 #endif 27428 27429 return(test_ret); 27430 } 27431 27432 27433 static int 27434 test_xmlXIncludeSetFlags(void) { 27435 int test_ret = 0; 27436 27437 #if defined(LIBXML_XINCLUDE_ENABLED) 27438 int mem_base; 27439 int ret_val; 27440 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */ 27441 int n_ctxt; 27442 int flags; /* a set of xmlParserOption used for parsing XML includes */ 27443 int n_flags; 27444 27445 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) { 27446 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { 27447 mem_base = xmlMemBlocks(); 27448 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0); 27449 flags = gen_int(n_flags, 1); 27450 27451 ret_val = xmlXIncludeSetFlags(ctxt, flags); 27452 desret_int(ret_val); 27453 call_tests++; 27454 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0); 27455 des_int(n_flags, flags, 1); 27456 xmlResetLastError(); 27457 if (mem_base != xmlMemBlocks()) { 27458 printf("Leak of %d blocks found in xmlXIncludeSetFlags", 27459 xmlMemBlocks() - mem_base); 27460 test_ret++; 27461 printf(" %d", n_ctxt); 27462 printf(" %d", n_flags); 27463 printf("\n"); 27464 } 27465 } 27466 } 27467 function_tests++; 27468 #endif 27469 27470 return(test_ret); 27471 } 27472 27473 static int 27474 test_xinclude(void) { 27475 int test_ret = 0; 27476 27477 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n"); 27478 test_ret += test_xmlXIncludeNewContext(); 27479 test_ret += test_xmlXIncludeProcess(); 27480 test_ret += test_xmlXIncludeProcessFlags(); 27481 test_ret += test_xmlXIncludeProcessFlagsData(); 27482 test_ret += test_xmlXIncludeProcessNode(); 27483 test_ret += test_xmlXIncludeProcessTree(); 27484 test_ret += test_xmlXIncludeProcessTreeFlags(); 27485 test_ret += test_xmlXIncludeProcessTreeFlagsData(); 27486 test_ret += test_xmlXIncludeSetFlags(); 27487 27488 if (test_ret != 0) 27489 printf("Module xinclude: %d errors\n", test_ret); 27490 return(test_ret); 27491 } 27492 27493 static int 27494 test_xmlAllocOutputBuffer(void) { 27495 int test_ret = 0; 27496 27497 #if defined(LIBXML_OUTPUT_ENABLED) 27498 int mem_base; 27499 xmlOutputBufferPtr ret_val; 27500 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 27501 int n_encoder; 27502 27503 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 27504 mem_base = xmlMemBlocks(); 27505 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0); 27506 27507 ret_val = xmlAllocOutputBuffer(encoder); 27508 desret_xmlOutputBufferPtr(ret_val); 27509 call_tests++; 27510 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0); 27511 xmlResetLastError(); 27512 if (mem_base != xmlMemBlocks()) { 27513 printf("Leak of %d blocks found in xmlAllocOutputBuffer", 27514 xmlMemBlocks() - mem_base); 27515 test_ret++; 27516 printf(" %d", n_encoder); 27517 printf("\n"); 27518 } 27519 } 27520 function_tests++; 27521 #endif 27522 27523 return(test_ret); 27524 } 27525 27526 27527 static int 27528 test_xmlAllocParserInputBuffer(void) { 27529 int test_ret = 0; 27530 27531 int mem_base; 27532 xmlParserInputBufferPtr ret_val; 27533 xmlCharEncoding enc; /* the charset encoding if known */ 27534 int n_enc; 27535 27536 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 27537 mem_base = xmlMemBlocks(); 27538 enc = gen_xmlCharEncoding(n_enc, 0); 27539 27540 ret_val = xmlAllocParserInputBuffer(enc); 27541 desret_xmlParserInputBufferPtr(ret_val); 27542 call_tests++; 27543 des_xmlCharEncoding(n_enc, enc, 0); 27544 xmlResetLastError(); 27545 if (mem_base != xmlMemBlocks()) { 27546 printf("Leak of %d blocks found in xmlAllocParserInputBuffer", 27547 xmlMemBlocks() - mem_base); 27548 test_ret++; 27549 printf(" %d", n_enc); 27550 printf("\n"); 27551 } 27552 } 27553 function_tests++; 27554 27555 return(test_ret); 27556 } 27557 27558 27559 static int 27560 test_xmlCheckFilename(void) { 27561 int test_ret = 0; 27562 27563 int mem_base; 27564 int ret_val; 27565 char * path; /* the path to check */ 27566 int n_path; 27567 27568 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) { 27569 mem_base = xmlMemBlocks(); 27570 path = gen_const_char_ptr(n_path, 0); 27571 27572 ret_val = xmlCheckFilename((const char *)path); 27573 desret_int(ret_val); 27574 call_tests++; 27575 des_const_char_ptr(n_path, (const char *)path, 0); 27576 xmlResetLastError(); 27577 if (mem_base != xmlMemBlocks()) { 27578 printf("Leak of %d blocks found in xmlCheckFilename", 27579 xmlMemBlocks() - mem_base); 27580 test_ret++; 27581 printf(" %d", n_path); 27582 printf("\n"); 27583 } 27584 } 27585 function_tests++; 27586 27587 return(test_ret); 27588 } 27589 27590 27591 static int 27592 test_xmlCheckHTTPInput(void) { 27593 int test_ret = 0; 27594 27595 int mem_base; 27596 xmlParserInputPtr ret_val; 27597 xmlParserCtxtPtr ctxt; /* an XML parser context */ 27598 int n_ctxt; 27599 xmlParserInputPtr ret; /* an XML parser input */ 27600 int n_ret; 27601 27602 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 27603 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) { 27604 mem_base = xmlMemBlocks(); 27605 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); 27606 ret = gen_xmlParserInputPtr(n_ret, 1); 27607 27608 ret_val = xmlCheckHTTPInput(ctxt, ret); 27609 desret_xmlParserInputPtr(ret_val); 27610 call_tests++; 27611 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); 27612 des_xmlParserInputPtr(n_ret, ret, 1); 27613 xmlResetLastError(); 27614 if (mem_base != xmlMemBlocks()) { 27615 printf("Leak of %d blocks found in xmlCheckHTTPInput", 27616 xmlMemBlocks() - mem_base); 27617 test_ret++; 27618 printf(" %d", n_ctxt); 27619 printf(" %d", n_ret); 27620 printf("\n"); 27621 } 27622 } 27623 } 27624 function_tests++; 27625 27626 return(test_ret); 27627 } 27628 27629 27630 static int 27631 test_xmlCleanupInputCallbacks(void) { 27632 int test_ret = 0; 27633 27634 int mem_base; 27635 27636 mem_base = xmlMemBlocks(); 27637 27638 xmlCleanupInputCallbacks(); 27639 call_tests++; 27640 xmlResetLastError(); 27641 if (mem_base != xmlMemBlocks()) { 27642 printf("Leak of %d blocks found in xmlCleanupInputCallbacks", 27643 xmlMemBlocks() - mem_base); 27644 test_ret++; 27645 printf("\n"); 27646 } 27647 function_tests++; 27648 27649 return(test_ret); 27650 } 27651 27652 27653 static int 27654 test_xmlCleanupOutputCallbacks(void) { 27655 int test_ret = 0; 27656 27657 #if defined(LIBXML_OUTPUT_ENABLED) 27658 int mem_base; 27659 27660 mem_base = xmlMemBlocks(); 27661 27662 xmlCleanupOutputCallbacks(); 27663 call_tests++; 27664 xmlResetLastError(); 27665 if (mem_base != xmlMemBlocks()) { 27666 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks", 27667 xmlMemBlocks() - mem_base); 27668 test_ret++; 27669 printf("\n"); 27670 } 27671 function_tests++; 27672 #endif 27673 27674 return(test_ret); 27675 } 27676 27677 27678 static int 27679 test_xmlFileClose(void) { 27680 int test_ret = 0; 27681 27682 int mem_base; 27683 int ret_val; 27684 void * context; /* the I/O context */ 27685 int n_context; 27686 27687 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27688 mem_base = xmlMemBlocks(); 27689 context = gen_void_ptr(n_context, 0); 27690 27691 ret_val = xmlFileClose(context); 27692 desret_int(ret_val); 27693 call_tests++; 27694 des_void_ptr(n_context, context, 0); 27695 xmlResetLastError(); 27696 if (mem_base != xmlMemBlocks()) { 27697 printf("Leak of %d blocks found in xmlFileClose", 27698 xmlMemBlocks() - mem_base); 27699 test_ret++; 27700 printf(" %d", n_context); 27701 printf("\n"); 27702 } 27703 } 27704 function_tests++; 27705 27706 return(test_ret); 27707 } 27708 27709 27710 static int 27711 test_xmlFileMatch(void) { 27712 int test_ret = 0; 27713 27714 int mem_base; 27715 int ret_val; 27716 const char * filename; /* the URI for matching */ 27717 int n_filename; 27718 27719 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 27720 mem_base = xmlMemBlocks(); 27721 filename = gen_filepath(n_filename, 0); 27722 27723 ret_val = xmlFileMatch(filename); 27724 desret_int(ret_val); 27725 call_tests++; 27726 des_filepath(n_filename, filename, 0); 27727 xmlResetLastError(); 27728 if (mem_base != xmlMemBlocks()) { 27729 printf("Leak of %d blocks found in xmlFileMatch", 27730 xmlMemBlocks() - mem_base); 27731 test_ret++; 27732 printf(" %d", n_filename); 27733 printf("\n"); 27734 } 27735 } 27736 function_tests++; 27737 27738 return(test_ret); 27739 } 27740 27741 27742 static int 27743 test_xmlFileOpen(void) { 27744 int test_ret = 0; 27745 27746 int mem_base; 27747 void * ret_val; 27748 const char * filename; /* the URI for matching */ 27749 int n_filename; 27750 27751 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 27752 mem_base = xmlMemBlocks(); 27753 filename = gen_filepath(n_filename, 0); 27754 27755 ret_val = xmlFileOpen(filename); 27756 desret_void_ptr(ret_val); 27757 call_tests++; 27758 des_filepath(n_filename, filename, 0); 27759 xmlResetLastError(); 27760 if (mem_base != xmlMemBlocks()) { 27761 printf("Leak of %d blocks found in xmlFileOpen", 27762 xmlMemBlocks() - mem_base); 27763 test_ret++; 27764 printf(" %d", n_filename); 27765 printf("\n"); 27766 } 27767 } 27768 function_tests++; 27769 27770 return(test_ret); 27771 } 27772 27773 27774 static int 27775 test_xmlFileRead(void) { 27776 int test_ret = 0; 27777 27778 int mem_base; 27779 int ret_val; 27780 void * context; /* the I/O context */ 27781 int n_context; 27782 char * buffer; /* where to drop data */ 27783 int n_buffer; 27784 int len; /* number of bytes to write */ 27785 int n_len; 27786 27787 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27788 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 27789 for (n_len = 0;n_len < gen_nb_int;n_len++) { 27790 mem_base = xmlMemBlocks(); 27791 context = gen_void_ptr(n_context, 0); 27792 buffer = gen_char_ptr(n_buffer, 1); 27793 len = gen_int(n_len, 2); 27794 27795 ret_val = xmlFileRead(context, buffer, len); 27796 desret_int(ret_val); 27797 call_tests++; 27798 des_void_ptr(n_context, context, 0); 27799 des_char_ptr(n_buffer, buffer, 1); 27800 des_int(n_len, len, 2); 27801 xmlResetLastError(); 27802 if (mem_base != xmlMemBlocks()) { 27803 printf("Leak of %d blocks found in xmlFileRead", 27804 xmlMemBlocks() - mem_base); 27805 test_ret++; 27806 printf(" %d", n_context); 27807 printf(" %d", n_buffer); 27808 printf(" %d", n_len); 27809 printf("\n"); 27810 } 27811 } 27812 } 27813 } 27814 function_tests++; 27815 27816 return(test_ret); 27817 } 27818 27819 27820 static int 27821 test_xmlIOFTPClose(void) { 27822 int test_ret = 0; 27823 27824 #if defined(LIBXML_FTP_ENABLED) 27825 int mem_base; 27826 int ret_val; 27827 void * context; /* the I/O context */ 27828 int n_context; 27829 27830 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27831 mem_base = xmlMemBlocks(); 27832 context = gen_void_ptr(n_context, 0); 27833 27834 ret_val = xmlIOFTPClose(context); 27835 desret_int(ret_val); 27836 call_tests++; 27837 des_void_ptr(n_context, context, 0); 27838 xmlResetLastError(); 27839 if (mem_base != xmlMemBlocks()) { 27840 printf("Leak of %d blocks found in xmlIOFTPClose", 27841 xmlMemBlocks() - mem_base); 27842 test_ret++; 27843 printf(" %d", n_context); 27844 printf("\n"); 27845 } 27846 } 27847 function_tests++; 27848 #endif 27849 27850 return(test_ret); 27851 } 27852 27853 27854 static int 27855 test_xmlIOFTPMatch(void) { 27856 int test_ret = 0; 27857 27858 #if defined(LIBXML_FTP_ENABLED) 27859 int mem_base; 27860 int ret_val; 27861 const char * filename; /* the URI for matching */ 27862 int n_filename; 27863 27864 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 27865 mem_base = xmlMemBlocks(); 27866 filename = gen_filepath(n_filename, 0); 27867 27868 ret_val = xmlIOFTPMatch(filename); 27869 desret_int(ret_val); 27870 call_tests++; 27871 des_filepath(n_filename, filename, 0); 27872 xmlResetLastError(); 27873 if (mem_base != xmlMemBlocks()) { 27874 printf("Leak of %d blocks found in xmlIOFTPMatch", 27875 xmlMemBlocks() - mem_base); 27876 test_ret++; 27877 printf(" %d", n_filename); 27878 printf("\n"); 27879 } 27880 } 27881 function_tests++; 27882 #endif 27883 27884 return(test_ret); 27885 } 27886 27887 27888 static int 27889 test_xmlIOFTPOpen(void) { 27890 int test_ret = 0; 27891 27892 #if defined(LIBXML_FTP_ENABLED) 27893 int mem_base; 27894 void * ret_val; 27895 const char * filename; /* the URI for matching */ 27896 int n_filename; 27897 27898 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 27899 mem_base = xmlMemBlocks(); 27900 filename = gen_filepath(n_filename, 0); 27901 27902 ret_val = xmlIOFTPOpen(filename); 27903 desret_void_ptr(ret_val); 27904 call_tests++; 27905 des_filepath(n_filename, filename, 0); 27906 xmlResetLastError(); 27907 if (mem_base != xmlMemBlocks()) { 27908 printf("Leak of %d blocks found in xmlIOFTPOpen", 27909 xmlMemBlocks() - mem_base); 27910 test_ret++; 27911 printf(" %d", n_filename); 27912 printf("\n"); 27913 } 27914 } 27915 function_tests++; 27916 #endif 27917 27918 return(test_ret); 27919 } 27920 27921 27922 static int 27923 test_xmlIOFTPRead(void) { 27924 int test_ret = 0; 27925 27926 #if defined(LIBXML_FTP_ENABLED) 27927 int mem_base; 27928 int ret_val; 27929 void * context; /* the I/O context */ 27930 int n_context; 27931 char * buffer; /* where to drop data */ 27932 int n_buffer; 27933 int len; /* number of bytes to write */ 27934 int n_len; 27935 27936 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27937 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 27938 for (n_len = 0;n_len < gen_nb_int;n_len++) { 27939 mem_base = xmlMemBlocks(); 27940 context = gen_void_ptr(n_context, 0); 27941 buffer = gen_char_ptr(n_buffer, 1); 27942 len = gen_int(n_len, 2); 27943 27944 ret_val = xmlIOFTPRead(context, buffer, len); 27945 desret_int(ret_val); 27946 call_tests++; 27947 des_void_ptr(n_context, context, 0); 27948 des_char_ptr(n_buffer, buffer, 1); 27949 des_int(n_len, len, 2); 27950 xmlResetLastError(); 27951 if (mem_base != xmlMemBlocks()) { 27952 printf("Leak of %d blocks found in xmlIOFTPRead", 27953 xmlMemBlocks() - mem_base); 27954 test_ret++; 27955 printf(" %d", n_context); 27956 printf(" %d", n_buffer); 27957 printf(" %d", n_len); 27958 printf("\n"); 27959 } 27960 } 27961 } 27962 } 27963 function_tests++; 27964 #endif 27965 27966 return(test_ret); 27967 } 27968 27969 27970 static int 27971 test_xmlIOHTTPClose(void) { 27972 int test_ret = 0; 27973 27974 #if defined(LIBXML_HTTP_ENABLED) 27975 int mem_base; 27976 int ret_val; 27977 void * context; /* the I/O context */ 27978 int n_context; 27979 27980 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 27981 mem_base = xmlMemBlocks(); 27982 context = gen_void_ptr(n_context, 0); 27983 27984 ret_val = xmlIOHTTPClose(context); 27985 desret_int(ret_val); 27986 call_tests++; 27987 des_void_ptr(n_context, context, 0); 27988 xmlResetLastError(); 27989 if (mem_base != xmlMemBlocks()) { 27990 printf("Leak of %d blocks found in xmlIOHTTPClose", 27991 xmlMemBlocks() - mem_base); 27992 test_ret++; 27993 printf(" %d", n_context); 27994 printf("\n"); 27995 } 27996 } 27997 function_tests++; 27998 #endif 27999 28000 return(test_ret); 28001 } 28002 28003 28004 static int 28005 test_xmlIOHTTPMatch(void) { 28006 int test_ret = 0; 28007 28008 #if defined(LIBXML_HTTP_ENABLED) 28009 int mem_base; 28010 int ret_val; 28011 const char * filename; /* the URI for matching */ 28012 int n_filename; 28013 28014 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 28015 mem_base = xmlMemBlocks(); 28016 filename = gen_filepath(n_filename, 0); 28017 28018 ret_val = xmlIOHTTPMatch(filename); 28019 desret_int(ret_val); 28020 call_tests++; 28021 des_filepath(n_filename, filename, 0); 28022 xmlResetLastError(); 28023 if (mem_base != xmlMemBlocks()) { 28024 printf("Leak of %d blocks found in xmlIOHTTPMatch", 28025 xmlMemBlocks() - mem_base); 28026 test_ret++; 28027 printf(" %d", n_filename); 28028 printf("\n"); 28029 } 28030 } 28031 function_tests++; 28032 #endif 28033 28034 return(test_ret); 28035 } 28036 28037 28038 static int 28039 test_xmlIOHTTPOpen(void) { 28040 int test_ret = 0; 28041 28042 #if defined(LIBXML_HTTP_ENABLED) 28043 int mem_base; 28044 void * ret_val; 28045 const char * filename; /* the URI for matching */ 28046 int n_filename; 28047 28048 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 28049 mem_base = xmlMemBlocks(); 28050 filename = gen_filepath(n_filename, 0); 28051 28052 ret_val = xmlIOHTTPOpen(filename); 28053 desret_xmlNanoHTTPCtxtPtr(ret_val); 28054 call_tests++; 28055 des_filepath(n_filename, filename, 0); 28056 xmlResetLastError(); 28057 if (mem_base != xmlMemBlocks()) { 28058 printf("Leak of %d blocks found in xmlIOHTTPOpen", 28059 xmlMemBlocks() - mem_base); 28060 test_ret++; 28061 printf(" %d", n_filename); 28062 printf("\n"); 28063 } 28064 } 28065 function_tests++; 28066 #endif 28067 28068 return(test_ret); 28069 } 28070 28071 28072 static int 28073 test_xmlIOHTTPRead(void) { 28074 int test_ret = 0; 28075 28076 #if defined(LIBXML_HTTP_ENABLED) 28077 int mem_base; 28078 int ret_val; 28079 void * context; /* the I/O context */ 28080 int n_context; 28081 char * buffer; /* where to drop data */ 28082 int n_buffer; 28083 int len; /* number of bytes to write */ 28084 int n_len; 28085 28086 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { 28087 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { 28088 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28089 mem_base = xmlMemBlocks(); 28090 context = gen_void_ptr(n_context, 0); 28091 buffer = gen_char_ptr(n_buffer, 1); 28092 len = gen_int(n_len, 2); 28093 28094 ret_val = xmlIOHTTPRead(context, buffer, len); 28095 desret_int(ret_val); 28096 call_tests++; 28097 des_void_ptr(n_context, context, 0); 28098 des_char_ptr(n_buffer, buffer, 1); 28099 des_int(n_len, len, 2); 28100 xmlResetLastError(); 28101 if (mem_base != xmlMemBlocks()) { 28102 printf("Leak of %d blocks found in xmlIOHTTPRead", 28103 xmlMemBlocks() - mem_base); 28104 test_ret++; 28105 printf(" %d", n_context); 28106 printf(" %d", n_buffer); 28107 printf(" %d", n_len); 28108 printf("\n"); 28109 } 28110 } 28111 } 28112 } 28113 function_tests++; 28114 #endif 28115 28116 return(test_ret); 28117 } 28118 28119 28120 static int 28121 test_xmlNoNetExternalEntityLoader(void) { 28122 int test_ret = 0; 28123 28124 int mem_base; 28125 xmlParserInputPtr ret_val; 28126 const char * URL; /* the URL for the entity to load */ 28127 int n_URL; 28128 char * ID; /* the System ID for the entity to load */ 28129 int n_ID; 28130 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */ 28131 int n_ctxt; 28132 28133 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 28134 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) { 28135 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { 28136 mem_base = xmlMemBlocks(); 28137 URL = gen_filepath(n_URL, 0); 28138 ID = gen_const_char_ptr(n_ID, 1); 28139 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2); 28140 28141 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt); 28142 desret_xmlParserInputPtr(ret_val); 28143 call_tests++; 28144 des_filepath(n_URL, URL, 0); 28145 des_const_char_ptr(n_ID, (const char *)ID, 1); 28146 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2); 28147 xmlResetLastError(); 28148 if (mem_base != xmlMemBlocks()) { 28149 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader", 28150 xmlMemBlocks() - mem_base); 28151 test_ret++; 28152 printf(" %d", n_URL); 28153 printf(" %d", n_ID); 28154 printf(" %d", n_ctxt); 28155 printf("\n"); 28156 } 28157 } 28158 } 28159 } 28160 function_tests++; 28161 28162 return(test_ret); 28163 } 28164 28165 28166 static int 28167 test_xmlNormalizeWindowsPath(void) { 28168 int test_ret = 0; 28169 28170 int mem_base; 28171 xmlChar * ret_val; 28172 xmlChar * path; /* the input file path */ 28173 int n_path; 28174 28175 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { 28176 mem_base = xmlMemBlocks(); 28177 path = gen_const_xmlChar_ptr(n_path, 0); 28178 28179 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path); 28180 desret_xmlChar_ptr(ret_val); 28181 call_tests++; 28182 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); 28183 xmlResetLastError(); 28184 if (mem_base != xmlMemBlocks()) { 28185 printf("Leak of %d blocks found in xmlNormalizeWindowsPath", 28186 xmlMemBlocks() - mem_base); 28187 test_ret++; 28188 printf(" %d", n_path); 28189 printf("\n"); 28190 } 28191 } 28192 function_tests++; 28193 28194 return(test_ret); 28195 } 28196 28197 28198 static int 28199 test_xmlOutputBufferCreateBuffer(void) { 28200 int test_ret = 0; 28201 28202 #if defined(LIBXML_OUTPUT_ENABLED) 28203 int mem_base; 28204 xmlOutputBufferPtr ret_val; 28205 xmlBufferPtr buffer; /* a xmlBufferPtr */ 28206 int n_buffer; 28207 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28208 int n_encoder; 28209 28210 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { 28211 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28212 mem_base = xmlMemBlocks(); 28213 buffer = gen_xmlBufferPtr(n_buffer, 0); 28214 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28215 28216 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder); 28217 desret_xmlOutputBufferPtr(ret_val); 28218 call_tests++; 28219 des_xmlBufferPtr(n_buffer, buffer, 0); 28220 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28221 xmlResetLastError(); 28222 if (mem_base != xmlMemBlocks()) { 28223 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer", 28224 xmlMemBlocks() - mem_base); 28225 test_ret++; 28226 printf(" %d", n_buffer); 28227 printf(" %d", n_encoder); 28228 printf("\n"); 28229 } 28230 } 28231 } 28232 function_tests++; 28233 #endif 28234 28235 return(test_ret); 28236 } 28237 28238 28239 static int 28240 test_xmlOutputBufferCreateFd(void) { 28241 int test_ret = 0; 28242 28243 #if defined(LIBXML_OUTPUT_ENABLED) 28244 int mem_base; 28245 xmlOutputBufferPtr ret_val; 28246 int fd; /* a file descriptor number */ 28247 int n_fd; 28248 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28249 int n_encoder; 28250 28251 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { 28252 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28253 mem_base = xmlMemBlocks(); 28254 fd = gen_int(n_fd, 0); 28255 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28256 28257 ret_val = xmlOutputBufferCreateFd(fd, encoder); 28258 desret_xmlOutputBufferPtr(ret_val); 28259 call_tests++; 28260 des_int(n_fd, fd, 0); 28261 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28262 xmlResetLastError(); 28263 if (mem_base != xmlMemBlocks()) { 28264 printf("Leak of %d blocks found in xmlOutputBufferCreateFd", 28265 xmlMemBlocks() - mem_base); 28266 test_ret++; 28267 printf(" %d", n_fd); 28268 printf(" %d", n_encoder); 28269 printf("\n"); 28270 } 28271 } 28272 } 28273 function_tests++; 28274 #endif 28275 28276 return(test_ret); 28277 } 28278 28279 28280 static int 28281 test_xmlOutputBufferCreateFile(void) { 28282 int test_ret = 0; 28283 28284 #if defined(LIBXML_OUTPUT_ENABLED) 28285 int mem_base; 28286 xmlOutputBufferPtr ret_val; 28287 FILE * file; /* a FILE* */ 28288 int n_file; 28289 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28290 int n_encoder; 28291 28292 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) { 28293 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28294 mem_base = xmlMemBlocks(); 28295 file = gen_FILE_ptr(n_file, 0); 28296 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28297 28298 ret_val = xmlOutputBufferCreateFile(file, encoder); 28299 desret_xmlOutputBufferPtr(ret_val); 28300 call_tests++; 28301 des_FILE_ptr(n_file, file, 0); 28302 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28303 xmlResetLastError(); 28304 if (mem_base != xmlMemBlocks()) { 28305 printf("Leak of %d blocks found in xmlOutputBufferCreateFile", 28306 xmlMemBlocks() - mem_base); 28307 test_ret++; 28308 printf(" %d", n_file); 28309 printf(" %d", n_encoder); 28310 printf("\n"); 28311 } 28312 } 28313 } 28314 function_tests++; 28315 #endif 28316 28317 return(test_ret); 28318 } 28319 28320 28321 static int 28322 test_xmlOutputBufferCreateFilename(void) { 28323 int test_ret = 0; 28324 28325 #if defined(LIBXML_OUTPUT_ENABLED) 28326 int mem_base; 28327 xmlOutputBufferPtr ret_val; 28328 const char * URI; /* a C string containing the URI or filename */ 28329 int n_URI; 28330 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ 28331 int n_encoder; 28332 int compression; /* the compression ration (0 none, 9 max). */ 28333 int n_compression; 28334 28335 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) { 28336 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { 28337 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { 28338 mem_base = xmlMemBlocks(); 28339 URI = gen_fileoutput(n_URI, 0); 28340 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); 28341 compression = gen_int(n_compression, 2); 28342 28343 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression); 28344 desret_xmlOutputBufferPtr(ret_val); 28345 call_tests++; 28346 des_fileoutput(n_URI, URI, 0); 28347 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); 28348 des_int(n_compression, compression, 2); 28349 xmlResetLastError(); 28350 if (mem_base != xmlMemBlocks()) { 28351 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename", 28352 xmlMemBlocks() - mem_base); 28353 test_ret++; 28354 printf(" %d", n_URI); 28355 printf(" %d", n_encoder); 28356 printf(" %d", n_compression); 28357 printf("\n"); 28358 } 28359 } 28360 } 28361 } 28362 function_tests++; 28363 #endif 28364 28365 return(test_ret); 28366 } 28367 28368 28369 static int 28370 test_xmlOutputBufferFlush(void) { 28371 int test_ret = 0; 28372 28373 #if defined(LIBXML_OUTPUT_ENABLED) 28374 int mem_base; 28375 int ret_val; 28376 xmlOutputBufferPtr out; /* a buffered output */ 28377 int n_out; 28378 28379 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28380 mem_base = xmlMemBlocks(); 28381 out = gen_xmlOutputBufferPtr(n_out, 0); 28382 28383 ret_val = xmlOutputBufferFlush(out); 28384 desret_int(ret_val); 28385 call_tests++; 28386 des_xmlOutputBufferPtr(n_out, out, 0); 28387 xmlResetLastError(); 28388 if (mem_base != xmlMemBlocks()) { 28389 printf("Leak of %d blocks found in xmlOutputBufferFlush", 28390 xmlMemBlocks() - mem_base); 28391 test_ret++; 28392 printf(" %d", n_out); 28393 printf("\n"); 28394 } 28395 } 28396 function_tests++; 28397 #endif 28398 28399 return(test_ret); 28400 } 28401 28402 28403 static int 28404 test_xmlOutputBufferWrite(void) { 28405 int test_ret = 0; 28406 28407 #if defined(LIBXML_OUTPUT_ENABLED) 28408 int mem_base; 28409 int ret_val; 28410 xmlOutputBufferPtr out; /* a buffered parser output */ 28411 int n_out; 28412 int len; /* the size in bytes of the array. */ 28413 int n_len; 28414 char * buf; /* an char array */ 28415 int n_buf; 28416 28417 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28418 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28419 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { 28420 mem_base = xmlMemBlocks(); 28421 out = gen_xmlOutputBufferPtr(n_out, 0); 28422 len = gen_int(n_len, 1); 28423 buf = gen_const_char_ptr(n_buf, 2); 28424 28425 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf); 28426 desret_int(ret_val); 28427 call_tests++; 28428 des_xmlOutputBufferPtr(n_out, out, 0); 28429 des_int(n_len, len, 1); 28430 des_const_char_ptr(n_buf, (const char *)buf, 2); 28431 xmlResetLastError(); 28432 if (mem_base != xmlMemBlocks()) { 28433 printf("Leak of %d blocks found in xmlOutputBufferWrite", 28434 xmlMemBlocks() - mem_base); 28435 test_ret++; 28436 printf(" %d", n_out); 28437 printf(" %d", n_len); 28438 printf(" %d", n_buf); 28439 printf("\n"); 28440 } 28441 } 28442 } 28443 } 28444 function_tests++; 28445 #endif 28446 28447 return(test_ret); 28448 } 28449 28450 28451 static int 28452 test_xmlOutputBufferWriteEscape(void) { 28453 int test_ret = 0; 28454 28455 28456 /* missing type support */ 28457 return(test_ret); 28458 } 28459 28460 28461 static int 28462 test_xmlOutputBufferWriteString(void) { 28463 int test_ret = 0; 28464 28465 #if defined(LIBXML_OUTPUT_ENABLED) 28466 int mem_base; 28467 int ret_val; 28468 xmlOutputBufferPtr out; /* a buffered parser output */ 28469 int n_out; 28470 char * str; /* a zero terminated C string */ 28471 int n_str; 28472 28473 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { 28474 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { 28475 mem_base = xmlMemBlocks(); 28476 out = gen_xmlOutputBufferPtr(n_out, 0); 28477 str = gen_const_char_ptr(n_str, 1); 28478 28479 ret_val = xmlOutputBufferWriteString(out, (const char *)str); 28480 desret_int(ret_val); 28481 call_tests++; 28482 des_xmlOutputBufferPtr(n_out, out, 0); 28483 des_const_char_ptr(n_str, (const char *)str, 1); 28484 xmlResetLastError(); 28485 if (mem_base != xmlMemBlocks()) { 28486 printf("Leak of %d blocks found in xmlOutputBufferWriteString", 28487 xmlMemBlocks() - mem_base); 28488 test_ret++; 28489 printf(" %d", n_out); 28490 printf(" %d", n_str); 28491 printf("\n"); 28492 } 28493 } 28494 } 28495 function_tests++; 28496 #endif 28497 28498 return(test_ret); 28499 } 28500 28501 28502 static int 28503 test_xmlParserGetDirectory(void) { 28504 int test_ret = 0; 28505 28506 28507 /* missing type support */ 28508 return(test_ret); 28509 } 28510 28511 28512 static int 28513 test_xmlParserInputBufferCreateFd(void) { 28514 int test_ret = 0; 28515 28516 int mem_base; 28517 xmlParserInputBufferPtr ret_val; 28518 int fd; /* a file descriptor number */ 28519 int n_fd; 28520 xmlCharEncoding enc; /* the charset encoding if known */ 28521 int n_enc; 28522 28523 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { 28524 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28525 mem_base = xmlMemBlocks(); 28526 fd = gen_int(n_fd, 0); 28527 enc = gen_xmlCharEncoding(n_enc, 1); 28528 if (fd >= 0) fd = -1; 28529 28530 ret_val = xmlParserInputBufferCreateFd(fd, enc); 28531 desret_xmlParserInputBufferPtr(ret_val); 28532 call_tests++; 28533 des_int(n_fd, fd, 0); 28534 des_xmlCharEncoding(n_enc, enc, 1); 28535 xmlResetLastError(); 28536 if (mem_base != xmlMemBlocks()) { 28537 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd", 28538 xmlMemBlocks() - mem_base); 28539 test_ret++; 28540 printf(" %d", n_fd); 28541 printf(" %d", n_enc); 28542 printf("\n"); 28543 } 28544 } 28545 } 28546 function_tests++; 28547 28548 return(test_ret); 28549 } 28550 28551 28552 static int 28553 test_xmlParserInputBufferCreateFile(void) { 28554 int test_ret = 0; 28555 28556 int mem_base; 28557 xmlParserInputBufferPtr ret_val; 28558 FILE * file; /* a FILE* */ 28559 int n_file; 28560 xmlCharEncoding enc; /* the charset encoding if known */ 28561 int n_enc; 28562 28563 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) { 28564 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28565 mem_base = xmlMemBlocks(); 28566 file = gen_FILE_ptr(n_file, 0); 28567 enc = gen_xmlCharEncoding(n_enc, 1); 28568 28569 ret_val = xmlParserInputBufferCreateFile(file, enc); 28570 desret_xmlParserInputBufferPtr(ret_val); 28571 call_tests++; 28572 des_FILE_ptr(n_file, file, 0); 28573 des_xmlCharEncoding(n_enc, enc, 1); 28574 xmlResetLastError(); 28575 if (mem_base != xmlMemBlocks()) { 28576 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile", 28577 xmlMemBlocks() - mem_base); 28578 test_ret++; 28579 printf(" %d", n_file); 28580 printf(" %d", n_enc); 28581 printf("\n"); 28582 } 28583 } 28584 } 28585 function_tests++; 28586 28587 return(test_ret); 28588 } 28589 28590 28591 static int 28592 test_xmlParserInputBufferCreateFilename(void) { 28593 int test_ret = 0; 28594 28595 int mem_base; 28596 xmlParserInputBufferPtr ret_val; 28597 const char * URI; /* a C string containing the URI or filename */ 28598 int n_URI; 28599 xmlCharEncoding enc; /* the charset encoding if known */ 28600 int n_enc; 28601 28602 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) { 28603 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28604 mem_base = xmlMemBlocks(); 28605 URI = gen_fileoutput(n_URI, 0); 28606 enc = gen_xmlCharEncoding(n_enc, 1); 28607 28608 ret_val = xmlParserInputBufferCreateFilename(URI, enc); 28609 desret_xmlParserInputBufferPtr(ret_val); 28610 call_tests++; 28611 des_fileoutput(n_URI, URI, 0); 28612 des_xmlCharEncoding(n_enc, enc, 1); 28613 xmlResetLastError(); 28614 if (mem_base != xmlMemBlocks()) { 28615 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename", 28616 xmlMemBlocks() - mem_base); 28617 test_ret++; 28618 printf(" %d", n_URI); 28619 printf(" %d", n_enc); 28620 printf("\n"); 28621 } 28622 } 28623 } 28624 function_tests++; 28625 28626 return(test_ret); 28627 } 28628 28629 28630 static int 28631 test_xmlParserInputBufferCreateMem(void) { 28632 int test_ret = 0; 28633 28634 int mem_base; 28635 xmlParserInputBufferPtr ret_val; 28636 char * mem; /* the memory input */ 28637 int n_mem; 28638 int size; /* the length of the memory block */ 28639 int n_size; 28640 xmlCharEncoding enc; /* the charset encoding if known */ 28641 int n_enc; 28642 28643 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) { 28644 for (n_size = 0;n_size < gen_nb_int;n_size++) { 28645 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28646 mem_base = xmlMemBlocks(); 28647 mem = gen_const_char_ptr(n_mem, 0); 28648 size = gen_int(n_size, 1); 28649 enc = gen_xmlCharEncoding(n_enc, 2); 28650 28651 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc); 28652 desret_xmlParserInputBufferPtr(ret_val); 28653 call_tests++; 28654 des_const_char_ptr(n_mem, (const char *)mem, 0); 28655 des_int(n_size, size, 1); 28656 des_xmlCharEncoding(n_enc, enc, 2); 28657 xmlResetLastError(); 28658 if (mem_base != xmlMemBlocks()) { 28659 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem", 28660 xmlMemBlocks() - mem_base); 28661 test_ret++; 28662 printf(" %d", n_mem); 28663 printf(" %d", n_size); 28664 printf(" %d", n_enc); 28665 printf("\n"); 28666 } 28667 } 28668 } 28669 } 28670 function_tests++; 28671 28672 return(test_ret); 28673 } 28674 28675 28676 static int 28677 test_xmlParserInputBufferCreateStatic(void) { 28678 int test_ret = 0; 28679 28680 int mem_base; 28681 xmlParserInputBufferPtr ret_val; 28682 char * mem; /* the memory input */ 28683 int n_mem; 28684 int size; /* the length of the memory block */ 28685 int n_size; 28686 xmlCharEncoding enc; /* the charset encoding if known */ 28687 int n_enc; 28688 28689 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) { 28690 for (n_size = 0;n_size < gen_nb_int;n_size++) { 28691 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { 28692 mem_base = xmlMemBlocks(); 28693 mem = gen_const_char_ptr(n_mem, 0); 28694 size = gen_int(n_size, 1); 28695 enc = gen_xmlCharEncoding(n_enc, 2); 28696 28697 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc); 28698 desret_xmlParserInputBufferPtr(ret_val); 28699 call_tests++; 28700 des_const_char_ptr(n_mem, (const char *)mem, 0); 28701 des_int(n_size, size, 1); 28702 des_xmlCharEncoding(n_enc, enc, 2); 28703 xmlResetLastError(); 28704 if (mem_base != xmlMemBlocks()) { 28705 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic", 28706 xmlMemBlocks() - mem_base); 28707 test_ret++; 28708 printf(" %d", n_mem); 28709 printf(" %d", n_size); 28710 printf(" %d", n_enc); 28711 printf("\n"); 28712 } 28713 } 28714 } 28715 } 28716 function_tests++; 28717 28718 return(test_ret); 28719 } 28720 28721 28722 static int 28723 test_xmlParserInputBufferGrow(void) { 28724 int test_ret = 0; 28725 28726 int mem_base; 28727 int ret_val; 28728 xmlParserInputBufferPtr in; /* a buffered parser input */ 28729 int n_in; 28730 int len; /* indicative value of the amount of chars to read */ 28731 int n_len; 28732 28733 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { 28734 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28735 mem_base = xmlMemBlocks(); 28736 in = gen_xmlParserInputBufferPtr(n_in, 0); 28737 len = gen_int(n_len, 1); 28738 28739 ret_val = xmlParserInputBufferGrow(in, len); 28740 desret_int(ret_val); 28741 call_tests++; 28742 des_xmlParserInputBufferPtr(n_in, in, 0); 28743 des_int(n_len, len, 1); 28744 xmlResetLastError(); 28745 if (mem_base != xmlMemBlocks()) { 28746 printf("Leak of %d blocks found in xmlParserInputBufferGrow", 28747 xmlMemBlocks() - mem_base); 28748 test_ret++; 28749 printf(" %d", n_in); 28750 printf(" %d", n_len); 28751 printf("\n"); 28752 } 28753 } 28754 } 28755 function_tests++; 28756 28757 return(test_ret); 28758 } 28759 28760 28761 static int 28762 test_xmlParserInputBufferPush(void) { 28763 int test_ret = 0; 28764 28765 int mem_base; 28766 int ret_val; 28767 xmlParserInputBufferPtr in; /* a buffered parser input */ 28768 int n_in; 28769 int len; /* the size in bytes of the array. */ 28770 int n_len; 28771 char * buf; /* an char array */ 28772 int n_buf; 28773 28774 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { 28775 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28776 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { 28777 mem_base = xmlMemBlocks(); 28778 in = gen_xmlParserInputBufferPtr(n_in, 0); 28779 len = gen_int(n_len, 1); 28780 buf = gen_const_char_ptr(n_buf, 2); 28781 28782 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf); 28783 desret_int(ret_val); 28784 call_tests++; 28785 des_xmlParserInputBufferPtr(n_in, in, 0); 28786 des_int(n_len, len, 1); 28787 des_const_char_ptr(n_buf, (const char *)buf, 2); 28788 xmlResetLastError(); 28789 if (mem_base != xmlMemBlocks()) { 28790 printf("Leak of %d blocks found in xmlParserInputBufferPush", 28791 xmlMemBlocks() - mem_base); 28792 test_ret++; 28793 printf(" %d", n_in); 28794 printf(" %d", n_len); 28795 printf(" %d", n_buf); 28796 printf("\n"); 28797 } 28798 } 28799 } 28800 } 28801 function_tests++; 28802 28803 return(test_ret); 28804 } 28805 28806 28807 static int 28808 test_xmlParserInputBufferRead(void) { 28809 int test_ret = 0; 28810 28811 int mem_base; 28812 int ret_val; 28813 xmlParserInputBufferPtr in; /* a buffered parser input */ 28814 int n_in; 28815 int len; /* indicative value of the amount of chars to read */ 28816 int n_len; 28817 28818 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { 28819 for (n_len = 0;n_len < gen_nb_int;n_len++) { 28820 mem_base = xmlMemBlocks(); 28821 in = gen_xmlParserInputBufferPtr(n_in, 0); 28822 len = gen_int(n_len, 1); 28823 28824 ret_val = xmlParserInputBufferRead(in, len); 28825 desret_int(ret_val); 28826 call_tests++; 28827 des_xmlParserInputBufferPtr(n_in, in, 0); 28828 des_int(n_len, len, 1); 28829 xmlResetLastError(); 28830 if (mem_base != xmlMemBlocks()) { 28831 printf("Leak of %d blocks found in xmlParserInputBufferRead", 28832 xmlMemBlocks() - mem_base); 28833 test_ret++; 28834 printf(" %d", n_in); 28835 printf(" %d", n_len); 28836 printf("\n"); 28837 } 28838 } 28839 } 28840 function_tests++; 28841 28842 return(test_ret); 28843 } 28844 28845 28846 static int 28847 test_xmlPopInputCallbacks(void) { 28848 int test_ret = 0; 28849 28850 int mem_base; 28851 int ret_val; 28852 28853 mem_base = xmlMemBlocks(); 28854 28855 ret_val = xmlPopInputCallbacks(); 28856 desret_int(ret_val); 28857 call_tests++; 28858 xmlResetLastError(); 28859 if (mem_base != xmlMemBlocks()) { 28860 printf("Leak of %d blocks found in xmlPopInputCallbacks", 28861 xmlMemBlocks() - mem_base); 28862 test_ret++; 28863 printf("\n"); 28864 } 28865 function_tests++; 28866 28867 return(test_ret); 28868 } 28869 28870 28871 static int 28872 test_xmlRegisterDefaultInputCallbacks(void) { 28873 int test_ret = 0; 28874 28875 int mem_base; 28876 28877 mem_base = xmlMemBlocks(); 28878 28879 xmlRegisterDefaultInputCallbacks(); 28880 call_tests++; 28881 xmlResetLastError(); 28882 if (mem_base != xmlMemBlocks()) { 28883 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks", 28884 xmlMemBlocks() - mem_base); 28885 test_ret++; 28886 printf("\n"); 28887 } 28888 function_tests++; 28889 28890 return(test_ret); 28891 } 28892 28893 28894 static int 28895 test_xmlRegisterDefaultOutputCallbacks(void) { 28896 int test_ret = 0; 28897 28898 #if defined(LIBXML_OUTPUT_ENABLED) 28899 int mem_base; 28900 28901 mem_base = xmlMemBlocks(); 28902 28903 xmlRegisterDefaultOutputCallbacks(); 28904 call_tests++; 28905 xmlResetLastError(); 28906 if (mem_base != xmlMemBlocks()) { 28907 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks", 28908 xmlMemBlocks() - mem_base); 28909 test_ret++; 28910 printf("\n"); 28911 } 28912 function_tests++; 28913 #endif 28914 28915 return(test_ret); 28916 } 28917 28918 28919 static int 28920 test_xmlRegisterHTTPPostCallbacks(void) { 28921 int test_ret = 0; 28922 28923 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED) 28924 int mem_base; 28925 28926 mem_base = xmlMemBlocks(); 28927 28928 xmlRegisterHTTPPostCallbacks(); 28929 call_tests++; 28930 xmlResetLastError(); 28931 if (mem_base != xmlMemBlocks()) { 28932 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks", 28933 xmlMemBlocks() - mem_base); 28934 test_ret++; 28935 printf("\n"); 28936 } 28937 function_tests++; 28938 #endif 28939 28940 return(test_ret); 28941 } 28942 28943 static int 28944 test_xmlIO(void) { 28945 int test_ret = 0; 28946 28947 if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n"); 28948 test_ret += test_xmlAllocOutputBuffer(); 28949 test_ret += test_xmlAllocParserInputBuffer(); 28950 test_ret += test_xmlCheckFilename(); 28951 test_ret += test_xmlCheckHTTPInput(); 28952 test_ret += test_xmlCleanupInputCallbacks(); 28953 test_ret += test_xmlCleanupOutputCallbacks(); 28954 test_ret += test_xmlFileClose(); 28955 test_ret += test_xmlFileMatch(); 28956 test_ret += test_xmlFileOpen(); 28957 test_ret += test_xmlFileRead(); 28958 test_ret += test_xmlIOFTPClose(); 28959 test_ret += test_xmlIOFTPMatch(); 28960 test_ret += test_xmlIOFTPOpen(); 28961 test_ret += test_xmlIOFTPRead(); 28962 test_ret += test_xmlIOHTTPClose(); 28963 test_ret += test_xmlIOHTTPMatch(); 28964 test_ret += test_xmlIOHTTPOpen(); 28965 test_ret += test_xmlIOHTTPRead(); 28966 test_ret += test_xmlNoNetExternalEntityLoader(); 28967 test_ret += test_xmlNormalizeWindowsPath(); 28968 test_ret += test_xmlOutputBufferCreateBuffer(); 28969 test_ret += test_xmlOutputBufferCreateFd(); 28970 test_ret += test_xmlOutputBufferCreateFile(); 28971 test_ret += test_xmlOutputBufferCreateFilename(); 28972 test_ret += test_xmlOutputBufferFlush(); 28973 test_ret += test_xmlOutputBufferWrite(); 28974 test_ret += test_xmlOutputBufferWriteEscape(); 28975 test_ret += test_xmlOutputBufferWriteString(); 28976 test_ret += test_xmlParserGetDirectory(); 28977 test_ret += test_xmlParserInputBufferCreateFd(); 28978 test_ret += test_xmlParserInputBufferCreateFile(); 28979 test_ret += test_xmlParserInputBufferCreateFilename(); 28980 test_ret += test_xmlParserInputBufferCreateMem(); 28981 test_ret += test_xmlParserInputBufferCreateStatic(); 28982 test_ret += test_xmlParserInputBufferGrow(); 28983 test_ret += test_xmlParserInputBufferPush(); 28984 test_ret += test_xmlParserInputBufferRead(); 28985 test_ret += test_xmlPopInputCallbacks(); 28986 test_ret += test_xmlRegisterDefaultInputCallbacks(); 28987 test_ret += test_xmlRegisterDefaultOutputCallbacks(); 28988 test_ret += test_xmlRegisterHTTPPostCallbacks(); 28989 28990 if (test_ret != 0) 28991 printf("Module xmlIO: %d errors\n", test_ret); 28992 return(test_ret); 28993 } 28994 #ifdef LIBXML_AUTOMATA_ENABLED 28995 28996 #define gen_nb_xmlAutomataPtr 1 28997 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 28998 return(NULL); 28999 } 29000 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29001 } 29002 #endif 29003 29004 29005 static int 29006 test_xmlAutomataCompile(void) { 29007 int test_ret = 0; 29008 29009 29010 /* missing type support */ 29011 return(test_ret); 29012 } 29013 29014 29015 static int 29016 test_xmlAutomataGetInitState(void) { 29017 int test_ret = 0; 29018 29019 29020 /* missing type support */ 29021 return(test_ret); 29022 } 29023 29024 29025 static int 29026 test_xmlAutomataIsDeterminist(void) { 29027 int test_ret = 0; 29028 29029 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) 29030 int mem_base; 29031 int ret_val; 29032 xmlAutomataPtr am; /* an automata */ 29033 int n_am; 29034 29035 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { 29036 mem_base = xmlMemBlocks(); 29037 am = gen_xmlAutomataPtr(n_am, 0); 29038 29039 ret_val = xmlAutomataIsDeterminist(am); 29040 desret_int(ret_val); 29041 call_tests++; 29042 des_xmlAutomataPtr(n_am, am, 0); 29043 xmlResetLastError(); 29044 if (mem_base != xmlMemBlocks()) { 29045 printf("Leak of %d blocks found in xmlAutomataIsDeterminist", 29046 xmlMemBlocks() - mem_base); 29047 test_ret++; 29048 printf(" %d", n_am); 29049 printf("\n"); 29050 } 29051 } 29052 function_tests++; 29053 #endif 29054 29055 return(test_ret); 29056 } 29057 29058 #ifdef LIBXML_AUTOMATA_ENABLED 29059 29060 #define gen_nb_xmlAutomataStatePtr 1 29061 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29062 return(NULL); 29063 } 29064 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29065 } 29066 #endif 29067 29068 29069 static int 29070 test_xmlAutomataNewAllTrans(void) { 29071 int test_ret = 0; 29072 29073 29074 /* missing type support */ 29075 return(test_ret); 29076 } 29077 29078 29079 static int 29080 test_xmlAutomataNewCountTrans(void) { 29081 int test_ret = 0; 29082 29083 29084 /* missing type support */ 29085 return(test_ret); 29086 } 29087 29088 29089 static int 29090 test_xmlAutomataNewCountTrans2(void) { 29091 int test_ret = 0; 29092 29093 29094 /* missing type support */ 29095 return(test_ret); 29096 } 29097 29098 29099 static int 29100 test_xmlAutomataNewCountedTrans(void) { 29101 int test_ret = 0; 29102 29103 29104 /* missing type support */ 29105 return(test_ret); 29106 } 29107 29108 29109 static int 29110 test_xmlAutomataNewCounter(void) { 29111 int test_ret = 0; 29112 29113 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) 29114 int mem_base; 29115 int ret_val; 29116 xmlAutomataPtr am; /* an automata */ 29117 int n_am; 29118 int min; /* the minimal value on the counter */ 29119 int n_min; 29120 int max; /* the maximal value on the counter */ 29121 int n_max; 29122 29123 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { 29124 for (n_min = 0;n_min < gen_nb_int;n_min++) { 29125 for (n_max = 0;n_max < gen_nb_int;n_max++) { 29126 mem_base = xmlMemBlocks(); 29127 am = gen_xmlAutomataPtr(n_am, 0); 29128 min = gen_int(n_min, 1); 29129 max = gen_int(n_max, 2); 29130 29131 ret_val = xmlAutomataNewCounter(am, min, max); 29132 desret_int(ret_val); 29133 call_tests++; 29134 des_xmlAutomataPtr(n_am, am, 0); 29135 des_int(n_min, min, 1); 29136 des_int(n_max, max, 2); 29137 xmlResetLastError(); 29138 if (mem_base != xmlMemBlocks()) { 29139 printf("Leak of %d blocks found in xmlAutomataNewCounter", 29140 xmlMemBlocks() - mem_base); 29141 test_ret++; 29142 printf(" %d", n_am); 29143 printf(" %d", n_min); 29144 printf(" %d", n_max); 29145 printf("\n"); 29146 } 29147 } 29148 } 29149 } 29150 function_tests++; 29151 #endif 29152 29153 return(test_ret); 29154 } 29155 29156 29157 static int 29158 test_xmlAutomataNewCounterTrans(void) { 29159 int test_ret = 0; 29160 29161 29162 /* missing type support */ 29163 return(test_ret); 29164 } 29165 29166 29167 static int 29168 test_xmlAutomataNewEpsilon(void) { 29169 int test_ret = 0; 29170 29171 29172 /* missing type support */ 29173 return(test_ret); 29174 } 29175 29176 29177 static int 29178 test_xmlAutomataNewNegTrans(void) { 29179 int test_ret = 0; 29180 29181 29182 /* missing type support */ 29183 return(test_ret); 29184 } 29185 29186 29187 static int 29188 test_xmlAutomataNewOnceTrans(void) { 29189 int test_ret = 0; 29190 29191 29192 /* missing type support */ 29193 return(test_ret); 29194 } 29195 29196 29197 static int 29198 test_xmlAutomataNewOnceTrans2(void) { 29199 int test_ret = 0; 29200 29201 29202 /* missing type support */ 29203 return(test_ret); 29204 } 29205 29206 29207 static int 29208 test_xmlAutomataNewState(void) { 29209 int test_ret = 0; 29210 29211 29212 /* missing type support */ 29213 return(test_ret); 29214 } 29215 29216 29217 static int 29218 test_xmlAutomataNewTransition(void) { 29219 int test_ret = 0; 29220 29221 29222 /* missing type support */ 29223 return(test_ret); 29224 } 29225 29226 29227 static int 29228 test_xmlAutomataNewTransition2(void) { 29229 int test_ret = 0; 29230 29231 29232 /* missing type support */ 29233 return(test_ret); 29234 } 29235 29236 29237 static int 29238 test_xmlAutomataSetFinalState(void) { 29239 int test_ret = 0; 29240 29241 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) 29242 int mem_base; 29243 int ret_val; 29244 xmlAutomataPtr am; /* an automata */ 29245 int n_am; 29246 xmlAutomataStatePtr state; /* a state in this automata */ 29247 int n_state; 29248 29249 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { 29250 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) { 29251 mem_base = xmlMemBlocks(); 29252 am = gen_xmlAutomataPtr(n_am, 0); 29253 state = gen_xmlAutomataStatePtr(n_state, 1); 29254 29255 ret_val = xmlAutomataSetFinalState(am, state); 29256 desret_int(ret_val); 29257 call_tests++; 29258 des_xmlAutomataPtr(n_am, am, 0); 29259 des_xmlAutomataStatePtr(n_state, state, 1); 29260 xmlResetLastError(); 29261 if (mem_base != xmlMemBlocks()) { 29262 printf("Leak of %d blocks found in xmlAutomataSetFinalState", 29263 xmlMemBlocks() - mem_base); 29264 test_ret++; 29265 printf(" %d", n_am); 29266 printf(" %d", n_state); 29267 printf("\n"); 29268 } 29269 } 29270 } 29271 function_tests++; 29272 #endif 29273 29274 return(test_ret); 29275 } 29276 29277 29278 static int 29279 test_xmlNewAutomata(void) { 29280 int test_ret = 0; 29281 29282 29283 /* missing type support */ 29284 return(test_ret); 29285 } 29286 29287 static int 29288 test_xmlautomata(void) { 29289 int test_ret = 0; 29290 29291 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n"); 29292 test_ret += test_xmlAutomataCompile(); 29293 test_ret += test_xmlAutomataGetInitState(); 29294 test_ret += test_xmlAutomataIsDeterminist(); 29295 test_ret += test_xmlAutomataNewAllTrans(); 29296 test_ret += test_xmlAutomataNewCountTrans(); 29297 test_ret += test_xmlAutomataNewCountTrans2(); 29298 test_ret += test_xmlAutomataNewCountedTrans(); 29299 test_ret += test_xmlAutomataNewCounter(); 29300 test_ret += test_xmlAutomataNewCounterTrans(); 29301 test_ret += test_xmlAutomataNewEpsilon(); 29302 test_ret += test_xmlAutomataNewNegTrans(); 29303 test_ret += test_xmlAutomataNewOnceTrans(); 29304 test_ret += test_xmlAutomataNewOnceTrans2(); 29305 test_ret += test_xmlAutomataNewState(); 29306 test_ret += test_xmlAutomataNewTransition(); 29307 test_ret += test_xmlAutomataNewTransition2(); 29308 test_ret += test_xmlAutomataSetFinalState(); 29309 test_ret += test_xmlNewAutomata(); 29310 29311 if (test_ret != 0) 29312 printf("Module xmlautomata: %d errors\n", test_ret); 29313 return(test_ret); 29314 } 29315 29316 #define gen_nb_xmlGenericErrorFunc_ptr 1 29317 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29318 return(NULL); 29319 } 29320 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29321 } 29322 29323 static int 29324 test_initGenericErrorDefaultFunc(void) { 29325 int test_ret = 0; 29326 29327 int mem_base; 29328 xmlGenericErrorFunc * handler; /* the handler */ 29329 int n_handler; 29330 29331 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) { 29332 mem_base = xmlMemBlocks(); 29333 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0); 29334 29335 initGenericErrorDefaultFunc(handler); 29336 call_tests++; 29337 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0); 29338 xmlResetLastError(); 29339 if (mem_base != xmlMemBlocks()) { 29340 printf("Leak of %d blocks found in initGenericErrorDefaultFunc", 29341 xmlMemBlocks() - mem_base); 29342 test_ret++; 29343 printf(" %d", n_handler); 29344 printf("\n"); 29345 } 29346 } 29347 function_tests++; 29348 29349 return(test_ret); 29350 } 29351 29352 29353 #define gen_nb_xmlErrorPtr 1 29354 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29355 return(NULL); 29356 } 29357 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29358 } 29359 29360 static int 29361 test_xmlCopyError(void) { 29362 int test_ret = 0; 29363 29364 int mem_base; 29365 int ret_val; 29366 xmlErrorPtr from; /* a source error */ 29367 int n_from; 29368 xmlErrorPtr to; /* a target error */ 29369 int n_to; 29370 29371 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) { 29372 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) { 29373 mem_base = xmlMemBlocks(); 29374 from = gen_xmlErrorPtr(n_from, 0); 29375 to = gen_xmlErrorPtr(n_to, 1); 29376 29377 ret_val = xmlCopyError(from, to); 29378 desret_int(ret_val); 29379 call_tests++; 29380 des_xmlErrorPtr(n_from, from, 0); 29381 des_xmlErrorPtr(n_to, to, 1); 29382 xmlResetLastError(); 29383 if (mem_base != xmlMemBlocks()) { 29384 printf("Leak of %d blocks found in xmlCopyError", 29385 xmlMemBlocks() - mem_base); 29386 test_ret++; 29387 printf(" %d", n_from); 29388 printf(" %d", n_to); 29389 printf("\n"); 29390 } 29391 } 29392 } 29393 function_tests++; 29394 29395 return(test_ret); 29396 } 29397 29398 29399 static int 29400 test_xmlCtxtGetLastError(void) { 29401 int test_ret = 0; 29402 29403 29404 /* missing type support */ 29405 return(test_ret); 29406 } 29407 29408 29409 static int 29410 test_xmlCtxtResetLastError(void) { 29411 int test_ret = 0; 29412 29413 int mem_base; 29414 void * ctx; /* an XML parser context */ 29415 int n_ctx; 29416 29417 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { 29418 mem_base = xmlMemBlocks(); 29419 ctx = gen_void_ptr(n_ctx, 0); 29420 29421 xmlCtxtResetLastError(ctx); 29422 call_tests++; 29423 des_void_ptr(n_ctx, ctx, 0); 29424 xmlResetLastError(); 29425 if (mem_base != xmlMemBlocks()) { 29426 printf("Leak of %d blocks found in xmlCtxtResetLastError", 29427 xmlMemBlocks() - mem_base); 29428 test_ret++; 29429 printf(" %d", n_ctx); 29430 printf("\n"); 29431 } 29432 } 29433 function_tests++; 29434 29435 return(test_ret); 29436 } 29437 29438 29439 static int 29440 test_xmlGetLastError(void) { 29441 int test_ret = 0; 29442 29443 29444 /* missing type support */ 29445 return(test_ret); 29446 } 29447 29448 29449 static int 29450 test_xmlParserError(void) { 29451 int test_ret = 0; 29452 29453 29454 /* missing type support */ 29455 return(test_ret); 29456 } 29457 29458 29459 static int 29460 test_xmlParserPrintFileContext(void) { 29461 int test_ret = 0; 29462 29463 int mem_base; 29464 xmlParserInputPtr input; /* an xmlParserInputPtr input */ 29465 int n_input; 29466 29467 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 29468 mem_base = xmlMemBlocks(); 29469 input = gen_xmlParserInputPtr(n_input, 0); 29470 29471 xmlParserPrintFileContext(input); 29472 call_tests++; 29473 des_xmlParserInputPtr(n_input, input, 0); 29474 xmlResetLastError(); 29475 if (mem_base != xmlMemBlocks()) { 29476 printf("Leak of %d blocks found in xmlParserPrintFileContext", 29477 xmlMemBlocks() - mem_base); 29478 test_ret++; 29479 printf(" %d", n_input); 29480 printf("\n"); 29481 } 29482 } 29483 function_tests++; 29484 29485 return(test_ret); 29486 } 29487 29488 29489 static int 29490 test_xmlParserPrintFileInfo(void) { 29491 int test_ret = 0; 29492 29493 int mem_base; 29494 xmlParserInputPtr input; /* an xmlParserInputPtr input */ 29495 int n_input; 29496 29497 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { 29498 mem_base = xmlMemBlocks(); 29499 input = gen_xmlParserInputPtr(n_input, 0); 29500 29501 xmlParserPrintFileInfo(input); 29502 call_tests++; 29503 des_xmlParserInputPtr(n_input, input, 0); 29504 xmlResetLastError(); 29505 if (mem_base != xmlMemBlocks()) { 29506 printf("Leak of %d blocks found in xmlParserPrintFileInfo", 29507 xmlMemBlocks() - mem_base); 29508 test_ret++; 29509 printf(" %d", n_input); 29510 printf("\n"); 29511 } 29512 } 29513 function_tests++; 29514 29515 return(test_ret); 29516 } 29517 29518 29519 static int 29520 test_xmlParserValidityError(void) { 29521 int test_ret = 0; 29522 29523 29524 /* missing type support */ 29525 return(test_ret); 29526 } 29527 29528 29529 static int 29530 test_xmlParserValidityWarning(void) { 29531 int test_ret = 0; 29532 29533 29534 /* missing type support */ 29535 return(test_ret); 29536 } 29537 29538 29539 static int 29540 test_xmlParserWarning(void) { 29541 int test_ret = 0; 29542 29543 29544 /* missing type support */ 29545 return(test_ret); 29546 } 29547 29548 29549 static int 29550 test_xmlResetError(void) { 29551 int test_ret = 0; 29552 29553 int mem_base; 29554 xmlErrorPtr err; /* pointer to the error. */ 29555 int n_err; 29556 29557 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) { 29558 mem_base = xmlMemBlocks(); 29559 err = gen_xmlErrorPtr(n_err, 0); 29560 29561 xmlResetError(err); 29562 call_tests++; 29563 des_xmlErrorPtr(n_err, err, 0); 29564 xmlResetLastError(); 29565 if (mem_base != xmlMemBlocks()) { 29566 printf("Leak of %d blocks found in xmlResetError", 29567 xmlMemBlocks() - mem_base); 29568 test_ret++; 29569 printf(" %d", n_err); 29570 printf("\n"); 29571 } 29572 } 29573 function_tests++; 29574 29575 return(test_ret); 29576 } 29577 29578 29579 static int 29580 test_xmlResetLastError(void) { 29581 int test_ret = 0; 29582 29583 29584 29585 xmlResetLastError(); 29586 call_tests++; 29587 xmlResetLastError(); 29588 function_tests++; 29589 29590 return(test_ret); 29591 } 29592 29593 29594 static int 29595 test_xmlSetGenericErrorFunc(void) { 29596 int test_ret = 0; 29597 29598 29599 /* missing type support */ 29600 return(test_ret); 29601 } 29602 29603 29604 static int 29605 test_xmlSetStructuredErrorFunc(void) { 29606 int test_ret = 0; 29607 29608 29609 /* missing type support */ 29610 return(test_ret); 29611 } 29612 29613 static int 29614 test_xmlerror(void) { 29615 int test_ret = 0; 29616 29617 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n"); 29618 test_ret += test_initGenericErrorDefaultFunc(); 29619 test_ret += test_xmlCopyError(); 29620 test_ret += test_xmlCtxtGetLastError(); 29621 test_ret += test_xmlCtxtResetLastError(); 29622 test_ret += test_xmlGetLastError(); 29623 test_ret += test_xmlParserError(); 29624 test_ret += test_xmlParserPrintFileContext(); 29625 test_ret += test_xmlParserPrintFileInfo(); 29626 test_ret += test_xmlParserValidityError(); 29627 test_ret += test_xmlParserValidityWarning(); 29628 test_ret += test_xmlParserWarning(); 29629 test_ret += test_xmlResetError(); 29630 test_ret += test_xmlResetLastError(); 29631 test_ret += test_xmlSetGenericErrorFunc(); 29632 test_ret += test_xmlSetStructuredErrorFunc(); 29633 29634 if (test_ret != 0) 29635 printf("Module xmlerror: %d errors\n", test_ret); 29636 return(test_ret); 29637 } 29638 #ifdef LIBXML_MODULES_ENABLED 29639 29640 #define gen_nb_xmlModulePtr 1 29641 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29642 return(NULL); 29643 } 29644 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { 29645 } 29646 #endif 29647 29648 29649 static int 29650 test_xmlModuleClose(void) { 29651 int test_ret = 0; 29652 29653 #if defined(LIBXML_MODULES_ENABLED) 29654 int mem_base; 29655 int ret_val; 29656 xmlModulePtr module; /* the module handle */ 29657 int n_module; 29658 29659 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) { 29660 mem_base = xmlMemBlocks(); 29661 module = gen_xmlModulePtr(n_module, 0); 29662 29663 ret_val = xmlModuleClose(module); 29664 desret_int(ret_val); 29665 call_tests++; 29666 des_xmlModulePtr(n_module, module, 0); 29667 xmlResetLastError(); 29668 if (mem_base != xmlMemBlocks()) { 29669 printf("Leak of %d blocks found in xmlModuleClose", 29670 xmlMemBlocks() - mem_base); 29671 test_ret++; 29672 printf(" %d", n_module); 29673 printf("\n"); 29674 } 29675 } 29676 function_tests++; 29677 #endif 29678 29679 return(test_ret); 29680 } 29681 29682 29683 static int 29684 test_xmlModuleOpen(void) { 29685 int test_ret = 0; 29686 29687 29688 /* missing type support */ 29689 return(test_ret); 29690 } 29691 29692 29693 static int 29694 test_xmlModuleSymbol(void) { 29695 int test_ret = 0; 29696 29697 #if defined(LIBXML_MODULES_ENABLED) 29698 int mem_base; 29699 int ret_val; 29700 xmlModulePtr module; /* the module */ 29701 int n_module; 29702 char * name; /* the name of the symbol */ 29703 int n_name; 29704 void ** symbol; /* the resulting symbol address */ 29705 int n_symbol; 29706 29707 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) { 29708 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { 29709 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) { 29710 mem_base = xmlMemBlocks(); 29711 module = gen_xmlModulePtr(n_module, 0); 29712 name = gen_const_char_ptr(n_name, 1); 29713 symbol = gen_void_ptr_ptr(n_symbol, 2); 29714 29715 ret_val = xmlModuleSymbol(module, (const char *)name, symbol); 29716 desret_int(ret_val); 29717 call_tests++; 29718 des_xmlModulePtr(n_module, module, 0); 29719 des_const_char_ptr(n_name, (const char *)name, 1); 29720 des_void_ptr_ptr(n_symbol, symbol, 2); 29721 xmlResetLastError(); 29722 if (mem_base != xmlMemBlocks()) { 29723 printf("Leak of %d blocks found in xmlModuleSymbol", 29724 xmlMemBlocks() - mem_base); 29725 test_ret++; 29726 printf(" %d", n_module); 29727 printf(" %d", n_name); 29728 printf(" %d", n_symbol); 29729 printf("\n"); 29730 } 29731 } 29732 } 29733 } 29734 function_tests++; 29735 #endif 29736 29737 return(test_ret); 29738 } 29739 29740 static int 29741 test_xmlmodule(void) { 29742 int test_ret = 0; 29743 29744 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n"); 29745 test_ret += test_xmlModuleClose(); 29746 test_ret += test_xmlModuleOpen(); 29747 test_ret += test_xmlModuleSymbol(); 29748 29749 if (test_ret != 0) 29750 printf("Module xmlmodule: %d errors\n", test_ret); 29751 return(test_ret); 29752 } 29753 29754 static int 29755 test_xmlNewTextReader(void) { 29756 int test_ret = 0; 29757 29758 #if defined(LIBXML_READER_ENABLED) 29759 int mem_base; 29760 xmlTextReaderPtr ret_val; 29761 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */ 29762 int n_input; 29763 const char * URI; /* the URI information for the source if available */ 29764 int n_URI; 29765 29766 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { 29767 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) { 29768 mem_base = xmlMemBlocks(); 29769 input = gen_xmlParserInputBufferPtr(n_input, 0); 29770 URI = gen_filepath(n_URI, 1); 29771 29772 ret_val = xmlNewTextReader(input, URI); 29773 desret_xmlTextReaderPtr(ret_val); 29774 call_tests++; 29775 des_xmlParserInputBufferPtr(n_input, input, 0); 29776 des_filepath(n_URI, URI, 1); 29777 xmlResetLastError(); 29778 if (mem_base != xmlMemBlocks()) { 29779 printf("Leak of %d blocks found in xmlNewTextReader", 29780 xmlMemBlocks() - mem_base); 29781 test_ret++; 29782 printf(" %d", n_input); 29783 printf(" %d", n_URI); 29784 printf("\n"); 29785 } 29786 } 29787 } 29788 function_tests++; 29789 #endif 29790 29791 return(test_ret); 29792 } 29793 29794 29795 static int 29796 test_xmlNewTextReaderFilename(void) { 29797 int test_ret = 0; 29798 29799 #if defined(LIBXML_READER_ENABLED) 29800 int mem_base; 29801 xmlTextReaderPtr ret_val; 29802 const char * URI; /* the URI of the resource to process */ 29803 int n_URI; 29804 29805 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) { 29806 mem_base = xmlMemBlocks(); 29807 URI = gen_filepath(n_URI, 0); 29808 29809 ret_val = xmlNewTextReaderFilename(URI); 29810 desret_xmlTextReaderPtr(ret_val); 29811 call_tests++; 29812 des_filepath(n_URI, URI, 0); 29813 xmlResetLastError(); 29814 if (mem_base != xmlMemBlocks()) { 29815 printf("Leak of %d blocks found in xmlNewTextReaderFilename", 29816 xmlMemBlocks() - mem_base); 29817 test_ret++; 29818 printf(" %d", n_URI); 29819 printf("\n"); 29820 } 29821 } 29822 function_tests++; 29823 #endif 29824 29825 return(test_ret); 29826 } 29827 29828 29829 static int 29830 test_xmlReaderForDoc(void) { 29831 int test_ret = 0; 29832 29833 #if defined(LIBXML_READER_ENABLED) 29834 int mem_base; 29835 xmlTextReaderPtr ret_val; 29836 xmlChar * cur; /* a pointer to a zero terminated string */ 29837 int n_cur; 29838 const char * URL; /* the base URL to use for the document */ 29839 int n_URL; 29840 char * encoding; /* the document encoding, or NULL */ 29841 int n_encoding; 29842 int options; /* a combination of xmlParserOption */ 29843 int n_options; 29844 29845 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 29846 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 29847 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 29848 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 29849 mem_base = xmlMemBlocks(); 29850 cur = gen_const_xmlChar_ptr(n_cur, 0); 29851 URL = gen_filepath(n_URL, 1); 29852 encoding = gen_const_char_ptr(n_encoding, 2); 29853 options = gen_parseroptions(n_options, 3); 29854 29855 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options); 29856 desret_xmlTextReaderPtr(ret_val); 29857 call_tests++; 29858 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); 29859 des_filepath(n_URL, URL, 1); 29860 des_const_char_ptr(n_encoding, (const char *)encoding, 2); 29861 des_parseroptions(n_options, options, 3); 29862 xmlResetLastError(); 29863 if (mem_base != xmlMemBlocks()) { 29864 printf("Leak of %d blocks found in xmlReaderForDoc", 29865 xmlMemBlocks() - mem_base); 29866 test_ret++; 29867 printf(" %d", n_cur); 29868 printf(" %d", n_URL); 29869 printf(" %d", n_encoding); 29870 printf(" %d", n_options); 29871 printf("\n"); 29872 } 29873 } 29874 } 29875 } 29876 } 29877 function_tests++; 29878 #endif 29879 29880 return(test_ret); 29881 } 29882 29883 29884 static int 29885 test_xmlReaderForFile(void) { 29886 int test_ret = 0; 29887 29888 #if defined(LIBXML_READER_ENABLED) 29889 int mem_base; 29890 xmlTextReaderPtr ret_val; 29891 const char * filename; /* a file or URL */ 29892 int n_filename; 29893 char * encoding; /* the document encoding, or NULL */ 29894 int n_encoding; 29895 int options; /* a combination of xmlParserOption */ 29896 int n_options; 29897 29898 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { 29899 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 29900 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 29901 mem_base = xmlMemBlocks(); 29902 filename = gen_filepath(n_filename, 0); 29903 encoding = gen_const_char_ptr(n_encoding, 1); 29904 options = gen_parseroptions(n_options, 2); 29905 29906 ret_val = xmlReaderForFile(filename, (const char *)encoding, options); 29907 desret_xmlTextReaderPtr(ret_val); 29908 call_tests++; 29909 des_filepath(n_filename, filename, 0); 29910 des_const_char_ptr(n_encoding, (const char *)encoding, 1); 29911 des_parseroptions(n_options, options, 2); 29912 xmlResetLastError(); 29913 if (mem_base != xmlMemBlocks()) { 29914 printf("Leak of %d blocks found in xmlReaderForFile", 29915 xmlMemBlocks() - mem_base); 29916 test_ret++; 29917 printf(" %d", n_filename); 29918 printf(" %d", n_encoding); 29919 printf(" %d", n_options); 29920 printf("\n"); 29921 } 29922 } 29923 } 29924 } 29925 function_tests++; 29926 #endif 29927 29928 return(test_ret); 29929 } 29930 29931 29932 static int 29933 test_xmlReaderForMemory(void) { 29934 int test_ret = 0; 29935 29936 #if defined(LIBXML_READER_ENABLED) 29937 int mem_base; 29938 xmlTextReaderPtr ret_val; 29939 char * buffer; /* a pointer to a char array */ 29940 int n_buffer; 29941 int size; /* the size of the array */ 29942 int n_size; 29943 const char * URL; /* the base URL to use for the document */ 29944 int n_URL; 29945 char * encoding; /* the document encoding, or NULL */ 29946 int n_encoding; 29947 int options; /* a combination of xmlParserOption */ 29948 int n_options; 29949 29950 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { 29951 for (n_size = 0;n_size < gen_nb_int;n_size++) { 29952 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 29953 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 29954 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 29955 mem_base = xmlMemBlocks(); 29956 buffer = gen_const_char_ptr(n_buffer, 0); 29957 size = gen_int(n_size, 1); 29958 URL = gen_filepath(n_URL, 2); 29959 encoding = gen_const_char_ptr(n_encoding, 3); 29960 options = gen_parseroptions(n_options, 4); 29961 29962 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options); 29963 desret_xmlTextReaderPtr(ret_val); 29964 call_tests++; 29965 des_const_char_ptr(n_buffer, (const char *)buffer, 0); 29966 des_int(n_size, size, 1); 29967 des_filepath(n_URL, URL, 2); 29968 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 29969 des_parseroptions(n_options, options, 4); 29970 xmlResetLastError(); 29971 if (mem_base != xmlMemBlocks()) { 29972 printf("Leak of %d blocks found in xmlReaderForMemory", 29973 xmlMemBlocks() - mem_base); 29974 test_ret++; 29975 printf(" %d", n_buffer); 29976 printf(" %d", n_size); 29977 printf(" %d", n_URL); 29978 printf(" %d", n_encoding); 29979 printf(" %d", n_options); 29980 printf("\n"); 29981 } 29982 } 29983 } 29984 } 29985 } 29986 } 29987 function_tests++; 29988 #endif 29989 29990 return(test_ret); 29991 } 29992 29993 29994 static int 29995 test_xmlReaderNewDoc(void) { 29996 int test_ret = 0; 29997 29998 #if defined(LIBXML_READER_ENABLED) 29999 int mem_base; 30000 int ret_val; 30001 xmlTextReaderPtr reader; /* an XML reader */ 30002 int n_reader; 30003 xmlChar * cur; /* a pointer to a zero terminated string */ 30004 int n_cur; 30005 const char * URL; /* the base URL to use for the document */ 30006 int n_URL; 30007 char * encoding; /* the document encoding, or NULL */ 30008 int n_encoding; 30009 int options; /* a combination of xmlParserOption */ 30010 int n_options; 30011 30012 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30013 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { 30014 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { 30015 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { 30016 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { 30017 mem_base = xmlMemBlocks(); 30018 reader = gen_xmlTextReaderPtr(n_reader, 0); 30019 cur = gen_const_xmlChar_ptr(n_cur, 1); 30020 URL = gen_filepath(n_URL, 2); 30021 encoding = gen_const_char_ptr(n_encoding, 3); 30022 options = gen_parseroptions(n_options, 4); 30023 30024 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options); 30025 desret_int(ret_val); 30026 call_tests++; 30027 des_xmlTextReaderPtr(n_reader, reader, 0); 30028 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); 30029 des_filepath(n_URL, URL, 2); 30030 des_const_char_ptr(n_encoding, (const char *)encoding, 3); 30031 des_parseroptions(n_options, options, 4); 30032 xmlResetLastError(); 30033 if (mem_base != xmlMemBlocks()) { 30034 printf("Leak of %d blocks found in xmlReaderNewDoc", 30035 xmlMemBlocks() - mem_base); 30036 test_ret++; 30037 printf(" %d", n_reader); 30038 printf(" %d", n_cur); 30039 printf(" %d", n_URL); 30040 printf(" %d", n_encoding); 30041 printf(" %d", n_options); 30042 printf("\n"); 30043 } 30044 } 30045 } 30046 } 30047 } 30048 } 30049 function_tests++; 30050 #endif 30051 30052 return(test_ret); 30053 } 30054 30055 30056 static int 30057 test_xmlReaderNewFile(void) { 30058 int test_ret = 0; 30059 30060 #if defined(LIBXML_READER_ENABLED) 30061 int mem_base; 30062 int ret_val; 30063 xmlTextReaderPtr reader; /* an XML reader */ 30064 int n_reader; 30065 const char * filename; /* a file or URL */ 30066 int n_filename; 30067 char * encoding; /* the document encoding, or NULL */ 30068 int n_encoding; 30069 int options; /* a combination of xmlParserOption */ 30070 int n_options; 30071 30072 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { 30073 for (