2 * testapi.c: libxml2 API tester program.
4 * Automatically generated by gentest.py from libxml2-api.xml
6 * See Copyright for the status of this software.
14 #include <stdlib.h> /* for putenv() */
16 #include <libxml/xmlerror.h>
17 #include <libxml/relaxng.h>
20 static int testlibxml2(void);
21 static int test_module(const char *module);
23 static int generic_errors = 0;
24 static int call_tests = 0;
25 static int function_tests = 0;
27 static xmlChar chartab[1024];
28 static int inttab[1024];
29 static unsigned long longtab[1024];
31 static xmlDocPtr api_doc = NULL;
32 static xmlDtdPtr api_dtd = NULL;
33 static xmlNodePtr api_root = NULL;
34 static xmlAttrPtr api_attr = NULL;
35 static xmlNsPtr api_ns = NULL;
38 structured_errors(void *userData ATTRIBUTE_UNUSED,
39 xmlErrorPtr error ATTRIBUTE_UNUSED) {
55 if (api_doc == NULL) {
56 api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
65 if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
67 if ((api_doc != NULL) && (api_doc->children != NULL) &&
68 (api_doc->children->type == XML_DTD_NODE))
69 api_dtd = (xmlDtdPtr) api_doc->children;
76 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
78 if ((api_doc != NULL) && (api_doc->children != NULL) &&
79 (api_doc->children->next != NULL) &&
80 (api_doc->children->next->type == XML_ELEMENT_NODE))
81 api_root = api_doc->children->next;
90 api_ns = api_root->nsDef;
96 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
101 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
104 if (api_root == NULL)
106 if (api_root->properties != NULL) {
107 api_attr = api_root->properties;
108 return(api_root->properties);
111 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
112 snprintf((char *) name, 20, "foo%d", nr++);
113 api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
118 static int quiet = 0;
120 int main(int argc, char **argv) {
125 /* access to the proxy can slow up regression tests a lot */
126 putenv((char *) "http_proxy=");
129 memset(chartab, 0, sizeof(chartab));
130 strncpy((char *) chartab, " chartab\n", 20);
131 memset(inttab, 0, sizeof(inttab));
132 memset(longtab, 0, sizeof(longtab));
135 #ifdef LIBXML_SCHEMAS_ENABLED
136 xmlRelaxNGInitTypes();
141 xmlSetStructuredErrorFunc(NULL, structured_errors);
144 if (!strcmp(argv[1], "-q")) {
147 ret = test_module(argv[2]);
151 ret = test_module(argv[1]);
157 blocks = xmlMemBlocks();
159 if ((blocks != 0) || (mem != 0)) {
160 printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
167 #include <libxml/HTMLparser.h>
168 #include <libxml/HTMLtree.h>
169 #include <libxml/catalog.h>
170 #include <libxml/chvalid.h>
171 #include <libxml/dict.h>
172 #include <libxml/encoding.h>
173 #include <libxml/entities.h>
174 #include <libxml/hash.h>
175 #include <libxml/list.h>
176 #include <libxml/nanoftp.h>
177 #include <libxml/nanohttp.h>
178 #include <libxml/parser.h>
179 #include <libxml/parserInternals.h>
180 #include <libxml/pattern.h>
181 #include <libxml/relaxng.h>
182 #include <libxml/schemasInternals.h>
183 #include <libxml/schematron.h>
184 #include <libxml/tree.h>
185 #include <libxml/uri.h>
186 #include <libxml/valid.h>
187 #include <libxml/xinclude.h>
188 #include <libxml/xmlIO.h>
189 #include <libxml/xmlerror.h>
190 #include <libxml/xmlreader.h>
191 #include <libxml/xmlsave.h>
192 #include <libxml/xmlschemas.h>
193 #include <libxml/xmlschemastypes.h>
194 #include <libxml/xmlstring.h>
195 #include <libxml/xmlwriter.h>
196 #include <libxml/xpath.h>
197 #include <libxml/xpointer.h>
198 #include <libxml/debugXML.h>
201 We manually define xmlErrMemory because it's normal declaration
202 is "hidden" by #ifdef IN_LIBXML
204 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
207 We need some "remote" addresses, but want to avoid getting into
208 name resolution delays, so we use these
210 #define REMOTE1GOOD "http://localhost/"
211 #define REMOTE1BAD "http:http://http"
212 #define REMOTE2GOOD "ftp://localhost/foo"
214 #define gen_nb_void_ptr 2
216 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
219 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
223 #define gen_nb_const_void_ptr 2
225 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
226 if (no == 0) return((const void *) "immutable string");
229 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
233 #define gen_nb_userdata 3
235 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
236 if (no == 0) return((void *) &call_tests);
237 if (no == 1) return((void *) -1);
240 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
246 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
247 if (no == 0) return(0);
248 if (no == 1) return(1);
249 if (no == 2) return(-1);
250 if (no == 3) return(122);
254 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
257 #define gen_nb_parseroptions 5
259 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
260 if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
261 if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
262 if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
263 if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
264 return(XML_PARSE_SAX1);
267 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
271 #define gen_nb_long 5
273 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
274 if (no == 0) return(0);
275 if (no == 1) return(1);
276 if (no == 2) return(-1);
277 if (no == 3) return(122);
281 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
285 #define gen_nb_xmlChar 4
287 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
288 if (no == 0) return('a');
289 if (no == 1) return(' ');
290 if (no == 2) return((xmlChar) '\xf8');
294 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
297 #define gen_nb_unsigned_int 3
299 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
300 if (no == 0) return(0);
301 if (no == 1) return(1);
302 if (no == 2) return(122);
303 return((unsigned int) -1);
306 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
309 #define gen_nb_unsigned_long 4
311 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
312 if (no == 0) return(0);
313 if (no == 1) return(1);
314 if (no == 2) return(122);
315 return((unsigned long) -1);
318 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
321 #define gen_nb_double 4
323 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
324 if (no == 0) return(0);
325 if (no == 1) return(-1.1);
326 #if defined(LIBXML_XPATH_ENABLED)
327 if (no == 2) return(xmlXPathNAN);
332 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
335 #define gen_nb_unsigned_long_ptr 2
337 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
338 if (no == 0) return(&longtab[nr]);
342 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
345 #define gen_nb_int_ptr 2
347 static int *gen_int_ptr(int no, int nr) {
348 if (no == 0) return(&inttab[nr]);
352 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
355 #define gen_nb_const_char_ptr 4
357 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
358 if (no == 0) return((char *) "foo");
359 if (no == 1) return((char *) "<foo/>");
360 if (no == 2) return((char *) "test/ent2");
363 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
366 #define gen_nb_xmlChar_ptr 2
368 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369 if (no == 0) return(&chartab[0]);
372 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
375 #define gen_nb_FILE_ptr 2
377 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378 if (no == 0) return(fopen("test.out", "a+"));
381 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
382 if (val != NULL) fclose(val);
385 #define gen_nb_debug_FILE_ptr 2
386 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
387 return(fopen("test.out", "a+"));
389 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
390 if (val != NULL) fclose(val);
393 #define gen_nb_const_xmlChar_ptr 5
395 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
396 if (no == 0) return((xmlChar *) "foo");
397 if (no == 1) return((xmlChar *) "<foo/>");
398 if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
399 if (no == 3) return((xmlChar *) " 2ab ");
402 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
405 #define gen_nb_filepath 8
407 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
408 if (no == 0) return("missing.xml");
409 if (no == 1) return("<foo/>");
410 if (no == 2) return("test/ent2");
411 if (no == 3) return("test/valid/REC-xml-19980210.xml");
412 if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
413 if (no == 5) return(REMOTE1GOOD);
414 if (no == 6) return(REMOTE1BAD);
417 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
420 #define gen_nb_eaten_name 2
422 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
423 if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
426 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
429 #define gen_nb_fileoutput 6
431 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
432 if (no == 0) return("/missing.xml");
433 if (no == 1) return("<foo/>");
434 if (no == 2) return(REMOTE2GOOD);
435 if (no == 3) return(REMOTE1GOOD);
436 if (no == 4) return(REMOTE1BAD);
439 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
442 #define gen_nb_xmlParserCtxtPtr 3
443 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
444 if (no == 0) return(xmlNewParserCtxt());
445 if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
448 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
450 xmlFreeParserCtxt(val);
453 #define gen_nb_xmlSAXHandlerPtr 2
454 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
455 #ifdef LIBXML_SAX1_ENABLED
456 if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
460 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
463 #define gen_nb_xmlValidCtxtPtr 2
464 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
465 #ifdef LIBXML_VALID_ENABLED
466 if (no == 0) return(xmlNewValidCtxt());
470 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
471 #ifdef LIBXML_VALID_ENABLED
473 xmlFreeValidCtxt(val);
477 #define gen_nb_xmlParserInputBufferPtr 8
479 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
480 if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
481 if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
482 if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
483 if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
484 if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
485 if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
486 if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
489 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
490 xmlFreeParserInputBuffer(val);
493 #define gen_nb_xmlDocPtr 4
494 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
495 if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
496 if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
497 if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
500 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
501 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
505 #define gen_nb_xmlAttrPtr 2
506 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
507 if (no == 0) return(get_api_attr());
510 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
511 if (no == 0) free_api_doc();
514 #define gen_nb_xmlDictPtr 2
515 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
516 if (no == 0) return(xmlDictCreate());
519 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
524 #define gen_nb_xmlNodePtr 3
525 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
526 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
527 if (no == 1) return(get_api_root());
529 /* if (no == 2) return((xmlNodePtr) get_api_doc()); */
531 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
534 } else if (val != NULL) {
540 #define gen_nb_xmlDtdPtr 3
541 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
543 return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
544 if (no == 1) return(get_api_dtd());
547 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
548 if (no == 1) free_api_doc();
549 else if (val != NULL) {
550 xmlUnlinkNode((xmlNodePtr) val);
551 xmlFreeNode((xmlNodePtr) val);
555 #define gen_nb_xmlNsPtr 2
556 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
557 if (no == 0) return(get_api_ns());
560 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
561 if (no == 0) free_api_doc();
564 #define gen_nb_xmlNodePtr_in 3
565 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
566 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
567 if (no == 0) return(xmlNewText(BAD_CAST "text"));
570 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
573 #ifdef LIBXML_WRITER_ENABLED
574 #define gen_nb_xmlTextWriterPtr 2
575 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
576 if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
579 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
580 if (val != NULL) xmlFreeTextWriter(val);
584 #ifdef LIBXML_READER_ENABLED
585 #define gen_nb_xmlTextReaderPtr 4
586 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
587 if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
588 if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
589 if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
592 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
593 if (val != NULL) xmlFreeTextReader(val);
597 #define gen_nb_xmlBufferPtr 3
598 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
599 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
600 if (no == 0) return(xmlBufferCreate());
601 if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
604 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
610 #define gen_nb_xmlListPtr 2
611 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
612 if (no == 0) return(xmlListCreate(NULL, NULL));
615 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
621 #define gen_nb_xmlHashTablePtr 2
622 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
623 if (no == 0) return(xmlHashCreate(10));
626 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
628 xmlHashFree(val, NULL);
632 #include <libxml/xpathInternals.h>
634 #ifdef LIBXML_XPATH_ENABLED
635 #define gen_nb_xmlXPathObjectPtr 5
636 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
637 if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
638 if (no == 1) return(xmlXPathNewFloat(1.1));
639 if (no == 2) return(xmlXPathNewBoolean(1));
640 if (no == 3) return(xmlXPathNewNodeSet(NULL));
643 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
645 xmlXPathFreeObject(val);
650 #ifdef LIBXML_OUTPUT_ENABLED
651 #define gen_nb_xmlOutputBufferPtr 2
652 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
653 if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
656 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
658 xmlOutputBufferClose(val);
663 #ifdef LIBXML_FTP_ENABLED
664 #define gen_nb_xmlNanoFTPCtxtPtr 4
665 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
666 if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
667 if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
668 if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
671 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
673 xmlNanoFTPFreeCtxt(val);
678 #ifdef LIBXML_HTTP_ENABLED
679 #define gen_nb_xmlNanoHTTPCtxtPtr 1
680 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
681 if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
682 if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
683 if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
686 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
688 xmlNanoHTTPClose(val);
693 #define gen_nb_xmlCharEncoding 4
694 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
695 if (no == 0) return(XML_CHAR_ENCODING_UTF8);
696 if (no == 1) return(XML_CHAR_ENCODING_NONE);
697 if (no == 2) return(XML_CHAR_ENCODING_8859_1);
698 return(XML_CHAR_ENCODING_ERROR);
700 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
703 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
705 #define gen_nb_xmlExpCtxtPtr 1
706 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
709 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
712 #define gen_nb_xmlExpNodePtr 1
713 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
716 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
721 #if defined(LIBXML_SCHEMAS_ENABLED)
722 #define gen_nb_xmlSchemaPtr 1
723 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
726 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
729 #define gen_nb_xmlSchemaValidCtxtPtr 1
730 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
733 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
736 #endif /* LIBXML_SCHEMAS_ENABLED */
738 #define gen_nb_xmlHashDeallocator 2
740 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
743 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
744 if (no == 0) return(test_xmlHashDeallocator);
747 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
751 static void desret_int(int val ATTRIBUTE_UNUSED) {
753 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
755 static void desret_long(long val ATTRIBUTE_UNUSED) {
757 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
759 static void desret_double(double val ATTRIBUTE_UNUSED) {
761 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
764 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
767 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
769 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
771 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
773 static void desret_xmlChar_ptr(xmlChar *val) {
777 static void desret_xmlDocPtr(xmlDocPtr val) {
781 static void desret_xmlDictPtr(xmlDictPtr val) {
784 #ifdef LIBXML_OUTPUT_ENABLED
785 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
786 xmlOutputBufferClose(val);
789 #ifdef LIBXML_READER_ENABLED
790 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
791 xmlFreeTextReader(val);
794 static void desret_xmlNodePtr(xmlNodePtr val) {
795 if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
800 static void desret_xmlAttrPtr(xmlAttrPtr val) {
802 xmlUnlinkNode((xmlNodePtr) val);
803 xmlFreeNode((xmlNodePtr) val);
806 static void desret_xmlEntityPtr(xmlEntityPtr val) {
808 xmlUnlinkNode((xmlNodePtr) val);
809 xmlFreeNode((xmlNodePtr) val);
812 static void desret_xmlElementPtr(xmlElementPtr val) {
814 xmlUnlinkNode((xmlNodePtr) val);
817 static void desret_xmlAttributePtr(xmlAttributePtr val) {
819 xmlUnlinkNode((xmlNodePtr) val);
822 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
824 static void desret_xmlDtdPtr(xmlDtdPtr val) {
825 desret_xmlNodePtr((xmlNodePtr)val);
827 #ifdef LIBXML_XPATH_ENABLED
828 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
829 xmlXPathFreeObject(val);
831 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
832 xmlXPathFreeNodeSet(val);
835 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
836 xmlFreeParserCtxt(val);
838 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
839 xmlFreeParserInputBuffer(val);
841 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
842 xmlFreeInputStream(val);
844 #ifdef LIBXML_WRITER_ENABLED
845 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
846 xmlFreeTextWriter(val);
849 static void desret_xmlBufferPtr(xmlBufferPtr val) {
852 #ifdef LIBXML_SCHEMAS_ENABLED
853 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
854 xmlSchemaFreeParserCtxt(val);
856 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
858 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
859 xmlRelaxNGFreeParserCtxt(val);
862 #ifdef LIBXML_HTML_ENABLED
863 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
866 #ifdef LIBXML_HTTP_ENABLED
867 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
868 xmlNanoHTTPClose(val);
871 #ifdef LIBXML_FTP_ENABLED
872 static void desret_xmlNanoFTPCtxtPtr(void *val) {
873 xmlNanoFTPClose(val);
876 /* cut and pasted from autogenerated to avoid troubles */
877 #define gen_nb_const_xmlChar_ptr_ptr 1
878 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
881 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
884 #define gen_nb_unsigned_char_ptr 1
885 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
888 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
891 #define gen_nb_const_unsigned_char_ptr 1
892 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
895 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
898 #ifdef LIBXML_HTML_ENABLED
899 #define gen_nb_const_htmlNodePtr 1
900 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
903 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
907 #ifdef LIBXML_HTML_ENABLED
908 #define gen_nb_htmlDocPtr 3
909 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
910 if (no == 0) return(htmlNewDoc(NULL, NULL));
911 if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
914 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
915 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
918 static void desret_htmlDocPtr(htmlDocPtr val) {
919 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
922 #define gen_nb_htmlParserCtxtPtr 3
923 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
924 if (no == 0) return(xmlNewParserCtxt());
925 if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
928 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
930 htmlFreeParserCtxt(val);
932 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
934 htmlFreeParserCtxt(val);
938 #ifdef LIBXML_XPATH_ENABLED
939 #define gen_nb_xmlNodeSetPtr 1
940 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
943 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
947 #ifdef LIBXML_DEBUG_ENABLED
948 #ifdef LIBXML_XPATH_ENABLED
949 #define gen_nb_xmlShellCtxtPtr 1
950 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
953 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
958 #ifdef LIBXML_PATTERN_ENABLED
959 #define gen_nb_xmlPatternPtr 1
960 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
963 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
967 #define gen_nb_xmlElementContentPtr 1
968 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
971 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
973 xmlFreeElementContent(val);
975 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
977 xmlFreeElementContent(val);
980 #define gen_nb_xmlParserNodeInfoSeqPtr 1
981 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
984 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
987 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
990 #define gen_nb_void_ptr_ptr 1
991 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
994 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
997 /************************************************************************
999 * WARNING: end of the manually maintained part of the test code *
1000 * do not remove or alter the CUT HERE line *
1002 ************************************************************************/
1004 /* CUT HERE: everything below that line is generated */
1005 #ifdef LIBXML_HTML_ENABLED
1006 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1011 #define gen_nb_xmlAttributeDefault 4
1012 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1013 if (no == 1) return(XML_ATTRIBUTE_FIXED);
1014 if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1015 if (no == 3) return(XML_ATTRIBUTE_NONE);
1016 if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1020 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1023 #define gen_nb_xmlAttributeType 4
1024 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1025 if (no == 1) return(XML_ATTRIBUTE_CDATA);
1026 if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1027 if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1028 if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1032 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1035 #define gen_nb_xmlBufferAllocationScheme 4
1036 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1037 if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1038 if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1039 if (no == 3) return(XML_BUFFER_ALLOC_HYBRID);
1040 if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE);
1044 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1047 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1050 #ifdef LIBXML_CATALOG_ENABLED
1051 #define gen_nb_xmlCatalogAllow 4
1052 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1053 if (no == 1) return(XML_CATA_ALLOW_ALL);
1054 if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1055 if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1056 if (no == 4) return(XML_CATA_ALLOW_NONE);
1060 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1063 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1068 #ifdef LIBXML_CATALOG_ENABLED
1069 #define gen_nb_xmlCatalogPrefer 3
1070 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1071 if (no == 1) return(XML_CATA_PREFER_NONE);
1072 if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1073 if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1077 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1080 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1085 #define gen_nb_xmlElementContentType 4
1086 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1087 if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1088 if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1089 if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1090 if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1094 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1097 #define gen_nb_xmlElementTypeVal 4
1098 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1099 if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1100 if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1101 if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1102 if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1106 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1109 #define gen_nb_xmlFeature 4
1110 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1111 if (no == 1) return(XML_WITH_AUTOMATA);
1112 if (no == 2) return(XML_WITH_C14N);
1113 if (no == 3) return(XML_WITH_CATALOG);
1114 if (no == 4) return(XML_WITH_DEBUG);
1118 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1121 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1124 #ifdef LIBXML_SCHEMAS_ENABLED
1125 #define gen_nb_xmlSchemaValType 4
1126 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1127 if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1128 if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1129 if (no == 3) return(XML_SCHEMAS_ANYURI);
1130 if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1134 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1137 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1142 #ifdef LIBXML_SCHEMAS_ENABLED
1143 #define gen_nb_xmlSchemaWhitespaceValueType 4
1144 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1145 if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1146 if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1147 if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1148 if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1152 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1157 #include <libxml/HTMLparser.h>
1158 #include <libxml/HTMLtree.h>
1159 #include <libxml/SAX2.h>
1160 #include <libxml/c14n.h>
1161 #include <libxml/catalog.h>
1162 #include <libxml/chvalid.h>
1163 #include <libxml/debugXML.h>
1164 #include <libxml/dict.h>
1165 #include <libxml/encoding.h>
1166 #include <libxml/entities.h>
1167 #include <libxml/hash.h>
1168 #include <libxml/list.h>
1169 #include <libxml/nanoftp.h>
1170 #include <libxml/nanohttp.h>
1171 #include <libxml/parser.h>
1172 #include <libxml/parserInternals.h>
1173 #include <libxml/pattern.h>
1174 #include <libxml/relaxng.h>
1175 #include <libxml/schemasInternals.h>
1176 #include <libxml/schematron.h>
1177 #include <libxml/tree.h>
1178 #include <libxml/uri.h>
1179 #include <libxml/valid.h>
1180 #include <libxml/xinclude.h>
1181 #include <libxml/xmlIO.h>
1182 #include <libxml/xmlautomata.h>
1183 #include <libxml/xmlerror.h>
1184 #include <libxml/xmlmodule.h>
1185 #include <libxml/xmlreader.h>
1186 #include <libxml/xmlregexp.h>
1187 #include <libxml/xmlsave.h>
1188 #include <libxml/xmlschemas.h>
1189 #include <libxml/xmlschemastypes.h>
1190 #include <libxml/xmlstring.h>
1191 #include <libxml/xmlunicode.h>
1192 #include <libxml/xmlwriter.h>
1193 #include <libxml/xpath.h>
1194 #include <libxml/xpathInternals.h>
1195 #include <libxml/xpointer.h>
1196 static int test_HTMLparser(void);
1197 static int test_HTMLtree(void);
1198 static int test_SAX2(void);
1199 static int test_c14n(void);
1200 static int test_catalog(void);
1201 static int test_chvalid(void);
1202 static int test_debugXML(void);
1203 static int test_dict(void);
1204 static int test_encoding(void);
1205 static int test_entities(void);
1206 static int test_hash(void);
1207 static int test_list(void);
1208 static int test_nanoftp(void);
1209 static int test_nanohttp(void);
1210 static int test_parser(void);
1211 static int test_parserInternals(void);
1212 static int test_pattern(void);
1213 static int test_relaxng(void);
1214 static int test_schemasInternals(void);
1215 static int test_schematron(void);
1216 static int test_tree(void);
1217 static int test_uri(void);
1218 static int test_valid(void);
1219 static int test_xinclude(void);
1220 static int test_xmlIO(void);
1221 static int test_xmlautomata(void);
1222 static int test_xmlerror(void);
1223 static int test_xmlmodule(void);
1224 static int test_xmlreader(void);
1225 static int test_xmlregexp(void);
1226 static int test_xmlsave(void);
1227 static int test_xmlschemas(void);
1228 static int test_xmlschemastypes(void);
1229 static int test_xmlstring(void);
1230 static int test_xmlunicode(void);
1231 static int test_xmlwriter(void);
1232 static int test_xpath(void);
1233 static int test_xpathInternals(void);
1234 static int test_xpointer(void);
1239 * Main entry point of the tester for the full libxml2 module,
1240 * it calls all the tester entry point for each module.
1242 * Returns the number of error found
1249 test_ret += test_HTMLparser();
1250 test_ret += test_HTMLtree();
1251 test_ret += test_SAX2();
1252 test_ret += test_c14n();
1253 test_ret += test_catalog();
1254 test_ret += test_chvalid();
1255 test_ret += test_debugXML();
1256 test_ret += test_dict();
1257 test_ret += test_encoding();
1258 test_ret += test_entities();
1259 test_ret += test_hash();
1260 test_ret += test_list();
1261 test_ret += test_nanoftp();
1262 test_ret += test_nanohttp();
1263 test_ret += test_parser();
1264 test_ret += test_parserInternals();
1265 test_ret += test_pattern();
1266 test_ret += test_relaxng();
1267 test_ret += test_schemasInternals();
1268 test_ret += test_schematron();
1269 test_ret += test_tree();
1270 test_ret += test_uri();
1271 test_ret += test_valid();
1272 test_ret += test_xinclude();
1273 test_ret += test_xmlIO();
1274 test_ret += test_xmlautomata();
1275 test_ret += test_xmlerror();
1276 test_ret += test_xmlmodule();
1277 test_ret += test_xmlreader();
1278 test_ret += test_xmlregexp();
1279 test_ret += test_xmlsave();
1280 test_ret += test_xmlschemas();
1281 test_ret += test_xmlschemastypes();
1282 test_ret += test_xmlstring();
1283 test_ret += test_xmlunicode();
1284 test_ret += test_xmlwriter();
1285 test_ret += test_xpath();
1286 test_ret += test_xpathInternals();
1287 test_ret += test_xpointer();
1289 printf("Total: %d functions, %d tests, %d errors\n",
1290 function_tests, call_tests, test_ret);
1296 test_UTF8ToHtml(void) {
1299 #if defined(LIBXML_HTML_ENABLED)
1302 unsigned char * out; /* a pointer to an array of bytes to store the result */
1304 int * outlen; /* the length of @out */
1306 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1308 int * inlen; /* the length of @in */
1311 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1312 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1313 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1314 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1315 mem_base = xmlMemBlocks();
1316 out = gen_unsigned_char_ptr(n_out, 0);
1317 outlen = gen_int_ptr(n_outlen, 1);
1318 in = gen_const_unsigned_char_ptr(n_in, 2);
1319 inlen = gen_int_ptr(n_inlen, 3);
1321 ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1322 desret_int(ret_val);
1324 des_unsigned_char_ptr(n_out, out, 0);
1325 des_int_ptr(n_outlen, outlen, 1);
1326 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1327 des_int_ptr(n_inlen, inlen, 3);
1328 xmlResetLastError();
1329 if (mem_base != xmlMemBlocks()) {
1330 printf("Leak of %d blocks found in UTF8ToHtml",
1331 xmlMemBlocks() - mem_base);
1333 printf(" %d", n_out);
1334 printf(" %d", n_outlen);
1335 printf(" %d", n_in);
1336 printf(" %d", n_inlen);
1349 #ifdef LIBXML_HTML_ENABLED
1351 #define gen_nb_const_htmlElemDesc_ptr 1
1352 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1355 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1361 test_htmlAttrAllowed(void) {
1364 #if defined(LIBXML_HTML_ENABLED)
1367 htmlElemDesc * elt; /* HTML element */
1369 xmlChar * attr; /* HTML attribute */
1371 int legacy; /* whether to allow deprecated attributes */
1374 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1375 for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1376 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1377 mem_base = xmlMemBlocks();
1378 elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1379 attr = gen_const_xmlChar_ptr(n_attr, 1);
1380 legacy = gen_int(n_legacy, 2);
1382 ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1383 desret_htmlStatus(ret_val);
1385 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1386 des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1387 des_int(n_legacy, legacy, 2);
1388 xmlResetLastError();
1389 if (mem_base != xmlMemBlocks()) {
1390 printf("Leak of %d blocks found in htmlAttrAllowed",
1391 xmlMemBlocks() - mem_base);
1393 printf(" %d", n_elt);
1394 printf(" %d", n_attr);
1395 printf(" %d", n_legacy);
1407 #ifdef LIBXML_HTML_ENABLED
1409 #define gen_nb_htmlNodePtr 1
1410 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1413 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1419 test_htmlAutoCloseTag(void) {
1422 #if defined(LIBXML_HTML_ENABLED)
1425 htmlDocPtr doc; /* the HTML document */
1427 xmlChar * name; /* The tag name */
1429 htmlNodePtr elem; /* the HTML element */
1432 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1433 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1434 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1435 mem_base = xmlMemBlocks();
1436 doc = gen_htmlDocPtr(n_doc, 0);
1437 name = gen_const_xmlChar_ptr(n_name, 1);
1438 elem = gen_htmlNodePtr(n_elem, 2);
1440 ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1441 desret_int(ret_val);
1443 des_htmlDocPtr(n_doc, doc, 0);
1444 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1445 des_htmlNodePtr(n_elem, elem, 2);
1446 xmlResetLastError();
1447 if (mem_base != xmlMemBlocks()) {
1448 printf("Leak of %d blocks found in htmlAutoCloseTag",
1449 xmlMemBlocks() - mem_base);
1451 printf(" %d", n_doc);
1452 printf(" %d", n_name);
1453 printf(" %d", n_elem);
1467 test_htmlCreateMemoryParserCtxt(void) {
1470 #if defined(LIBXML_HTML_ENABLED)
1472 htmlParserCtxtPtr ret_val;
1473 char * buffer; /* a pointer to a char array */
1475 int size; /* the size of the array */
1478 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1479 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1480 mem_base = xmlMemBlocks();
1481 buffer = gen_const_char_ptr(n_buffer, 0);
1482 size = gen_int(n_size, 1);
1484 ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1485 desret_htmlParserCtxtPtr(ret_val);
1487 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1488 des_int(n_size, size, 1);
1489 xmlResetLastError();
1490 if (mem_base != xmlMemBlocks()) {
1491 printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1492 xmlMemBlocks() - mem_base);
1494 printf(" %d", n_buffer);
1495 printf(" %d", n_size);
1506 #ifdef LIBXML_HTML_ENABLED
1508 #define gen_nb_htmlSAXHandlerPtr 1
1509 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1512 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1518 test_htmlCreatePushParserCtxt(void) {
1521 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1523 htmlParserCtxtPtr ret_val;
1524 htmlSAXHandlerPtr sax; /* a SAX handler */
1526 void * user_data; /* The user data returned on SAX callbacks */
1528 char * chunk; /* a pointer to an array of chars */
1530 int size; /* number of chars in the array */
1532 const char * filename; /* an optional file name or URI */
1534 xmlCharEncoding enc; /* an optional encoding */
1537 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1538 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1539 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1540 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1541 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1542 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1543 mem_base = xmlMemBlocks();
1544 sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1545 user_data = gen_userdata(n_user_data, 1);
1546 chunk = gen_const_char_ptr(n_chunk, 2);
1547 size = gen_int(n_size, 3);
1548 filename = gen_fileoutput(n_filename, 4);
1549 enc = gen_xmlCharEncoding(n_enc, 5);
1551 ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1552 desret_htmlParserCtxtPtr(ret_val);
1554 des_htmlSAXHandlerPtr(n_sax, sax, 0);
1555 des_userdata(n_user_data, user_data, 1);
1556 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1557 des_int(n_size, size, 3);
1558 des_fileoutput(n_filename, filename, 4);
1559 des_xmlCharEncoding(n_enc, enc, 5);
1560 xmlResetLastError();
1561 if (mem_base != xmlMemBlocks()) {
1562 printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1563 xmlMemBlocks() - mem_base);
1565 printf(" %d", n_sax);
1566 printf(" %d", n_user_data);
1567 printf(" %d", n_chunk);
1568 printf(" %d", n_size);
1569 printf(" %d", n_filename);
1570 printf(" %d", n_enc);
1587 test_htmlCtxtReadDoc(void) {
1590 #if defined(LIBXML_HTML_ENABLED)
1593 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1595 xmlChar * cur; /* a pointer to a zero terminated string */
1597 const char * URL; /* the base URL to use for the document */
1599 char * encoding; /* the document encoding, or NULL */
1601 int options; /* a combination of htmlParserOption(s) */
1604 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1605 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1606 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1607 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1608 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1609 mem_base = xmlMemBlocks();
1610 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1611 cur = gen_const_xmlChar_ptr(n_cur, 1);
1612 URL = gen_filepath(n_URL, 2);
1613 encoding = gen_const_char_ptr(n_encoding, 3);
1614 options = gen_int(n_options, 4);
1616 ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1617 desret_htmlDocPtr(ret_val);
1619 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1620 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1621 des_filepath(n_URL, URL, 2);
1622 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1623 des_int(n_options, options, 4);
1624 xmlResetLastError();
1625 if (mem_base != xmlMemBlocks()) {
1626 printf("Leak of %d blocks found in htmlCtxtReadDoc",
1627 xmlMemBlocks() - mem_base);
1629 printf(" %d", n_ctxt);
1630 printf(" %d", n_cur);
1631 printf(" %d", n_URL);
1632 printf(" %d", n_encoding);
1633 printf(" %d", n_options);
1649 test_htmlCtxtReadFile(void) {
1652 #if defined(LIBXML_HTML_ENABLED)
1654 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1656 const char * filename; /* a file or URL */
1658 char * encoding; /* the document encoding, or NULL */
1660 int options; /* a combination of htmlParserOption(s) */
1663 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1664 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1665 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1666 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1667 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1668 filename = gen_filepath(n_filename, 1);
1669 encoding = gen_const_char_ptr(n_encoding, 2);
1670 options = gen_int(n_options, 3);
1672 ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1673 desret_htmlDocPtr(ret_val);
1675 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1676 des_filepath(n_filename, filename, 1);
1677 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1678 des_int(n_options, options, 3);
1679 xmlResetLastError();
1692 test_htmlCtxtReadMemory(void) {
1695 #if defined(LIBXML_HTML_ENABLED)
1698 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1700 char * buffer; /* a pointer to a char array */
1702 int size; /* the size of the array */
1704 const char * URL; /* the base URL to use for the document */
1706 char * encoding; /* the document encoding, or NULL */
1708 int options; /* a combination of htmlParserOption(s) */
1711 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1712 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1713 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1714 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1715 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1716 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1717 mem_base = xmlMemBlocks();
1718 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1719 buffer = gen_const_char_ptr(n_buffer, 1);
1720 size = gen_int(n_size, 2);
1721 URL = gen_filepath(n_URL, 3);
1722 encoding = gen_const_char_ptr(n_encoding, 4);
1723 options = gen_int(n_options, 5);
1725 ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1726 desret_htmlDocPtr(ret_val);
1728 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1729 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1730 des_int(n_size, size, 2);
1731 des_filepath(n_URL, URL, 3);
1732 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1733 des_int(n_options, options, 5);
1734 xmlResetLastError();
1735 if (mem_base != xmlMemBlocks()) {
1736 printf("Leak of %d blocks found in htmlCtxtReadMemory",
1737 xmlMemBlocks() - mem_base);
1739 printf(" %d", n_ctxt);
1740 printf(" %d", n_buffer);
1741 printf(" %d", n_size);
1742 printf(" %d", n_URL);
1743 printf(" %d", n_encoding);
1744 printf(" %d", n_options);
1761 test_htmlCtxtReset(void) {
1764 #if defined(LIBXML_HTML_ENABLED)
1766 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1769 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1770 mem_base = xmlMemBlocks();
1771 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1773 htmlCtxtReset(ctxt);
1775 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1776 xmlResetLastError();
1777 if (mem_base != xmlMemBlocks()) {
1778 printf("Leak of %d blocks found in htmlCtxtReset",
1779 xmlMemBlocks() - mem_base);
1781 printf(" %d", n_ctxt);
1793 test_htmlCtxtUseOptions(void) {
1796 #if defined(LIBXML_HTML_ENABLED)
1799 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1801 int options; /* a combination of htmlParserOption(s) */
1804 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1805 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1806 mem_base = xmlMemBlocks();
1807 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1808 options = gen_int(n_options, 1);
1810 ret_val = htmlCtxtUseOptions(ctxt, options);
1811 desret_int(ret_val);
1813 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1814 des_int(n_options, options, 1);
1815 xmlResetLastError();
1816 if (mem_base != xmlMemBlocks()) {
1817 printf("Leak of %d blocks found in htmlCtxtUseOptions",
1818 xmlMemBlocks() - mem_base);
1820 printf(" %d", n_ctxt);
1821 printf(" %d", n_options);
1834 test_htmlElementAllowedHere(void) {
1837 #if defined(LIBXML_HTML_ENABLED)
1840 htmlElemDesc * parent; /* HTML parent element */
1842 xmlChar * elt; /* HTML element */
1845 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1846 for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1847 mem_base = xmlMemBlocks();
1848 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1849 elt = gen_const_xmlChar_ptr(n_elt, 1);
1851 ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1852 desret_int(ret_val);
1854 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1855 des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1856 xmlResetLastError();
1857 if (mem_base != xmlMemBlocks()) {
1858 printf("Leak of %d blocks found in htmlElementAllowedHere",
1859 xmlMemBlocks() - mem_base);
1861 printf(" %d", n_parent);
1862 printf(" %d", n_elt);
1875 test_htmlElementStatusHere(void) {
1878 #if defined(LIBXML_HTML_ENABLED)
1881 htmlElemDesc * parent; /* HTML parent element */
1883 htmlElemDesc * elt; /* HTML element */
1886 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1887 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1888 mem_base = xmlMemBlocks();
1889 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1890 elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1892 ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1893 desret_htmlStatus(ret_val);
1895 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1896 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1897 xmlResetLastError();
1898 if (mem_base != xmlMemBlocks()) {
1899 printf("Leak of %d blocks found in htmlElementStatusHere",
1900 xmlMemBlocks() - mem_base);
1902 printf(" %d", n_parent);
1903 printf(" %d", n_elt);
1916 test_htmlEncodeEntities(void) {
1919 #if defined(LIBXML_HTML_ENABLED)
1922 unsigned char * out; /* a pointer to an array of bytes to store the result */
1924 int * outlen; /* the length of @out */
1926 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1928 int * inlen; /* the length of @in */
1930 int quoteChar; /* the quote character to escape (' or ") or zero. */
1933 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1934 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1935 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1936 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1937 for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1938 mem_base = xmlMemBlocks();
1939 out = gen_unsigned_char_ptr(n_out, 0);
1940 outlen = gen_int_ptr(n_outlen, 1);
1941 in = gen_const_unsigned_char_ptr(n_in, 2);
1942 inlen = gen_int_ptr(n_inlen, 3);
1943 quoteChar = gen_int(n_quoteChar, 4);
1945 ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1946 desret_int(ret_val);
1948 des_unsigned_char_ptr(n_out, out, 0);
1949 des_int_ptr(n_outlen, outlen, 1);
1950 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1951 des_int_ptr(n_inlen, inlen, 3);
1952 des_int(n_quoteChar, quoteChar, 4);
1953 xmlResetLastError();
1954 if (mem_base != xmlMemBlocks()) {
1955 printf("Leak of %d blocks found in htmlEncodeEntities",
1956 xmlMemBlocks() - mem_base);
1958 printf(" %d", n_out);
1959 printf(" %d", n_outlen);
1960 printf(" %d", n_in);
1961 printf(" %d", n_inlen);
1962 printf(" %d", n_quoteChar);
1978 test_htmlEntityLookup(void) {
1981 #if defined(LIBXML_HTML_ENABLED)
1983 const htmlEntityDesc * ret_val;
1984 xmlChar * name; /* the entity name */
1987 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1988 mem_base = xmlMemBlocks();
1989 name = gen_const_xmlChar_ptr(n_name, 0);
1991 ret_val = htmlEntityLookup((const xmlChar *)name);
1992 desret_const_htmlEntityDesc_ptr(ret_val);
1994 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1995 xmlResetLastError();
1996 if (mem_base != xmlMemBlocks()) {
1997 printf("Leak of %d blocks found in htmlEntityLookup",
1998 xmlMemBlocks() - mem_base);
2000 printf(" %d", n_name);
2012 test_htmlEntityValueLookup(void) {
2015 #if defined(LIBXML_HTML_ENABLED)
2017 const htmlEntityDesc * ret_val;
2018 unsigned int value; /* the entity's unicode value */
2021 for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2022 mem_base = xmlMemBlocks();
2023 value = gen_unsigned_int(n_value, 0);
2025 ret_val = htmlEntityValueLookup(value);
2026 desret_const_htmlEntityDesc_ptr(ret_val);
2028 des_unsigned_int(n_value, value, 0);
2029 xmlResetLastError();
2030 if (mem_base != xmlMemBlocks()) {
2031 printf("Leak of %d blocks found in htmlEntityValueLookup",
2032 xmlMemBlocks() - mem_base);
2034 printf(" %d", n_value);
2046 test_htmlHandleOmittedElem(void) {
2049 #if defined(LIBXML_HTML_ENABLED)
2052 int val; /* int 0 or 1 */
2055 for (n_val = 0;n_val < gen_nb_int;n_val++) {
2056 mem_base = xmlMemBlocks();
2057 val = gen_int(n_val, 0);
2059 ret_val = htmlHandleOmittedElem(val);
2060 desret_int(ret_val);
2062 des_int(n_val, val, 0);
2063 xmlResetLastError();
2064 if (mem_base != xmlMemBlocks()) {
2065 printf("Leak of %d blocks found in htmlHandleOmittedElem",
2066 xmlMemBlocks() - mem_base);
2068 printf(" %d", n_val);
2080 test_htmlIsAutoClosed(void) {
2083 #if defined(LIBXML_HTML_ENABLED)
2086 htmlDocPtr doc; /* the HTML document */
2088 htmlNodePtr elem; /* the HTML element */
2091 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2092 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2093 mem_base = xmlMemBlocks();
2094 doc = gen_htmlDocPtr(n_doc, 0);
2095 elem = gen_htmlNodePtr(n_elem, 1);
2097 ret_val = htmlIsAutoClosed(doc, elem);
2098 desret_int(ret_val);
2100 des_htmlDocPtr(n_doc, doc, 0);
2101 des_htmlNodePtr(n_elem, elem, 1);
2102 xmlResetLastError();
2103 if (mem_base != xmlMemBlocks()) {
2104 printf("Leak of %d blocks found in htmlIsAutoClosed",
2105 xmlMemBlocks() - mem_base);
2107 printf(" %d", n_doc);
2108 printf(" %d", n_elem);
2121 test_htmlIsScriptAttribute(void) {
2124 #if defined(LIBXML_HTML_ENABLED)
2127 xmlChar * name; /* an attribute name */
2130 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2131 mem_base = xmlMemBlocks();
2132 name = gen_const_xmlChar_ptr(n_name, 0);
2134 ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2135 desret_int(ret_val);
2137 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2138 xmlResetLastError();
2139 if (mem_base != xmlMemBlocks()) {
2140 printf("Leak of %d blocks found in htmlIsScriptAttribute",
2141 xmlMemBlocks() - mem_base);
2143 printf(" %d", n_name);
2155 test_htmlNewParserCtxt(void) {
2158 #if defined(LIBXML_HTML_ENABLED)
2160 htmlParserCtxtPtr ret_val;
2162 mem_base = xmlMemBlocks();
2164 ret_val = htmlNewParserCtxt();
2165 desret_htmlParserCtxtPtr(ret_val);
2167 xmlResetLastError();
2168 if (mem_base != xmlMemBlocks()) {
2169 printf("Leak of %d blocks found in htmlNewParserCtxt",
2170 xmlMemBlocks() - mem_base);
2182 test_htmlNodeStatus(void) {
2185 #if defined(LIBXML_HTML_ENABLED)
2188 htmlNodePtr node; /* an htmlNodePtr in a tree */
2190 int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2193 for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2194 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2195 mem_base = xmlMemBlocks();
2196 node = gen_const_htmlNodePtr(n_node, 0);
2197 legacy = gen_int(n_legacy, 1);
2199 ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2200 desret_htmlStatus(ret_val);
2202 des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2203 des_int(n_legacy, legacy, 1);
2204 xmlResetLastError();
2205 if (mem_base != xmlMemBlocks()) {
2206 printf("Leak of %d blocks found in htmlNodeStatus",
2207 xmlMemBlocks() - mem_base);
2209 printf(" %d", n_node);
2210 printf(" %d", n_legacy);
2223 test_htmlParseCharRef(void) {
2226 #if defined(LIBXML_HTML_ENABLED)
2229 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2232 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2233 mem_base = xmlMemBlocks();
2234 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2236 ret_val = htmlParseCharRef(ctxt);
2237 desret_int(ret_val);
2239 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2240 xmlResetLastError();
2241 if (mem_base != xmlMemBlocks()) {
2242 printf("Leak of %d blocks found in htmlParseCharRef",
2243 xmlMemBlocks() - mem_base);
2245 printf(" %d", n_ctxt);
2257 test_htmlParseChunk(void) {
2260 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2263 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2265 char * chunk; /* an char array */
2267 int size; /* the size in byte of the chunk */
2269 int terminate; /* last chunk indicator */
2272 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2273 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2274 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2275 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2276 mem_base = xmlMemBlocks();
2277 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2278 chunk = gen_const_char_ptr(n_chunk, 1);
2279 size = gen_int(n_size, 2);
2280 terminate = gen_int(n_terminate, 3);
2282 ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2283 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2284 desret_int(ret_val);
2286 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2287 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2288 des_int(n_size, size, 2);
2289 des_int(n_terminate, terminate, 3);
2290 xmlResetLastError();
2291 if (mem_base != xmlMemBlocks()) {
2292 printf("Leak of %d blocks found in htmlParseChunk",
2293 xmlMemBlocks() - mem_base);
2295 printf(" %d", n_ctxt);
2296 printf(" %d", n_chunk);
2297 printf(" %d", n_size);
2298 printf(" %d", n_terminate);
2313 test_htmlParseDoc(void) {
2316 #if defined(LIBXML_HTML_ENABLED)
2319 xmlChar * cur; /* a pointer to an array of xmlChar */
2321 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2324 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2325 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2326 mem_base = xmlMemBlocks();
2327 cur = gen_xmlChar_ptr(n_cur, 0);
2328 encoding = gen_const_char_ptr(n_encoding, 1);
2330 ret_val = htmlParseDoc(cur, (const char *)encoding);
2331 desret_htmlDocPtr(ret_val);
2333 des_xmlChar_ptr(n_cur, cur, 0);
2334 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2335 xmlResetLastError();
2336 if (mem_base != xmlMemBlocks()) {
2337 printf("Leak of %d blocks found in htmlParseDoc",
2338 xmlMemBlocks() - mem_base);
2340 printf(" %d", n_cur);
2341 printf(" %d", n_encoding);
2354 test_htmlParseDocument(void) {
2357 #if defined(LIBXML_HTML_ENABLED)
2360 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2363 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2364 mem_base = xmlMemBlocks();
2365 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2367 ret_val = htmlParseDocument(ctxt);
2368 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2369 desret_int(ret_val);
2371 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2372 xmlResetLastError();
2373 if (mem_base != xmlMemBlocks()) {
2374 printf("Leak of %d blocks found in htmlParseDocument",
2375 xmlMemBlocks() - mem_base);
2377 printf(" %d", n_ctxt);
2389 test_htmlParseElement(void) {
2392 #if defined(LIBXML_HTML_ENABLED)
2394 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2397 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2398 mem_base = xmlMemBlocks();
2399 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2401 htmlParseElement(ctxt);
2403 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2404 xmlResetLastError();
2405 if (mem_base != xmlMemBlocks()) {
2406 printf("Leak of %d blocks found in htmlParseElement",
2407 xmlMemBlocks() - mem_base);
2409 printf(" %d", n_ctxt);
2421 test_htmlParseEntityRef(void) {
2424 #if defined(LIBXML_HTML_ENABLED)
2426 const htmlEntityDesc * ret_val;
2427 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2429 xmlChar ** str; /* location to store the entity name */
2432 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2433 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2434 mem_base = xmlMemBlocks();
2435 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2436 str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2438 ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2439 desret_const_htmlEntityDesc_ptr(ret_val);
2441 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2442 des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2443 xmlResetLastError();
2444 if (mem_base != xmlMemBlocks()) {
2445 printf("Leak of %d blocks found in htmlParseEntityRef",
2446 xmlMemBlocks() - mem_base);
2448 printf(" %d", n_ctxt);
2449 printf(" %d", n_str);
2462 test_htmlParseFile(void) {
2465 #if defined(LIBXML_HTML_ENABLED)
2467 const char * filename; /* the filename */
2469 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2472 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2473 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2474 filename = gen_filepath(n_filename, 0);
2475 encoding = gen_const_char_ptr(n_encoding, 1);
2477 ret_val = htmlParseFile(filename, (const char *)encoding);
2478 desret_htmlDocPtr(ret_val);
2480 des_filepath(n_filename, filename, 0);
2481 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2482 xmlResetLastError();
2493 test_htmlReadDoc(void) {
2496 #if defined(LIBXML_HTML_ENABLED)
2499 xmlChar * cur; /* a pointer to a zero terminated string */
2501 const char * URL; /* the base URL to use for the document */
2503 char * encoding; /* the document encoding, or NULL */
2505 int options; /* a combination of htmlParserOption(s) */
2508 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2509 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2510 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2511 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2512 mem_base = xmlMemBlocks();
2513 cur = gen_const_xmlChar_ptr(n_cur, 0);
2514 URL = gen_filepath(n_URL, 1);
2515 encoding = gen_const_char_ptr(n_encoding, 2);
2516 options = gen_int(n_options, 3);
2518 ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2519 desret_htmlDocPtr(ret_val);
2521 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2522 des_filepath(n_URL, URL, 1);
2523 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2524 des_int(n_options, options, 3);
2525 xmlResetLastError();
2526 if (mem_base != xmlMemBlocks()) {
2527 printf("Leak of %d blocks found in htmlReadDoc",
2528 xmlMemBlocks() - mem_base);
2530 printf(" %d", n_cur);
2531 printf(" %d", n_URL);
2532 printf(" %d", n_encoding);
2533 printf(" %d", n_options);
2548 test_htmlReadFile(void) {
2551 #if defined(LIBXML_HTML_ENABLED)
2554 const char * filename; /* a file or URL */
2556 char * encoding; /* the document encoding, or NULL */
2558 int options; /* a combination of htmlParserOption(s) */
2561 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2562 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2563 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2564 mem_base = xmlMemBlocks();
2565 filename = gen_filepath(n_filename, 0);
2566 encoding = gen_const_char_ptr(n_encoding, 1);
2567 options = gen_int(n_options, 2);
2569 ret_val = htmlReadFile(filename, (const char *)encoding, options);
2570 desret_htmlDocPtr(ret_val);
2572 des_filepath(n_filename, filename, 0);
2573 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2574 des_int(n_options, options, 2);
2575 xmlResetLastError();
2576 if (mem_base != xmlMemBlocks()) {
2577 printf("Leak of %d blocks found in htmlReadFile",
2578 xmlMemBlocks() - mem_base);
2580 printf(" %d", n_filename);
2581 printf(" %d", n_encoding);
2582 printf(" %d", n_options);
2596 test_htmlReadMemory(void) {
2599 #if defined(LIBXML_HTML_ENABLED)
2602 char * buffer; /* a pointer to a char array */
2604 int size; /* the size of the array */
2606 const char * URL; /* the base URL to use for the document */
2608 char * encoding; /* the document encoding, or NULL */
2610 int options; /* a combination of htmlParserOption(s) */
2613 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2614 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2615 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2616 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2617 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2618 mem_base = xmlMemBlocks();
2619 buffer = gen_const_char_ptr(n_buffer, 0);
2620 size = gen_int(n_size, 1);
2621 URL = gen_filepath(n_URL, 2);
2622 encoding = gen_const_char_ptr(n_encoding, 3);
2623 options = gen_int(n_options, 4);
2625 ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2626 desret_htmlDocPtr(ret_val);
2628 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2629 des_int(n_size, size, 1);
2630 des_filepath(n_URL, URL, 2);
2631 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2632 des_int(n_options, options, 4);
2633 xmlResetLastError();
2634 if (mem_base != xmlMemBlocks()) {
2635 printf("Leak of %d blocks found in htmlReadMemory",
2636 xmlMemBlocks() - mem_base);
2638 printf(" %d", n_buffer);
2639 printf(" %d", n_size);
2640 printf(" %d", n_URL);
2641 printf(" %d", n_encoding);
2642 printf(" %d", n_options);
2658 test_htmlSAXParseDoc(void) {
2661 #if defined(LIBXML_HTML_ENABLED)
2664 xmlChar * cur; /* a pointer to an array of xmlChar */
2666 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2668 htmlSAXHandlerPtr sax; /* the SAX handler block */
2670 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2673 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2674 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2675 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2676 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2677 mem_base = xmlMemBlocks();
2678 cur = gen_xmlChar_ptr(n_cur, 0);
2679 encoding = gen_const_char_ptr(n_encoding, 1);
2680 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2681 userData = gen_userdata(n_userData, 3);
2683 ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2684 desret_htmlDocPtr(ret_val);
2686 des_xmlChar_ptr(n_cur, cur, 0);
2687 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2688 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2689 des_userdata(n_userData, userData, 3);
2690 xmlResetLastError();
2691 if (mem_base != xmlMemBlocks()) {
2692 printf("Leak of %d blocks found in htmlSAXParseDoc",
2693 xmlMemBlocks() - mem_base);
2695 printf(" %d", n_cur);
2696 printf(" %d", n_encoding);
2697 printf(" %d", n_sax);
2698 printf(" %d", n_userData);
2713 test_htmlSAXParseFile(void) {
2716 #if defined(LIBXML_HTML_ENABLED)
2719 const char * filename; /* the filename */
2721 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2723 htmlSAXHandlerPtr sax; /* the SAX handler block */
2725 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2728 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2729 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2730 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2731 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2732 mem_base = xmlMemBlocks();
2733 filename = gen_filepath(n_filename, 0);
2734 encoding = gen_const_char_ptr(n_encoding, 1);
2735 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2736 userData = gen_userdata(n_userData, 3);
2738 ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2739 desret_htmlDocPtr(ret_val);
2741 des_filepath(n_filename, filename, 0);
2742 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2743 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2744 des_userdata(n_userData, userData, 3);
2745 xmlResetLastError();
2746 if (mem_base != xmlMemBlocks()) {
2747 printf("Leak of %d blocks found in htmlSAXParseFile",
2748 xmlMemBlocks() - mem_base);
2750 printf(" %d", n_filename);
2751 printf(" %d", n_encoding);
2752 printf(" %d", n_sax);
2753 printf(" %d", n_userData);
2768 test_htmlTagLookup(void) {
2772 /* missing type support */
2777 test_HTMLparser(void) {
2780 if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2781 test_ret += test_UTF8ToHtml();
2782 test_ret += test_htmlAttrAllowed();
2783 test_ret += test_htmlAutoCloseTag();
2784 test_ret += test_htmlCreateMemoryParserCtxt();
2785 test_ret += test_htmlCreatePushParserCtxt();
2786 test_ret += test_htmlCtxtReadDoc();
2787 test_ret += test_htmlCtxtReadFile();
2788 test_ret += test_htmlCtxtReadMemory();
2789 test_ret += test_htmlCtxtReset();
2790 test_ret += test_htmlCtxtUseOptions();
2791 test_ret += test_htmlElementAllowedHere();
2792 test_ret += test_htmlElementStatusHere();
2793 test_ret += test_htmlEncodeEntities();
2794 test_ret += test_htmlEntityLookup();
2795 test_ret += test_htmlEntityValueLookup();
2796 test_ret += test_htmlHandleOmittedElem();
2797 test_ret += test_htmlIsAutoClosed();
2798 test_ret += test_htmlIsScriptAttribute();
2799 test_ret += test_htmlNewParserCtxt();
2800 test_ret += test_htmlNodeStatus();
2801 test_ret += test_htmlParseCharRef();
2802 test_ret += test_htmlParseChunk();
2803 test_ret += test_htmlParseDoc();
2804 test_ret += test_htmlParseDocument();
2805 test_ret += test_htmlParseElement();
2806 test_ret += test_htmlParseEntityRef();
2807 test_ret += test_htmlParseFile();
2808 test_ret += test_htmlReadDoc();
2809 test_ret += test_htmlReadFile();
2810 test_ret += test_htmlReadMemory();
2811 test_ret += test_htmlSAXParseDoc();
2812 test_ret += test_htmlSAXParseFile();
2813 test_ret += test_htmlTagLookup();
2816 printf("Module HTMLparser: %d errors\n", test_ret);
2821 test_htmlDocContentDumpFormatOutput(void) {
2824 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2826 xmlOutputBufferPtr buf; /* the HTML buffer output */
2828 xmlDocPtr cur; /* the document */
2830 char * encoding; /* the encoding string */
2832 int format; /* should formatting spaces been added */
2835 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2836 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2837 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2838 for (n_format = 0;n_format < gen_nb_int;n_format++) {
2839 mem_base = xmlMemBlocks();
2840 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2841 cur = gen_xmlDocPtr(n_cur, 1);
2842 encoding = gen_const_char_ptr(n_encoding, 2);
2843 format = gen_int(n_format, 3);
2845 htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2847 des_xmlOutputBufferPtr(n_buf, buf, 0);
2848 des_xmlDocPtr(n_cur, cur, 1);
2849 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2850 des_int(n_format, format, 3);
2851 xmlResetLastError();
2852 if (mem_base != xmlMemBlocks()) {
2853 printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2854 xmlMemBlocks() - mem_base);
2856 printf(" %d", n_buf);
2857 printf(" %d", n_cur);
2858 printf(" %d", n_encoding);
2859 printf(" %d", n_format);
2874 test_htmlDocContentDumpOutput(void) {
2877 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2879 xmlOutputBufferPtr buf; /* the HTML buffer output */
2881 xmlDocPtr cur; /* the document */
2883 char * encoding; /* the encoding string */
2886 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2887 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2888 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2889 mem_base = xmlMemBlocks();
2890 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2891 cur = gen_xmlDocPtr(n_cur, 1);
2892 encoding = gen_const_char_ptr(n_encoding, 2);
2894 htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2896 des_xmlOutputBufferPtr(n_buf, buf, 0);
2897 des_xmlDocPtr(n_cur, cur, 1);
2898 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2899 xmlResetLastError();
2900 if (mem_base != xmlMemBlocks()) {
2901 printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2902 xmlMemBlocks() - mem_base);
2904 printf(" %d", n_buf);
2905 printf(" %d", n_cur);
2906 printf(" %d", n_encoding);
2920 test_htmlDocDump(void) {
2923 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2926 FILE * f; /* the FILE* */
2928 xmlDocPtr cur; /* the document */
2931 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2932 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2933 mem_base = xmlMemBlocks();
2934 f = gen_FILE_ptr(n_f, 0);
2935 cur = gen_xmlDocPtr(n_cur, 1);
2937 ret_val = htmlDocDump(f, cur);
2938 desret_int(ret_val);
2940 des_FILE_ptr(n_f, f, 0);
2941 des_xmlDocPtr(n_cur, cur, 1);
2942 xmlResetLastError();
2943 if (mem_base != xmlMemBlocks()) {
2944 printf("Leak of %d blocks found in htmlDocDump",
2945 xmlMemBlocks() - mem_base);
2948 printf(" %d", n_cur);
2960 #define gen_nb_xmlChar_ptr_ptr 1
2961 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2964 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2968 test_htmlDocDumpMemory(void) {
2971 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2973 xmlDocPtr cur; /* the document */
2975 xmlChar ** mem; /* OUT: the memory pointer */
2977 int * size; /* OUT: the memory length */
2980 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2981 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2982 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2983 mem_base = xmlMemBlocks();
2984 cur = gen_xmlDocPtr(n_cur, 0);
2985 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2986 size = gen_int_ptr(n_size, 2);
2988 htmlDocDumpMemory(cur, mem, size);
2990 des_xmlDocPtr(n_cur, cur, 0);
2991 des_xmlChar_ptr_ptr(n_mem, mem, 1);
2992 des_int_ptr(n_size, size, 2);
2993 xmlResetLastError();
2994 if (mem_base != xmlMemBlocks()) {
2995 printf("Leak of %d blocks found in htmlDocDumpMemory",
2996 xmlMemBlocks() - mem_base);
2998 printf(" %d", n_cur);
2999 printf(" %d", n_mem);
3000 printf(" %d", n_size);
3014 test_htmlDocDumpMemoryFormat(void) {
3017 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3019 xmlDocPtr cur; /* the document */
3021 xmlChar ** mem; /* OUT: the memory pointer */
3023 int * size; /* OUT: the memory length */
3025 int format; /* should formatting spaces been added */
3028 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3029 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3030 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3031 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3032 mem_base = xmlMemBlocks();
3033 cur = gen_xmlDocPtr(n_cur, 0);
3034 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3035 size = gen_int_ptr(n_size, 2);
3036 format = gen_int(n_format, 3);
3038 htmlDocDumpMemoryFormat(cur, mem, size, format);
3040 des_xmlDocPtr(n_cur, cur, 0);
3041 des_xmlChar_ptr_ptr(n_mem, mem, 1);
3042 des_int_ptr(n_size, size, 2);
3043 des_int(n_format, format, 3);
3044 xmlResetLastError();
3045 if (mem_base != xmlMemBlocks()) {
3046 printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3047 xmlMemBlocks() - mem_base);
3049 printf(" %d", n_cur);
3050 printf(" %d", n_mem);
3051 printf(" %d", n_size);
3052 printf(" %d", n_format);
3067 test_htmlGetMetaEncoding(void) {
3070 #if defined(LIBXML_HTML_ENABLED)
3072 const xmlChar * ret_val;
3073 htmlDocPtr doc; /* the document */
3076 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3077 mem_base = xmlMemBlocks();
3078 doc = gen_htmlDocPtr(n_doc, 0);
3080 ret_val = htmlGetMetaEncoding(doc);
3081 desret_const_xmlChar_ptr(ret_val);
3083 des_htmlDocPtr(n_doc, doc, 0);
3084 xmlResetLastError();
3085 if (mem_base != xmlMemBlocks()) {
3086 printf("Leak of %d blocks found in htmlGetMetaEncoding",
3087 xmlMemBlocks() - mem_base);
3089 printf(" %d", n_doc);
3101 test_htmlIsBooleanAttr(void) {
3104 #if defined(LIBXML_HTML_ENABLED)
3107 xmlChar * name; /* the name of the attribute to check */
3110 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3111 mem_base = xmlMemBlocks();
3112 name = gen_const_xmlChar_ptr(n_name, 0);
3114 ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3115 desret_int(ret_val);
3117 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3118 xmlResetLastError();
3119 if (mem_base != xmlMemBlocks()) {
3120 printf("Leak of %d blocks found in htmlIsBooleanAttr",
3121 xmlMemBlocks() - mem_base);
3123 printf(" %d", n_name);
3135 test_htmlNewDoc(void) {
3138 #if defined(LIBXML_HTML_ENABLED)
3141 xmlChar * URI; /* URI for the dtd, or NULL */
3143 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3146 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3147 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3148 mem_base = xmlMemBlocks();
3149 URI = gen_const_xmlChar_ptr(n_URI, 0);
3150 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3152 ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3153 desret_htmlDocPtr(ret_val);
3155 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3156 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3157 xmlResetLastError();
3158 if (mem_base != xmlMemBlocks()) {
3159 printf("Leak of %d blocks found in htmlNewDoc",
3160 xmlMemBlocks() - mem_base);
3162 printf(" %d", n_URI);
3163 printf(" %d", n_ExternalID);
3176 test_htmlNewDocNoDtD(void) {
3179 #if defined(LIBXML_HTML_ENABLED)
3182 xmlChar * URI; /* URI for the dtd, or NULL */
3184 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3187 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3188 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3189 mem_base = xmlMemBlocks();
3190 URI = gen_const_xmlChar_ptr(n_URI, 0);
3191 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3193 ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3194 desret_htmlDocPtr(ret_val);
3196 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3197 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3198 xmlResetLastError();
3199 if (mem_base != xmlMemBlocks()) {
3200 printf("Leak of %d blocks found in htmlNewDocNoDtD",
3201 xmlMemBlocks() - mem_base);
3203 printf(" %d", n_URI);
3204 printf(" %d", n_ExternalID);
3217 test_htmlNodeDump(void) {
3220 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3223 xmlBufferPtr buf; /* the HTML buffer output */
3225 xmlDocPtr doc; /* the document */
3227 xmlNodePtr cur; /* the current node */
3230 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3231 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3232 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3233 mem_base = xmlMemBlocks();
3234 buf = gen_xmlBufferPtr(n_buf, 0);
3235 doc = gen_xmlDocPtr(n_doc, 1);
3236 cur = gen_xmlNodePtr(n_cur, 2);
3238 ret_val = htmlNodeDump(buf, doc, cur);
3239 desret_int(ret_val);
3241 des_xmlBufferPtr(n_buf, buf, 0);
3242 des_xmlDocPtr(n_doc, doc, 1);
3243 des_xmlNodePtr(n_cur, cur, 2);
3244 xmlResetLastError();
3245 if (mem_base != xmlMemBlocks()) {
3246 printf("Leak of %d blocks found in htmlNodeDump",
3247 xmlMemBlocks() - mem_base);
3249 printf(" %d", n_buf);
3250 printf(" %d", n_doc);
3251 printf(" %d", n_cur);
3265 test_htmlNodeDumpFile(void) {
3268 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3270 FILE * out; /* the FILE pointer */
3272 xmlDocPtr doc; /* the document */
3274 xmlNodePtr cur; /* the current node */
3277 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3278 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3279 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3280 mem_base = xmlMemBlocks();
3281 out = gen_FILE_ptr(n_out, 0);
3282 doc = gen_xmlDocPtr(n_doc, 1);
3283 cur = gen_xmlNodePtr(n_cur, 2);
3285 htmlNodeDumpFile(out, doc, cur);
3287 des_FILE_ptr(n_out, out, 0);
3288 des_xmlDocPtr(n_doc, doc, 1);
3289 des_xmlNodePtr(n_cur, cur, 2);
3290 xmlResetLastError();
3291 if (mem_base != xmlMemBlocks()) {
3292 printf("Leak of %d blocks found in htmlNodeDumpFile",
3293 xmlMemBlocks() - mem_base);
3295 printf(" %d", n_out);
3296 printf(" %d", n_doc);
3297 printf(" %d", n_cur);
3311 test_htmlNodeDumpFileFormat(void) {
3314 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3317 FILE * out; /* the FILE pointer */
3319 xmlDocPtr doc; /* the document */
3321 xmlNodePtr cur; /* the current node */
3323 char * encoding; /* the document encoding */
3325 int format; /* should formatting spaces been added */
3328 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3329 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3330 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3331 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3332 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3333 mem_base = xmlMemBlocks();
3334 out = gen_FILE_ptr(n_out, 0);
3335 doc = gen_xmlDocPtr(n_doc, 1);
3336 cur = gen_xmlNodePtr(n_cur, 2);
3337 encoding = gen_const_char_ptr(n_encoding, 3);
3338 format = gen_int(n_format, 4);
3340 ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3341 desret_int(ret_val);
3343 des_FILE_ptr(n_out, out, 0);
3344 des_xmlDocPtr(n_doc, doc, 1);
3345 des_xmlNodePtr(n_cur, cur, 2);
3346 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3347 des_int(n_format, format, 4);
3348 xmlResetLastError();
3349 if (mem_base != xmlMemBlocks()) {
3350 printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3351 xmlMemBlocks() - mem_base);
3353 printf(" %d", n_out);
3354 printf(" %d", n_doc);
3355 printf(" %d", n_cur);
3356 printf(" %d", n_encoding);
3357 printf(" %d", n_format);
3373 test_htmlNodeDumpFormatOutput(void) {
3376 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3378 xmlOutputBufferPtr buf; /* the HTML buffer output */
3380 xmlDocPtr doc; /* the document */
3382 xmlNodePtr cur; /* the current node */
3384 char * encoding; /* the encoding string */
3386 int format; /* should formatting spaces been added */
3389 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3390 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3391 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3392 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3393 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3394 mem_base = xmlMemBlocks();
3395 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3396 doc = gen_xmlDocPtr(n_doc, 1);
3397 cur = gen_xmlNodePtr(n_cur, 2);
3398 encoding = gen_const_char_ptr(n_encoding, 3);
3399 format = gen_int(n_format, 4);
3401 htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3403 des_xmlOutputBufferPtr(n_buf, buf, 0);
3404 des_xmlDocPtr(n_doc, doc, 1);
3405 des_xmlNodePtr(n_cur, cur, 2);
3406 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3407 des_int(n_format, format, 4);
3408 xmlResetLastError();
3409 if (mem_base != xmlMemBlocks()) {
3410 printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3411 xmlMemBlocks() - mem_base);
3413 printf(" %d", n_buf);
3414 printf(" %d", n_doc);
3415 printf(" %d", n_cur);
3416 printf(" %d", n_encoding);
3417 printf(" %d", n_format);
3433 test_htmlNodeDumpOutput(void) {
3436 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3438 xmlOutputBufferPtr buf; /* the HTML buffer output */
3440 xmlDocPtr doc; /* the document */
3442 xmlNodePtr cur; /* the current node */
3444 char * encoding; /* the encoding string */
3447 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3448 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3449 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3450 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3451 mem_base = xmlMemBlocks();
3452 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3453 doc = gen_xmlDocPtr(n_doc, 1);
3454 cur = gen_xmlNodePtr(n_cur, 2);
3455 encoding = gen_const_char_ptr(n_encoding, 3);
3457 htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3459 des_xmlOutputBufferPtr(n_buf, buf, 0);
3460 des_xmlDocPtr(n_doc, doc, 1);
3461 des_xmlNodePtr(n_cur, cur, 2);
3462 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3463 xmlResetLastError();
3464 if (mem_base != xmlMemBlocks()) {
3465 printf("Leak of %d blocks found in htmlNodeDumpOutput",
3466 xmlMemBlocks() - mem_base);
3468 printf(" %d", n_buf);
3469 printf(" %d", n_doc);
3470 printf(" %d", n_cur);
3471 printf(" %d", n_encoding);
3486 test_htmlSaveFile(void) {
3489 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3492 const char * filename; /* the filename (or URL) */
3494 xmlDocPtr cur; /* the document */
3497 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3498 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3499 mem_base = xmlMemBlocks();
3500 filename = gen_fileoutput(n_filename, 0);
3501 cur = gen_xmlDocPtr(n_cur, 1);
3503 ret_val = htmlSaveFile(filename, cur);
3504 desret_int(ret_val);
3506 des_fileoutput(n_filename, filename, 0);
3507 des_xmlDocPtr(n_cur, cur, 1);
3508 xmlResetLastError();
3509 if (mem_base != xmlMemBlocks()) {
3510 printf("Leak of %d blocks found in htmlSaveFile",
3511 xmlMemBlocks() - mem_base);
3513 printf(" %d", n_filename);
3514 printf(" %d", n_cur);
3527 test_htmlSaveFileEnc(void) {
3530 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3533 const char * filename; /* the filename */
3535 xmlDocPtr cur; /* the document */
3537 char * encoding; /* the document encoding */
3540 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3541 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3542 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3543 mem_base = xmlMemBlocks();
3544 filename = gen_fileoutput(n_filename, 0);
3545 cur = gen_xmlDocPtr(n_cur, 1);
3546 encoding = gen_const_char_ptr(n_encoding, 2);
3548 ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3549 desret_int(ret_val);
3551 des_fileoutput(n_filename, filename, 0);
3552 des_xmlDocPtr(n_cur, cur, 1);
3553 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3554 xmlResetLastError();
3555 if (mem_base != xmlMemBlocks()) {
3556 printf("Leak of %d blocks found in htmlSaveFileEnc",
3557 xmlMemBlocks() - mem_base);
3559 printf(" %d", n_filename);
3560 printf(" %d", n_cur);
3561 printf(" %d", n_encoding);
3575 test_htmlSaveFileFormat(void) {
3578 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3581 const char * filename; /* the filename */
3583 xmlDocPtr cur; /* the document */
3585 char * encoding; /* the document encoding */
3587 int format; /* should formatting spaces been added */
3590 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3591 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3592 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3593 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3594 mem_base = xmlMemBlocks();
3595 filename = gen_fileoutput(n_filename, 0);
3596 cur = gen_xmlDocPtr(n_cur, 1);
3597 encoding = gen_const_char_ptr(n_encoding, 2);
3598 format = gen_int(n_format, 3);
3600 ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3601 desret_int(ret_val);
3603 des_fileoutput(n_filename, filename, 0);
3604 des_xmlDocPtr(n_cur, cur, 1);
3605 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3606 des_int(n_format, format, 3);
3607 xmlResetLastError();
3608 if (mem_base != xmlMemBlocks()) {
3609 printf("Leak of %d blocks found in htmlSaveFileFormat",
3610 xmlMemBlocks() - mem_base);
3612 printf(" %d", n_filename);
3613 printf(" %d", n_cur);
3614 printf(" %d", n_encoding);
3615 printf(" %d", n_format);
3630 test_htmlSetMetaEncoding(void) {
3633 #if defined(LIBXML_HTML_ENABLED)
3636 htmlDocPtr doc; /* the document */
3638 xmlChar * encoding; /* the encoding string */
3641 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3642 for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3643 mem_base = xmlMemBlocks();
3644 doc = gen_htmlDocPtr(n_doc, 0);
3645 encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3647 ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3648 desret_int(ret_val);
3650 des_htmlDocPtr(n_doc, doc, 0);
3651 des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3652 xmlResetLastError();
3653 if (mem_base != xmlMemBlocks()) {
3654 printf("Leak of %d blocks found in htmlSetMetaEncoding",
3655 xmlMemBlocks() - mem_base);
3657 printf(" %d", n_doc);
3658 printf(" %d", n_encoding);
3670 test_HTMLtree(void) {
3673 if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3674 test_ret += test_htmlDocContentDumpFormatOutput();
3675 test_ret += test_htmlDocContentDumpOutput();
3676 test_ret += test_htmlDocDump();
3677 test_ret += test_htmlDocDumpMemory();
3678 test_ret += test_htmlDocDumpMemoryFormat();
3679 test_ret += test_htmlGetMetaEncoding();
3680 test_ret += test_htmlIsBooleanAttr();
3681 test_ret += test_htmlNewDoc();
3682 test_ret += test_htmlNewDocNoDtD();
3683 test_ret += test_htmlNodeDump();
3684 test_ret += test_htmlNodeDumpFile();
3685 test_ret += test_htmlNodeDumpFileFormat();
3686 test_ret += test_htmlNodeDumpFormatOutput();
3687 test_ret += test_htmlNodeDumpOutput();
3688 test_ret += test_htmlSaveFile();
3689 test_ret += test_htmlSaveFileEnc();
3690 test_ret += test_htmlSaveFileFormat();
3691 test_ret += test_htmlSetMetaEncoding();
3694 printf("Module HTMLtree: %d errors\n", test_ret);
3699 test_docbDefaultSAXHandlerInit(void) {
3702 #if defined(LIBXML_DOCB_ENABLED)
3703 #ifdef LIBXML_DOCB_ENABLED
3706 mem_base = xmlMemBlocks();
3708 docbDefaultSAXHandlerInit();
3710 xmlResetLastError();
3711 if (mem_base != xmlMemBlocks()) {
3712 printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3713 xmlMemBlocks() - mem_base);
3726 test_htmlDefaultSAXHandlerInit(void) {
3729 #if defined(LIBXML_HTML_ENABLED)
3730 #ifdef LIBXML_HTML_ENABLED
3733 mem_base = xmlMemBlocks();
3735 htmlDefaultSAXHandlerInit();
3737 xmlResetLastError();
3738 if (mem_base != xmlMemBlocks()) {
3739 printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3740 xmlMemBlocks() - mem_base);
3753 test_xmlDefaultSAXHandlerInit(void) {
3758 mem_base = xmlMemBlocks();
3760 xmlDefaultSAXHandlerInit();
3762 xmlResetLastError();
3763 if (mem_base != xmlMemBlocks()) {
3764 printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3765 xmlMemBlocks() - mem_base);
3775 #define gen_nb_xmlEnumerationPtr 1
3776 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3779 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3783 test_xmlSAX2AttributeDecl(void) {
3787 void * ctx; /* the user data (XML parser context) */
3789 xmlChar * elem; /* the name of the element */
3791 xmlChar * fullname; /* the attribute name */
3793 int type; /* the attribute type */
3795 int def; /* the type of default value */
3797 xmlChar * defaultValue; /* the attribute default value */
3799 xmlEnumerationPtr tree; /* the tree of enumerated value set */
3802 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3803 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3804 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3805 for (n_type = 0;n_type < gen_nb_int;n_type++) {
3806 for (n_def = 0;n_def < gen_nb_int;n_def++) {
3807 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3808 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3809 mem_base = xmlMemBlocks();
3810 ctx = gen_void_ptr(n_ctx, 0);
3811 elem = gen_const_xmlChar_ptr(n_elem, 1);
3812 fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3813 type = gen_int(n_type, 3);
3814 def = gen_int(n_def, 4);
3815 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3816 tree = gen_xmlEnumerationPtr(n_tree, 6);
3818 xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3820 des_void_ptr(n_ctx, ctx, 0);
3821 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3822 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3823 des_int(n_type, type, 3);
3824 des_int(n_def, def, 4);
3825 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3826 des_xmlEnumerationPtr(n_tree, tree, 6);
3827 xmlResetLastError();
3828 if (mem_base != xmlMemBlocks()) {
3829 printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3830 xmlMemBlocks() - mem_base);
3832 printf(" %d", n_ctx);
3833 printf(" %d", n_elem);
3834 printf(" %d", n_fullname);
3835 printf(" %d", n_type);
3836 printf(" %d", n_def);
3837 printf(" %d", n_defaultValue);
3838 printf(" %d", n_tree);
3855 test_xmlSAX2CDataBlock(void) {
3859 void * ctx; /* the user data (XML parser context) */
3861 xmlChar * value; /* The pcdata content */
3863 int len; /* the block length */
3866 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3867 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3868 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3869 mem_base = xmlMemBlocks();
3870 ctx = gen_void_ptr(n_ctx, 0);
3871 value = gen_const_xmlChar_ptr(n_value, 1);
3872 len = gen_int(n_len, 2);
3874 xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3876 des_void_ptr(n_ctx, ctx, 0);
3877 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3878 des_int(n_len, len, 2);
3879 xmlResetLastError();
3880 if (mem_base != xmlMemBlocks()) {
3881 printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3882 xmlMemBlocks() - mem_base);
3884 printf(" %d", n_ctx);
3885 printf(" %d", n_value);
3886 printf(" %d", n_len);
3899 test_xmlSAX2Characters(void) {
3903 void * ctx; /* the user data (XML parser context) */
3905 xmlChar * ch; /* a xmlChar string */
3907 int len; /* the number of xmlChar */
3910 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3911 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3912 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3913 mem_base = xmlMemBlocks();
3914 ctx = gen_void_ptr(n_ctx, 0);
3915 ch = gen_const_xmlChar_ptr(n_ch, 1);
3916 len = gen_int(n_len, 2);
3918 xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3920 des_void_ptr(n_ctx, ctx, 0);
3921 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3922 des_int(n_len, len, 2);
3923 xmlResetLastError();
3924 if (mem_base != xmlMemBlocks()) {
3925 printf("Leak of %d blocks found in xmlSAX2Characters",
3926 xmlMemBlocks() - mem_base);
3928 printf(" %d", n_ctx);
3929 printf(" %d", n_ch);
3930 printf(" %d", n_len);
3943 test_xmlSAX2Comment(void) {
3947 void * ctx; /* the user data (XML parser context) */
3949 xmlChar * value; /* the xmlSAX2Comment content */
3952 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3953 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3954 mem_base = xmlMemBlocks();
3955 ctx = gen_void_ptr(n_ctx, 0);
3956 value = gen_const_xmlChar_ptr(n_value, 1);
3958 xmlSAX2Comment(ctx, (const xmlChar *)value);
3960 des_void_ptr(n_ctx, ctx, 0);
3961 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3962 xmlResetLastError();
3963 if (mem_base != xmlMemBlocks()) {
3964 printf("Leak of %d blocks found in xmlSAX2Comment",
3965 xmlMemBlocks() - mem_base);
3967 printf(" %d", n_ctx);
3968 printf(" %d", n_value);
3980 test_xmlSAX2ElementDecl(void) {
3984 void * ctx; /* the user data (XML parser context) */
3986 xmlChar * name; /* the element name */
3988 int type; /* the element type */
3990 xmlElementContentPtr content; /* the element value tree */
3993 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3994 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3995 for (n_type = 0;n_type < gen_nb_int;n_type++) {
3996 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3997 mem_base = xmlMemBlocks();
3998 ctx = gen_void_ptr(n_ctx, 0);
3999 name = gen_const_xmlChar_ptr(n_name, 1);
4000 type = gen_int(n_type, 2);
4001 content = gen_xmlElementContentPtr(n_content, 3);
4003 xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4005 des_void_ptr(n_ctx, ctx, 0);
4006 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4007 des_int(n_type, type, 2);
4008 des_xmlElementContentPtr(n_content, content, 3);
4009 xmlResetLastError();
4010 if (mem_base != xmlMemBlocks()) {
4011 printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4012 xmlMemBlocks() - mem_base);
4014 printf(" %d", n_ctx);
4015 printf(" %d", n_name);
4016 printf(" %d", n_type);
4017 printf(" %d", n_content);
4031 test_xmlSAX2EndDocument(void) {
4035 void * ctx; /* the user data (XML parser context) */
4038 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4039 mem_base = xmlMemBlocks();
4040 ctx = gen_void_ptr(n_ctx, 0);
4042 xmlSAX2EndDocument(ctx);
4044 des_void_ptr(n_ctx, ctx, 0);
4045 xmlResetLastError();
4046 if (mem_base != xmlMemBlocks()) {
4047 printf("Leak of %d blocks found in xmlSAX2EndDocument",
4048 xmlMemBlocks() - mem_base);
4050 printf(" %d", n_ctx);
4061 test_xmlSAX2EndElement(void) {
4064 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4065 #ifdef LIBXML_SAX1_ENABLED
4067 void * ctx; /* the user data (XML parser context) */
4069 xmlChar * name; /* The element name */
4072 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4073 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4074 mem_base = xmlMemBlocks();
4075 ctx = gen_void_ptr(n_ctx, 0);
4076 name = gen_const_xmlChar_ptr(n_name, 1);
4078 xmlSAX2EndElement(ctx, (const xmlChar *)name);
4080 des_void_ptr(n_ctx, ctx, 0);
4081 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4082 xmlResetLastError();
4083 if (mem_base != xmlMemBlocks()) {
4084 printf("Leak of %d blocks found in xmlSAX2EndElement",
4085 xmlMemBlocks() - mem_base);
4087 printf(" %d", n_ctx);
4088 printf(" %d", n_name);
4102 test_xmlSAX2EndElementNs(void) {
4106 void * ctx; /* the user data (XML parser context) */
4108 xmlChar * localname; /* the local name of the element */
4110 xmlChar * prefix; /* the element namespace prefix if available */
4112 xmlChar * URI; /* the element namespace name if available */
4115 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4116 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4117 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4118 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4119 mem_base = xmlMemBlocks();
4120 ctx = gen_void_ptr(n_ctx, 0);
4121 localname = gen_const_xmlChar_ptr(n_localname, 1);
4122 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4123 URI = gen_const_xmlChar_ptr(n_URI, 3);
4125 xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4127 des_void_ptr(n_ctx, ctx, 0);
4128 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4129 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4130 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4131 xmlResetLastError();
4132 if (mem_base != xmlMemBlocks()) {
4133 printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4134 xmlMemBlocks() - mem_base);
4136 printf(" %d", n_ctx);
4137 printf(" %d", n_localname);
4138 printf(" %d", n_prefix);
4139 printf(" %d", n_URI);
4153 test_xmlSAX2EntityDecl(void) {
4157 void * ctx; /* the user data (XML parser context) */
4159 xmlChar * name; /* the entity name */
4161 int type; /* the entity type */
4163 xmlChar * publicId; /* The public ID of the entity */
4165 xmlChar * systemId; /* The system ID of the entity */
4167 xmlChar * content; /* the entity value (without processing). */
4170 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4171 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4172 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4173 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4174 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4175 for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4176 mem_base = xmlMemBlocks();
4177 ctx = gen_void_ptr(n_ctx, 0);
4178 name = gen_const_xmlChar_ptr(n_name, 1);
4179 type = gen_int(n_type, 2);
4180 publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4181 systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4182 content = gen_xmlChar_ptr(n_content, 5);
4184 xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4186 des_void_ptr(n_ctx, ctx, 0);
4187 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4188 des_int(n_type, type, 2);
4189 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4190 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4191 des_xmlChar_ptr(n_content, content, 5);
4192 xmlResetLastError();
4193 if (mem_base != xmlMemBlocks()) {
4194 printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4195 xmlMemBlocks() - mem_base);
4197 printf(" %d", n_ctx);
4198 printf(" %d", n_name);
4199 printf(" %d", n_type);
4200 printf(" %d", n_publicId);
4201 printf(" %d", n_systemId);
4202 printf(" %d", n_content);
4218 test_xmlSAX2ExternalSubset(void) {
4222 void * ctx; /* the user data (XML parser context) */
4224 xmlChar * name; /* the root element name */
4226 xmlChar * ExternalID; /* the external ID */
4228 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4231 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4232 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4233 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4234 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4235 mem_base = xmlMemBlocks();
4236 ctx = gen_void_ptr(n_ctx, 0);
4237 name = gen_const_xmlChar_ptr(n_name, 1);
4238 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4239 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4241 xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4243 des_void_ptr(n_ctx, ctx, 0);
4244 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4245 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4246 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4247 xmlResetLastError();
4248 if (mem_base != xmlMemBlocks()) {
4249 printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4250 xmlMemBlocks() - mem_base);
4252 printf(" %d", n_ctx);
4253 printf(" %d", n_name);
4254 printf(" %d", n_ExternalID);
4255 printf(" %d", n_SystemID);
4269 test_xmlSAX2GetColumnNumber(void) {
4274 void * ctx; /* the user data (XML parser context) */
4277 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4278 mem_base = xmlMemBlocks();
4279 ctx = gen_void_ptr(n_ctx, 0);
4281 ret_val = xmlSAX2GetColumnNumber(ctx);
4282 desret_int(ret_val);
4284 des_void_ptr(n_ctx, ctx, 0);
4285 xmlResetLastError();
4286 if (mem_base != xmlMemBlocks()) {
4287 printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4288 xmlMemBlocks() - mem_base);
4290 printf(" %d", n_ctx);
4301 test_xmlSAX2GetEntity(void) {
4305 xmlEntityPtr ret_val;
4306 void * ctx; /* the user data (XML parser context) */
4308 xmlChar * name; /* The entity name */
4311 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4312 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4313 mem_base = xmlMemBlocks();
4314 ctx = gen_void_ptr(n_ctx, 0);
4315 name = gen_const_xmlChar_ptr(n_name, 1);
4317 ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4318 desret_xmlEntityPtr(ret_val);
4320 des_void_ptr(n_ctx, ctx, 0);
4321 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4322 xmlResetLastError();
4323 if (mem_base != xmlMemBlocks()) {
4324 printf("Leak of %d blocks found in xmlSAX2GetEntity",
4325 xmlMemBlocks() - mem_base);
4327 printf(" %d", n_ctx);
4328 printf(" %d", n_name);
4340 test_xmlSAX2GetLineNumber(void) {
4345 void * ctx; /* the user data (XML parser context) */
4348 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4349 mem_base = xmlMemBlocks();
4350 ctx = gen_void_ptr(n_ctx, 0);
4352 ret_val = xmlSAX2GetLineNumber(ctx);
4353 desret_int(ret_val);
4355 des_void_ptr(n_ctx, ctx, 0);
4356 xmlResetLastError();
4357 if (mem_base != xmlMemBlocks()) {
4358 printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4359 xmlMemBlocks() - mem_base);
4361 printf(" %d", n_ctx);
4372 test_xmlSAX2GetParameterEntity(void) {
4376 xmlEntityPtr ret_val;
4377 void * ctx; /* the user data (XML parser context) */
4379 xmlChar * name; /* The entity name */
4382 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4383 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4384 mem_base = xmlMemBlocks();
4385 ctx = gen_void_ptr(n_ctx, 0);
4386 name = gen_const_xmlChar_ptr(n_name, 1);
4388 ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4389 desret_xmlEntityPtr(ret_val);
4391 des_void_ptr(n_ctx, ctx, 0);
4392 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4393 xmlResetLastError();
4394 if (mem_base != xmlMemBlocks()) {
4395 printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4396 xmlMemBlocks() - mem_base);
4398 printf(" %d", n_ctx);
4399 printf(" %d", n_name);
4411 test_xmlSAX2GetPublicId(void) {
4415 const xmlChar * ret_val;
4416 void * ctx; /* the user data (XML parser context) */
4419 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4420 mem_base = xmlMemBlocks();
4421 ctx = gen_void_ptr(n_ctx, 0);
4423 ret_val = xmlSAX2GetPublicId(ctx);
4424 desret_const_xmlChar_ptr(ret_val);
4426 des_void_ptr(n_ctx, ctx, 0);
4427 xmlResetLastError();
4428 if (mem_base != xmlMemBlocks()) {
4429 printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4430 xmlMemBlocks() - mem_base);
4432 printf(" %d", n_ctx);
4443 test_xmlSAX2GetSystemId(void) {
4447 const xmlChar * ret_val;
4448 void * ctx; /* the user data (XML parser context) */
4451 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4452 mem_base = xmlMemBlocks();
4453 ctx = gen_void_ptr(n_ctx, 0);
4455 ret_val = xmlSAX2GetSystemId(ctx);
4456 desret_const_xmlChar_ptr(ret_val);
4458 des_void_ptr(n_ctx, ctx, 0);
4459 xmlResetLastError();
4460 if (mem_base != xmlMemBlocks()) {
4461 printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4462 xmlMemBlocks() - mem_base);
4464 printf(" %d", n_ctx);
4475 test_xmlSAX2HasExternalSubset(void) {
4480 void * ctx; /* the user data (XML parser context) */
4483 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4484 mem_base = xmlMemBlocks();
4485 ctx = gen_void_ptr(n_ctx, 0);
4487 ret_val = xmlSAX2HasExternalSubset(ctx);
4488 desret_int(ret_val);
4490 des_void_ptr(n_ctx, ctx, 0);
4491 xmlResetLastError();
4492 if (mem_base != xmlMemBlocks()) {
4493 printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4494 xmlMemBlocks() - mem_base);
4496 printf(" %d", n_ctx);
4507 test_xmlSAX2HasInternalSubset(void) {
4512 void * ctx; /* the user data (XML parser context) */
4515 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4516 mem_base = xmlMemBlocks();
4517 ctx = gen_void_ptr(n_ctx, 0);
4519 ret_val = xmlSAX2HasInternalSubset(ctx);
4520 desret_int(ret_val);
4522 des_void_ptr(n_ctx, ctx, 0);
4523 xmlResetLastError();
4524 if (mem_base != xmlMemBlocks()) {
4525 printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4526 xmlMemBlocks() - mem_base);
4528 printf(" %d", n_ctx);
4539 test_xmlSAX2IgnorableWhitespace(void) {
4543 void * ctx; /* the user data (XML parser context) */
4545 xmlChar * ch; /* a xmlChar string */
4547 int len; /* the number of xmlChar */
4550 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4551 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4552 for (n_len = 0;n_len < gen_nb_int;n_len++) {
4553 mem_base = xmlMemBlocks();
4554 ctx = gen_void_ptr(n_ctx, 0);
4555 ch = gen_const_xmlChar_ptr(n_ch, 1);
4556 len = gen_int(n_len, 2);
4558 xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4560 des_void_ptr(n_ctx, ctx, 0);
4561 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4562 des_int(n_len, len, 2);
4563 xmlResetLastError();
4564 if (mem_base != xmlMemBlocks()) {
4565 printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4566 xmlMemBlocks() - mem_base);
4568 printf(" %d", n_ctx);
4569 printf(" %d", n_ch);
4570 printf(" %d", n_len);
4582 #define gen_nb_xmlSAXHandler_ptr 1
4583 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4586 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4590 test_xmlSAX2InitDefaultSAXHandler(void) {
4594 xmlSAXHandler * hdlr; /* the SAX handler */
4596 int warning; /* flag if non-zero sets the handler warning procedure */
4599 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4600 for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4601 mem_base = xmlMemBlocks();
4602 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4603 warning = gen_int(n_warning, 1);
4605 xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4607 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4608 des_int(n_warning, warning, 1);
4609 xmlResetLastError();
4610 if (mem_base != xmlMemBlocks()) {
4611 printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4612 xmlMemBlocks() - mem_base);
4614 printf(" %d", n_hdlr);
4615 printf(" %d", n_warning);
4627 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4630 #if defined(LIBXML_DOCB_ENABLED)
4632 xmlSAXHandler * hdlr; /* the SAX handler */
4635 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4636 mem_base = xmlMemBlocks();
4637 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4639 xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4641 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4642 xmlResetLastError();
4643 if (mem_base != xmlMemBlocks()) {
4644 printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4645 xmlMemBlocks() - mem_base);
4647 printf(" %d", n_hdlr);
4659 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4662 #if defined(LIBXML_HTML_ENABLED)
4664 xmlSAXHandler * hdlr; /* the SAX handler */
4667 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4668 mem_base = xmlMemBlocks();
4669 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4671 xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4673 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4674 xmlResetLastError();
4675 if (mem_base != xmlMemBlocks()) {
4676 printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4677 xmlMemBlocks() - mem_base);
4679 printf(" %d", n_hdlr);
4691 test_xmlSAX2InternalSubset(void) {
4695 void * ctx; /* the user data (XML parser context) */
4697 xmlChar * name; /* the root element name */
4699 xmlChar * ExternalID; /* the external ID */
4701 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4704 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4705 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4706 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4707 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4708 mem_base = xmlMemBlocks();
4709 ctx = gen_void_ptr(n_ctx, 0);
4710 name = gen_const_xmlChar_ptr(n_name, 1);
4711 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4712 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4714 xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4716 des_void_ptr(n_ctx, ctx, 0);
4717 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4718 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4719 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4720 xmlResetLastError();
4721 if (mem_base != xmlMemBlocks()) {
4722 printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4723 xmlMemBlocks() - mem_base);
4725 printf(" %d", n_ctx);
4726 printf(" %d", n_name);
4727 printf(" %d", n_ExternalID);
4728 printf(" %d", n_SystemID);
4742 test_xmlSAX2IsStandalone(void) {
4747 void * ctx; /* the user data (XML parser context) */
4750 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4751 mem_base = xmlMemBlocks();
4752 ctx = gen_void_ptr(n_ctx, 0);
4754 ret_val = xmlSAX2IsStandalone(ctx);
4755 desret_int(ret_val);
4757 des_void_ptr(n_ctx, ctx, 0);
4758 xmlResetLastError();
4759 if (mem_base != xmlMemBlocks()) {
4760 printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4761 xmlMemBlocks() - mem_base);
4763 printf(" %d", n_ctx);
4774 test_xmlSAX2NotationDecl(void) {
4778 void * ctx; /* the user data (XML parser context) */
4780 xmlChar * name; /* The name of the notation */
4782 xmlChar * publicId; /* The public ID of the entity */
4784 xmlChar * systemId; /* The system ID of the entity */
4787 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4788 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4789 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4790 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4791 mem_base = xmlMemBlocks();
4792 ctx = gen_void_ptr(n_ctx, 0);
4793 name = gen_const_xmlChar_ptr(n_name, 1);
4794 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4795 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4797 xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4799 des_void_ptr(n_ctx, ctx, 0);
4800 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4801 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4802 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4803 xmlResetLastError();
4804 if (mem_base != xmlMemBlocks()) {
4805 printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4806 xmlMemBlocks() - mem_base);
4808 printf(" %d", n_ctx);
4809 printf(" %d", n_name);
4810 printf(" %d", n_publicId);
4811 printf(" %d", n_systemId);
4825 test_xmlSAX2ProcessingInstruction(void) {
4829 void * ctx; /* the user data (XML parser context) */
4831 xmlChar * target; /* the target name */
4833 xmlChar * data; /* the PI data's */
4836 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4837 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4838 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4839 mem_base = xmlMemBlocks();
4840 ctx = gen_void_ptr(n_ctx, 0);
4841 target = gen_const_xmlChar_ptr(n_target, 1);
4842 data = gen_const_xmlChar_ptr(n_data, 2);
4844 xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4846 des_void_ptr(n_ctx, ctx, 0);
4847 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4848 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4849 xmlResetLastError();
4850 if (mem_base != xmlMemBlocks()) {
4851 printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4852 xmlMemBlocks() - mem_base);
4854 printf(" %d", n_ctx);
4855 printf(" %d", n_target);
4856 printf(" %d", n_data);
4869 test_xmlSAX2Reference(void) {
4873 void * ctx; /* the user data (XML parser context) */
4875 xmlChar * name; /* The entity name */
4878 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4879 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4880 mem_base = xmlMemBlocks();
4881 ctx = gen_void_ptr(n_ctx, 0);
4882 name = gen_const_xmlChar_ptr(n_name, 1);
4884 xmlSAX2Reference(ctx, (const xmlChar *)name);
4886 des_void_ptr(n_ctx, ctx, 0);
4887 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4888 xmlResetLastError();
4889 if (mem_base != xmlMemBlocks()) {
4890 printf("Leak of %d blocks found in xmlSAX2Reference",
4891 xmlMemBlocks() - mem_base);
4893 printf(" %d", n_ctx);
4894 printf(" %d", n_name);
4906 test_xmlSAX2ResolveEntity(void) {
4910 xmlParserInputPtr ret_val;
4911 void * ctx; /* the user data (XML parser context) */
4913 xmlChar * publicId; /* The public ID of the entity */
4915 xmlChar * systemId; /* The system ID of the entity */
4918 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4919 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4920 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4921 mem_base = xmlMemBlocks();
4922 ctx = gen_void_ptr(n_ctx, 0);
4923 publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4924 systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4926 ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4927 desret_xmlParserInputPtr(ret_val);
4929 des_void_ptr(n_ctx, ctx, 0);
4930 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4931 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4932 xmlResetLastError();
4933 if (mem_base != xmlMemBlocks()) {
4934 printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4935 xmlMemBlocks() - mem_base);
4937 printf(" %d", n_ctx);
4938 printf(" %d", n_publicId);
4939 printf(" %d", n_systemId);
4951 #define gen_nb_xmlSAXLocatorPtr 1
4952 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4955 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4959 test_xmlSAX2SetDocumentLocator(void) {
4963 void * ctx; /* the user data (XML parser context) */
4965 xmlSAXLocatorPtr loc; /* A SAX Locator */
4968 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4969 for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4970 mem_base = xmlMemBlocks();
4971 ctx = gen_void_ptr(n_ctx, 0);
4972 loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4974 xmlSAX2SetDocumentLocator(ctx, loc);
4976 des_void_ptr(n_ctx, ctx, 0);
4977 des_xmlSAXLocatorPtr(n_loc, loc, 1);
4978 xmlResetLastError();
4979 if (mem_base != xmlMemBlocks()) {
4980 printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4981 xmlMemBlocks() - mem_base);
4983 printf(" %d", n_ctx);
4984 printf(" %d", n_loc);
4996 test_xmlSAX2StartDocument(void) {
5000 void * ctx; /* the user data (XML parser context) */
5003 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5004 mem_base = xmlMemBlocks();
5005 ctx = gen_void_ptr(n_ctx, 0);
5007 xmlSAX2StartDocument(ctx);
5009 des_void_ptr(n_ctx, ctx, 0);
5010 xmlResetLastError();
5011 if (mem_base != xmlMemBlocks()) {
5012 printf("Leak of %d blocks found in xmlSAX2StartDocument",
5013 xmlMemBlocks() - mem_base);
5015 printf(" %d", n_ctx);
5026 test_xmlSAX2StartElement(void) {
5029 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5030 #ifdef LIBXML_SAX1_ENABLED
5032 void * ctx; /* the user data (XML parser context) */
5034 xmlChar * fullname; /* The element name, including namespace prefix */
5036 xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5039 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5040 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5041 for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5042 mem_base = xmlMemBlocks();
5043 ctx = gen_void_ptr(n_ctx, 0);
5044 fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5045 atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5047 xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5049 des_void_ptr(n_ctx, ctx, 0);
5050 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5051 des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5052 xmlResetLastError();
5053 if (mem_base != xmlMemBlocks()) {
5054 printf("Leak of %d blocks found in xmlSAX2StartElement",
5055 xmlMemBlocks() - mem_base);
5057 printf(" %d", n_ctx);
5058 printf(" %d", n_fullname);
5059 printf(" %d", n_atts);
5074 test_xmlSAX2StartElementNs(void) {
5078 void * ctx; /* the user data (XML parser context) */
5080 xmlChar * localname; /* the local name of the element */
5082 xmlChar * prefix; /* the element namespace prefix if available */
5084 xmlChar * URI; /* the element namespace name if available */
5086 int nb_namespaces; /* number of namespace definitions on that node */
5087 int n_nb_namespaces;
5088 xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5090 int nb_attributes; /* the number of attributes on that node */
5091 int n_nb_attributes;
5092 int nb_defaulted; /* the number of defaulted attributes. */
5094 xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5097 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5098 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5099 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5100 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5101 for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5102 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5103 for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5104 for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5105 for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5106 mem_base = xmlMemBlocks();
5107 ctx = gen_void_ptr(n_ctx, 0);
5108 localname = gen_const_xmlChar_ptr(n_localname, 1);
5109 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5110 URI = gen_const_xmlChar_ptr(n_URI, 3);
5111 nb_namespaces = gen_int(n_nb_namespaces, 4);
5112 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5113 nb_attributes = gen_int(n_nb_attributes, 6);
5114 nb_defaulted = gen_int(n_nb_defaulted, 7);
5115 attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5117 xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5119 des_void_ptr(n_ctx, ctx, 0);
5120 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5121 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5122 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5123 des_int(n_nb_namespaces, nb_namespaces, 4);
5124 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5125 des_int(n_nb_attributes, nb_attributes, 6);
5126 des_int(n_nb_defaulted, nb_defaulted, 7);
5127 des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5128 xmlResetLastError();
5129 if (mem_base != xmlMemBlocks()) {
5130 printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5131 xmlMemBlocks() - mem_base);
5133 printf(" %d", n_ctx);
5134 printf(" %d", n_localname);
5135 printf(" %d", n_prefix);
5136 printf(" %d", n_URI);
5137 printf(" %d", n_nb_namespaces);
5138 printf(" %d", n_namespaces);
5139 printf(" %d", n_nb_attributes);
5140 printf(" %d", n_nb_defaulted);
5141 printf(" %d", n_attributes);
5160 test_xmlSAX2UnparsedEntityDecl(void) {
5164 void * ctx; /* the user data (XML parser context) */
5166 xmlChar * name; /* The name of the entity */
5168 xmlChar * publicId; /* The public ID of the entity */
5170 xmlChar * systemId; /* The system ID of the entity */
5172 xmlChar * notationName; /* the name of the notation */
5175 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5177 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5178 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5179 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5180 mem_base = xmlMemBlocks();
5181 ctx = gen_void_ptr(n_ctx, 0);
5182 name = gen_const_xmlChar_ptr(n_name, 1);
5183 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5184 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5185 notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5187 xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5189 des_void_ptr(n_ctx, ctx, 0);
5190 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5191 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5192 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5193 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5194 xmlResetLastError();
5195 if (mem_base != xmlMemBlocks()) {
5196 printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5197 xmlMemBlocks() - mem_base);
5199 printf(" %d", n_ctx);
5200 printf(" %d", n_name);
5201 printf(" %d", n_publicId);
5202 printf(" %d", n_systemId);
5203 printf(" %d", n_notationName);
5218 test_xmlSAXDefaultVersion(void) {
5221 #if defined(LIBXML_SAX1_ENABLED)
5222 #ifdef LIBXML_SAX1_ENABLED
5225 int version; /* the version, 1 or 2 */
5228 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5229 mem_base = xmlMemBlocks();
5230 version = gen_int(n_version, 0);
5232 ret_val = xmlSAXDefaultVersion(version);
5233 desret_int(ret_val);
5235 des_int(n_version, version, 0);
5236 xmlResetLastError();
5237 if (mem_base != xmlMemBlocks()) {
5238 printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5239 xmlMemBlocks() - mem_base);
5241 printf(" %d", n_version);
5254 test_xmlSAXVersion(void) {
5259 xmlSAXHandler * hdlr; /* the SAX handler */
5261 int version; /* the version, 1 or 2 */
5264 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5265 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5266 mem_base = xmlMemBlocks();
5267 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5268 version = gen_int(n_version, 1);
5270 ret_val = xmlSAXVersion(hdlr, version);
5271 desret_int(ret_val);
5273 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5274 des_int(n_version, version, 1);
5275 xmlResetLastError();
5276 if (mem_base != xmlMemBlocks()) {
5277 printf("Leak of %d blocks found in xmlSAXVersion",
5278 xmlMemBlocks() - mem_base);
5280 printf(" %d", n_hdlr);
5281 printf(" %d", n_version);
5295 if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5296 test_ret += test_docbDefaultSAXHandlerInit();
5297 test_ret += test_htmlDefaultSAXHandlerInit();
5298 test_ret += test_xmlDefaultSAXHandlerInit();
5299 test_ret += test_xmlSAX2AttributeDecl();
5300 test_ret += test_xmlSAX2CDataBlock();
5301 test_ret += test_xmlSAX2Characters();
5302 test_ret += test_xmlSAX2Comment();
5303 test_ret += test_xmlSAX2ElementDecl();
5304 test_ret += test_xmlSAX2EndDocument();
5305 test_ret += test_xmlSAX2EndElement();
5306 test_ret += test_xmlSAX2EndElementNs();
5307 test_ret += test_xmlSAX2EntityDecl();
5308 test_ret += test_xmlSAX2ExternalSubset();
5309 test_ret += test_xmlSAX2GetColumnNumber();
5310 test_ret += test_xmlSAX2GetEntity();
5311 test_ret += test_xmlSAX2GetLineNumber();
5312 test_ret += test_xmlSAX2GetParameterEntity();
5313 test_ret += test_xmlSAX2GetPublicId();
5314 test_ret += test_xmlSAX2GetSystemId();
5315 test_ret += test_xmlSAX2HasExternalSubset();
5316 test_ret += test_xmlSAX2HasInternalSubset();
5317 test_ret += test_xmlSAX2IgnorableWhitespace();
5318 test_ret += test_xmlSAX2InitDefaultSAXHandler();
5319 test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5320 test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5321 test_ret += test_xmlSAX2InternalSubset();
5322 test_ret += test_xmlSAX2IsStandalone();
5323 test_ret += test_xmlSAX2NotationDecl();
5324 test_ret += test_xmlSAX2ProcessingInstruction();
5325 test_ret += test_xmlSAX2Reference();
5326 test_ret += test_xmlSAX2ResolveEntity();
5327 test_ret += test_xmlSAX2SetDocumentLocator();
5328 test_ret += test_xmlSAX2StartDocument();
5329 test_ret += test_xmlSAX2StartElement();
5330 test_ret += test_xmlSAX2StartElementNs();
5331 test_ret += test_xmlSAX2UnparsedEntityDecl();
5332 test_ret += test_xmlSAXDefaultVersion();
5333 test_ret += test_xmlSAXVersion();
5336 printf("Module SAX2: %d errors\n", test_ret);
5341 test_xmlC14NDocDumpMemory(void) {
5344 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5347 xmlDocPtr doc; /* the XML document for canonization */
5349 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5351 int mode; /* the c14n mode (see @xmlC14NMode) */
5353 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5354 int n_inclusive_ns_prefixes;
5355 int with_comments; /* include comments in the result (!=0) or not (==0) */
5356 int n_with_comments;
5357 xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
5360 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5361 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5362 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5363 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5364 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5365 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5366 mem_base = xmlMemBlocks();
5367 doc = gen_xmlDocPtr(n_doc, 0);
5368 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5369 mode = gen_int(n_mode, 2);
5370 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5371 with_comments = gen_int(n_with_comments, 4);
5372 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5374 ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5375 desret_int(ret_val);
5377 des_xmlDocPtr(n_doc, doc, 0);
5378 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5379 des_int(n_mode, mode, 2);
5380 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5381 des_int(n_with_comments, with_comments, 4);
5382 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5383 xmlResetLastError();
5384 if (mem_base != xmlMemBlocks()) {
5385 printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5386 xmlMemBlocks() - mem_base);
5388 printf(" %d", n_doc);
5389 printf(" %d", n_nodes);
5390 printf(" %d", n_mode);
5391 printf(" %d", n_inclusive_ns_prefixes);
5392 printf(" %d", n_with_comments);
5393 printf(" %d", n_doc_txt_ptr);
5410 test_xmlC14NDocSave(void) {
5413 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5416 xmlDocPtr doc; /* the XML document for canonization */
5418 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5420 int mode; /* the c14n mode (see @xmlC14NMode) */
5422 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5423 int n_inclusive_ns_prefixes;
5424 int with_comments; /* include comments in the result (!=0) or not (==0) */
5425 int n_with_comments;
5426 const char * filename; /* the filename to store canonical XML image */
5428 int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5431 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5432 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5433 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5434 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5435 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5436 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5437 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5438 mem_base = xmlMemBlocks();
5439 doc = gen_xmlDocPtr(n_doc, 0);
5440 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5441 mode = gen_int(n_mode, 2);
5442 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5443 with_comments = gen_int(n_with_comments, 4);
5444 filename = gen_fileoutput(n_filename, 5);
5445 compression = gen_int(n_compression, 6);
5447 ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5448 desret_int(ret_val);
5450 des_xmlDocPtr(n_doc, doc, 0);
5451 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5452 des_int(n_mode, mode, 2);
5453 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5454 des_int(n_with_comments, with_comments, 4);
5455 des_fileoutput(n_filename, filename, 5);
5456 des_int(n_compression, compression, 6);
5457 xmlResetLastError();
5458 if (mem_base != xmlMemBlocks()) {
5459 printf("Leak of %d blocks found in xmlC14NDocSave",
5460 xmlMemBlocks() - mem_base);
5462 printf(" %d", n_doc);
5463 printf(" %d", n_nodes);
5464 printf(" %d", n_mode);
5465 printf(" %d", n_inclusive_ns_prefixes);
5466 printf(" %d", n_with_comments);
5467 printf(" %d", n_filename);
5468 printf(" %d", n_compression);
5486 test_xmlC14NDocSaveTo(void) {
5489 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5492 xmlDocPtr doc; /* the XML document for canonization */
5494 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5496 int mode; /* the c14n mode (see @xmlC14NMode) */
5498 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5499 int n_inclusive_ns_prefixes;
5500 int with_comments; /* include comments in the result (!=0) or not (==0) */
5501 int n_with_comments;
5502 xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5505 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5506 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5507 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5508 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5509 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5510 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5511 mem_base = xmlMemBlocks();
5512 doc = gen_xmlDocPtr(n_doc, 0);
5513 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5514 mode = gen_int(n_mode, 2);
5515 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5516 with_comments = gen_int(n_with_comments, 4);
5517 buf = gen_xmlOutputBufferPtr(n_buf, 5);
5519 ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5520 desret_int(ret_val);
5522 des_xmlDocPtr(n_doc, doc, 0);
5523 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5524 des_int(n_mode, mode, 2);
5525 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5526 des_int(n_with_comments, with_comments, 4);
5527 des_xmlOutputBufferPtr(n_buf, buf, 5);
5528 xmlResetLastError();
5529 if (mem_base != xmlMemBlocks()) {
5530 printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5531 xmlMemBlocks() - mem_base);
5533 printf(" %d", n_doc);
5534 printf(" %d", n_nodes);
5535 printf(" %d", n_mode);
5536 printf(" %d", n_inclusive_ns_prefixes);
5537 printf(" %d", n_with_comments);
5538 printf(" %d", n_buf);
5555 test_xmlC14NExecute(void) {
5559 /* missing type support */
5567 if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5568 test_ret += test_xmlC14NDocDumpMemory();
5569 test_ret += test_xmlC14NDocSave();
5570 test_ret += test_xmlC14NDocSaveTo();
5571 test_ret += test_xmlC14NExecute();
5574 printf("Module c14n: %d errors\n", test_ret);
5577 #ifdef LIBXML_CATALOG_ENABLED
5579 #define gen_nb_xmlCatalogPtr 1
5580 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5583 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5589 test_xmlACatalogAdd(void) {
5592 #if defined(LIBXML_CATALOG_ENABLED)
5595 xmlCatalogPtr catal; /* a Catalog */
5597 xmlChar * type; /* the type of record to add to the catalog */
5599 xmlChar * orig; /* the system, public or prefix to match */
5601 xmlChar * replace; /* the replacement value for the match */
5604 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5605 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5606 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5607 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5608 mem_base = xmlMemBlocks();
5609 catal = gen_xmlCatalogPtr(n_catal, 0);
5610 type = gen_const_xmlChar_ptr(n_type, 1);
5611 orig = gen_const_xmlChar_ptr(n_orig, 2);
5612 replace = gen_const_xmlChar_ptr(n_replace, 3);
5614 ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5615 desret_int(ret_val);
5617 des_xmlCatalogPtr(n_catal, catal, 0);
5618 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5619 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5620 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5621 xmlResetLastError();
5622 if (mem_base != xmlMemBlocks()) {
5623 printf("Leak of %d blocks found in xmlACatalogAdd",
5624 xmlMemBlocks() - mem_base);
5626 printf(" %d", n_catal);
5627 printf(" %d", n_type);
5628 printf(" %d", n_orig);
5629 printf(" %d", n_replace);
5644 test_xmlACatalogDump(void) {
5647 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5649 xmlCatalogPtr catal; /* a Catalog */
5651 FILE * out; /* the file. */
5654 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5655 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5656 mem_base = xmlMemBlocks();
5657 catal = gen_xmlCatalogPtr(n_catal, 0);
5658 out = gen_FILE_ptr(n_out, 1);
5660 xmlACatalogDump(catal, out);
5662 des_xmlCatalogPtr(n_catal, catal, 0);
5663 des_FILE_ptr(n_out, out, 1);
5664 xmlResetLastError();
5665 if (mem_base != xmlMemBlocks()) {
5666 printf("Leak of %d blocks found in xmlACatalogDump",
5667 xmlMemBlocks() - mem_base);
5669 printf(" %d", n_catal);
5670 printf(" %d", n_out);
5683 test_xmlACatalogRemove(void) {
5686 #if defined(LIBXML_CATALOG_ENABLED)
5689 xmlCatalogPtr catal; /* a Catalog */
5691 xmlChar * value; /* the value to remove */
5694 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5695 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5696 mem_base = xmlMemBlocks();
5697 catal = gen_xmlCatalogPtr(n_catal, 0);
5698 value = gen_const_xmlChar_ptr(n_value, 1);
5700 ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5701 desret_int(ret_val);
5703 des_xmlCatalogPtr(n_catal, catal, 0);
5704 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5705 xmlResetLastError();
5706 if (mem_base != xmlMemBlocks()) {
5707 printf("Leak of %d blocks found in xmlACatalogRemove",
5708 xmlMemBlocks() - mem_base);
5710 printf(" %d", n_catal);
5711 printf(" %d", n_value);
5724 test_xmlACatalogResolve(void) {
5727 #if defined(LIBXML_CATALOG_ENABLED)
5730 xmlCatalogPtr catal; /* a Catalog */
5732 xmlChar * pubID; /* the public ID string */
5734 xmlChar * sysID; /* the system ID string */
5737 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5738 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5739 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5740 mem_base = xmlMemBlocks();
5741 catal = gen_xmlCatalogPtr(n_catal, 0);
5742 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5743 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5745 ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5746 desret_xmlChar_ptr(ret_val);
5748 des_xmlCatalogPtr(n_catal, catal, 0);
5749 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5750 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5751 xmlResetLastError();
5752 if (mem_base != xmlMemBlocks()) {
5753 printf("Leak of %d blocks found in xmlACatalogResolve",
5754 xmlMemBlocks() - mem_base);
5756 printf(" %d", n_catal);
5757 printf(" %d", n_pubID);
5758 printf(" %d", n_sysID);
5772 test_xmlACatalogResolvePublic(void) {
5775 #if defined(LIBXML_CATALOG_ENABLED)
5778 xmlCatalogPtr catal; /* a Catalog */
5780 xmlChar * pubID; /* the public ID string */
5783 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5784 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5785 mem_base = xmlMemBlocks();
5786 catal = gen_xmlCatalogPtr(n_catal, 0);
5787 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5789 ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5790 desret_xmlChar_ptr(ret_val);
5792 des_xmlCatalogPtr(n_catal, catal, 0);
5793 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5794 xmlResetLastError();
5795 if (mem_base != xmlMemBlocks()) {
5796 printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5797 xmlMemBlocks() - mem_base);
5799 printf(" %d", n_catal);
5800 printf(" %d", n_pubID);
5813 test_xmlACatalogResolveSystem(void) {
5816 #if defined(LIBXML_CATALOG_ENABLED)
5819 xmlCatalogPtr catal; /* a Catalog */
5821 xmlChar * sysID; /* the system ID string */
5824 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5825 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5826 mem_base = xmlMemBlocks();
5827 catal = gen_xmlCatalogPtr(n_catal, 0);
5828 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5830 ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5831 desret_xmlChar_ptr(ret_val);
5833 des_xmlCatalogPtr(n_catal, catal, 0);
5834 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5835 xmlResetLastError();
5836 if (mem_base != xmlMemBlocks()) {
5837 printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5838 xmlMemBlocks() - mem_base);
5840 printf(" %d", n_catal);
5841 printf(" %d", n_sysID);
5854 test_xmlACatalogResolveURI(void) {
5857 #if defined(LIBXML_CATALOG_ENABLED)
5860 xmlCatalogPtr catal; /* a Catalog */
5862 xmlChar * URI; /* the URI */
5865 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5866 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5867 mem_base = xmlMemBlocks();
5868 catal = gen_xmlCatalogPtr(n_catal, 0);
5869 URI = gen_const_xmlChar_ptr(n_URI, 1);
5871 ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5872 desret_xmlChar_ptr(ret_val);
5874 des_xmlCatalogPtr(n_catal, catal, 0);
5875 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5876 xmlResetLastError();
5877 if (mem_base != xmlMemBlocks()) {
5878 printf("Leak of %d blocks found in xmlACatalogResolveURI",
5879 xmlMemBlocks() - mem_base);
5881 printf(" %d", n_catal);
5882 printf(" %d", n_URI);
5895 test_xmlCatalogAdd(void) {
5898 #if defined(LIBXML_CATALOG_ENABLED)
5901 xmlChar * type; /* the type of record to add to the catalog */
5903 xmlChar * orig; /* the system, public or prefix to match */
5905 xmlChar * replace; /* the replacement value for the match */
5908 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5909 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5910 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5911 mem_base = xmlMemBlocks();
5912 type = gen_const_xmlChar_ptr(n_type, 0);
5913 orig = gen_const_xmlChar_ptr(n_orig, 1);
5914 replace = gen_const_xmlChar_ptr(n_replace, 2);
5916 ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5917 desret_int(ret_val);
5919 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5920 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5921 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5922 xmlResetLastError();
5923 if (mem_base != xmlMemBlocks()) {
5924 printf("Leak of %d blocks found in xmlCatalogAdd",
5925 xmlMemBlocks() - mem_base);
5927 printf(" %d", n_type);
5928 printf(" %d", n_orig);
5929 printf(" %d", n_replace);
5943 test_xmlCatalogCleanup(void) {
5946 #if defined(LIBXML_CATALOG_ENABLED)
5949 xmlCatalogCleanup();
5951 xmlResetLastError();
5960 test_xmlCatalogConvert(void) {
5963 #if defined(LIBXML_CATALOG_ENABLED)
5967 ret_val = xmlCatalogConvert();
5968 desret_int(ret_val);
5970 xmlResetLastError();
5979 test_xmlCatalogDump(void) {
5982 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5984 FILE * out; /* the file. */
5987 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5988 mem_base = xmlMemBlocks();
5989 out = gen_FILE_ptr(n_out, 0);
5991 xmlCatalogDump(out);
5993 des_FILE_ptr(n_out, out, 0);
5994 xmlResetLastError();
5995 if (mem_base != xmlMemBlocks()) {
5996 printf("Leak of %d blocks found in xmlCatalogDump",
5997 xmlMemBlocks() - mem_base);
5999 printf(" %d", n_out);
6011 test_xmlCatalogGetDefaults(void) {
6014 #if defined(LIBXML_CATALOG_ENABLED)
6016 xmlCatalogAllow ret_val;
6018 mem_base = xmlMemBlocks();
6020 ret_val = xmlCatalogGetDefaults();
6021 desret_xmlCatalogAllow(ret_val);
6023 xmlResetLastError();
6024 if (mem_base != xmlMemBlocks()) {
6025 printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6026 xmlMemBlocks() - mem_base);
6038 test_xmlCatalogIsEmpty(void) {
6041 #if defined(LIBXML_CATALOG_ENABLED)
6044 xmlCatalogPtr catal; /* should this create an SGML catalog */
6047 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6048 mem_base = xmlMemBlocks();
6049 catal = gen_xmlCatalogPtr(n_catal, 0);
6051 ret_val = xmlCatalogIsEmpty(catal);
6052 desret_int(ret_val);
6054 des_xmlCatalogPtr(n_catal, catal, 0);
6055 xmlResetLastError();
6056 if (mem_base != xmlMemBlocks()) {
6057 printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6058 xmlMemBlocks() - mem_base);
6060 printf(" %d", n_catal);
6072 test_xmlCatalogLocalResolve(void) {
6075 #if defined(LIBXML_CATALOG_ENABLED)
6078 void * catalogs; /* a document's list of catalogs */
6080 xmlChar * pubID; /* the public ID string */
6082 xmlChar * sysID; /* the system ID string */
6085 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6086 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6087 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6088 mem_base = xmlMemBlocks();
6089 catalogs = gen_void_ptr(n_catalogs, 0);
6090 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6091 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6093 ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6094 desret_xmlChar_ptr(ret_val);
6096 des_void_ptr(n_catalogs, catalogs, 0);
6097 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6098 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6099 xmlResetLastError();
6100 if (mem_base != xmlMemBlocks()) {
6101 printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6102 xmlMemBlocks() - mem_base);
6104 printf(" %d", n_catalogs);
6105 printf(" %d", n_pubID);
6106 printf(" %d", n_sysID);
6120 test_xmlCatalogLocalResolveURI(void) {
6123 #if defined(LIBXML_CATALOG_ENABLED)
6126 void * catalogs; /* a document's list of catalogs */
6128 xmlChar * URI; /* the URI */
6131 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6132 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6133 mem_base = xmlMemBlocks();
6134 catalogs = gen_void_ptr(n_catalogs, 0);
6135 URI = gen_const_xmlChar_ptr(n_URI, 1);
6137 ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6138 desret_xmlChar_ptr(ret_val);
6140 des_void_ptr(n_catalogs, catalogs, 0);
6141 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6142 xmlResetLastError();
6143 if (mem_base != xmlMemBlocks()) {
6144 printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6145 xmlMemBlocks() - mem_base);
6147 printf(" %d", n_catalogs);
6148 printf(" %d", n_URI);
6161 test_xmlCatalogRemove(void) {
6164 #if defined(LIBXML_CATALOG_ENABLED)
6166 xmlChar * value; /* the value to remove */
6169 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6170 value = gen_const_xmlChar_ptr(n_value, 0);
6172 ret_val = xmlCatalogRemove((const xmlChar *)value);
6173 desret_int(ret_val);
6175 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6176 xmlResetLastError();
6186 test_xmlCatalogResolve(void) {
6189 #if defined(LIBXML_CATALOG_ENABLED)
6191 xmlChar * pubID; /* the public ID string */
6193 xmlChar * sysID; /* the system ID string */
6196 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6197 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6198 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6199 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6201 ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6202 desret_xmlChar_ptr(ret_val);
6204 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6205 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6206 xmlResetLastError();
6217 test_xmlCatalogResolvePublic(void) {
6220 #if defined(LIBXML_CATALOG_ENABLED)
6223 xmlChar * pubID; /* the public ID string */
6226 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6227 mem_base = xmlMemBlocks();
6228 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6230 ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6231 desret_xmlChar_ptr(ret_val);
6233 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6234 xmlResetLastError();
6235 if (mem_base != xmlMemBlocks()) {
6236 printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6237 xmlMemBlocks() - mem_base);
6239 printf(" %d", n_pubID);
6251 test_xmlCatalogResolveSystem(void) {
6254 #if defined(LIBXML_CATALOG_ENABLED)
6257 xmlChar * sysID; /* the system ID string */
6260 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6261 mem_base = xmlMemBlocks();
6262 sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6264 ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6265 desret_xmlChar_ptr(ret_val);
6267 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6268 xmlResetLastError();
6269 if (mem_base != xmlMemBlocks()) {
6270 printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6271 xmlMemBlocks() - mem_base);
6273 printf(" %d", n_sysID);
6285 test_xmlCatalogResolveURI(void) {
6288 #if defined(LIBXML_CATALOG_ENABLED)
6291 xmlChar * URI; /* the URI */
6294 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6295 mem_base = xmlMemBlocks();
6296 URI = gen_const_xmlChar_ptr(n_URI, 0);
6298 ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6299 desret_xmlChar_ptr(ret_val);
6301 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6302 xmlResetLastError();
6303 if (mem_base != xmlMemBlocks()) {
6304 printf("Leak of %d blocks found in xmlCatalogResolveURI",
6305 xmlMemBlocks() - mem_base);
6307 printf(" %d", n_URI);
6319 test_xmlCatalogSetDefaultPrefer(void) {
6322 #if defined(LIBXML_CATALOG_ENABLED)
6324 xmlCatalogPrefer ret_val;
6325 xmlCatalogPrefer prefer; /* the default preference for delegation */
6328 for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6329 mem_base = xmlMemBlocks();
6330 prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6332 ret_val = xmlCatalogSetDefaultPrefer(prefer);
6333 desret_xmlCatalogPrefer(ret_val);
6335 des_xmlCatalogPrefer(n_prefer, prefer, 0);
6336 xmlResetLastError();
6337 if (mem_base != xmlMemBlocks()) {
6338 printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6339 xmlMemBlocks() - mem_base);
6341 printf(" %d", n_prefer);
6353 test_xmlCatalogSetDefaults(void) {
6356 #if defined(LIBXML_CATALOG_ENABLED)
6358 xmlCatalogAllow allow; /* what catalogs should be accepted */
6361 for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6362 mem_base = xmlMemBlocks();
6363 allow = gen_xmlCatalogAllow(n_allow, 0);
6365 xmlCatalogSetDefaults(allow);
6367 des_xmlCatalogAllow(n_allow, allow, 0);
6368 xmlResetLastError();
6369 if (mem_base != xmlMemBlocks()) {
6370 printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6371 xmlMemBlocks() - mem_base);
6373 printf(" %d", n_allow);
6385 test_xmlConvertSGMLCatalog(void) {
6388 #if defined(LIBXML_CATALOG_ENABLED)
6391 xmlCatalogPtr catal; /* the catalog */
6394 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6395 mem_base = xmlMemBlocks();
6396 catal = gen_xmlCatalogPtr(n_catal, 0);
6398 ret_val = xmlConvertSGMLCatalog(catal);
6399 desret_int(ret_val);
6401 des_xmlCatalogPtr(n_catal, catal, 0);
6402 xmlResetLastError();
6403 if (mem_base != xmlMemBlocks()) {
6404 printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6405 xmlMemBlocks() - mem_base);
6407 printf(" %d", n_catal);
6419 test_xmlInitializeCatalog(void) {
6422 #if defined(LIBXML_CATALOG_ENABLED)
6425 mem_base = xmlMemBlocks();
6427 xmlInitializeCatalog();
6429 xmlResetLastError();
6430 if (mem_base != xmlMemBlocks()) {
6431 printf("Leak of %d blocks found in xmlInitializeCatalog",
6432 xmlMemBlocks() - mem_base);
6444 test_xmlLoadACatalog(void) {
6448 /* missing type support */
6454 test_xmlLoadCatalog(void) {
6457 #if defined(LIBXML_CATALOG_ENABLED)
6459 const char * filename; /* a file path */
6462 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6463 filename = gen_filepath(n_filename, 0);
6465 ret_val = xmlLoadCatalog(filename);
6466 desret_int(ret_val);
6468 des_filepath(n_filename, filename, 0);
6469 xmlResetLastError();
6479 test_xmlLoadCatalogs(void) {
6482 #if defined(LIBXML_CATALOG_ENABLED)
6483 char * pathss; /* a list of directories separated by a colon or a space. */
6486 for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6487 pathss = gen_const_char_ptr(n_pathss, 0);
6489 xmlLoadCatalogs((const char *)pathss);
6491 des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6492 xmlResetLastError();
6502 test_xmlLoadSGMLSuperCatalog(void) {
6506 /* missing type support */
6512 test_xmlNewCatalog(void) {
6516 /* missing type support */
6522 test_xmlParseCatalogFile(void) {
6525 #if defined(LIBXML_CATALOG_ENABLED)
6528 const char * filename; /* the filename */
6531 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6532 mem_base = xmlMemBlocks();
6533 filename = gen_filepath(n_filename, 0);
6535 ret_val = xmlParseCatalogFile(filename);
6536 desret_xmlDocPtr(ret_val);
6538 des_filepath(n_filename, filename, 0);
6539 xmlResetLastError();
6540 if (mem_base != xmlMemBlocks()) {
6541 printf("Leak of %d blocks found in xmlParseCatalogFile",
6542 xmlMemBlocks() - mem_base);
6544 printf(" %d", n_filename);
6555 test_catalog(void) {
6558 if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6559 test_ret += test_xmlACatalogAdd();
6560 test_ret += test_xmlACatalogDump();
6561 test_ret += test_xmlACatalogRemove();
6562 test_ret += test_xmlACatalogResolve();
6563 test_ret += test_xmlACatalogResolvePublic();
6564 test_ret += test_xmlACatalogResolveSystem();
6565 test_ret += test_xmlACatalogResolveURI();
6566 test_ret += test_xmlCatalogAdd();
6567 test_ret += test_xmlCatalogCleanup();
6568 test_ret += test_xmlCatalogConvert();
6569 test_ret += test_xmlCatalogDump();
6570 test_ret += test_xmlCatalogGetDefaults();
6571 test_ret += test_xmlCatalogIsEmpty();
6572 test_ret += test_xmlCatalogLocalResolve();
6573 test_ret += test_xmlCatalogLocalResolveURI();
6574 test_ret += test_xmlCatalogRemove();
6575 test_ret += test_xmlCatalogResolve();
6576 test_ret += test_xmlCatalogResolvePublic();
6577 test_ret += test_xmlCatalogResolveSystem();
6578 test_ret += test_xmlCatalogResolveURI();
6579 test_ret += test_xmlCatalogSetDefaultPrefer();
6580 test_ret += test_xmlCatalogSetDefaults();
6581 test_ret += test_xmlConvertSGMLCatalog();
6582 test_ret += test_xmlInitializeCatalog();
6583 test_ret += test_xmlLoadACatalog();
6584 test_ret += test_xmlLoadCatalog();
6585 test_ret += test_xmlLoadCatalogs();
6586 test_ret += test_xmlLoadSGMLSuperCatalog();
6587 test_ret += test_xmlNewCatalog();
6588 test_ret += test_xmlParseCatalogFile();
6591 printf("Module catalog: %d errors\n", test_ret);
6595 #define gen_nb_const_xmlChRangeGroup_ptr 1
6596 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6599 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6603 test_xmlCharInRange(void) {
6608 unsigned int val; /* character to be validated */
6610 xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6613 for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6614 for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6615 mem_base = xmlMemBlocks();
6616 val = gen_unsigned_int(n_val, 0);
6617 rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6619 ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6620 desret_int(ret_val);
6622 des_unsigned_int(n_val, val, 0);
6623 des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6624 xmlResetLastError();
6625 if (mem_base != xmlMemBlocks()) {
6626 printf("Leak of %d blocks found in xmlCharInRange",
6627 xmlMemBlocks() - mem_base);
6629 printf(" %d", n_val);
6630 printf(" %d", n_rptr);
6642 test_xmlIsBaseChar(void) {
6647 unsigned int ch; /* character to validate */
6650 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6651 mem_base = xmlMemBlocks();
6652 ch = gen_unsigned_int(n_ch, 0);
6654 ret_val = xmlIsBaseChar(ch);
6655 desret_int(ret_val);
6657 des_unsigned_int(n_ch, ch, 0);
6658 xmlResetLastError();
6659 if (mem_base != xmlMemBlocks()) {
6660 printf("Leak of %d blocks found in xmlIsBaseChar",
6661 xmlMemBlocks() - mem_base);
6663 printf(" %d", n_ch);
6674 test_xmlIsBlank(void) {
6679 unsigned int ch; /* character to validate */
6682 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6683 mem_base = xmlMemBlocks();
6684 ch = gen_unsigned_int(n_ch, 0);
6686 ret_val = xmlIsBlank(ch);
6687 desret_int(ret_val);
6689 des_unsigned_int(n_ch, ch, 0);
6690 xmlResetLastError();
6691 if (mem_base != xmlMemBlocks()) {
6692 printf("Leak of %d blocks found in xmlIsBlank",
6693 xmlMemBlocks() - mem_base);
6695 printf(" %d", n_ch);
6706 test_xmlIsChar(void) {
6711 unsigned int ch; /* character to validate */
6714 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6715 mem_base = xmlMemBlocks();
6716 ch = gen_unsigned_int(n_ch, 0);
6718 ret_val = xmlIsChar(ch);
6719 desret_int(ret_val);
6721 des_unsigned_int(n_ch, ch, 0);
6722 xmlResetLastError();
6723 if (mem_base != xmlMemBlocks()) {
6724 printf("Leak of %d blocks found in xmlIsChar",
6725 xmlMemBlocks() - mem_base);
6727 printf(" %d", n_ch);
6738 test_xmlIsCombining(void) {
6743 unsigned int ch; /* character to validate */
6746 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6747 mem_base = xmlMemBlocks();
6748 ch = gen_unsigned_int(n_ch, 0);
6750 ret_val = xmlIsCombining(ch);
6751 desret_int(ret_val);
6753 des_unsigned_int(n_ch, ch, 0);
6754 xmlResetLastError();
6755 if (mem_base != xmlMemBlocks()) {
6756 printf("Leak of %d blocks found in xmlIsCombining",
6757 xmlMemBlocks() - mem_base);
6759 printf(" %d", n_ch);
6770 test_xmlIsDigit(void) {
6775 unsigned int ch; /* character to validate */
6778 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6779 mem_base = xmlMemBlocks();
6780 ch = gen_unsigned_int(n_ch, 0);
6782 ret_val = xmlIsDigit(ch);
6783 desret_int(ret_val);
6785 des_unsigned_int(n_ch, ch, 0);
6786 xmlResetLastError();
6787 if (mem_base != xmlMemBlocks()) {
6788 printf("Leak of %d blocks found in xmlIsDigit",
6789 xmlMemBlocks() - mem_base);
6791 printf(" %d", n_ch);
6802 test_xmlIsExtender(void) {
6807 unsigned int ch; /* character to validate */
6810 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6811 mem_base = xmlMemBlocks();
6812 ch = gen_unsigned_int(n_ch, 0);
6814 ret_val = xmlIsExtender(ch);
6815 desret_int(ret_val);
6817 des_unsigned_int(n_ch, ch, 0);
6818 xmlResetLastError();
6819 if (mem_base != xmlMemBlocks()) {
6820 printf("Leak of %d blocks found in xmlIsExtender",
6821 xmlMemBlocks() - mem_base);
6823 printf(" %d", n_ch);
6834 test_xmlIsIdeographic(void) {
6839 unsigned int ch; /* character to validate */
6842 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6843 mem_base = xmlMemBlocks();
6844 ch = gen_unsigned_int(n_ch, 0);
6846 ret_val = xmlIsIdeographic(ch);
6847 desret_int(ret_val);
6849 des_unsigned_int(n_ch, ch, 0);
6850 xmlResetLastError();
6851 if (mem_base != xmlMemBlocks()) {
6852 printf("Leak of %d blocks found in xmlIsIdeographic",
6853 xmlMemBlocks() - mem_base);
6855 printf(" %d", n_ch);
6866 test_xmlIsPubidChar(void) {
6871 unsigned int ch; /* character to validate */
6874 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6875 mem_base = xmlMemBlocks();
6876 ch = gen_unsigned_int(n_ch, 0);
6878 ret_val = xmlIsPubidChar(ch);
6879 desret_int(ret_val);
6881 des_unsigned_int(n_ch, ch, 0);
6882 xmlResetLastError();
6883 if (mem_base != xmlMemBlocks()) {
6884 printf("Leak of %d blocks found in xmlIsPubidChar",
6885 xmlMemBlocks() - mem_base);
6887 printf(" %d", n_ch);
6897 test_chvalid(void) {
6900 if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6901 test_ret += test_xmlCharInRange();
6902 test_ret += test_xmlIsBaseChar();
6903 test_ret += test_xmlIsBlank();
6904 test_ret += test_xmlIsChar();
6905 test_ret += test_xmlIsCombining();
6906 test_ret += test_xmlIsDigit();
6907 test_ret += test_xmlIsExtender();
6908 test_ret += test_xmlIsIdeographic();
6909 test_ret += test_xmlIsPubidChar();
6912 printf("Module chvalid: %d errors\n", test_ret);
6917 test_xmlBoolToText(void) {
6920 #if defined(LIBXML_DEBUG_ENABLED)
6922 const char * ret_val;
6923 int boolval; /* a bool to turn into text */
6926 for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6927 mem_base = xmlMemBlocks();
6928 boolval = gen_int(n_boolval, 0);
6930 ret_val = xmlBoolToText(boolval);
6931 desret_const_char_ptr(ret_val);
6933 des_int(n_boolval, boolval, 0);
6934 xmlResetLastError();
6935 if (mem_base != xmlMemBlocks()) {
6936 printf("Leak of %d blocks found in xmlBoolToText",
6937 xmlMemBlocks() - mem_base);
6939 printf(" %d", n_boolval);
6951 test_xmlDebugCheckDocument(void) {
6954 #if defined(LIBXML_DEBUG_ENABLED)
6957 FILE * output; /* the FILE * for the output */
6959 xmlDocPtr doc; /* the document */
6962 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6963 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6964 mem_base = xmlMemBlocks();
6965 output = gen_debug_FILE_ptr(n_output, 0);
6966 doc = gen_xmlDocPtr(n_doc, 1);
6968 ret_val = xmlDebugCheckDocument(output, doc);
6969 desret_int(ret_val);
6971 des_debug_FILE_ptr(n_output, output, 0);
6972 des_xmlDocPtr(n_doc, doc, 1);
6973 xmlResetLastError();
6974 if (mem_base != xmlMemBlocks()) {
6975 printf("Leak of %d blocks found in xmlDebugCheckDocument",
6976 xmlMemBlocks() - mem_base);
6978 printf(" %d", n_output);
6979 printf(" %d", n_doc);
6992 test_xmlDebugDumpAttr(void) {
6995 #if defined(LIBXML_DEBUG_ENABLED)
6997 FILE * output; /* the FILE * for the output */
6999 xmlAttrPtr attr; /* the attribute */
7001 int depth; /* the indentation level. */
7004 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7005 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7006 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7007 mem_base = xmlMemBlocks();
7008 output = gen_debug_FILE_ptr(n_output, 0);
7009 attr = gen_xmlAttrPtr(n_attr, 1);
7010 depth = gen_int(n_depth, 2);
7012 xmlDebugDumpAttr(output, attr, depth);
7014 des_debug_FILE_ptr(n_output, output, 0);
7015 des_xmlAttrPtr(n_attr, attr, 1);
7016 des_int(n_depth, depth, 2);
7017 xmlResetLastError();
7018 if (mem_base != xmlMemBlocks()) {
7019 printf("Leak of %d blocks found in xmlDebugDumpAttr",
7020 xmlMemBlocks() - mem_base);
7022 printf(" %d", n_output);
7023 printf(" %d", n_attr);
7024 printf(" %d", n_depth);
7038 test_xmlDebugDumpAttrList(void) {
7041 #if defined(LIBXML_DEBUG_ENABLED)
7043 FILE * output; /* the FILE * for the output */
7045 xmlAttrPtr attr; /* the attribute list */
7047 int depth; /* the indentation level. */
7050 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7051 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7052 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7053 mem_base = xmlMemBlocks();
7054 output = gen_debug_FILE_ptr(n_output, 0);
7055 attr = gen_xmlAttrPtr(n_attr, 1);
7056 depth = gen_int(n_depth, 2);
7058 xmlDebugDumpAttrList(output, attr, depth);
7060 des_debug_FILE_ptr(n_output, output, 0);
7061 des_xmlAttrPtr(n_attr, attr, 1);
7062 des_int(n_depth, depth, 2);
7063 xmlResetLastError();
7064 if (mem_base != xmlMemBlocks()) {
7065 printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7066 xmlMemBlocks() - mem_base);
7068 printf(" %d", n_output);
7069 printf(" %d", n_attr);
7070 printf(" %d", n_depth);
7084 test_xmlDebugDumpDTD(void) {
7087 #if defined(LIBXML_DEBUG_ENABLED)
7089 FILE * output; /* the FILE * for the output */
7091 xmlDtdPtr dtd; /* the DTD */
7094 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7095 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7096 mem_base = xmlMemBlocks();
7097 output = gen_debug_FILE_ptr(n_output, 0);
7098 dtd = gen_xmlDtdPtr(n_dtd, 1);
7100 xmlDebugDumpDTD(output, dtd);
7102 des_debug_FILE_ptr(n_output, output, 0);
7103 des_xmlDtdPtr(n_dtd, dtd, 1);
7104 xmlResetLastError();
7105 if (mem_base != xmlMemBlocks()) {
7106 printf("Leak of %d blocks found in xmlDebugDumpDTD",
7107 xmlMemBlocks() - mem_base);
7109 printf(" %d", n_output);
7110 printf(" %d", n_dtd);
7123 test_xmlDebugDumpDocument(void) {
7126 #if defined(LIBXML_DEBUG_ENABLED)
7128 FILE * output; /* the FILE * for the output */
7130 xmlDocPtr doc; /* the document */
7133 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7134 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7135 mem_base = xmlMemBlocks();
7136 output = gen_debug_FILE_ptr(n_output, 0);
7137 doc = gen_xmlDocPtr(n_doc, 1);
7139 xmlDebugDumpDocument(output, doc);
7141 des_debug_FILE_ptr(n_output, output, 0);
7142 des_xmlDocPtr(n_doc, doc, 1);
7143 xmlResetLastError();
7144 if (mem_base != xmlMemBlocks()) {
7145 printf("Leak of %d blocks found in xmlDebugDumpDocument",
7146 xmlMemBlocks() - mem_base);
7148 printf(" %d", n_output);
7149 printf(" %d", n_doc);
7162 test_xmlDebugDumpDocumentHead(void) {
7165 #if defined(LIBXML_DEBUG_ENABLED)
7167 FILE * output; /* the FILE * for the output */
7169 xmlDocPtr doc; /* the document */
7172 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7173 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7174 mem_base = xmlMemBlocks();
7175 output = gen_debug_FILE_ptr(n_output, 0);
7176 doc = gen_xmlDocPtr(n_doc, 1);
7178 xmlDebugDumpDocumentHead(output, doc);
7180 des_debug_FILE_ptr(n_output, output, 0);
7181 des_xmlDocPtr(n_doc, doc, 1);
7182 xmlResetLastError();
7183 if (mem_base != xmlMemBlocks()) {
7184 printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7185 xmlMemBlocks() - mem_base);
7187 printf(" %d", n_output);
7188 printf(" %d", n_doc);
7201 test_xmlDebugDumpEntities(void) {
7204 #if defined(LIBXML_DEBUG_ENABLED)
7206 FILE * output; /* the FILE * for the output */
7208 xmlDocPtr doc; /* the document */
7211 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7212 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7213 mem_base = xmlMemBlocks();
7214 output = gen_debug_FILE_ptr(n_output, 0);
7215 doc = gen_xmlDocPtr(n_doc, 1);
7217 xmlDebugDumpEntities(output, doc);
7219 des_debug_FILE_ptr(n_output, output, 0);
7220 des_xmlDocPtr(n_doc, doc, 1);
7221 xmlResetLastError();
7222 if (mem_base != xmlMemBlocks()) {
7223 printf("Leak of %d blocks found in xmlDebugDumpEntities",
7224 xmlMemBlocks() - mem_base);
7226 printf(" %d", n_output);
7227 printf(" %d", n_doc);
7240 test_xmlDebugDumpNode(void) {
7243 #if defined(LIBXML_DEBUG_ENABLED)
7245 FILE * output; /* the FILE * for the output */
7247 xmlNodePtr node; /* the node */
7249 int depth; /* the indentation level. */
7252 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7253 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7254 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7255 mem_base = xmlMemBlocks();
7256 output = gen_debug_FILE_ptr(n_output, 0);
7257 node = gen_xmlNodePtr(n_node, 1);
7258 depth = gen_int(n_depth, 2);
7260 xmlDebugDumpNode(output, node, depth);
7262 des_debug_FILE_ptr(n_output, output, 0);
7263 des_xmlNodePtr(n_node, node, 1);
7264 des_int(n_depth, depth, 2);
7265 xmlResetLastError();
7266 if (mem_base != xmlMemBlocks()) {
7267 printf("Leak of %d blocks found in xmlDebugDumpNode",
7268 xmlMemBlocks() - mem_base);
7270 printf(" %d", n_output);
7271 printf(" %d", n_node);
7272 printf(" %d", n_depth);
7286 test_xmlDebugDumpNodeList(void) {
7289 #if defined(LIBXML_DEBUG_ENABLED)
7291 FILE * output; /* the FILE * for the output */
7293 xmlNodePtr node; /* the node list */
7295 int depth; /* the indentation level. */
7298 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7299 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7300 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7301 mem_base = xmlMemBlocks();
7302 output = gen_debug_FILE_ptr(n_output, 0);
7303 node = gen_xmlNodePtr(n_node, 1);
7304 depth = gen_int(n_depth, 2);
7306 xmlDebugDumpNodeList(output, node, depth);
7308 des_debug_FILE_ptr(n_output, output, 0);
7309 des_xmlNodePtr(n_node, node, 1);
7310 des_int(n_depth, depth, 2);
7311 xmlResetLastError();
7312 if (mem_base != xmlMemBlocks()) {
7313 printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7314 xmlMemBlocks() - mem_base);
7316 printf(" %d", n_output);
7317 printf(" %d", n_node);
7318 printf(" %d", n_depth);
7332 test_xmlDebugDumpOneNode(void) {
7335 #if defined(LIBXML_DEBUG_ENABLED)
7337 FILE * output; /* the FILE * for the output */
7339 xmlNodePtr node; /* the node */
7341 int depth; /* the indentation level. */
7344 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7345 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7346 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7347 mem_base = xmlMemBlocks();
7348 output = gen_debug_FILE_ptr(n_output, 0);
7349 node = gen_xmlNodePtr(n_node, 1);
7350 depth = gen_int(n_depth, 2);
7352 xmlDebugDumpOneNode(output, node, depth);
7354 des_debug_FILE_ptr(n_output, output, 0);
7355 des_xmlNodePtr(n_node, node, 1);
7356 des_int(n_depth, depth, 2);
7357 xmlResetLastError();
7358 if (mem_base != xmlMemBlocks()) {
7359 printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7360 xmlMemBlocks() - mem_base);
7362 printf(" %d", n_output);
7363 printf(" %d", n_node);
7364 printf(" %d", n_depth);
7378 test_xmlDebugDumpString(void) {
7381 #if defined(LIBXML_DEBUG_ENABLED)
7383 FILE * output; /* the FILE * for the output */
7385 xmlChar * str; /* the string */
7388 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7389 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7390 mem_base = xmlMemBlocks();
7391 output = gen_debug_FILE_ptr(n_output, 0);
7392 str = gen_const_xmlChar_ptr(n_str, 1);
7394 xmlDebugDumpString(output, (const xmlChar *)str);
7396 des_debug_FILE_ptr(n_output, output, 0);
7397 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7398 xmlResetLastError();
7399 if (mem_base != xmlMemBlocks()) {
7400 printf("Leak of %d blocks found in xmlDebugDumpString",
7401 xmlMemBlocks() - mem_base);
7403 printf(" %d", n_output);
7404 printf(" %d", n_str);
7417 test_xmlLsCountNode(void) {
7420 #if defined(LIBXML_DEBUG_ENABLED)
7423 xmlNodePtr node; /* the node to count */
7426 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7427 mem_base = xmlMemBlocks();
7428 node = gen_xmlNodePtr(n_node, 0);
7430 ret_val = xmlLsCountNode(node);
7431 desret_int(ret_val);
7433 des_xmlNodePtr(n_node, node, 0);
7434 xmlResetLastError();
7435 if (mem_base != xmlMemBlocks()) {
7436 printf("Leak of %d blocks found in xmlLsCountNode",
7437 xmlMemBlocks() - mem_base);
7439 printf(" %d", n_node);
7451 test_xmlLsOneNode(void) {
7454 #if defined(LIBXML_DEBUG_ENABLED)
7456 FILE * output; /* the FILE * for the output */
7458 xmlNodePtr node; /* the node to dump */
7461 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7462 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7463 mem_base = xmlMemBlocks();
7464 output = gen_debug_FILE_ptr(n_output, 0);
7465 node = gen_xmlNodePtr(n_node, 1);
7467 xmlLsOneNode(output, node);
7469 des_debug_FILE_ptr(n_output, output, 0);
7470 des_xmlNodePtr(n_node, node, 1);
7471 xmlResetLastError();
7472 if (mem_base != xmlMemBlocks()) {
7473 printf("Leak of %d blocks found in xmlLsOneNode",
7474 xmlMemBlocks() - mem_base);
7476 printf(" %d", n_output);
7477 printf(" %d", n_node);
7489 #define gen_nb_char_ptr 1
7490 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7493 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7497 test_xmlShell(void) {
7501 /* missing type support */
7507 test_xmlShellBase(void) {
7510 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7513 xmlShellCtxtPtr ctxt; /* the shell context */
7515 char * arg; /* unused */
7517 xmlNodePtr node; /* a node */
7519 xmlNodePtr node2; /* unused */
7522 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7523 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7524 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7525 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7526 mem_base = xmlMemBlocks();
7527 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7528 arg = gen_char_ptr(n_arg, 1);
7529 node = gen_xmlNodePtr(n_node, 2);
7530 node2 = gen_xmlNodePtr(n_node2, 3);
7532 ret_val = xmlShellBase(ctxt, arg, node, node2);
7533 desret_int(ret_val);
7535 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7536 des_char_ptr(n_arg, arg, 1);
7537 des_xmlNodePtr(n_node, node, 2);
7538 des_xmlNodePtr(n_node2, node2, 3);
7539 xmlResetLastError();
7540 if (mem_base != xmlMemBlocks()) {
7541 printf("Leak of %d blocks found in xmlShellBase",
7542 xmlMemBlocks() - mem_base);
7544 printf(" %d", n_ctxt);
7545 printf(" %d", n_arg);
7546 printf(" %d", n_node);
7547 printf(" %d", n_node2);
7562 test_xmlShellCat(void) {
7565 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7568 xmlShellCtxtPtr ctxt; /* the shell context */
7570 char * arg; /* unused */
7572 xmlNodePtr node; /* a node */
7574 xmlNodePtr node2; /* unused */
7577 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7578 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7579 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7580 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7581 mem_base = xmlMemBlocks();
7582 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7583 arg = gen_char_ptr(n_arg, 1);
7584 node = gen_xmlNodePtr(n_node, 2);
7585 node2 = gen_xmlNodePtr(n_node2, 3);
7587 ret_val = xmlShellCat(ctxt, arg, node, node2);
7588 desret_int(ret_val);
7590 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7591 des_char_ptr(n_arg, arg, 1);
7592 des_xmlNodePtr(n_node, node, 2);
7593 des_xmlNodePtr(n_node2, node2, 3);
7594 xmlResetLastError();
7595 if (mem_base != xmlMemBlocks()) {
7596 printf("Leak of %d blocks found in xmlShellCat",
7597 xmlMemBlocks() - mem_base);
7599 printf(" %d", n_ctxt);
7600 printf(" %d", n_arg);
7601 printf(" %d", n_node);
7602 printf(" %d", n_node2);
7617 test_xmlShellDir(void) {
7620 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7623 xmlShellCtxtPtr ctxt; /* the shell context */
7625 char * arg; /* unused */
7627 xmlNodePtr node; /* a node */
7629 xmlNodePtr node2; /* unused */
7632 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7633 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7634 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7635 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7636 mem_base = xmlMemBlocks();
7637 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7638 arg = gen_char_ptr(n_arg, 1);
7639 node = gen_xmlNodePtr(n_node, 2);
7640 node2 = gen_xmlNodePtr(n_node2, 3);
7642 ret_val = xmlShellDir(ctxt, arg, node, node2);
7643 desret_int(ret_val);
7645 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7646 des_char_ptr(n_arg, arg, 1);
7647 des_xmlNodePtr(n_node, node, 2);
7648 des_xmlNodePtr(n_node2, node2, 3);
7649 xmlResetLastError();
7650 if (mem_base != xmlMemBlocks()) {
7651 printf("Leak of %d blocks found in xmlShellDir",
7652 xmlMemBlocks() - mem_base);
7654 printf(" %d", n_ctxt);
7655 printf(" %d", n_arg);
7656 printf(" %d", n_node);
7657 printf(" %d", n_node2);
7672 test_xmlShellDu(void) {
7675 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7678 xmlShellCtxtPtr ctxt; /* the shell context */
7680 char * arg; /* unused */
7682 xmlNodePtr tree; /* a node defining a subtree */
7684 xmlNodePtr node2; /* unused */
7687 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7688 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7689 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7690 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7691 mem_base = xmlMemBlocks();
7692 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7693 arg = gen_char_ptr(n_arg, 1);
7694 tree = gen_xmlNodePtr(n_tree, 2);
7695 node2 = gen_xmlNodePtr(n_node2, 3);
7697 ret_val = xmlShellDu(ctxt, arg, tree, node2);
7698 desret_int(ret_val);
7700 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7701 des_char_ptr(n_arg, arg, 1);
7702 des_xmlNodePtr(n_tree, tree, 2);
7703 des_xmlNodePtr(n_node2, node2, 3);
7704 xmlResetLastError();
7705 if (mem_base != xmlMemBlocks()) {
7706 printf("Leak of %d blocks found in xmlShellDu",
7707 xmlMemBlocks() - mem_base);
7709 printf(" %d", n_ctxt);
7710 printf(" %d", n_arg);
7711 printf(" %d", n_tree);
7712 printf(" %d", n_node2);
7727 test_xmlShellList(void) {
7730 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7733 xmlShellCtxtPtr ctxt; /* the shell context */
7735 char * arg; /* unused */
7737 xmlNodePtr node; /* a node */
7739 xmlNodePtr node2; /* unused */
7742 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7743 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7744 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7745 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7746 mem_base = xmlMemBlocks();
7747 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7748 arg = gen_char_ptr(n_arg, 1);
7749 node = gen_xmlNodePtr(n_node, 2);
7750 node2 = gen_xmlNodePtr(n_node2, 3);
7752 ret_val = xmlShellList(ctxt, arg, node, node2);
7753 desret_int(ret_val);
7755 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7756 des_char_ptr(n_arg, arg, 1);
7757 des_xmlNodePtr(n_node, node, 2);
7758 des_xmlNodePtr(n_node2, node2, 3);
7759 xmlResetLastError();
7760 if (mem_base != xmlMemBlocks()) {
7761 printf("Leak of %d blocks found in xmlShellList",
7762 xmlMemBlocks() - mem_base);
7764 printf(" %d", n_ctxt);
7765 printf(" %d", n_arg);
7766 printf(" %d", n_node);
7767 printf(" %d", n_node2);
7782 test_xmlShellLoad(void) {
7785 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7788 xmlShellCtxtPtr ctxt; /* the shell context */
7790 char * filename; /* the file name */
7792 xmlNodePtr node; /* unused */
7794 xmlNodePtr node2; /* unused */
7797 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7798 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7799 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7800 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7801 mem_base = xmlMemBlocks();
7802 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7803 filename = gen_char_ptr(n_filename, 1);
7804 node = gen_xmlNodePtr(n_node, 2);
7805 node2 = gen_xmlNodePtr(n_node2, 3);
7807 ret_val = xmlShellLoad(ctxt, filename, node, node2);
7808 desret_int(ret_val);
7810 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7811 des_char_ptr(n_filename, filename, 1);
7812 des_xmlNodePtr(n_node, node, 2);
7813 des_xmlNodePtr(n_node2, node2, 3);
7814 xmlResetLastError();
7815 if (mem_base != xmlMemBlocks()) {
7816 printf("Leak of %d blocks found in xmlShellLoad",
7817 xmlMemBlocks() - mem_base);
7819 printf(" %d", n_ctxt);
7820 printf(" %d", n_filename);
7821 printf(" %d", n_node);
7822 printf(" %d", n_node2);
7837 test_xmlShellPrintXPathResult(void) {
7840 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7842 xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7845 for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7846 mem_base = xmlMemBlocks();
7847 list = gen_xmlXPathObjectPtr(n_list, 0);
7849 xmlShellPrintXPathResult(list);
7851 des_xmlXPathObjectPtr(n_list, list, 0);
7852 xmlResetLastError();
7853 if (mem_base != xmlMemBlocks()) {
7854 printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7855 xmlMemBlocks() - mem_base);
7857 printf(" %d", n_list);
7869 test_xmlShellPwd(void) {
7872 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7875 xmlShellCtxtPtr ctxt; /* the shell context */
7877 char * buffer; /* the output buffer */
7879 xmlNodePtr node; /* a node */
7881 xmlNodePtr node2; /* unused */
7884 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7885 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7886 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7887 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7888 mem_base = xmlMemBlocks();
7889 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7890 buffer = gen_char_ptr(n_buffer, 1);
7891 node = gen_xmlNodePtr(n_node, 2);
7892 node2 = gen_xmlNodePtr(n_node2, 3);
7894 ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7895 desret_int(ret_val);
7897 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7898 des_char_ptr(n_buffer, buffer, 1);
7899 des_xmlNodePtr(n_node, node, 2);
7900 des_xmlNodePtr(n_node2, node2, 3);
7901 xmlResetLastError();
7902 if (mem_base != xmlMemBlocks()) {
7903 printf("Leak of %d blocks found in xmlShellPwd",
7904 xmlMemBlocks() - mem_base);
7906 printf(" %d", n_ctxt);
7907 printf(" %d", n_buffer);
7908 printf(" %d", n_node);
7909 printf(" %d", n_node2);
7924 test_xmlShellSave(void) {
7927 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7930 xmlShellCtxtPtr ctxt; /* the shell context */
7932 char * filename; /* the file name (optional) */
7934 xmlNodePtr node; /* unused */
7936 xmlNodePtr node2; /* unused */
7939 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7940 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7941 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7942 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7943 mem_base = xmlMemBlocks();
7944 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7945 filename = gen_char_ptr(n_filename, 1);
7946 node = gen_xmlNodePtr(n_node, 2);
7947 node2 = gen_xmlNodePtr(n_node2, 3);
7949 ret_val = xmlShellSave(ctxt, filename, node, node2);
7950 desret_int(ret_val);
7952 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7953 des_char_ptr(n_filename, filename, 1);
7954 des_xmlNodePtr(n_node, node, 2);
7955 des_xmlNodePtr(n_node2, node2, 3);
7956 xmlResetLastError();
7957 if (mem_base != xmlMemBlocks()) {
7958 printf("Leak of %d blocks found in xmlShellSave",
7959 xmlMemBlocks() - mem_base);
7961 printf(" %d", n_ctxt);
7962 printf(" %d", n_filename);
7963 printf(" %d", n_node);
7964 printf(" %d", n_node2);
7979 test_xmlShellValidate(void) {
7982 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7985 xmlShellCtxtPtr ctxt; /* the shell context */
7987 char * dtd; /* the DTD URI (optional) */
7989 xmlNodePtr node; /* unused */
7991 xmlNodePtr node2; /* unused */
7994 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7995 for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7996 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7997 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7998 mem_base = xmlMemBlocks();
7999 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8000 dtd = gen_char_ptr(n_dtd, 1);
8001 node = gen_xmlNodePtr(n_node, 2);
8002 node2 = gen_xmlNodePtr(n_node2, 3);
8004 ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8005 desret_int(ret_val);
8007 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8008 des_char_ptr(n_dtd, dtd, 1);
8009 des_xmlNodePtr(n_node, node, 2);
8010 des_xmlNodePtr(n_node2, node2, 3);
8011 xmlResetLastError();
8012 if (mem_base != xmlMemBlocks()) {
8013 printf("Leak of %d blocks found in xmlShellValidate",
8014 xmlMemBlocks() - mem_base);
8016 printf(" %d", n_ctxt);
8017 printf(" %d", n_dtd);
8018 printf(" %d", n_node);
8019 printf(" %d", n_node2);
8034 test_xmlShellWrite(void) {
8037 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8040 xmlShellCtxtPtr ctxt; /* the shell context */
8042 char * filename; /* the file name */
8044 xmlNodePtr node; /* a node in the tree */
8046 xmlNodePtr node2; /* unused */
8049 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8050 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8051 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8052 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8053 mem_base = xmlMemBlocks();
8054 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8055 filename = gen_char_ptr(n_filename, 1);
8056 node = gen_xmlNodePtr(n_node, 2);
8057 node2 = gen_xmlNodePtr(n_node2, 3);
8059 ret_val = xmlShellWrite(ctxt, filename, node, node2);
8060 desret_int(ret_val);
8062 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8063 des_char_ptr(n_filename, filename, 1);
8064 des_xmlNodePtr(n_node, node, 2);
8065 des_xmlNodePtr(n_node2, node2, 3);
8066 xmlResetLastError();
8067 if (mem_base != xmlMemBlocks()) {
8068 printf("Leak of %d blocks found in xmlShellWrite",
8069 xmlMemBlocks() - mem_base);
8071 printf(" %d", n_ctxt);
8072 printf(" %d", n_filename);
8073 printf(" %d", n_node);
8074 printf(" %d", n_node2);
8088 test_debugXML(void) {
8091 if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8092 test_ret += test_xmlBoolToText();
8093 test_ret += test_xmlDebugCheckDocument();
8094 test_ret += test_xmlDebugDumpAttr();
8095 test_ret += test_xmlDebugDumpAttrList();
8096 test_ret += test_xmlDebugDumpDTD();
8097 test_ret += test_xmlDebugDumpDocument();
8098 test_ret += test_xmlDebugDumpDocumentHead();
8099 test_ret += test_xmlDebugDumpEntities();
8100 test_ret += test_xmlDebugDumpNode();
8101 test_ret += test_xmlDebugDumpNodeList();
8102 test_ret += test_xmlDebugDumpOneNode();
8103 test_ret += test_xmlDebugDumpString();
8104 test_ret += test_xmlLsCountNode();
8105 test_ret += test_xmlLsOneNode();
8106 test_ret += test_xmlShell();
8107 test_ret += test_xmlShellBase();
8108 test_ret += test_xmlShellCat();
8109 test_ret += test_xmlShellDir();
8110 test_ret += test_xmlShellDu();
8111 test_ret += test_xmlShellList();
8112 test_ret += test_xmlShellLoad();
8113 test_ret += test_xmlShellPrintXPathResult();
8114 test_ret += test_xmlShellPwd();
8115 test_ret += test_xmlShellSave();
8116 test_ret += test_xmlShellValidate();
8117 test_ret += test_xmlShellWrite();
8120 printf("Module debugXML: %d errors\n", test_ret);
8125 test_xmlDictCleanup(void) {
8130 mem_base = xmlMemBlocks();
8134 xmlResetLastError();
8135 if (mem_base != xmlMemBlocks()) {
8136 printf("Leak of %d blocks found in xmlDictCleanup",
8137 xmlMemBlocks() - mem_base);
8148 test_xmlDictCreate(void) {
8154 mem_base = xmlMemBlocks();
8156 ret_val = xmlDictCreate();
8157 desret_xmlDictPtr(ret_val);
8159 xmlResetLastError();
8160 if (mem_base != xmlMemBlocks()) {
8161 printf("Leak of %d blocks found in xmlDictCreate",
8162 xmlMemBlocks() - mem_base);
8173 test_xmlDictCreateSub(void) {
8178 xmlDictPtr sub; /* an existing dictionnary */
8181 for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8182 mem_base = xmlMemBlocks();
8183 sub = gen_xmlDictPtr(n_sub, 0);
8185 ret_val = xmlDictCreateSub(sub);
8186 desret_xmlDictPtr(ret_val);
8188 des_xmlDictPtr(n_sub, sub, 0);
8189 xmlResetLastError();
8190 if (mem_base != xmlMemBlocks()) {
8191 printf("Leak of %d blocks found in xmlDictCreateSub",
8192 xmlMemBlocks() - mem_base);
8194 printf(" %d", n_sub);
8205 test_xmlDictExists(void) {
8209 const xmlChar * ret_val;
8210 xmlDictPtr dict; /* the dictionnary */
8212 xmlChar * name; /* the name of the userdata */
8214 int len; /* the length of the name, if -1 it is recomputed */
8217 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8218 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8219 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8220 mem_base = xmlMemBlocks();
8221 dict = gen_xmlDictPtr(n_dict, 0);
8222 name = gen_const_xmlChar_ptr(n_name, 1);
8223 len = gen_int(n_len, 2);
8225 ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8226 desret_const_xmlChar_ptr(ret_val);
8228 des_xmlDictPtr(n_dict, dict, 0);
8229 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8230 des_int(n_len, len, 2);
8231 xmlResetLastError();
8232 if (mem_base != xmlMemBlocks()) {
8233 printf("Leak of %d blocks found in xmlDictExists",
8234 xmlMemBlocks() - mem_base);
8236 printf(" %d", n_dict);
8237 printf(" %d", n_name);
8238 printf(" %d", n_len);
8251 test_xmlDictGetUsage(void) {
8255 /* missing type support */
8261 test_xmlDictLookup(void) {
8265 const xmlChar * ret_val;
8266 xmlDictPtr dict; /* the dictionnary */
8268 xmlChar * name; /* the name of the userdata */
8270 int len; /* the length of the name, if -1 it is recomputed */
8273 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8274 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8275 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8276 mem_base = xmlMemBlocks();
8277 dict = gen_xmlDictPtr(n_dict, 0);
8278 name = gen_const_xmlChar_ptr(n_name, 1);
8279 len = gen_int(n_len, 2);
8281 ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8282 desret_const_xmlChar_ptr(ret_val);
8284 des_xmlDictPtr(n_dict, dict, 0);
8285 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8286 des_int(n_len, len, 2);
8287 xmlResetLastError();
8288 if (mem_base != xmlMemBlocks()) {
8289 printf("Leak of %d blocks found in xmlDictLookup",
8290 xmlMemBlocks() - mem_base);
8292 printf(" %d", n_dict);
8293 printf(" %d", n_name);
8294 printf(" %d", n_len);
8307 test_xmlDictOwns(void) {
8312 xmlDictPtr dict; /* the dictionnary */
8314 xmlChar * str; /* the string */
8317 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8318 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8319 mem_base = xmlMemBlocks();
8320 dict = gen_xmlDictPtr(n_dict, 0);
8321 str = gen_const_xmlChar_ptr(n_str, 1);
8323 ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8324 desret_int(ret_val);
8326 des_xmlDictPtr(n_dict, dict, 0);
8327 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8328 xmlResetLastError();
8329 if (mem_base != xmlMemBlocks()) {
8330 printf("Leak of %d blocks found in xmlDictOwns",
8331 xmlMemBlocks() - mem_base);
8333 printf(" %d", n_dict);
8334 printf(" %d", n_str);
8346 test_xmlDictQLookup(void) {
8350 const xmlChar * ret_val;
8351 xmlDictPtr dict; /* the dictionnary */
8353 xmlChar * prefix; /* the prefix */
8355 xmlChar * name; /* the name */
8358 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8359 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8360 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8361 mem_base = xmlMemBlocks();
8362 dict = gen_xmlDictPtr(n_dict, 0);
8363 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8364 name = gen_const_xmlChar_ptr(n_name, 2);
8366 ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8367 desret_const_xmlChar_ptr(ret_val);
8369 des_xmlDictPtr(n_dict, dict, 0);
8370 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8371 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8372 xmlResetLastError();
8373 if (mem_base != xmlMemBlocks()) {
8374 printf("Leak of %d blocks found in xmlDictQLookup",
8375 xmlMemBlocks() - mem_base);
8377 printf(" %d", n_dict);
8378 printf(" %d", n_prefix);
8379 printf(" %d", n_name);
8392 test_xmlDictReference(void) {
8397 xmlDictPtr dict; /* the dictionnary */
8400 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8401 mem_base = xmlMemBlocks();
8402 dict = gen_xmlDictPtr(n_dict, 0);
8404 ret_val = xmlDictReference(dict);
8406 desret_int(ret_val);
8408 des_xmlDictPtr(n_dict, dict, 0);
8409 xmlResetLastError();
8410 if (mem_base != xmlMemBlocks()) {
8411 printf("Leak of %d blocks found in xmlDictReference",
8412 xmlMemBlocks() - mem_base);
8414 printf(" %d", n_dict);
8425 test_xmlDictSetLimit(void) {
8429 /* missing type support */
8435 test_xmlDictSize(void) {
8440 xmlDictPtr dict; /* the dictionnary */
8443 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8444 mem_base = xmlMemBlocks();
8445 dict = gen_xmlDictPtr(n_dict, 0);
8447 ret_val = xmlDictSize(dict);
8448 desret_int(ret_val);
8450 des_xmlDictPtr(n_dict, dict, 0);
8451 xmlResetLastError();
8452 if (mem_base != xmlMemBlocks()) {
8453 printf("Leak of %d blocks found in xmlDictSize",
8454 xmlMemBlocks() - mem_base);
8456 printf(" %d", n_dict);
8467 test_xmlInitializeDict(void) {
8473 mem_base = xmlMemBlocks();
8475 ret_val = xmlInitializeDict();
8476 desret_int(ret_val);
8478 xmlResetLastError();
8479 if (mem_base != xmlMemBlocks()) {
8480 printf("Leak of %d blocks found in xmlInitializeDict",
8481 xmlMemBlocks() - mem_base);
8494 if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8495 test_ret += test_xmlDictCleanup();
8496 test_ret += test_xmlDictCreate();
8497 test_ret += test_xmlDictCreateSub();
8498 test_ret += test_xmlDictExists();
8499 test_ret += test_xmlDictGetUsage();
8500 test_ret += test_xmlDictLookup();
8501 test_ret += test_xmlDictOwns();
8502 test_ret += test_xmlDictQLookup();
8503 test_ret += test_xmlDictReference();
8504 test_ret += test_xmlDictSetLimit();
8505 test_ret += test_xmlDictSize();
8506 test_ret += test_xmlInitializeDict();
8509 printf("Module dict: %d errors\n", test_ret);
8514 test_UTF8Toisolat1(void) {
8517 #if defined(LIBXML_OUTPUT_ENABLED)
8518 #ifdef LIBXML_OUTPUT_ENABLED
8521 unsigned char * out; /* a pointer to an array of bytes to store the result */
8523 int * outlen; /* the length of @out */
8525 unsigned char * in; /* a pointer to an array of UTF-8 chars */
8527 int * inlen; /* the length of @in */
8530 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8531 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8532 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8533 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8534 mem_base = xmlMemBlocks();
8535 out = gen_unsigned_char_ptr(n_out, 0);
8536 outlen = gen_int_ptr(n_outlen, 1);
8537 in = gen_const_unsigned_char_ptr(n_in, 2);
8538 inlen = gen_int_ptr(n_inlen, 3);
8540 ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8541 desret_int(ret_val);
8543 des_unsigned_char_ptr(n_out, out, 0);
8544 des_int_ptr(n_outlen, outlen, 1);
8545 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8546 des_int_ptr(n_inlen, inlen, 3);
8547 xmlResetLastError();
8548 if (mem_base != xmlMemBlocks()) {
8549 printf("Leak of %d blocks found in UTF8Toisolat1",
8550 xmlMemBlocks() - mem_base);
8552 printf(" %d", n_out);
8553 printf(" %d", n_outlen);
8554 printf(" %d", n_in);
8555 printf(" %d", n_inlen);
8571 test_isolat1ToUTF8(void) {
8576 unsigned char * out; /* a pointer to an array of bytes to store the result */
8578 int * outlen; /* the length of @out */
8580 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8582 int * inlen; /* the length of @in */
8585 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8586 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8587 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8588 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8589 mem_base = xmlMemBlocks();
8590 out = gen_unsigned_char_ptr(n_out, 0);
8591 outlen = gen_int_ptr(n_outlen, 1);
8592 in = gen_const_unsigned_char_ptr(n_in, 2);
8593 inlen = gen_int_ptr(n_inlen, 3);
8595 ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8596 desret_int(ret_val);
8598 des_unsigned_char_ptr(n_out, out, 0);
8599 des_int_ptr(n_outlen, outlen, 1);
8600 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8601 des_int_ptr(n_inlen, inlen, 3);
8602 xmlResetLastError();
8603 if (mem_base != xmlMemBlocks()) {
8604 printf("Leak of %d blocks found in isolat1ToUTF8",
8605 xmlMemBlocks() - mem_base);
8607 printf(" %d", n_out);
8608 printf(" %d", n_outlen);
8609 printf(" %d", n_in);
8610 printf(" %d", n_inlen);
8624 test_xmlAddEncodingAlias(void) {
8628 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8630 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8633 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8634 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8635 name = gen_const_char_ptr(n_name, 0);
8636 alias = gen_const_char_ptr(n_alias, 1);
8638 ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8639 desret_int(ret_val);
8641 des_const_char_ptr(n_name, (const char *)name, 0);
8642 des_const_char_ptr(n_alias, (const char *)alias, 1);
8643 xmlResetLastError();
8652 #define gen_nb_xmlCharEncodingHandler_ptr 1
8653 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8656 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8660 test_xmlCharEncCloseFunc(void) {
8665 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8668 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8669 mem_base = xmlMemBlocks();
8670 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8672 ret_val = xmlCharEncCloseFunc(handler);
8673 desret_int(ret_val);
8675 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8676 xmlResetLastError();
8677 if (mem_base != xmlMemBlocks()) {
8678 printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8679 xmlMemBlocks() - mem_base);
8681 printf(" %d", n_handler);
8692 test_xmlCharEncFirstLine(void) {
8697 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8699 xmlBufferPtr out; /* an xmlBuffer for the output. */
8701 xmlBufferPtr in; /* an xmlBuffer for the input */
8704 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8705 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8706 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8707 mem_base = xmlMemBlocks();
8708 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8709 out = gen_xmlBufferPtr(n_out, 1);
8710 in = gen_xmlBufferPtr(n_in, 2);
8712 ret_val = xmlCharEncFirstLine(handler, out, in);
8713 desret_int(ret_val);
8715 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8716 des_xmlBufferPtr(n_out, out, 1);
8717 des_xmlBufferPtr(n_in, in, 2);
8718 xmlResetLastError();
8719 if (mem_base != xmlMemBlocks()) {
8720 printf("Leak of %d blocks found in xmlCharEncFirstLine",
8721 xmlMemBlocks() - mem_base);
8723 printf(" %d", n_handler);
8724 printf(" %d", n_out);
8725 printf(" %d", n_in);
8738 test_xmlCharEncInFunc(void) {
8743 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8745 xmlBufferPtr out; /* an xmlBuffer for the output. */
8747 xmlBufferPtr in; /* an xmlBuffer for the input */
8750 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8751 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8752 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8753 mem_base = xmlMemBlocks();
8754 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8755 out = gen_xmlBufferPtr(n_out, 1);
8756 in = gen_xmlBufferPtr(n_in, 2);
8758 ret_val = xmlCharEncInFunc(handler, out, in);
8759 desret_int(ret_val);
8761 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8762 des_xmlBufferPtr(n_out, out, 1);
8763 des_xmlBufferPtr(n_in, in, 2);
8764 xmlResetLastError();
8765 if (mem_base != xmlMemBlocks()) {
8766 printf("Leak of %d blocks found in xmlCharEncInFunc",
8767 xmlMemBlocks() - mem_base);
8769 printf(" %d", n_handler);
8770 printf(" %d", n_out);
8771 printf(" %d", n_in);
8784 test_xmlCharEncOutFunc(void) {
8789 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8791 xmlBufferPtr out; /* an xmlBuffer for the output. */
8793 xmlBufferPtr in; /* an xmlBuffer for the input */
8796 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8797 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8798 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8799 mem_base = xmlMemBlocks();
8800 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8801 out = gen_xmlBufferPtr(n_out, 1);
8802 in = gen_xmlBufferPtr(n_in, 2);
8804 ret_val = xmlCharEncOutFunc(handler, out, in);
8805 desret_int(ret_val);
8807 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8808 des_xmlBufferPtr(n_out, out, 1);
8809 des_xmlBufferPtr(n_in, in, 2);
8810 xmlResetLastError();
8811 if (mem_base != xmlMemBlocks()) {
8812 printf("Leak of %d blocks found in xmlCharEncOutFunc",
8813 xmlMemBlocks() - mem_base);
8815 printf(" %d", n_handler);
8816 printf(" %d", n_out);
8817 printf(" %d", n_in);
8830 test_xmlCleanupCharEncodingHandlers(void) {
8835 xmlCleanupCharEncodingHandlers();
8837 xmlResetLastError();
8845 test_xmlCleanupEncodingAliases(void) {
8850 mem_base = xmlMemBlocks();
8852 xmlCleanupEncodingAliases();
8854 xmlResetLastError();
8855 if (mem_base != xmlMemBlocks()) {
8856 printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8857 xmlMemBlocks() - mem_base);
8868 test_xmlDelEncodingAlias(void) {
8873 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8876 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8877 mem_base = xmlMemBlocks();
8878 alias = gen_const_char_ptr(n_alias, 0);
8880 ret_val = xmlDelEncodingAlias((const char *)alias);
8881 desret_int(ret_val);
8883 des_const_char_ptr(n_alias, (const char *)alias, 0);
8884 xmlResetLastError();
8885 if (mem_base != xmlMemBlocks()) {
8886 printf("Leak of %d blocks found in xmlDelEncodingAlias",
8887 xmlMemBlocks() - mem_base);
8889 printf(" %d", n_alias);
8900 test_xmlDetectCharEncoding(void) {
8904 xmlCharEncoding ret_val;
8905 unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
8907 int len; /* pointer to the length of the buffer */
8910 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8911 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8912 mem_base = xmlMemBlocks();
8913 in = gen_const_unsigned_char_ptr(n_in, 0);
8914 len = gen_int(n_len, 1);
8916 ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8917 desret_xmlCharEncoding(ret_val);
8919 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8920 des_int(n_len, len, 1);
8921 xmlResetLastError();
8922 if (mem_base != xmlMemBlocks()) {
8923 printf("Leak of %d blocks found in xmlDetectCharEncoding",
8924 xmlMemBlocks() - mem_base);
8926 printf(" %d", n_in);
8927 printf(" %d", n_len);
8939 test_xmlFindCharEncodingHandler(void) {
8943 /* missing type support */
8949 test_xmlGetCharEncodingHandler(void) {
8953 /* missing type support */
8959 test_xmlGetCharEncodingName(void) {
8963 const char * ret_val;
8964 xmlCharEncoding enc; /* the encoding */
8967 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8968 mem_base = xmlMemBlocks();
8969 enc = gen_xmlCharEncoding(n_enc, 0);
8971 ret_val = xmlGetCharEncodingName(enc);
8972 desret_const_char_ptr(ret_val);
8974 des_xmlCharEncoding(n_enc, enc, 0);
8975 xmlResetLastError();
8976 if (mem_base != xmlMemBlocks()) {
8977 printf("Leak of %d blocks found in xmlGetCharEncodingName",
8978 xmlMemBlocks() - mem_base);
8980 printf(" %d", n_enc);
8991 test_xmlGetEncodingAlias(void) {
8995 const char * ret_val;
8996 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8999 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9000 mem_base = xmlMemBlocks();
9001 alias = gen_const_char_ptr(n_alias, 0);
9003 ret_val = xmlGetEncodingAlias((const char *)alias);
9004 desret_const_char_ptr(ret_val);
9006 des_const_char_ptr(n_alias, (const char *)alias, 0);
9007 xmlResetLastError();
9008 if (mem_base != xmlMemBlocks()) {
9009 printf("Leak of %d blocks found in xmlGetEncodingAlias",
9010 xmlMemBlocks() - mem_base);
9012 printf(" %d", n_alias);
9023 test_xmlInitCharEncodingHandlers(void) {
9028 xmlInitCharEncodingHandlers();
9030 xmlResetLastError();
9038 test_xmlNewCharEncodingHandler(void) {
9042 /* missing type support */
9048 test_xmlParseCharEncoding(void) {
9052 xmlCharEncoding ret_val;
9053 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9056 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9057 mem_base = xmlMemBlocks();
9058 name = gen_const_char_ptr(n_name, 0);
9060 ret_val = xmlParseCharEncoding((const char *)name);
9061 desret_xmlCharEncoding(ret_val);
9063 des_const_char_ptr(n_name, (const char *)name, 0);
9064 xmlResetLastError();
9065 if (mem_base != xmlMemBlocks()) {
9066 printf("Leak of %d blocks found in xmlParseCharEncoding",
9067 xmlMemBlocks() - mem_base);
9069 printf(" %d", n_name);
9079 #define gen_nb_xmlCharEncodingHandlerPtr 1
9080 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9083 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9087 test_xmlRegisterCharEncodingHandler(void) {
9091 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9094 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9095 mem_base = xmlMemBlocks();
9096 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9098 xmlRegisterCharEncodingHandler(handler);
9100 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9101 xmlResetLastError();
9102 if (mem_base != xmlMemBlocks()) {
9103 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9104 xmlMemBlocks() - mem_base);
9106 printf(" %d", n_handler);
9116 test_encoding(void) {
9119 if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9120 test_ret += test_UTF8Toisolat1();
9121 test_ret += test_isolat1ToUTF8();
9122 test_ret += test_xmlAddEncodingAlias();
9123 test_ret += test_xmlCharEncCloseFunc();
9124 test_ret += test_xmlCharEncFirstLine();
9125 test_ret += test_xmlCharEncInFunc();
9126 test_ret += test_xmlCharEncOutFunc();
9127 test_ret += test_xmlCleanupCharEncodingHandlers();
9128 test_ret += test_xmlCleanupEncodingAliases();
9129 test_ret += test_xmlDelEncodingAlias();
9130 test_ret += test_xmlDetectCharEncoding();
9131 test_ret += test_xmlFindCharEncodingHandler();
9132 test_ret += test_xmlGetCharEncodingHandler();
9133 test_ret += test_xmlGetCharEncodingName();
9134 test_ret += test_xmlGetEncodingAlias();
9135 test_ret += test_xmlInitCharEncodingHandlers();
9136 test_ret += test_xmlNewCharEncodingHandler();
9137 test_ret += test_xmlParseCharEncoding();
9138 test_ret += test_xmlRegisterCharEncodingHandler();
9141 printf("Module encoding: %d errors\n", test_ret);
9146 test_xmlAddDocEntity(void) {
9150 xmlEntityPtr ret_val;
9151 xmlDocPtr doc; /* the document */
9153 xmlChar * name; /* the entity name */
9155 int type; /* the entity type XML_xxx_yyy_ENTITY */
9157 xmlChar * ExternalID; /* the entity external ID if available */
9159 xmlChar * SystemID; /* the entity system ID if available */
9161 xmlChar * content; /* the entity content */
9164 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9165 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9166 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9167 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9168 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9169 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9170 mem_base = xmlMemBlocks();
9171 doc = gen_xmlDocPtr(n_doc, 0);
9172 name = gen_const_xmlChar_ptr(n_name, 1);
9173 type = gen_int(n_type, 2);
9174 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9175 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9176 content = gen_const_xmlChar_ptr(n_content, 5);
9178 ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9179 desret_xmlEntityPtr(ret_val);
9181 des_xmlDocPtr(n_doc, doc, 0);
9182 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9183 des_int(n_type, type, 2);
9184 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9185 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9186 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9187 xmlResetLastError();
9188 if (mem_base != xmlMemBlocks()) {
9189 printf("Leak of %d blocks found in xmlAddDocEntity",
9190 xmlMemBlocks() - mem_base);
9192 printf(" %d", n_doc);
9193 printf(" %d", n_name);
9194 printf(" %d", n_type);
9195 printf(" %d", n_ExternalID);
9196 printf(" %d", n_SystemID);
9197 printf(" %d", n_content);
9213 test_xmlAddDtdEntity(void) {
9217 xmlEntityPtr ret_val;
9218 xmlDocPtr doc; /* the document */
9220 xmlChar * name; /* the entity name */
9222 int type; /* the entity type XML_xxx_yyy_ENTITY */
9224 xmlChar * ExternalID; /* the entity external ID if available */
9226 xmlChar * SystemID; /* the entity system ID if available */
9228 xmlChar * content; /* the entity content */
9231 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9232 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9233 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9234 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9235 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9236 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9237 mem_base = xmlMemBlocks();
9238 doc = gen_xmlDocPtr(n_doc, 0);
9239 name = gen_const_xmlChar_ptr(n_name, 1);
9240 type = gen_int(n_type, 2);
9241 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9242 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9243 content = gen_const_xmlChar_ptr(n_content, 5);
9245 ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9246 desret_xmlEntityPtr(ret_val);
9248 des_xmlDocPtr(n_doc, doc, 0);
9249 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9250 des_int(n_type, type, 2);
9251 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9252 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9253 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9254 xmlResetLastError();
9255 if (mem_base != xmlMemBlocks()) {
9256 printf("Leak of %d blocks found in xmlAddDtdEntity",
9257 xmlMemBlocks() - mem_base);
9259 printf(" %d", n_doc);
9260 printf(" %d", n_name);
9261 printf(" %d", n_type);
9262 printf(" %d", n_ExternalID);
9263 printf(" %d", n_SystemID);
9264 printf(" %d", n_content);
9280 test_xmlCleanupPredefinedEntities(void) {
9283 #if defined(LIBXML_LEGACY_ENABLED)
9284 #ifdef LIBXML_LEGACY_ENABLED
9287 mem_base = xmlMemBlocks();
9289 xmlCleanupPredefinedEntities();
9291 xmlResetLastError();
9292 if (mem_base != xmlMemBlocks()) {
9293 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9294 xmlMemBlocks() - mem_base);
9306 #define gen_nb_xmlEntitiesTablePtr 1
9307 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9310 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9314 test_xmlCopyEntitiesTable(void) {
9318 /* missing type support */
9324 test_xmlCreateEntitiesTable(void) {
9328 /* missing type support */
9334 test_xmlDumpEntitiesTable(void) {
9337 #if defined(LIBXML_OUTPUT_ENABLED)
9339 xmlBufferPtr buf; /* An XML buffer. */
9341 xmlEntitiesTablePtr table; /* An entity table */
9344 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9345 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9346 mem_base = xmlMemBlocks();
9347 buf = gen_xmlBufferPtr(n_buf, 0);
9348 table = gen_xmlEntitiesTablePtr(n_table, 1);
9350 xmlDumpEntitiesTable(buf, table);
9352 des_xmlBufferPtr(n_buf, buf, 0);
9353 des_xmlEntitiesTablePtr(n_table, table, 1);
9354 xmlResetLastError();
9355 if (mem_base != xmlMemBlocks()) {
9356 printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9357 xmlMemBlocks() - mem_base);
9359 printf(" %d", n_buf);
9360 printf(" %d", n_table);
9372 #define gen_nb_xmlEntityPtr 1
9373 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9376 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9380 test_xmlDumpEntityDecl(void) {
9383 #if defined(LIBXML_OUTPUT_ENABLED)
9385 xmlBufferPtr buf; /* An XML buffer. */
9387 xmlEntityPtr ent; /* An entity table */
9390 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9391 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9392 mem_base = xmlMemBlocks();
9393 buf = gen_xmlBufferPtr(n_buf, 0);
9394 ent = gen_xmlEntityPtr(n_ent, 1);
9396 xmlDumpEntityDecl(buf, ent);
9398 des_xmlBufferPtr(n_buf, buf, 0);
9399 des_xmlEntityPtr(n_ent, ent, 1);
9400 xmlResetLastError();
9401 if (mem_base != xmlMemBlocks()) {
9402 printf("Leak of %d blocks found in xmlDumpEntityDecl",
9403 xmlMemBlocks() - mem_base);
9405 printf(" %d", n_buf);
9406 printf(" %d", n_ent);
9419 test_xmlEncodeEntitiesReentrant(void) {
9424 xmlDocPtr doc; /* the document containing the string */
9426 xmlChar * input; /* A string to convert to XML. */
9429 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9430 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9431 mem_base = xmlMemBlocks();
9432 doc = gen_xmlDocPtr(n_doc, 0);
9433 input = gen_const_xmlChar_ptr(n_input, 1);
9435 ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9436 desret_xmlChar_ptr(ret_val);
9438 des_xmlDocPtr(n_doc, doc, 0);
9439 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9440 xmlResetLastError();
9441 if (mem_base != xmlMemBlocks()) {
9442 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9443 xmlMemBlocks() - mem_base);
9445 printf(" %d", n_doc);
9446 printf(" %d", n_input);
9457 #define gen_nb_const_xmlDoc_ptr 1
9458 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9461 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9465 test_xmlEncodeSpecialChars(void) {
9470 xmlDoc * doc; /* the document containing the string */
9472 xmlChar * input; /* A string to convert to XML. */
9475 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9476 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9477 mem_base = xmlMemBlocks();
9478 doc = gen_const_xmlDoc_ptr(n_doc, 0);
9479 input = gen_const_xmlChar_ptr(n_input, 1);
9481 ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
9482 desret_xmlChar_ptr(ret_val);
9484 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9485 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9486 xmlResetLastError();
9487 if (mem_base != xmlMemBlocks()) {
9488 printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9489 xmlMemBlocks() - mem_base);
9491 printf(" %d", n_doc);
9492 printf(" %d", n_input);
9504 test_xmlGetDocEntity(void) {
9508 xmlEntityPtr ret_val;
9509 xmlDoc * doc; /* the document referencing the entity */
9511 xmlChar * name; /* the entity name */
9514 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9515 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9516 mem_base = xmlMemBlocks();
9517 doc = gen_const_xmlDoc_ptr(n_doc, 0);
9518 name = gen_const_xmlChar_ptr(n_name, 1);
9520 ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
9521 desret_xmlEntityPtr(ret_val);
9523 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9524 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9525 xmlResetLastError();
9526 if (mem_base != xmlMemBlocks()) {
9527 printf("Leak of %d blocks found in xmlGetDocEntity",
9528 xmlMemBlocks() - mem_base);
9530 printf(" %d", n_doc);
9531 printf(" %d", n_name);
9543 test_xmlGetDtdEntity(void) {
9547 xmlEntityPtr ret_val;
9548 xmlDocPtr doc; /* the document referencing the entity */
9550 xmlChar * name; /* the entity name */
9553 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9554 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9555 mem_base = xmlMemBlocks();
9556 doc = gen_xmlDocPtr(n_doc, 0);
9557 name = gen_const_xmlChar_ptr(n_name, 1);
9559 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9560 desret_xmlEntityPtr(ret_val);
9562 des_xmlDocPtr(n_doc, doc, 0);
9563 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9564 xmlResetLastError();
9565 if (mem_base != xmlMemBlocks()) {
9566 printf("Leak of %d blocks found in xmlGetDtdEntity",
9567 xmlMemBlocks() - mem_base);
9569 printf(" %d", n_doc);
9570 printf(" %d", n_name);
9582 test_xmlGetParameterEntity(void) {
9586 xmlEntityPtr ret_val;
9587 xmlDocPtr doc; /* the document referencing the entity */
9589 xmlChar * name; /* the entity name */
9592 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9593 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9594 mem_base = xmlMemBlocks();
9595 doc = gen_xmlDocPtr(n_doc, 0);
9596 name = gen_const_xmlChar_ptr(n_name, 1);
9598 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9599 desret_xmlEntityPtr(ret_val);
9601 des_xmlDocPtr(n_doc, doc, 0);
9602 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9603 xmlResetLastError();
9604 if (mem_base != xmlMemBlocks()) {
9605 printf("Leak of %d blocks found in xmlGetParameterEntity",
9606 xmlMemBlocks() - mem_base);
9608 printf(" %d", n_doc);
9609 printf(" %d", n_name);
9621 test_xmlGetPredefinedEntity(void) {
9625 xmlEntityPtr ret_val;
9626 xmlChar * name; /* the entity name */
9629 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9630 mem_base = xmlMemBlocks();
9631 name = gen_const_xmlChar_ptr(n_name, 0);
9633 ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9634 desret_xmlEntityPtr(ret_val);
9636 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9637 xmlResetLastError();
9638 if (mem_base != xmlMemBlocks()) {
9639 printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9640 xmlMemBlocks() - mem_base);
9642 printf(" %d", n_name);
9653 test_xmlInitializePredefinedEntities(void) {
9656 #if defined(LIBXML_LEGACY_ENABLED)
9657 #ifdef LIBXML_LEGACY_ENABLED
9660 mem_base = xmlMemBlocks();
9662 xmlInitializePredefinedEntities();
9664 xmlResetLastError();
9665 if (mem_base != xmlMemBlocks()) {
9666 printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9667 xmlMemBlocks() - mem_base);
9680 test_xmlNewEntity(void) {
9684 xmlEntityPtr ret_val;
9685 xmlDocPtr doc; /* the document */
9687 xmlChar * name; /* the entity name */
9689 int type; /* the entity type XML_xxx_yyy_ENTITY */
9691 xmlChar * ExternalID; /* the entity external ID if available */
9693 xmlChar * SystemID; /* the entity system ID if available */
9695 xmlChar * content; /* the entity content */
9698 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9699 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9700 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9701 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9702 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9703 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9704 mem_base = xmlMemBlocks();
9705 doc = gen_xmlDocPtr(n_doc, 0);
9706 name = gen_const_xmlChar_ptr(n_name, 1);
9707 type = gen_int(n_type, 2);
9708 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9709 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9710 content = gen_const_xmlChar_ptr(n_content, 5);
9712 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9713 desret_xmlEntityPtr(ret_val);
9715 des_xmlDocPtr(n_doc, doc, 0);
9716 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9717 des_int(n_type, type, 2);
9718 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9719 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9720 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9721 xmlResetLastError();
9722 if (mem_base != xmlMemBlocks()) {
9723 printf("Leak of %d blocks found in xmlNewEntity",
9724 xmlMemBlocks() - mem_base);
9726 printf(" %d", n_doc);
9727 printf(" %d", n_name);
9728 printf(" %d", n_type);
9729 printf(" %d", n_ExternalID);
9730 printf(" %d", n_SystemID);
9731 printf(" %d", n_content);
9746 test_entities(void) {
9749 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9750 test_ret += test_xmlAddDocEntity();
9751 test_ret += test_xmlAddDtdEntity();
9752 test_ret += test_xmlCleanupPredefinedEntities();
9753 test_ret += test_xmlCopyEntitiesTable();
9754 test_ret += test_xmlCreateEntitiesTable();
9755 test_ret += test_xmlDumpEntitiesTable();
9756 test_ret += test_xmlDumpEntityDecl();
9757 test_ret += test_xmlEncodeEntitiesReentrant();
9758 test_ret += test_xmlEncodeSpecialChars();
9759 test_ret += test_xmlGetDocEntity();
9760 test_ret += test_xmlGetDtdEntity();
9761 test_ret += test_xmlGetParameterEntity();
9762 test_ret += test_xmlGetPredefinedEntity();
9763 test_ret += test_xmlInitializePredefinedEntities();
9764 test_ret += test_xmlNewEntity();
9767 printf("Module entities: %d errors\n", test_ret);
9772 test_xmlHashAddEntry(void) {
9777 xmlHashTablePtr table; /* the hash table */
9779 xmlChar * name; /* the name of the userdata */
9781 void * userdata; /* a pointer to the userdata */
9784 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9785 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9786 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9787 mem_base = xmlMemBlocks();
9788 table = gen_xmlHashTablePtr(n_table, 0);
9789 name = gen_const_xmlChar_ptr(n_name, 1);
9790 userdata = gen_userdata(n_userdata, 2);
9792 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9793 desret_int(ret_val);
9795 des_xmlHashTablePtr(n_table, table, 0);
9796 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9797 des_userdata(n_userdata, userdata, 2);
9798 xmlResetLastError();
9799 if (mem_base != xmlMemBlocks()) {
9800 printf("Leak of %d blocks found in xmlHashAddEntry",
9801 xmlMemBlocks() - mem_base);
9803 printf(" %d", n_table);
9804 printf(" %d", n_name);
9805 printf(" %d", n_userdata);
9818 test_xmlHashAddEntry2(void) {
9823 xmlHashTablePtr table; /* the hash table */
9825 xmlChar * name; /* the name of the userdata */
9827 xmlChar * name2; /* a second name of the userdata */
9829 void * userdata; /* a pointer to the userdata */
9832 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9833 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9834 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9835 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9836 mem_base = xmlMemBlocks();
9837 table = gen_xmlHashTablePtr(n_table, 0);
9838 name = gen_const_xmlChar_ptr(n_name, 1);
9839 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9840 userdata = gen_userdata(n_userdata, 3);
9842 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9843 desret_int(ret_val);
9845 des_xmlHashTablePtr(n_table, table, 0);
9846 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9847 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9848 des_userdata(n_userdata, userdata, 3);
9849 xmlResetLastError();
9850 if (mem_base != xmlMemBlocks()) {
9851 printf("Leak of %d blocks found in xmlHashAddEntry2",
9852 xmlMemBlocks() - mem_base);
9854 printf(" %d", n_table);
9855 printf(" %d", n_name);
9856 printf(" %d", n_name2);
9857 printf(" %d", n_userdata);
9871 test_xmlHashAddEntry3(void) {
9876 xmlHashTablePtr table; /* the hash table */
9878 xmlChar * name; /* the name of the userdata */
9880 xmlChar * name2; /* a second name of the userdata */
9882 xmlChar * name3; /* a third name of the userdata */
9884 void * userdata; /* a pointer to the userdata */
9887 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9888 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9889 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9890 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9891 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9892 mem_base = xmlMemBlocks();
9893 table = gen_xmlHashTablePtr(n_table, 0);
9894 name = gen_const_xmlChar_ptr(n_name, 1);
9895 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9896 name3 = gen_const_xmlChar_ptr(n_name3, 3);
9897 userdata = gen_userdata(n_userdata, 4);
9899 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9900 desret_int(ret_val);
9902 des_xmlHashTablePtr(n_table, table, 0);
9903 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9904 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9905 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9906 des_userdata(n_userdata, userdata, 4);
9907 xmlResetLastError();
9908 if (mem_base != xmlMemBlocks()) {
9909 printf("Leak of %d blocks found in xmlHashAddEntry3",
9910 xmlMemBlocks() - mem_base);
9912 printf(" %d", n_table);
9913 printf(" %d", n_name);
9914 printf(" %d", n_name2);
9915 printf(" %d", n_name3);
9916 printf(" %d", n_userdata);
9931 test_xmlHashCopy(void) {
9935 /* missing type support */
9941 test_xmlHashCreate(void) {
9945 /* missing type support */
9951 test_xmlHashCreateDict(void) {
9955 /* missing type support */
9961 test_xmlHashLookup(void) {
9966 xmlHashTablePtr table; /* the hash table */
9968 xmlChar * name; /* the name of the userdata */
9971 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9972 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9973 mem_base = xmlMemBlocks();
9974 table = gen_xmlHashTablePtr(n_table, 0);
9975 name = gen_const_xmlChar_ptr(n_name, 1);
9977 ret_val = xmlHashLookup(table, (const xmlChar *)name);
9978 desret_void_ptr(ret_val);
9980 des_xmlHashTablePtr(n_table, table, 0);
9981 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9982 xmlResetLastError();
9983 if (mem_base != xmlMemBlocks()) {
9984 printf("Leak of %d blocks found in xmlHashLookup",
9985 xmlMemBlocks() - mem_base);
9987 printf(" %d", n_table);
9988 printf(" %d", n_name);
10000 test_xmlHashLookup2(void) {
10005 xmlHashTablePtr table; /* the hash table */
10007 xmlChar * name; /* the name of the userdata */
10009 xmlChar * name2; /* a second name of the userdata */
10012 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10013 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10014 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10015 mem_base = xmlMemBlocks();
10016 table = gen_xmlHashTablePtr(n_table, 0);
10017 name = gen_const_xmlChar_ptr(n_name, 1);
10018 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10020 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10021 desret_void_ptr(ret_val);
10023 des_xmlHashTablePtr(n_table, table, 0);
10024 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10025 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10026 xmlResetLastError();
10027 if (mem_base != xmlMemBlocks()) {
10028 printf("Leak of %d blocks found in xmlHashLookup2",
10029 xmlMemBlocks() - mem_base);
10031 printf(" %d", n_table);
10032 printf(" %d", n_name);
10033 printf(" %d", n_name2);
10046 test_xmlHashLookup3(void) {
10051 xmlHashTablePtr table; /* the hash table */
10053 xmlChar * name; /* the name of the userdata */
10055 xmlChar * name2; /* a second name of the userdata */
10057 xmlChar * name3; /* a third name of the userdata */
10060 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10061 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10062 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10063 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10064 mem_base = xmlMemBlocks();
10065 table = gen_xmlHashTablePtr(n_table, 0);
10066 name = gen_const_xmlChar_ptr(n_name, 1);
10067 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10068 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10070 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10071 desret_void_ptr(ret_val);
10073 des_xmlHashTablePtr(n_table, table, 0);
10074 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10075 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10076 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10077 xmlResetLastError();
10078 if (mem_base != xmlMemBlocks()) {
10079 printf("Leak of %d blocks found in xmlHashLookup3",
10080 xmlMemBlocks() - mem_base);
10082 printf(" %d", n_table);
10083 printf(" %d", n_name);
10084 printf(" %d", n_name2);
10085 printf(" %d", n_name3);
10099 test_xmlHashQLookup(void) {
10104 xmlHashTablePtr table; /* the hash table */
10106 xmlChar * prefix; /* the prefix of the userdata */
10108 xmlChar * name; /* the name of the userdata */
10111 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10112 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10113 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10114 mem_base = xmlMemBlocks();
10115 table = gen_xmlHashTablePtr(n_table, 0);
10116 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10117 name = gen_const_xmlChar_ptr(n_name, 2);
10119 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10120 desret_void_ptr(ret_val);
10122 des_xmlHashTablePtr(n_table, table, 0);
10123 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10124 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10125 xmlResetLastError();
10126 if (mem_base != xmlMemBlocks()) {
10127 printf("Leak of %d blocks found in xmlHashQLookup",
10128 xmlMemBlocks() - mem_base);
10130 printf(" %d", n_table);
10131 printf(" %d", n_prefix);
10132 printf(" %d", n_name);
10145 test_xmlHashQLookup2(void) {
10150 xmlHashTablePtr table; /* the hash table */
10152 xmlChar * prefix; /* the prefix of the userdata */
10154 xmlChar * name; /* the name of the userdata */
10156 xmlChar * prefix2; /* the second prefix of the userdata */
10158 xmlChar * name2; /* a second name of the userdata */
10161 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10162 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10163 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10164 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10165 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10166 mem_base = xmlMemBlocks();
10167 table = gen_xmlHashTablePtr(n_table, 0);
10168 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10169 name = gen_const_xmlChar_ptr(n_name, 2);
10170 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10171 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10173 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10174 desret_void_ptr(ret_val);
10176 des_xmlHashTablePtr(n_table, table, 0);
10177 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10178 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10179 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10180 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10181 xmlResetLastError();
10182 if (mem_base != xmlMemBlocks()) {
10183 printf("Leak of %d blocks found in xmlHashQLookup2",
10184 xmlMemBlocks() - mem_base);
10186 printf(" %d", n_table);
10187 printf(" %d", n_prefix);
10188 printf(" %d", n_name);
10189 printf(" %d", n_prefix2);
10190 printf(" %d", n_name2);
10205 test_xmlHashQLookup3(void) {
10210 xmlHashTablePtr table; /* the hash table */
10212 xmlChar * prefix; /* the prefix of the userdata */
10214 xmlChar * name; /* the name of the userdata */
10216 xmlChar * prefix2; /* the second prefix of the userdata */
10218 xmlChar * name2; /* a second name of the userdata */
10220 xmlChar * prefix3; /* the third prefix of the userdata */
10222 xmlChar * name3; /* a third name of the userdata */
10225 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10226 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10227 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10228 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10229 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10230 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10231 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10232 mem_base = xmlMemBlocks();
10233 table = gen_xmlHashTablePtr(n_table, 0);
10234 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10235 name = gen_const_xmlChar_ptr(n_name, 2);
10236 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10237 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10238 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10239 name3 = gen_const_xmlChar_ptr(n_name3, 6);
10241 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10242 desret_void_ptr(ret_val);
10244 des_xmlHashTablePtr(n_table, table, 0);
10245 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10246 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10247 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10248 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10249 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10250 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10251 xmlResetLastError();
10252 if (mem_base != xmlMemBlocks()) {
10253 printf("Leak of %d blocks found in xmlHashQLookup3",
10254 xmlMemBlocks() - mem_base);
10256 printf(" %d", n_table);
10257 printf(" %d", n_prefix);
10258 printf(" %d", n_name);
10259 printf(" %d", n_prefix2);
10260 printf(" %d", n_name2);
10261 printf(" %d", n_prefix3);
10262 printf(" %d", n_name3);
10279 test_xmlHashRemoveEntry(void) {
10284 xmlHashTablePtr table; /* the hash table */
10286 xmlChar * name; /* the name of the userdata */
10288 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10291 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10292 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10293 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10294 mem_base = xmlMemBlocks();
10295 table = gen_xmlHashTablePtr(n_table, 0);
10296 name = gen_const_xmlChar_ptr(n_name, 1);
10297 f = gen_xmlHashDeallocator(n_f, 2);
10299 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10300 desret_int(ret_val);
10302 des_xmlHashTablePtr(n_table, table, 0);
10303 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10304 des_xmlHashDeallocator(n_f, f, 2);
10305 xmlResetLastError();
10306 if (mem_base != xmlMemBlocks()) {
10307 printf("Leak of %d blocks found in xmlHashRemoveEntry",
10308 xmlMemBlocks() - mem_base);
10310 printf(" %d", n_table);
10311 printf(" %d", n_name);
10312 printf(" %d", n_f);
10325 test_xmlHashRemoveEntry2(void) {
10330 xmlHashTablePtr table; /* the hash table */
10332 xmlChar * name; /* the name of the userdata */
10334 xmlChar * name2; /* a second name of the userdata */
10336 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10339 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10340 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10341 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10342 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10343 mem_base = xmlMemBlocks();
10344 table = gen_xmlHashTablePtr(n_table, 0);
10345 name = gen_const_xmlChar_ptr(n_name, 1);
10346 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10347 f = gen_xmlHashDeallocator(n_f, 3);
10349 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10350 desret_int(ret_val);
10352 des_xmlHashTablePtr(n_table, table, 0);
10353 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10354 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10355 des_xmlHashDeallocator(n_f, f, 3);
10356 xmlResetLastError();
10357 if (mem_base != xmlMemBlocks()) {
10358 printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10359 xmlMemBlocks() - mem_base);
10361 printf(" %d", n_table);
10362 printf(" %d", n_name);
10363 printf(" %d", n_name2);
10364 printf(" %d", n_f);
10378 test_xmlHashRemoveEntry3(void) {
10383 xmlHashTablePtr table; /* the hash table */
10385 xmlChar * name; /* the name of the userdata */
10387 xmlChar * name2; /* a second name of the userdata */
10389 xmlChar * name3; /* a third name of the userdata */
10391 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10394 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10395 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10396 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10397 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10398 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10399 mem_base = xmlMemBlocks();
10400 table = gen_xmlHashTablePtr(n_table, 0);
10401 name = gen_const_xmlChar_ptr(n_name, 1);
10402 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10403 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10404 f = gen_xmlHashDeallocator(n_f, 4);
10406 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10407 desret_int(ret_val);
10409 des_xmlHashTablePtr(n_table, table, 0);
10410 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10411 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10412 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10413 des_xmlHashDeallocator(n_f, f, 4);
10414 xmlResetLastError();
10415 if (mem_base != xmlMemBlocks()) {
10416 printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10417 xmlMemBlocks() - mem_base);
10419 printf(" %d", n_table);
10420 printf(" %d", n_name);
10421 printf(" %d", n_name2);
10422 printf(" %d", n_name3);
10423 printf(" %d", n_f);
10438 test_xmlHashScan(void) {
10442 /* missing type support */
10448 test_xmlHashScan3(void) {
10452 /* missing type support */
10458 test_xmlHashScanFull(void) {
10462 /* missing type support */
10468 test_xmlHashScanFull3(void) {
10472 /* missing type support */
10478 test_xmlHashSize(void) {
10483 xmlHashTablePtr table; /* the hash table */
10486 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10487 mem_base = xmlMemBlocks();
10488 table = gen_xmlHashTablePtr(n_table, 0);
10490 ret_val = xmlHashSize(table);
10491 desret_int(ret_val);
10493 des_xmlHashTablePtr(n_table, table, 0);
10494 xmlResetLastError();
10495 if (mem_base != xmlMemBlocks()) {
10496 printf("Leak of %d blocks found in xmlHashSize",
10497 xmlMemBlocks() - mem_base);
10499 printf(" %d", n_table);
10510 test_xmlHashUpdateEntry(void) {
10515 xmlHashTablePtr table; /* the hash table */
10517 xmlChar * name; /* the name of the userdata */
10519 void * userdata; /* a pointer to the userdata */
10521 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10524 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10525 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10526 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10527 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10528 mem_base = xmlMemBlocks();
10529 table = gen_xmlHashTablePtr(n_table, 0);
10530 name = gen_const_xmlChar_ptr(n_name, 1);
10531 userdata = gen_userdata(n_userdata, 2);
10532 f = gen_xmlHashDeallocator(n_f, 3);
10534 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10535 desret_int(ret_val);
10537 des_xmlHashTablePtr(n_table, table, 0);
10538 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10539 des_userdata(n_userdata, userdata, 2);
10540 des_xmlHashDeallocator(n_f, f, 3);
10541 xmlResetLastError();
10542 if (mem_base != xmlMemBlocks()) {
10543 printf("Leak of %d blocks found in xmlHashUpdateEntry",
10544 xmlMemBlocks() - mem_base);
10546 printf(" %d", n_table);
10547 printf(" %d", n_name);
10548 printf(" %d", n_userdata);
10549 printf(" %d", n_f);
10563 test_xmlHashUpdateEntry2(void) {
10568 xmlHashTablePtr table; /* the hash table */
10570 xmlChar * name; /* the name of the userdata */
10572 xmlChar * name2; /* a second name of the userdata */
10574 void * userdata; /* a pointer to the userdata */
10576 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10579 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10580 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10581 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10582 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10583 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10584 mem_base = xmlMemBlocks();
10585 table = gen_xmlHashTablePtr(n_table, 0);
10586 name = gen_const_xmlChar_ptr(n_name, 1);
10587 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10588 userdata = gen_userdata(n_userdata, 3);
10589 f = gen_xmlHashDeallocator(n_f, 4);
10591 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10592 desret_int(ret_val);
10594 des_xmlHashTablePtr(n_table, table, 0);
10595 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10596 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10597 des_userdata(n_userdata, userdata, 3);
10598 des_xmlHashDeallocator(n_f, f, 4);
10599 xmlResetLastError();
10600 if (mem_base != xmlMemBlocks()) {
10601 printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10602 xmlMemBlocks() - mem_base);
10604 printf(" %d", n_table);
10605 printf(" %d", n_name);
10606 printf(" %d", n_name2);
10607 printf(" %d", n_userdata);
10608 printf(" %d", n_f);
10623 test_xmlHashUpdateEntry3(void) {
10628 xmlHashTablePtr table; /* the hash table */
10630 xmlChar * name; /* the name of the userdata */
10632 xmlChar * name2; /* a second name of the userdata */
10634 xmlChar * name3; /* a third name of the userdata */
10636 void * userdata; /* a pointer to the userdata */
10638 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10641 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10642 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10643 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10644 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10645 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10646 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10647 mem_base = xmlMemBlocks();
10648 table = gen_xmlHashTablePtr(n_table, 0);
10649 name = gen_const_xmlChar_ptr(n_name, 1);
10650 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10651 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10652 userdata = gen_userdata(n_userdata, 4);
10653 f = gen_xmlHashDeallocator(n_f, 5);
10655 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10656 desret_int(ret_val);
10658 des_xmlHashTablePtr(n_table, table, 0);
10659 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10660 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10661 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10662 des_userdata(n_userdata, userdata, 4);
10663 des_xmlHashDeallocator(n_f, f, 5);
10664 xmlResetLastError();
10665 if (mem_base != xmlMemBlocks()) {
10666 printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10667 xmlMemBlocks() - mem_base);
10669 printf(" %d", n_table);
10670 printf(" %d", n_name);
10671 printf(" %d", n_name2);
10672 printf(" %d", n_name3);
10673 printf(" %d", n_userdata);
10674 printf(" %d", n_f);
10692 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10693 test_ret += test_xmlHashAddEntry();
10694 test_ret += test_xmlHashAddEntry2();
10695 test_ret += test_xmlHashAddEntry3();
10696 test_ret += test_xmlHashCopy();
10697 test_ret += test_xmlHashCreate();
10698 test_ret += test_xmlHashCreateDict();
10699 test_ret += test_xmlHashLookup();
10700 test_ret += test_xmlHashLookup2();
10701 test_ret += test_xmlHashLookup3();
10702 test_ret += test_xmlHashQLookup();
10703 test_ret += test_xmlHashQLookup2();
10704 test_ret += test_xmlHashQLookup3();
10705 test_ret += test_xmlHashRemoveEntry();
10706 test_ret += test_xmlHashRemoveEntry2();
10707 test_ret += test_xmlHashRemoveEntry3();
10708 test_ret += test_xmlHashScan();
10709 test_ret += test_xmlHashScan3();
10710 test_ret += test_xmlHashScanFull();
10711 test_ret += test_xmlHashScanFull3();
10712 test_ret += test_xmlHashSize();
10713 test_ret += test_xmlHashUpdateEntry();
10714 test_ret += test_xmlHashUpdateEntry2();
10715 test_ret += test_xmlHashUpdateEntry3();
10718 printf("Module hash: %d errors\n", test_ret);
10722 #define gen_nb_xmlLinkPtr 1
10723 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10726 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10730 test_xmlLinkGetData(void) {
10735 xmlLinkPtr lk; /* a link */
10738 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10739 mem_base = xmlMemBlocks();
10740 lk = gen_xmlLinkPtr(n_lk, 0);
10742 ret_val = xmlLinkGetData(lk);
10743 desret_void_ptr(ret_val);
10745 des_xmlLinkPtr(n_lk, lk, 0);
10746 xmlResetLastError();
10747 if (mem_base != xmlMemBlocks()) {
10748 printf("Leak of %d blocks found in xmlLinkGetData",
10749 xmlMemBlocks() - mem_base);
10751 printf(" %d", n_lk);
10762 test_xmlListAppend(void) {
10767 xmlListPtr l; /* a list */
10769 void * data; /* the data */
10772 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10773 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10774 mem_base = xmlMemBlocks();
10775 l = gen_xmlListPtr(n_l, 0);
10776 data = gen_userdata(n_data, 1);
10778 ret_val = xmlListAppend(l, data);
10779 desret_int(ret_val);
10781 des_xmlListPtr(n_l, l, 0);
10782 des_userdata(n_data, data, 1);
10783 xmlResetLastError();
10784 if (mem_base != xmlMemBlocks()) {
10785 printf("Leak of %d blocks found in xmlListAppend",
10786 xmlMemBlocks() - mem_base);
10788 printf(" %d", n_l);
10789 printf(" %d", n_data);
10801 test_xmlListClear(void) {
10805 xmlListPtr l; /* a list */
10808 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10809 mem_base = xmlMemBlocks();
10810 l = gen_xmlListPtr(n_l, 0);
10814 des_xmlListPtr(n_l, l, 0);
10815 xmlResetLastError();
10816 if (mem_base != xmlMemBlocks()) {
10817 printf("Leak of %d blocks found in xmlListClear",
10818 xmlMemBlocks() - mem_base);
10820 printf(" %d", n_l);
10830 #define gen_nb_const_xmlListPtr 1
10831 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10834 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10838 test_xmlListCopy(void) {
10843 xmlListPtr cur; /* the new list */
10845 xmlListPtr old; /* the old list */
10848 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10849 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10850 mem_base = xmlMemBlocks();
10851 cur = gen_xmlListPtr(n_cur, 0);
10852 old = gen_const_xmlListPtr(n_old, 1);
10854 ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10855 desret_int(ret_val);
10857 des_xmlListPtr(n_cur, cur, 0);
10858 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10859 xmlResetLastError();
10860 if (mem_base != xmlMemBlocks()) {
10861 printf("Leak of %d blocks found in xmlListCopy",
10862 xmlMemBlocks() - mem_base);
10864 printf(" %d", n_cur);
10865 printf(" %d", n_old);
10877 test_xmlListCreate(void) {
10881 /* missing type support */
10887 test_xmlListDup(void) {
10891 /* missing type support */
10897 test_xmlListEmpty(void) {
10902 xmlListPtr l; /* a list */
10905 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10906 mem_base = xmlMemBlocks();
10907 l = gen_xmlListPtr(n_l, 0);
10909 ret_val = xmlListEmpty(l);
10910 desret_int(ret_val);
10912 des_xmlListPtr(n_l, l, 0);
10913 xmlResetLastError();
10914 if (mem_base != xmlMemBlocks()) {
10915 printf("Leak of %d blocks found in xmlListEmpty",
10916 xmlMemBlocks() - mem_base);
10918 printf(" %d", n_l);
10929 test_xmlListEnd(void) {
10933 /* missing type support */
10939 test_xmlListFront(void) {
10943 /* missing type support */
10949 test_xmlListInsert(void) {
10954 xmlListPtr l; /* a list */
10956 void * data; /* the data */
10959 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10960 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10961 mem_base = xmlMemBlocks();
10962 l = gen_xmlListPtr(n_l, 0);
10963 data = gen_userdata(n_data, 1);
10965 ret_val = xmlListInsert(l, data);
10966 desret_int(ret_val);
10968 des_xmlListPtr(n_l, l, 0);
10969 des_userdata(n_data, data, 1);
10970 xmlResetLastError();
10971 if (mem_base != xmlMemBlocks()) {
10972 printf("Leak of %d blocks found in xmlListInsert",
10973 xmlMemBlocks() - mem_base);
10975 printf(" %d", n_l);
10976 printf(" %d", n_data);
10988 test_xmlListMerge(void) {
10992 xmlListPtr l1; /* the original list */
10994 xmlListPtr l2; /* the new list */
10997 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10998 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10999 mem_base = xmlMemBlocks();
11000 l1 = gen_xmlListPtr(n_l1, 0);
11001 l2 = gen_xmlListPtr(n_l2, 1);
11003 xmlListMerge(l1, l2);
11005 des_xmlListPtr(n_l1, l1, 0);
11006 des_xmlListPtr(n_l2, l2, 1);
11007 xmlResetLastError();
11008 if (mem_base != xmlMemBlocks()) {
11009 printf("Leak of %d blocks found in xmlListMerge",
11010 xmlMemBlocks() - mem_base);
11012 printf(" %d", n_l1);
11013 printf(" %d", n_l2);
11025 test_xmlListPopBack(void) {
11029 xmlListPtr l; /* a list */
11032 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11033 mem_base = xmlMemBlocks();
11034 l = gen_xmlListPtr(n_l, 0);
11038 des_xmlListPtr(n_l, l, 0);
11039 xmlResetLastError();
11040 if (mem_base != xmlMemBlocks()) {
11041 printf("Leak of %d blocks found in xmlListPopBack",
11042 xmlMemBlocks() - mem_base);
11044 printf(" %d", n_l);
11055 test_xmlListPopFront(void) {
11059 xmlListPtr l; /* a list */
11062 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11063 mem_base = xmlMemBlocks();
11064 l = gen_xmlListPtr(n_l, 0);
11066 xmlListPopFront(l);
11068 des_xmlListPtr(n_l, l, 0);
11069 xmlResetLastError();
11070 if (mem_base != xmlMemBlocks()) {
11071 printf("Leak of %d blocks found in xmlListPopFront",
11072 xmlMemBlocks() - mem_base);
11074 printf(" %d", n_l);
11085 test_xmlListPushBack(void) {
11090 xmlListPtr l; /* a list */
11092 void * data; /* new data */
11095 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11096 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11097 mem_base = xmlMemBlocks();
11098 l = gen_xmlListPtr(n_l, 0);
11099 data = gen_userdata(n_data, 1);
11101 ret_val = xmlListPushBack(l, data);
11102 desret_int(ret_val);
11104 des_xmlListPtr(n_l, l, 0);
11105 des_userdata(n_data, data, 1);
11106 xmlResetLastError();
11107 if (mem_base != xmlMemBlocks()) {
11108 printf("Leak of %d blocks found in xmlListPushBack",
11109 xmlMemBlocks() - mem_base);
11111 printf(" %d", n_l);
11112 printf(" %d", n_data);
11124 test_xmlListPushFront(void) {
11129 xmlListPtr l; /* a list */
11131 void * data; /* new data */
11134 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11135 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11136 mem_base = xmlMemBlocks();
11137 l = gen_xmlListPtr(n_l, 0);
11138 data = gen_userdata(n_data, 1);
11140 ret_val = xmlListPushFront(l, data);
11141 desret_int(ret_val);
11143 des_xmlListPtr(n_l, l, 0);
11144 des_userdata(n_data, data, 1);
11145 xmlResetLastError();
11146 if (mem_base != xmlMemBlocks()) {
11147 printf("Leak of %d blocks found in xmlListPushFront",
11148 xmlMemBlocks() - mem_base);
11150 printf(" %d", n_l);
11151 printf(" %d", n_data);
11163 test_xmlListRemoveAll(void) {
11168 xmlListPtr l; /* a list */
11170 void * data; /* list data */
11173 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11174 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11175 mem_base = xmlMemBlocks();
11176 l = gen_xmlListPtr(n_l, 0);
11177 data = gen_userdata(n_data, 1);
11179 ret_val = xmlListRemoveAll(l, data);
11180 desret_int(ret_val);
11182 des_xmlListPtr(n_l, l, 0);
11183 des_userdata(n_data, data, 1);
11184 xmlResetLastError();
11185 if (mem_base != xmlMemBlocks()) {
11186 printf("Leak of %d blocks found in xmlListRemoveAll",
11187 xmlMemBlocks() - mem_base);
11189 printf(" %d", n_l);
11190 printf(" %d", n_data);
11202 test_xmlListRemoveFirst(void) {
11207 xmlListPtr l; /* a list */
11209 void * data; /* list data */
11212 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11213 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11214 mem_base = xmlMemBlocks();
11215 l = gen_xmlListPtr(n_l, 0);
11216 data = gen_userdata(n_data, 1);
11218 ret_val = xmlListRemoveFirst(l, data);
11219 desret_int(ret_val);
11221 des_xmlListPtr(n_l, l, 0);
11222 des_userdata(n_data, data, 1);
11223 xmlResetLastError();
11224 if (mem_base != xmlMemBlocks()) {
11225 printf("Leak of %d blocks found in xmlListRemoveFirst",
11226 xmlMemBlocks() - mem_base);
11228 printf(" %d", n_l);
11229 printf(" %d", n_data);
11241 test_xmlListRemoveLast(void) {
11246 xmlListPtr l; /* a list */
11248 void * data; /* list data */
11251 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11252 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11253 mem_base = xmlMemBlocks();
11254 l = gen_xmlListPtr(n_l, 0);
11255 data = gen_userdata(n_data, 1);
11257 ret_val = xmlListRemoveLast(l, data);
11258 desret_int(ret_val);
11260 des_xmlListPtr(n_l, l, 0);
11261 des_userdata(n_data, data, 1);
11262 xmlResetLastError();
11263 if (mem_base != xmlMemBlocks()) {
11264 printf("Leak of %d blocks found in xmlListRemoveLast",
11265 xmlMemBlocks() - mem_base);
11267 printf(" %d", n_l);
11268 printf(" %d", n_data);
11280 test_xmlListReverse(void) {
11284 xmlListPtr l; /* a list */
11287 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11288 mem_base = xmlMemBlocks();
11289 l = gen_xmlListPtr(n_l, 0);
11293 des_xmlListPtr(n_l, l, 0);
11294 xmlResetLastError();
11295 if (mem_base != xmlMemBlocks()) {
11296 printf("Leak of %d blocks found in xmlListReverse",
11297 xmlMemBlocks() - mem_base);
11299 printf(" %d", n_l);
11310 test_xmlListReverseSearch(void) {
11315 xmlListPtr l; /* a list */
11317 void * data; /* a search value */
11320 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11321 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11322 mem_base = xmlMemBlocks();
11323 l = gen_xmlListPtr(n_l, 0);
11324 data = gen_userdata(n_data, 1);
11326 ret_val = xmlListReverseSearch(l, data);
11327 desret_void_ptr(ret_val);
11329 des_xmlListPtr(n_l, l, 0);
11330 des_userdata(n_data, data, 1);
11331 xmlResetLastError();
11332 if (mem_base != xmlMemBlocks()) {
11333 printf("Leak of %d blocks found in xmlListReverseSearch",
11334 xmlMemBlocks() - mem_base);
11336 printf(" %d", n_l);
11337 printf(" %d", n_data);
11349 test_xmlListReverseWalk(void) {
11353 /* missing type support */
11359 test_xmlListSearch(void) {
11364 xmlListPtr l; /* a list */
11366 void * data; /* a search value */
11369 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11370 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11371 mem_base = xmlMemBlocks();
11372 l = gen_xmlListPtr(n_l, 0);
11373 data = gen_userdata(n_data, 1);
11375 ret_val = xmlListSearch(l, data);
11376 desret_void_ptr(ret_val);
11378 des_xmlListPtr(n_l, l, 0);
11379 des_userdata(n_data, data, 1);
11380 xmlResetLastError();
11381 if (mem_base != xmlMemBlocks()) {
11382 printf("Leak of %d blocks found in xmlListSearch",
11383 xmlMemBlocks() - mem_base);
11385 printf(" %d", n_l);
11386 printf(" %d", n_data);
11398 test_xmlListSize(void) {
11403 xmlListPtr l; /* a list */
11406 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11407 mem_base = xmlMemBlocks();
11408 l = gen_xmlListPtr(n_l, 0);
11410 ret_val = xmlListSize(l);
11411 desret_int(ret_val);
11413 des_xmlListPtr(n_l, l, 0);
11414 xmlResetLastError();
11415 if (mem_base != xmlMemBlocks()) {
11416 printf("Leak of %d blocks found in xmlListSize",
11417 xmlMemBlocks() - mem_base);
11419 printf(" %d", n_l);
11430 test_xmlListSort(void) {
11434 xmlListPtr l; /* a list */
11437 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11438 mem_base = xmlMemBlocks();
11439 l = gen_xmlListPtr(n_l, 0);
11443 des_xmlListPtr(n_l, l, 0);
11444 xmlResetLastError();
11445 if (mem_base != xmlMemBlocks()) {
11446 printf("Leak of %d blocks found in xmlListSort",
11447 xmlMemBlocks() - mem_base);
11449 printf(" %d", n_l);
11460 test_xmlListWalk(void) {
11464 /* missing type support */
11472 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11473 test_ret += test_xmlLinkGetData();
11474 test_ret += test_xmlListAppend();
11475 test_ret += test_xmlListClear();
11476 test_ret += test_xmlListCopy();
11477 test_ret += test_xmlListCreate();
11478 test_ret += test_xmlListDup();
11479 test_ret += test_xmlListEmpty();
11480 test_ret += test_xmlListEnd();
11481 test_ret += test_xmlListFront();
11482 test_ret += test_xmlListInsert();
11483 test_ret += test_xmlListMerge();
11484 test_ret += test_xmlListPopBack();
11485 test_ret += test_xmlListPopFront();
11486 test_ret += test_xmlListPushBack();
11487 test_ret += test_xmlListPushFront();
11488 test_ret += test_xmlListRemoveAll();
11489 test_ret += test_xmlListRemoveFirst();
11490 test_ret += test_xmlListRemoveLast();
11491 test_ret += test_xmlListReverse();
11492 test_ret += test_xmlListReverseSearch();
11493 test_ret += test_xmlListReverseWalk();
11494 test_ret += test_xmlListSearch();
11495 test_ret += test_xmlListSize();
11496 test_ret += test_xmlListSort();
11497 test_ret += test_xmlListWalk();
11500 printf("Module list: %d errors\n", test_ret);
11505 test_xmlNanoFTPCheckResponse(void) {
11508 #if defined(LIBXML_FTP_ENABLED)
11511 void * ctx; /* an FTP context */
11514 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11515 mem_base = xmlMemBlocks();
11516 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11518 ret_val = xmlNanoFTPCheckResponse(ctx);
11519 desret_int(ret_val);
11521 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11522 xmlResetLastError();
11523 if (mem_base != xmlMemBlocks()) {
11524 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11525 xmlMemBlocks() - mem_base);
11527 printf(" %d", n_ctx);
11539 test_xmlNanoFTPCleanup(void) {
11542 #if defined(LIBXML_FTP_ENABLED)
11545 mem_base = xmlMemBlocks();
11547 xmlNanoFTPCleanup();
11549 xmlResetLastError();
11550 if (mem_base != xmlMemBlocks()) {
11551 printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11552 xmlMemBlocks() - mem_base);
11564 test_xmlNanoFTPCloseConnection(void) {
11567 #if defined(LIBXML_FTP_ENABLED)
11570 void * ctx; /* an FTP context */
11573 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11574 mem_base = xmlMemBlocks();
11575 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11577 ret_val = xmlNanoFTPCloseConnection(ctx);
11578 desret_int(ret_val);
11580 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11581 xmlResetLastError();
11582 if (mem_base != xmlMemBlocks()) {
11583 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11584 xmlMemBlocks() - mem_base);
11586 printf(" %d", n_ctx);
11598 test_xmlNanoFTPCwd(void) {
11601 #if defined(LIBXML_FTP_ENABLED)
11604 void * ctx; /* an FTP context */
11606 char * directory; /* a directory on the server */
11609 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11610 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11611 mem_base = xmlMemBlocks();
11612 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11613 directory = gen_const_char_ptr(n_directory, 1);
11615 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11616 desret_int(ret_val);
11618 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11619 des_const_char_ptr(n_directory, (const char *)directory, 1);
11620 xmlResetLastError();
11621 if (mem_base != xmlMemBlocks()) {
11622 printf("Leak of %d blocks found in xmlNanoFTPCwd",
11623 xmlMemBlocks() - mem_base);
11625 printf(" %d", n_ctx);
11626 printf(" %d", n_directory);
11639 test_xmlNanoFTPDele(void) {
11642 #if defined(LIBXML_FTP_ENABLED)
11645 void * ctx; /* an FTP context */
11647 const char * file; /* a file or directory on the server */
11650 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11651 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11652 mem_base = xmlMemBlocks();
11653 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11654 file = gen_filepath(n_file, 1);
11656 ret_val = xmlNanoFTPDele(ctx, file);
11657 desret_int(ret_val);
11659 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11660 des_filepath(n_file, file, 1);
11661 xmlResetLastError();
11662 if (mem_base != xmlMemBlocks()) {
11663 printf("Leak of %d blocks found in xmlNanoFTPDele",
11664 xmlMemBlocks() - mem_base);
11666 printf(" %d", n_ctx);
11667 printf(" %d", n_file);
11680 test_xmlNanoFTPGet(void) {
11684 /* missing type support */
11690 test_xmlNanoFTPGetConnection(void) {
11694 /* missing type support */
11700 test_xmlNanoFTPGetResponse(void) {
11703 #if defined(LIBXML_FTP_ENABLED)
11706 void * ctx; /* an FTP context */
11709 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11710 mem_base = xmlMemBlocks();
11711 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11713 ret_val = xmlNanoFTPGetResponse(ctx);
11714 desret_int(ret_val);
11716 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11717 xmlResetLastError();
11718 if (mem_base != xmlMemBlocks()) {
11719 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11720 xmlMemBlocks() - mem_base);
11722 printf(" %d", n_ctx);
11734 test_xmlNanoFTPGetSocket(void) {
11738 /* missing type support */
11744 test_xmlNanoFTPInit(void) {
11747 #if defined(LIBXML_FTP_ENABLED)
11750 mem_base = xmlMemBlocks();
11754 xmlResetLastError();
11755 if (mem_base != xmlMemBlocks()) {
11756 printf("Leak of %d blocks found in xmlNanoFTPInit",
11757 xmlMemBlocks() - mem_base);
11769 test_xmlNanoFTPList(void) {
11773 /* missing type support */
11779 test_xmlNanoFTPNewCtxt(void) {
11782 #if defined(LIBXML_FTP_ENABLED)
11785 const char * URL; /* The URL used to initialize the context */
11788 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11789 mem_base = xmlMemBlocks();
11790 URL = gen_filepath(n_URL, 0);
11792 ret_val = xmlNanoFTPNewCtxt(URL);
11793 desret_xmlNanoFTPCtxtPtr(ret_val);
11795 des_filepath(n_URL, URL, 0);
11796 xmlResetLastError();
11797 if (mem_base != xmlMemBlocks()) {
11798 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11799 xmlMemBlocks() - mem_base);
11801 printf(" %d", n_URL);
11813 test_xmlNanoFTPOpen(void) {
11816 #if defined(LIBXML_FTP_ENABLED)
11819 const char * URL; /* the URL to the resource */
11822 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11823 mem_base = xmlMemBlocks();
11824 URL = gen_filepath(n_URL, 0);
11826 ret_val = xmlNanoFTPOpen(URL);
11827 desret_xmlNanoFTPCtxtPtr(ret_val);
11829 des_filepath(n_URL, URL, 0);
11830 xmlResetLastError();
11831 if (mem_base != xmlMemBlocks()) {
11832 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11833 xmlMemBlocks() - mem_base);
11835 printf(" %d", n_URL);
11847 test_xmlNanoFTPProxy(void) {
11850 #if defined(LIBXML_FTP_ENABLED)
11851 char * host; /* the proxy host name */
11853 int port; /* the proxy port */
11855 char * user; /* the proxy user name */
11857 char * passwd; /* the proxy password */
11859 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11862 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11863 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11864 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11865 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11866 for (n_type = 0;n_type < gen_nb_int;n_type++) {
11867 host = gen_const_char_ptr(n_host, 0);
11868 port = gen_int(n_port, 1);
11869 user = gen_const_char_ptr(n_user, 2);
11870 passwd = gen_const_char_ptr(n_passwd, 3);
11871 type = gen_int(n_type, 4);
11873 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11875 des_const_char_ptr(n_host, (const char *)host, 0);
11876 des_int(n_port, port, 1);
11877 des_const_char_ptr(n_user, (const char *)user, 2);
11878 des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11879 des_int(n_type, type, 4);
11880 xmlResetLastError();
11894 test_xmlNanoFTPQuit(void) {
11897 #if defined(LIBXML_FTP_ENABLED)
11900 void * ctx; /* an FTP context */
11903 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11904 mem_base = xmlMemBlocks();
11905 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11907 ret_val = xmlNanoFTPQuit(ctx);
11908 desret_int(ret_val);
11910 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11911 xmlResetLastError();
11912 if (mem_base != xmlMemBlocks()) {
11913 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11914 xmlMemBlocks() - mem_base);
11916 printf(" %d", n_ctx);
11928 test_xmlNanoFTPRead(void) {
11931 #if defined(LIBXML_FTP_ENABLED)
11934 void * ctx; /* the FTP context */
11936 void * dest; /* a buffer */
11938 int len; /* the buffer length */
11941 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11942 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11943 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11944 mem_base = xmlMemBlocks();
11945 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11946 dest = gen_void_ptr(n_dest, 1);
11947 len = gen_int(n_len, 2);
11949 ret_val = xmlNanoFTPRead(ctx, dest, len);
11950 desret_int(ret_val);
11952 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11953 des_void_ptr(n_dest, dest, 1);
11954 des_int(n_len, len, 2);
11955 xmlResetLastError();
11956 if (mem_base != xmlMemBlocks()) {
11957 printf("Leak of %d blocks found in xmlNanoFTPRead",
11958 xmlMemBlocks() - mem_base);
11960 printf(" %d", n_ctx);
11961 printf(" %d", n_dest);
11962 printf(" %d", n_len);
11976 test_xmlNanoFTPScanProxy(void) {
11979 #if defined(LIBXML_FTP_ENABLED)
11980 const char * URL; /* The proxy URL used to initialize the proxy context */
11983 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11984 URL = gen_filepath(n_URL, 0);
11986 xmlNanoFTPScanProxy(URL);
11988 des_filepath(n_URL, URL, 0);
11989 xmlResetLastError();
11999 test_xmlNanoFTPUpdateURL(void) {
12002 #if defined(LIBXML_FTP_ENABLED)
12005 void * ctx; /* an FTP context */
12007 const char * URL; /* The URL used to update the context */
12010 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12011 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12012 mem_base = xmlMemBlocks();
12013 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12014 URL = gen_filepath(n_URL, 1);
12016 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12017 desret_int(ret_val);
12019 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12020 des_filepath(n_URL, URL, 1);
12021 xmlResetLastError();
12022 if (mem_base != xmlMemBlocks()) {
12023 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12024 xmlMemBlocks() - mem_base);
12026 printf(" %d", n_ctx);
12027 printf(" %d", n_URL);
12039 test_nanoftp(void) {
12042 if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12043 test_ret += test_xmlNanoFTPCheckResponse();
12044 test_ret += test_xmlNanoFTPCleanup();
12045 test_ret += test_xmlNanoFTPCloseConnection();
12046 test_ret += test_xmlNanoFTPCwd();
12047 test_ret += test_xmlNanoFTPDele();
12048 test_ret += test_xmlNanoFTPGet();
12049 test_ret += test_xmlNanoFTPGetConnection();
12050 test_ret += test_xmlNanoFTPGetResponse();
12051 test_ret += test_xmlNanoFTPGetSocket();
12052 test_ret += test_xmlNanoFTPInit();
12053 test_ret += test_xmlNanoFTPList();
12054 test_ret += test_xmlNanoFTPNewCtxt();
12055 test_ret += test_xmlNanoFTPOpen();
12056 test_ret += test_xmlNanoFTPProxy();
12057 test_ret += test_xmlNanoFTPQuit();
12058 test_ret += test_xmlNanoFTPRead();
12059 test_ret += test_xmlNanoFTPScanProxy();
12060 test_ret += test_xmlNanoFTPUpdateURL();
12063 printf("Module nanoftp: %d errors\n", test_ret);
12068 test_xmlNanoHTTPAuthHeader(void) {
12071 #if defined(LIBXML_HTTP_ENABLED)
12073 const char * ret_val;
12074 void * ctx; /* the HTTP context */
12077 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12078 mem_base = xmlMemBlocks();
12079 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12081 ret_val = xmlNanoHTTPAuthHeader(ctx);
12082 desret_const_char_ptr(ret_val);
12084 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12085 xmlResetLastError();
12086 if (mem_base != xmlMemBlocks()) {
12087 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12088 xmlMemBlocks() - mem_base);
12090 printf(" %d", n_ctx);
12102 test_xmlNanoHTTPCleanup(void) {
12105 #if defined(LIBXML_HTTP_ENABLED)
12108 mem_base = xmlMemBlocks();
12110 xmlNanoHTTPCleanup();
12112 xmlResetLastError();
12113 if (mem_base != xmlMemBlocks()) {
12114 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12115 xmlMemBlocks() - mem_base);
12127 test_xmlNanoHTTPContentLength(void) {
12130 #if defined(LIBXML_HTTP_ENABLED)
12133 void * ctx; /* the HTTP context */
12136 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12137 mem_base = xmlMemBlocks();
12138 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12140 ret_val = xmlNanoHTTPContentLength(ctx);
12141 desret_int(ret_val);
12143 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12144 xmlResetLastError();
12145 if (mem_base != xmlMemBlocks()) {
12146 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12147 xmlMemBlocks() - mem_base);
12149 printf(" %d", n_ctx);
12161 test_xmlNanoHTTPEncoding(void) {
12164 #if defined(LIBXML_HTTP_ENABLED)
12166 const char * ret_val;
12167 void * ctx; /* the HTTP context */
12170 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12171 mem_base = xmlMemBlocks();
12172 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12174 ret_val = xmlNanoHTTPEncoding(ctx);
12175 desret_const_char_ptr(ret_val);
12177 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12178 xmlResetLastError();
12179 if (mem_base != xmlMemBlocks()) {
12180 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12181 xmlMemBlocks() - mem_base);
12183 printf(" %d", n_ctx);
12194 #define gen_nb_char_ptr_ptr 1
12195 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12198 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12202 test_xmlNanoHTTPFetch(void) {
12205 #if defined(LIBXML_HTTP_ENABLED)
12208 const char * URL; /* The URL to load */
12210 const char * filename; /* the filename where the content should be saved */
12212 char ** contentType; /* if available the Content-Type information will be returned at that location */
12215 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12216 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12217 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12218 mem_base = xmlMemBlocks();
12219 URL = gen_fileoutput(n_URL, 0);
12220 filename = gen_fileoutput(n_filename, 1);
12221 contentType = gen_char_ptr_ptr(n_contentType, 2);
12223 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12224 desret_int(ret_val);
12226 des_fileoutput(n_URL, URL, 0);
12227 des_fileoutput(n_filename, filename, 1);
12228 des_char_ptr_ptr(n_contentType, contentType, 2);
12229 xmlResetLastError();
12230 if (mem_base != xmlMemBlocks()) {
12231 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12232 xmlMemBlocks() - mem_base);
12234 printf(" %d", n_URL);
12235 printf(" %d", n_filename);
12236 printf(" %d", n_contentType);
12250 test_xmlNanoHTTPInit(void) {
12253 #if defined(LIBXML_HTTP_ENABLED)
12256 mem_base = xmlMemBlocks();
12260 xmlResetLastError();
12261 if (mem_base != xmlMemBlocks()) {
12262 printf("Leak of %d blocks found in xmlNanoHTTPInit",
12263 xmlMemBlocks() - mem_base);
12275 test_xmlNanoHTTPMimeType(void) {
12278 #if defined(LIBXML_HTTP_ENABLED)
12280 const char * ret_val;
12281 void * ctx; /* the HTTP context */
12284 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12285 mem_base = xmlMemBlocks();
12286 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12288 ret_val = xmlNanoHTTPMimeType(ctx);
12289 desret_const_char_ptr(ret_val);
12291 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12292 xmlResetLastError();
12293 if (mem_base != xmlMemBlocks()) {
12294 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12295 xmlMemBlocks() - mem_base);
12297 printf(" %d", n_ctx);
12309 test_xmlNanoHTTPOpen(void) {
12312 #if defined(LIBXML_HTTP_ENABLED)
12315 const char * URL; /* The URL to load */
12317 char ** contentType; /* if available the Content-Type information will be returned at that location */
12320 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12321 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12322 mem_base = xmlMemBlocks();
12323 URL = gen_filepath(n_URL, 0);
12324 contentType = gen_char_ptr_ptr(n_contentType, 1);
12326 ret_val = xmlNanoHTTPOpen(URL, contentType);
12327 desret_xmlNanoHTTPCtxtPtr(ret_val);
12329 des_filepath(n_URL, URL, 0);
12330 des_char_ptr_ptr(n_contentType, contentType, 1);
12331 xmlResetLastError();
12332 if (mem_base != xmlMemBlocks()) {
12333 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12334 xmlMemBlocks() - mem_base);
12336 printf(" %d", n_URL);
12337 printf(" %d", n_contentType);
12350 test_xmlNanoHTTPOpenRedir(void) {
12353 #if defined(LIBXML_HTTP_ENABLED)
12356 const char * URL; /* The URL to load */
12358 char ** contentType; /* if available the Content-Type information will be returned at that location */
12360 char ** redir; /* if available the redirected URL will be returned */
12363 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12364 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12365 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12366 mem_base = xmlMemBlocks();
12367 URL = gen_filepath(n_URL, 0);
12368 contentType = gen_char_ptr_ptr(n_contentType, 1);
12369 redir = gen_char_ptr_ptr(n_redir, 2);
12371 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12372 desret_xmlNanoHTTPCtxtPtr(ret_val);
12374 des_filepath(n_URL, URL, 0);
12375 des_char_ptr_ptr(n_contentType, contentType, 1);
12376 des_char_ptr_ptr(n_redir, redir, 2);
12377 xmlResetLastError();
12378 if (mem_base != xmlMemBlocks()) {
12379 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12380 xmlMemBlocks() - mem_base);
12382 printf(" %d", n_URL);
12383 printf(" %d", n_contentType);
12384 printf(" %d", n_redir);
12398 test_xmlNanoHTTPRead(void) {
12401 #if defined(LIBXML_HTTP_ENABLED)
12404 void * ctx; /* the HTTP context */
12406 void * dest; /* a buffer */
12408 int len; /* the buffer length */
12411 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12412 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12413 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12414 mem_base = xmlMemBlocks();
12415 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12416 dest = gen_void_ptr(n_dest, 1);
12417 len = gen_int(n_len, 2);
12419 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12420 desret_int(ret_val);
12422 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12423 des_void_ptr(n_dest, dest, 1);
12424 des_int(n_len, len, 2);
12425 xmlResetLastError();
12426 if (mem_base != xmlMemBlocks()) {
12427 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12428 xmlMemBlocks() - mem_base);
12430 printf(" %d", n_ctx);
12431 printf(" %d", n_dest);
12432 printf(" %d", n_len);
12446 test_xmlNanoHTTPRedir(void) {
12450 /* missing type support */
12456 test_xmlNanoHTTPReturnCode(void) {
12459 #if defined(LIBXML_HTTP_ENABLED)
12462 void * ctx; /* the HTTP context */
12465 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12466 mem_base = xmlMemBlocks();
12467 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12469 ret_val = xmlNanoHTTPReturnCode(ctx);
12470 desret_int(ret_val);
12472 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12473 xmlResetLastError();
12474 if (mem_base != xmlMemBlocks()) {
12475 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12476 xmlMemBlocks() - mem_base);
12478 printf(" %d", n_ctx);
12490 test_xmlNanoHTTPSave(void) {
12493 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12496 void * ctxt; /* the HTTP context */
12498 const char * filename; /* the filename where the content should be saved */
12501 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12502 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12503 mem_base = xmlMemBlocks();
12504 ctxt = gen_void_ptr(n_ctxt, 0);
12505 filename = gen_fileoutput(n_filename, 1);
12507 ret_val = xmlNanoHTTPSave(ctxt, filename);
12508 desret_int(ret_val);
12510 des_void_ptr(n_ctxt, ctxt, 0);
12511 des_fileoutput(n_filename, filename, 1);
12512 xmlResetLastError();
12513 if (mem_base != xmlMemBlocks()) {
12514 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12515 xmlMemBlocks() - mem_base);
12517 printf(" %d", n_ctxt);
12518 printf(" %d", n_filename);
12531 test_xmlNanoHTTPScanProxy(void) {
12534 #if defined(LIBXML_HTTP_ENABLED)
12535 const char * URL; /* The proxy URL used to initialize the proxy context */
12538 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12539 URL = gen_filepath(n_URL, 0);
12541 xmlNanoHTTPScanProxy(URL);
12543 des_filepath(n_URL, URL, 0);
12544 xmlResetLastError();
12553 test_nanohttp(void) {
12556 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12557 test_ret += test_xmlNanoHTTPAuthHeader();
12558 test_ret += test_xmlNanoHTTPCleanup();
12559 test_ret += test_xmlNanoHTTPContentLength();
12560 test_ret += test_xmlNanoHTTPEncoding();
12561 test_ret += test_xmlNanoHTTPFetch();
12562 test_ret += test_xmlNanoHTTPInit();
12563 test_ret += test_xmlNanoHTTPMimeType();
12564 test_ret += test_xmlNanoHTTPOpen();
12565 test_ret += test_xmlNanoHTTPOpenRedir();
12566 test_ret += test_xmlNanoHTTPRead();
12567 test_ret += test_xmlNanoHTTPRedir();
12568 test_ret += test_xmlNanoHTTPReturnCode();
12569 test_ret += test_xmlNanoHTTPSave();
12570 test_ret += test_xmlNanoHTTPScanProxy();
12573 printf("Module nanohttp: %d errors\n", test_ret);
12578 test_xmlByteConsumed(void) {
12583 xmlParserCtxtPtr ctxt; /* an XML parser context */
12586 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12587 mem_base = xmlMemBlocks();
12588 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12590 ret_val = xmlByteConsumed(ctxt);
12591 desret_long(ret_val);
12593 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12594 xmlResetLastError();
12595 if (mem_base != xmlMemBlocks()) {
12596 printf("Leak of %d blocks found in xmlByteConsumed",
12597 xmlMemBlocks() - mem_base);
12599 printf(" %d", n_ctxt);
12610 test_xmlClearNodeInfoSeq(void) {
12614 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12617 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12618 mem_base = xmlMemBlocks();
12619 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12621 xmlClearNodeInfoSeq(seq);
12623 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12624 xmlResetLastError();
12625 if (mem_base != xmlMemBlocks()) {
12626 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12627 xmlMemBlocks() - mem_base);
12629 printf(" %d", n_seq);
12640 test_xmlClearParserCtxt(void) {
12644 xmlParserCtxtPtr ctxt; /* an XML parser context */
12647 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12648 mem_base = xmlMemBlocks();
12649 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12651 xmlClearParserCtxt(ctxt);
12653 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12654 xmlResetLastError();
12655 if (mem_base != xmlMemBlocks()) {
12656 printf("Leak of %d blocks found in xmlClearParserCtxt",
12657 xmlMemBlocks() - mem_base);
12659 printf(" %d", n_ctxt);
12670 test_xmlCreateDocParserCtxt(void) {
12674 xmlParserCtxtPtr ret_val;
12675 xmlChar * cur; /* a pointer to an array of xmlChar */
12678 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12679 mem_base = xmlMemBlocks();
12680 cur = gen_const_xmlChar_ptr(n_cur, 0);
12682 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12683 desret_xmlParserCtxtPtr(ret_val);
12685 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12686 xmlResetLastError();
12687 if (mem_base != xmlMemBlocks()) {
12688 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12689 xmlMemBlocks() - mem_base);
12691 printf(" %d", n_cur);
12702 test_xmlCreatePushParserCtxt(void) {
12705 #if defined(LIBXML_PUSH_ENABLED)
12707 xmlParserCtxtPtr ret_val;
12708 xmlSAXHandlerPtr sax; /* a SAX handler */
12710 void * user_data; /* The user data returned on SAX callbacks */
12712 char * chunk; /* a pointer to an array of chars */
12714 int size; /* number of chars in the array */
12716 const char * filename; /* an optional file name or URI */
12719 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12720 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12721 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12722 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12723 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12724 mem_base = xmlMemBlocks();
12725 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12726 user_data = gen_userdata(n_user_data, 1);
12727 chunk = gen_const_char_ptr(n_chunk, 2);
12728 size = gen_int(n_size, 3);
12729 filename = gen_fileoutput(n_filename, 4);
12731 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12732 desret_xmlParserCtxtPtr(ret_val);
12734 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12735 des_userdata(n_user_data, user_data, 1);
12736 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12737 des_int(n_size, size, 3);
12738 des_fileoutput(n_filename, filename, 4);
12739 xmlResetLastError();
12740 if (mem_base != xmlMemBlocks()) {
12741 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12742 xmlMemBlocks() - mem_base);
12744 printf(" %d", n_sax);
12745 printf(" %d", n_user_data);
12746 printf(" %d", n_chunk);
12747 printf(" %d", n_size);
12748 printf(" %d", n_filename);
12764 test_xmlCtxtReadDoc(void) {
12769 xmlParserCtxtPtr ctxt; /* an XML parser context */
12771 xmlChar * cur; /* a pointer to a zero terminated string */
12773 const char * URL; /* the base URL to use for the document */
12775 char * encoding; /* the document encoding, or NULL */
12777 int options; /* a combination of xmlParserOption */
12780 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12781 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12782 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12783 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12784 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12785 mem_base = xmlMemBlocks();
12786 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12787 cur = gen_const_xmlChar_ptr(n_cur, 1);
12788 URL = gen_filepath(n_URL, 2);
12789 encoding = gen_const_char_ptr(n_encoding, 3);
12790 options = gen_parseroptions(n_options, 4);
12792 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12793 desret_xmlDocPtr(ret_val);
12795 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12796 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12797 des_filepath(n_URL, URL, 2);
12798 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12799 des_parseroptions(n_options, options, 4);
12800 xmlResetLastError();
12801 if (mem_base != xmlMemBlocks()) {
12802 printf("Leak of %d blocks found in xmlCtxtReadDoc",
12803 xmlMemBlocks() - mem_base);
12805 printf(" %d", n_ctxt);
12806 printf(" %d", n_cur);
12807 printf(" %d", n_URL);
12808 printf(" %d", n_encoding);
12809 printf(" %d", n_options);
12824 test_xmlCtxtReadFile(void) {
12829 xmlParserCtxtPtr ctxt; /* an XML parser context */
12831 const char * filename; /* a file or URL */
12833 char * encoding; /* the document encoding, or NULL */
12835 int options; /* a combination of xmlParserOption */
12838 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12839 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12840 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12841 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12842 mem_base = xmlMemBlocks();
12843 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12844 filename = gen_filepath(n_filename, 1);
12845 encoding = gen_const_char_ptr(n_encoding, 2);
12846 options = gen_parseroptions(n_options, 3);
12848 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12849 desret_xmlDocPtr(ret_val);
12851 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12852 des_filepath(n_filename, filename, 1);
12853 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12854 des_parseroptions(n_options, options, 3);
12855 xmlResetLastError();
12856 if (mem_base != xmlMemBlocks()) {
12857 printf("Leak of %d blocks found in xmlCtxtReadFile",
12858 xmlMemBlocks() - mem_base);
12860 printf(" %d", n_ctxt);
12861 printf(" %d", n_filename);
12862 printf(" %d", n_encoding);
12863 printf(" %d", n_options);
12877 test_xmlCtxtReadMemory(void) {
12882 xmlParserCtxtPtr ctxt; /* an XML parser context */
12884 char * buffer; /* a pointer to a char array */
12886 int size; /* the size of the array */
12888 const char * URL; /* the base URL to use for the document */
12890 char * encoding; /* the document encoding, or NULL */
12892 int options; /* a combination of xmlParserOption */
12895 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12896 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12897 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12898 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12899 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12900 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12901 mem_base = xmlMemBlocks();
12902 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12903 buffer = gen_const_char_ptr(n_buffer, 1);
12904 size = gen_int(n_size, 2);
12905 URL = gen_filepath(n_URL, 3);
12906 encoding = gen_const_char_ptr(n_encoding, 4);
12907 options = gen_parseroptions(n_options, 5);
12909 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12910 desret_xmlDocPtr(ret_val);
12912 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12913 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12914 des_int(n_size, size, 2);
12915 des_filepath(n_URL, URL, 3);
12916 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12917 des_parseroptions(n_options, options, 5);
12918 xmlResetLastError();
12919 if (mem_base != xmlMemBlocks()) {
12920 printf("Leak of %d blocks found in xmlCtxtReadMemory",
12921 xmlMemBlocks() - mem_base);
12923 printf(" %d", n_ctxt);
12924 printf(" %d", n_buffer);
12925 printf(" %d", n_size);
12926 printf(" %d", n_URL);
12927 printf(" %d", n_encoding);
12928 printf(" %d", n_options);
12944 test_xmlCtxtReset(void) {
12948 xmlParserCtxtPtr ctxt; /* an XML parser context */
12951 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12952 mem_base = xmlMemBlocks();
12953 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12955 xmlCtxtReset(ctxt);
12957 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12958 xmlResetLastError();
12959 if (mem_base != xmlMemBlocks()) {
12960 printf("Leak of %d blocks found in xmlCtxtReset",
12961 xmlMemBlocks() - mem_base);
12963 printf(" %d", n_ctxt);
12974 test_xmlCtxtResetPush(void) {
12979 xmlParserCtxtPtr ctxt; /* an XML parser context */
12981 char * chunk; /* a pointer to an array of chars */
12983 int size; /* number of chars in the array */
12985 const char * filename; /* an optional file name or URI */
12987 char * encoding; /* the document encoding, or NULL */
12990 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12991 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12992 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12993 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12994 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12995 mem_base = xmlMemBlocks();
12996 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12997 chunk = gen_const_char_ptr(n_chunk, 1);
12998 size = gen_int(n_size, 2);
12999 filename = gen_filepath(n_filename, 3);
13000 encoding = gen_const_char_ptr(n_encoding, 4);
13002 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13003 desret_int(ret_val);
13005 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13006 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13007 des_int(n_size, size, 2);
13008 des_filepath(n_filename, filename, 3);
13009 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13010 xmlResetLastError();
13011 if (mem_base != xmlMemBlocks()) {
13012 printf("Leak of %d blocks found in xmlCtxtResetPush",
13013 xmlMemBlocks() - mem_base);
13015 printf(" %d", n_ctxt);
13016 printf(" %d", n_chunk);
13017 printf(" %d", n_size);
13018 printf(" %d", n_filename);
13019 printf(" %d", n_encoding);
13034 test_xmlCtxtUseOptions(void) {
13039 xmlParserCtxtPtr ctxt; /* an XML parser context */
13041 int options; /* a combination of xmlParserOption */
13044 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13045 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13046 mem_base = xmlMemBlocks();
13047 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13048 options = gen_parseroptions(n_options, 1);
13050 ret_val = xmlCtxtUseOptions(ctxt, options);
13051 desret_int(ret_val);
13053 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13054 des_parseroptions(n_options, options, 1);
13055 xmlResetLastError();
13056 if (mem_base != xmlMemBlocks()) {
13057 printf("Leak of %d blocks found in xmlCtxtUseOptions",
13058 xmlMemBlocks() - mem_base);
13060 printf(" %d", n_ctxt);
13061 printf(" %d", n_options);
13073 test_xmlGetExternalEntityLoader(void) {
13077 /* missing type support */
13083 test_xmlGetFeature(void) {
13086 #if defined(LIBXML_LEGACY_ENABLED)
13087 #ifdef LIBXML_LEGACY_ENABLED
13090 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13092 char * name; /* the feature name */
13094 void * result; /* location to store the result */
13097 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13098 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13099 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13100 mem_base = xmlMemBlocks();
13101 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13102 name = gen_const_char_ptr(n_name, 1);
13103 result = gen_void_ptr(n_result, 2);
13105 ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13106 desret_int(ret_val);
13108 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13109 des_const_char_ptr(n_name, (const char *)name, 1);
13110 des_void_ptr(n_result, result, 2);
13111 xmlResetLastError();
13112 if (mem_base != xmlMemBlocks()) {
13113 printf("Leak of %d blocks found in xmlGetFeature",
13114 xmlMemBlocks() - mem_base);
13116 printf(" %d", n_ctxt);
13117 printf(" %d", n_name);
13118 printf(" %d", n_result);
13132 #define gen_nb_const_char_ptr_ptr 1
13133 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13136 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13140 test_xmlGetFeaturesList(void) {
13143 #if defined(LIBXML_LEGACY_ENABLED)
13144 #ifdef LIBXML_LEGACY_ENABLED
13147 int * len; /* the length of the features name array (input/output) */
13149 char ** result; /* an array of string to be filled with the features name. */
13152 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13153 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13154 mem_base = xmlMemBlocks();
13155 len = gen_int_ptr(n_len, 0);
13156 result = gen_const_char_ptr_ptr(n_result, 1);
13158 ret_val = xmlGetFeaturesList(len, (const char **)result);
13159 desret_int(ret_val);
13161 des_int_ptr(n_len, len, 0);
13162 des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13163 xmlResetLastError();
13164 if (mem_base != xmlMemBlocks()) {
13165 printf("Leak of %d blocks found in xmlGetFeaturesList",
13166 xmlMemBlocks() - mem_base);
13168 printf(" %d", n_len);
13169 printf(" %d", n_result);
13183 test_xmlHasFeature(void) {
13188 xmlFeature feature; /* the feature to be examined */
13191 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13192 mem_base = xmlMemBlocks();
13193 feature = gen_xmlFeature(n_feature, 0);
13195 ret_val = xmlHasFeature(feature);
13196 desret_int(ret_val);
13198 des_xmlFeature(n_feature, feature, 0);
13199 xmlResetLastError();
13200 if (mem_base != xmlMemBlocks()) {
13201 printf("Leak of %d blocks found in xmlHasFeature",
13202 xmlMemBlocks() - mem_base);
13204 printf(" %d", n_feature);
13215 test_xmlIOParseDTD(void) {
13218 #if defined(LIBXML_VALID_ENABLED)
13219 #ifdef LIBXML_VALID_ENABLED
13221 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13223 xmlParserInputBufferPtr input; /* an Input Buffer */
13225 xmlCharEncoding enc; /* the charset encoding if known */
13228 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13229 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13230 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13231 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13232 input = gen_xmlParserInputBufferPtr(n_input, 1);
13233 enc = gen_xmlCharEncoding(n_enc, 2);
13235 ret_val = xmlIOParseDTD(sax, input, enc);
13237 desret_xmlDtdPtr(ret_val);
13239 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13240 des_xmlParserInputBufferPtr(n_input, input, 1);
13241 des_xmlCharEncoding(n_enc, enc, 2);
13242 xmlResetLastError();
13255 test_xmlInitNodeInfoSeq(void) {
13259 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13262 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13263 mem_base = xmlMemBlocks();
13264 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13266 xmlInitNodeInfoSeq(seq);
13268 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13269 xmlResetLastError();
13270 if (mem_base != xmlMemBlocks()) {
13271 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13272 xmlMemBlocks() - mem_base);
13274 printf(" %d", n_seq);
13285 test_xmlInitParser(void) {
13290 mem_base = xmlMemBlocks();
13294 xmlResetLastError();
13295 if (mem_base != xmlMemBlocks()) {
13296 printf("Leak of %d blocks found in xmlInitParser",
13297 xmlMemBlocks() - mem_base);
13308 test_xmlInitParserCtxt(void) {
13313 xmlParserCtxtPtr ctxt; /* an XML parser context */
13316 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13317 mem_base = xmlMemBlocks();
13318 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13320 ret_val = xmlInitParserCtxt(ctxt);
13321 desret_int(ret_val);
13323 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13324 xmlResetLastError();
13325 if (mem_base != xmlMemBlocks()) {
13326 printf("Leak of %d blocks found in xmlInitParserCtxt",
13327 xmlMemBlocks() - mem_base);
13329 printf(" %d", n_ctxt);
13340 test_xmlKeepBlanksDefault(void) {
13345 int val; /* int 0 or 1 */
13348 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13349 mem_base = xmlMemBlocks();
13350 val = gen_int(n_val, 0);
13352 ret_val = xmlKeepBlanksDefault(val);
13353 desret_int(ret_val);
13355 des_int(n_val, val, 0);
13356 xmlResetLastError();
13357 if (mem_base != xmlMemBlocks()) {
13358 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13359 xmlMemBlocks() - mem_base);
13361 printf(" %d", n_val);
13372 test_xmlLineNumbersDefault(void) {
13377 int val; /* int 0 or 1 */
13380 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13381 mem_base = xmlMemBlocks();
13382 val = gen_int(n_val, 0);
13384 ret_val = xmlLineNumbersDefault(val);
13385 desret_int(ret_val);
13387 des_int(n_val, val, 0);
13388 xmlResetLastError();
13389 if (mem_base != xmlMemBlocks()) {
13390 printf("Leak of %d blocks found in xmlLineNumbersDefault",
13391 xmlMemBlocks() - mem_base);
13393 printf(" %d", n_val);
13404 test_xmlLoadExternalEntity(void) {
13408 xmlParserInputPtr ret_val;
13409 const char * URL; /* the URL for the entity to load */
13411 char * ID; /* the Public ID for the entity to load */
13413 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13416 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13417 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13418 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13419 mem_base = xmlMemBlocks();
13420 URL = gen_filepath(n_URL, 0);
13421 ID = gen_const_char_ptr(n_ID, 1);
13422 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13424 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13425 desret_xmlParserInputPtr(ret_val);
13427 des_filepath(n_URL, URL, 0);
13428 des_const_char_ptr(n_ID, (const char *)ID, 1);
13429 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13430 xmlResetLastError();
13431 if (mem_base != xmlMemBlocks()) {
13432 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13433 xmlMemBlocks() - mem_base);
13435 printf(" %d", n_URL);
13436 printf(" %d", n_ID);
13437 printf(" %d", n_ctxt);
13450 test_xmlNewIOInputStream(void) {
13454 xmlParserInputPtr ret_val;
13455 xmlParserCtxtPtr ctxt; /* an XML parser context */
13457 xmlParserInputBufferPtr input; /* an I/O Input */
13459 xmlCharEncoding enc; /* the charset encoding if known */
13462 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13463 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13464 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13465 mem_base = xmlMemBlocks();
13466 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13467 input = gen_xmlParserInputBufferPtr(n_input, 1);
13468 enc = gen_xmlCharEncoding(n_enc, 2);
13470 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13471 if (ret_val != NULL) input = NULL;
13472 desret_xmlParserInputPtr(ret_val);
13474 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13475 des_xmlParserInputBufferPtr(n_input, input, 1);
13476 des_xmlCharEncoding(n_enc, enc, 2);
13477 xmlResetLastError();
13478 if (mem_base != xmlMemBlocks()) {
13479 printf("Leak of %d blocks found in xmlNewIOInputStream",
13480 xmlMemBlocks() - mem_base);
13482 printf(" %d", n_ctxt);
13483 printf(" %d", n_input);
13484 printf(" %d", n_enc);
13497 test_xmlNewParserCtxt(void) {
13501 xmlParserCtxtPtr ret_val;
13503 mem_base = xmlMemBlocks();
13505 ret_val = xmlNewParserCtxt();
13506 desret_xmlParserCtxtPtr(ret_val);
13508 xmlResetLastError();
13509 if (mem_base != xmlMemBlocks()) {
13510 printf("Leak of %d blocks found in xmlNewParserCtxt",
13511 xmlMemBlocks() - mem_base);
13521 #define gen_nb_xmlNodePtr_ptr 1
13522 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13525 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13529 test_xmlParseBalancedChunkMemory(void) {
13532 #if defined(LIBXML_SAX1_ENABLED)
13533 #ifdef LIBXML_SAX1_ENABLED
13536 xmlDocPtr doc; /* the document the chunk pertains to */
13538 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13540 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13542 int depth; /* Used for loop detection, use 0 */
13544 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13546 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13549 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13550 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13551 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13552 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13553 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13554 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13555 mem_base = xmlMemBlocks();
13556 doc = gen_xmlDocPtr(n_doc, 0);
13557 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13558 user_data = gen_userdata(n_user_data, 2);
13559 depth = gen_int(n_depth, 3);
13560 string = gen_const_xmlChar_ptr(n_string, 4);
13561 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13563 #ifdef LIBXML_SAX1_ENABLED
13564 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13568 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13569 desret_int(ret_val);
13571 des_xmlDocPtr(n_doc, doc, 0);
13572 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13573 des_userdata(n_user_data, user_data, 2);
13574 des_int(n_depth, depth, 3);
13575 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13576 des_xmlNodePtr_ptr(n_lst, lst, 5);
13577 xmlResetLastError();
13578 if (mem_base != xmlMemBlocks()) {
13579 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13580 xmlMemBlocks() - mem_base);
13582 printf(" %d", n_doc);
13583 printf(" %d", n_sax);
13584 printf(" %d", n_user_data);
13585 printf(" %d", n_depth);
13586 printf(" %d", n_string);
13587 printf(" %d", n_lst);
13605 test_xmlParseBalancedChunkMemoryRecover(void) {
13608 #if defined(LIBXML_SAX1_ENABLED)
13609 #ifdef LIBXML_SAX1_ENABLED
13612 xmlDocPtr doc; /* the document the chunk pertains to */
13614 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13616 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13618 int depth; /* Used for loop detection, use 0 */
13620 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13622 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13624 int recover; /* return nodes even if the data is broken (use 0) */
13627 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13628 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13629 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13630 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13631 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13632 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13633 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13634 mem_base = xmlMemBlocks();
13635 doc = gen_xmlDocPtr(n_doc, 0);
13636 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13637 user_data = gen_userdata(n_user_data, 2);
13638 depth = gen_int(n_depth, 3);
13639 string = gen_const_xmlChar_ptr(n_string, 4);
13640 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13641 recover = gen_int(n_recover, 6);
13643 #ifdef LIBXML_SAX1_ENABLED
13644 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13648 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13649 desret_int(ret_val);
13651 des_xmlDocPtr(n_doc, doc, 0);
13652 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13653 des_userdata(n_user_data, user_data, 2);
13654 des_int(n_depth, depth, 3);
13655 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13656 des_xmlNodePtr_ptr(n_lst, lst, 5);
13657 des_int(n_recover, recover, 6);
13658 xmlResetLastError();
13659 if (mem_base != xmlMemBlocks()) {
13660 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13661 xmlMemBlocks() - mem_base);
13663 printf(" %d", n_doc);
13664 printf(" %d", n_sax);
13665 printf(" %d", n_user_data);
13666 printf(" %d", n_depth);
13667 printf(" %d", n_string);
13668 printf(" %d", n_lst);
13669 printf(" %d", n_recover);
13688 test_xmlParseChunk(void) {
13691 #if defined(LIBXML_PUSH_ENABLED)
13694 xmlParserCtxtPtr ctxt; /* an XML parser context */
13696 char * chunk; /* an char array */
13698 int size; /* the size in byte of the chunk */
13700 int terminate; /* last chunk indicator */
13703 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13704 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13705 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13706 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13707 mem_base = xmlMemBlocks();
13708 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13709 chunk = gen_const_char_ptr(n_chunk, 1);
13710 size = gen_int(n_size, 2);
13711 terminate = gen_int(n_terminate, 3);
13713 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13714 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13715 desret_int(ret_val);
13717 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13718 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13719 des_int(n_size, size, 2);
13720 des_int(n_terminate, terminate, 3);
13721 xmlResetLastError();
13722 if (mem_base != xmlMemBlocks()) {
13723 printf("Leak of %d blocks found in xmlParseChunk",
13724 xmlMemBlocks() - mem_base);
13726 printf(" %d", n_ctxt);
13727 printf(" %d", n_chunk);
13728 printf(" %d", n_size);
13729 printf(" %d", n_terminate);
13744 test_xmlParseCtxtExternalEntity(void) {
13749 xmlParserCtxtPtr ctx; /* the existing parsing context */
13751 xmlChar * URL; /* the URL for the entity to load */
13753 xmlChar * ID; /* the System ID for the entity to load */
13755 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13758 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13759 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13760 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13761 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13762 mem_base = xmlMemBlocks();
13763 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13764 URL = gen_const_xmlChar_ptr(n_URL, 1);
13765 ID = gen_const_xmlChar_ptr(n_ID, 2);
13766 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13768 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13769 desret_int(ret_val);
13771 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13772 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13773 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13774 des_xmlNodePtr_ptr(n_lst, lst, 3);
13775 xmlResetLastError();
13776 if (mem_base != xmlMemBlocks()) {
13777 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13778 xmlMemBlocks() - mem_base);
13780 printf(" %d", n_ctx);
13781 printf(" %d", n_URL);
13782 printf(" %d", n_ID);
13783 printf(" %d", n_lst);
13797 test_xmlParseDTD(void) {
13800 #if defined(LIBXML_VALID_ENABLED)
13801 #ifdef LIBXML_VALID_ENABLED
13804 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13806 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13809 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13810 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13811 mem_base = xmlMemBlocks();
13812 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13813 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13815 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13816 desret_xmlDtdPtr(ret_val);
13818 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13819 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13820 xmlResetLastError();
13821 if (mem_base != xmlMemBlocks()) {
13822 printf("Leak of %d blocks found in xmlParseDTD",
13823 xmlMemBlocks() - mem_base);
13825 printf(" %d", n_ExternalID);
13826 printf(" %d", n_SystemID);
13840 test_xmlParseDoc(void) {
13843 #if defined(LIBXML_SAX1_ENABLED)
13844 #ifdef LIBXML_SAX1_ENABLED
13847 xmlChar * cur; /* a pointer to an array of xmlChar */
13850 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13851 mem_base = xmlMemBlocks();
13852 cur = gen_const_xmlChar_ptr(n_cur, 0);
13854 ret_val = xmlParseDoc((const xmlChar *)cur);
13855 desret_xmlDocPtr(ret_val);
13857 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13858 xmlResetLastError();
13859 if (mem_base != xmlMemBlocks()) {
13860 printf("Leak of %d blocks found in xmlParseDoc",
13861 xmlMemBlocks() - mem_base);
13863 printf(" %d", n_cur);
13876 test_xmlParseDocument(void) {
13881 xmlParserCtxtPtr ctxt; /* an XML parser context */
13884 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13885 mem_base = xmlMemBlocks();
13886 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13888 ret_val = xmlParseDocument(ctxt);
13889 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13890 desret_int(ret_val);
13892 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13893 xmlResetLastError();
13894 if (mem_base != xmlMemBlocks()) {
13895 printf("Leak of %d blocks found in xmlParseDocument",
13896 xmlMemBlocks() - mem_base);
13898 printf(" %d", n_ctxt);
13909 test_xmlParseEntity(void) {
13912 #if defined(LIBXML_SAX1_ENABLED)
13913 #ifdef LIBXML_SAX1_ENABLED
13916 const char * filename; /* the filename */
13919 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13920 mem_base = xmlMemBlocks();
13921 filename = gen_filepath(n_filename, 0);
13923 ret_val = xmlParseEntity(filename);
13924 desret_xmlDocPtr(ret_val);
13926 des_filepath(n_filename, filename, 0);
13927 xmlResetLastError();
13928 if (mem_base != xmlMemBlocks()) {
13929 printf("Leak of %d blocks found in xmlParseEntity",
13930 xmlMemBlocks() - mem_base);
13932 printf(" %d", n_filename);
13945 test_xmlParseExtParsedEnt(void) {
13950 xmlParserCtxtPtr ctxt; /* an XML parser context */
13953 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13954 mem_base = xmlMemBlocks();
13955 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13957 ret_val = xmlParseExtParsedEnt(ctxt);
13958 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13959 desret_int(ret_val);
13961 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13962 xmlResetLastError();
13963 if (mem_base != xmlMemBlocks()) {
13964 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13965 xmlMemBlocks() - mem_base);
13967 printf(" %d", n_ctxt);
13978 test_xmlParseExternalEntity(void) {
13981 #if defined(LIBXML_SAX1_ENABLED)
13982 #ifdef LIBXML_SAX1_ENABLED
13985 xmlDocPtr doc; /* the document the chunk pertains to */
13987 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13989 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13991 int depth; /* Used for loop detection, use 0 */
13993 xmlChar * URL; /* the URL for the entity to load */
13995 xmlChar * ID; /* the System ID for the entity to load */
13997 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14000 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14001 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14002 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14003 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14004 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14005 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14006 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14007 mem_base = xmlMemBlocks();
14008 doc = gen_xmlDocPtr(n_doc, 0);
14009 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14010 user_data = gen_userdata(n_user_data, 2);
14011 depth = gen_int(n_depth, 3);
14012 URL = gen_const_xmlChar_ptr(n_URL, 4);
14013 ID = gen_const_xmlChar_ptr(n_ID, 5);
14014 lst = gen_xmlNodePtr_ptr(n_lst, 6);
14016 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14017 desret_int(ret_val);
14019 des_xmlDocPtr(n_doc, doc, 0);
14020 des_xmlSAXHandlerPtr(n_sax, sax, 1);
14021 des_userdata(n_user_data, user_data, 2);
14022 des_int(n_depth, depth, 3);
14023 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14024 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14025 des_xmlNodePtr_ptr(n_lst, lst, 6);
14026 xmlResetLastError();
14027 if (mem_base != xmlMemBlocks()) {
14028 printf("Leak of %d blocks found in xmlParseExternalEntity",
14029 xmlMemBlocks() - mem_base);
14031 printf(" %d", n_doc);
14032 printf(" %d", n_sax);
14033 printf(" %d", n_user_data);
14034 printf(" %d", n_depth);
14035 printf(" %d", n_URL);
14036 printf(" %d", n_ID);
14037 printf(" %d", n_lst);
14056 test_xmlParseFile(void) {
14059 #if defined(LIBXML_SAX1_ENABLED)
14060 #ifdef LIBXML_SAX1_ENABLED
14063 const char * filename; /* the filename */
14066 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14067 mem_base = xmlMemBlocks();
14068 filename = gen_filepath(n_filename, 0);
14070 ret_val = xmlParseFile(filename);
14071 desret_xmlDocPtr(ret_val);
14073 des_filepath(n_filename, filename, 0);
14074 xmlResetLastError();
14075 if (mem_base != xmlMemBlocks()) {
14076 printf("Leak of %d blocks found in xmlParseFile",
14077 xmlMemBlocks() - mem_base);
14079 printf(" %d", n_filename);
14092 test_xmlParseInNodeContext(void) {
14096 xmlParserErrors ret_val;
14097 xmlNodePtr node; /* the context node */
14099 char * data; /* the input string */
14101 int datalen; /* the input string length in bytes */
14103 int options; /* a combination of xmlParserOption */
14105 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14108 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14109 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14110 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14111 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14112 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14113 mem_base = xmlMemBlocks();
14114 node = gen_xmlNodePtr(n_node, 0);
14115 data = gen_const_char_ptr(n_data, 1);
14116 datalen = gen_int(n_datalen, 2);
14117 options = gen_parseroptions(n_options, 3);
14118 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14120 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14121 desret_xmlParserErrors(ret_val);
14123 des_xmlNodePtr(n_node, node, 0);
14124 des_const_char_ptr(n_data, (const char *)data, 1);
14125 des_int(n_datalen, datalen, 2);
14126 des_parseroptions(n_options, options, 3);
14127 des_xmlNodePtr_ptr(n_lst, lst, 4);
14128 xmlResetLastError();
14129 if (mem_base != xmlMemBlocks()) {
14130 printf("Leak of %d blocks found in xmlParseInNodeContext",
14131 xmlMemBlocks() - mem_base);
14133 printf(" %d", n_node);
14134 printf(" %d", n_data);
14135 printf(" %d", n_datalen);
14136 printf(" %d", n_options);
14137 printf(" %d", n_lst);
14152 test_xmlParseMemory(void) {
14155 #if defined(LIBXML_SAX1_ENABLED)
14156 #ifdef LIBXML_SAX1_ENABLED
14159 char * buffer; /* an pointer to a char array */
14161 int size; /* the size of the array */
14164 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14165 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14166 mem_base = xmlMemBlocks();
14167 buffer = gen_const_char_ptr(n_buffer, 0);
14168 size = gen_int(n_size, 1);
14170 ret_val = xmlParseMemory((const char *)buffer, size);
14171 desret_xmlDocPtr(ret_val);
14173 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14174 des_int(n_size, size, 1);
14175 xmlResetLastError();
14176 if (mem_base != xmlMemBlocks()) {
14177 printf("Leak of %d blocks found in xmlParseMemory",
14178 xmlMemBlocks() - mem_base);
14180 printf(" %d", n_buffer);
14181 printf(" %d", n_size);
14194 #define gen_nb_const_xmlParserNodeInfoPtr 1
14195 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14198 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14202 test_xmlParserAddNodeInfo(void) {
14206 xmlParserCtxtPtr ctxt; /* an XML parser context */
14208 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14211 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14212 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14213 mem_base = xmlMemBlocks();
14214 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14215 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14217 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14219 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14220 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14221 xmlResetLastError();
14222 if (mem_base != xmlMemBlocks()) {
14223 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14224 xmlMemBlocks() - mem_base);
14226 printf(" %d", n_ctxt);
14227 printf(" %d", n_info);
14238 #define gen_nb_const_xmlParserCtxtPtr 1
14239 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14242 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14245 #define gen_nb_const_xmlNodePtr 1
14246 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14249 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14253 test_xmlParserFindNodeInfo(void) {
14257 const xmlParserNodeInfo * ret_val;
14258 xmlParserCtxtPtr ctx; /* an XML parser context */
14260 xmlNodePtr node; /* an XML node within the tree */
14263 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14264 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14265 mem_base = xmlMemBlocks();
14266 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14267 node = gen_const_xmlNodePtr(n_node, 1);
14269 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14270 desret_const_xmlParserNodeInfo_ptr(ret_val);
14272 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14273 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14274 xmlResetLastError();
14275 if (mem_base != xmlMemBlocks()) {
14276 printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14277 xmlMemBlocks() - mem_base);
14279 printf(" %d", n_ctx);
14280 printf(" %d", n_node);
14291 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14292 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14295 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14299 test_xmlParserFindNodeInfoIndex(void) {
14303 unsigned long ret_val;
14304 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14306 xmlNodePtr node; /* an XML node pointer */
14309 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14310 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14311 mem_base = xmlMemBlocks();
14312 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14313 node = gen_const_xmlNodePtr(n_node, 1);
14315 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14316 desret_unsigned_long(ret_val);
14318 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14319 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14320 xmlResetLastError();
14321 if (mem_base != xmlMemBlocks()) {
14322 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14323 xmlMemBlocks() - mem_base);
14325 printf(" %d", n_seq);
14326 printf(" %d", n_node);
14337 #define gen_nb_xmlParserInputPtr 1
14338 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14341 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14345 test_xmlParserInputGrow(void) {
14350 xmlParserInputPtr in; /* an XML parser input */
14352 int len; /* an indicative size for the lookahead */
14355 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14356 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14357 mem_base = xmlMemBlocks();
14358 in = gen_xmlParserInputPtr(n_in, 0);
14359 len = gen_int(n_len, 1);
14361 ret_val = xmlParserInputGrow(in, len);
14362 desret_int(ret_val);
14364 des_xmlParserInputPtr(n_in, in, 0);
14365 des_int(n_len, len, 1);
14366 xmlResetLastError();
14367 if (mem_base != xmlMemBlocks()) {
14368 printf("Leak of %d blocks found in xmlParserInputGrow",
14369 xmlMemBlocks() - mem_base);
14371 printf(" %d", n_in);
14372 printf(" %d", n_len);
14384 test_xmlParserInputRead(void) {
14389 xmlParserInputPtr in; /* an XML parser input */
14391 int len; /* an indicative size for the lookahead */
14394 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14395 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14396 mem_base = xmlMemBlocks();
14397 in = gen_xmlParserInputPtr(n_in, 0);
14398 len = gen_int(n_len, 1);
14400 ret_val = xmlParserInputRead(in, len);
14401 desret_int(ret_val);
14403 des_xmlParserInputPtr(n_in, in, 0);
14404 des_int(n_len, len, 1);
14405 xmlResetLastError();
14406 if (mem_base != xmlMemBlocks()) {
14407 printf("Leak of %d blocks found in xmlParserInputRead",
14408 xmlMemBlocks() - mem_base);
14410 printf(" %d", n_in);
14411 printf(" %d", n_len);
14423 test_xmlPedanticParserDefault(void) {
14428 int val; /* int 0 or 1 */
14431 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14432 mem_base = xmlMemBlocks();
14433 val = gen_int(n_val, 0);
14435 ret_val = xmlPedanticParserDefault(val);
14436 desret_int(ret_val);
14438 des_int(n_val, val, 0);
14439 xmlResetLastError();
14440 if (mem_base != xmlMemBlocks()) {
14441 printf("Leak of %d blocks found in xmlPedanticParserDefault",
14442 xmlMemBlocks() - mem_base);
14444 printf(" %d", n_val);
14455 test_xmlReadDoc(void) {
14460 xmlChar * cur; /* a pointer to a zero terminated string */
14462 const char * URL; /* the base URL to use for the document */
14464 char * encoding; /* the document encoding, or NULL */
14466 int options; /* a combination of xmlParserOption */
14469 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14470 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14471 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14472 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14473 mem_base = xmlMemBlocks();
14474 cur = gen_const_xmlChar_ptr(n_cur, 0);
14475 URL = gen_filepath(n_URL, 1);
14476 encoding = gen_const_char_ptr(n_encoding, 2);
14477 options = gen_parseroptions(n_options, 3);
14479 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14480 desret_xmlDocPtr(ret_val);
14482 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14483 des_filepath(n_URL, URL, 1);
14484 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14485 des_parseroptions(n_options, options, 3);
14486 xmlResetLastError();
14487 if (mem_base != xmlMemBlocks()) {
14488 printf("Leak of %d blocks found in xmlReadDoc",
14489 xmlMemBlocks() - mem_base);
14491 printf(" %d", n_cur);
14492 printf(" %d", n_URL);
14493 printf(" %d", n_encoding);
14494 printf(" %d", n_options);
14508 test_xmlReadFile(void) {
14513 const char * filename; /* a file or URL */
14515 char * encoding; /* the document encoding, or NULL */
14517 int options; /* a combination of xmlParserOption */
14520 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14521 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14522 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14523 mem_base = xmlMemBlocks();
14524 filename = gen_filepath(n_filename, 0);
14525 encoding = gen_const_char_ptr(n_encoding, 1);
14526 options = gen_parseroptions(n_options, 2);
14528 ret_val = xmlReadFile(filename, (const char *)encoding, options);
14529 desret_xmlDocPtr(ret_val);
14531 des_filepath(n_filename, filename, 0);
14532 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14533 des_parseroptions(n_options, options, 2);
14534 xmlResetLastError();
14535 if (mem_base != xmlMemBlocks()) {
14536 printf("Leak of %d blocks found in xmlReadFile",
14537 xmlMemBlocks() - mem_base);
14539 printf(" %d", n_filename);
14540 printf(" %d", n_encoding);
14541 printf(" %d", n_options);
14554 test_xmlReadMemory(void) {
14559 char * buffer; /* a pointer to a char array */
14561 int size; /* the size of the array */
14563 const char * URL; /* the base URL to use for the document */
14565 char * encoding; /* the document encoding, or NULL */
14567 int options; /* a combination of xmlParserOption */
14570 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14571 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14572 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14573 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14574 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14575 mem_base = xmlMemBlocks();
14576 buffer = gen_const_char_ptr(n_buffer, 0);
14577 size = gen_int(n_size, 1);
14578 URL = gen_filepath(n_URL, 2);
14579 encoding = gen_const_char_ptr(n_encoding, 3);
14580 options = gen_parseroptions(n_options, 4);
14582 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14583 desret_xmlDocPtr(ret_val);
14585 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14586 des_int(n_size, size, 1);
14587 des_filepath(n_URL, URL, 2);
14588 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14589 des_parseroptions(n_options, options, 4);
14590 xmlResetLastError();
14591 if (mem_base != xmlMemBlocks()) {
14592 printf("Leak of %d blocks found in xmlReadMemory",
14593 xmlMemBlocks() - mem_base);
14595 printf(" %d", n_buffer);
14596 printf(" %d", n_size);
14597 printf(" %d", n_URL);
14598 printf(" %d", n_encoding);
14599 printf(" %d", n_options);
14614 test_xmlRecoverDoc(void) {
14617 #if defined(LIBXML_SAX1_ENABLED)
14618 #ifdef LIBXML_SAX1_ENABLED
14621 xmlChar * cur; /* a pointer to an array of xmlChar */
14624 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14625 mem_base = xmlMemBlocks();
14626 cur = gen_const_xmlChar_ptr(n_cur, 0);
14628 ret_val = xmlRecoverDoc((const xmlChar *)cur);
14629 desret_xmlDocPtr(ret_val);
14631 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14632 xmlResetLastError();
14633 if (mem_base != xmlMemBlocks()) {
14634 printf("Leak of %d blocks found in xmlRecoverDoc",
14635 xmlMemBlocks() - mem_base);
14637 printf(" %d", n_cur);
14650 test_xmlRecoverFile(void) {
14653 #if defined(LIBXML_SAX1_ENABLED)
14654 #ifdef LIBXML_SAX1_ENABLED
14657 const char * filename; /* the filename */
14660 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14661 mem_base = xmlMemBlocks();
14662 filename = gen_filepath(n_filename, 0);
14664 ret_val = xmlRecoverFile(filename);
14665 desret_xmlDocPtr(ret_val);
14667 des_filepath(n_filename, filename, 0);
14668 xmlResetLastError();
14669 if (mem_base != xmlMemBlocks()) {
14670 printf("Leak of %d blocks found in xmlRecoverFile",
14671 xmlMemBlocks() - mem_base);
14673 printf(" %d", n_filename);
14686 test_xmlRecoverMemory(void) {
14689 #if defined(LIBXML_SAX1_ENABLED)
14690 #ifdef LIBXML_SAX1_ENABLED
14693 char * buffer; /* an pointer to a char array */
14695 int size; /* the size of the array */
14698 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14699 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14700 mem_base = xmlMemBlocks();
14701 buffer = gen_const_char_ptr(n_buffer, 0);
14702 size = gen_int(n_size, 1);
14704 ret_val = xmlRecoverMemory((const char *)buffer, size);
14705 desret_xmlDocPtr(ret_val);
14707 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14708 des_int(n_size, size, 1);
14709 xmlResetLastError();
14710 if (mem_base != xmlMemBlocks()) {
14711 printf("Leak of %d blocks found in xmlRecoverMemory",
14712 xmlMemBlocks() - mem_base);
14714 printf(" %d", n_buffer);
14715 printf(" %d", n_size);
14729 test_xmlSAXParseDTD(void) {
14732 #if defined(LIBXML_VALID_ENABLED)
14733 #ifdef LIBXML_SAX1_ENABLED
14736 xmlSAXHandlerPtr sax; /* the SAX handler block */
14738 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14740 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14743 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14744 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14745 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14746 mem_base = xmlMemBlocks();
14747 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14748 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14749 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14751 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14752 desret_xmlDtdPtr(ret_val);
14754 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14755 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14756 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14757 xmlResetLastError();
14758 if (mem_base != xmlMemBlocks()) {
14759 printf("Leak of %d blocks found in xmlSAXParseDTD",
14760 xmlMemBlocks() - mem_base);
14762 printf(" %d", n_sax);
14763 printf(" %d", n_ExternalID);
14764 printf(" %d", n_SystemID);
14779 test_xmlSAXParseDoc(void) {
14782 #if defined(LIBXML_SAX1_ENABLED)
14783 #ifdef LIBXML_SAX1_ENABLED
14786 xmlSAXHandlerPtr sax; /* the SAX handler block */
14788 xmlChar * cur; /* a pointer to an array of xmlChar */
14790 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14793 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14794 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14795 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14796 mem_base = xmlMemBlocks();
14797 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14798 cur = gen_const_xmlChar_ptr(n_cur, 1);
14799 recovery = gen_int(n_recovery, 2);
14801 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14802 desret_xmlDocPtr(ret_val);
14804 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14805 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14806 des_int(n_recovery, recovery, 2);
14807 xmlResetLastError();
14808 if (mem_base != xmlMemBlocks()) {
14809 printf("Leak of %d blocks found in xmlSAXParseDoc",
14810 xmlMemBlocks() - mem_base);
14812 printf(" %d", n_sax);
14813 printf(" %d", n_cur);
14814 printf(" %d", n_recovery);
14829 test_xmlSAXParseEntity(void) {
14832 #if defined(LIBXML_SAX1_ENABLED)
14833 #ifdef LIBXML_SAX1_ENABLED
14836 xmlSAXHandlerPtr sax; /* the SAX handler block */
14838 const char * filename; /* the filename */
14841 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14842 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14843 mem_base = xmlMemBlocks();
14844 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14845 filename = gen_filepath(n_filename, 1);
14847 ret_val = xmlSAXParseEntity(sax, filename);
14848 desret_xmlDocPtr(ret_val);
14850 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14851 des_filepath(n_filename, filename, 1);
14852 xmlResetLastError();
14853 if (mem_base != xmlMemBlocks()) {
14854 printf("Leak of %d blocks found in xmlSAXParseEntity",
14855 xmlMemBlocks() - mem_base);
14857 printf(" %d", n_sax);
14858 printf(" %d", n_filename);
14872 test_xmlSAXParseFile(void) {
14875 #if defined(LIBXML_SAX1_ENABLED)
14876 #ifdef LIBXML_SAX1_ENABLED
14879 xmlSAXHandlerPtr sax; /* the SAX handler block */
14881 const char * filename; /* the filename */
14883 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14886 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14887 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14888 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14889 mem_base = xmlMemBlocks();
14890 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14891 filename = gen_filepath(n_filename, 1);
14892 recovery = gen_int(n_recovery, 2);
14894 ret_val = xmlSAXParseFile(sax, filename, recovery);
14895 desret_xmlDocPtr(ret_val);
14897 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14898 des_filepath(n_filename, filename, 1);
14899 des_int(n_recovery, recovery, 2);
14900 xmlResetLastError();
14901 if (mem_base != xmlMemBlocks()) {
14902 printf("Leak of %d blocks found in xmlSAXParseFile",
14903 xmlMemBlocks() - mem_base);
14905 printf(" %d", n_sax);
14906 printf(" %d", n_filename);
14907 printf(" %d", n_recovery);
14922 test_xmlSAXParseFileWithData(void) {
14925 #if defined(LIBXML_SAX1_ENABLED)
14926 #ifdef LIBXML_SAX1_ENABLED
14929 xmlSAXHandlerPtr sax; /* the SAX handler block */
14931 const char * filename; /* the filename */
14933 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14935 void * data; /* the userdata */
14938 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14939 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14940 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14941 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14942 mem_base = xmlMemBlocks();
14943 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14944 filename = gen_filepath(n_filename, 1);
14945 recovery = gen_int(n_recovery, 2);
14946 data = gen_userdata(n_data, 3);
14948 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14949 desret_xmlDocPtr(ret_val);
14951 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14952 des_filepath(n_filename, filename, 1);
14953 des_int(n_recovery, recovery, 2);
14954 des_userdata(n_data, data, 3);
14955 xmlResetLastError();
14956 if (mem_base != xmlMemBlocks()) {
14957 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14958 xmlMemBlocks() - mem_base);
14960 printf(" %d", n_sax);
14961 printf(" %d", n_filename);
14962 printf(" %d", n_recovery);
14963 printf(" %d", n_data);
14979 test_xmlSAXParseMemory(void) {
14982 #if defined(LIBXML_SAX1_ENABLED)
14983 #ifdef LIBXML_SAX1_ENABLED
14986 xmlSAXHandlerPtr sax; /* the SAX handler block */
14988 char * buffer; /* an pointer to a char array */
14990 int size; /* the size of the array */
14992 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14995 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14996 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14997 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14998 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14999 mem_base = xmlMemBlocks();
15000 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15001 buffer = gen_const_char_ptr(n_buffer, 1);
15002 size = gen_int(n_size, 2);
15003 recovery = gen_int(n_recovery, 3);
15005 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15006 desret_xmlDocPtr(ret_val);
15008 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15009 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15010 des_int(n_size, size, 2);
15011 des_int(n_recovery, recovery, 3);
15012 xmlResetLastError();
15013 if (mem_base != xmlMemBlocks()) {
15014 printf("Leak of %d blocks found in xmlSAXParseMemory",
15015 xmlMemBlocks() - mem_base);
15017 printf(" %d", n_sax);
15018 printf(" %d", n_buffer);
15019 printf(" %d", n_size);
15020 printf(" %d", n_recovery);
15036 test_xmlSAXParseMemoryWithData(void) {
15039 #if defined(LIBXML_SAX1_ENABLED)
15040 #ifdef LIBXML_SAX1_ENABLED
15043 xmlSAXHandlerPtr sax; /* the SAX handler block */
15045 char * buffer; /* an pointer to a char array */
15047 int size; /* the size of the array */
15049 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15051 void * data; /* the userdata */
15054 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15055 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15056 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15057 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15058 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15059 mem_base = xmlMemBlocks();
15060 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15061 buffer = gen_const_char_ptr(n_buffer, 1);
15062 size = gen_int(n_size, 2);
15063 recovery = gen_int(n_recovery, 3);
15064 data = gen_userdata(n_data, 4);
15066 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15067 desret_xmlDocPtr(ret_val);
15069 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15070 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15071 des_int(n_size, size, 2);
15072 des_int(n_recovery, recovery, 3);
15073 des_userdata(n_data, data, 4);
15074 xmlResetLastError();
15075 if (mem_base != xmlMemBlocks()) {
15076 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15077 xmlMemBlocks() - mem_base);
15079 printf(" %d", n_sax);
15080 printf(" %d", n_buffer);
15081 printf(" %d", n_size);
15082 printf(" %d", n_recovery);
15083 printf(" %d", n_data);
15100 test_xmlSAXUserParseFile(void) {
15103 #if defined(LIBXML_SAX1_ENABLED)
15104 #ifdef LIBXML_SAX1_ENABLED
15107 xmlSAXHandlerPtr sax; /* a SAX handler */
15109 void * user_data; /* The user data returned on SAX callbacks */
15111 const char * filename; /* a file name */
15114 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15115 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15116 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15117 mem_base = xmlMemBlocks();
15118 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15119 user_data = gen_userdata(n_user_data, 1);
15120 filename = gen_filepath(n_filename, 2);
15122 #ifdef LIBXML_SAX1_ENABLED
15123 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15127 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15128 desret_int(ret_val);
15130 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15131 des_userdata(n_user_data, user_data, 1);
15132 des_filepath(n_filename, filename, 2);
15133 xmlResetLastError();
15134 if (mem_base != xmlMemBlocks()) {
15135 printf("Leak of %d blocks found in xmlSAXUserParseFile",
15136 xmlMemBlocks() - mem_base);
15138 printf(" %d", n_sax);
15139 printf(" %d", n_user_data);
15140 printf(" %d", n_filename);
15155 test_xmlSAXUserParseMemory(void) {
15158 #if defined(LIBXML_SAX1_ENABLED)
15159 #ifdef LIBXML_SAX1_ENABLED
15162 xmlSAXHandlerPtr sax; /* a SAX handler */
15164 void * user_data; /* The user data returned on SAX callbacks */
15166 char * buffer; /* an in-memory XML document input */
15168 int size; /* the length of the XML document in bytes */
15171 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15172 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15173 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15174 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15175 mem_base = xmlMemBlocks();
15176 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15177 user_data = gen_userdata(n_user_data, 1);
15178 buffer = gen_const_char_ptr(n_buffer, 2);
15179 size = gen_int(n_size, 3);
15181 #ifdef LIBXML_SAX1_ENABLED
15182 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15186 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15187 desret_int(ret_val);
15189 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15190 des_userdata(n_user_data, user_data, 1);
15191 des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15192 des_int(n_size, size, 3);
15193 xmlResetLastError();
15194 if (mem_base != xmlMemBlocks()) {
15195 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15196 xmlMemBlocks() - mem_base);
15198 printf(" %d", n_sax);
15199 printf(" %d", n_user_data);
15200 printf(" %d", n_buffer);
15201 printf(" %d", n_size);
15217 test_xmlSetExternalEntityLoader(void) {
15221 /* missing type support */
15227 test_xmlSetFeature(void) {
15230 #if defined(LIBXML_LEGACY_ENABLED)
15231 #ifdef LIBXML_LEGACY_ENABLED
15234 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15236 char * name; /* the feature name */
15238 void * value; /* pointer to the location of the new value */
15241 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15242 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15243 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15244 mem_base = xmlMemBlocks();
15245 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15246 name = gen_const_char_ptr(n_name, 1);
15247 value = gen_void_ptr(n_value, 2);
15249 ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15250 desret_int(ret_val);
15252 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15253 des_const_char_ptr(n_name, (const char *)name, 1);
15254 des_void_ptr(n_value, value, 2);
15255 xmlResetLastError();
15256 if (mem_base != xmlMemBlocks()) {
15257 printf("Leak of %d blocks found in xmlSetFeature",
15258 xmlMemBlocks() - mem_base);
15260 printf(" %d", n_ctxt);
15261 printf(" %d", n_name);
15262 printf(" %d", n_value);
15277 test_xmlSetupParserForBuffer(void) {
15280 #if defined(LIBXML_SAX1_ENABLED)
15281 #ifdef LIBXML_SAX1_ENABLED
15283 xmlParserCtxtPtr ctxt; /* an XML parser context */
15285 xmlChar * buffer; /* a xmlChar * buffer */
15287 const char * filename; /* a file name */
15290 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15291 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15292 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15293 mem_base = xmlMemBlocks();
15294 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15295 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15296 filename = gen_filepath(n_filename, 2);
15298 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15300 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15301 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15302 des_filepath(n_filename, filename, 2);
15303 xmlResetLastError();
15304 if (mem_base != xmlMemBlocks()) {
15305 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15306 xmlMemBlocks() - mem_base);
15308 printf(" %d", n_ctxt);
15309 printf(" %d", n_buffer);
15310 printf(" %d", n_filename);
15325 test_xmlStopParser(void) {
15328 #ifdef LIBXML_PUSH_ENABLED
15330 xmlParserCtxtPtr ctxt; /* an XML parser context */
15333 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15334 mem_base = xmlMemBlocks();
15335 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15337 xmlStopParser(ctxt);
15339 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15340 xmlResetLastError();
15341 if (mem_base != xmlMemBlocks()) {
15342 printf("Leak of %d blocks found in xmlStopParser",
15343 xmlMemBlocks() - mem_base);
15345 printf(" %d", n_ctxt);
15357 test_xmlSubstituteEntitiesDefault(void) {
15362 int val; /* int 0 or 1 */
15365 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15366 mem_base = xmlMemBlocks();
15367 val = gen_int(n_val, 0);
15369 ret_val = xmlSubstituteEntitiesDefault(val);
15370 desret_int(ret_val);
15372 des_int(n_val, val, 0);
15373 xmlResetLastError();
15374 if (mem_base != xmlMemBlocks()) {
15375 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15376 xmlMemBlocks() - mem_base);
15378 printf(" %d", n_val);
15388 test_parser(void) {
15391 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15392 test_ret += test_xmlByteConsumed();
15393 test_ret += test_xmlClearNodeInfoSeq();
15394 test_ret += test_xmlClearParserCtxt();
15395 test_ret += test_xmlCreateDocParserCtxt();
15396 test_ret += test_xmlCreatePushParserCtxt();
15397 test_ret += test_xmlCtxtReadDoc();
15398 test_ret += test_xmlCtxtReadFile();
15399 test_ret += test_xmlCtxtReadMemory();
15400 test_ret += test_xmlCtxtReset();
15401 test_ret += test_xmlCtxtResetPush();
15402 test_ret += test_xmlCtxtUseOptions();
15403 test_ret += test_xmlGetExternalEntityLoader();
15404 test_ret += test_xmlGetFeature();
15405 test_ret += test_xmlGetFeaturesList();
15406 test_ret += test_xmlHasFeature();
15407 test_ret += test_xmlIOParseDTD();
15408 test_ret += test_xmlInitNodeInfoSeq();
15409 test_ret += test_xmlInitParser();
15410 test_ret += test_xmlInitParserCtxt();
15411 test_ret += test_xmlKeepBlanksDefault();
15412 test_ret += test_xmlLineNumbersDefault();
15413 test_ret += test_xmlLoadExternalEntity();
15414 test_ret += test_xmlNewIOInputStream();
15415 test_ret += test_xmlNewParserCtxt();
15416 test_ret += test_xmlParseBalancedChunkMemory();
15417 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15418 test_ret += test_xmlParseChunk();
15419 test_ret += test_xmlParseCtxtExternalEntity();
15420 test_ret += test_xmlParseDTD();
15421 test_ret += test_xmlParseDoc();
15422 test_ret += test_xmlParseDocument();
15423 test_ret += test_xmlParseEntity();
15424 test_ret += test_xmlParseExtParsedEnt();
15425 test_ret += test_xmlParseExternalEntity();
15426 test_ret += test_xmlParseFile();
15427 test_ret += test_xmlParseInNodeContext();
15428 test_ret += test_xmlParseMemory();
15429 test_ret += test_xmlParserAddNodeInfo();
15430 test_ret += test_xmlParserFindNodeInfo();
15431 test_ret += test_xmlParserFindNodeInfoIndex();
15432 test_ret += test_xmlParserInputGrow();
15433 test_ret += test_xmlParserInputRead();
15434 test_ret += test_xmlPedanticParserDefault();
15435 test_ret += test_xmlReadDoc();
15436 test_ret += test_xmlReadFile();
15437 test_ret += test_xmlReadMemory();
15438 test_ret += test_xmlRecoverDoc();
15439 test_ret += test_xmlRecoverFile();
15440 test_ret += test_xmlRecoverMemory();
15441 test_ret += test_xmlSAXParseDTD();
15442 test_ret += test_xmlSAXParseDoc();
15443 test_ret += test_xmlSAXParseEntity();
15444 test_ret += test_xmlSAXParseFile();
15445 test_ret += test_xmlSAXParseFileWithData();
15446 test_ret += test_xmlSAXParseMemory();
15447 test_ret += test_xmlSAXParseMemoryWithData();
15448 test_ret += test_xmlSAXUserParseFile();
15449 test_ret += test_xmlSAXUserParseMemory();
15450 test_ret += test_xmlSetExternalEntityLoader();
15451 test_ret += test_xmlSetFeature();
15452 test_ret += test_xmlSetupParserForBuffer();
15453 test_ret += test_xmlStopParser();
15454 test_ret += test_xmlSubstituteEntitiesDefault();
15457 printf("Module parser: %d errors\n", test_ret);
15462 test_htmlCreateFileParserCtxt(void) {
15465 #if defined(LIBXML_HTML_ENABLED)
15467 htmlParserCtxtPtr ret_val;
15468 const char * filename; /* the filename */
15470 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15473 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15474 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15475 mem_base = xmlMemBlocks();
15476 filename = gen_fileoutput(n_filename, 0);
15477 encoding = gen_const_char_ptr(n_encoding, 1);
15479 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15480 desret_htmlParserCtxtPtr(ret_val);
15482 des_fileoutput(n_filename, filename, 0);
15483 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15484 xmlResetLastError();
15485 if (mem_base != xmlMemBlocks()) {
15486 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15487 xmlMemBlocks() - mem_base);
15489 printf(" %d", n_filename);
15490 printf(" %d", n_encoding);
15503 test_htmlInitAutoClose(void) {
15506 #if defined(LIBXML_HTML_ENABLED)
15509 mem_base = xmlMemBlocks();
15511 htmlInitAutoClose();
15513 xmlResetLastError();
15514 if (mem_base != xmlMemBlocks()) {
15515 printf("Leak of %d blocks found in htmlInitAutoClose",
15516 xmlMemBlocks() - mem_base);
15528 test_inputPop(void) {
15532 xmlParserInputPtr ret_val;
15533 xmlParserCtxtPtr ctxt; /* an XML parser context */
15536 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15537 mem_base = xmlMemBlocks();
15538 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15540 ret_val = inputPop(ctxt);
15541 desret_xmlParserInputPtr(ret_val);
15543 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15544 xmlResetLastError();
15545 if (mem_base != xmlMemBlocks()) {
15546 printf("Leak of %d blocks found in inputPop",
15547 xmlMemBlocks() - mem_base);
15549 printf(" %d", n_ctxt);
15560 test_inputPush(void) {
15565 xmlParserCtxtPtr ctxt; /* an XML parser context */
15567 xmlParserInputPtr value; /* the parser input */
15570 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15571 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15572 mem_base = xmlMemBlocks();
15573 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15574 value = gen_xmlParserInputPtr(n_value, 1);
15576 ret_val = inputPush(ctxt, value);
15577 desret_int(ret_val);
15579 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15580 des_xmlParserInputPtr(n_value, value, 1);
15581 xmlResetLastError();
15582 if (mem_base != xmlMemBlocks()) {
15583 printf("Leak of %d blocks found in inputPush",
15584 xmlMemBlocks() - mem_base);
15586 printf(" %d", n_ctxt);
15587 printf(" %d", n_value);
15599 test_namePop(void) {
15603 const xmlChar * ret_val;
15604 xmlParserCtxtPtr ctxt; /* an XML parser context */
15607 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15608 mem_base = xmlMemBlocks();
15609 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15611 ret_val = namePop(ctxt);
15612 desret_const_xmlChar_ptr(ret_val);
15614 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15615 xmlResetLastError();
15616 if (mem_base != xmlMemBlocks()) {
15617 printf("Leak of %d blocks found in namePop",
15618 xmlMemBlocks() - mem_base);
15620 printf(" %d", n_ctxt);
15631 test_namePush(void) {
15636 xmlParserCtxtPtr ctxt; /* an XML parser context */
15638 xmlChar * value; /* the element name */
15641 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15642 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15643 mem_base = xmlMemBlocks();
15644 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15645 value = gen_const_xmlChar_ptr(n_value, 1);
15647 ret_val = namePush(ctxt, (const xmlChar *)value);
15648 desret_int(ret_val);
15650 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15651 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15652 xmlResetLastError();
15653 if (mem_base != xmlMemBlocks()) {
15654 printf("Leak of %d blocks found in namePush",
15655 xmlMemBlocks() - mem_base);
15657 printf(" %d", n_ctxt);
15658 printf(" %d", n_value);
15670 test_nodePop(void) {
15674 xmlNodePtr ret_val;
15675 xmlParserCtxtPtr ctxt; /* an XML parser context */
15678 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15679 mem_base = xmlMemBlocks();
15680 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15682 ret_val = nodePop(ctxt);
15683 desret_xmlNodePtr(ret_val);
15685 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15686 xmlResetLastError();
15687 if (mem_base != xmlMemBlocks()) {
15688 printf("Leak of %d blocks found in nodePop",
15689 xmlMemBlocks() - mem_base);
15691 printf(" %d", n_ctxt);
15702 test_nodePush(void) {
15707 xmlParserCtxtPtr ctxt; /* an XML parser context */
15709 xmlNodePtr value; /* the element node */
15712 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15713 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15714 mem_base = xmlMemBlocks();
15715 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15716 value = gen_xmlNodePtr(n_value, 1);
15718 ret_val = nodePush(ctxt, value);
15719 desret_int(ret_val);
15721 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15722 des_xmlNodePtr(n_value, value, 1);
15723 xmlResetLastError();
15724 if (mem_base != xmlMemBlocks()) {
15725 printf("Leak of %d blocks found in nodePush",
15726 xmlMemBlocks() - mem_base);
15728 printf(" %d", n_ctxt);
15729 printf(" %d", n_value);
15741 test_xmlCheckLanguageID(void) {
15746 xmlChar * lang; /* pointer to the string value */
15749 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15750 mem_base = xmlMemBlocks();
15751 lang = gen_const_xmlChar_ptr(n_lang, 0);
15753 ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15754 desret_int(ret_val);
15756 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15757 xmlResetLastError();
15758 if (mem_base != xmlMemBlocks()) {
15759 printf("Leak of %d blocks found in xmlCheckLanguageID",
15760 xmlMemBlocks() - mem_base);
15762 printf(" %d", n_lang);
15773 test_xmlCopyChar(void) {
15778 int len; /* Ignored, compatibility */
15780 xmlChar * out; /* pointer to an array of xmlChar */
15782 int val; /* the char value */
15785 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15786 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15787 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15788 mem_base = xmlMemBlocks();
15789 len = gen_int(n_len, 0);
15790 out = gen_xmlChar_ptr(n_out, 1);
15791 val = gen_int(n_val, 2);
15793 ret_val = xmlCopyChar(len, out, val);
15794 desret_int(ret_val);
15796 des_int(n_len, len, 0);
15797 des_xmlChar_ptr(n_out, out, 1);
15798 des_int(n_val, val, 2);
15799 xmlResetLastError();
15800 if (mem_base != xmlMemBlocks()) {
15801 printf("Leak of %d blocks found in xmlCopyChar",
15802 xmlMemBlocks() - mem_base);
15804 printf(" %d", n_len);
15805 printf(" %d", n_out);
15806 printf(" %d", n_val);
15819 test_xmlCopyCharMultiByte(void) {
15824 xmlChar * out; /* pointer to an array of xmlChar */
15826 int val; /* the char value */
15829 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15830 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15831 mem_base = xmlMemBlocks();
15832 out = gen_xmlChar_ptr(n_out, 0);
15833 val = gen_int(n_val, 1);
15835 ret_val = xmlCopyCharMultiByte(out, val);
15836 desret_int(ret_val);
15838 des_xmlChar_ptr(n_out, out, 0);
15839 des_int(n_val, val, 1);
15840 xmlResetLastError();
15841 if (mem_base != xmlMemBlocks()) {
15842 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15843 xmlMemBlocks() - mem_base);
15845 printf(" %d", n_out);
15846 printf(" %d", n_val);
15858 test_xmlCreateEntityParserCtxt(void) {
15862 xmlParserCtxtPtr ret_val;
15863 xmlChar * URL; /* the entity URL */
15865 xmlChar * ID; /* the entity PUBLIC ID */
15867 xmlChar * base; /* a possible base for the target URI */
15870 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15871 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15872 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15873 mem_base = xmlMemBlocks();
15874 URL = gen_const_xmlChar_ptr(n_URL, 0);
15875 ID = gen_const_xmlChar_ptr(n_ID, 1);
15876 base = gen_const_xmlChar_ptr(n_base, 2);
15878 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15879 desret_xmlParserCtxtPtr(ret_val);
15881 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15882 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15883 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15884 xmlResetLastError();
15885 if (mem_base != xmlMemBlocks()) {
15886 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15887 xmlMemBlocks() - mem_base);
15889 printf(" %d", n_URL);
15890 printf(" %d", n_ID);
15891 printf(" %d", n_base);
15904 test_xmlCreateFileParserCtxt(void) {
15908 xmlParserCtxtPtr ret_val;
15909 const char * filename; /* the filename */
15912 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15913 mem_base = xmlMemBlocks();
15914 filename = gen_fileoutput(n_filename, 0);
15916 ret_val = xmlCreateFileParserCtxt(filename);
15917 desret_xmlParserCtxtPtr(ret_val);
15919 des_fileoutput(n_filename, filename, 0);
15920 xmlResetLastError();
15921 if (mem_base != xmlMemBlocks()) {
15922 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15923 xmlMemBlocks() - mem_base);
15925 printf(" %d", n_filename);
15936 test_xmlCreateMemoryParserCtxt(void) {
15940 xmlParserCtxtPtr ret_val;
15941 char * buffer; /* a pointer to a char array */
15943 int size; /* the size of the array */
15946 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15947 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15948 mem_base = xmlMemBlocks();
15949 buffer = gen_const_char_ptr(n_buffer, 0);
15950 size = gen_int(n_size, 1);
15952 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15953 desret_xmlParserCtxtPtr(ret_val);
15955 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15956 des_int(n_size, size, 1);
15957 xmlResetLastError();
15958 if (mem_base != xmlMemBlocks()) {
15959 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15960 xmlMemBlocks() - mem_base);
15962 printf(" %d", n_buffer);
15963 printf(" %d", n_size);
15975 test_xmlCreateURLParserCtxt(void) {
15979 xmlParserCtxtPtr ret_val;
15980 const char * filename; /* the filename or URL */
15982 int options; /* a combination of xmlParserOption */
15985 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15986 for (n_options = 0;n_options < gen_nb_int;n_options++) {
15987 mem_base = xmlMemBlocks();
15988 filename = gen_fileoutput(n_filename, 0);
15989 options = gen_int(n_options, 1);
15991 ret_val = xmlCreateURLParserCtxt(filename, options);
15992 desret_xmlParserCtxtPtr(ret_val);
15994 des_fileoutput(n_filename, filename, 0);
15995 des_int(n_options, options, 1);
15996 xmlResetLastError();
15997 if (mem_base != xmlMemBlocks()) {
15998 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15999 xmlMemBlocks() - mem_base);
16001 printf(" %d", n_filename);
16002 printf(" %d", n_options);
16014 test_xmlCurrentChar(void) {
16019 xmlParserCtxtPtr ctxt; /* the XML parser context */
16021 int * len; /* pointer to the length of the char read */
16024 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16025 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16026 mem_base = xmlMemBlocks();
16027 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16028 len = gen_int_ptr(n_len, 1);
16030 ret_val = xmlCurrentChar(ctxt, len);
16031 desret_int(ret_val);
16033 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16034 des_int_ptr(n_len, len, 1);
16035 xmlResetLastError();
16036 if (mem_base != xmlMemBlocks()) {
16037 printf("Leak of %d blocks found in xmlCurrentChar",
16038 xmlMemBlocks() - mem_base);
16040 printf(" %d", n_ctxt);
16041 printf(" %d", n_len);
16053 test_xmlErrMemory(void) {
16057 xmlParserCtxtPtr ctxt; /* an XML parser context */
16059 char * extra; /* extra informations */
16062 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16063 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16064 mem_base = xmlMemBlocks();
16065 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16066 extra = gen_const_char_ptr(n_extra, 1);
16068 xmlErrMemory(ctxt, (const char *)extra);
16070 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16071 des_const_char_ptr(n_extra, (const char *)extra, 1);
16072 xmlResetLastError();
16073 if (mem_base != xmlMemBlocks()) {
16074 printf("Leak of %d blocks found in xmlErrMemory",
16075 xmlMemBlocks() - mem_base);
16077 printf(" %d", n_ctxt);
16078 printf(" %d", n_extra);
16090 test_xmlIsLetter(void) {
16095 int c; /* an unicode character (int) */
16098 for (n_c = 0;n_c < gen_nb_int;n_c++) {
16099 mem_base = xmlMemBlocks();
16100 c = gen_int(n_c, 0);
16102 ret_val = xmlIsLetter(c);
16103 desret_int(ret_val);
16105 des_int(n_c, c, 0);
16106 xmlResetLastError();
16107 if (mem_base != xmlMemBlocks()) {
16108 printf("Leak of %d blocks found in xmlIsLetter",
16109 xmlMemBlocks() - mem_base);
16111 printf(" %d", n_c);
16122 test_xmlNewEntityInputStream(void) {
16126 xmlParserInputPtr ret_val;
16127 xmlParserCtxtPtr ctxt; /* an XML parser context */
16129 xmlEntityPtr entity; /* an Entity pointer */
16132 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16133 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16134 mem_base = xmlMemBlocks();
16135 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16136 entity = gen_xmlEntityPtr(n_entity, 1);
16138 ret_val = xmlNewEntityInputStream(ctxt, entity);
16139 desret_xmlParserInputPtr(ret_val);
16141 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16142 des_xmlEntityPtr(n_entity, entity, 1);
16143 xmlResetLastError();
16144 if (mem_base != xmlMemBlocks()) {
16145 printf("Leak of %d blocks found in xmlNewEntityInputStream",
16146 xmlMemBlocks() - mem_base);
16148 printf(" %d", n_ctxt);
16149 printf(" %d", n_entity);
16161 test_xmlNewInputFromFile(void) {
16165 xmlParserInputPtr ret_val;
16166 xmlParserCtxtPtr ctxt; /* an XML parser context */
16168 const char * filename; /* the filename to use as entity */
16171 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16172 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16173 mem_base = xmlMemBlocks();
16174 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16175 filename = gen_filepath(n_filename, 1);
16177 ret_val = xmlNewInputFromFile(ctxt, filename);
16178 desret_xmlParserInputPtr(ret_val);
16180 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16181 des_filepath(n_filename, filename, 1);
16182 xmlResetLastError();
16183 if (mem_base != xmlMemBlocks()) {
16184 printf("Leak of %d blocks found in xmlNewInputFromFile",
16185 xmlMemBlocks() - mem_base);
16187 printf(" %d", n_ctxt);
16188 printf(" %d", n_filename);
16200 test_xmlNewInputStream(void) {
16204 xmlParserInputPtr ret_val;
16205 xmlParserCtxtPtr ctxt; /* an XML parser context */
16208 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16209 mem_base = xmlMemBlocks();
16210 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16212 ret_val = xmlNewInputStream(ctxt);
16213 desret_xmlParserInputPtr(ret_val);
16215 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16216 xmlResetLastError();
16217 if (mem_base != xmlMemBlocks()) {
16218 printf("Leak of %d blocks found in xmlNewInputStream",
16219 xmlMemBlocks() - mem_base);
16221 printf(" %d", n_ctxt);
16232 test_xmlNewStringInputStream(void) {
16236 xmlParserInputPtr ret_val;
16237 xmlParserCtxtPtr ctxt; /* an XML parser context */
16239 xmlChar * buffer; /* an memory buffer */
16242 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16243 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16244 mem_base = xmlMemBlocks();
16245 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16246 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16248 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16249 desret_xmlParserInputPtr(ret_val);
16251 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16252 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16253 xmlResetLastError();
16254 if (mem_base != xmlMemBlocks()) {
16255 printf("Leak of %d blocks found in xmlNewStringInputStream",
16256 xmlMemBlocks() - mem_base);
16258 printf(" %d", n_ctxt);
16259 printf(" %d", n_buffer);
16271 test_xmlNextChar(void) {
16275 xmlParserCtxtPtr ctxt; /* the XML parser context */
16278 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16279 mem_base = xmlMemBlocks();
16280 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16284 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16285 xmlResetLastError();
16286 if (mem_base != xmlMemBlocks()) {
16287 printf("Leak of %d blocks found in xmlNextChar",
16288 xmlMemBlocks() - mem_base);
16290 printf(" %d", n_ctxt);
16301 test_xmlParserInputShrink(void) {
16305 xmlParserInputPtr in; /* an XML parser input */
16308 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16309 mem_base = xmlMemBlocks();
16310 in = gen_xmlParserInputPtr(n_in, 0);
16312 xmlParserInputShrink(in);
16314 des_xmlParserInputPtr(n_in, in, 0);
16315 xmlResetLastError();
16316 if (mem_base != xmlMemBlocks()) {
16317 printf("Leak of %d blocks found in xmlParserInputShrink",
16318 xmlMemBlocks() - mem_base);
16320 printf(" %d", n_in);
16331 test_xmlPopInput(void) {
16336 xmlParserCtxtPtr ctxt; /* an XML parser context */
16339 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16340 mem_base = xmlMemBlocks();
16341 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16343 ret_val = xmlPopInput(ctxt);
16344 desret_xmlChar(ret_val);
16346 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16347 xmlResetLastError();
16348 if (mem_base != xmlMemBlocks()) {
16349 printf("Leak of %d blocks found in xmlPopInput",
16350 xmlMemBlocks() - mem_base);
16352 printf(" %d", n_ctxt);
16363 test_xmlPushInput(void) {
16368 xmlParserCtxtPtr ctxt; /* an XML parser context */
16370 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16373 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16374 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16375 mem_base = xmlMemBlocks();
16376 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16377 input = gen_xmlParserInputPtr(n_input, 1);
16379 ret_val = xmlPushInput(ctxt, input);
16380 desret_int(ret_val);
16382 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16383 des_xmlParserInputPtr(n_input, input, 1);
16384 xmlResetLastError();
16385 if (mem_base != xmlMemBlocks()) {
16386 printf("Leak of %d blocks found in xmlPushInput",
16387 xmlMemBlocks() - mem_base);
16389 printf(" %d", n_ctxt);
16390 printf(" %d", n_input);
16402 test_xmlSetEntityReferenceFunc(void) {
16406 /* missing type support */
16412 test_xmlSplitQName(void) {
16417 xmlParserCtxtPtr ctxt; /* an XML parser context */
16419 xmlChar * name; /* an XML parser context */
16421 xmlChar ** prefix; /* a xmlChar ** */
16424 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16425 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16426 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16427 mem_base = xmlMemBlocks();
16428 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16429 name = gen_const_xmlChar_ptr(n_name, 1);
16430 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16432 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16433 desret_xmlChar_ptr(ret_val);
16435 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16436 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16437 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16438 xmlResetLastError();
16439 if (mem_base != xmlMemBlocks()) {
16440 printf("Leak of %d blocks found in xmlSplitQName",
16441 xmlMemBlocks() - mem_base);
16443 printf(" %d", n_ctxt);
16444 printf(" %d", n_name);
16445 printf(" %d", n_prefix);
16458 test_xmlStringCurrentChar(void) {
16463 xmlParserCtxtPtr ctxt; /* the XML parser context */
16465 xmlChar * cur; /* pointer to the beginning of the char */
16467 int * len; /* pointer to the length of the char read */
16470 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16471 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16472 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16473 mem_base = xmlMemBlocks();
16474 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16475 cur = gen_const_xmlChar_ptr(n_cur, 1);
16476 len = gen_int_ptr(n_len, 2);
16478 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16479 desret_int(ret_val);
16481 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16482 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16483 des_int_ptr(n_len, len, 2);
16484 xmlResetLastError();
16485 if (mem_base != xmlMemBlocks()) {
16486 printf("Leak of %d blocks found in xmlStringCurrentChar",
16487 xmlMemBlocks() - mem_base);
16489 printf(" %d", n_ctxt);
16490 printf(" %d", n_cur);
16491 printf(" %d", n_len);
16504 test_xmlStringDecodeEntities(void) {
16509 xmlParserCtxtPtr ctxt; /* the parser context */
16511 xmlChar * str; /* the input string */
16513 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16515 xmlChar end; /* an end marker xmlChar, 0 if none */
16517 xmlChar end2; /* an end marker xmlChar, 0 if none */
16519 xmlChar end3; /* an end marker xmlChar, 0 if none */
16522 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16523 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16524 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16525 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16526 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16527 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16528 mem_base = xmlMemBlocks();
16529 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16530 str = gen_const_xmlChar_ptr(n_str, 1);
16531 what = gen_int(n_what, 2);
16532 end = gen_xmlChar(n_end, 3);
16533 end2 = gen_xmlChar(n_end2, 4);
16534 end3 = gen_xmlChar(n_end3, 5);
16536 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16537 desret_xmlChar_ptr(ret_val);
16539 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16540 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16541 des_int(n_what, what, 2);
16542 des_xmlChar(n_end, end, 3);
16543 des_xmlChar(n_end2, end2, 4);
16544 des_xmlChar(n_end3, end3, 5);
16545 xmlResetLastError();
16546 if (mem_base != xmlMemBlocks()) {
16547 printf("Leak of %d blocks found in xmlStringDecodeEntities",
16548 xmlMemBlocks() - mem_base);
16550 printf(" %d", n_ctxt);
16551 printf(" %d", n_str);
16552 printf(" %d", n_what);
16553 printf(" %d", n_end);
16554 printf(" %d", n_end2);
16555 printf(" %d", n_end3);
16571 test_xmlStringLenDecodeEntities(void) {
16576 xmlParserCtxtPtr ctxt; /* the parser context */
16578 xmlChar * str; /* the input string */
16580 int len; /* the string length */
16582 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16584 xmlChar end; /* an end marker xmlChar, 0 if none */
16586 xmlChar end2; /* an end marker xmlChar, 0 if none */
16588 xmlChar end3; /* an end marker xmlChar, 0 if none */
16591 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16592 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16593 for (n_len = 0;n_len < gen_nb_int;n_len++) {
16594 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16595 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16596 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16597 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16598 mem_base = xmlMemBlocks();
16599 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16600 str = gen_const_xmlChar_ptr(n_str, 1);
16601 len = gen_int(n_len, 2);
16602 what = gen_int(n_what, 3);
16603 end = gen_xmlChar(n_end, 4);
16604 end2 = gen_xmlChar(n_end2, 5);
16605 end3 = gen_xmlChar(n_end3, 6);
16607 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16608 desret_xmlChar_ptr(ret_val);
16610 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16611 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16612 des_int(n_len, len, 2);
16613 des_int(n_what, what, 3);
16614 des_xmlChar(n_end, end, 4);
16615 des_xmlChar(n_end2, end2, 5);
16616 des_xmlChar(n_end3, end3, 6);
16617 xmlResetLastError();
16618 if (mem_base != xmlMemBlocks()) {
16619 printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16620 xmlMemBlocks() - mem_base);
16622 printf(" %d", n_ctxt);
16623 printf(" %d", n_str);
16624 printf(" %d", n_len);
16625 printf(" %d", n_what);
16626 printf(" %d", n_end);
16627 printf(" %d", n_end2);
16628 printf(" %d", n_end3);
16645 test_xmlSwitchEncoding(void) {
16650 xmlParserCtxtPtr ctxt; /* the parser context */
16652 xmlCharEncoding enc; /* the encoding value (number) */
16655 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16656 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16657 mem_base = xmlMemBlocks();
16658 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16659 enc = gen_xmlCharEncoding(n_enc, 1);
16661 ret_val = xmlSwitchEncoding(ctxt, enc);
16662 desret_int(ret_val);
16664 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16665 des_xmlCharEncoding(n_enc, enc, 1);
16666 xmlResetLastError();
16667 if (mem_base != xmlMemBlocks()) {
16668 printf("Leak of %d blocks found in xmlSwitchEncoding",
16669 xmlMemBlocks() - mem_base);
16671 printf(" %d", n_ctxt);
16672 printf(" %d", n_enc);
16684 test_xmlSwitchInputEncoding(void) {
16689 xmlParserCtxtPtr ctxt; /* the parser context */
16691 xmlParserInputPtr input; /* the input stream */
16693 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16696 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16697 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16698 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16699 mem_base = xmlMemBlocks();
16700 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16701 input = gen_xmlParserInputPtr(n_input, 1);
16702 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16704 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16705 desret_int(ret_val);
16707 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16708 des_xmlParserInputPtr(n_input, input, 1);
16709 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16710 xmlResetLastError();
16711 if (mem_base != xmlMemBlocks()) {
16712 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16713 xmlMemBlocks() - mem_base);
16715 printf(" %d", n_ctxt);
16716 printf(" %d", n_input);
16717 printf(" %d", n_handler);
16730 test_xmlSwitchToEncoding(void) {
16735 xmlParserCtxtPtr ctxt; /* the parser context */
16737 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16740 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16741 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16742 mem_base = xmlMemBlocks();
16743 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16744 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16746 ret_val = xmlSwitchToEncoding(ctxt, handler);
16747 desret_int(ret_val);
16749 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16750 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16751 xmlResetLastError();
16752 if (mem_base != xmlMemBlocks()) {
16753 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16754 xmlMemBlocks() - mem_base);
16756 printf(" %d", n_ctxt);
16757 printf(" %d", n_handler);
16768 test_parserInternals(void) {
16771 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16772 test_ret += test_htmlCreateFileParserCtxt();
16773 test_ret += test_htmlInitAutoClose();
16774 test_ret += test_inputPop();
16775 test_ret += test_inputPush();
16776 test_ret += test_namePop();
16777 test_ret += test_namePush();
16778 test_ret += test_nodePop();
16779 test_ret += test_nodePush();
16780 test_ret += test_xmlCheckLanguageID();
16781 test_ret += test_xmlCopyChar();
16782 test_ret += test_xmlCopyCharMultiByte();
16783 test_ret += test_xmlCreateEntityParserCtxt();
16784 test_ret += test_xmlCreateFileParserCtxt();
16785 test_ret += test_xmlCreateMemoryParserCtxt();
16786 test_ret += test_xmlCreateURLParserCtxt();
16787 test_ret += test_xmlCurrentChar();
16788 test_ret += test_xmlErrMemory();
16789 test_ret += test_xmlIsLetter();
16790 test_ret += test_xmlNewEntityInputStream();
16791 test_ret += test_xmlNewInputFromFile();
16792 test_ret += test_xmlNewInputStream();
16793 test_ret += test_xmlNewStringInputStream();
16794 test_ret += test_xmlNextChar();
16795 test_ret += test_xmlParserInputShrink();
16796 test_ret += test_xmlPopInput();
16797 test_ret += test_xmlPushInput();
16798 test_ret += test_xmlSetEntityReferenceFunc();
16799 test_ret += test_xmlSplitQName();
16800 test_ret += test_xmlStringCurrentChar();
16801 test_ret += test_xmlStringDecodeEntities();
16802 test_ret += test_xmlStringLenDecodeEntities();
16803 test_ret += test_xmlSwitchEncoding();
16804 test_ret += test_xmlSwitchInputEncoding();
16805 test_ret += test_xmlSwitchToEncoding();
16808 printf("Module parserInternals: %d errors\n", test_ret);
16813 test_xmlPatternFromRoot(void) {
16816 #if defined(LIBXML_PATTERN_ENABLED)
16819 xmlPatternPtr comp; /* the precompiled pattern */
16822 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16823 mem_base = xmlMemBlocks();
16824 comp = gen_xmlPatternPtr(n_comp, 0);
16826 ret_val = xmlPatternFromRoot(comp);
16827 desret_int(ret_val);
16829 des_xmlPatternPtr(n_comp, comp, 0);
16830 xmlResetLastError();
16831 if (mem_base != xmlMemBlocks()) {
16832 printf("Leak of %d blocks found in xmlPatternFromRoot",
16833 xmlMemBlocks() - mem_base);
16835 printf(" %d", n_comp);
16847 test_xmlPatternGetStreamCtxt(void) {
16851 /* missing type support */
16857 test_xmlPatternMatch(void) {
16860 #if defined(LIBXML_PATTERN_ENABLED)
16863 xmlPatternPtr comp; /* the precompiled pattern */
16865 xmlNodePtr node; /* a node */
16868 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16869 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16870 mem_base = xmlMemBlocks();
16871 comp = gen_xmlPatternPtr(n_comp, 0);
16872 node = gen_xmlNodePtr(n_node, 1);
16874 ret_val = xmlPatternMatch(comp, node);
16875 desret_int(ret_val);
16877 des_xmlPatternPtr(n_comp, comp, 0);
16878 des_xmlNodePtr(n_node, node, 1);
16879 xmlResetLastError();
16880 if (mem_base != xmlMemBlocks()) {
16881 printf("Leak of %d blocks found in xmlPatternMatch",
16882 xmlMemBlocks() - mem_base);
16884 printf(" %d", n_comp);
16885 printf(" %d", n_node);
16898 test_xmlPatternMaxDepth(void) {
16901 #if defined(LIBXML_PATTERN_ENABLED)
16904 xmlPatternPtr comp; /* the precompiled pattern */
16907 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16908 mem_base = xmlMemBlocks();
16909 comp = gen_xmlPatternPtr(n_comp, 0);
16911 ret_val = xmlPatternMaxDepth(comp);
16912 desret_int(ret_val);
16914 des_xmlPatternPtr(n_comp, comp, 0);
16915 xmlResetLastError();
16916 if (mem_base != xmlMemBlocks()) {
16917 printf("Leak of %d blocks found in xmlPatternMaxDepth",
16918 xmlMemBlocks() - mem_base);
16920 printf(" %d", n_comp);
16932 test_xmlPatternMinDepth(void) {
16935 #if defined(LIBXML_PATTERN_ENABLED)
16938 xmlPatternPtr comp; /* the precompiled pattern */
16941 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16942 mem_base = xmlMemBlocks();
16943 comp = gen_xmlPatternPtr(n_comp, 0);
16945 ret_val = xmlPatternMinDepth(comp);
16946 desret_int(ret_val);
16948 des_xmlPatternPtr(n_comp, comp, 0);
16949 xmlResetLastError();
16950 if (mem_base != xmlMemBlocks()) {
16951 printf("Leak of %d blocks found in xmlPatternMinDepth",
16952 xmlMemBlocks() - mem_base);
16954 printf(" %d", n_comp);
16966 test_xmlPatternStreamable(void) {
16969 #if defined(LIBXML_PATTERN_ENABLED)
16972 xmlPatternPtr comp; /* the precompiled pattern */
16975 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16976 mem_base = xmlMemBlocks();
16977 comp = gen_xmlPatternPtr(n_comp, 0);
16979 ret_val = xmlPatternStreamable(comp);
16980 desret_int(ret_val);
16982 des_xmlPatternPtr(n_comp, comp, 0);
16983 xmlResetLastError();
16984 if (mem_base != xmlMemBlocks()) {
16985 printf("Leak of %d blocks found in xmlPatternStreamable",
16986 xmlMemBlocks() - mem_base);
16988 printf(" %d", n_comp);
17000 test_xmlPatterncompile(void) {
17004 /* missing type support */
17008 #ifdef LIBXML_PATTERN_ENABLED
17010 #define gen_nb_xmlStreamCtxtPtr 1
17011 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17014 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17020 test_xmlStreamPop(void) {
17023 #if defined(LIBXML_PATTERN_ENABLED)
17026 xmlStreamCtxtPtr stream; /* the stream context */
17029 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17030 mem_base = xmlMemBlocks();
17031 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17033 ret_val = xmlStreamPop(stream);
17034 desret_int(ret_val);
17036 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17037 xmlResetLastError();
17038 if (mem_base != xmlMemBlocks()) {
17039 printf("Leak of %d blocks found in xmlStreamPop",
17040 xmlMemBlocks() - mem_base);
17042 printf(" %d", n_stream);
17054 test_xmlStreamPush(void) {
17057 #if defined(LIBXML_PATTERN_ENABLED)
17060 xmlStreamCtxtPtr stream; /* the stream context */
17062 xmlChar * name; /* the current name */
17064 xmlChar * ns; /* the namespace name */
17067 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17068 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17069 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17070 mem_base = xmlMemBlocks();
17071 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17072 name = gen_const_xmlChar_ptr(n_name, 1);
17073 ns = gen_const_xmlChar_ptr(n_ns, 2);
17075 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17076 desret_int(ret_val);
17078 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17079 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17080 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17081 xmlResetLastError();
17082 if (mem_base != xmlMemBlocks()) {
17083 printf("Leak of %d blocks found in xmlStreamPush",
17084 xmlMemBlocks() - mem_base);
17086 printf(" %d", n_stream);
17087 printf(" %d", n_name);
17088 printf(" %d", n_ns);
17102 test_xmlStreamPushAttr(void) {
17105 #if defined(LIBXML_PATTERN_ENABLED)
17108 xmlStreamCtxtPtr stream; /* the stream context */
17110 xmlChar * name; /* the current name */
17112 xmlChar * ns; /* the namespace name */
17115 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17116 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17117 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17118 mem_base = xmlMemBlocks();
17119 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17120 name = gen_const_xmlChar_ptr(n_name, 1);
17121 ns = gen_const_xmlChar_ptr(n_ns, 2);
17123 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17124 desret_int(ret_val);
17126 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17127 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17128 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17129 xmlResetLastError();
17130 if (mem_base != xmlMemBlocks()) {
17131 printf("Leak of %d blocks found in xmlStreamPushAttr",
17132 xmlMemBlocks() - mem_base);
17134 printf(" %d", n_stream);
17135 printf(" %d", n_name);
17136 printf(" %d", n_ns);
17150 test_xmlStreamPushNode(void) {
17153 #if defined(LIBXML_PATTERN_ENABLED)
17156 xmlStreamCtxtPtr stream; /* the stream context */
17158 xmlChar * name; /* the current name */
17160 xmlChar * ns; /* the namespace name */
17162 int nodeType; /* the type of the node being pushed */
17165 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17166 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17167 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17168 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17169 mem_base = xmlMemBlocks();
17170 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17171 name = gen_const_xmlChar_ptr(n_name, 1);
17172 ns = gen_const_xmlChar_ptr(n_ns, 2);
17173 nodeType = gen_int(n_nodeType, 3);
17175 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17176 desret_int(ret_val);
17178 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17179 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17180 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17181 des_int(n_nodeType, nodeType, 3);
17182 xmlResetLastError();
17183 if (mem_base != xmlMemBlocks()) {
17184 printf("Leak of %d blocks found in xmlStreamPushNode",
17185 xmlMemBlocks() - mem_base);
17187 printf(" %d", n_stream);
17188 printf(" %d", n_name);
17189 printf(" %d", n_ns);
17190 printf(" %d", n_nodeType);
17205 test_xmlStreamWantsAnyNode(void) {
17208 #if defined(LIBXML_PATTERN_ENABLED)
17211 xmlStreamCtxtPtr streamCtxt; /* the stream context */
17214 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17215 mem_base = xmlMemBlocks();
17216 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17218 ret_val = xmlStreamWantsAnyNode(streamCtxt);
17219 desret_int(ret_val);
17221 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17222 xmlResetLastError();
17223 if (mem_base != xmlMemBlocks()) {
17224 printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17225 xmlMemBlocks() - mem_base);
17227 printf(" %d", n_streamCtxt);
17238 test_pattern(void) {
17241 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17242 test_ret += test_xmlPatternFromRoot();
17243 test_ret += test_xmlPatternGetStreamCtxt();
17244 test_ret += test_xmlPatternMatch();
17245 test_ret += test_xmlPatternMaxDepth();
17246 test_ret += test_xmlPatternMinDepth();
17247 test_ret += test_xmlPatternStreamable();
17248 test_ret += test_xmlPatterncompile();
17249 test_ret += test_xmlStreamPop();
17250 test_ret += test_xmlStreamPush();
17251 test_ret += test_xmlStreamPushAttr();
17252 test_ret += test_xmlStreamPushNode();
17253 test_ret += test_xmlStreamWantsAnyNode();
17256 printf("Module pattern: %d errors\n", test_ret);
17259 #ifdef LIBXML_SCHEMAS_ENABLED
17261 #define gen_nb_xmlRelaxNGPtr 1
17262 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17265 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17271 test_xmlRelaxNGDump(void) {
17274 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17276 FILE * output; /* the file output */
17278 xmlRelaxNGPtr schema; /* a schema structure */
17281 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17282 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17283 mem_base = xmlMemBlocks();
17284 output = gen_FILE_ptr(n_output, 0);
17285 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17287 xmlRelaxNGDump(output, schema);
17289 des_FILE_ptr(n_output, output, 0);
17290 des_xmlRelaxNGPtr(n_schema, schema, 1);
17291 xmlResetLastError();
17292 if (mem_base != xmlMemBlocks()) {
17293 printf("Leak of %d blocks found in xmlRelaxNGDump",
17294 xmlMemBlocks() - mem_base);
17296 printf(" %d", n_output);
17297 printf(" %d", n_schema);
17310 test_xmlRelaxNGDumpTree(void) {
17313 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17315 FILE * output; /* the file output */
17317 xmlRelaxNGPtr schema; /* a schema structure */
17320 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17321 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17322 mem_base = xmlMemBlocks();
17323 output = gen_FILE_ptr(n_output, 0);
17324 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17326 xmlRelaxNGDumpTree(output, schema);
17328 des_FILE_ptr(n_output, output, 0);
17329 des_xmlRelaxNGPtr(n_schema, schema, 1);
17330 xmlResetLastError();
17331 if (mem_base != xmlMemBlocks()) {
17332 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17333 xmlMemBlocks() - mem_base);
17335 printf(" %d", n_output);
17336 printf(" %d", n_schema);
17347 #ifdef LIBXML_SCHEMAS_ENABLED
17349 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17350 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17353 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17357 #ifdef LIBXML_SCHEMAS_ENABLED
17359 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17360 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17363 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17367 #ifdef LIBXML_SCHEMAS_ENABLED
17369 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17370 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17373 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17379 test_xmlRelaxNGGetParserErrors(void) {
17382 #if defined(LIBXML_SCHEMAS_ENABLED)
17385 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17387 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17389 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17391 void ** ctx; /* contextual data for the callbacks result */
17394 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17395 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17396 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17397 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17398 mem_base = xmlMemBlocks();
17399 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17400 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17401 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17402 ctx = gen_void_ptr_ptr(n_ctx, 3);
17404 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17405 desret_int(ret_val);
17407 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17408 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17409 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17410 des_void_ptr_ptr(n_ctx, ctx, 3);
17411 xmlResetLastError();
17412 if (mem_base != xmlMemBlocks()) {
17413 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17414 xmlMemBlocks() - mem_base);
17416 printf(" %d", n_ctxt);
17417 printf(" %d", n_err);
17418 printf(" %d", n_warn);
17419 printf(" %d", n_ctx);
17432 #ifdef LIBXML_SCHEMAS_ENABLED
17434 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17435 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17438 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17444 test_xmlRelaxNGGetValidErrors(void) {
17447 #if defined(LIBXML_SCHEMAS_ENABLED)
17450 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17452 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17454 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17456 void ** ctx; /* the functions context result */
17459 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17460 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17461 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17462 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17463 mem_base = xmlMemBlocks();
17464 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17465 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17466 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17467 ctx = gen_void_ptr_ptr(n_ctx, 3);
17469 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17470 desret_int(ret_val);
17472 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17473 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17474 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17475 des_void_ptr_ptr(n_ctx, ctx, 3);
17476 xmlResetLastError();
17477 if (mem_base != xmlMemBlocks()) {
17478 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17479 xmlMemBlocks() - mem_base);
17481 printf(" %d", n_ctxt);
17482 printf(" %d", n_err);
17483 printf(" %d", n_warn);
17484 printf(" %d", n_ctx);
17499 test_xmlRelaxNGInitTypes(void) {
17502 #if defined(LIBXML_SCHEMAS_ENABLED)
17506 mem_base = xmlMemBlocks();
17508 ret_val = xmlRelaxNGInitTypes();
17509 desret_int(ret_val);
17511 xmlResetLastError();
17512 if (mem_base != xmlMemBlocks()) {
17513 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17514 xmlMemBlocks() - mem_base);
17526 test_xmlRelaxNGNewDocParserCtxt(void) {
17529 #if defined(LIBXML_SCHEMAS_ENABLED)
17531 xmlRelaxNGParserCtxtPtr ret_val;
17532 xmlDocPtr doc; /* a preparsed document tree */
17535 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17536 mem_base = xmlMemBlocks();
17537 doc = gen_xmlDocPtr(n_doc, 0);
17539 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17540 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17542 des_xmlDocPtr(n_doc, doc, 0);
17543 xmlResetLastError();
17544 if (mem_base != xmlMemBlocks()) {
17545 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17546 xmlMemBlocks() - mem_base);
17548 printf(" %d", n_doc);
17560 test_xmlRelaxNGNewMemParserCtxt(void) {
17563 #if defined(LIBXML_SCHEMAS_ENABLED)
17565 xmlRelaxNGParserCtxtPtr ret_val;
17566 char * buffer; /* a pointer to a char array containing the schemas */
17568 int size; /* the size of the array */
17571 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17572 for (n_size = 0;n_size < gen_nb_int;n_size++) {
17573 mem_base = xmlMemBlocks();
17574 buffer = gen_const_char_ptr(n_buffer, 0);
17575 size = gen_int(n_size, 1);
17577 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17578 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17580 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17581 des_int(n_size, size, 1);
17582 xmlResetLastError();
17583 if (mem_base != xmlMemBlocks()) {
17584 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17585 xmlMemBlocks() - mem_base);
17587 printf(" %d", n_buffer);
17588 printf(" %d", n_size);
17601 test_xmlRelaxNGNewParserCtxt(void) {
17604 #if defined(LIBXML_SCHEMAS_ENABLED)
17606 xmlRelaxNGParserCtxtPtr ret_val;
17607 char * URL; /* the location of the schema */
17610 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17611 mem_base = xmlMemBlocks();
17612 URL = gen_const_char_ptr(n_URL, 0);
17614 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17615 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17617 des_const_char_ptr(n_URL, (const char *)URL, 0);
17618 xmlResetLastError();
17619 if (mem_base != xmlMemBlocks()) {
17620 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17621 xmlMemBlocks() - mem_base);
17623 printf(" %d", n_URL);
17635 test_xmlRelaxNGNewValidCtxt(void) {
17639 /* missing type support */
17645 test_xmlRelaxNGParse(void) {
17649 /* missing type support */
17655 test_xmlRelaxNGSetParserErrors(void) {
17659 /* missing type support */
17665 test_xmlRelaxNGSetParserStructuredErrors(void) {
17669 /* missing type support */
17675 test_xmlRelaxNGSetValidErrors(void) {
17679 /* missing type support */
17685 test_xmlRelaxNGSetValidStructuredErrors(void) {
17689 /* missing type support */
17695 test_xmlRelaxNGValidateDoc(void) {
17698 #if defined(LIBXML_SCHEMAS_ENABLED)
17701 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17703 xmlDocPtr doc; /* a parsed document tree */
17706 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17707 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17708 mem_base = xmlMemBlocks();
17709 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17710 doc = gen_xmlDocPtr(n_doc, 1);
17712 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17713 desret_int(ret_val);
17715 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17716 des_xmlDocPtr(n_doc, doc, 1);
17717 xmlResetLastError();
17718 if (mem_base != xmlMemBlocks()) {
17719 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17720 xmlMemBlocks() - mem_base);
17722 printf(" %d", n_ctxt);
17723 printf(" %d", n_doc);
17736 test_xmlRelaxNGValidateFullElement(void) {
17739 #if defined(LIBXML_SCHEMAS_ENABLED)
17742 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17744 xmlDocPtr doc; /* a document instance */
17746 xmlNodePtr elem; /* an element instance */
17749 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17750 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17751 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17752 mem_base = xmlMemBlocks();
17753 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17754 doc = gen_xmlDocPtr(n_doc, 1);
17755 elem = gen_xmlNodePtr(n_elem, 2);
17757 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17758 desret_int(ret_val);
17760 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17761 des_xmlDocPtr(n_doc, doc, 1);
17762 des_xmlNodePtr(n_elem, elem, 2);
17763 xmlResetLastError();
17764 if (mem_base != xmlMemBlocks()) {
17765 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17766 xmlMemBlocks() - mem_base);
17768 printf(" %d", n_ctxt);
17769 printf(" %d", n_doc);
17770 printf(" %d", n_elem);
17784 test_xmlRelaxNGValidatePopElement(void) {
17787 #if defined(LIBXML_SCHEMAS_ENABLED)
17790 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17792 xmlDocPtr doc; /* a document instance */
17794 xmlNodePtr elem; /* an element instance */
17797 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17798 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17799 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17800 mem_base = xmlMemBlocks();
17801 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17802 doc = gen_xmlDocPtr(n_doc, 1);
17803 elem = gen_xmlNodePtr(n_elem, 2);
17805 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17806 desret_int(ret_val);
17808 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17809 des_xmlDocPtr(n_doc, doc, 1);
17810 des_xmlNodePtr(n_elem, elem, 2);
17811 xmlResetLastError();
17812 if (mem_base != xmlMemBlocks()) {
17813 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17814 xmlMemBlocks() - mem_base);
17816 printf(" %d", n_ctxt);
17817 printf(" %d", n_doc);
17818 printf(" %d", n_elem);
17832 test_xmlRelaxNGValidatePushCData(void) {
17835 #if defined(LIBXML_SCHEMAS_ENABLED)
17838 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17840 xmlChar * data; /* some character data read */
17842 int len; /* the length of the data */
17845 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17846 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17847 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17848 mem_base = xmlMemBlocks();
17849 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17850 data = gen_const_xmlChar_ptr(n_data, 1);
17851 len = gen_int(n_len, 2);
17853 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17854 desret_int(ret_val);
17856 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17857 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17858 des_int(n_len, len, 2);
17859 xmlResetLastError();
17860 if (mem_base != xmlMemBlocks()) {
17861 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17862 xmlMemBlocks() - mem_base);
17864 printf(" %d", n_ctxt);
17865 printf(" %d", n_data);
17866 printf(" %d", n_len);
17880 test_xmlRelaxNGValidatePushElement(void) {
17883 #if defined(LIBXML_SCHEMAS_ENABLED)
17886 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17888 xmlDocPtr doc; /* a document instance */
17890 xmlNodePtr elem; /* an element instance */
17893 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17894 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17895 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17896 mem_base = xmlMemBlocks();
17897 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17898 doc = gen_xmlDocPtr(n_doc, 1);
17899 elem = gen_xmlNodePtr(n_elem, 2);
17901 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17902 desret_int(ret_val);
17904 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17905 des_xmlDocPtr(n_doc, doc, 1);
17906 des_xmlNodePtr(n_elem, elem, 2);
17907 xmlResetLastError();
17908 if (mem_base != xmlMemBlocks()) {
17909 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17910 xmlMemBlocks() - mem_base);
17912 printf(" %d", n_ctxt);
17913 printf(" %d", n_doc);
17914 printf(" %d", n_elem);
17928 test_xmlRelaxParserSetFlag(void) {
17931 #if defined(LIBXML_SCHEMAS_ENABLED)
17934 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17936 int flags; /* a set of flags values */
17939 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17940 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17941 mem_base = xmlMemBlocks();
17942 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17943 flags = gen_int(n_flags, 1);
17945 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17946 desret_int(ret_val);
17948 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17949 des_int(n_flags, flags, 1);
17950 xmlResetLastError();
17951 if (mem_base != xmlMemBlocks()) {
17952 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17953 xmlMemBlocks() - mem_base);
17955 printf(" %d", n_ctxt);
17956 printf(" %d", n_flags);
17968 test_relaxng(void) {
17971 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17972 test_ret += test_xmlRelaxNGDump();
17973 test_ret += test_xmlRelaxNGDumpTree();
17974 test_ret += test_xmlRelaxNGGetParserErrors();
17975 test_ret += test_xmlRelaxNGGetValidErrors();
17976 test_ret += test_xmlRelaxNGInitTypes();
17977 test_ret += test_xmlRelaxNGNewDocParserCtxt();
17978 test_ret += test_xmlRelaxNGNewMemParserCtxt();
17979 test_ret += test_xmlRelaxNGNewParserCtxt();
17980 test_ret += test_xmlRelaxNGNewValidCtxt();
17981 test_ret += test_xmlRelaxNGParse();
17982 test_ret += test_xmlRelaxNGSetParserErrors();
17983 test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17984 test_ret += test_xmlRelaxNGSetValidErrors();
17985 test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17986 test_ret += test_xmlRelaxNGValidateDoc();
17987 test_ret += test_xmlRelaxNGValidateFullElement();
17988 test_ret += test_xmlRelaxNGValidatePopElement();
17989 test_ret += test_xmlRelaxNGValidatePushCData();
17990 test_ret += test_xmlRelaxNGValidatePushElement();
17991 test_ret += test_xmlRelaxParserSetFlag();
17994 printf("Module relaxng: %d errors\n", test_ret);
17998 test_schemasInternals(void) {
18001 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18004 printf("Module schemasInternals: %d errors\n", test_ret);
18009 test_xmlSchematronNewDocParserCtxt(void) {
18013 /* missing type support */
18019 test_xmlSchematronNewMemParserCtxt(void) {
18023 /* missing type support */
18029 test_xmlSchematronNewParserCtxt(void) {
18033 /* missing type support */
18037 #ifdef LIBXML_SCHEMATRON_ENABLED
18039 #define gen_nb_xmlSchematronPtr 1
18040 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18043 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18049 test_xmlSchematronNewValidCtxt(void) {
18053 /* missing type support */
18057 #ifdef LIBXML_SCHEMATRON_ENABLED
18059 #define gen_nb_xmlSchematronParserCtxtPtr 1
18060 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18063 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18069 test_xmlSchematronParse(void) {
18073 /* missing type support */
18077 #ifdef LIBXML_SCHEMATRON_ENABLED
18079 #define gen_nb_xmlSchematronValidCtxtPtr 1
18080 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18083 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18089 test_xmlSchematronSetValidStructuredErrors(void) {
18093 /* missing type support */
18099 test_xmlSchematronValidateDoc(void) {
18102 #if defined(LIBXML_SCHEMATRON_ENABLED)
18105 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18107 xmlDocPtr instance; /* the document instace tree */
18110 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18111 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18112 mem_base = xmlMemBlocks();
18113 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18114 instance = gen_xmlDocPtr(n_instance, 1);
18116 ret_val = xmlSchematronValidateDoc(ctxt, instance);
18117 desret_int(ret_val);
18119 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18120 des_xmlDocPtr(n_instance, instance, 1);
18121 xmlResetLastError();
18122 if (mem_base != xmlMemBlocks()) {
18123 printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18124 xmlMemBlocks() - mem_base);
18126 printf(" %d", n_ctxt);
18127 printf(" %d", n_instance);
18139 test_schematron(void) {
18142 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18143 test_ret += test_xmlSchematronNewDocParserCtxt();
18144 test_ret += test_xmlSchematronNewMemParserCtxt();
18145 test_ret += test_xmlSchematronNewParserCtxt();
18146 test_ret += test_xmlSchematronNewValidCtxt();
18147 test_ret += test_xmlSchematronParse();
18148 test_ret += test_xmlSchematronSetValidStructuredErrors();
18149 test_ret += test_xmlSchematronValidateDoc();
18152 printf("Module schematron: %d errors\n", test_ret);
18157 test_xmlAddChild(void) {
18161 xmlNodePtr ret_val;
18162 xmlNodePtr parent; /* the parent node */
18164 xmlNodePtr cur; /* the child node */
18167 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18168 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18169 mem_base = xmlMemBlocks();
18170 parent = gen_xmlNodePtr(n_parent, 0);
18171 cur = gen_xmlNodePtr_in(n_cur, 1);
18173 ret_val = xmlAddChild(parent, cur);
18174 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18175 desret_xmlNodePtr(ret_val);
18177 des_xmlNodePtr(n_parent, parent, 0);
18178 des_xmlNodePtr_in(n_cur, cur, 1);
18179 xmlResetLastError();
18180 if (mem_base != xmlMemBlocks()) {
18181 printf("Leak of %d blocks found in xmlAddChild",
18182 xmlMemBlocks() - mem_base);
18184 printf(" %d", n_parent);
18185 printf(" %d", n_cur);
18197 test_xmlAddChildList(void) {
18201 xmlNodePtr ret_val;
18202 xmlNodePtr parent; /* the parent node */
18204 xmlNodePtr cur; /* the first node in the list */
18207 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18208 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18209 mem_base = xmlMemBlocks();
18210 parent = gen_xmlNodePtr(n_parent, 0);
18211 cur = gen_xmlNodePtr_in(n_cur, 1);
18213 ret_val = xmlAddChildList(parent, cur);
18214 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18215 desret_xmlNodePtr(ret_val);
18217 des_xmlNodePtr(n_parent, parent, 0);
18218 des_xmlNodePtr_in(n_cur, cur, 1);
18219 xmlResetLastError();
18220 if (mem_base != xmlMemBlocks()) {
18221 printf("Leak of %d blocks found in xmlAddChildList",
18222 xmlMemBlocks() - mem_base);
18224 printf(" %d", n_parent);
18225 printf(" %d", n_cur);
18237 test_xmlAddNextSibling(void) {
18241 xmlNodePtr ret_val;
18242 xmlNodePtr cur; /* the child node */
18244 xmlNodePtr elem; /* the new node */
18247 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18248 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18249 mem_base = xmlMemBlocks();
18250 cur = gen_xmlNodePtr(n_cur, 0);
18251 elem = gen_xmlNodePtr_in(n_elem, 1);
18253 ret_val = xmlAddNextSibling(cur, elem);
18254 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18255 desret_xmlNodePtr(ret_val);
18257 des_xmlNodePtr(n_cur, cur, 0);
18258 des_xmlNodePtr_in(n_elem, elem, 1);
18259 xmlResetLastError();
18260 if (mem_base != xmlMemBlocks()) {
18261 printf("Leak of %d blocks found in xmlAddNextSibling",
18262 xmlMemBlocks() - mem_base);
18264 printf(" %d", n_cur);
18265 printf(" %d", n_elem);
18277 test_xmlAddPrevSibling(void) {
18280 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
18282 xmlNodePtr ret_val;
18283 xmlNodePtr cur; /* the child node */
18285 xmlNodePtr elem; /* the new node */
18288 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18289 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18290 mem_base = xmlMemBlocks();
18291 cur = gen_xmlNodePtr(n_cur, 0);
18292 elem = gen_xmlNodePtr_in(n_elem, 1);
18294 ret_val = xmlAddPrevSibling(cur, elem);
18295 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18296 desret_xmlNodePtr(ret_val);
18298 des_xmlNodePtr(n_cur, cur, 0);
18299 des_xmlNodePtr_in(n_elem, elem, 1);
18300 xmlResetLastError();
18301 if (mem_base != xmlMemBlocks()) {
18302 printf("Leak of %d blocks found in xmlAddPrevSibling",
18303 xmlMemBlocks() - mem_base);
18305 printf(" %d", n_cur);
18306 printf(" %d", n_elem);
18319 test_xmlAddSibling(void) {
18323 xmlNodePtr ret_val;
18324 xmlNodePtr cur; /* the child node */
18326 xmlNodePtr elem; /* the new node */
18329 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18330 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18331 mem_base = xmlMemBlocks();
18332 cur = gen_xmlNodePtr(n_cur, 0);
18333 elem = gen_xmlNodePtr_in(n_elem, 1);
18335 ret_val = xmlAddSibling(cur, elem);
18336 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18337 desret_xmlNodePtr(ret_val);
18339 des_xmlNodePtr(n_cur, cur, 0);
18340 des_xmlNodePtr_in(n_elem, elem, 1);
18341 xmlResetLastError();
18342 if (mem_base != xmlMemBlocks()) {
18343 printf("Leak of %d blocks found in xmlAddSibling",
18344 xmlMemBlocks() - mem_base);
18346 printf(" %d", n_cur);
18347 printf(" %d", n_elem);
18359 test_xmlAttrSerializeTxtContent(void) {
18362 #if defined(LIBXML_OUTPUT_ENABLED)
18363 #ifdef LIBXML_OUTPUT_ENABLED
18365 xmlBufferPtr buf; /* the XML buffer output */
18367 xmlDocPtr doc; /* the document */
18369 xmlAttrPtr attr; /* the attribute node */
18371 xmlChar * string; /* the text content */
18374 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18375 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18376 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18377 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18378 mem_base = xmlMemBlocks();
18379 buf = gen_xmlBufferPtr(n_buf, 0);
18380 doc = gen_xmlDocPtr(n_doc, 1);
18381 attr = gen_xmlAttrPtr(n_attr, 2);
18382 string = gen_const_xmlChar_ptr(n_string, 3);
18384 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18386 des_xmlBufferPtr(n_buf, buf, 0);
18387 des_xmlDocPtr(n_doc, doc, 1);
18388 des_xmlAttrPtr(n_attr, attr, 2);
18389 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18390 xmlResetLastError();
18391 if (mem_base != xmlMemBlocks()) {
18392 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18393 xmlMemBlocks() - mem_base);
18395 printf(" %d", n_buf);
18396 printf(" %d", n_doc);
18397 printf(" %d", n_attr);
18398 printf(" %d", n_string);
18413 #define gen_nb_const_xmlBuf_ptr 1
18414 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18417 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18421 test_xmlBufContent(void) {
18426 xmlBuf * buf; /* the buffer */
18429 for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
18430 mem_base = xmlMemBlocks();
18431 buf = gen_const_xmlBuf_ptr(n_buf, 0);
18433 ret_val = xmlBufContent((const xmlBuf *)buf);
18434 desret_xmlChar_ptr(ret_val);
18436 des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
18437 xmlResetLastError();
18438 if (mem_base != xmlMemBlocks()) {
18439 printf("Leak of %d blocks found in xmlBufContent",
18440 xmlMemBlocks() - mem_base);
18442 printf(" %d", n_buf);
18452 #define gen_nb_xmlBufPtr 1
18453 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18456 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18460 test_xmlBufEnd(void) {
18465 xmlBufPtr buf; /* the buffer */
18468 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18469 mem_base = xmlMemBlocks();
18470 buf = gen_xmlBufPtr(n_buf, 0);
18472 ret_val = xmlBufEnd(buf);
18473 desret_xmlChar_ptr(ret_val);
18475 des_xmlBufPtr(n_buf, buf, 0);
18476 xmlResetLastError();
18477 if (mem_base != xmlMemBlocks()) {
18478 printf("Leak of %d blocks found in xmlBufEnd",
18479 xmlMemBlocks() - mem_base);
18481 printf(" %d", n_buf);
18491 #define gen_nb_const_xmlNode_ptr 1
18492 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18495 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18499 test_xmlBufGetNodeContent(void) {
18504 xmlBufPtr buf; /* a buffer xmlBufPtr */
18506 xmlNode * cur; /* the node being read */
18509 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18510 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
18511 mem_base = xmlMemBlocks();
18512 buf = gen_xmlBufPtr(n_buf, 0);
18513 cur = gen_const_xmlNode_ptr(n_cur, 1);
18515 ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
18516 desret_int(ret_val);
18518 des_xmlBufPtr(n_buf, buf, 0);
18519 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
18520 xmlResetLastError();
18521 if (mem_base != xmlMemBlocks()) {
18522 printf("Leak of %d blocks found in xmlBufGetNodeContent",
18523 xmlMemBlocks() - mem_base);
18525 printf(" %d", n_buf);
18526 printf(" %d", n_cur);
18538 test_xmlBufNodeDump(void) {
18542 /* missing type support */
18548 test_xmlBufShrink(void) {
18552 /* missing type support */
18557 #define gen_nb_const_xmlBufPtr 1
18558 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18561 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18565 test_xmlBufUse(void) {
18569 /* missing type support */
18575 test_xmlBufferAdd(void) {
18580 xmlBufferPtr buf; /* the buffer to dump */
18582 xmlChar * str; /* the #xmlChar string */
18584 int len; /* the number of #xmlChar to add */
18587 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18588 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18589 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18590 mem_base = xmlMemBlocks();
18591 buf = gen_xmlBufferPtr(n_buf, 0);
18592 str = gen_const_xmlChar_ptr(n_str, 1);
18593 len = gen_int(n_len, 2);
18595 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18596 desret_int(ret_val);
18598 des_xmlBufferPtr(n_buf, buf, 0);
18599 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18600 des_int(n_len, len, 2);
18601 xmlResetLastError();
18602 if (mem_base != xmlMemBlocks()) {
18603 printf("Leak of %d blocks found in xmlBufferAdd",
18604 xmlMemBlocks() - mem_base);
18606 printf(" %d", n_buf);
18607 printf(" %d", n_str);
18608 printf(" %d", n_len);
18621 test_xmlBufferAddHead(void) {
18626 xmlBufferPtr buf; /* the buffer */
18628 xmlChar * str; /* the #xmlChar string */
18630 int len; /* the number of #xmlChar to add */
18633 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18634 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18635 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18636 mem_base = xmlMemBlocks();
18637 buf = gen_xmlBufferPtr(n_buf, 0);
18638 str = gen_const_xmlChar_ptr(n_str, 1);
18639 len = gen_int(n_len, 2);
18641 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18642 desret_int(ret_val);
18644 des_xmlBufferPtr(n_buf, buf, 0);
18645 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18646 des_int(n_len, len, 2);
18647 xmlResetLastError();
18648 if (mem_base != xmlMemBlocks()) {
18649 printf("Leak of %d blocks found in xmlBufferAddHead",
18650 xmlMemBlocks() - mem_base);
18652 printf(" %d", n_buf);
18653 printf(" %d", n_str);
18654 printf(" %d", n_len);
18667 test_xmlBufferCCat(void) {
18672 xmlBufferPtr buf; /* the buffer to dump */
18674 char * str; /* the C char string */
18677 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18678 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18679 mem_base = xmlMemBlocks();
18680 buf = gen_xmlBufferPtr(n_buf, 0);
18681 str = gen_const_char_ptr(n_str, 1);
18683 ret_val = xmlBufferCCat(buf, (const char *)str);
18684 desret_int(ret_val);
18686 des_xmlBufferPtr(n_buf, buf, 0);
18687 des_const_char_ptr(n_str, (const char *)str, 1);
18688 xmlResetLastError();
18689 if (mem_base != xmlMemBlocks()) {
18690 printf("Leak of %d blocks found in xmlBufferCCat",
18691 xmlMemBlocks() - mem_base);
18693 printf(" %d", n_buf);
18694 printf(" %d", n_str);
18706 test_xmlBufferCat(void) {
18711 xmlBufferPtr buf; /* the buffer to add to */
18713 xmlChar * str; /* the #xmlChar string */
18716 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18717 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18718 mem_base = xmlMemBlocks();
18719 buf = gen_xmlBufferPtr(n_buf, 0);
18720 str = gen_const_xmlChar_ptr(n_str, 1);
18722 ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18723 desret_int(ret_val);
18725 des_xmlBufferPtr(n_buf, buf, 0);
18726 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18727 xmlResetLastError();
18728 if (mem_base != xmlMemBlocks()) {
18729 printf("Leak of %d blocks found in xmlBufferCat",
18730 xmlMemBlocks() - mem_base);
18732 printf(" %d", n_buf);
18733 printf(" %d", n_str);
18744 #define gen_nb_const_xmlBuffer_ptr 1
18745 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18748 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18752 test_xmlBufferContent(void) {
18756 const xmlChar * ret_val;
18757 xmlBuffer * buf; /* the buffer */
18760 for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18761 mem_base = xmlMemBlocks();
18762 buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18764 ret_val = xmlBufferContent((const xmlBuffer *)buf);
18765 desret_const_xmlChar_ptr(ret_val);
18767 des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
18768 xmlResetLastError();
18769 if (mem_base != xmlMemBlocks()) {
18770 printf("Leak of %d blocks found in xmlBufferContent",
18771 xmlMemBlocks() - mem_base);
18773 printf(" %d", n_buf);
18784 test_xmlBufferCreate(void) {
18788 xmlBufferPtr ret_val;
18790 mem_base = xmlMemBlocks();
18792 ret_val = xmlBufferCreate();
18793 desret_xmlBufferPtr(ret_val);
18795 xmlResetLastError();
18796 if (mem_base != xmlMemBlocks()) {
18797 printf("Leak of %d blocks found in xmlBufferCreate",
18798 xmlMemBlocks() - mem_base);
18809 test_xmlBufferCreateSize(void) {
18813 /* missing type support */
18819 test_xmlBufferCreateStatic(void) {
18823 /* missing type support */
18829 test_xmlBufferDetach(void) {
18834 xmlBufferPtr buf; /* the buffer */
18837 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18838 mem_base = xmlMemBlocks();
18839 buf = gen_xmlBufferPtr(n_buf, 0);
18841 ret_val = xmlBufferDetach(buf);
18842 desret_xmlChar_ptr(ret_val);
18844 des_xmlBufferPtr(n_buf, buf, 0);
18845 xmlResetLastError();
18846 if (mem_base != xmlMemBlocks()) {
18847 printf("Leak of %d blocks found in xmlBufferDetach",
18848 xmlMemBlocks() - mem_base);
18850 printf(" %d", n_buf);
18861 test_xmlBufferEmpty(void) {
18865 xmlBufferPtr buf; /* the buffer */
18868 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18869 mem_base = xmlMemBlocks();
18870 buf = gen_xmlBufferPtr(n_buf, 0);
18872 xmlBufferEmpty(buf);
18874 des_xmlBufferPtr(n_buf, buf, 0);
18875 xmlResetLastError();
18876 if (mem_base != xmlMemBlocks()) {
18877 printf("Leak of %d blocks found in xmlBufferEmpty",
18878 xmlMemBlocks() - mem_base);
18880 printf(" %d", n_buf);
18891 test_xmlBufferGrow(void) {
18896 xmlBufferPtr buf; /* the buffer */
18898 unsigned int len; /* the minimum free size to allocate */
18901 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18902 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18903 mem_base = xmlMemBlocks();
18904 buf = gen_xmlBufferPtr(n_buf, 0);
18905 len = gen_unsigned_int(n_len, 1);
18907 ret_val = xmlBufferGrow(buf, len);
18908 desret_int(ret_val);
18910 des_xmlBufferPtr(n_buf, buf, 0);
18911 des_unsigned_int(n_len, len, 1);
18912 xmlResetLastError();
18913 if (mem_base != xmlMemBlocks()) {
18914 printf("Leak of %d blocks found in xmlBufferGrow",
18915 xmlMemBlocks() - mem_base);
18917 printf(" %d", n_buf);
18918 printf(" %d", n_len);
18930 test_xmlBufferLength(void) {
18935 xmlBuffer * buf; /* the buffer */
18938 for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18939 mem_base = xmlMemBlocks();
18940 buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18942 ret_val = xmlBufferLength((const xmlBuffer *)buf);
18943 desret_int(ret_val);
18945 des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
18946 xmlResetLastError();
18947 if (mem_base != xmlMemBlocks()) {
18948 printf("Leak of %d blocks found in xmlBufferLength",
18949 xmlMemBlocks() - mem_base);
18951 printf(" %d", n_buf);
18962 test_xmlBufferResize(void) {
18967 xmlBufferPtr buf; /* the buffer to resize */
18969 unsigned int size; /* the desired size */
18972 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18973 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18974 mem_base = xmlMemBlocks();
18975 buf = gen_xmlBufferPtr(n_buf, 0);
18976 size = gen_unsigned_int(n_size, 1);
18978 ret_val = xmlBufferResize(buf, size);
18979 desret_int(ret_val);
18981 des_xmlBufferPtr(n_buf, buf, 0);
18982 des_unsigned_int(n_size, size, 1);
18983 xmlResetLastError();
18984 if (mem_base != xmlMemBlocks()) {
18985 printf("Leak of %d blocks found in xmlBufferResize",
18986 xmlMemBlocks() - mem_base);
18988 printf(" %d", n_buf);
18989 printf(" %d", n_size);
19001 test_xmlBufferSetAllocationScheme(void) {
19005 xmlBufferPtr buf; /* the buffer to tune */
19007 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
19010 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19011 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
19012 mem_base = xmlMemBlocks();
19013 buf = gen_xmlBufferPtr(n_buf, 0);
19014 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
19016 xmlBufferSetAllocationScheme(buf, scheme);
19017 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
19019 des_xmlBufferPtr(n_buf, buf, 0);
19020 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19021 xmlResetLastError();
19022 if (mem_base != xmlMemBlocks()) {
19023 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19024 xmlMemBlocks() - mem_base);
19026 printf(" %d", n_buf);
19027 printf(" %d", n_scheme);
19039 test_xmlBufferShrink(void) {
19044 xmlBufferPtr buf; /* the buffer to dump */
19046 unsigned int len; /* the number of xmlChar to remove */
19049 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19050 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19051 mem_base = xmlMemBlocks();
19052 buf = gen_xmlBufferPtr(n_buf, 0);
19053 len = gen_unsigned_int(n_len, 1);
19055 ret_val = xmlBufferShrink(buf, len);
19056 desret_int(ret_val);
19058 des_xmlBufferPtr(n_buf, buf, 0);
19059 des_unsigned_int(n_len, len, 1);
19060 xmlResetLastError();
19061 if (mem_base != xmlMemBlocks()) {
19062 printf("Leak of %d blocks found in xmlBufferShrink",
19063 xmlMemBlocks() - mem_base);
19065 printf(" %d", n_buf);
19066 printf(" %d", n_len);
19078 test_xmlBufferWriteCHAR(void) {
19082 xmlBufferPtr buf; /* the XML buffer */
19084 xmlChar * string; /* the string to add */
19087 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19088 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19089 mem_base = xmlMemBlocks();
19090 buf = gen_xmlBufferPtr(n_buf, 0);
19091 string = gen_const_xmlChar_ptr(n_string, 1);
19093 xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19095 des_xmlBufferPtr(n_buf, buf, 0);
19096 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19097 xmlResetLastError();
19098 if (mem_base != xmlMemBlocks()) {
19099 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19100 xmlMemBlocks() - mem_base);
19102 printf(" %d", n_buf);
19103 printf(" %d", n_string);
19115 test_xmlBufferWriteChar(void) {
19119 xmlBufferPtr buf; /* the XML buffer output */
19121 char * string; /* the string to add */
19124 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19125 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19126 mem_base = xmlMemBlocks();
19127 buf = gen_xmlBufferPtr(n_buf, 0);
19128 string = gen_const_char_ptr(n_string, 1);
19130 xmlBufferWriteChar(buf, (const char *)string);
19132 des_xmlBufferPtr(n_buf, buf, 0);
19133 des_const_char_ptr(n_string, (const char *)string, 1);
19134 xmlResetLastError();
19135 if (mem_base != xmlMemBlocks()) {
19136 printf("Leak of %d blocks found in xmlBufferWriteChar",
19137 xmlMemBlocks() - mem_base);
19139 printf(" %d", n_buf);
19140 printf(" %d", n_string);
19152 test_xmlBufferWriteQuotedString(void) {
19156 xmlBufferPtr buf; /* the XML buffer output */
19158 xmlChar * string; /* the string to add */
19161 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19162 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19163 mem_base = xmlMemBlocks();
19164 buf = gen_xmlBufferPtr(n_buf, 0);
19165 string = gen_const_xmlChar_ptr(n_string, 1);
19167 xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19169 des_xmlBufferPtr(n_buf, buf, 0);
19170 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19171 xmlResetLastError();
19172 if (mem_base != xmlMemBlocks()) {
19173 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19174 xmlMemBlocks() - mem_base);
19176 printf(" %d", n_buf);
19177 printf(" %d", n_string);
19189 test_xmlBuildQName(void) {
19194 xmlChar * ncname; /* the Name */
19196 xmlChar * prefix; /* the prefix */
19198 xmlChar * memory; /* preallocated memory */
19200 int len; /* preallocated memory length */
19203 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19204 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19205 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19206 for (n_len = 0;n_len < gen_nb_int;n_len++) {
19207 mem_base = xmlMemBlocks();
19208 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19209 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19210 memory = gen_xmlChar_ptr(n_memory, 2);
19211 len = gen_int(n_len, 3);
19213 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19214 if ((ret_val != NULL) && (ret_val != ncname) &&
19215 (ret_val != prefix) && (ret_val != memory))
19218 desret_xmlChar_ptr(ret_val);
19220 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19221 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19222 des_xmlChar_ptr(n_memory, memory, 2);
19223 des_int(n_len, len, 3);
19224 xmlResetLastError();
19225 if (mem_base != xmlMemBlocks()) {
19226 printf("Leak of %d blocks found in xmlBuildQName",
19227 xmlMemBlocks() - mem_base);
19229 printf(" %d", n_ncname);
19230 printf(" %d", n_prefix);
19231 printf(" %d", n_memory);
19232 printf(" %d", n_len);
19246 test_xmlChildElementCount(void) {
19249 #if defined(LIBXML_TREE_ENABLED)
19251 unsigned long ret_val;
19252 xmlNodePtr parent; /* the parent node */
19255 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19256 mem_base = xmlMemBlocks();
19257 parent = gen_xmlNodePtr(n_parent, 0);
19259 ret_val = xmlChildElementCount(parent);
19260 desret_unsigned_long(ret_val);
19262 des_xmlNodePtr(n_parent, parent, 0);
19263 xmlResetLastError();
19264 if (mem_base != xmlMemBlocks()) {
19265 printf("Leak of %d blocks found in xmlChildElementCount",
19266 xmlMemBlocks() - mem_base);
19268 printf(" %d", n_parent);
19280 test_xmlCopyDoc(void) {
19283 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19286 xmlDocPtr doc; /* the document */
19288 int recursive; /* if not zero do a recursive copy. */
19291 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19292 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19293 mem_base = xmlMemBlocks();
19294 doc = gen_xmlDocPtr(n_doc, 0);
19295 recursive = gen_int(n_recursive, 1);
19297 ret_val = xmlCopyDoc(doc, recursive);
19298 desret_xmlDocPtr(ret_val);
19300 des_xmlDocPtr(n_doc, doc, 0);
19301 des_int(n_recursive, recursive, 1);
19302 xmlResetLastError();
19303 if (mem_base != xmlMemBlocks()) {
19304 printf("Leak of %d blocks found in xmlCopyDoc",
19305 xmlMemBlocks() - mem_base);
19307 printf(" %d", n_doc);
19308 printf(" %d", n_recursive);
19321 test_xmlCopyDtd(void) {
19324 #if defined(LIBXML_TREE_ENABLED)
19327 xmlDtdPtr dtd; /* the dtd */
19330 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19331 mem_base = xmlMemBlocks();
19332 dtd = gen_xmlDtdPtr(n_dtd, 0);
19334 ret_val = xmlCopyDtd(dtd);
19335 desret_xmlDtdPtr(ret_val);
19337 des_xmlDtdPtr(n_dtd, dtd, 0);
19338 xmlResetLastError();
19339 if (mem_base != xmlMemBlocks()) {
19340 printf("Leak of %d blocks found in xmlCopyDtd",
19341 xmlMemBlocks() - mem_base);
19343 printf(" %d", n_dtd);
19355 test_xmlCopyNamespace(void) {
19360 xmlNsPtr cur; /* the namespace */
19363 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19364 mem_base = xmlMemBlocks();
19365 cur = gen_xmlNsPtr(n_cur, 0);
19367 ret_val = xmlCopyNamespace(cur);
19368 if (ret_val != NULL) xmlFreeNs(ret_val);
19369 desret_xmlNsPtr(ret_val);
19371 des_xmlNsPtr(n_cur, cur, 0);
19372 xmlResetLastError();
19373 if (mem_base != xmlMemBlocks()) {
19374 printf("Leak of %d blocks found in xmlCopyNamespace",
19375 xmlMemBlocks() - mem_base);
19377 printf(" %d", n_cur);
19388 test_xmlCopyNamespaceList(void) {
19393 xmlNsPtr cur; /* the first namespace */
19396 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19397 mem_base = xmlMemBlocks();
19398 cur = gen_xmlNsPtr(n_cur, 0);
19400 ret_val = xmlCopyNamespaceList(cur);
19401 if (ret_val != NULL) xmlFreeNsList(ret_val);
19402 desret_xmlNsPtr(ret_val);
19404 des_xmlNsPtr(n_cur, cur, 0);
19405 xmlResetLastError();
19406 if (mem_base != xmlMemBlocks()) {
19407 printf("Leak of %d blocks found in xmlCopyNamespaceList",
19408 xmlMemBlocks() - mem_base);
19410 printf(" %d", n_cur);
19421 test_xmlCopyNode(void) {
19425 xmlNodePtr ret_val;
19426 xmlNodePtr node; /* the node */
19428 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19431 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19432 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19433 mem_base = xmlMemBlocks();
19434 node = gen_xmlNodePtr(n_node, 0);
19435 extended = gen_int(n_extended, 1);
19437 ret_val = xmlCopyNode(node, extended);
19438 desret_xmlNodePtr(ret_val);
19440 des_xmlNodePtr(n_node, node, 0);
19441 des_int(n_extended, extended, 1);
19442 xmlResetLastError();
19443 if (mem_base != xmlMemBlocks()) {
19444 printf("Leak of %d blocks found in xmlCopyNode",
19445 xmlMemBlocks() - mem_base);
19447 printf(" %d", n_node);
19448 printf(" %d", n_extended);
19460 test_xmlCopyNodeList(void) {
19464 xmlNodePtr ret_val;
19465 xmlNodePtr node; /* the first node in the list. */
19468 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19469 mem_base = xmlMemBlocks();
19470 node = gen_xmlNodePtr(n_node, 0);
19472 ret_val = xmlCopyNodeList(node);
19473 desret_xmlNodePtr(ret_val);
19475 des_xmlNodePtr(n_node, node, 0);
19476 xmlResetLastError();
19477 if (mem_base != xmlMemBlocks()) {
19478 printf("Leak of %d blocks found in xmlCopyNodeList",
19479 xmlMemBlocks() - mem_base);
19481 printf(" %d", n_node);
19492 test_xmlCopyProp(void) {
19496 xmlAttrPtr ret_val;
19497 xmlNodePtr target; /* the element where the attribute will be grafted */
19499 xmlAttrPtr cur; /* the attribute */
19502 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19503 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19504 mem_base = xmlMemBlocks();
19505 target = gen_xmlNodePtr(n_target, 0);
19506 cur = gen_xmlAttrPtr(n_cur, 1);
19508 ret_val = xmlCopyProp(target, cur);
19509 desret_xmlAttrPtr(ret_val);
19511 des_xmlNodePtr(n_target, target, 0);
19512 des_xmlAttrPtr(n_cur, cur, 1);
19513 xmlResetLastError();
19514 if (mem_base != xmlMemBlocks()) {
19515 printf("Leak of %d blocks found in xmlCopyProp",
19516 xmlMemBlocks() - mem_base);
19518 printf(" %d", n_target);
19519 printf(" %d", n_cur);
19531 test_xmlCopyPropList(void) {
19535 xmlAttrPtr ret_val;
19536 xmlNodePtr target; /* the element where the attributes will be grafted */
19538 xmlAttrPtr cur; /* the first attribute */
19541 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19542 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19543 mem_base = xmlMemBlocks();
19544 target = gen_xmlNodePtr(n_target, 0);
19545 cur = gen_xmlAttrPtr(n_cur, 1);
19547 ret_val = xmlCopyPropList(target, cur);
19548 desret_xmlAttrPtr(ret_val);
19550 des_xmlNodePtr(n_target, target, 0);
19551 des_xmlAttrPtr(n_cur, cur, 1);
19552 xmlResetLastError();
19553 if (mem_base != xmlMemBlocks()) {
19554 printf("Leak of %d blocks found in xmlCopyPropList",
19555 xmlMemBlocks() - mem_base);
19557 printf(" %d", n_target);
19558 printf(" %d", n_cur);
19570 test_xmlCreateIntSubset(void) {
19575 xmlDocPtr doc; /* the document pointer */
19577 xmlChar * name; /* the DTD name */
19579 xmlChar * ExternalID; /* the external (PUBLIC) ID */
19581 xmlChar * SystemID; /* the system ID */
19584 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19585 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19586 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19587 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19588 mem_base = xmlMemBlocks();
19589 doc = gen_xmlDocPtr(n_doc, 0);
19590 name = gen_const_xmlChar_ptr(n_name, 1);
19591 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19592 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19594 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19595 desret_xmlDtdPtr(ret_val);
19597 des_xmlDocPtr(n_doc, doc, 0);
19598 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19599 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19600 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19601 xmlResetLastError();
19602 if (mem_base != xmlMemBlocks()) {
19603 printf("Leak of %d blocks found in xmlCreateIntSubset",
19604 xmlMemBlocks() - mem_base);
19606 printf(" %d", n_doc);
19607 printf(" %d", n_name);
19608 printf(" %d", n_ExternalID);
19609 printf(" %d", n_SystemID);
19622 #define gen_nb_xmlDOMWrapCtxtPtr 1
19623 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19626 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19630 test_xmlDOMWrapAdoptNode(void) {
19635 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19637 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19639 xmlNodePtr node; /* the node to start with */
19641 xmlDocPtr destDoc; /* the destination doc */
19643 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19645 int options; /* option flags */
19648 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19649 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19650 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19651 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19652 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19653 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19654 mem_base = xmlMemBlocks();
19655 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19656 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19657 node = gen_xmlNodePtr(n_node, 2);
19658 destDoc = gen_xmlDocPtr(n_destDoc, 3);
19659 destParent = gen_xmlNodePtr(n_destParent, 4);
19660 options = gen_int(n_options, 5);
19662 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19663 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19664 desret_int(ret_val);
19666 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19667 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19668 des_xmlNodePtr(n_node, node, 2);
19669 des_xmlDocPtr(n_destDoc, destDoc, 3);
19670 des_xmlNodePtr(n_destParent, destParent, 4);
19671 des_int(n_options, options, 5);
19672 xmlResetLastError();
19673 if (mem_base != xmlMemBlocks()) {
19674 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19675 xmlMemBlocks() - mem_base);
19677 printf(" %d", n_ctxt);
19678 printf(" %d", n_sourceDoc);
19679 printf(" %d", n_node);
19680 printf(" %d", n_destDoc);
19681 printf(" %d", n_destParent);
19682 printf(" %d", n_options);
19698 test_xmlDOMWrapCloneNode(void) {
19703 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19705 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19707 xmlNodePtr node; /* the node to start with */
19709 xmlNodePtr * resNode; /* the clone of the given @node */
19711 xmlDocPtr destDoc; /* the destination doc */
19713 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19715 int deep; /* descend into child if set */
19717 int options; /* option flags */
19720 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19721 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19722 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19723 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19724 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19725 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19726 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19727 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19728 mem_base = xmlMemBlocks();
19729 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19730 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19731 node = gen_xmlNodePtr(n_node, 2);
19732 resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19733 destDoc = gen_xmlDocPtr(n_destDoc, 4);
19734 destParent = gen_xmlNodePtr(n_destParent, 5);
19735 deep = gen_int(n_deep, 6);
19736 options = gen_int(n_options, 7);
19738 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19739 desret_int(ret_val);
19741 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19742 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19743 des_xmlNodePtr(n_node, node, 2);
19744 des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19745 des_xmlDocPtr(n_destDoc, destDoc, 4);
19746 des_xmlNodePtr(n_destParent, destParent, 5);
19747 des_int(n_deep, deep, 6);
19748 des_int(n_options, options, 7);
19749 xmlResetLastError();
19750 if (mem_base != xmlMemBlocks()) {
19751 printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19752 xmlMemBlocks() - mem_base);
19754 printf(" %d", n_ctxt);
19755 printf(" %d", n_sourceDoc);
19756 printf(" %d", n_node);
19757 printf(" %d", n_resNode);
19758 printf(" %d", n_destDoc);
19759 printf(" %d", n_destParent);
19760 printf(" %d", n_deep);
19761 printf(" %d", n_options);
19779 test_xmlDOMWrapNewCtxt(void) {
19783 /* missing type support */
19789 test_xmlDOMWrapReconcileNamespaces(void) {
19794 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19796 xmlNodePtr elem; /* the element-node */
19798 int options; /* option flags */
19801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19802 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19803 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19804 mem_base = xmlMemBlocks();
19805 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19806 elem = gen_xmlNodePtr(n_elem, 1);
19807 options = gen_int(n_options, 2);
19809 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19810 desret_int(ret_val);
19812 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19813 des_xmlNodePtr(n_elem, elem, 1);
19814 des_int(n_options, options, 2);
19815 xmlResetLastError();
19816 if (mem_base != xmlMemBlocks()) {
19817 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19818 xmlMemBlocks() - mem_base);
19820 printf(" %d", n_ctxt);
19821 printf(" %d", n_elem);
19822 printf(" %d", n_options);
19835 test_xmlDOMWrapRemoveNode(void) {
19840 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19842 xmlDocPtr doc; /* the doc */
19844 xmlNodePtr node; /* the node to be removed. */
19846 int options; /* set of options, unused at the moment */
19849 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19850 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19851 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19852 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19853 mem_base = xmlMemBlocks();
19854 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19855 doc = gen_xmlDocPtr(n_doc, 1);
19856 node = gen_xmlNodePtr(n_node, 2);
19857 options = gen_int(n_options, 3);
19859 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19860 desret_int(ret_val);
19862 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19863 des_xmlDocPtr(n_doc, doc, 1);
19864 des_xmlNodePtr(n_node, node, 2);
19865 des_int(n_options, options, 3);
19866 xmlResetLastError();
19867 if (mem_base != xmlMemBlocks()) {
19868 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19869 xmlMemBlocks() - mem_base);
19871 printf(" %d", n_ctxt);
19872 printf(" %d", n_doc);
19873 printf(" %d", n_node);
19874 printf(" %d", n_options);
19888 test_xmlDocCopyNode(void) {
19892 xmlNodePtr ret_val;
19893 xmlNodePtr node; /* the node */
19895 xmlDocPtr doc; /* the document */
19897 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19900 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19901 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19902 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19903 mem_base = xmlMemBlocks();
19904 node = gen_xmlNodePtr(n_node, 0);
19905 doc = gen_xmlDocPtr(n_doc, 1);
19906 extended = gen_int(n_extended, 2);
19908 ret_val = xmlDocCopyNode(node, doc, extended);
19909 desret_xmlNodePtr(ret_val);
19911 des_xmlNodePtr(n_node, node, 0);
19912 des_xmlDocPtr(n_doc, doc, 1);
19913 des_int(n_extended, extended, 2);
19914 xmlResetLastError();
19915 if (mem_base != xmlMemBlocks()) {
19916 printf("Leak of %d blocks found in xmlDocCopyNode",
19917 xmlMemBlocks() - mem_base);
19919 printf(" %d", n_node);
19920 printf(" %d", n_doc);
19921 printf(" %d", n_extended);
19934 test_xmlDocCopyNodeList(void) {
19938 xmlNodePtr ret_val;
19939 xmlDocPtr doc; /* the target document */
19941 xmlNodePtr node; /* the first node in the list. */
19944 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19945 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19946 mem_base = xmlMemBlocks();
19947 doc = gen_xmlDocPtr(n_doc, 0);
19948 node = gen_xmlNodePtr(n_node, 1);
19950 ret_val = xmlDocCopyNodeList(doc, node);
19951 desret_xmlNodePtr(ret_val);
19953 des_xmlDocPtr(n_doc, doc, 0);
19954 des_xmlNodePtr(n_node, node, 1);
19955 xmlResetLastError();
19956 if (mem_base != xmlMemBlocks()) {
19957 printf("Leak of %d blocks found in xmlDocCopyNodeList",
19958 xmlMemBlocks() - mem_base);
19960 printf(" %d", n_doc);
19961 printf(" %d", n_node);
19973 test_xmlDocDump(void) {
19976 #if defined(LIBXML_OUTPUT_ENABLED)
19979 FILE * f; /* the FILE* */
19981 xmlDocPtr cur; /* the document */
19984 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19985 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19986 mem_base = xmlMemBlocks();
19987 f = gen_FILE_ptr(n_f, 0);
19988 cur = gen_xmlDocPtr(n_cur, 1);
19990 ret_val = xmlDocDump(f, cur);
19991 desret_int(ret_val);
19993 des_FILE_ptr(n_f, f, 0);
19994 des_xmlDocPtr(n_cur, cur, 1);
19995 xmlResetLastError();
19996 if (mem_base != xmlMemBlocks()) {
19997 printf("Leak of %d blocks found in xmlDocDump",
19998 xmlMemBlocks() - mem_base);
20000 printf(" %d", n_f);
20001 printf(" %d", n_cur);
20014 test_xmlDocDumpFormatMemory(void) {
20017 #if defined(LIBXML_OUTPUT_ENABLED)
20019 xmlDocPtr cur; /* the document */
20021 xmlChar ** mem; /* OUT: the memory pointer */
20023 int * size; /* OUT: the memory length */
20025 int format; /* should formatting spaces been added */
20028 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20029 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20030 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20031 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20032 mem_base = xmlMemBlocks();
20033 cur = gen_xmlDocPtr(n_cur, 0);
20034 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20035 size = gen_int_ptr(n_size, 2);
20036 format = gen_int(n_format, 3);
20038 xmlDocDumpFormatMemory(cur, mem, size, format);
20040 des_xmlDocPtr(n_cur, cur, 0);
20041 des_xmlChar_ptr_ptr(n_mem, mem, 1);
20042 des_int_ptr(n_size, size, 2);
20043 des_int(n_format, format, 3);
20044 xmlResetLastError();
20045 if (mem_base != xmlMemBlocks()) {
20046 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20047 xmlMemBlocks() - mem_base);
20049 printf(" %d", n_cur);
20050 printf(" %d", n_mem);
20051 printf(" %d", n_size);
20052 printf(" %d", n_format);
20067 test_xmlDocDumpFormatMemoryEnc(void) {
20070 #if defined(LIBXML_OUTPUT_ENABLED)
20072 xmlDocPtr out_doc; /* Document to generate XML text from */
20074 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20076 int * doc_txt_len; /* Length of the generated XML text */
20078 char * txt_encoding; /* Character encoding to use when generating XML text */
20079 int n_txt_encoding;
20080 int format; /* should formatting spaces been added */
20083 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20084 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20085 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20086 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20087 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20088 mem_base = xmlMemBlocks();
20089 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20090 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20091 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20092 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20093 format = gen_int(n_format, 4);
20095 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20097 des_xmlDocPtr(n_out_doc, out_doc, 0);
20098 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20099 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20100 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20101 des_int(n_format, format, 4);
20102 xmlResetLastError();
20103 if (mem_base != xmlMemBlocks()) {
20104 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20105 xmlMemBlocks() - mem_base);
20107 printf(" %d", n_out_doc);
20108 printf(" %d", n_doc_txt_ptr);
20109 printf(" %d", n_doc_txt_len);
20110 printf(" %d", n_txt_encoding);
20111 printf(" %d", n_format);
20127 test_xmlDocDumpMemory(void) {
20130 #if defined(LIBXML_OUTPUT_ENABLED)
20132 xmlDocPtr cur; /* the document */
20134 xmlChar ** mem; /* OUT: the memory pointer */
20136 int * size; /* OUT: the memory length */
20139 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20140 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20141 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20142 mem_base = xmlMemBlocks();
20143 cur = gen_xmlDocPtr(n_cur, 0);
20144 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20145 size = gen_int_ptr(n_size, 2);
20147 xmlDocDumpMemory(cur, mem, size);
20149 des_xmlDocPtr(n_cur, cur, 0);
20150 des_xmlChar_ptr_ptr(n_mem, mem, 1);
20151 des_int_ptr(n_size, size, 2);
20152 xmlResetLastError();
20153 if (mem_base != xmlMemBlocks()) {
20154 printf("Leak of %d blocks found in xmlDocDumpMemory",
20155 xmlMemBlocks() - mem_base);
20157 printf(" %d", n_cur);
20158 printf(" %d", n_mem);
20159 printf(" %d", n_size);
20173 test_xmlDocDumpMemoryEnc(void) {
20176 #if defined(LIBXML_OUTPUT_ENABLED)
20178 xmlDocPtr out_doc; /* Document to generate XML text from */
20180 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20182 int * doc_txt_len; /* Length of the generated XML text */
20184 char * txt_encoding; /* Character encoding to use when generating XML text */
20185 int n_txt_encoding;
20187 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20188 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20189 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20190 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20191 mem_base = xmlMemBlocks();
20192 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20193 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20194 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20195 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20197 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20199 des_xmlDocPtr(n_out_doc, out_doc, 0);
20200 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20201 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20202 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20203 xmlResetLastError();
20204 if (mem_base != xmlMemBlocks()) {
20205 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20206 xmlMemBlocks() - mem_base);
20208 printf(" %d", n_out_doc);
20209 printf(" %d", n_doc_txt_ptr);
20210 printf(" %d", n_doc_txt_len);
20211 printf(" %d", n_txt_encoding);
20226 test_xmlDocFormatDump(void) {
20229 #if defined(LIBXML_OUTPUT_ENABLED)
20232 FILE * f; /* the FILE* */
20234 xmlDocPtr cur; /* the document */
20236 int format; /* should formatting spaces been added */
20239 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20240 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20241 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20242 mem_base = xmlMemBlocks();
20243 f = gen_FILE_ptr(n_f, 0);
20244 cur = gen_xmlDocPtr(n_cur, 1);
20245 format = gen_int(n_format, 2);
20247 ret_val = xmlDocFormatDump(f, cur, format);
20248 desret_int(ret_val);
20250 des_FILE_ptr(n_f, f, 0);
20251 des_xmlDocPtr(n_cur, cur, 1);
20252 des_int(n_format, format, 2);
20253 xmlResetLastError();
20254 if (mem_base != xmlMemBlocks()) {
20255 printf("Leak of %d blocks found in xmlDocFormatDump",
20256 xmlMemBlocks() - mem_base);
20258 printf(" %d", n_f);
20259 printf(" %d", n_cur);
20260 printf(" %d", n_format);
20274 test_xmlDocGetRootElement(void) {
20278 xmlNodePtr ret_val;
20279 xmlDoc * doc; /* the document */
20282 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20283 mem_base = xmlMemBlocks();
20284 doc = gen_const_xmlDoc_ptr(n_doc, 0);
20286 ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
20287 desret_xmlNodePtr(ret_val);
20289 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20290 xmlResetLastError();
20291 if (mem_base != xmlMemBlocks()) {
20292 printf("Leak of %d blocks found in xmlDocGetRootElement",
20293 xmlMemBlocks() - mem_base);
20295 printf(" %d", n_doc);
20306 test_xmlDocSetRootElement(void) {
20309 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20311 xmlNodePtr ret_val;
20312 xmlDocPtr doc; /* the document */
20314 xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */
20317 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20318 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20319 mem_base = xmlMemBlocks();
20320 doc = gen_xmlDocPtr(n_doc, 0);
20321 root = gen_xmlNodePtr_in(n_root, 1);
20323 ret_val = xmlDocSetRootElement(doc, root);
20324 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20325 desret_xmlNodePtr(ret_val);
20327 des_xmlDocPtr(n_doc, doc, 0);
20328 des_xmlNodePtr_in(n_root, root, 1);
20329 xmlResetLastError();
20330 if (mem_base != xmlMemBlocks()) {
20331 printf("Leak of %d blocks found in xmlDocSetRootElement",
20332 xmlMemBlocks() - mem_base);
20334 printf(" %d", n_doc);
20335 printf(" %d", n_root);
20348 test_xmlElemDump(void) {
20351 #if defined(LIBXML_OUTPUT_ENABLED)
20353 FILE * f; /* the FILE * for the output */
20355 xmlDocPtr doc; /* the document */
20357 xmlNodePtr cur; /* the current node */
20360 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20361 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20362 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20363 mem_base = xmlMemBlocks();
20364 f = gen_FILE_ptr(n_f, 0);
20365 doc = gen_xmlDocPtr(n_doc, 1);
20366 cur = gen_xmlNodePtr(n_cur, 2);
20368 xmlElemDump(f, doc, cur);
20370 des_FILE_ptr(n_f, f, 0);
20371 des_xmlDocPtr(n_doc, doc, 1);
20372 des_xmlNodePtr(n_cur, cur, 2);
20373 xmlResetLastError();
20374 if (mem_base != xmlMemBlocks()) {
20375 printf("Leak of %d blocks found in xmlElemDump",
20376 xmlMemBlocks() - mem_base);
20378 printf(" %d", n_f);
20379 printf(" %d", n_doc);
20380 printf(" %d", n_cur);
20394 test_xmlFirstElementChild(void) {
20397 #if defined(LIBXML_TREE_ENABLED)
20399 xmlNodePtr ret_val;
20400 xmlNodePtr parent; /* the parent node */
20403 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20404 mem_base = xmlMemBlocks();
20405 parent = gen_xmlNodePtr(n_parent, 0);
20407 ret_val = xmlFirstElementChild(parent);
20408 desret_xmlNodePtr(ret_val);
20410 des_xmlNodePtr(n_parent, parent, 0);
20411 xmlResetLastError();
20412 if (mem_base != xmlMemBlocks()) {
20413 printf("Leak of %d blocks found in xmlFirstElementChild",
20414 xmlMemBlocks() - mem_base);
20416 printf(" %d", n_parent);
20428 test_xmlGetBufferAllocationScheme(void) {
20432 xmlBufferAllocationScheme ret_val;
20434 mem_base = xmlMemBlocks();
20436 ret_val = xmlGetBufferAllocationScheme();
20437 desret_xmlBufferAllocationScheme(ret_val);
20439 xmlResetLastError();
20440 if (mem_base != xmlMemBlocks()) {
20441 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20442 xmlMemBlocks() - mem_base);
20453 test_xmlGetCompressMode(void) {
20459 mem_base = xmlMemBlocks();
20461 ret_val = xmlGetCompressMode();
20462 desret_int(ret_val);
20464 xmlResetLastError();
20465 if (mem_base != xmlMemBlocks()) {
20466 printf("Leak of %d blocks found in xmlGetCompressMode",
20467 xmlMemBlocks() - mem_base);
20478 test_xmlGetDocCompressMode(void) {
20483 xmlDoc * doc; /* the document */
20486 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20487 mem_base = xmlMemBlocks();
20488 doc = gen_const_xmlDoc_ptr(n_doc, 0);
20490 ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
20491 desret_int(ret_val);
20493 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20494 xmlResetLastError();
20495 if (mem_base != xmlMemBlocks()) {
20496 printf("Leak of %d blocks found in xmlGetDocCompressMode",
20497 xmlMemBlocks() - mem_base);
20499 printf(" %d", n_doc);
20510 test_xmlGetIntSubset(void) {
20515 xmlDoc * doc; /* the document pointer */
20518 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20519 mem_base = xmlMemBlocks();
20520 doc = gen_const_xmlDoc_ptr(n_doc, 0);
20522 ret_val = xmlGetIntSubset((const xmlDoc *)doc);
20523 desret_xmlDtdPtr(ret_val);
20525 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20526 xmlResetLastError();
20527 if (mem_base != xmlMemBlocks()) {
20528 printf("Leak of %d blocks found in xmlGetIntSubset",
20529 xmlMemBlocks() - mem_base);
20531 printf(" %d", n_doc);
20542 test_xmlGetLastChild(void) {
20546 xmlNodePtr ret_val;
20547 xmlNode * parent; /* the parent node */
20550 for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
20551 mem_base = xmlMemBlocks();
20552 parent = gen_const_xmlNode_ptr(n_parent, 0);
20554 ret_val = xmlGetLastChild((const xmlNode *)parent);
20555 desret_xmlNodePtr(ret_val);
20557 des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
20558 xmlResetLastError();
20559 if (mem_base != xmlMemBlocks()) {
20560 printf("Leak of %d blocks found in xmlGetLastChild",
20561 xmlMemBlocks() - mem_base);
20563 printf(" %d", n_parent);
20574 test_xmlGetLineNo(void) {
20579 xmlNode * node; /* valid node */
20582 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20583 mem_base = xmlMemBlocks();
20584 node = gen_const_xmlNode_ptr(n_node, 0);
20586 ret_val = xmlGetLineNo((const xmlNode *)node);
20587 desret_long(ret_val);
20589 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20590 xmlResetLastError();
20591 if (mem_base != xmlMemBlocks()) {
20592 printf("Leak of %d blocks found in xmlGetLineNo",
20593 xmlMemBlocks() - mem_base);
20595 printf(" %d", n_node);
20606 test_xmlGetNoNsProp(void) {
20611 xmlNode * node; /* the node */
20613 xmlChar * name; /* the attribute name */
20616 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20617 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20618 mem_base = xmlMemBlocks();
20619 node = gen_const_xmlNode_ptr(n_node, 0);
20620 name = gen_const_xmlChar_ptr(n_name, 1);
20622 ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
20623 desret_xmlChar_ptr(ret_val);
20625 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20626 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20627 xmlResetLastError();
20628 if (mem_base != xmlMemBlocks()) {
20629 printf("Leak of %d blocks found in xmlGetNoNsProp",
20630 xmlMemBlocks() - mem_base);
20632 printf(" %d", n_node);
20633 printf(" %d", n_name);
20645 test_xmlGetNodePath(void) {
20648 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20651 xmlNode * node; /* a node */
20654 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20655 mem_base = xmlMemBlocks();
20656 node = gen_const_xmlNode_ptr(n_node, 0);
20658 ret_val = xmlGetNodePath((const xmlNode *)node);
20659 desret_xmlChar_ptr(ret_val);
20661 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20662 xmlResetLastError();
20663 if (mem_base != xmlMemBlocks()) {
20664 printf("Leak of %d blocks found in xmlGetNodePath",
20665 xmlMemBlocks() - mem_base);
20667 printf(" %d", n_node);
20679 test_xmlGetNsList(void) {
20683 /* missing type support */
20689 test_xmlGetNsProp(void) {
20694 xmlNode * node; /* the node */
20696 xmlChar * name; /* the attribute name */
20698 xmlChar * nameSpace; /* the URI of the namespace */
20701 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20702 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20703 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20704 mem_base = xmlMemBlocks();
20705 node = gen_const_xmlNode_ptr(n_node, 0);
20706 name = gen_const_xmlChar_ptr(n_name, 1);
20707 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20709 ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20710 desret_xmlChar_ptr(ret_val);
20712 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20713 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20714 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20715 xmlResetLastError();
20716 if (mem_base != xmlMemBlocks()) {
20717 printf("Leak of %d blocks found in xmlGetNsProp",
20718 xmlMemBlocks() - mem_base);
20720 printf(" %d", n_node);
20721 printf(" %d", n_name);
20722 printf(" %d", n_nameSpace);
20735 test_xmlGetProp(void) {
20740 xmlNode * node; /* the node */
20742 xmlChar * name; /* the attribute name */
20745 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20746 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20747 mem_base = xmlMemBlocks();
20748 node = gen_const_xmlNode_ptr(n_node, 0);
20749 name = gen_const_xmlChar_ptr(n_name, 1);
20751 ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
20752 desret_xmlChar_ptr(ret_val);
20754 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20755 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20756 xmlResetLastError();
20757 if (mem_base != xmlMemBlocks()) {
20758 printf("Leak of %d blocks found in xmlGetProp",
20759 xmlMemBlocks() - mem_base);
20761 printf(" %d", n_node);
20762 printf(" %d", n_name);
20774 test_xmlHasNsProp(void) {
20778 xmlAttrPtr ret_val;
20779 xmlNode * node; /* the node */
20781 xmlChar * name; /* the attribute name */
20783 xmlChar * nameSpace; /* the URI of the namespace */
20786 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20787 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20788 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20789 mem_base = xmlMemBlocks();
20790 node = gen_const_xmlNode_ptr(n_node, 0);
20791 name = gen_const_xmlChar_ptr(n_name, 1);
20792 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20794 ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20795 desret_xmlAttrPtr(ret_val);
20797 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20798 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20799 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20800 xmlResetLastError();
20801 if (mem_base != xmlMemBlocks()) {
20802 printf("Leak of %d blocks found in xmlHasNsProp",
20803 xmlMemBlocks() - mem_base);
20805 printf(" %d", n_node);
20806 printf(" %d", n_name);
20807 printf(" %d", n_nameSpace);
20820 test_xmlHasProp(void) {
20824 xmlAttrPtr ret_val;
20825 xmlNode * node; /* the node */
20827 xmlChar * name; /* the attribute name */
20830 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20831 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20832 mem_base = xmlMemBlocks();
20833 node = gen_const_xmlNode_ptr(n_node, 0);
20834 name = gen_const_xmlChar_ptr(n_name, 1);
20836 ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
20837 desret_xmlAttrPtr(ret_val);
20839 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20840 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20841 xmlResetLastError();
20842 if (mem_base != xmlMemBlocks()) {
20843 printf("Leak of %d blocks found in xmlHasProp",
20844 xmlMemBlocks() - mem_base);
20846 printf(" %d", n_node);
20847 printf(" %d", n_name);
20859 test_xmlIsBlankNode(void) {
20864 xmlNode * node; /* the node */
20867 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20868 mem_base = xmlMemBlocks();
20869 node = gen_const_xmlNode_ptr(n_node, 0);
20871 ret_val = xmlIsBlankNode((const xmlNode *)node);
20872 desret_int(ret_val);
20874 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20875 xmlResetLastError();
20876 if (mem_base != xmlMemBlocks()) {
20877 printf("Leak of %d blocks found in xmlIsBlankNode",
20878 xmlMemBlocks() - mem_base);
20880 printf(" %d", n_node);
20891 test_xmlIsXHTML(void) {
20896 xmlChar * systemID; /* the system identifier */
20898 xmlChar * publicID; /* the public identifier */
20901 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20902 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20903 mem_base = xmlMemBlocks();
20904 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20905 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20907 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20908 desret_int(ret_val);
20910 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20911 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20912 xmlResetLastError();
20913 if (mem_base != xmlMemBlocks()) {
20914 printf("Leak of %d blocks found in xmlIsXHTML",
20915 xmlMemBlocks() - mem_base);
20917 printf(" %d", n_systemID);
20918 printf(" %d", n_publicID);
20930 test_xmlLastElementChild(void) {
20933 #if defined(LIBXML_TREE_ENABLED)
20935 xmlNodePtr ret_val;
20936 xmlNodePtr parent; /* the parent node */
20939 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20940 mem_base = xmlMemBlocks();
20941 parent = gen_xmlNodePtr(n_parent, 0);
20943 ret_val = xmlLastElementChild(parent);
20944 desret_xmlNodePtr(ret_val);
20946 des_xmlNodePtr(n_parent, parent, 0);
20947 xmlResetLastError();
20948 if (mem_base != xmlMemBlocks()) {
20949 printf("Leak of %d blocks found in xmlLastElementChild",
20950 xmlMemBlocks() - mem_base);
20952 printf(" %d", n_parent);
20964 test_xmlNewCDataBlock(void) {
20968 xmlNodePtr ret_val;
20969 xmlDocPtr doc; /* the document */
20971 xmlChar * content; /* the CDATA block content content */
20973 int len; /* the length of the block */
20976 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20977 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20978 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20979 mem_base = xmlMemBlocks();
20980 doc = gen_xmlDocPtr(n_doc, 0);
20981 content = gen_const_xmlChar_ptr(n_content, 1);
20982 len = gen_int(n_len, 2);
20984 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20985 desret_xmlNodePtr(ret_val);
20987 des_xmlDocPtr(n_doc, doc, 0);
20988 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20989 des_int(n_len, len, 2);
20990 xmlResetLastError();
20991 if (mem_base != xmlMemBlocks()) {
20992 printf("Leak of %d blocks found in xmlNewCDataBlock",
20993 xmlMemBlocks() - mem_base);
20995 printf(" %d", n_doc);
20996 printf(" %d", n_content);
20997 printf(" %d", n_len);
21010 test_xmlNewCharRef(void) {
21014 xmlNodePtr ret_val;
21015 xmlDocPtr doc; /* the document */
21017 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
21020 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21021 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21022 mem_base = xmlMemBlocks();
21023 doc = gen_xmlDocPtr(n_doc, 0);
21024 name = gen_const_xmlChar_ptr(n_name, 1);
21026 ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21027 desret_xmlNodePtr(ret_val);
21029 des_xmlDocPtr(n_doc, doc, 0);
21030 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21031 xmlResetLastError();
21032 if (mem_base != xmlMemBlocks()) {
21033 printf("Leak of %d blocks found in xmlNewCharRef",
21034 xmlMemBlocks() - mem_base);
21036 printf(" %d", n_doc);
21037 printf(" %d", n_name);
21049 test_xmlNewChild(void) {
21052 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21053 #ifdef LIBXML_TREE_ENABLED
21055 xmlNodePtr ret_val;
21056 xmlNodePtr parent; /* the parent node */
21058 xmlNsPtr ns; /* a namespace if any */
21060 xmlChar * name; /* the name of the child */
21062 xmlChar * content; /* the XML content of the child if any. */
21065 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21066 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21067 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21068 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21069 mem_base = xmlMemBlocks();
21070 parent = gen_xmlNodePtr(n_parent, 0);
21071 ns = gen_xmlNsPtr(n_ns, 1);
21072 name = gen_const_xmlChar_ptr(n_name, 2);
21073 content = gen_const_xmlChar_ptr(n_content, 3);
21075 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21076 desret_xmlNodePtr(ret_val);
21078 des_xmlNodePtr(n_parent, parent, 0);
21079 des_xmlNsPtr(n_ns, ns, 1);
21080 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21081 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21082 xmlResetLastError();
21083 if (mem_base != xmlMemBlocks()) {
21084 printf("Leak of %d blocks found in xmlNewChild",
21085 xmlMemBlocks() - mem_base);
21087 printf(" %d", n_parent);
21088 printf(" %d", n_ns);
21089 printf(" %d", n_name);
21090 printf(" %d", n_content);
21106 test_xmlNewComment(void) {
21110 xmlNodePtr ret_val;
21111 xmlChar * content; /* the comment content */
21114 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21115 mem_base = xmlMemBlocks();
21116 content = gen_const_xmlChar_ptr(n_content, 0);
21118 ret_val = xmlNewComment((const xmlChar *)content);
21119 desret_xmlNodePtr(ret_val);
21121 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21122 xmlResetLastError();
21123 if (mem_base != xmlMemBlocks()) {
21124 printf("Leak of %d blocks found in xmlNewComment",
21125 xmlMemBlocks() - mem_base);
21127 printf(" %d", n_content);
21138 test_xmlNewDoc(void) {
21143 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21146 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21147 mem_base = xmlMemBlocks();
21148 version = gen_const_xmlChar_ptr(n_version, 0);
21150 ret_val = xmlNewDoc((const xmlChar *)version);
21151 desret_xmlDocPtr(ret_val);
21153 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21154 xmlResetLastError();
21155 if (mem_base != xmlMemBlocks()) {
21156 printf("Leak of %d blocks found in xmlNewDoc",
21157 xmlMemBlocks() - mem_base);
21159 printf(" %d", n_version);
21170 test_xmlNewDocComment(void) {
21174 xmlNodePtr ret_val;
21175 xmlDocPtr doc; /* the document */
21177 xmlChar * content; /* the comment content */
21180 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21181 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21182 mem_base = xmlMemBlocks();
21183 doc = gen_xmlDocPtr(n_doc, 0);
21184 content = gen_const_xmlChar_ptr(n_content, 1);
21186 ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21187 desret_xmlNodePtr(ret_val);
21189 des_xmlDocPtr(n_doc, doc, 0);
21190 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21191 xmlResetLastError();
21192 if (mem_base != xmlMemBlocks()) {
21193 printf("Leak of %d blocks found in xmlNewDocComment",
21194 xmlMemBlocks() - mem_base);
21196 printf(" %d", n_doc);
21197 printf(" %d", n_content);
21209 test_xmlNewDocFragment(void) {
21212 #if defined(LIBXML_TREE_ENABLED)
21214 xmlNodePtr ret_val;
21215 xmlDocPtr doc; /* the document owning the fragment */
21218 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21219 mem_base = xmlMemBlocks();
21220 doc = gen_xmlDocPtr(n_doc, 0);
21222 ret_val = xmlNewDocFragment(doc);
21223 desret_xmlNodePtr(ret_val);
21225 des_xmlDocPtr(n_doc, doc, 0);
21226 xmlResetLastError();
21227 if (mem_base != xmlMemBlocks()) {
21228 printf("Leak of %d blocks found in xmlNewDocFragment",
21229 xmlMemBlocks() - mem_base);
21231 printf(" %d", n_doc);
21243 test_xmlNewDocNode(void) {
21247 xmlNodePtr ret_val;
21248 xmlDocPtr doc; /* the document */
21250 xmlNsPtr ns; /* namespace if any */
21252 xmlChar * name; /* the node name */
21254 xmlChar * content; /* the XML text content if any */
21257 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21258 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21259 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21260 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21261 mem_base = xmlMemBlocks();
21262 doc = gen_xmlDocPtr(n_doc, 0);
21263 ns = gen_xmlNsPtr(n_ns, 1);
21264 name = gen_const_xmlChar_ptr(n_name, 2);
21265 content = gen_const_xmlChar_ptr(n_content, 3);
21267 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21268 desret_xmlNodePtr(ret_val);
21270 des_xmlDocPtr(n_doc, doc, 0);
21271 des_xmlNsPtr(n_ns, ns, 1);
21272 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21273 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21274 xmlResetLastError();
21275 if (mem_base != xmlMemBlocks()) {
21276 printf("Leak of %d blocks found in xmlNewDocNode",
21277 xmlMemBlocks() - mem_base);
21279 printf(" %d", n_doc);
21280 printf(" %d", n_ns);
21281 printf(" %d", n_name);
21282 printf(" %d", n_content);
21296 test_xmlNewDocNodeEatName(void) {
21300 xmlNodePtr ret_val;
21301 xmlDocPtr doc; /* the document */
21303 xmlNsPtr ns; /* namespace if any */
21305 xmlChar * name; /* the node name */
21307 xmlChar * content; /* the XML text content if any */
21310 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21311 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21312 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21313 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21314 mem_base = xmlMemBlocks();
21315 doc = gen_xmlDocPtr(n_doc, 0);
21316 ns = gen_xmlNsPtr(n_ns, 1);
21317 name = gen_eaten_name(n_name, 2);
21318 content = gen_const_xmlChar_ptr(n_content, 3);
21320 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21321 desret_xmlNodePtr(ret_val);
21323 des_xmlDocPtr(n_doc, doc, 0);
21324 des_xmlNsPtr(n_ns, ns, 1);
21325 des_eaten_name(n_name, name, 2);
21326 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21327 xmlResetLastError();
21328 if (mem_base != xmlMemBlocks()) {
21329 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21330 xmlMemBlocks() - mem_base);
21332 printf(" %d", n_doc);
21333 printf(" %d", n_ns);
21334 printf(" %d", n_name);
21335 printf(" %d", n_content);
21349 test_xmlNewDocPI(void) {
21353 xmlNodePtr ret_val;
21354 xmlDocPtr doc; /* the target document */
21356 xmlChar * name; /* the processing instruction name */
21358 xmlChar * content; /* the PI content */
21361 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21362 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21363 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21364 mem_base = xmlMemBlocks();
21365 doc = gen_xmlDocPtr(n_doc, 0);
21366 name = gen_const_xmlChar_ptr(n_name, 1);
21367 content = gen_const_xmlChar_ptr(n_content, 2);
21369 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21370 desret_xmlNodePtr(ret_val);
21372 des_xmlDocPtr(n_doc, doc, 0);
21373 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21374 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21375 xmlResetLastError();
21376 if (mem_base != xmlMemBlocks()) {
21377 printf("Leak of %d blocks found in xmlNewDocPI",
21378 xmlMemBlocks() - mem_base);
21380 printf(" %d", n_doc);
21381 printf(" %d", n_name);
21382 printf(" %d", n_content);
21395 test_xmlNewDocProp(void) {
21399 xmlAttrPtr ret_val;
21400 xmlDocPtr doc; /* the document */
21402 xmlChar * name; /* the name of the attribute */
21404 xmlChar * value; /* the value of the attribute */
21407 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21408 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21409 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21410 mem_base = xmlMemBlocks();
21411 doc = gen_xmlDocPtr(n_doc, 0);
21412 name = gen_const_xmlChar_ptr(n_name, 1);
21413 value = gen_const_xmlChar_ptr(n_value, 2);
21415 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21416 desret_xmlAttrPtr(ret_val);
21418 des_xmlDocPtr(n_doc, doc, 0);
21419 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21420 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21421 xmlResetLastError();
21422 if (mem_base != xmlMemBlocks()) {
21423 printf("Leak of %d blocks found in xmlNewDocProp",
21424 xmlMemBlocks() - mem_base);
21426 printf(" %d", n_doc);
21427 printf(" %d", n_name);
21428 printf(" %d", n_value);
21441 test_xmlNewDocRawNode(void) {
21444 #if defined(LIBXML_TREE_ENABLED)
21445 #ifdef LIBXML_TREE_ENABLED
21447 xmlNodePtr ret_val;
21448 xmlDocPtr doc; /* the document */
21450 xmlNsPtr ns; /* namespace if any */
21452 xmlChar * name; /* the node name */
21454 xmlChar * content; /* the text content if any */
21457 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21458 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21459 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21460 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21461 mem_base = xmlMemBlocks();
21462 doc = gen_xmlDocPtr(n_doc, 0);
21463 ns = gen_xmlNsPtr(n_ns, 1);
21464 name = gen_const_xmlChar_ptr(n_name, 2);
21465 content = gen_const_xmlChar_ptr(n_content, 3);
21467 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21468 desret_xmlNodePtr(ret_val);
21470 des_xmlDocPtr(n_doc, doc, 0);
21471 des_xmlNsPtr(n_ns, ns, 1);
21472 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21473 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21474 xmlResetLastError();
21475 if (mem_base != xmlMemBlocks()) {
21476 printf("Leak of %d blocks found in xmlNewDocRawNode",
21477 xmlMemBlocks() - mem_base);
21479 printf(" %d", n_doc);
21480 printf(" %d", n_ns);
21481 printf(" %d", n_name);
21482 printf(" %d", n_content);
21498 test_xmlNewDocText(void) {
21502 xmlNodePtr ret_val;
21503 xmlDoc * doc; /* the document */
21505 xmlChar * content; /* the text content */
21508 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21509 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21510 mem_base = xmlMemBlocks();
21511 doc = gen_const_xmlDoc_ptr(n_doc, 0);
21512 content = gen_const_xmlChar_ptr(n_content, 1);
21514 ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
21515 desret_xmlNodePtr(ret_val);
21517 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21518 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21519 xmlResetLastError();
21520 if (mem_base != xmlMemBlocks()) {
21521 printf("Leak of %d blocks found in xmlNewDocText",
21522 xmlMemBlocks() - mem_base);
21524 printf(" %d", n_doc);
21525 printf(" %d", n_content);
21537 test_xmlNewDocTextLen(void) {
21541 xmlNodePtr ret_val;
21542 xmlDocPtr doc; /* the document */
21544 xmlChar * content; /* the text content */
21546 int len; /* the text len. */
21549 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21550 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21551 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21552 mem_base = xmlMemBlocks();
21553 doc = gen_xmlDocPtr(n_doc, 0);
21554 content = gen_const_xmlChar_ptr(n_content, 1);
21555 len = gen_int(n_len, 2);
21557 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21558 desret_xmlNodePtr(ret_val);
21560 des_xmlDocPtr(n_doc, doc, 0);
21561 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21562 des_int(n_len, len, 2);
21563 xmlResetLastError();
21564 if (mem_base != xmlMemBlocks()) {
21565 printf("Leak of %d blocks found in xmlNewDocTextLen",
21566 xmlMemBlocks() - mem_base);
21568 printf(" %d", n_doc);
21569 printf(" %d", n_content);
21570 printf(" %d", n_len);
21583 test_xmlNewDtd(void) {
21588 xmlDocPtr doc; /* the document pointer */
21590 xmlChar * name; /* the DTD name */
21592 xmlChar * ExternalID; /* the external ID */
21594 xmlChar * SystemID; /* the system ID */
21597 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21598 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21599 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21600 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21601 mem_base = xmlMemBlocks();
21602 doc = gen_xmlDocPtr(n_doc, 0);
21603 name = gen_const_xmlChar_ptr(n_name, 1);
21604 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21605 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21607 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21608 desret_xmlDtdPtr(ret_val);
21610 des_xmlDocPtr(n_doc, doc, 0);
21611 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21612 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21613 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21614 xmlResetLastError();
21615 if (mem_base != xmlMemBlocks()) {
21616 printf("Leak of %d blocks found in xmlNewDtd",
21617 xmlMemBlocks() - mem_base);
21619 printf(" %d", n_doc);
21620 printf(" %d", n_name);
21621 printf(" %d", n_ExternalID);
21622 printf(" %d", n_SystemID);
21636 test_xmlNewNode(void) {
21640 xmlNodePtr ret_val;
21641 xmlNsPtr ns; /* namespace if any */
21643 xmlChar * name; /* the node name */
21646 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21647 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21648 mem_base = xmlMemBlocks();
21649 ns = gen_xmlNsPtr(n_ns, 0);
21650 name = gen_const_xmlChar_ptr(n_name, 1);
21652 ret_val = xmlNewNode(ns, (const xmlChar *)name);
21653 desret_xmlNodePtr(ret_val);
21655 des_xmlNsPtr(n_ns, ns, 0);
21656 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21657 xmlResetLastError();
21658 if (mem_base != xmlMemBlocks()) {
21659 printf("Leak of %d blocks found in xmlNewNode",
21660 xmlMemBlocks() - mem_base);
21662 printf(" %d", n_ns);
21663 printf(" %d", n_name);
21675 test_xmlNewNodeEatName(void) {
21679 xmlNodePtr ret_val;
21680 xmlNsPtr ns; /* namespace if any */
21682 xmlChar * name; /* the node name */
21685 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21686 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21687 mem_base = xmlMemBlocks();
21688 ns = gen_xmlNsPtr(n_ns, 0);
21689 name = gen_eaten_name(n_name, 1);
21691 ret_val = xmlNewNodeEatName(ns, name);
21692 desret_xmlNodePtr(ret_val);
21694 des_xmlNsPtr(n_ns, ns, 0);
21695 des_eaten_name(n_name, name, 1);
21696 xmlResetLastError();
21697 if (mem_base != xmlMemBlocks()) {
21698 printf("Leak of %d blocks found in xmlNewNodeEatName",
21699 xmlMemBlocks() - mem_base);
21701 printf(" %d", n_ns);
21702 printf(" %d", n_name);
21714 test_xmlNewNs(void) {
21719 xmlNodePtr node; /* the element carrying the namespace */
21721 xmlChar * href; /* the URI associated */
21723 xmlChar * prefix; /* the prefix for the namespace */
21726 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21727 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21728 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21729 mem_base = xmlMemBlocks();
21730 node = gen_xmlNodePtr(n_node, 0);
21731 href = gen_const_xmlChar_ptr(n_href, 1);
21732 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21734 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21735 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21736 desret_xmlNsPtr(ret_val);
21738 des_xmlNodePtr(n_node, node, 0);
21739 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21740 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21741 xmlResetLastError();
21742 if (mem_base != xmlMemBlocks()) {
21743 printf("Leak of %d blocks found in xmlNewNs",
21744 xmlMemBlocks() - mem_base);
21746 printf(" %d", n_node);
21747 printf(" %d", n_href);
21748 printf(" %d", n_prefix);
21761 test_xmlNewNsProp(void) {
21765 xmlAttrPtr ret_val;
21766 xmlNodePtr node; /* the holding node */
21768 xmlNsPtr ns; /* the namespace */
21770 xmlChar * name; /* the name of the attribute */
21772 xmlChar * value; /* the value of the attribute */
21775 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21776 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21777 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21778 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21779 mem_base = xmlMemBlocks();
21780 node = gen_xmlNodePtr(n_node, 0);
21781 ns = gen_xmlNsPtr(n_ns, 1);
21782 name = gen_const_xmlChar_ptr(n_name, 2);
21783 value = gen_const_xmlChar_ptr(n_value, 3);
21785 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21786 desret_xmlAttrPtr(ret_val);
21788 des_xmlNodePtr(n_node, node, 0);
21789 des_xmlNsPtr(n_ns, ns, 1);
21790 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21791 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21792 xmlResetLastError();
21793 if (mem_base != xmlMemBlocks()) {
21794 printf("Leak of %d blocks found in xmlNewNsProp",
21795 xmlMemBlocks() - mem_base);
21797 printf(" %d", n_node);
21798 printf(" %d", n_ns);
21799 printf(" %d", n_name);
21800 printf(" %d", n_value);
21814 test_xmlNewNsPropEatName(void) {
21818 xmlAttrPtr ret_val;
21819 xmlNodePtr node; /* the holding node */
21821 xmlNsPtr ns; /* the namespace */
21823 xmlChar * name; /* the name of the attribute */
21825 xmlChar * value; /* the value of the attribute */
21828 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21829 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21830 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21831 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21832 mem_base = xmlMemBlocks();
21833 node = gen_xmlNodePtr(n_node, 0);
21834 ns = gen_xmlNsPtr(n_ns, 1);
21835 name = gen_eaten_name(n_name, 2);
21836 value = gen_const_xmlChar_ptr(n_value, 3);
21838 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21839 desret_xmlAttrPtr(ret_val);
21841 des_xmlNodePtr(n_node, node, 0);
21842 des_xmlNsPtr(n_ns, ns, 1);
21843 des_eaten_name(n_name, name, 2);
21844 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21845 xmlResetLastError();
21846 if (mem_base != xmlMemBlocks()) {
21847 printf("Leak of %d blocks found in xmlNewNsPropEatName",
21848 xmlMemBlocks() - mem_base);
21850 printf(" %d", n_node);
21851 printf(" %d", n_ns);
21852 printf(" %d", n_name);
21853 printf(" %d", n_value);
21867 test_xmlNewPI(void) {
21871 xmlNodePtr ret_val;
21872 xmlChar * name; /* the processing instruction name */
21874 xmlChar * content; /* the PI content */
21877 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21878 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21879 mem_base = xmlMemBlocks();
21880 name = gen_const_xmlChar_ptr(n_name, 0);
21881 content = gen_const_xmlChar_ptr(n_content, 1);
21883 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21884 desret_xmlNodePtr(ret_val);
21886 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21887 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21888 xmlResetLastError();
21889 if (mem_base != xmlMemBlocks()) {
21890 printf("Leak of %d blocks found in xmlNewPI",
21891 xmlMemBlocks() - mem_base);
21893 printf(" %d", n_name);
21894 printf(" %d", n_content);
21906 test_xmlNewProp(void) {
21909 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21910 #ifdef LIBXML_TREE_ENABLED
21912 xmlAttrPtr ret_val;
21913 xmlNodePtr node; /* the holding node */
21915 xmlChar * name; /* the name of the attribute */
21917 xmlChar * value; /* the value of the attribute */
21920 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21921 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21922 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21923 mem_base = xmlMemBlocks();
21924 node = gen_xmlNodePtr(n_node, 0);
21925 name = gen_const_xmlChar_ptr(n_name, 1);
21926 value = gen_const_xmlChar_ptr(n_value, 2);
21928 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21929 desret_xmlAttrPtr(ret_val);
21931 des_xmlNodePtr(n_node, node, 0);
21932 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21933 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21934 xmlResetLastError();
21935 if (mem_base != xmlMemBlocks()) {
21936 printf("Leak of %d blocks found in xmlNewProp",
21937 xmlMemBlocks() - mem_base);
21939 printf(" %d", n_node);
21940 printf(" %d", n_name);
21941 printf(" %d", n_value);
21956 test_xmlNewReference(void) {
21960 xmlNodePtr ret_val;
21961 xmlDoc * doc; /* the document */
21963 xmlChar * name; /* the reference name, or the reference string with & and ; */
21966 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21967 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21968 mem_base = xmlMemBlocks();
21969 doc = gen_const_xmlDoc_ptr(n_doc, 0);
21970 name = gen_const_xmlChar_ptr(n_name, 1);
21972 ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
21973 desret_xmlNodePtr(ret_val);
21975 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21976 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21977 xmlResetLastError();
21978 if (mem_base != xmlMemBlocks()) {
21979 printf("Leak of %d blocks found in xmlNewReference",
21980 xmlMemBlocks() - mem_base);
21982 printf(" %d", n_doc);
21983 printf(" %d", n_name);
21995 test_xmlNewText(void) {
21999 xmlNodePtr ret_val;
22000 xmlChar * content; /* the text content */
22003 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22004 mem_base = xmlMemBlocks();
22005 content = gen_const_xmlChar_ptr(n_content, 0);
22007 ret_val = xmlNewText((const xmlChar *)content);
22008 desret_xmlNodePtr(ret_val);
22010 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22011 xmlResetLastError();
22012 if (mem_base != xmlMemBlocks()) {
22013 printf("Leak of %d blocks found in xmlNewText",
22014 xmlMemBlocks() - mem_base);
22016 printf(" %d", n_content);
22027 test_xmlNewTextChild(void) {
22030 #if defined(LIBXML_TREE_ENABLED)
22031 #ifdef LIBXML_TREE_ENABLED
22033 xmlNodePtr ret_val;
22034 xmlNodePtr parent; /* the parent node */
22036 xmlNsPtr ns; /* a namespace if any */
22038 xmlChar * name; /* the name of the child */
22040 xmlChar * content; /* the text content of the child if any. */
22043 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22044 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22045 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22046 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22047 mem_base = xmlMemBlocks();
22048 parent = gen_xmlNodePtr(n_parent, 0);
22049 ns = gen_xmlNsPtr(n_ns, 1);
22050 name = gen_const_xmlChar_ptr(n_name, 2);
22051 content = gen_const_xmlChar_ptr(n_content, 3);
22053 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22054 desret_xmlNodePtr(ret_val);
22056 des_xmlNodePtr(n_parent, parent, 0);
22057 des_xmlNsPtr(n_ns, ns, 1);
22058 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22059 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22060 xmlResetLastError();
22061 if (mem_base != xmlMemBlocks()) {
22062 printf("Leak of %d blocks found in xmlNewTextChild",
22063 xmlMemBlocks() - mem_base);
22065 printf(" %d", n_parent);
22066 printf(" %d", n_ns);
22067 printf(" %d", n_name);
22068 printf(" %d", n_content);
22084 test_xmlNewTextLen(void) {
22088 xmlNodePtr ret_val;
22089 xmlChar * content; /* the text content */
22091 int len; /* the text len. */
22094 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22095 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22096 mem_base = xmlMemBlocks();
22097 content = gen_const_xmlChar_ptr(n_content, 0);
22098 len = gen_int(n_len, 1);
22100 ret_val = xmlNewTextLen((const xmlChar *)content, len);
22101 desret_xmlNodePtr(ret_val);
22103 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22104 des_int(n_len, len, 1);
22105 xmlResetLastError();
22106 if (mem_base != xmlMemBlocks()) {
22107 printf("Leak of %d blocks found in xmlNewTextLen",
22108 xmlMemBlocks() - mem_base);
22110 printf(" %d", n_content);
22111 printf(" %d", n_len);
22123 test_xmlNextElementSibling(void) {
22126 #if defined(LIBXML_TREE_ENABLED)
22128 xmlNodePtr ret_val;
22129 xmlNodePtr node; /* the current node */
22132 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22133 mem_base = xmlMemBlocks();
22134 node = gen_xmlNodePtr(n_node, 0);
22136 ret_val = xmlNextElementSibling(node);
22137 desret_xmlNodePtr(ret_val);
22139 des_xmlNodePtr(n_node, node, 0);
22140 xmlResetLastError();
22141 if (mem_base != xmlMemBlocks()) {
22142 printf("Leak of %d blocks found in xmlNextElementSibling",
22143 xmlMemBlocks() - mem_base);
22145 printf(" %d", n_node);
22157 test_xmlNodeAddContent(void) {
22161 xmlNodePtr cur; /* the node being modified */
22163 xmlChar * content; /* extra content */
22166 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22167 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22168 mem_base = xmlMemBlocks();
22169 cur = gen_xmlNodePtr(n_cur, 0);
22170 content = gen_const_xmlChar_ptr(n_content, 1);
22172 xmlNodeAddContent(cur, (const xmlChar *)content);
22174 des_xmlNodePtr(n_cur, cur, 0);
22175 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22176 xmlResetLastError();
22177 if (mem_base != xmlMemBlocks()) {
22178 printf("Leak of %d blocks found in xmlNodeAddContent",
22179 xmlMemBlocks() - mem_base);
22181 printf(" %d", n_cur);
22182 printf(" %d", n_content);
22194 test_xmlNodeAddContentLen(void) {
22198 xmlNodePtr cur; /* the node being modified */
22200 xmlChar * content; /* extra content */
22202 int len; /* the size of @content */
22205 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22206 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22207 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22208 mem_base = xmlMemBlocks();
22209 cur = gen_xmlNodePtr(n_cur, 0);
22210 content = gen_const_xmlChar_ptr(n_content, 1);
22211 len = gen_int(n_len, 2);
22213 xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22215 des_xmlNodePtr(n_cur, cur, 0);
22216 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22217 des_int(n_len, len, 2);
22218 xmlResetLastError();
22219 if (mem_base != xmlMemBlocks()) {
22220 printf("Leak of %d blocks found in xmlNodeAddContentLen",
22221 xmlMemBlocks() - mem_base);
22223 printf(" %d", n_cur);
22224 printf(" %d", n_content);
22225 printf(" %d", n_len);
22238 test_xmlNodeBufGetContent(void) {
22243 xmlBufferPtr buffer; /* a buffer */
22245 xmlNode * cur; /* the node being read */
22248 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22249 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22250 mem_base = xmlMemBlocks();
22251 buffer = gen_xmlBufferPtr(n_buffer, 0);
22252 cur = gen_const_xmlNode_ptr(n_cur, 1);
22254 ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
22255 desret_int(ret_val);
22257 des_xmlBufferPtr(n_buffer, buffer, 0);
22258 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22259 xmlResetLastError();
22260 if (mem_base != xmlMemBlocks()) {
22261 printf("Leak of %d blocks found in xmlNodeBufGetContent",
22262 xmlMemBlocks() - mem_base);
22264 printf(" %d", n_buffer);
22265 printf(" %d", n_cur);
22277 test_xmlNodeDump(void) {
22280 #if defined(LIBXML_OUTPUT_ENABLED)
22283 xmlBufferPtr buf; /* the XML buffer output */
22285 xmlDocPtr doc; /* the document */
22287 xmlNodePtr cur; /* the current node */
22289 int level; /* the imbrication level for indenting */
22291 int format; /* is formatting allowed */
22294 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22295 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22296 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22297 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22298 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22299 mem_base = xmlMemBlocks();
22300 buf = gen_xmlBufferPtr(n_buf, 0);
22301 doc = gen_xmlDocPtr(n_doc, 1);
22302 cur = gen_xmlNodePtr(n_cur, 2);
22303 level = gen_int(n_level, 3);
22304 format = gen_int(n_format, 4);
22306 ret_val = xmlNodeDump(buf, doc, cur, level, format);
22307 desret_int(ret_val);
22309 des_xmlBufferPtr(n_buf, buf, 0);
22310 des_xmlDocPtr(n_doc, doc, 1);
22311 des_xmlNodePtr(n_cur, cur, 2);
22312 des_int(n_level, level, 3);
22313 des_int(n_format, format, 4);
22314 xmlResetLastError();
22315 if (mem_base != xmlMemBlocks()) {
22316 printf("Leak of %d blocks found in xmlNodeDump",
22317 xmlMemBlocks() - mem_base);
22319 printf(" %d", n_buf);
22320 printf(" %d", n_doc);
22321 printf(" %d", n_cur);
22322 printf(" %d", n_level);
22323 printf(" %d", n_format);
22339 test_xmlNodeDumpOutput(void) {
22342 #if defined(LIBXML_OUTPUT_ENABLED)
22344 xmlOutputBufferPtr buf; /* the XML buffer output */
22346 xmlDocPtr doc; /* the document */
22348 xmlNodePtr cur; /* the current node */
22350 int level; /* the imbrication level for indenting */
22352 int format; /* is formatting allowed */
22354 char * encoding; /* an optional encoding string */
22357 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22358 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22359 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22360 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22361 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22362 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22363 mem_base = xmlMemBlocks();
22364 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22365 doc = gen_xmlDocPtr(n_doc, 1);
22366 cur = gen_xmlNodePtr(n_cur, 2);
22367 level = gen_int(n_level, 3);
22368 format = gen_int(n_format, 4);
22369 encoding = gen_const_char_ptr(n_encoding, 5);
22371 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22373 des_xmlOutputBufferPtr(n_buf, buf, 0);
22374 des_xmlDocPtr(n_doc, doc, 1);
22375 des_xmlNodePtr(n_cur, cur, 2);
22376 des_int(n_level, level, 3);
22377 des_int(n_format, format, 4);
22378 des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22379 xmlResetLastError();
22380 if (mem_base != xmlMemBlocks()) {
22381 printf("Leak of %d blocks found in xmlNodeDumpOutput",
22382 xmlMemBlocks() - mem_base);
22384 printf(" %d", n_buf);
22385 printf(" %d", n_doc);
22386 printf(" %d", n_cur);
22387 printf(" %d", n_level);
22388 printf(" %d", n_format);
22389 printf(" %d", n_encoding);
22406 test_xmlNodeGetBase(void) {
22411 xmlDoc * doc; /* the document the node pertains to */
22413 xmlNode * cur; /* the node being checked */
22416 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22417 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22418 mem_base = xmlMemBlocks();
22419 doc = gen_const_xmlDoc_ptr(n_doc, 0);
22420 cur = gen_const_xmlNode_ptr(n_cur, 1);
22422 ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
22423 desret_xmlChar_ptr(ret_val);
22425 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22426 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22427 xmlResetLastError();
22428 if (mem_base != xmlMemBlocks()) {
22429 printf("Leak of %d blocks found in xmlNodeGetBase",
22430 xmlMemBlocks() - mem_base);
22432 printf(" %d", n_doc);
22433 printf(" %d", n_cur);
22445 test_xmlNodeGetContent(void) {
22450 xmlNode * cur; /* the node being read */
22453 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22454 mem_base = xmlMemBlocks();
22455 cur = gen_const_xmlNode_ptr(n_cur, 0);
22457 ret_val = xmlNodeGetContent((const xmlNode *)cur);
22458 desret_xmlChar_ptr(ret_val);
22460 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22461 xmlResetLastError();
22462 if (mem_base != xmlMemBlocks()) {
22463 printf("Leak of %d blocks found in xmlNodeGetContent",
22464 xmlMemBlocks() - mem_base);
22466 printf(" %d", n_cur);
22477 test_xmlNodeGetLang(void) {
22482 xmlNode * cur; /* the node being checked */
22485 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22486 mem_base = xmlMemBlocks();
22487 cur = gen_const_xmlNode_ptr(n_cur, 0);
22489 ret_val = xmlNodeGetLang((const xmlNode *)cur);
22490 desret_xmlChar_ptr(ret_val);
22492 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22493 xmlResetLastError();
22494 if (mem_base != xmlMemBlocks()) {
22495 printf("Leak of %d blocks found in xmlNodeGetLang",
22496 xmlMemBlocks() - mem_base);
22498 printf(" %d", n_cur);
22509 test_xmlNodeGetSpacePreserve(void) {
22514 xmlNode * cur; /* the node being checked */
22517 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22518 mem_base = xmlMemBlocks();
22519 cur = gen_const_xmlNode_ptr(n_cur, 0);
22521 ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
22522 desret_int(ret_val);
22524 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22525 xmlResetLastError();
22526 if (mem_base != xmlMemBlocks()) {
22527 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22528 xmlMemBlocks() - mem_base);
22530 printf(" %d", n_cur);
22541 test_xmlNodeIsText(void) {
22546 xmlNode * node; /* the node */
22549 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
22550 mem_base = xmlMemBlocks();
22551 node = gen_const_xmlNode_ptr(n_node, 0);
22553 ret_val = xmlNodeIsText((const xmlNode *)node);
22554 desret_int(ret_val);
22556 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
22557 xmlResetLastError();
22558 if (mem_base != xmlMemBlocks()) {
22559 printf("Leak of %d blocks found in xmlNodeIsText",
22560 xmlMemBlocks() - mem_base);
22562 printf(" %d", n_node);
22573 test_xmlNodeListGetRawString(void) {
22576 #if defined(LIBXML_TREE_ENABLED)
22579 xmlDoc * doc; /* the document */
22581 xmlNode * list; /* a Node list */
22583 int inLine; /* should we replace entity contents or show their external form */
22586 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22587 for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22588 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22589 mem_base = xmlMemBlocks();
22590 doc = gen_const_xmlDoc_ptr(n_doc, 0);
22591 list = gen_const_xmlNode_ptr(n_list, 1);
22592 inLine = gen_int(n_inLine, 2);
22594 ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
22595 desret_xmlChar_ptr(ret_val);
22597 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22598 des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22599 des_int(n_inLine, inLine, 2);
22600 xmlResetLastError();
22601 if (mem_base != xmlMemBlocks()) {
22602 printf("Leak of %d blocks found in xmlNodeListGetRawString",
22603 xmlMemBlocks() - mem_base);
22605 printf(" %d", n_doc);
22606 printf(" %d", n_list);
22607 printf(" %d", n_inLine);
22621 test_xmlNodeListGetString(void) {
22626 xmlDocPtr doc; /* the document */
22628 xmlNode * list; /* a Node list */
22630 int inLine; /* should we replace entity contents or show their external form */
22633 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22634 for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22635 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22636 mem_base = xmlMemBlocks();
22637 doc = gen_xmlDocPtr(n_doc, 0);
22638 list = gen_const_xmlNode_ptr(n_list, 1);
22639 inLine = gen_int(n_inLine, 2);
22641 ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
22642 desret_xmlChar_ptr(ret_val);
22644 des_xmlDocPtr(n_doc, doc, 0);
22645 des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22646 des_int(n_inLine, inLine, 2);
22647 xmlResetLastError();
22648 if (mem_base != xmlMemBlocks()) {
22649 printf("Leak of %d blocks found in xmlNodeListGetString",
22650 xmlMemBlocks() - mem_base);
22652 printf(" %d", n_doc);
22653 printf(" %d", n_list);
22654 printf(" %d", n_inLine);
22667 test_xmlNodeSetBase(void) {
22670 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22672 xmlNodePtr cur; /* the node being changed */
22674 xmlChar * uri; /* the new base URI */
22677 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22678 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22679 mem_base = xmlMemBlocks();
22680 cur = gen_xmlNodePtr(n_cur, 0);
22681 uri = gen_const_xmlChar_ptr(n_uri, 1);
22683 xmlNodeSetBase(cur, (const xmlChar *)uri);
22685 des_xmlNodePtr(n_cur, cur, 0);
22686 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22687 xmlResetLastError();
22688 if (mem_base != xmlMemBlocks()) {
22689 printf("Leak of %d blocks found in xmlNodeSetBase",
22690 xmlMemBlocks() - mem_base);
22692 printf(" %d", n_cur);
22693 printf(" %d", n_uri);
22706 test_xmlNodeSetContent(void) {
22710 xmlNodePtr cur; /* the node being modified */
22712 xmlChar * content; /* the new value of the content */
22715 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22716 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22717 mem_base = xmlMemBlocks();
22718 cur = gen_xmlNodePtr(n_cur, 0);
22719 content = gen_const_xmlChar_ptr(n_content, 1);
22721 xmlNodeSetContent(cur, (const xmlChar *)content);
22723 des_xmlNodePtr(n_cur, cur, 0);
22724 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22725 xmlResetLastError();
22726 if (mem_base != xmlMemBlocks()) {
22727 printf("Leak of %d blocks found in xmlNodeSetContent",
22728 xmlMemBlocks() - mem_base);
22730 printf(" %d", n_cur);
22731 printf(" %d", n_content);
22743 test_xmlNodeSetContentLen(void) {
22746 #if defined(LIBXML_TREE_ENABLED)
22748 xmlNodePtr cur; /* the node being modified */
22750 xmlChar * content; /* the new value of the content */
22752 int len; /* the size of @content */
22755 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22756 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22757 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22758 mem_base = xmlMemBlocks();
22759 cur = gen_xmlNodePtr(n_cur, 0);
22760 content = gen_const_xmlChar_ptr(n_content, 1);
22761 len = gen_int(n_len, 2);
22763 xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22765 des_xmlNodePtr(n_cur, cur, 0);
22766 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22767 des_int(n_len, len, 2);
22768 xmlResetLastError();
22769 if (mem_base != xmlMemBlocks()) {
22770 printf("Leak of %d blocks found in xmlNodeSetContentLen",
22771 xmlMemBlocks() - mem_base);
22773 printf(" %d", n_cur);
22774 printf(" %d", n_content);
22775 printf(" %d", n_len);
22789 test_xmlNodeSetLang(void) {
22792 #if defined(LIBXML_TREE_ENABLED)
22794 xmlNodePtr cur; /* the node being changed */
22796 xmlChar * lang; /* the language description */
22799 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22800 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22801 mem_base = xmlMemBlocks();
22802 cur = gen_xmlNodePtr(n_cur, 0);
22803 lang = gen_const_xmlChar_ptr(n_lang, 1);
22805 xmlNodeSetLang(cur, (const xmlChar *)lang);
22807 des_xmlNodePtr(n_cur, cur, 0);
22808 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22809 xmlResetLastError();
22810 if (mem_base != xmlMemBlocks()) {
22811 printf("Leak of %d blocks found in xmlNodeSetLang",
22812 xmlMemBlocks() - mem_base);
22814 printf(" %d", n_cur);
22815 printf(" %d", n_lang);
22828 test_xmlNodeSetName(void) {
22831 #if defined(LIBXML_TREE_ENABLED)
22833 xmlNodePtr cur; /* the node being changed */
22835 xmlChar * name; /* the new tag name */
22838 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22839 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22840 mem_base = xmlMemBlocks();
22841 cur = gen_xmlNodePtr(n_cur, 0);
22842 name = gen_const_xmlChar_ptr(n_name, 1);
22844 xmlNodeSetName(cur, (const xmlChar *)name);
22846 des_xmlNodePtr(n_cur, cur, 0);
22847 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22848 xmlResetLastError();
22849 if (mem_base != xmlMemBlocks()) {
22850 printf("Leak of %d blocks found in xmlNodeSetName",
22851 xmlMemBlocks() - mem_base);
22853 printf(" %d", n_cur);
22854 printf(" %d", n_name);
22867 test_xmlNodeSetSpacePreserve(void) {
22870 #if defined(LIBXML_TREE_ENABLED)
22872 xmlNodePtr cur; /* the node being changed */
22874 int val; /* the xml:space value ("0": default, 1: "preserve") */
22877 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22878 for (n_val = 0;n_val < gen_nb_int;n_val++) {
22879 mem_base = xmlMemBlocks();
22880 cur = gen_xmlNodePtr(n_cur, 0);
22881 val = gen_int(n_val, 1);
22883 xmlNodeSetSpacePreserve(cur, val);
22885 des_xmlNodePtr(n_cur, cur, 0);
22886 des_int(n_val, val, 1);
22887 xmlResetLastError();
22888 if (mem_base != xmlMemBlocks()) {
22889 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22890 xmlMemBlocks() - mem_base);
22892 printf(" %d", n_cur);
22893 printf(" %d", n_val);
22906 test_xmlPreviousElementSibling(void) {
22909 #if defined(LIBXML_TREE_ENABLED)
22911 xmlNodePtr ret_val;
22912 xmlNodePtr node; /* the current node */
22915 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22916 mem_base = xmlMemBlocks();
22917 node = gen_xmlNodePtr(n_node, 0);
22919 ret_val = xmlPreviousElementSibling(node);
22920 desret_xmlNodePtr(ret_val);
22922 des_xmlNodePtr(n_node, node, 0);
22923 xmlResetLastError();
22924 if (mem_base != xmlMemBlocks()) {
22925 printf("Leak of %d blocks found in xmlPreviousElementSibling",
22926 xmlMemBlocks() - mem_base);
22928 printf(" %d", n_node);
22940 test_xmlReconciliateNs(void) {
22943 #if defined(LIBXML_TREE_ENABLED)
22944 #ifdef LIBXML_TREE_ENABLED
22947 xmlDocPtr doc; /* the document */
22949 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22952 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22953 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22954 mem_base = xmlMemBlocks();
22955 doc = gen_xmlDocPtr(n_doc, 0);
22956 tree = gen_xmlNodePtr(n_tree, 1);
22958 ret_val = xmlReconciliateNs(doc, tree);
22959 desret_int(ret_val);
22961 des_xmlDocPtr(n_doc, doc, 0);
22962 des_xmlNodePtr(n_tree, tree, 1);
22963 xmlResetLastError();
22964 if (mem_base != xmlMemBlocks()) {
22965 printf("Leak of %d blocks found in xmlReconciliateNs",
22966 xmlMemBlocks() - mem_base);
22968 printf(" %d", n_doc);
22969 printf(" %d", n_tree);
22983 test_xmlRemoveProp(void) {
22988 xmlAttrPtr cur; /* an attribute */
22991 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22992 mem_base = xmlMemBlocks();
22993 cur = gen_xmlAttrPtr(n_cur, 0);
22995 ret_val = xmlRemoveProp(cur);
22997 desret_int(ret_val);
22999 des_xmlAttrPtr(n_cur, cur, 0);
23000 xmlResetLastError();
23001 if (mem_base != xmlMemBlocks()) {
23002 printf("Leak of %d blocks found in xmlRemoveProp",
23003 xmlMemBlocks() - mem_base);
23005 printf(" %d", n_cur);
23016 test_xmlReplaceNode(void) {
23019 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23021 xmlNodePtr ret_val;
23022 xmlNodePtr old; /* the old node */
23024 xmlNodePtr cur; /* the node */
23027 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23028 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23029 mem_base = xmlMemBlocks();
23030 old = gen_xmlNodePtr(n_old, 0);
23031 cur = gen_xmlNodePtr_in(n_cur, 1);
23033 ret_val = xmlReplaceNode(old, cur);
23035 xmlUnlinkNode(cur);
23036 xmlFreeNode(cur) ; cur = NULL ; }
23038 xmlUnlinkNode(old);
23039 xmlFreeNode(old) ; old = NULL ; }
23041 desret_xmlNodePtr(ret_val);
23043 des_xmlNodePtr(n_old, old, 0);
23044 des_xmlNodePtr_in(n_cur, cur, 1);
23045 xmlResetLastError();
23046 if (mem_base != xmlMemBlocks()) {
23047 printf("Leak of %d blocks found in xmlReplaceNode",
23048 xmlMemBlocks() - mem_base);
23050 printf(" %d", n_old);
23051 printf(" %d", n_cur);
23064 test_xmlSaveFile(void) {
23067 #if defined(LIBXML_OUTPUT_ENABLED)
23070 const char * filename; /* the filename (or URL) */
23072 xmlDocPtr cur; /* the document */
23075 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23076 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23077 mem_base = xmlMemBlocks();
23078 filename = gen_fileoutput(n_filename, 0);
23079 cur = gen_xmlDocPtr(n_cur, 1);
23081 ret_val = xmlSaveFile(filename, cur);
23082 desret_int(ret_val);
23084 des_fileoutput(n_filename, filename, 0);
23085 des_xmlDocPtr(n_cur, cur, 1);
23086 xmlResetLastError();
23087 if (mem_base != xmlMemBlocks()) {
23088 printf("Leak of %d blocks found in xmlSaveFile",
23089 xmlMemBlocks() - mem_base);
23091 printf(" %d", n_filename);
23092 printf(" %d", n_cur);
23105 test_xmlSaveFileEnc(void) {
23108 #if defined(LIBXML_OUTPUT_ENABLED)
23111 const char * filename; /* the filename (or URL) */
23113 xmlDocPtr cur; /* the document */
23115 char * encoding; /* the name of an encoding (or NULL) */
23118 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23119 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23120 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23121 mem_base = xmlMemBlocks();
23122 filename = gen_fileoutput(n_filename, 0);
23123 cur = gen_xmlDocPtr(n_cur, 1);
23124 encoding = gen_const_char_ptr(n_encoding, 2);
23126 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23127 desret_int(ret_val);
23129 des_fileoutput(n_filename, filename, 0);
23130 des_xmlDocPtr(n_cur, cur, 1);
23131 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23132 xmlResetLastError();
23133 if (mem_base != xmlMemBlocks()) {
23134 printf("Leak of %d blocks found in xmlSaveFileEnc",
23135 xmlMemBlocks() - mem_base);
23137 printf(" %d", n_filename);
23138 printf(" %d", n_cur);
23139 printf(" %d", n_encoding);
23153 test_xmlSaveFileTo(void) {
23156 #if defined(LIBXML_OUTPUT_ENABLED)
23159 xmlOutputBufferPtr buf; /* an output I/O buffer */
23161 xmlDocPtr cur; /* the document */
23163 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23166 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23167 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23168 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23169 mem_base = xmlMemBlocks();
23170 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23171 cur = gen_xmlDocPtr(n_cur, 1);
23172 encoding = gen_const_char_ptr(n_encoding, 2);
23174 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23176 desret_int(ret_val);
23178 des_xmlOutputBufferPtr(n_buf, buf, 0);
23179 des_xmlDocPtr(n_cur, cur, 1);
23180 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23181 xmlResetLastError();
23182 if (mem_base != xmlMemBlocks()) {
23183 printf("Leak of %d blocks found in xmlSaveFileTo",
23184 xmlMemBlocks() - mem_base);
23186 printf(" %d", n_buf);
23187 printf(" %d", n_cur);
23188 printf(" %d", n_encoding);
23202 test_xmlSaveFormatFile(void) {
23205 #if defined(LIBXML_OUTPUT_ENABLED)
23208 const char * filename; /* the filename (or URL) */
23210 xmlDocPtr cur; /* the document */
23212 int format; /* should formatting spaces been added */
23215 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23216 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23217 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23218 mem_base = xmlMemBlocks();
23219 filename = gen_fileoutput(n_filename, 0);
23220 cur = gen_xmlDocPtr(n_cur, 1);
23221 format = gen_int(n_format, 2);
23223 ret_val = xmlSaveFormatFile(filename, cur, format);
23224 desret_int(ret_val);
23226 des_fileoutput(n_filename, filename, 0);
23227 des_xmlDocPtr(n_cur, cur, 1);
23228 des_int(n_format, format, 2);
23229 xmlResetLastError();
23230 if (mem_base != xmlMemBlocks()) {
23231 printf("Leak of %d blocks found in xmlSaveFormatFile",
23232 xmlMemBlocks() - mem_base);
23234 printf(" %d", n_filename);
23235 printf(" %d", n_cur);
23236 printf(" %d", n_format);
23250 test_xmlSaveFormatFileEnc(void) {
23253 #if defined(LIBXML_OUTPUT_ENABLED)
23256 const char * filename; /* the filename or URL to output */
23258 xmlDocPtr cur; /* the document being saved */
23260 char * encoding; /* the name of the encoding to use or NULL. */
23262 int format; /* should formatting spaces be added. */
23265 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23266 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23267 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23268 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23269 mem_base = xmlMemBlocks();
23270 filename = gen_fileoutput(n_filename, 0);
23271 cur = gen_xmlDocPtr(n_cur, 1);
23272 encoding = gen_const_char_ptr(n_encoding, 2);
23273 format = gen_int(n_format, 3);
23275 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23276 desret_int(ret_val);
23278 des_fileoutput(n_filename, filename, 0);
23279 des_xmlDocPtr(n_cur, cur, 1);
23280 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23281 des_int(n_format, format, 3);
23282 xmlResetLastError();
23283 if (mem_base != xmlMemBlocks()) {
23284 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23285 xmlMemBlocks() - mem_base);
23287 printf(" %d", n_filename);
23288 printf(" %d", n_cur);
23289 printf(" %d", n_encoding);
23290 printf(" %d", n_format);
23305 test_xmlSaveFormatFileTo(void) {
23308 #if defined(LIBXML_OUTPUT_ENABLED)
23311 xmlOutputBufferPtr buf; /* an output I/O buffer */
23313 xmlDocPtr cur; /* the document */
23315 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23317 int format; /* should formatting spaces been added */
23320 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23321 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23322 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23323 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23324 mem_base = xmlMemBlocks();
23325 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23326 cur = gen_xmlDocPtr(n_cur, 1);
23327 encoding = gen_const_char_ptr(n_encoding, 2);
23328 format = gen_int(n_format, 3);
23330 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23332 desret_int(ret_val);
23334 des_xmlOutputBufferPtr(n_buf, buf, 0);
23335 des_xmlDocPtr(n_cur, cur, 1);
23336 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23337 des_int(n_format, format, 3);
23338 xmlResetLastError();
23339 if (mem_base != xmlMemBlocks()) {
23340 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23341 xmlMemBlocks() - mem_base);
23343 printf(" %d", n_buf);
23344 printf(" %d", n_cur);
23345 printf(" %d", n_encoding);
23346 printf(" %d", n_format);
23361 test_xmlSearchNs(void) {
23366 xmlDocPtr doc; /* the document */
23368 xmlNodePtr node; /* the current node */
23370 xmlChar * nameSpace; /* the namespace prefix */
23373 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23374 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23375 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23376 mem_base = xmlMemBlocks();
23377 doc = gen_xmlDocPtr(n_doc, 0);
23378 node = gen_xmlNodePtr(n_node, 1);
23379 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23381 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23382 desret_xmlNsPtr(ret_val);
23384 des_xmlDocPtr(n_doc, doc, 0);
23385 des_xmlNodePtr(n_node, node, 1);
23386 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23387 xmlResetLastError();
23388 if (mem_base != xmlMemBlocks()) {
23389 printf("Leak of %d blocks found in xmlSearchNs",
23390 xmlMemBlocks() - mem_base);
23392 printf(" %d", n_doc);
23393 printf(" %d", n_node);
23394 printf(" %d", n_nameSpace);
23407 test_xmlSearchNsByHref(void) {
23412 xmlDocPtr doc; /* the document */
23414 xmlNodePtr node; /* the current node */
23416 xmlChar * href; /* the namespace value */
23419 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23420 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23421 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23422 mem_base = xmlMemBlocks();
23423 doc = gen_xmlDocPtr(n_doc, 0);
23424 node = gen_xmlNodePtr(n_node, 1);
23425 href = gen_const_xmlChar_ptr(n_href, 2);
23427 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23428 desret_xmlNsPtr(ret_val);
23430 des_xmlDocPtr(n_doc, doc, 0);
23431 des_xmlNodePtr(n_node, node, 1);
23432 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23433 xmlResetLastError();
23434 if (mem_base != xmlMemBlocks()) {
23435 printf("Leak of %d blocks found in xmlSearchNsByHref",
23436 xmlMemBlocks() - mem_base);
23438 printf(" %d", n_doc);
23439 printf(" %d", n_node);
23440 printf(" %d", n_href);
23453 test_xmlSetBufferAllocationScheme(void) {
23457 xmlBufferAllocationScheme scheme; /* allocation method to use */
23460 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23461 mem_base = xmlMemBlocks();
23462 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23464 xmlSetBufferAllocationScheme(scheme);
23466 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23467 xmlResetLastError();
23468 if (mem_base != xmlMemBlocks()) {
23469 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23470 xmlMemBlocks() - mem_base);
23472 printf(" %d", n_scheme);
23483 test_xmlSetCompressMode(void) {
23487 int mode; /* the compression ratio */
23490 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23491 mem_base = xmlMemBlocks();
23492 mode = gen_int(n_mode, 0);
23494 xmlSetCompressMode(mode);
23496 des_int(n_mode, mode, 0);
23497 xmlResetLastError();
23498 if (mem_base != xmlMemBlocks()) {
23499 printf("Leak of %d blocks found in xmlSetCompressMode",
23500 xmlMemBlocks() - mem_base);
23502 printf(" %d", n_mode);
23513 test_xmlSetDocCompressMode(void) {
23517 xmlDocPtr doc; /* the document */
23519 int mode; /* the compression ratio */
23522 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23523 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23524 mem_base = xmlMemBlocks();
23525 doc = gen_xmlDocPtr(n_doc, 0);
23526 mode = gen_int(n_mode, 1);
23528 xmlSetDocCompressMode(doc, mode);
23530 des_xmlDocPtr(n_doc, doc, 0);
23531 des_int(n_mode, mode, 1);
23532 xmlResetLastError();
23533 if (mem_base != xmlMemBlocks()) {
23534 printf("Leak of %d blocks found in xmlSetDocCompressMode",
23535 xmlMemBlocks() - mem_base);
23537 printf(" %d", n_doc);
23538 printf(" %d", n_mode);
23550 test_xmlSetNs(void) {
23554 xmlNodePtr node; /* a node in the document */
23556 xmlNsPtr ns; /* a namespace pointer */
23559 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23560 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23561 mem_base = xmlMemBlocks();
23562 node = gen_xmlNodePtr(n_node, 0);
23563 ns = gen_xmlNsPtr(n_ns, 1);
23565 xmlSetNs(node, ns);
23567 des_xmlNodePtr(n_node, node, 0);
23568 des_xmlNsPtr(n_ns, ns, 1);
23569 xmlResetLastError();
23570 if (mem_base != xmlMemBlocks()) {
23571 printf("Leak of %d blocks found in xmlSetNs",
23572 xmlMemBlocks() - mem_base);
23574 printf(" %d", n_node);
23575 printf(" %d", n_ns);
23587 test_xmlSetNsProp(void) {
23590 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23592 xmlAttrPtr ret_val;
23593 xmlNodePtr node; /* the node */
23595 xmlNsPtr ns; /* the namespace definition */
23597 xmlChar * name; /* the attribute name */
23599 xmlChar * value; /* the attribute value */
23602 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23603 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23604 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23605 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23606 mem_base = xmlMemBlocks();
23607 node = gen_xmlNodePtr(n_node, 0);
23608 ns = gen_xmlNsPtr(n_ns, 1);
23609 name = gen_const_xmlChar_ptr(n_name, 2);
23610 value = gen_const_xmlChar_ptr(n_value, 3);
23612 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23613 desret_xmlAttrPtr(ret_val);
23615 des_xmlNodePtr(n_node, node, 0);
23616 des_xmlNsPtr(n_ns, ns, 1);
23617 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23618 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23619 xmlResetLastError();
23620 if (mem_base != xmlMemBlocks()) {
23621 printf("Leak of %d blocks found in xmlSetNsProp",
23622 xmlMemBlocks() - mem_base);
23624 printf(" %d", n_node);
23625 printf(" %d", n_ns);
23626 printf(" %d", n_name);
23627 printf(" %d", n_value);
23642 test_xmlSetProp(void) {
23645 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23647 xmlAttrPtr ret_val;
23648 xmlNodePtr node; /* the node */
23650 xmlChar * name; /* the attribute name (a QName) */
23652 xmlChar * value; /* the attribute value */
23655 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23656 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23657 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23658 mem_base = xmlMemBlocks();
23659 node = gen_xmlNodePtr(n_node, 0);
23660 name = gen_const_xmlChar_ptr(n_name, 1);
23661 value = gen_const_xmlChar_ptr(n_value, 2);
23663 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23664 desret_xmlAttrPtr(ret_val);
23666 des_xmlNodePtr(n_node, node, 0);
23667 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23668 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23669 xmlResetLastError();
23670 if (mem_base != xmlMemBlocks()) {
23671 printf("Leak of %d blocks found in xmlSetProp",
23672 xmlMemBlocks() - mem_base);
23674 printf(" %d", n_node);
23675 printf(" %d", n_name);
23676 printf(" %d", n_value);
23690 test_xmlSplitQName2(void) {
23695 xmlChar * name; /* the full QName */
23697 xmlChar ** prefix; /* a xmlChar ** */
23700 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23701 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23702 mem_base = xmlMemBlocks();
23703 name = gen_const_xmlChar_ptr(n_name, 0);
23704 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23706 ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23707 desret_xmlChar_ptr(ret_val);
23709 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23710 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23711 xmlResetLastError();
23712 if (mem_base != xmlMemBlocks()) {
23713 printf("Leak of %d blocks found in xmlSplitQName2",
23714 xmlMemBlocks() - mem_base);
23716 printf(" %d", n_name);
23717 printf(" %d", n_prefix);
23729 test_xmlSplitQName3(void) {
23733 const xmlChar * ret_val;
23734 xmlChar * name; /* the full QName */
23736 int * len; /* an int * */
23739 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23740 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23741 mem_base = xmlMemBlocks();
23742 name = gen_const_xmlChar_ptr(n_name, 0);
23743 len = gen_int_ptr(n_len, 1);
23745 ret_val = xmlSplitQName3((const xmlChar *)name, len);
23746 desret_const_xmlChar_ptr(ret_val);
23748 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23749 des_int_ptr(n_len, len, 1);
23750 xmlResetLastError();
23751 if (mem_base != xmlMemBlocks()) {
23752 printf("Leak of %d blocks found in xmlSplitQName3",
23753 xmlMemBlocks() - mem_base);
23755 printf(" %d", n_name);
23756 printf(" %d", n_len);
23768 test_xmlStringGetNodeList(void) {
23772 xmlNodePtr ret_val;
23773 xmlDoc * doc; /* the document */
23775 xmlChar * value; /* the value of the attribute */
23778 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23779 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23780 mem_base = xmlMemBlocks();
23781 doc = gen_const_xmlDoc_ptr(n_doc, 0);
23782 value = gen_const_xmlChar_ptr(n_value, 1);
23784 ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
23785 desret_xmlNodePtr(ret_val);
23787 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23788 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23789 xmlResetLastError();
23790 if (mem_base != xmlMemBlocks()) {
23791 printf("Leak of %d blocks found in xmlStringGetNodeList",
23792 xmlMemBlocks() - mem_base);
23794 printf(" %d", n_doc);
23795 printf(" %d", n_value);
23807 test_xmlStringLenGetNodeList(void) {
23811 xmlNodePtr ret_val;
23812 xmlDoc * doc; /* the document */
23814 xmlChar * value; /* the value of the text */
23816 int len; /* the length of the string value */
23819 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23820 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23821 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23822 mem_base = xmlMemBlocks();
23823 doc = gen_const_xmlDoc_ptr(n_doc, 0);
23824 value = gen_const_xmlChar_ptr(n_value, 1);
23825 len = gen_int(n_len, 2);
23827 ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
23828 desret_xmlNodePtr(ret_val);
23830 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23831 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23832 des_int(n_len, len, 2);
23833 xmlResetLastError();
23834 if (mem_base != xmlMemBlocks()) {
23835 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23836 xmlMemBlocks() - mem_base);
23838 printf(" %d", n_doc);
23839 printf(" %d", n_value);
23840 printf(" %d", n_len);
23853 test_xmlTextConcat(void) {
23858 xmlNodePtr node; /* the node */
23860 xmlChar * content; /* the content */
23862 int len; /* @content length */
23865 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23866 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23867 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23868 mem_base = xmlMemBlocks();
23869 node = gen_xmlNodePtr(n_node, 0);
23870 content = gen_const_xmlChar_ptr(n_content, 1);
23871 len = gen_int(n_len, 2);
23873 ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23874 desret_int(ret_val);
23876 des_xmlNodePtr(n_node, node, 0);
23877 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23878 des_int(n_len, len, 2);
23879 xmlResetLastError();
23880 if (mem_base != xmlMemBlocks()) {
23881 printf("Leak of %d blocks found in xmlTextConcat",
23882 xmlMemBlocks() - mem_base);
23884 printf(" %d", n_node);
23885 printf(" %d", n_content);
23886 printf(" %d", n_len);
23899 test_xmlTextMerge(void) {
23903 xmlNodePtr ret_val;
23904 xmlNodePtr first; /* the first text node */
23906 xmlNodePtr second; /* the second text node being merged */
23909 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23910 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23911 mem_base = xmlMemBlocks();
23912 first = gen_xmlNodePtr_in(n_first, 0);
23913 second = gen_xmlNodePtr_in(n_second, 1);
23915 ret_val = xmlTextMerge(first, second);
23916 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23917 xmlUnlinkNode(second);
23918 xmlFreeNode(second) ; second = NULL ; }
23919 desret_xmlNodePtr(ret_val);
23921 des_xmlNodePtr_in(n_first, first, 0);
23922 des_xmlNodePtr_in(n_second, second, 1);
23923 xmlResetLastError();
23924 if (mem_base != xmlMemBlocks()) {
23925 printf("Leak of %d blocks found in xmlTextMerge",
23926 xmlMemBlocks() - mem_base);
23928 printf(" %d", n_first);
23929 printf(" %d", n_second);
23941 test_xmlUnsetNsProp(void) {
23944 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23947 xmlNodePtr node; /* the node */
23949 xmlNsPtr ns; /* the namespace definition */
23951 xmlChar * name; /* the attribute name */
23954 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23955 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23956 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23957 mem_base = xmlMemBlocks();
23958 node = gen_xmlNodePtr(n_node, 0);
23959 ns = gen_xmlNsPtr(n_ns, 1);
23960 name = gen_const_xmlChar_ptr(n_name, 2);
23962 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23963 desret_int(ret_val);
23965 des_xmlNodePtr(n_node, node, 0);
23966 des_xmlNsPtr(n_ns, ns, 1);
23967 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23968 xmlResetLastError();
23969 if (mem_base != xmlMemBlocks()) {
23970 printf("Leak of %d blocks found in xmlUnsetNsProp",
23971 xmlMemBlocks() - mem_base);
23973 printf(" %d", n_node);
23974 printf(" %d", n_ns);
23975 printf(" %d", n_name);
23989 test_xmlUnsetProp(void) {
23992 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23995 xmlNodePtr node; /* the node */
23997 xmlChar * name; /* the attribute name */
24000 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24001 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24002 mem_base = xmlMemBlocks();
24003 node = gen_xmlNodePtr(n_node, 0);
24004 name = gen_const_xmlChar_ptr(n_name, 1);
24006 ret_val = xmlUnsetProp(node, (const xmlChar *)name);
24007 desret_int(ret_val);
24009 des_xmlNodePtr(n_node, node, 0);
24010 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24011 xmlResetLastError();
24012 if (mem_base != xmlMemBlocks()) {
24013 printf("Leak of %d blocks found in xmlUnsetProp",
24014 xmlMemBlocks() - mem_base);
24016 printf(" %d", n_node);
24017 printf(" %d", n_name);
24030 test_xmlValidateNCName(void) {
24033 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
24034 #ifdef LIBXML_TREE_ENABLED
24037 xmlChar * value; /* the value to check */
24039 int space; /* allow spaces in front and end of the string */
24042 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24043 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24044 mem_base = xmlMemBlocks();
24045 value = gen_const_xmlChar_ptr(n_value, 0);
24046 space = gen_int(n_space, 1);
24048 ret_val = xmlValidateNCName((const xmlChar *)value, space);
24049 desret_int(ret_val);
24051 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24052 des_int(n_space, space, 1);
24053 xmlResetLastError();
24054 if (mem_base != xmlMemBlocks()) {
24055 printf("Leak of %d blocks found in xmlValidateNCName",
24056 xmlMemBlocks() - mem_base);
24058 printf(" %d", n_value);
24059 printf(" %d", n_space);
24073 test_xmlValidateNMToken(void) {
24076 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24077 #ifdef LIBXML_TREE_ENABLED
24080 xmlChar * value; /* the value to check */
24082 int space; /* allow spaces in front and end of the string */
24085 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24086 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24087 mem_base = xmlMemBlocks();
24088 value = gen_const_xmlChar_ptr(n_value, 0);
24089 space = gen_int(n_space, 1);
24091 ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24092 desret_int(ret_val);
24094 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24095 des_int(n_space, space, 1);
24096 xmlResetLastError();
24097 if (mem_base != xmlMemBlocks()) {
24098 printf("Leak of %d blocks found in xmlValidateNMToken",
24099 xmlMemBlocks() - mem_base);
24101 printf(" %d", n_value);
24102 printf(" %d", n_space);
24116 test_xmlValidateName(void) {
24119 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24120 #ifdef LIBXML_TREE_ENABLED
24123 xmlChar * value; /* the value to check */
24125 int space; /* allow spaces in front and end of the string */
24128 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24129 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24130 mem_base = xmlMemBlocks();
24131 value = gen_const_xmlChar_ptr(n_value, 0);
24132 space = gen_int(n_space, 1);
24134 ret_val = xmlValidateName((const xmlChar *)value, space);
24135 desret_int(ret_val);
24137 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24138 des_int(n_space, space, 1);
24139 xmlResetLastError();
24140 if (mem_base != xmlMemBlocks()) {
24141 printf("Leak of %d blocks found in xmlValidateName",
24142 xmlMemBlocks() - mem_base);
24144 printf(" %d", n_value);
24145 printf(" %d", n_space);
24159 test_xmlValidateQName(void) {
24162 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24163 #ifdef LIBXML_TREE_ENABLED
24166 xmlChar * value; /* the value to check */
24168 int space; /* allow spaces in front and end of the string */
24171 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24172 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24173 mem_base = xmlMemBlocks();
24174 value = gen_const_xmlChar_ptr(n_value, 0);
24175 space = gen_int(n_space, 1);
24177 ret_val = xmlValidateQName((const xmlChar *)value, space);
24178 desret_int(ret_val);
24180 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24181 des_int(n_space, space, 1);
24182 xmlResetLastError();
24183 if (mem_base != xmlMemBlocks()) {
24184 printf("Leak of %d blocks found in xmlValidateQName",
24185 xmlMemBlocks() - mem_base);
24187 printf(" %d", n_value);
24188 printf(" %d", n_space);
24204 if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24205 test_ret += test_xmlAddChild();
24206 test_ret += test_xmlAddChildList();
24207 test_ret += test_xmlAddNextSibling();
24208 test_ret += test_xmlAddPrevSibling();
24209 test_ret += test_xmlAddSibling();
24210 test_ret += test_xmlAttrSerializeTxtContent();
24211 test_ret += test_xmlBufContent();
24212 test_ret += test_xmlBufEnd();
24213 test_ret += test_xmlBufGetNodeContent();
24214 test_ret += test_xmlBufNodeDump();
24215 test_ret += test_xmlBufShrink();
24216 test_ret += test_xmlBufUse();
24217 test_ret += test_xmlBufferAdd();
24218 test_ret += test_xmlBufferAddHead();
24219 test_ret += test_xmlBufferCCat();
24220 test_ret += test_xmlBufferCat();
24221 test_ret += test_xmlBufferContent();
24222 test_ret += test_xmlBufferCreate();
24223 test_ret += test_xmlBufferCreateSize();
24224 test_ret += test_xmlBufferCreateStatic();
24225 test_ret += test_xmlBufferDetach();
24226 test_ret += test_xmlBufferEmpty();
24227 test_ret += test_xmlBufferGrow();
24228 test_ret += test_xmlBufferLength();
24229 test_ret += test_xmlBufferResize();
24230 test_ret += test_xmlBufferSetAllocationScheme();
24231 test_ret += test_xmlBufferShrink();
24232 test_ret += test_xmlBufferWriteCHAR();
24233 test_ret += test_xmlBufferWriteChar();
24234 test_ret += test_xmlBufferWriteQuotedString();
24235 test_ret += test_xmlBuildQName();
24236 test_ret += test_xmlChildElementCount();
24237 test_ret += test_xmlCopyDoc();
24238 test_ret += test_xmlCopyDtd();
24239 test_ret += test_xmlCopyNamespace();
24240 test_ret += test_xmlCopyNamespaceList();
24241 test_ret += test_xmlCopyNode();
24242 test_ret += test_xmlCopyNodeList();
24243 test_ret += test_xmlCopyProp();
24244 test_ret += test_xmlCopyPropList();
24245 test_ret += test_xmlCreateIntSubset();
24246 test_ret += test_xmlDOMWrapAdoptNode();
24247 test_ret += test_xmlDOMWrapCloneNode();
24248 test_ret += test_xmlDOMWrapNewCtxt();
24249 test_ret += test_xmlDOMWrapReconcileNamespaces();
24250 test_ret += test_xmlDOMWrapRemoveNode();
24251 test_ret += test_xmlDocCopyNode();
24252 test_ret += test_xmlDocCopyNodeList();
24253 test_ret += test_xmlDocDump();
24254 test_ret += test_xmlDocDumpFormatMemory();
24255 test_ret += test_xmlDocDumpFormatMemoryEnc();
24256 test_ret += test_xmlDocDumpMemory();
24257 test_ret += test_xmlDocDumpMemoryEnc();
24258 test_ret += test_xmlDocFormatDump();
24259 test_ret += test_xmlDocGetRootElement();
24260 test_ret += test_xmlDocSetRootElement();
24261 test_ret += test_xmlElemDump();
24262 test_ret += test_xmlFirstElementChild();
24263 test_ret += test_xmlGetBufferAllocationScheme();
24264 test_ret += test_xmlGetCompressMode();
24265 test_ret += test_xmlGetDocCompressMode();
24266 test_ret += test_xmlGetIntSubset();
24267 test_ret += test_xmlGetLastChild();
24268 test_ret += test_xmlGetLineNo();
24269 test_ret += test_xmlGetNoNsProp();
24270 test_ret += test_xmlGetNodePath();
24271 test_ret += test_xmlGetNsList();
24272 test_ret += test_xmlGetNsProp();
24273 test_ret += test_xmlGetProp();
24274 test_ret += test_xmlHasNsProp();
24275 test_ret += test_xmlHasProp();
24276 test_ret += test_xmlIsBlankNode();
24277 test_ret += test_xmlIsXHTML();
24278 test_ret += test_xmlLastElementChild();
24279 test_ret += test_xmlNewCDataBlock();
24280 test_ret += test_xmlNewCharRef();
24281 test_ret += test_xmlNewChild();
24282 test_ret += test_xmlNewComment();
24283 test_ret += test_xmlNewDoc();
24284 test_ret += test_xmlNewDocComment();
24285 test_ret += test_xmlNewDocFragment();
24286 test_ret += test_xmlNewDocNode();
24287 test_ret += test_xmlNewDocNodeEatName();
24288 test_ret += test_xmlNewDocPI();
24289 test_ret += test_xmlNewDocProp();
24290 test_ret += test_xmlNewDocRawNode();
24291 test_ret += test_xmlNewDocText();
24292 test_ret += test_xmlNewDocTextLen();
24293 test_ret += test_xmlNewDtd();
24294 test_ret += test_xmlNewNode();
24295 test_ret += test_xmlNewNodeEatName();
24296 test_ret += test_xmlNewNs();
24297 test_ret += test_xmlNewNsProp();
24298 test_ret += test_xmlNewNsPropEatName();
24299 test_ret += test_xmlNewPI();
24300 test_ret += test_xmlNewProp();
24301 test_ret += test_xmlNewReference();
24302 test_ret += test_xmlNewText();
24303 test_ret += test_xmlNewTextChild();
24304 test_ret += test_xmlNewTextLen();
24305 test_ret += test_xmlNextElementSibling();
24306 test_ret += test_xmlNodeAddContent();
24307 test_ret += test_xmlNodeAddContentLen();
24308 test_ret += test_xmlNodeBufGetContent();
24309 test_ret += test_xmlNodeDump();
24310 test_ret += test_xmlNodeDumpOutput();
24311 test_ret += test_xmlNodeGetBase();
24312 test_ret += test_xmlNodeGetContent();
24313 test_ret += test_xmlNodeGetLang();
24314 test_ret += test_xmlNodeGetSpacePreserve();
24315 test_ret += test_xmlNodeIsText();
24316 test_ret += test_xmlNodeListGetRawString();
24317 test_ret += test_xmlNodeListGetString();
24318 test_ret += test_xmlNodeSetBase();
24319 test_ret += test_xmlNodeSetContent();
24320 test_ret += test_xmlNodeSetContentLen();
24321 test_ret += test_xmlNodeSetLang();
24322 test_ret += test_xmlNodeSetName();
24323 test_ret += test_xmlNodeSetSpacePreserve();
24324 test_ret += test_xmlPreviousElementSibling();
24325 test_ret += test_xmlReconciliateNs();
24326 test_ret += test_xmlRemoveProp();
24327 test_ret += test_xmlReplaceNode();
24328 test_ret += test_xmlSaveFile();
24329 test_ret += test_xmlSaveFileEnc();
24330 test_ret += test_xmlSaveFileTo();
24331 test_ret += test_xmlSaveFormatFile();
24332 test_ret += test_xmlSaveFormatFileEnc();
24333 test_ret += test_xmlSaveFormatFileTo();
24334 test_ret += test_xmlSearchNs();
24335 test_ret += test_xmlSearchNsByHref();
24336 test_ret += test_xmlSetBufferAllocationScheme();
24337 test_ret += test_xmlSetCompressMode();
24338 test_ret += test_xmlSetDocCompressMode();
24339 test_ret += test_xmlSetNs();
24340 test_ret += test_xmlSetNsProp();
24341 test_ret += test_xmlSetProp();
24342 test_ret += test_xmlSplitQName2();
24343 test_ret += test_xmlSplitQName3();
24344 test_ret += test_xmlStringGetNodeList();
24345 test_ret += test_xmlStringLenGetNodeList();
24346 test_ret += test_xmlTextConcat();
24347 test_ret += test_xmlTextMerge();
24348 test_ret += test_xmlUnsetNsProp();
24349 test_ret += test_xmlUnsetProp();
24350 test_ret += test_xmlValidateNCName();
24351 test_ret += test_xmlValidateNMToken();
24352 test_ret += test_xmlValidateName();
24353 test_ret += test_xmlValidateQName();
24356 printf("Module tree: %d errors\n", test_ret);
24361 test_xmlBuildRelativeURI(void) {
24366 xmlChar * URI; /* the URI reference under consideration */
24368 xmlChar * base; /* the base value */
24371 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24372 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24373 mem_base = xmlMemBlocks();
24374 URI = gen_const_xmlChar_ptr(n_URI, 0);
24375 base = gen_const_xmlChar_ptr(n_base, 1);
24377 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24378 desret_xmlChar_ptr(ret_val);
24380 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24381 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24382 xmlResetLastError();
24383 if (mem_base != xmlMemBlocks()) {
24384 printf("Leak of %d blocks found in xmlBuildRelativeURI",
24385 xmlMemBlocks() - mem_base);
24387 printf(" %d", n_URI);
24388 printf(" %d", n_base);
24400 test_xmlBuildURI(void) {
24405 xmlChar * URI; /* the URI instance found in the document */
24407 xmlChar * base; /* the base value */
24410 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24411 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24412 mem_base = xmlMemBlocks();
24413 URI = gen_const_xmlChar_ptr(n_URI, 0);
24414 base = gen_const_xmlChar_ptr(n_base, 1);
24416 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24417 desret_xmlChar_ptr(ret_val);
24419 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24420 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24421 xmlResetLastError();
24422 if (mem_base != xmlMemBlocks()) {
24423 printf("Leak of %d blocks found in xmlBuildURI",
24424 xmlMemBlocks() - mem_base);
24426 printf(" %d", n_URI);
24427 printf(" %d", n_base);
24439 test_xmlCanonicPath(void) {
24444 xmlChar * path; /* the resource locator in a filesystem notation */
24447 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24448 mem_base = xmlMemBlocks();
24449 path = gen_const_xmlChar_ptr(n_path, 0);
24451 ret_val = xmlCanonicPath((const xmlChar *)path);
24452 desret_xmlChar_ptr(ret_val);
24454 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24455 xmlResetLastError();
24456 if (mem_base != xmlMemBlocks()) {
24457 printf("Leak of %d blocks found in xmlCanonicPath",
24458 xmlMemBlocks() - mem_base);
24460 printf(" %d", n_path);
24471 test_xmlCreateURI(void) {
24475 /* missing type support */
24481 test_xmlNormalizeURIPath(void) {
24486 char * path; /* pointer to the path string */
24489 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24490 mem_base = xmlMemBlocks();
24491 path = gen_char_ptr(n_path, 0);
24493 ret_val = xmlNormalizeURIPath(path);
24494 desret_int(ret_val);
24496 des_char_ptr(n_path, path, 0);
24497 xmlResetLastError();
24498 if (mem_base != xmlMemBlocks()) {
24499 printf("Leak of %d blocks found in xmlNormalizeURIPath",
24500 xmlMemBlocks() - mem_base);
24502 printf(" %d", n_path);
24513 test_xmlParseURI(void) {
24517 /* missing type support */
24523 test_xmlParseURIRaw(void) {
24527 /* missing type support */
24532 #define gen_nb_xmlURIPtr 1
24533 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24536 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24540 test_xmlParseURIReference(void) {
24545 xmlURIPtr uri; /* pointer to an URI structure */
24547 char * str; /* the string to analyze */
24550 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24551 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24552 mem_base = xmlMemBlocks();
24553 uri = gen_xmlURIPtr(n_uri, 0);
24554 str = gen_const_char_ptr(n_str, 1);
24556 ret_val = xmlParseURIReference(uri, (const char *)str);
24557 desret_int(ret_val);
24559 des_xmlURIPtr(n_uri, uri, 0);
24560 des_const_char_ptr(n_str, (const char *)str, 1);
24561 xmlResetLastError();
24562 if (mem_base != xmlMemBlocks()) {
24563 printf("Leak of %d blocks found in xmlParseURIReference",
24564 xmlMemBlocks() - mem_base);
24566 printf(" %d", n_uri);
24567 printf(" %d", n_str);
24579 test_xmlPathToURI(void) {
24584 xmlChar * path; /* the resource locator in a filesystem notation */
24587 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24588 mem_base = xmlMemBlocks();
24589 path = gen_const_xmlChar_ptr(n_path, 0);
24591 ret_val = xmlPathToURI((const xmlChar *)path);
24592 desret_xmlChar_ptr(ret_val);
24594 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24595 xmlResetLastError();
24596 if (mem_base != xmlMemBlocks()) {
24597 printf("Leak of %d blocks found in xmlPathToURI",
24598 xmlMemBlocks() - mem_base);
24600 printf(" %d", n_path);
24611 test_xmlPrintURI(void) {
24615 FILE * stream; /* a FILE* for the output */
24617 xmlURIPtr uri; /* pointer to an xmlURI */
24620 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24621 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24622 mem_base = xmlMemBlocks();
24623 stream = gen_FILE_ptr(n_stream, 0);
24624 uri = gen_xmlURIPtr(n_uri, 1);
24626 xmlPrintURI(stream, uri);
24628 des_FILE_ptr(n_stream, stream, 0);
24629 des_xmlURIPtr(n_uri, uri, 1);
24630 xmlResetLastError();
24631 if (mem_base != xmlMemBlocks()) {
24632 printf("Leak of %d blocks found in xmlPrintURI",
24633 xmlMemBlocks() - mem_base);
24635 printf(" %d", n_stream);
24636 printf(" %d", n_uri);
24648 test_xmlSaveUri(void) {
24653 xmlURIPtr uri; /* pointer to an xmlURI */
24656 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24657 mem_base = xmlMemBlocks();
24658 uri = gen_xmlURIPtr(n_uri, 0);
24660 ret_val = xmlSaveUri(uri);
24661 desret_xmlChar_ptr(ret_val);
24663 des_xmlURIPtr(n_uri, uri, 0);
24664 xmlResetLastError();
24665 if (mem_base != xmlMemBlocks()) {
24666 printf("Leak of %d blocks found in xmlSaveUri",
24667 xmlMemBlocks() - mem_base);
24669 printf(" %d", n_uri);
24680 test_xmlURIEscape(void) {
24685 xmlChar * str; /* the string of the URI to escape */
24688 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24689 mem_base = xmlMemBlocks();
24690 str = gen_const_xmlChar_ptr(n_str, 0);
24692 ret_val = xmlURIEscape((const xmlChar *)str);
24693 desret_xmlChar_ptr(ret_val);
24695 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24696 xmlResetLastError();
24697 if (mem_base != xmlMemBlocks()) {
24698 printf("Leak of %d blocks found in xmlURIEscape",
24699 xmlMemBlocks() - mem_base);
24701 printf(" %d", n_str);
24712 test_xmlURIEscapeStr(void) {
24717 xmlChar * str; /* string to escape */
24719 xmlChar * list; /* exception list string of chars not to escape */
24722 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24723 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24724 mem_base = xmlMemBlocks();
24725 str = gen_const_xmlChar_ptr(n_str, 0);
24726 list = gen_const_xmlChar_ptr(n_list, 1);
24728 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24729 desret_xmlChar_ptr(ret_val);
24731 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24732 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24733 xmlResetLastError();
24734 if (mem_base != xmlMemBlocks()) {
24735 printf("Leak of %d blocks found in xmlURIEscapeStr",
24736 xmlMemBlocks() - mem_base);
24738 printf(" %d", n_str);
24739 printf(" %d", n_list);
24751 test_xmlURIUnescapeString(void) {
24755 /* missing type support */
24763 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24764 test_ret += test_xmlBuildRelativeURI();
24765 test_ret += test_xmlBuildURI();
24766 test_ret += test_xmlCanonicPath();
24767 test_ret += test_xmlCreateURI();
24768 test_ret += test_xmlNormalizeURIPath();
24769 test_ret += test_xmlParseURI();
24770 test_ret += test_xmlParseURIRaw();
24771 test_ret += test_xmlParseURIReference();
24772 test_ret += test_xmlPathToURI();
24773 test_ret += test_xmlPrintURI();
24774 test_ret += test_xmlSaveUri();
24775 test_ret += test_xmlURIEscape();
24776 test_ret += test_xmlURIEscapeStr();
24777 test_ret += test_xmlURIUnescapeString();
24780 printf("Module uri: %d errors\n", test_ret);
24785 test_xmlAddAttributeDecl(void) {
24789 xmlAttributePtr ret_val;
24790 xmlValidCtxtPtr ctxt; /* the validation context */
24792 xmlDtdPtr dtd; /* pointer to the DTD */
24794 xmlChar * elem; /* the element name */
24796 xmlChar * name; /* the attribute name */
24798 xmlChar * ns; /* the attribute namespace prefix */
24800 xmlAttributeType type; /* the attribute type */
24802 xmlAttributeDefault def; /* the attribute default type */
24804 xmlChar * defaultValue; /* the attribute default value */
24805 int n_defaultValue;
24806 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24809 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24810 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24811 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24812 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24813 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24814 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24815 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24816 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24817 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24818 mem_base = xmlMemBlocks();
24819 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24820 dtd = gen_xmlDtdPtr(n_dtd, 1);
24821 elem = gen_const_xmlChar_ptr(n_elem, 2);
24822 name = gen_const_xmlChar_ptr(n_name, 3);
24823 ns = gen_const_xmlChar_ptr(n_ns, 4);
24824 type = gen_xmlAttributeType(n_type, 5);
24825 def = gen_xmlAttributeDefault(n_def, 6);
24826 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24827 tree = gen_xmlEnumerationPtr(n_tree, 8);
24829 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24830 desret_xmlAttributePtr(ret_val);
24832 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24833 des_xmlDtdPtr(n_dtd, dtd, 1);
24834 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24835 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24836 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24837 des_xmlAttributeType(n_type, type, 5);
24838 des_xmlAttributeDefault(n_def, def, 6);
24839 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24840 des_xmlEnumerationPtr(n_tree, tree, 8);
24841 xmlResetLastError();
24842 if (mem_base != xmlMemBlocks()) {
24843 printf("Leak of %d blocks found in xmlAddAttributeDecl",
24844 xmlMemBlocks() - mem_base);
24846 printf(" %d", n_ctxt);
24847 printf(" %d", n_dtd);
24848 printf(" %d", n_elem);
24849 printf(" %d", n_name);
24850 printf(" %d", n_ns);
24851 printf(" %d", n_type);
24852 printf(" %d", n_def);
24853 printf(" %d", n_defaultValue);
24854 printf(" %d", n_tree);
24873 test_xmlAddElementDecl(void) {
24877 xmlElementPtr ret_val;
24878 xmlValidCtxtPtr ctxt; /* the validation context */
24880 xmlDtdPtr dtd; /* pointer to the DTD */
24882 xmlChar * name; /* the entity name */
24884 xmlElementTypeVal type; /* the element type */
24886 xmlElementContentPtr content; /* the element content tree or NULL */
24889 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24890 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24891 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24892 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24893 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24894 mem_base = xmlMemBlocks();
24895 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24896 dtd = gen_xmlDtdPtr(n_dtd, 1);
24897 name = gen_const_xmlChar_ptr(n_name, 2);
24898 type = gen_xmlElementTypeVal(n_type, 3);
24899 content = gen_xmlElementContentPtr(n_content, 4);
24901 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24902 desret_xmlElementPtr(ret_val);
24904 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24905 des_xmlDtdPtr(n_dtd, dtd, 1);
24906 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24907 des_xmlElementTypeVal(n_type, type, 3);
24908 des_xmlElementContentPtr(n_content, content, 4);
24909 xmlResetLastError();
24910 if (mem_base != xmlMemBlocks()) {
24911 printf("Leak of %d blocks found in xmlAddElementDecl",
24912 xmlMemBlocks() - mem_base);
24914 printf(" %d", n_ctxt);
24915 printf(" %d", n_dtd);
24916 printf(" %d", n_name);
24917 printf(" %d", n_type);
24918 printf(" %d", n_content);
24933 test_xmlAddID(void) {
24937 /* missing type support */
24943 test_xmlAddNotationDecl(void) {
24947 /* missing type support */
24953 test_xmlAddRef(void) {
24957 /* missing type support */
24962 #define gen_nb_xmlAttributeTablePtr 1
24963 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24966 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24970 test_xmlCopyAttributeTable(void) {
24974 /* missing type support */
24980 test_xmlCopyDocElementContent(void) {
24984 xmlElementContentPtr ret_val;
24985 xmlDocPtr doc; /* the document owning the element declaration */
24987 xmlElementContentPtr cur; /* An element content pointer. */
24990 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24991 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24992 mem_base = xmlMemBlocks();
24993 doc = gen_xmlDocPtr(n_doc, 0);
24994 cur = gen_xmlElementContentPtr(n_cur, 1);
24996 ret_val = xmlCopyDocElementContent(doc, cur);
24997 desret_xmlElementContentPtr(ret_val);
24999 des_xmlDocPtr(n_doc, doc, 0);
25000 des_xmlElementContentPtr(n_cur, cur, 1);
25001 xmlResetLastError();
25002 if (mem_base != xmlMemBlocks()) {
25003 printf("Leak of %d blocks found in xmlCopyDocElementContent",
25004 xmlMemBlocks() - mem_base);
25006 printf(" %d", n_doc);
25007 printf(" %d", n_cur);
25019 test_xmlCopyElementContent(void) {
25023 xmlElementContentPtr ret_val;
25024 xmlElementContentPtr cur; /* An element content pointer. */
25027 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25028 mem_base = xmlMemBlocks();
25029 cur = gen_xmlElementContentPtr(n_cur, 0);
25031 ret_val = xmlCopyElementContent(cur);
25032 desret_xmlElementContentPtr(ret_val);
25034 des_xmlElementContentPtr(n_cur, cur, 0);
25035 xmlResetLastError();
25036 if (mem_base != xmlMemBlocks()) {
25037 printf("Leak of %d blocks found in xmlCopyElementContent",
25038 xmlMemBlocks() - mem_base);
25040 printf(" %d", n_cur);
25050 #define gen_nb_xmlElementTablePtr 1
25051 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25054 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25058 test_xmlCopyElementTable(void) {
25062 /* missing type support */
25068 test_xmlCopyEnumeration(void) {
25072 /* missing type support */
25077 #define gen_nb_xmlNotationTablePtr 1
25078 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25081 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25085 test_xmlCopyNotationTable(void) {
25089 /* missing type support */
25095 test_xmlCreateEnumeration(void) {
25099 /* missing type support */
25104 #define gen_nb_xmlAttributePtr 1
25105 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25108 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25112 test_xmlDumpAttributeDecl(void) {
25115 #if defined(LIBXML_OUTPUT_ENABLED)
25117 xmlBufferPtr buf; /* the XML buffer output */
25119 xmlAttributePtr attr; /* An attribute declaration */
25122 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25123 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25124 mem_base = xmlMemBlocks();
25125 buf = gen_xmlBufferPtr(n_buf, 0);
25126 attr = gen_xmlAttributePtr(n_attr, 1);
25128 xmlDumpAttributeDecl(buf, attr);
25130 des_xmlBufferPtr(n_buf, buf, 0);
25131 des_xmlAttributePtr(n_attr, attr, 1);
25132 xmlResetLastError();
25133 if (mem_base != xmlMemBlocks()) {
25134 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25135 xmlMemBlocks() - mem_base);
25137 printf(" %d", n_buf);
25138 printf(" %d", n_attr);
25151 test_xmlDumpAttributeTable(void) {
25154 #if defined(LIBXML_OUTPUT_ENABLED)
25156 xmlBufferPtr buf; /* the XML buffer output */
25158 xmlAttributeTablePtr table; /* An attribute table */
25161 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25162 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25163 mem_base = xmlMemBlocks();
25164 buf = gen_xmlBufferPtr(n_buf, 0);
25165 table = gen_xmlAttributeTablePtr(n_table, 1);
25167 xmlDumpAttributeTable(buf, table);
25169 des_xmlBufferPtr(n_buf, buf, 0);
25170 des_xmlAttributeTablePtr(n_table, table, 1);
25171 xmlResetLastError();
25172 if (mem_base != xmlMemBlocks()) {
25173 printf("Leak of %d blocks found in xmlDumpAttributeTable",
25174 xmlMemBlocks() - mem_base);
25176 printf(" %d", n_buf);
25177 printf(" %d", n_table);
25189 #define gen_nb_xmlElementPtr 1
25190 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25193 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25197 test_xmlDumpElementDecl(void) {
25200 #if defined(LIBXML_OUTPUT_ENABLED)
25202 xmlBufferPtr buf; /* the XML buffer output */
25204 xmlElementPtr elem; /* An element table */
25207 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25208 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25209 mem_base = xmlMemBlocks();
25210 buf = gen_xmlBufferPtr(n_buf, 0);
25211 elem = gen_xmlElementPtr(n_elem, 1);
25213 xmlDumpElementDecl(buf, elem);
25215 des_xmlBufferPtr(n_buf, buf, 0);
25216 des_xmlElementPtr(n_elem, elem, 1);
25217 xmlResetLastError();
25218 if (mem_base != xmlMemBlocks()) {
25219 printf("Leak of %d blocks found in xmlDumpElementDecl",
25220 xmlMemBlocks() - mem_base);
25222 printf(" %d", n_buf);
25223 printf(" %d", n_elem);
25236 test_xmlDumpElementTable(void) {
25239 #if defined(LIBXML_OUTPUT_ENABLED)
25241 xmlBufferPtr buf; /* the XML buffer output */
25243 xmlElementTablePtr table; /* An element table */
25246 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25247 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25248 mem_base = xmlMemBlocks();
25249 buf = gen_xmlBufferPtr(n_buf, 0);
25250 table = gen_xmlElementTablePtr(n_table, 1);
25252 xmlDumpElementTable(buf, table);
25254 des_xmlBufferPtr(n_buf, buf, 0);
25255 des_xmlElementTablePtr(n_table, table, 1);
25256 xmlResetLastError();
25257 if (mem_base != xmlMemBlocks()) {
25258 printf("Leak of %d blocks found in xmlDumpElementTable",
25259 xmlMemBlocks() - mem_base);
25261 printf(" %d", n_buf);
25262 printf(" %d", n_table);
25274 #define gen_nb_xmlNotationPtr 1
25275 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25278 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25282 test_xmlDumpNotationDecl(void) {
25285 #if defined(LIBXML_OUTPUT_ENABLED)
25287 xmlBufferPtr buf; /* the XML buffer output */
25289 xmlNotationPtr nota; /* A notation declaration */
25292 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25293 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25294 mem_base = xmlMemBlocks();
25295 buf = gen_xmlBufferPtr(n_buf, 0);
25296 nota = gen_xmlNotationPtr(n_nota, 1);
25298 xmlDumpNotationDecl(buf, nota);
25300 des_xmlBufferPtr(n_buf, buf, 0);
25301 des_xmlNotationPtr(n_nota, nota, 1);
25302 xmlResetLastError();
25303 if (mem_base != xmlMemBlocks()) {
25304 printf("Leak of %d blocks found in xmlDumpNotationDecl",
25305 xmlMemBlocks() - mem_base);
25307 printf(" %d", n_buf);
25308 printf(" %d", n_nota);
25321 test_xmlDumpNotationTable(void) {
25324 #if defined(LIBXML_OUTPUT_ENABLED)
25326 xmlBufferPtr buf; /* the XML buffer output */
25328 xmlNotationTablePtr table; /* A notation table */
25331 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25332 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25333 mem_base = xmlMemBlocks();
25334 buf = gen_xmlBufferPtr(n_buf, 0);
25335 table = gen_xmlNotationTablePtr(n_table, 1);
25337 xmlDumpNotationTable(buf, table);
25339 des_xmlBufferPtr(n_buf, buf, 0);
25340 des_xmlNotationTablePtr(n_table, table, 1);
25341 xmlResetLastError();
25342 if (mem_base != xmlMemBlocks()) {
25343 printf("Leak of %d blocks found in xmlDumpNotationTable",
25344 xmlMemBlocks() - mem_base);
25346 printf(" %d", n_buf);
25347 printf(" %d", n_table);
25360 test_xmlGetDtdAttrDesc(void) {
25364 xmlAttributePtr ret_val;
25365 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25367 xmlChar * elem; /* the element name */
25369 xmlChar * name; /* the attribute name */
25372 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25373 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25374 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25375 mem_base = xmlMemBlocks();
25376 dtd = gen_xmlDtdPtr(n_dtd, 0);
25377 elem = gen_const_xmlChar_ptr(n_elem, 1);
25378 name = gen_const_xmlChar_ptr(n_name, 2);
25380 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25381 desret_xmlAttributePtr(ret_val);
25383 des_xmlDtdPtr(n_dtd, dtd, 0);
25384 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25385 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25386 xmlResetLastError();
25387 if (mem_base != xmlMemBlocks()) {
25388 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25389 xmlMemBlocks() - mem_base);
25391 printf(" %d", n_dtd);
25392 printf(" %d", n_elem);
25393 printf(" %d", n_name);
25406 test_xmlGetDtdElementDesc(void) {
25410 xmlElementPtr ret_val;
25411 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25413 xmlChar * name; /* the element name */
25416 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25417 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25418 mem_base = xmlMemBlocks();
25419 dtd = gen_xmlDtdPtr(n_dtd, 0);
25420 name = gen_const_xmlChar_ptr(n_name, 1);
25422 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25423 desret_xmlElementPtr(ret_val);
25425 des_xmlDtdPtr(n_dtd, dtd, 0);
25426 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25427 xmlResetLastError();
25428 if (mem_base != xmlMemBlocks()) {
25429 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25430 xmlMemBlocks() - mem_base);
25432 printf(" %d", n_dtd);
25433 printf(" %d", n_name);
25445 test_xmlGetDtdNotationDesc(void) {
25449 /* missing type support */
25455 test_xmlGetDtdQAttrDesc(void) {
25459 xmlAttributePtr ret_val;
25460 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25462 xmlChar * elem; /* the element name */
25464 xmlChar * name; /* the attribute name */
25466 xmlChar * prefix; /* the attribute namespace prefix */
25469 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25470 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25471 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25472 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25473 mem_base = xmlMemBlocks();
25474 dtd = gen_xmlDtdPtr(n_dtd, 0);
25475 elem = gen_const_xmlChar_ptr(n_elem, 1);
25476 name = gen_const_xmlChar_ptr(n_name, 2);
25477 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25479 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25480 desret_xmlAttributePtr(ret_val);
25482 des_xmlDtdPtr(n_dtd, dtd, 0);
25483 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25484 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25485 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25486 xmlResetLastError();
25487 if (mem_base != xmlMemBlocks()) {
25488 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25489 xmlMemBlocks() - mem_base);
25491 printf(" %d", n_dtd);
25492 printf(" %d", n_elem);
25493 printf(" %d", n_name);
25494 printf(" %d", n_prefix);
25508 test_xmlGetDtdQElementDesc(void) {
25512 xmlElementPtr ret_val;
25513 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25515 xmlChar * name; /* the element name */
25517 xmlChar * prefix; /* the element namespace prefix */
25520 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25521 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25522 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25523 mem_base = xmlMemBlocks();
25524 dtd = gen_xmlDtdPtr(n_dtd, 0);
25525 name = gen_const_xmlChar_ptr(n_name, 1);
25526 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25528 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25529 desret_xmlElementPtr(ret_val);
25531 des_xmlDtdPtr(n_dtd, dtd, 0);
25532 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25533 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25534 xmlResetLastError();
25535 if (mem_base != xmlMemBlocks()) {
25536 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25537 xmlMemBlocks() - mem_base);
25539 printf(" %d", n_dtd);
25540 printf(" %d", n_name);
25541 printf(" %d", n_prefix);
25554 test_xmlGetID(void) {
25558 xmlAttrPtr ret_val;
25559 xmlDocPtr doc; /* pointer to the document */
25561 xmlChar * ID; /* the ID value */
25564 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25565 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25566 mem_base = xmlMemBlocks();
25567 doc = gen_xmlDocPtr(n_doc, 0);
25568 ID = gen_const_xmlChar_ptr(n_ID, 1);
25570 ret_val = xmlGetID(doc, (const xmlChar *)ID);
25571 desret_xmlAttrPtr(ret_val);
25573 des_xmlDocPtr(n_doc, doc, 0);
25574 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25575 xmlResetLastError();
25576 if (mem_base != xmlMemBlocks()) {
25577 printf("Leak of %d blocks found in xmlGetID",
25578 xmlMemBlocks() - mem_base);
25580 printf(" %d", n_doc);
25581 printf(" %d", n_ID);
25593 test_xmlGetRefs(void) {
25597 /* missing type support */
25603 test_xmlIsID(void) {
25608 xmlDocPtr doc; /* the document */
25610 xmlNodePtr elem; /* the element carrying the attribute */
25612 xmlAttrPtr attr; /* the attribute */
25615 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25616 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25617 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25618 mem_base = xmlMemBlocks();
25619 doc = gen_xmlDocPtr(n_doc, 0);
25620 elem = gen_xmlNodePtr(n_elem, 1);
25621 attr = gen_xmlAttrPtr(n_attr, 2);
25623 ret_val = xmlIsID(doc, elem, attr);
25624 desret_int(ret_val);
25626 des_xmlDocPtr(n_doc, doc, 0);
25627 des_xmlNodePtr(n_elem, elem, 1);
25628 des_xmlAttrPtr(n_attr, attr, 2);
25629 xmlResetLastError();
25630 if (mem_base != xmlMemBlocks()) {
25631 printf("Leak of %d blocks found in xmlIsID",
25632 xmlMemBlocks() - mem_base);
25634 printf(" %d", n_doc);
25635 printf(" %d", n_elem);
25636 printf(" %d", n_attr);
25649 test_xmlIsMixedElement(void) {
25654 xmlDocPtr doc; /* the document */
25656 xmlChar * name; /* the element name */
25659 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25660 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25661 mem_base = xmlMemBlocks();
25662 doc = gen_xmlDocPtr(n_doc, 0);
25663 name = gen_const_xmlChar_ptr(n_name, 1);
25665 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25666 desret_int(ret_val);
25668 des_xmlDocPtr(n_doc, doc, 0);
25669 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25670 xmlResetLastError();
25671 if (mem_base != xmlMemBlocks()) {
25672 printf("Leak of %d blocks found in xmlIsMixedElement",
25673 xmlMemBlocks() - mem_base);
25675 printf(" %d", n_doc);
25676 printf(" %d", n_name);
25688 test_xmlIsRef(void) {
25693 xmlDocPtr doc; /* the document */
25695 xmlNodePtr elem; /* the element carrying the attribute */
25697 xmlAttrPtr attr; /* the attribute */
25700 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25701 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25702 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25703 mem_base = xmlMemBlocks();
25704 doc = gen_xmlDocPtr(n_doc, 0);
25705 elem = gen_xmlNodePtr(n_elem, 1);
25706 attr = gen_xmlAttrPtr(n_attr, 2);
25708 ret_val = xmlIsRef(doc, elem, attr);
25709 desret_int(ret_val);
25711 des_xmlDocPtr(n_doc, doc, 0);
25712 des_xmlNodePtr(n_elem, elem, 1);
25713 des_xmlAttrPtr(n_attr, attr, 2);
25714 xmlResetLastError();
25715 if (mem_base != xmlMemBlocks()) {
25716 printf("Leak of %d blocks found in xmlIsRef",
25717 xmlMemBlocks() - mem_base);
25719 printf(" %d", n_doc);
25720 printf(" %d", n_elem);
25721 printf(" %d", n_attr);
25734 test_xmlNewDocElementContent(void) {
25738 xmlElementContentPtr ret_val;
25739 xmlDocPtr doc; /* the document */
25741 xmlChar * name; /* the subelement name or NULL */
25743 xmlElementContentType type; /* the type of element content decl */
25746 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25747 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25748 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25749 mem_base = xmlMemBlocks();
25750 doc = gen_xmlDocPtr(n_doc, 0);
25751 name = gen_const_xmlChar_ptr(n_name, 1);
25752 type = gen_xmlElementContentType(n_type, 2);
25754 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25755 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25756 desret_xmlElementContentPtr(ret_val);
25758 des_xmlDocPtr(n_doc, doc, 0);
25759 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25760 des_xmlElementContentType(n_type, type, 2);
25761 xmlResetLastError();
25762 if (mem_base != xmlMemBlocks()) {
25763 printf("Leak of %d blocks found in xmlNewDocElementContent",
25764 xmlMemBlocks() - mem_base);
25766 printf(" %d", n_doc);
25767 printf(" %d", n_name);
25768 printf(" %d", n_type);
25781 test_xmlNewElementContent(void) {
25785 xmlElementContentPtr ret_val;
25786 xmlChar * name; /* the subelement name or NULL */
25788 xmlElementContentType type; /* the type of element content decl */
25791 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25792 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25793 mem_base = xmlMemBlocks();
25794 name = gen_const_xmlChar_ptr(n_name, 0);
25795 type = gen_xmlElementContentType(n_type, 1);
25797 ret_val = xmlNewElementContent((const xmlChar *)name, type);
25798 desret_xmlElementContentPtr(ret_val);
25800 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25801 des_xmlElementContentType(n_type, type, 1);
25802 xmlResetLastError();
25803 if (mem_base != xmlMemBlocks()) {
25804 printf("Leak of %d blocks found in xmlNewElementContent",
25805 xmlMemBlocks() - mem_base);
25807 printf(" %d", n_name);
25808 printf(" %d", n_type);
25820 test_xmlNewValidCtxt(void) {
25824 /* missing type support */
25830 test_xmlRemoveID(void) {
25835 xmlDocPtr doc; /* the document */
25837 xmlAttrPtr attr; /* the attribute */
25840 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25841 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25842 mem_base = xmlMemBlocks();
25843 doc = gen_xmlDocPtr(n_doc, 0);
25844 attr = gen_xmlAttrPtr(n_attr, 1);
25846 ret_val = xmlRemoveID(doc, attr);
25847 desret_int(ret_val);
25849 des_xmlDocPtr(n_doc, doc, 0);
25850 des_xmlAttrPtr(n_attr, attr, 1);
25851 xmlResetLastError();
25852 if (mem_base != xmlMemBlocks()) {
25853 printf("Leak of %d blocks found in xmlRemoveID",
25854 xmlMemBlocks() - mem_base);
25856 printf(" %d", n_doc);
25857 printf(" %d", n_attr);
25869 test_xmlRemoveRef(void) {
25874 xmlDocPtr doc; /* the document */
25876 xmlAttrPtr attr; /* the attribute */
25879 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25880 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25881 mem_base = xmlMemBlocks();
25882 doc = gen_xmlDocPtr(n_doc, 0);
25883 attr = gen_xmlAttrPtr(n_attr, 1);
25885 ret_val = xmlRemoveRef(doc, attr);
25886 desret_int(ret_val);
25888 des_xmlDocPtr(n_doc, doc, 0);
25889 des_xmlAttrPtr(n_attr, attr, 1);
25890 xmlResetLastError();
25891 if (mem_base != xmlMemBlocks()) {
25892 printf("Leak of %d blocks found in xmlRemoveRef",
25893 xmlMemBlocks() - mem_base);
25895 printf(" %d", n_doc);
25896 printf(" %d", n_attr);
25908 test_xmlSnprintfElementContent(void) {
25912 char * buf; /* an output buffer */
25914 int size; /* the buffer size */
25916 xmlElementContentPtr content; /* An element table */
25918 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25921 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25922 for (n_size = 0;n_size < gen_nb_int;n_size++) {
25923 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25924 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25925 mem_base = xmlMemBlocks();
25926 buf = gen_char_ptr(n_buf, 0);
25927 size = gen_int(n_size, 1);
25928 content = gen_xmlElementContentPtr(n_content, 2);
25929 englob = gen_int(n_englob, 3);
25931 xmlSnprintfElementContent(buf, size, content, englob);
25933 des_char_ptr(n_buf, buf, 0);
25934 des_int(n_size, size, 1);
25935 des_xmlElementContentPtr(n_content, content, 2);
25936 des_int(n_englob, englob, 3);
25937 xmlResetLastError();
25938 if (mem_base != xmlMemBlocks()) {
25939 printf("Leak of %d blocks found in xmlSnprintfElementContent",
25940 xmlMemBlocks() - mem_base);
25942 printf(" %d", n_buf);
25943 printf(" %d", n_size);
25944 printf(" %d", n_content);
25945 printf(" %d", n_englob);
25959 test_xmlSprintfElementContent(void) {
25962 #if defined(LIBXML_OUTPUT_ENABLED)
25963 #ifdef LIBXML_OUTPUT_ENABLED
25965 char * buf; /* an output buffer */
25967 xmlElementContentPtr content; /* An element table */
25969 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25972 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25973 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25974 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25975 mem_base = xmlMemBlocks();
25976 buf = gen_char_ptr(n_buf, 0);
25977 content = gen_xmlElementContentPtr(n_content, 1);
25978 englob = gen_int(n_englob, 2);
25980 xmlSprintfElementContent(buf, content, englob);
25982 des_char_ptr(n_buf, buf, 0);
25983 des_xmlElementContentPtr(n_content, content, 1);
25984 des_int(n_englob, englob, 2);
25985 xmlResetLastError();
25986 if (mem_base != xmlMemBlocks()) {
25987 printf("Leak of %d blocks found in xmlSprintfElementContent",
25988 xmlMemBlocks() - mem_base);
25990 printf(" %d", n_buf);
25991 printf(" %d", n_content);
25992 printf(" %d", n_englob);
26007 test_xmlValidBuildContentModel(void) {
26010 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26013 xmlValidCtxtPtr ctxt; /* a validation context */
26015 xmlElementPtr elem; /* an element declaration node */
26018 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26019 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26020 mem_base = xmlMemBlocks();
26021 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26022 elem = gen_xmlElementPtr(n_elem, 1);
26024 ret_val = xmlValidBuildContentModel(ctxt, elem);
26025 desret_int(ret_val);
26027 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26028 des_xmlElementPtr(n_elem, elem, 1);
26029 xmlResetLastError();
26030 if (mem_base != xmlMemBlocks()) {
26031 printf("Leak of %d blocks found in xmlValidBuildContentModel",
26032 xmlMemBlocks() - mem_base);
26034 printf(" %d", n_ctxt);
26035 printf(" %d", n_elem);
26048 test_xmlValidCtxtNormalizeAttributeValue(void) {
26051 #if defined(LIBXML_VALID_ENABLED)
26054 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26056 xmlDocPtr doc; /* the document */
26058 xmlNodePtr elem; /* the parent */
26060 xmlChar * name; /* the attribute name */
26062 xmlChar * value; /* the attribute value */
26065 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26066 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26067 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26068 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26069 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26070 mem_base = xmlMemBlocks();
26071 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26072 doc = gen_xmlDocPtr(n_doc, 1);
26073 elem = gen_xmlNodePtr(n_elem, 2);
26074 name = gen_const_xmlChar_ptr(n_name, 3);
26075 value = gen_const_xmlChar_ptr(n_value, 4);
26077 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26078 desret_xmlChar_ptr(ret_val);
26080 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26081 des_xmlDocPtr(n_doc, doc, 1);
26082 des_xmlNodePtr(n_elem, elem, 2);
26083 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26084 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26085 xmlResetLastError();
26086 if (mem_base != xmlMemBlocks()) {
26087 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26088 xmlMemBlocks() - mem_base);
26090 printf(" %d", n_ctxt);
26091 printf(" %d", n_doc);
26092 printf(" %d", n_elem);
26093 printf(" %d", n_name);
26094 printf(" %d", n_value);
26109 #define gen_nb_xmlElementContent_ptr 1
26110 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26113 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26117 test_xmlValidGetPotentialChildren(void) {
26120 #if defined(LIBXML_VALID_ENABLED)
26121 #ifdef LIBXML_VALID_ENABLED
26124 xmlElementContent * ctree; /* an element content tree */
26126 xmlChar ** names; /* an array to store the list of child names */
26128 int * len; /* a pointer to the number of element in the list */
26130 int max; /* the size of the array */
26133 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26134 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26135 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26136 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26137 mem_base = xmlMemBlocks();
26138 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26139 names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26140 len = gen_int_ptr(n_len, 2);
26141 max = gen_int(n_max, 3);
26143 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26144 desret_int(ret_val);
26146 des_xmlElementContent_ptr(n_ctree, ctree, 0);
26147 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26148 des_int_ptr(n_len, len, 2);
26149 des_int(n_max, max, 3);
26150 xmlResetLastError();
26151 if (mem_base != xmlMemBlocks()) {
26152 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26153 xmlMemBlocks() - mem_base);
26155 printf(" %d", n_ctree);
26156 printf(" %d", n_names);
26157 printf(" %d", n_len);
26158 printf(" %d", n_max);
26174 test_xmlValidGetValidElements(void) {
26177 #if defined(LIBXML_VALID_ENABLED)
26178 #ifdef LIBXML_VALID_ENABLED
26181 xmlNode * prev; /* an element to insert after */
26183 xmlNode * next; /* an element to insert next */
26185 xmlChar ** names; /* an array to store the list of child names */
26187 int max; /* the size of the array */
26190 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26191 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26192 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26193 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26194 mem_base = xmlMemBlocks();
26195 prev = gen_xmlNodePtr(n_prev, 0);
26196 next = gen_xmlNodePtr(n_next, 1);
26197 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26198 max = gen_int(n_max, 3);
26200 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26201 desret_int(ret_val);
26203 des_xmlNodePtr(n_prev, prev, 0);
26204 des_xmlNodePtr(n_next, next, 1);
26205 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26206 des_int(n_max, max, 3);
26207 xmlResetLastError();
26208 if (mem_base != xmlMemBlocks()) {
26209 printf("Leak of %d blocks found in xmlValidGetValidElements",
26210 xmlMemBlocks() - mem_base);
26212 printf(" %d", n_prev);
26213 printf(" %d", n_next);
26214 printf(" %d", n_names);
26215 printf(" %d", n_max);
26231 test_xmlValidNormalizeAttributeValue(void) {
26234 #if defined(LIBXML_VALID_ENABLED)
26237 xmlDocPtr doc; /* the document */
26239 xmlNodePtr elem; /* the parent */
26241 xmlChar * name; /* the attribute name */
26243 xmlChar * value; /* the attribute value */
26246 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26247 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26248 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26249 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26250 mem_base = xmlMemBlocks();
26251 doc = gen_xmlDocPtr(n_doc, 0);
26252 elem = gen_xmlNodePtr(n_elem, 1);
26253 name = gen_const_xmlChar_ptr(n_name, 2);
26254 value = gen_const_xmlChar_ptr(n_value, 3);
26256 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26257 desret_xmlChar_ptr(ret_val);
26259 des_xmlDocPtr(n_doc, doc, 0);
26260 des_xmlNodePtr(n_elem, elem, 1);
26261 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26262 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26263 xmlResetLastError();
26264 if (mem_base != xmlMemBlocks()) {
26265 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26266 xmlMemBlocks() - mem_base);
26268 printf(" %d", n_doc);
26269 printf(" %d", n_elem);
26270 printf(" %d", n_name);
26271 printf(" %d", n_value);
26286 test_xmlValidateAttributeDecl(void) {
26289 #if defined(LIBXML_VALID_ENABLED)
26292 xmlValidCtxtPtr ctxt; /* the validation context */
26294 xmlDocPtr doc; /* a document instance */
26296 xmlAttributePtr attr; /* an attribute definition */
26299 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26300 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26301 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26302 mem_base = xmlMemBlocks();
26303 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26304 doc = gen_xmlDocPtr(n_doc, 1);
26305 attr = gen_xmlAttributePtr(n_attr, 2);
26307 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26308 desret_int(ret_val);
26310 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26311 des_xmlDocPtr(n_doc, doc, 1);
26312 des_xmlAttributePtr(n_attr, attr, 2);
26313 xmlResetLastError();
26314 if (mem_base != xmlMemBlocks()) {
26315 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26316 xmlMemBlocks() - mem_base);
26318 printf(" %d", n_ctxt);
26319 printf(" %d", n_doc);
26320 printf(" %d", n_attr);
26334 test_xmlValidateAttributeValue(void) {
26337 #if defined(LIBXML_VALID_ENABLED)
26340 xmlAttributeType type; /* an attribute type */
26342 xmlChar * value; /* an attribute value */
26345 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26346 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26347 mem_base = xmlMemBlocks();
26348 type = gen_xmlAttributeType(n_type, 0);
26349 value = gen_const_xmlChar_ptr(n_value, 1);
26351 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26352 desret_int(ret_val);
26354 des_xmlAttributeType(n_type, type, 0);
26355 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26356 xmlResetLastError();
26357 if (mem_base != xmlMemBlocks()) {
26358 printf("Leak of %d blocks found in xmlValidateAttributeValue",
26359 xmlMemBlocks() - mem_base);
26361 printf(" %d", n_type);
26362 printf(" %d", n_value);
26375 test_xmlValidateDocument(void) {
26378 #if defined(LIBXML_VALID_ENABLED)
26381 xmlValidCtxtPtr ctxt; /* the validation context */
26383 xmlDocPtr doc; /* a document instance */
26386 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26387 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26388 mem_base = xmlMemBlocks();
26389 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26390 doc = gen_xmlDocPtr(n_doc, 1);
26392 ret_val = xmlValidateDocument(ctxt, doc);
26393 desret_int(ret_val);
26395 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26396 des_xmlDocPtr(n_doc, doc, 1);
26397 xmlResetLastError();
26398 if (mem_base != xmlMemBlocks()) {
26399 printf("Leak of %d blocks found in xmlValidateDocument",
26400 xmlMemBlocks() - mem_base);
26402 printf(" %d", n_ctxt);
26403 printf(" %d", n_doc);
26416 test_xmlValidateDocumentFinal(void) {
26419 #if defined(LIBXML_VALID_ENABLED)
26422 xmlValidCtxtPtr ctxt; /* the validation context */
26424 xmlDocPtr doc; /* a document instance */
26427 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26428 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26429 mem_base = xmlMemBlocks();
26430 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26431 doc = gen_xmlDocPtr(n_doc, 1);
26433 ret_val = xmlValidateDocumentFinal(ctxt, doc);
26434 desret_int(ret_val);
26436 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26437 des_xmlDocPtr(n_doc, doc, 1);
26438 xmlResetLastError();
26439 if (mem_base != xmlMemBlocks()) {
26440 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26441 xmlMemBlocks() - mem_base);
26443 printf(" %d", n_ctxt);
26444 printf(" %d", n_doc);
26457 test_xmlValidateDtd(void) {
26460 #if defined(LIBXML_VALID_ENABLED)
26463 xmlValidCtxtPtr ctxt; /* the validation context */
26465 xmlDocPtr doc; /* a document instance */
26467 xmlDtdPtr dtd; /* a dtd instance */
26470 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26471 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26472 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26473 mem_base = xmlMemBlocks();
26474 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26475 doc = gen_xmlDocPtr(n_doc, 1);
26476 dtd = gen_xmlDtdPtr(n_dtd, 2);
26478 ret_val = xmlValidateDtd(ctxt, doc, dtd);
26479 desret_int(ret_val);
26481 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26482 des_xmlDocPtr(n_doc, doc, 1);
26483 des_xmlDtdPtr(n_dtd, dtd, 2);
26484 xmlResetLastError();
26485 if (mem_base != xmlMemBlocks()) {
26486 printf("Leak of %d blocks found in xmlValidateDtd",
26487 xmlMemBlocks() - mem_base);
26489 printf(" %d", n_ctxt);
26490 printf(" %d", n_doc);
26491 printf(" %d", n_dtd);
26505 test_xmlValidateDtdFinal(void) {
26508 #if defined(LIBXML_VALID_ENABLED)
26511 xmlValidCtxtPtr ctxt; /* the validation context */
26513 xmlDocPtr doc; /* a document instance */
26516 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26517 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26518 mem_base = xmlMemBlocks();
26519 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26520 doc = gen_xmlDocPtr(n_doc, 1);
26522 ret_val = xmlValidateDtdFinal(ctxt, doc);
26523 desret_int(ret_val);
26525 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26526 des_xmlDocPtr(n_doc, doc, 1);
26527 xmlResetLastError();
26528 if (mem_base != xmlMemBlocks()) {
26529 printf("Leak of %d blocks found in xmlValidateDtdFinal",
26530 xmlMemBlocks() - mem_base);
26532 printf(" %d", n_ctxt);
26533 printf(" %d", n_doc);
26546 test_xmlValidateElement(void) {
26549 #if defined(LIBXML_VALID_ENABLED)
26552 xmlValidCtxtPtr ctxt; /* the validation context */
26554 xmlDocPtr doc; /* a document instance */
26556 xmlNodePtr elem; /* an element instance */
26559 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26560 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26561 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26562 mem_base = xmlMemBlocks();
26563 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26564 doc = gen_xmlDocPtr(n_doc, 1);
26565 elem = gen_xmlNodePtr(n_elem, 2);
26567 ret_val = xmlValidateElement(ctxt, doc, elem);
26568 desret_int(ret_val);
26570 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26571 des_xmlDocPtr(n_doc, doc, 1);
26572 des_xmlNodePtr(n_elem, elem, 2);
26573 xmlResetLastError();
26574 if (mem_base != xmlMemBlocks()) {
26575 printf("Leak of %d blocks found in xmlValidateElement",
26576 xmlMemBlocks() - mem_base);
26578 printf(" %d", n_ctxt);
26579 printf(" %d", n_doc);
26580 printf(" %d", n_elem);
26594 test_xmlValidateElementDecl(void) {
26597 #if defined(LIBXML_VALID_ENABLED)
26600 xmlValidCtxtPtr ctxt; /* the validation context */
26602 xmlDocPtr doc; /* a document instance */
26604 xmlElementPtr elem; /* an element definition */
26607 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26608 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26609 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26610 mem_base = xmlMemBlocks();
26611 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26612 doc = gen_xmlDocPtr(n_doc, 1);
26613 elem = gen_xmlElementPtr(n_elem, 2);
26615 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26616 desret_int(ret_val);
26618 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26619 des_xmlDocPtr(n_doc, doc, 1);
26620 des_xmlElementPtr(n_elem, elem, 2);
26621 xmlResetLastError();
26622 if (mem_base != xmlMemBlocks()) {
26623 printf("Leak of %d blocks found in xmlValidateElementDecl",
26624 xmlMemBlocks() - mem_base);
26626 printf(" %d", n_ctxt);
26627 printf(" %d", n_doc);
26628 printf(" %d", n_elem);
26642 test_xmlValidateNameValue(void) {
26645 #if defined(LIBXML_VALID_ENABLED)
26648 xmlChar * value; /* an Name value */
26651 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26652 mem_base = xmlMemBlocks();
26653 value = gen_const_xmlChar_ptr(n_value, 0);
26655 ret_val = xmlValidateNameValue((const xmlChar *)value);
26656 desret_int(ret_val);
26658 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26659 xmlResetLastError();
26660 if (mem_base != xmlMemBlocks()) {
26661 printf("Leak of %d blocks found in xmlValidateNameValue",
26662 xmlMemBlocks() - mem_base);
26664 printf(" %d", n_value);
26676 test_xmlValidateNamesValue(void) {
26679 #if defined(LIBXML_VALID_ENABLED)
26682 xmlChar * value; /* an Names value */
26685 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26686 mem_base = xmlMemBlocks();
26687 value = gen_const_xmlChar_ptr(n_value, 0);
26689 ret_val = xmlValidateNamesValue((const xmlChar *)value);
26690 desret_int(ret_val);
26692 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26693 xmlResetLastError();
26694 if (mem_base != xmlMemBlocks()) {
26695 printf("Leak of %d blocks found in xmlValidateNamesValue",
26696 xmlMemBlocks() - mem_base);
26698 printf(" %d", n_value);
26710 test_xmlValidateNmtokenValue(void) {
26713 #if defined(LIBXML_VALID_ENABLED)
26716 xmlChar * value; /* an Nmtoken value */
26719 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26720 mem_base = xmlMemBlocks();
26721 value = gen_const_xmlChar_ptr(n_value, 0);
26723 ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26724 desret_int(ret_val);
26726 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26727 xmlResetLastError();
26728 if (mem_base != xmlMemBlocks()) {
26729 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26730 xmlMemBlocks() - mem_base);
26732 printf(" %d", n_value);
26744 test_xmlValidateNmtokensValue(void) {
26747 #if defined(LIBXML_VALID_ENABLED)
26750 xmlChar * value; /* an Nmtokens value */
26753 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26754 mem_base = xmlMemBlocks();
26755 value = gen_const_xmlChar_ptr(n_value, 0);
26757 ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26758 desret_int(ret_val);
26760 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26761 xmlResetLastError();
26762 if (mem_base != xmlMemBlocks()) {
26763 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26764 xmlMemBlocks() - mem_base);
26766 printf(" %d", n_value);
26778 test_xmlValidateNotationDecl(void) {
26781 #if defined(LIBXML_VALID_ENABLED)
26784 xmlValidCtxtPtr ctxt; /* the validation context */
26786 xmlDocPtr doc; /* a document instance */
26788 xmlNotationPtr nota; /* a notation definition */
26791 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26792 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26793 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26794 mem_base = xmlMemBlocks();
26795 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26796 doc = gen_xmlDocPtr(n_doc, 1);
26797 nota = gen_xmlNotationPtr(n_nota, 2);
26799 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26800 desret_int(ret_val);
26802 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26803 des_xmlDocPtr(n_doc, doc, 1);
26804 des_xmlNotationPtr(n_nota, nota, 2);
26805 xmlResetLastError();
26806 if (mem_base != xmlMemBlocks()) {
26807 printf("Leak of %d blocks found in xmlValidateNotationDecl",
26808 xmlMemBlocks() - mem_base);
26810 printf(" %d", n_ctxt);
26811 printf(" %d", n_doc);
26812 printf(" %d", n_nota);
26826 test_xmlValidateNotationUse(void) {
26829 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26832 xmlValidCtxtPtr ctxt; /* the validation context */
26834 xmlDocPtr doc; /* the document */
26836 xmlChar * notationName; /* the notation name to check */
26837 int n_notationName;
26839 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26840 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26841 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26842 mem_base = xmlMemBlocks();
26843 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26844 doc = gen_xmlDocPtr(n_doc, 1);
26845 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26847 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26848 desret_int(ret_val);
26850 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26851 des_xmlDocPtr(n_doc, doc, 1);
26852 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26853 xmlResetLastError();
26854 if (mem_base != xmlMemBlocks()) {
26855 printf("Leak of %d blocks found in xmlValidateNotationUse",
26856 xmlMemBlocks() - mem_base);
26858 printf(" %d", n_ctxt);
26859 printf(" %d", n_doc);
26860 printf(" %d", n_notationName);
26874 test_xmlValidateOneAttribute(void) {
26877 #if defined(LIBXML_VALID_ENABLED)
26880 xmlValidCtxtPtr ctxt; /* the validation context */
26882 xmlDocPtr doc; /* a document instance */
26884 xmlNodePtr elem; /* an element instance */
26886 xmlAttrPtr attr; /* an attribute instance */
26888 xmlChar * value; /* the attribute value (without entities processing) */
26891 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26892 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26893 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26894 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26895 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26896 mem_base = xmlMemBlocks();
26897 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26898 doc = gen_xmlDocPtr(n_doc, 1);
26899 elem = gen_xmlNodePtr(n_elem, 2);
26900 attr = gen_xmlAttrPtr(n_attr, 3);
26901 value = gen_const_xmlChar_ptr(n_value, 4);
26903 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26904 desret_int(ret_val);
26906 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26907 des_xmlDocPtr(n_doc, doc, 1);
26908 des_xmlNodePtr(n_elem, elem, 2);
26909 des_xmlAttrPtr(n_attr, attr, 3);
26910 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26911 xmlResetLastError();
26912 if (mem_base != xmlMemBlocks()) {
26913 printf("Leak of %d blocks found in xmlValidateOneAttribute",
26914 xmlMemBlocks() - mem_base);
26916 printf(" %d", n_ctxt);
26917 printf(" %d", n_doc);
26918 printf(" %d", n_elem);
26919 printf(" %d", n_attr);
26920 printf(" %d", n_value);
26936 test_xmlValidateOneElement(void) {
26939 #if defined(LIBXML_VALID_ENABLED)
26942 xmlValidCtxtPtr ctxt; /* the validation context */
26944 xmlDocPtr doc; /* a document instance */
26946 xmlNodePtr elem; /* an element instance */
26949 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26950 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26951 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26952 mem_base = xmlMemBlocks();
26953 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26954 doc = gen_xmlDocPtr(n_doc, 1);
26955 elem = gen_xmlNodePtr(n_elem, 2);
26957 ret_val = xmlValidateOneElement(ctxt, doc, elem);
26958 desret_int(ret_val);
26960 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26961 des_xmlDocPtr(n_doc, doc, 1);
26962 des_xmlNodePtr(n_elem, elem, 2);
26963 xmlResetLastError();
26964 if (mem_base != xmlMemBlocks()) {
26965 printf("Leak of %d blocks found in xmlValidateOneElement",
26966 xmlMemBlocks() - mem_base);
26968 printf(" %d", n_ctxt);
26969 printf(" %d", n_doc);
26970 printf(" %d", n_elem);
26984 test_xmlValidateOneNamespace(void) {
26987 #if defined(LIBXML_VALID_ENABLED)
26990 xmlValidCtxtPtr ctxt; /* the validation context */
26992 xmlDocPtr doc; /* a document instance */
26994 xmlNodePtr elem; /* an element instance */
26996 xmlChar * prefix; /* the namespace prefix */
26998 xmlNsPtr ns; /* an namespace declaration instance */
27000 xmlChar * value; /* the attribute value (without entities processing) */
27003 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27004 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27005 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27006 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
27007 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
27008 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27009 mem_base = xmlMemBlocks();
27010 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27011 doc = gen_xmlDocPtr(n_doc, 1);
27012 elem = gen_xmlNodePtr(n_elem, 2);
27013 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
27014 ns = gen_xmlNsPtr(n_ns, 4);
27015 value = gen_const_xmlChar_ptr(n_value, 5);
27017 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
27018 desret_int(ret_val);
27020 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27021 des_xmlDocPtr(n_doc, doc, 1);
27022 des_xmlNodePtr(n_elem, elem, 2);
27023 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27024 des_xmlNsPtr(n_ns, ns, 4);
27025 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27026 xmlResetLastError();
27027 if (mem_base != xmlMemBlocks()) {
27028 printf("Leak of %d blocks found in xmlValidateOneNamespace",
27029 xmlMemBlocks() - mem_base);
27031 printf(" %d", n_ctxt);
27032 printf(" %d", n_doc);
27033 printf(" %d", n_elem);
27034 printf(" %d", n_prefix);
27035 printf(" %d", n_ns);
27036 printf(" %d", n_value);
27053 test_xmlValidatePopElement(void) {
27056 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27059 xmlValidCtxtPtr ctxt; /* the validation context */
27061 xmlDocPtr doc; /* a document instance */
27063 xmlNodePtr elem; /* an element instance */
27065 xmlChar * qname; /* the qualified name as appearing in the serialization */
27068 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27069 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27070 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27071 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27072 mem_base = xmlMemBlocks();
27073 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27074 doc = gen_xmlDocPtr(n_doc, 1);
27075 elem = gen_xmlNodePtr(n_elem, 2);
27076 qname = gen_const_xmlChar_ptr(n_qname, 3);
27078 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27079 desret_int(ret_val);
27081 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27082 des_xmlDocPtr(n_doc, doc, 1);
27083 des_xmlNodePtr(n_elem, elem, 2);
27084 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27085 xmlResetLastError();
27086 if (mem_base != xmlMemBlocks()) {
27087 printf("Leak of %d blocks found in xmlValidatePopElement",
27088 xmlMemBlocks() - mem_base);
27090 printf(" %d", n_ctxt);
27091 printf(" %d", n_doc);
27092 printf(" %d", n_elem);
27093 printf(" %d", n_qname);
27108 test_xmlValidatePushCData(void) {
27111 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27114 xmlValidCtxtPtr ctxt; /* the validation context */
27116 xmlChar * data; /* some character data read */
27118 int len; /* the length of the data */
27121 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27122 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27123 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27124 mem_base = xmlMemBlocks();
27125 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27126 data = gen_const_xmlChar_ptr(n_data, 1);
27127 len = gen_int(n_len, 2);
27129 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27130 desret_int(ret_val);
27132 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27133 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27134 des_int(n_len, len, 2);
27135 xmlResetLastError();
27136 if (mem_base != xmlMemBlocks()) {
27137 printf("Leak of %d blocks found in xmlValidatePushCData",
27138 xmlMemBlocks() - mem_base);
27140 printf(" %d", n_ctxt);
27141 printf(" %d", n_data);
27142 printf(" %d", n_len);
27156 test_xmlValidatePushElement(void) {
27159 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27162 xmlValidCtxtPtr ctxt; /* the validation context */
27164 xmlDocPtr doc; /* a document instance */
27166 xmlNodePtr elem; /* an element instance */
27168 xmlChar * qname; /* the qualified name as appearing in the serialization */
27171 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27173 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27174 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27175 mem_base = xmlMemBlocks();
27176 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27177 doc = gen_xmlDocPtr(n_doc, 1);
27178 elem = gen_xmlNodePtr(n_elem, 2);
27179 qname = gen_const_xmlChar_ptr(n_qname, 3);
27181 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27182 desret_int(ret_val);
27184 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27185 des_xmlDocPtr(n_doc, doc, 1);
27186 des_xmlNodePtr(n_elem, elem, 2);
27187 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27188 xmlResetLastError();
27189 if (mem_base != xmlMemBlocks()) {
27190 printf("Leak of %d blocks found in xmlValidatePushElement",
27191 xmlMemBlocks() - mem_base);
27193 printf(" %d", n_ctxt);
27194 printf(" %d", n_doc);
27195 printf(" %d", n_elem);
27196 printf(" %d", n_qname);
27211 test_xmlValidateRoot(void) {
27214 #if defined(LIBXML_VALID_ENABLED)
27217 xmlValidCtxtPtr ctxt; /* the validation context */
27219 xmlDocPtr doc; /* a document instance */
27222 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27223 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27224 mem_base = xmlMemBlocks();
27225 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27226 doc = gen_xmlDocPtr(n_doc, 1);
27228 ret_val = xmlValidateRoot(ctxt, doc);
27229 desret_int(ret_val);
27231 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27232 des_xmlDocPtr(n_doc, doc, 1);
27233 xmlResetLastError();
27234 if (mem_base != xmlMemBlocks()) {
27235 printf("Leak of %d blocks found in xmlValidateRoot",
27236 xmlMemBlocks() - mem_base);
27238 printf(" %d", n_ctxt);
27239 printf(" %d", n_doc);
27254 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27255 test_ret += test_xmlAddAttributeDecl();
27256 test_ret += test_xmlAddElementDecl();
27257 test_ret += test_xmlAddID();
27258 test_ret += test_xmlAddNotationDecl();
27259 test_ret += test_xmlAddRef();
27260 test_ret += test_xmlCopyAttributeTable();
27261 test_ret += test_xmlCopyDocElementContent();
27262 test_ret += test_xmlCopyElementContent();
27263 test_ret += test_xmlCopyElementTable();
27264 test_ret += test_xmlCopyEnumeration();
27265 test_ret += test_xmlCopyNotationTable();
27266 test_ret += test_xmlCreateEnumeration();
27267 test_ret += test_xmlDumpAttributeDecl();
27268 test_ret += test_xmlDumpAttributeTable();
27269 test_ret += test_xmlDumpElementDecl();
27270 test_ret += test_xmlDumpElementTable();
27271 test_ret += test_xmlDumpNotationDecl();
27272 test_ret += test_xmlDumpNotationTable();
27273 test_ret += test_xmlGetDtdAttrDesc();
27274 test_ret += test_xmlGetDtdElementDesc();
27275 test_ret += test_xmlGetDtdNotationDesc();
27276 test_ret += test_xmlGetDtdQAttrDesc();
27277 test_ret += test_xmlGetDtdQElementDesc();
27278 test_ret += test_xmlGetID();
27279 test_ret += test_xmlGetRefs();
27280 test_ret += test_xmlIsID();
27281 test_ret += test_xmlIsMixedElement();
27282 test_ret += test_xmlIsRef();
27283 test_ret += test_xmlNewDocElementContent();
27284 test_ret += test_xmlNewElementContent();
27285 test_ret += test_xmlNewValidCtxt();
27286 test_ret += test_xmlRemoveID();
27287 test_ret += test_xmlRemoveRef();
27288 test_ret += test_xmlSnprintfElementContent();
27289 test_ret += test_xmlSprintfElementContent();
27290 test_ret += test_xmlValidBuildContentModel();
27291 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27292 test_ret += test_xmlValidGetPotentialChildren();
27293 test_ret += test_xmlValidGetValidElements();
27294 test_ret += test_xmlValidNormalizeAttributeValue();
27295 test_ret += test_xmlValidateAttributeDecl();
27296 test_ret += test_xmlValidateAttributeValue();
27297 test_ret += test_xmlValidateDocument();
27298 test_ret += test_xmlValidateDocumentFinal();
27299 test_ret += test_xmlValidateDtd();
27300 test_ret += test_xmlValidateDtdFinal();
27301 test_ret += test_xmlValidateElement();
27302 test_ret += test_xmlValidateElementDecl();
27303 test_ret += test_xmlValidateNameValue();
27304 test_ret += test_xmlValidateNamesValue();
27305 test_ret += test_xmlValidateNmtokenValue();
27306 test_ret += test_xmlValidateNmtokensValue();
27307 test_ret += test_xmlValidateNotationDecl();
27308 test_ret += test_xmlValidateNotationUse();
27309 test_ret += test_xmlValidateOneAttribute();
27310 test_ret += test_xmlValidateOneElement();
27311 test_ret += test_xmlValidateOneNamespace();
27312 test_ret += test_xmlValidatePopElement();
27313 test_ret += test_xmlValidatePushCData();
27314 test_ret += test_xmlValidatePushElement();
27315 test_ret += test_xmlValidateRoot();
27318 printf("Module valid: %d errors\n", test_ret);
27323 test_xmlXIncludeNewContext(void) {
27327 /* missing type support */
27333 test_xmlXIncludeProcess(void) {
27336 #if defined(LIBXML_XINCLUDE_ENABLED)
27339 xmlDocPtr doc; /* an XML document */
27342 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27343 mem_base = xmlMemBlocks();
27344 doc = gen_xmlDocPtr(n_doc, 0);
27346 ret_val = xmlXIncludeProcess(doc);
27347 desret_int(ret_val);
27349 des_xmlDocPtr(n_doc, doc, 0);
27350 xmlResetLastError();
27351 if (mem_base != xmlMemBlocks()) {
27352 printf("Leak of %d blocks found in xmlXIncludeProcess",
27353 xmlMemBlocks() - mem_base);
27355 printf(" %d", n_doc);
27367 test_xmlXIncludeProcessFlags(void) {
27370 #if defined(LIBXML_XINCLUDE_ENABLED)
27373 xmlDocPtr doc; /* an XML document */
27375 int flags; /* a set of xmlParserOption used for parsing XML includes */
27378 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27379 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27380 mem_base = xmlMemBlocks();
27381 doc = gen_xmlDocPtr(n_doc, 0);
27382 flags = gen_int(n_flags, 1);
27384 ret_val = xmlXIncludeProcessFlags(doc, flags);
27385 desret_int(ret_val);
27387 des_xmlDocPtr(n_doc, doc, 0);
27388 des_int(n_flags, flags, 1);
27389 xmlResetLastError();
27390 if (mem_base != xmlMemBlocks()) {
27391 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27392 xmlMemBlocks() - mem_base);
27394 printf(" %d", n_doc);
27395 printf(" %d", n_flags);
27408 test_xmlXIncludeProcessFlagsData(void) {
27411 #if defined(LIBXML_XINCLUDE_ENABLED)
27414 xmlDocPtr doc; /* an XML document */
27416 int flags; /* a set of xmlParserOption used for parsing XML includes */
27418 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27421 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27422 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27423 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27424 mem_base = xmlMemBlocks();
27425 doc = gen_xmlDocPtr(n_doc, 0);
27426 flags = gen_int(n_flags, 1);
27427 data = gen_userdata(n_data, 2);
27429 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27430 desret_int(ret_val);
27432 des_xmlDocPtr(n_doc, doc, 0);
27433 des_int(n_flags, flags, 1);
27434 des_userdata(n_data, data, 2);
27435 xmlResetLastError();
27436 if (mem_base != xmlMemBlocks()) {
27437 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27438 xmlMemBlocks() - mem_base);
27440 printf(" %d", n_doc);
27441 printf(" %d", n_flags);
27442 printf(" %d", n_data);
27454 #ifdef LIBXML_XINCLUDE_ENABLED
27456 #define gen_nb_xmlXIncludeCtxtPtr 1
27457 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27460 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27466 test_xmlXIncludeProcessNode(void) {
27469 #if defined(LIBXML_XINCLUDE_ENABLED)
27472 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27474 xmlNodePtr node; /* a node in an XML document */
27477 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27478 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27479 mem_base = xmlMemBlocks();
27480 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27481 node = gen_xmlNodePtr(n_node, 1);
27483 ret_val = xmlXIncludeProcessNode(ctxt, node);
27484 desret_int(ret_val);
27486 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27487 des_xmlNodePtr(n_node, node, 1);
27488 xmlResetLastError();
27489 if (mem_base != xmlMemBlocks()) {
27490 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27491 xmlMemBlocks() - mem_base);
27493 printf(" %d", n_ctxt);
27494 printf(" %d", n_node);
27507 test_xmlXIncludeProcessTree(void) {
27510 #if defined(LIBXML_XINCLUDE_ENABLED)
27513 xmlNodePtr tree; /* a node in an XML document */
27516 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27517 mem_base = xmlMemBlocks();
27518 tree = gen_xmlNodePtr(n_tree, 0);
27520 ret_val = xmlXIncludeProcessTree(tree);
27521 desret_int(ret_val);
27523 des_xmlNodePtr(n_tree, tree, 0);
27524 xmlResetLastError();
27525 if (mem_base != xmlMemBlocks()) {
27526 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27527 xmlMemBlocks() - mem_base);
27529 printf(" %d", n_tree);
27541 test_xmlXIncludeProcessTreeFlags(void) {
27544 #if defined(LIBXML_XINCLUDE_ENABLED)
27547 xmlNodePtr tree; /* a node in an XML document */
27549 int flags; /* a set of xmlParserOption used for parsing XML includes */
27552 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27553 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27554 mem_base = xmlMemBlocks();
27555 tree = gen_xmlNodePtr(n_tree, 0);
27556 flags = gen_int(n_flags, 1);
27558 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27559 desret_int(ret_val);
27561 des_xmlNodePtr(n_tree, tree, 0);
27562 des_int(n_flags, flags, 1);
27563 xmlResetLastError();
27564 if (mem_base != xmlMemBlocks()) {
27565 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27566 xmlMemBlocks() - mem_base);
27568 printf(" %d", n_tree);
27569 printf(" %d", n_flags);
27582 test_xmlXIncludeProcessTreeFlagsData(void) {
27585 #if defined(LIBXML_XINCLUDE_ENABLED)
27588 xmlNodePtr tree; /* an XML node */
27590 int flags; /* a set of xmlParserOption used for parsing XML includes */
27592 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27595 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27596 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27597 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27598 mem_base = xmlMemBlocks();
27599 tree = gen_xmlNodePtr(n_tree, 0);
27600 flags = gen_int(n_flags, 1);
27601 data = gen_userdata(n_data, 2);
27603 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27604 desret_int(ret_val);
27606 des_xmlNodePtr(n_tree, tree, 0);
27607 des_int(n_flags, flags, 1);
27608 des_userdata(n_data, data, 2);
27609 xmlResetLastError();
27610 if (mem_base != xmlMemBlocks()) {
27611 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27612 xmlMemBlocks() - mem_base);
27614 printf(" %d", n_tree);
27615 printf(" %d", n_flags);
27616 printf(" %d", n_data);
27630 test_xmlXIncludeSetFlags(void) {
27633 #if defined(LIBXML_XINCLUDE_ENABLED)
27636 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27638 int flags; /* a set of xmlParserOption used for parsing XML includes */
27641 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27642 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27643 mem_base = xmlMemBlocks();
27644 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27645 flags = gen_int(n_flags, 1);
27647 ret_val = xmlXIncludeSetFlags(ctxt, flags);
27648 desret_int(ret_val);
27650 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27651 des_int(n_flags, flags, 1);
27652 xmlResetLastError();
27653 if (mem_base != xmlMemBlocks()) {
27654 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27655 xmlMemBlocks() - mem_base);
27657 printf(" %d", n_ctxt);
27658 printf(" %d", n_flags);
27670 test_xinclude(void) {
27673 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27674 test_ret += test_xmlXIncludeNewContext();
27675 test_ret += test_xmlXIncludeProcess();
27676 test_ret += test_xmlXIncludeProcessFlags();
27677 test_ret += test_xmlXIncludeProcessFlagsData();
27678 test_ret += test_xmlXIncludeProcessNode();
27679 test_ret += test_xmlXIncludeProcessTree();
27680 test_ret += test_xmlXIncludeProcessTreeFlags();
27681 test_ret += test_xmlXIncludeProcessTreeFlagsData();
27682 test_ret += test_xmlXIncludeSetFlags();
27685 printf("Module xinclude: %d errors\n", test_ret);
27690 test_xmlAllocOutputBuffer(void) {
27693 #if defined(LIBXML_OUTPUT_ENABLED)
27695 xmlOutputBufferPtr ret_val;
27696 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27699 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27700 mem_base = xmlMemBlocks();
27701 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27703 ret_val = xmlAllocOutputBuffer(encoder);
27704 desret_xmlOutputBufferPtr(ret_val);
27706 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27707 xmlResetLastError();
27708 if (mem_base != xmlMemBlocks()) {
27709 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27710 xmlMemBlocks() - mem_base);
27712 printf(" %d", n_encoder);
27724 test_xmlAllocParserInputBuffer(void) {
27728 xmlParserInputBufferPtr ret_val;
27729 xmlCharEncoding enc; /* the charset encoding if known */
27732 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27733 mem_base = xmlMemBlocks();
27734 enc = gen_xmlCharEncoding(n_enc, 0);
27736 ret_val = xmlAllocParserInputBuffer(enc);
27737 desret_xmlParserInputBufferPtr(ret_val);
27739 des_xmlCharEncoding(n_enc, enc, 0);
27740 xmlResetLastError();
27741 if (mem_base != xmlMemBlocks()) {
27742 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27743 xmlMemBlocks() - mem_base);
27745 printf(" %d", n_enc);
27756 test_xmlCheckFilename(void) {
27761 char * path; /* the path to check */
27764 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27765 mem_base = xmlMemBlocks();
27766 path = gen_const_char_ptr(n_path, 0);
27768 ret_val = xmlCheckFilename((const char *)path);
27769 desret_int(ret_val);
27771 des_const_char_ptr(n_path, (const char *)path, 0);
27772 xmlResetLastError();
27773 if (mem_base != xmlMemBlocks()) {
27774 printf("Leak of %d blocks found in xmlCheckFilename",
27775 xmlMemBlocks() - mem_base);
27777 printf(" %d", n_path);
27788 test_xmlCheckHTTPInput(void) {
27792 xmlParserInputPtr ret_val;
27793 xmlParserCtxtPtr ctxt; /* an XML parser context */
27795 xmlParserInputPtr ret; /* an XML parser input */
27798 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27799 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27800 mem_base = xmlMemBlocks();
27801 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27802 ret = gen_xmlParserInputPtr(n_ret, 1);
27804 ret_val = xmlCheckHTTPInput(ctxt, ret);
27805 desret_xmlParserInputPtr(ret_val);
27807 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27808 des_xmlParserInputPtr(n_ret, ret, 1);
27809 xmlResetLastError();
27810 if (mem_base != xmlMemBlocks()) {
27811 printf("Leak of %d blocks found in xmlCheckHTTPInput",
27812 xmlMemBlocks() - mem_base);
27814 printf(" %d", n_ctxt);
27815 printf(" %d", n_ret);
27827 test_xmlCleanupInputCallbacks(void) {
27832 mem_base = xmlMemBlocks();
27834 xmlCleanupInputCallbacks();
27836 xmlResetLastError();
27837 if (mem_base != xmlMemBlocks()) {
27838 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27839 xmlMemBlocks() - mem_base);
27850 test_xmlCleanupOutputCallbacks(void) {
27853 #if defined(LIBXML_OUTPUT_ENABLED)
27856 mem_base = xmlMemBlocks();
27858 xmlCleanupOutputCallbacks();
27860 xmlResetLastError();
27861 if (mem_base != xmlMemBlocks()) {
27862 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27863 xmlMemBlocks() - mem_base);
27875 test_xmlFileClose(void) {
27880 void * context; /* the I/O context */
27883 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27884 mem_base = xmlMemBlocks();
27885 context = gen_void_ptr(n_context, 0);
27887 ret_val = xmlFileClose(context);
27888 desret_int(ret_val);
27890 des_void_ptr(n_context, context, 0);
27891 xmlResetLastError();
27892 if (mem_base != xmlMemBlocks()) {
27893 printf("Leak of %d blocks found in xmlFileClose",
27894 xmlMemBlocks() - mem_base);
27896 printf(" %d", n_context);
27907 test_xmlFileMatch(void) {
27912 const char * filename; /* the URI for matching */
27915 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27916 mem_base = xmlMemBlocks();
27917 filename = gen_filepath(n_filename, 0);
27919 ret_val = xmlFileMatch(filename);
27920 desret_int(ret_val);
27922 des_filepath(n_filename, filename, 0);
27923 xmlResetLastError();
27924 if (mem_base != xmlMemBlocks()) {
27925 printf("Leak of %d blocks found in xmlFileMatch",
27926 xmlMemBlocks() - mem_base);
27928 printf(" %d", n_filename);
27939 test_xmlFileOpen(void) {
27944 const char * filename; /* the URI for matching */
27947 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27948 mem_base = xmlMemBlocks();
27949 filename = gen_filepath(n_filename, 0);
27951 ret_val = xmlFileOpen(filename);
27952 desret_void_ptr(ret_val);
27954 des_filepath(n_filename, filename, 0);
27955 xmlResetLastError();
27956 if (mem_base != xmlMemBlocks()) {
27957 printf("Leak of %d blocks found in xmlFileOpen",
27958 xmlMemBlocks() - mem_base);
27960 printf(" %d", n_filename);
27971 test_xmlFileRead(void) {
27976 void * context; /* the I/O context */
27978 char * buffer; /* where to drop data */
27980 int len; /* number of bytes to write */
27983 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27984 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27985 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27986 mem_base = xmlMemBlocks();
27987 context = gen_void_ptr(n_context, 0);
27988 buffer = gen_char_ptr(n_buffer, 1);
27989 len = gen_int(n_len, 2);
27991 ret_val = xmlFileRead(context, buffer, len);
27992 desret_int(ret_val);
27994 des_void_ptr(n_context, context, 0);
27995 des_char_ptr(n_buffer, buffer, 1);
27996 des_int(n_len, len, 2);
27997 xmlResetLastError();
27998 if (mem_base != xmlMemBlocks()) {
27999 printf("Leak of %d blocks found in xmlFileRead",
28000 xmlMemBlocks() - mem_base);
28002 printf(" %d", n_context);
28003 printf(" %d", n_buffer);
28004 printf(" %d", n_len);
28017 test_xmlIOFTPClose(void) {
28020 #if defined(LIBXML_FTP_ENABLED)
28023 void * context; /* the I/O context */
28026 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28027 mem_base = xmlMemBlocks();
28028 context = gen_void_ptr(n_context, 0);
28030 ret_val = xmlIOFTPClose(context);
28031 desret_int(ret_val);
28033 des_void_ptr(n_context, context, 0);
28034 xmlResetLastError();
28035 if (mem_base != xmlMemBlocks()) {
28036 printf("Leak of %d blocks found in xmlIOFTPClose",
28037 xmlMemBlocks() - mem_base);
28039 printf(" %d", n_context);
28051 test_xmlIOFTPMatch(void) {
28054 #if defined(LIBXML_FTP_ENABLED)
28057 const char * filename; /* the URI for matching */
28060 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28061 mem_base = xmlMemBlocks();
28062 filename = gen_filepath(n_filename, 0);
28064 ret_val = xmlIOFTPMatch(filename);
28065 desret_int(ret_val);
28067 des_filepath(n_filename, filename, 0);
28068 xmlResetLastError();
28069 if (mem_base != xmlMemBlocks()) {
28070 printf("Leak of %d blocks found in xmlIOFTPMatch",
28071 xmlMemBlocks() - mem_base);
28073 printf(" %d", n_filename);
28085 test_xmlIOFTPOpen(void) {
28088 #if defined(LIBXML_FTP_ENABLED)
28091 const char * filename; /* the URI for matching */
28094 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28095 mem_base = xmlMemBlocks();
28096 filename = gen_filepath(n_filename, 0);
28098 ret_val = xmlIOFTPOpen(filename);
28099 desret_void_ptr(ret_val);
28101 des_filepath(n_filename, filename, 0);
28102 xmlResetLastError();
28103 if (mem_base != xmlMemBlocks()) {
28104 printf("Leak of %d blocks found in xmlIOFTPOpen",
28105 xmlMemBlocks() - mem_base);
28107 printf(" %d", n_filename);
28119 test_xmlIOFTPRead(void) {
28122 #if defined(LIBXML_FTP_ENABLED)
28125 void * context; /* the I/O context */
28127 char * buffer; /* where to drop data */
28129 int len; /* number of bytes to write */
28132 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28133 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28134 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28135 mem_base = xmlMemBlocks();
28136 context = gen_void_ptr(n_context, 0);
28137 buffer = gen_char_ptr(n_buffer, 1);
28138 len = gen_int(n_len, 2);
28140 ret_val = xmlIOFTPRead(context, buffer, len);
28141 desret_int(ret_val);
28143 des_void_ptr(n_context, context, 0);
28144 des_char_ptr(n_buffer, buffer, 1);
28145 des_int(n_len, len, 2);
28146 xmlResetLastError();
28147 if (mem_base != xmlMemBlocks()) {
28148 printf("Leak of %d blocks found in xmlIOFTPRead",
28149 xmlMemBlocks() - mem_base);
28151 printf(" %d", n_context);
28152 printf(" %d", n_buffer);
28153 printf(" %d", n_len);
28167 test_xmlIOHTTPClose(void) {
28170 #if defined(LIBXML_HTTP_ENABLED)
28173 void * context; /* the I/O context */
28176 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28177 mem_base = xmlMemBlocks();
28178 context = gen_void_ptr(n_context, 0);
28180 ret_val = xmlIOHTTPClose(context);
28181 desret_int(ret_val);
28183 des_void_ptr(n_context, context, 0);
28184 xmlResetLastError();
28185 if (mem_base != xmlMemBlocks()) {
28186 printf("Leak of %d blocks found in xmlIOHTTPClose",
28187 xmlMemBlocks() - mem_base);
28189 printf(" %d", n_context);
28201 test_xmlIOHTTPMatch(void) {
28204 #if defined(LIBXML_HTTP_ENABLED)
28207 const char * filename; /* the URI for matching */
28210 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28211 mem_base = xmlMemBlocks();
28212 filename = gen_filepath(n_filename, 0);
28214 ret_val = xmlIOHTTPMatch(filename);
28215 desret_int(ret_val);
28217 des_filepath(n_filename, filename, 0);
28218 xmlResetLastError();
28219 if (mem_base != xmlMemBlocks()) {
28220 printf("Leak of %d blocks found in xmlIOHTTPMatch",
28221 xmlMemBlocks() - mem_base);
28223 printf(" %d", n_filename);
28235 test_xmlIOHTTPOpen(void) {
28238 #if defined(LIBXML_HTTP_ENABLED)
28241 const char * filename; /* the URI for matching */
28244 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28245 mem_base = xmlMemBlocks();
28246 filename = gen_filepath(n_filename, 0);
28248 ret_val = xmlIOHTTPOpen(filename);
28249 desret_xmlNanoHTTPCtxtPtr(ret_val);
28251 des_filepath(n_filename, filename, 0);
28252 xmlResetLastError();
28253 if (mem_base != xmlMemBlocks()) {
28254 printf("Leak of %d blocks found in xmlIOHTTPOpen",
28255 xmlMemBlocks() - mem_base);
28257 printf(" %d", n_filename);
28269 test_xmlIOHTTPRead(void) {
28272 #if defined(LIBXML_HTTP_ENABLED)
28275 void * context; /* the I/O context */
28277 char * buffer; /* where to drop data */
28279 int len; /* number of bytes to write */
28282 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28283 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28284 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28285 mem_base = xmlMemBlocks();
28286 context = gen_void_ptr(n_context, 0);
28287 buffer = gen_char_ptr(n_buffer, 1);
28288 len = gen_int(n_len, 2);
28290 ret_val = xmlIOHTTPRead(context, buffer, len);
28291 desret_int(ret_val);
28293 des_void_ptr(n_context, context, 0);
28294 des_char_ptr(n_buffer, buffer, 1);
28295 des_int(n_len, len, 2);
28296 xmlResetLastError();
28297 if (mem_base != xmlMemBlocks()) {
28298 printf("Leak of %d blocks found in xmlIOHTTPRead",
28299 xmlMemBlocks() - mem_base);
28301 printf(" %d", n_context);
28302 printf(" %d", n_buffer);
28303 printf(" %d", n_len);
28317 test_xmlNoNetExternalEntityLoader(void) {
28321 xmlParserInputPtr ret_val;
28322 const char * URL; /* the URL for the entity to load */
28324 char * ID; /* the System ID for the entity to load */
28326 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28329 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28330 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28331 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28332 mem_base = xmlMemBlocks();
28333 URL = gen_filepath(n_URL, 0);
28334 ID = gen_const_char_ptr(n_ID, 1);
28335 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28337 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28338 desret_xmlParserInputPtr(ret_val);
28340 des_filepath(n_URL, URL, 0);
28341 des_const_char_ptr(n_ID, (const char *)ID, 1);
28342 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28343 xmlResetLastError();
28344 if (mem_base != xmlMemBlocks()) {
28345 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28346 xmlMemBlocks() - mem_base);
28348 printf(" %d", n_URL);
28349 printf(" %d", n_ID);
28350 printf(" %d", n_ctxt);
28363 test_xmlNormalizeWindowsPath(void) {
28368 xmlChar * path; /* the input file path */
28371 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28372 mem_base = xmlMemBlocks();
28373 path = gen_const_xmlChar_ptr(n_path, 0);
28375 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28376 desret_xmlChar_ptr(ret_val);
28378 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28379 xmlResetLastError();
28380 if (mem_base != xmlMemBlocks()) {
28381 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28382 xmlMemBlocks() - mem_base);
28384 printf(" %d", n_path);
28395 test_xmlOutputBufferCreateBuffer(void) {
28398 #if defined(LIBXML_OUTPUT_ENABLED)
28400 xmlOutputBufferPtr ret_val;
28401 xmlBufferPtr buffer; /* a xmlBufferPtr */
28403 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28406 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28407 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28408 mem_base = xmlMemBlocks();
28409 buffer = gen_xmlBufferPtr(n_buffer, 0);
28410 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28412 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28413 desret_xmlOutputBufferPtr(ret_val);
28415 des_xmlBufferPtr(n_buffer, buffer, 0);
28416 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28417 xmlResetLastError();
28418 if (mem_base != xmlMemBlocks()) {
28419 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28420 xmlMemBlocks() - mem_base);
28422 printf(" %d", n_buffer);
28423 printf(" %d", n_encoder);
28436 test_xmlOutputBufferCreateFd(void) {
28439 #if defined(LIBXML_OUTPUT_ENABLED)
28441 xmlOutputBufferPtr ret_val;
28442 int fd; /* a file descriptor number */
28444 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28447 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28448 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28449 mem_base = xmlMemBlocks();
28450 fd = gen_int(n_fd, 0);
28451 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28453 ret_val = xmlOutputBufferCreateFd(fd, encoder);
28454 desret_xmlOutputBufferPtr(ret_val);
28456 des_int(n_fd, fd, 0);
28457 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28458 xmlResetLastError();
28459 if (mem_base != xmlMemBlocks()) {
28460 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28461 xmlMemBlocks() - mem_base);
28463 printf(" %d", n_fd);
28464 printf(" %d", n_encoder);
28477 test_xmlOutputBufferCreateFile(void) {
28480 #if defined(LIBXML_OUTPUT_ENABLED)
28482 xmlOutputBufferPtr ret_val;
28483 FILE * file; /* a FILE* */
28485 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28488 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28489 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28490 mem_base = xmlMemBlocks();
28491 file = gen_FILE_ptr(n_file, 0);
28492 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28494 ret_val = xmlOutputBufferCreateFile(file, encoder);
28495 desret_xmlOutputBufferPtr(ret_val);
28497 des_FILE_ptr(n_file, file, 0);
28498 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28499 xmlResetLastError();
28500 if (mem_base != xmlMemBlocks()) {
28501 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28502 xmlMemBlocks() - mem_base);
28504 printf(" %d", n_file);
28505 printf(" %d", n_encoder);
28518 test_xmlOutputBufferCreateFilename(void) {
28521 #if defined(LIBXML_OUTPUT_ENABLED)
28523 xmlOutputBufferPtr ret_val;
28524 const char * URI; /* a C string containing the URI or filename */
28526 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28528 int compression; /* the compression ration (0 none, 9 max). */
28531 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28532 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28533 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28534 mem_base = xmlMemBlocks();
28535 URI = gen_fileoutput(n_URI, 0);
28536 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28537 compression = gen_int(n_compression, 2);
28539 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28540 desret_xmlOutputBufferPtr(ret_val);
28542 des_fileoutput(n_URI, URI, 0);
28543 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28544 des_int(n_compression, compression, 2);
28545 xmlResetLastError();
28546 if (mem_base != xmlMemBlocks()) {
28547 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28548 xmlMemBlocks() - mem_base);
28550 printf(" %d", n_URI);
28551 printf(" %d", n_encoder);
28552 printf(" %d", n_compression);
28566 test_xmlOutputBufferFlush(void) {
28569 #if defined(LIBXML_OUTPUT_ENABLED)
28572 xmlOutputBufferPtr out; /* a buffered output */
28575 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28576 mem_base = xmlMemBlocks();
28577 out = gen_xmlOutputBufferPtr(n_out, 0);
28579 ret_val = xmlOutputBufferFlush(out);
28580 desret_int(ret_val);
28582 des_xmlOutputBufferPtr(n_out, out, 0);
28583 xmlResetLastError();
28584 if (mem_base != xmlMemBlocks()) {
28585 printf("Leak of %d blocks found in xmlOutputBufferFlush",
28586 xmlMemBlocks() - mem_base);
28588 printf(" %d", n_out);
28600 test_xmlOutputBufferGetContent(void) {
28603 #if defined(LIBXML_OUTPUT_ENABLED)
28605 const xmlChar * ret_val;
28606 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28609 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28610 mem_base = xmlMemBlocks();
28611 out = gen_xmlOutputBufferPtr(n_out, 0);
28613 ret_val = xmlOutputBufferGetContent(out);
28614 desret_const_xmlChar_ptr(ret_val);
28616 des_xmlOutputBufferPtr(n_out, out, 0);
28617 xmlResetLastError();
28618 if (mem_base != xmlMemBlocks()) {
28619 printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28620 xmlMemBlocks() - mem_base);
28622 printf(" %d", n_out);
28634 test_xmlOutputBufferGetSize(void) {
28638 /* missing type support */
28644 test_xmlOutputBufferWrite(void) {
28647 #if defined(LIBXML_OUTPUT_ENABLED)
28650 xmlOutputBufferPtr out; /* a buffered parser output */
28652 int len; /* the size in bytes of the array. */
28654 char * buf; /* an char array */
28657 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28658 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28659 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28660 mem_base = xmlMemBlocks();
28661 out = gen_xmlOutputBufferPtr(n_out, 0);
28662 len = gen_int(n_len, 1);
28663 buf = gen_const_char_ptr(n_buf, 2);
28665 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28666 desret_int(ret_val);
28668 des_xmlOutputBufferPtr(n_out, out, 0);
28669 des_int(n_len, len, 1);
28670 des_const_char_ptr(n_buf, (const char *)buf, 2);
28671 xmlResetLastError();
28672 if (mem_base != xmlMemBlocks()) {
28673 printf("Leak of %d blocks found in xmlOutputBufferWrite",
28674 xmlMemBlocks() - mem_base);
28676 printf(" %d", n_out);
28677 printf(" %d", n_len);
28678 printf(" %d", n_buf);
28692 test_xmlOutputBufferWriteEscape(void) {
28696 /* missing type support */
28702 test_xmlOutputBufferWriteString(void) {
28705 #if defined(LIBXML_OUTPUT_ENABLED)
28708 xmlOutputBufferPtr out; /* a buffered parser output */
28710 char * str; /* a zero terminated C string */
28713 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28714 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28715 mem_base = xmlMemBlocks();
28716 out = gen_xmlOutputBufferPtr(n_out, 0);
28717 str = gen_const_char_ptr(n_str, 1);
28719 ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28720 desret_int(ret_val);
28722 des_xmlOutputBufferPtr(n_out, out, 0);
28723 des_const_char_ptr(n_str, (const char *)str, 1);
28724 xmlResetLastError();
28725 if (mem_base != xmlMemBlocks()) {
28726 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28727 xmlMemBlocks() - mem_base);
28729 printf(" %d", n_out);
28730 printf(" %d", n_str);
28743 test_xmlParserGetDirectory(void) {
28747 /* missing type support */
28753 test_xmlParserInputBufferCreateFd(void) {
28757 xmlParserInputBufferPtr ret_val;
28758 int fd; /* a file descriptor number */
28760 xmlCharEncoding enc; /* the charset encoding if known */
28763 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28764 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28765 mem_base = xmlMemBlocks();
28766 fd = gen_int(n_fd, 0);
28767 enc = gen_xmlCharEncoding(n_enc, 1);
28768 if (fd >= 0) fd = -1;
28770 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28771 desret_xmlParserInputBufferPtr(ret_val);
28773 des_int(n_fd, fd, 0);
28774 des_xmlCharEncoding(n_enc, enc, 1);
28775 xmlResetLastError();
28776 if (mem_base != xmlMemBlocks()) {
28777 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28778 xmlMemBlocks() - mem_base);
28780 printf(" %d", n_fd);
28781 printf(" %d", n_enc);
28793 test_xmlParserInputBufferCreateFile(void) {
28797 xmlParserInputBufferPtr ret_val;
28798 FILE * file; /* a FILE* */
28800 xmlCharEncoding enc; /* the charset encoding if known */
28803 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28804 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28805 mem_base = xmlMemBlocks();
28806 file = gen_FILE_ptr(n_file, 0);
28807 enc = gen_xmlCharEncoding(n_enc, 1);
28809 ret_val = xmlParserInputBufferCreateFile(file, enc);
28810 desret_xmlParserInputBufferPtr(ret_val);
28812 des_FILE_ptr(n_file, file, 0);
28813 des_xmlCharEncoding(n_enc, enc, 1);
28814 xmlResetLastError();
28815 if (mem_base != xmlMemBlocks()) {
28816 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28817 xmlMemBlocks() - mem_base);
28819 printf(" %d", n_file);
28820 printf(" %d", n_enc);
28832 test_xmlParserInputBufferCreateFilename(void) {
28836 xmlParserInputBufferPtr ret_val;
28837 const char * URI; /* a C string containing the URI or filename */
28839 xmlCharEncoding enc; /* the charset encoding if known */
28842 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28843 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28844 mem_base = xmlMemBlocks();
28845 URI = gen_fileoutput(n_URI, 0);
28846 enc = gen_xmlCharEncoding(n_enc, 1);
28848 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28849 desret_xmlParserInputBufferPtr(ret_val);
28851 des_fileoutput(n_URI, URI, 0);
28852 des_xmlCharEncoding(n_enc, enc, 1);
28853 xmlResetLastError();
28854 if (mem_base != xmlMemBlocks()) {
28855 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28856 xmlMemBlocks() - mem_base);
28858 printf(" %d", n_URI);
28859 printf(" %d", n_enc);
28871 test_xmlParserInputBufferCreateMem(void) {
28875 xmlParserInputBufferPtr ret_val;
28876 char * mem; /* the memory input */
28878 int size; /* the length of the memory block */
28880 xmlCharEncoding enc; /* the charset encoding if known */
28883 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28884 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28885 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28886 mem_base = xmlMemBlocks();
28887 mem = gen_const_char_ptr(n_mem, 0);
28888 size = gen_int(n_size, 1);
28889 enc = gen_xmlCharEncoding(n_enc, 2);
28891 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28892 desret_xmlParserInputBufferPtr(ret_val);
28894 des_const_char_ptr(n_mem, (const char *)mem, 0);
28895 des_int(n_size, size, 1);
28896 des_xmlCharEncoding(n_enc, enc, 2);
28897 xmlResetLastError();
28898 if (mem_base != xmlMemBlocks()) {
28899 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28900 xmlMemBlocks() - mem_base);
28902 printf(" %d", n_mem);
28903 printf(" %d", n_size);
28904 printf(" %d", n_enc);
28917 test_xmlParserInputBufferCreateStatic(void) {
28921 xmlParserInputBufferPtr ret_val;
28922 char * mem; /* the memory input */
28924 int size; /* the length of the memory block */
28926 xmlCharEncoding enc; /* the charset encoding if known */
28929 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28930 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28931 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28932 mem_base = xmlMemBlocks();
28933 mem = gen_const_char_ptr(n_mem, 0);
28934 size = gen_int(n_size, 1);
28935 enc = gen_xmlCharEncoding(n_enc, 2);
28937 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28938 desret_xmlParserInputBufferPtr(ret_val);
28940 des_const_char_ptr(n_mem, (const char *)mem, 0);
28941 des_int(n_size, size, 1);
28942 des_xmlCharEncoding(n_enc, enc, 2);
28943 xmlResetLastError();
28944 if (mem_base != xmlMemBlocks()) {
28945 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28946 xmlMemBlocks() - mem_base);
28948 printf(" %d", n_mem);
28949 printf(" %d", n_size);
28950 printf(" %d", n_enc);
28963 test_xmlParserInputBufferGrow(void) {
28968 xmlParserInputBufferPtr in; /* a buffered parser input */
28970 int len; /* indicative value of the amount of chars to read */
28973 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28974 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28975 mem_base = xmlMemBlocks();
28976 in = gen_xmlParserInputBufferPtr(n_in, 0);
28977 len = gen_int(n_len, 1);
28979 ret_val = xmlParserInputBufferGrow(in, len);
28980 desret_int(ret_val);
28982 des_xmlParserInputBufferPtr(n_in, in, 0);
28983 des_int(n_len, len, 1);
28984 xmlResetLastError();
28985 if (mem_base != xmlMemBlocks()) {
28986 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28987 xmlMemBlocks() - mem_base);
28989 printf(" %d", n_in);
28990 printf(" %d", n_len);
29002 test_xmlParserInputBufferPush(void) {
29007 xmlParserInputBufferPtr in; /* a buffered parser input */
29009 int len; /* the size in bytes of the array. */
29011 char * buf; /* an char array */
29014 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29015 for (n_len = 0;n_len < gen_nb_int;n_len++) {
29016 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29017 mem_base = xmlMemBlocks();
29018 in = gen_xmlParserInputBufferPtr(n_in, 0);
29019 len = gen_int(n_len, 1);
29020 buf = gen_const_char_ptr(n_buf, 2);
29022 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29023 desret_int(ret_val);
29025 des_xmlParserInputBufferPtr(n_in, in, 0);
29026 des_int(n_len, len, 1);
29027 des_const_char_ptr(n_buf, (const char *)buf, 2);
29028 xmlResetLastError();
29029 if (mem_base != xmlMemBlocks()) {
29030 printf("Leak of %d blocks found in xmlParserInputBufferPush",
29031 xmlMemBlocks() - mem_base);
29033 printf(" %d", n_in);
29034 printf(" %d", n_len);
29035 printf(" %d", n_buf);
29048 test_xmlParserInputBufferRead(void) {
29053 xmlParserInputBufferPtr in; /* a buffered parser input */
29055 int len; /* indicative value of the amount of chars to read */
29058 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29059 for (n_len = 0;n_len < gen_nb_int;n_len++) {
29060 mem_base = xmlMemBlocks();
29061 in = gen_xmlParserInputBufferPtr(n_in, 0);
29062 len = gen_int(n_len, 1);
29064 ret_val = xmlParserInputBufferRead(in, len);
29065 desret_int(ret_val);
29067 des_xmlParserInputBufferPtr(n_in, in, 0);
29068 des_int(n_len, len, 1);
29069 xmlResetLastError();
29070 if (mem_base != xmlMemBlocks()) {
29071 printf("Leak of %d blocks found in xmlParserInputBufferRead",
29072 xmlMemBlocks() - mem_base);
29074 printf(" %d", n_in);
29075 printf(" %d", n_len);
29087 test_xmlPopInputCallbacks(void) {
29093 mem_base = xmlMemBlocks();
29095 ret_val = xmlPopInputCallbacks();
29096 desret_int(ret_val);
29098 xmlResetLastError();
29099 if (mem_base != xmlMemBlocks()) {
29100 printf("Leak of %d blocks found in xmlPopInputCallbacks",
29101 xmlMemBlocks() - mem_base);
29112 test_xmlRegisterDefaultInputCallbacks(void) {
29117 mem_base = xmlMemBlocks();
29119 xmlRegisterDefaultInputCallbacks();
29121 xmlResetLastError();
29122 if (mem_base != xmlMemBlocks()) {
29123 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29124 xmlMemBlocks() - mem_base);
29135 test_xmlRegisterDefaultOutputCallbacks(void) {
29138 #if defined(LIBXML_OUTPUT_ENABLED)
29141 mem_base = xmlMemBlocks();
29143 xmlRegisterDefaultOutputCallbacks();
29145 xmlResetLastError();
29146 if (mem_base != xmlMemBlocks()) {
29147 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29148 xmlMemBlocks() - mem_base);
29160 test_xmlRegisterHTTPPostCallbacks(void) {
29163 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29166 mem_base = xmlMemBlocks();
29168 xmlRegisterHTTPPostCallbacks();
29170 xmlResetLastError();
29171 if (mem_base != xmlMemBlocks()) {
29172 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29173 xmlMemBlocks() - mem_base);
29187 if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29188 test_ret += test_xmlAllocOutputBuffer();
29189 test_ret += test_xmlAllocParserInputBuffer();
29190 test_ret += test_xmlCheckFilename();
29191 test_ret += test_xmlCheckHTTPInput();
29192 test_ret += test_xmlCleanupInputCallbacks();
29193 test_ret += test_xmlCleanupOutputCallbacks();
29194 test_ret += test_xmlFileClose();
29195 test_ret += test_xmlFileMatch();
29196 test_ret += test_xmlFileOpen();
29197 test_ret += test_xmlFileRead();
29198 test_ret += test_xmlIOFTPClose();
29199 test_ret += test_xmlIOFTPMatch();
29200 test_ret += test_xmlIOFTPOpen();
29201 test_ret += test_xmlIOFTPRead();
29202 test_ret += test_xmlIOHTTPClose();
29203 test_ret += test_xmlIOHTTPMatch();
29204 test_ret += test_xmlIOHTTPOpen();
29205 test_ret += test_xmlIOHTTPRead();
29206 test_ret += test_xmlNoNetExternalEntityLoader();
29207 test_ret += test_xmlNormalizeWindowsPath();
29208 test_ret += test_xmlOutputBufferCreateBuffer();
29209 test_ret += test_xmlOutputBufferCreateFd();
29210 test_ret += test_xmlOutputBufferCreateFile();
29211 test_ret += test_xmlOutputBufferCreateFilename();
29212 test_ret += test_xmlOutputBufferFlush();
29213 test_ret += test_xmlOutputBufferGetContent();
29214 test_ret += test_xmlOutputBufferGetSize();
29215 test_ret += test_xmlOutputBufferWrite();
29216 test_ret += test_xmlOutputBufferWriteEscape();
29217 test_ret += test_xmlOutputBufferWriteString();
29218 test_ret += test_xmlParserGetDirectory();
29219 test_ret += test_xmlParserInputBufferCreateFd();
29220 test_ret += test_xmlParserInputBufferCreateFile();
29221 test_ret += test_xmlParserInputBufferCreateFilename();
29222 test_ret += test_xmlParserInputBufferCreateMem();
29223 test_ret += test_xmlParserInputBufferCreateStatic();
29224 test_ret += test_xmlParserInputBufferGrow();
29225 test_ret += test_xmlParserInputBufferPush();
29226 test_ret += test_xmlParserInputBufferRead();
29227 test_ret += test_xmlPopInputCallbacks();
29228 test_ret += test_xmlRegisterDefaultInputCallbacks();
29229 test_ret += test_xmlRegisterDefaultOutputCallbacks();
29230 test_ret += test_xmlRegisterHTTPPostCallbacks();
29233 printf("Module xmlIO: %d errors\n", test_ret);
29236 #ifdef LIBXML_AUTOMATA_ENABLED
29238 #define gen_nb_xmlAutomataPtr 1
29239 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29242 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29248 test_xmlAutomataCompile(void) {
29252 /* missing type support */
29258 test_xmlAutomataGetInitState(void) {
29262 /* missing type support */
29268 test_xmlAutomataIsDeterminist(void) {
29271 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29274 xmlAutomataPtr am; /* an automata */
29277 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29278 mem_base = xmlMemBlocks();
29279 am = gen_xmlAutomataPtr(n_am, 0);
29281 ret_val = xmlAutomataIsDeterminist(am);
29282 desret_int(ret_val);
29284 des_xmlAutomataPtr(n_am, am, 0);
29285 xmlResetLastError();
29286 if (mem_base != xmlMemBlocks()) {
29287 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29288 xmlMemBlocks() - mem_base);
29290 printf(" %d", n_am);
29300 #ifdef LIBXML_AUTOMATA_ENABLED
29302 #define gen_nb_xmlAutomataStatePtr 1
29303 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29306 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29312 test_xmlAutomataNewAllTrans(void) {
29316 /* missing type support */
29322 test_xmlAutomataNewCountTrans(void) {
29326 /* missing type support */
29332 test_xmlAutomataNewCountTrans2(void) {
29336 /* missing type support */
29342 test_xmlAutomataNewCountedTrans(void) {
29346 /* missing type support */
29352 test_xmlAutomataNewCounter(void) {
29355 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29358 xmlAutomataPtr am; /* an automata */
29360 int min; /* the minimal value on the counter */
29362 int max; /* the maximal value on the counter */
29365 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29366 for (n_min = 0;n_min < gen_nb_int;n_min++) {
29367 for (n_max = 0;n_max < gen_nb_int;n_max++) {
29368 mem_base = xmlMemBlocks();
29369 am = gen_xmlAutomataPtr(n_am, 0);
29370 min = gen_int(n_min, 1);
29371 max = gen_int(n_max, 2);
29373 ret_val = xmlAutomataNewCounter(am, min, max);
29374 desret_int(ret_val);
29376 des_xmlAutomataPtr(n_am, am, 0);
29377 des_int(n_min, min, 1);
29378 des_int(n_max, max, 2);
29379 xmlResetLastError();
29380 if (mem_base != xmlMemBlocks()) {
29381 printf("Leak of %d blocks found in xmlAutomataNewCounter",
29382 xmlMemBlocks() - mem_base);
29384 printf(" %d", n_am);
29385 printf(" %d", n_min);
29386 printf(" %d", n_max);
29400 test_xmlAutomataNewCounterTrans(void) {
29404 /* missing type support */
29410 test_xmlAutomataNewEpsilon(void) {
29414 /* missing type support */
29420 test_xmlAutomataNewNegTrans(void) {
29424 /* missing type support */
29430 test_xmlAutomataNewOnceTrans(void) {
29434 /* missing type support */
29440 test_xmlAutomataNewOnceTrans2(void) {
29444 /* missing type support */
29450 test_xmlAutomataNewState(void) {
29454 /* missing type support */
29460 test_xmlAutomataNewTransition(void) {
29464 /* missing type support */
29470 test_xmlAutomataNewTransition2(void) {
29474 /* missing type support */
29480 test_xmlAutomataSetFinalState(void) {
29483 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29486 xmlAutomataPtr am; /* an automata */
29488 xmlAutomataStatePtr state; /* a state in this automata */
29491 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29492 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29493 mem_base = xmlMemBlocks();
29494 am = gen_xmlAutomataPtr(n_am, 0);
29495 state = gen_xmlAutomataStatePtr(n_state, 1);
29497 ret_val = xmlAutomataSetFinalState(am, state);
29498 desret_int(ret_val);
29500 des_xmlAutomataPtr(n_am, am, 0);
29501 des_xmlAutomataStatePtr(n_state, state, 1);
29502 xmlResetLastError();
29503 if (mem_base != xmlMemBlocks()) {
29504 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29505 xmlMemBlocks() - mem_base);
29507 printf(" %d", n_am);
29508 printf(" %d", n_state);
29521 test_xmlNewAutomata(void) {
29525 /* missing type support */
29530 test_xmlautomata(void) {
29533 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29534 test_ret += test_xmlAutomataCompile();
29535 test_ret += test_xmlAutomataGetInitState();
29536 test_ret += test_xmlAutomataIsDeterminist();
29537 test_ret += test_xmlAutomataNewAllTrans();
29538 test_ret += test_xmlAutomataNewCountTrans();
29539 test_ret += test_xmlAutomataNewCountTrans2();
29540 test_ret += test_xmlAutomataNewCountedTrans();
29541 test_ret += test_xmlAutomataNewCounter();
29542 test_ret += test_xmlAutomataNewCounterTrans();
29543 test_ret += test_xmlAutomataNewEpsilon();
29544 test_ret += test_xmlAutomataNewNegTrans();
29545 test_ret += test_xmlAutomataNewOnceTrans();
29546 test_ret += test_xmlAutomataNewOnceTrans2();
29547 test_ret += test_xmlAutomataNewState();
29548 test_ret += test_xmlAutomataNewTransition();
29549 test_ret += test_xmlAutomataNewTransition2();
29550 test_ret += test_xmlAutomataSetFinalState();
29551 test_ret += test_xmlNewAutomata();
29554 printf("Module xmlautomata: %d errors\n", test_ret);
29558 #define gen_nb_xmlGenericErrorFunc_ptr 1
29559 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29562 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29566 test_initGenericErrorDefaultFunc(void) {
29570 xmlGenericErrorFunc * handler; /* the handler */
29573 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29574 mem_base = xmlMemBlocks();
29575 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29577 initGenericErrorDefaultFunc(handler);
29579 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29580 xmlResetLastError();
29581 if (mem_base != xmlMemBlocks()) {
29582 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29583 xmlMemBlocks() - mem_base);
29585 printf(" %d", n_handler);
29595 #define gen_nb_xmlErrorPtr 1
29596 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29599 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29603 test_xmlCopyError(void) {
29608 xmlErrorPtr from; /* a source error */
29610 xmlErrorPtr to; /* a target error */
29613 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29614 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29615 mem_base = xmlMemBlocks();
29616 from = gen_xmlErrorPtr(n_from, 0);
29617 to = gen_xmlErrorPtr(n_to, 1);
29619 ret_val = xmlCopyError(from, to);
29620 desret_int(ret_val);
29622 des_xmlErrorPtr(n_from, from, 0);
29623 des_xmlErrorPtr(n_to, to, 1);
29624 xmlResetLastError();
29625 if (mem_base != xmlMemBlocks()) {
29626 printf("Leak of %d blocks found in xmlCopyError",
29627 xmlMemBlocks() - mem_base);
29629 printf(" %d", n_from);
29630 printf(" %d", n_to);
29642 test_xmlCtxtGetLastError(void) {
29646 /* missing type support */
29652 test_xmlCtxtResetLastError(void) {
29656 void * ctx; /* an XML parser context */
29659 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29660 mem_base = xmlMemBlocks();
29661 ctx = gen_void_ptr(n_ctx, 0);
29663 xmlCtxtResetLastError(ctx);
29665 des_void_ptr(n_ctx, ctx, 0);
29666 xmlResetLastError();
29667 if (mem_base != xmlMemBlocks()) {
29668 printf("Leak of %d blocks found in xmlCtxtResetLastError",
29669 xmlMemBlocks() - mem_base);
29671 printf(" %d", n_ctx);
29682 test_xmlGetLastError(void) {
29686 /* missing type support */
29692 test_xmlParserError(void) {
29696 /* missing type support */
29702 test_xmlParserPrintFileContext(void) {
29706 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29709 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29710 mem_base = xmlMemBlocks();
29711 input = gen_xmlParserInputPtr(n_input, 0);
29713 xmlParserPrintFileContext(input);
29715 des_xmlParserInputPtr(n_input, input, 0);
29716 xmlResetLastError();
29717 if (mem_base != xmlMemBlocks()) {
29718 printf("Leak of %d blocks found in xmlParserPrintFileContext",
29719 xmlMemBlocks() - mem_base);
29721 printf(" %d", n_input);
29732 test_xmlParserPrintFileInfo(void) {
29736 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29739 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29740 mem_base = xmlMemBlocks();
29741 input = gen_xmlParserInputPtr(n_input, 0);
29743 xmlParserPrintFileInfo(input);
29745 des_xmlParserInputPtr(n_input, input, 0);
29746 xmlResetLastError();
29747 if (mem_base != xmlMemBlocks()) {
29748 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29749 xmlMemBlocks() - mem_base);
29751 printf(" %d", n_input);
29762 test_xmlParserValidityError(void) {
29766 /* missing type support */
29772 test_xmlParserValidityWarning(void) {
29776 /* missing type support */
29782 test_xmlParserWarning(void) {
29786 /* missing type support */
29792 test_xmlResetError(void) {
29796 xmlErrorPtr err; /* pointer to the error. */
29799 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29800 mem_base = xmlMemBlocks();
29801 err = gen_xmlErrorPtr(n_err, 0);
29803 xmlResetError(err);
29805 des_xmlErrorPtr(n_err, err, 0);
29806 xmlResetLastError();
29807 if (mem_base != xmlMemBlocks()) {
29808 printf("Leak of %d blocks found in xmlResetError",
29809 xmlMemBlocks() - mem_base);
29811 printf(" %d", n_err);
29822 test_xmlResetLastError(void) {
29827 xmlResetLastError();
29829 xmlResetLastError();
29837 test_xmlSetGenericErrorFunc(void) {
29841 /* missing type support */
29847 test_xmlSetStructuredErrorFunc(void) {
29851 /* missing type support */
29856 test_xmlerror(void) {
29859 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29860 test_ret += test_initGenericErrorDefaultFunc();
29861 test_ret += test_xmlCopyError();
29862 test_ret += test_xmlCtxtGetLastError();
29863 test_ret += test_xmlCtxtResetLastError();
29864 test_ret += test_xmlGetLastError();
29865 test_ret += test_xmlParserError();
29866 test_ret += test_xmlParserPrintFileContext();
29867 test_ret += test_xmlParserPrintFileInfo();
29868 test_ret += test_xmlParserValidityError();
29869 test_ret += test_xmlParserValidityWarning();
29870 test_ret += test_xmlParserWarning();
29871 test_ret += test_xmlResetError();
29872 test_ret += test_xmlResetLastError();
29873 test_ret += test_xmlSetGenericErrorFunc();
29874 test_ret += test_xmlSetStructuredErrorFunc();
29877 printf("Module xmlerror: %d errors\n", test_ret);
29880 #ifdef LIBXML_MODULES_ENABLED
29882 #define gen_nb_xmlModulePtr 1
29883 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29886 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29892 test_xmlModuleClose(void) {
29895 #if defined(LIBXML_MODULES_ENABLED)
29898 xmlModulePtr module; /* the module handle */
29901 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29902 mem_base = xmlMemBlocks();
29903 module = gen_xmlModulePtr(n_module, 0);
29905 ret_val = xmlModuleClose(module);
29906 desret_int(ret_val);
29908 des_xmlModulePtr(n_module, module, 0);
29909 xmlResetLastError();
29910 if (mem_base != xmlMemBlocks()) {
29911 printf("Leak of %d blocks found in xmlModuleClose",
29912 xmlMemBlocks() - mem_base);
29914 printf(" %d", n_module);
29926 test_xmlModuleOpen(void) {
29930 /* missing type support */
29936 test_xmlModuleSymbol(void) {
29939 #if defined(LIBXML_MODULES_ENABLED)
29942 xmlModulePtr module; /* the module */
29944 char * name; /* the name of the symbol */
29946 void ** symbol; /* the resulting symbol address */
29949 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29950 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29951 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29952 mem_base = xmlMemBlocks();
29953 module = gen_xmlModulePtr(n_module, 0);
29954 name = gen_const_char_ptr(n_name, 1);
29955 symbol = gen_void_ptr_ptr(n_symbol, 2);
29957 ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29958 desret_int(ret_val);
29960 des_xmlModulePtr(n_module, module, 0);
29961 des_const_char_ptr(n_name, (const char *)name, 1);
29962 des_void_ptr_ptr(n_symbol, symbol, 2);
29963 xmlResetLastError();
29964 if (mem_base != xmlMemBlocks()) {
29965 printf("Leak of %d blocks found in xmlModuleSymbol",
29966 xmlMemBlocks() - mem_base);
29968 printf(" %d", n_module);
29969 printf(" %d", n_name);
29970 printf(" %d", n_symbol);
29983 test_xmlmodule(void) {
29986 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29987 test_ret += test_xmlModuleClose();
29988 test_ret += test_xmlModuleOpen();
29989 test_ret += test_xmlModuleSymbol();
29992 printf("Module xmlmodule: %d errors\n", test_ret);
29997 test_xmlNewTextReader(void) {
30000 #if defined(LIBXML_READER_ENABLED)
30002 xmlTextReaderPtr ret_val;
30003 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30005 const char * URI; /* the URI information for the source if available */
30008 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30009 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30010 mem_base = xmlMemBlocks();
30011 input = gen_xmlParserInputBufferPtr(n_input, 0);
30012 URI = gen_filepath(n_URI, 1);
30014 ret_val = xmlNewTextReader(input, URI);
30015 desret_xmlTextReaderPtr(ret_val);
30017 des_xmlParserInputBufferPtr(n_input, input, 0);
30018 des_filepath(n_URI, URI, 1);
30019 xmlResetLastError();
30020 if (mem_base != xmlMemBlocks()) {
30021 printf("Leak of %d blocks found in xmlNewTextReader",
30022 xmlMemBlocks() - mem_base);
30024 printf(" %d", n_input);
30025 printf(" %d", n_URI);
30038 test_xmlNewTextReaderFilename(void) {
30041 #if defined(LIBXML_READER_ENABLED)
30043 xmlTextReaderPtr ret_val;
30044 const char * URI; /* the URI of the resource to process */
30047 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30048 mem_base = xmlMemBlocks();
30049 URI = gen_filepath(n_URI, 0);
30051 ret_val = xmlNewTextReaderFilename(URI);
30052 desret_xmlTextReaderPtr(ret_val);
30054 des_filepath(n_URI, URI, 0);
30055 xmlResetLastError();
30056 if (mem_base != xmlMemBlocks()) {
30057 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30058 xmlMemBlocks() - mem_base);
30060 printf(" %d", n_URI);
30072 test_xmlReaderForDoc(void) {
30075 #if defined(LIBXML_READER_ENABLED)
30077 xmlTextReaderPtr ret_val;
30078 xmlChar * cur; /* a pointer to a zero terminated string */
30080 const char * URL; /* the base URL to use for the document */
30082 char * encoding; /* the document encoding, or NULL */
30084 int options; /* a combination of xmlParserOption */
30087 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30088 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30089 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30090 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30091 mem_base = xmlMemBlocks();
30092 cur = gen_const_xmlChar_ptr(n_cur, 0);
30093 URL = gen_filepath(n_URL, 1);
30094 encoding = gen_const_char_ptr(n_encoding, 2);
30095 options = gen_parseroptions(n_options, 3);
30097 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30098 desret_xmlTextReaderPtr(ret_val);
30100 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30101 des_filepath(n_URL, URL, 1);
30102 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30103 des_parseroptions(n_options, options, 3);
30104 xmlResetLastError();
30105 if (mem_base != xmlMemBlocks()) {
30106 printf("Leak of %d blocks found in xmlReaderForDoc",
30107 xmlMemBlocks() - mem_base);
30109 printf(" %d", n_cur);
30110 printf(" %d", n_URL);
30111 printf(" %d", n_encoding);
30112 printf(" %d", n_options);
30127 test_xmlReaderForFile(void) {
30130 #if defined(LIBXML_READER_ENABLED)
30132 xmlTextReaderPtr ret_val;
30133 const char * filename; /* a file or URL */
30135 char * encoding; /* the document encoding, or NULL */
30137 int options; /* a combination of xmlParserOption */
30140 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30141 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30142 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30143 mem_base = xmlMemBlocks();
30144 filename = gen_filepath(n_filename, 0);
30145 encoding = gen_const_char_ptr(n_encoding, 1);
30146 options = gen_parseroptions(n_options, 2);
30148 ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30149 desret_xmlTextReaderPtr(ret_val);
30151 des_filepath(n_filename, filename, 0);
30152 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30153 des_parseroptions(n_options, options, 2);
30154 xmlResetLastError();
30155 if (mem_base != xmlMemBlocks()) {
30156 printf("Leak of %d blocks found in xmlReaderForFile",
30157 xmlMemBlocks() - mem_base);
30159 printf(" %d", n_filename);
30160 printf(" %d", n_encoding);
30161 printf(" %d", n_options);
30175 test_xmlReaderForMemory(void) {
30178 #if defined(LIBXML_READER_ENABLED)
30180 xmlTextReaderPtr ret_val;
30181 char * buffer; /* a pointer to a char array */
30183 int size; /* the size of the array */
30185 const char * URL; /* the base URL to use for the document */
30187 char * encoding; /* the document encoding, or NULL */
30189 int options; /* a combination of xmlParserOption */
30192 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30193 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30194 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30195 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30196 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30197 mem_base = xmlMemBlocks();
30198 buffer = gen_const_char_ptr(n_buffer, 0);
30199 size = gen_int(n_size, 1);
30200 URL = gen_filepath(n_URL, 2);
30201 encoding = gen_const_char_ptr(n_encoding, 3);
30202 options = gen_parseroptions(n_options, 4);
30204 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30205 desret_xmlTextReaderPtr(ret_val);
30207 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30208 des_int(n_size, size, 1);
30209 des_filepath(n_URL, URL, 2);
30210 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30211 des_parseroptions(n_options, options, 4);
30212 xmlResetLastError();
30213 if (mem_base != xmlMemBlocks()) {
30214 printf("Leak of %d blocks found in xmlReaderForMemory",
30215 xmlMemBlocks() - mem_base);
30217 printf(" %d", n_buffer);
30218 printf(" %d", n_size);
30219 printf(" %d", n_URL);
30220 printf(" %d", n_encoding);
30221 printf(" %d", n_options);
30237 test_xmlReaderNewDoc(void) {
30240 #if defined(LIBXML_READER_ENABLED)
30243 xmlTextReaderPtr reader; /* an XML reader */
30245 xmlChar * cur; /* a pointer to a zero terminated string */
30247 const char * URL; /* the base URL to use for the document */
30249 char * encoding; /* the document encoding, or NULL */
30251 int options; /* a combination of xmlParserOption */
30254 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30255 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30256 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30257 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30258 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30259 mem_base = xmlMemBlocks();
30260 reader = gen_xmlTextReaderPtr(n_reader, 0);
30261 cur = gen_const_xmlChar_ptr(n_cur, 1);
30262 URL = gen_filepath(n_URL, 2);
30263 encoding = gen_const_char_ptr(n_encoding, 3);
30264 options = gen_parseroptions(n_options, 4);
30266 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30267 desret_int(ret_val);
30269 des_xmlTextReaderPtr(n_reader, reader, 0);
30270 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30271 des_filepath(n_URL, URL, 2);
30272 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30273 des_parseroptions(n_options, options, 4);
30274 xmlResetLastError();
30275 if (mem_base != xmlMemBlocks()) {
30276 printf("Leak of %d blocks found in xmlReaderNewDoc",
30277 xmlMemBlocks() - mem_base);
30279 printf(" %d", n_reader);
30280 printf(" %d", n_cur);
30281 printf(" %d", n_URL);
30282 printf(" %d", n_encoding);
30283 printf(" %d", n_options);
30299 test_xmlReaderNewFile(void) {
30302 #if defined(LIBXML_READER_ENABLED)
30305 xmlTextReaderPtr reader; /* an XML reader */
30307 const char * filename; /* a file or URL */
30309 char * encoding; /* the document encoding, or NULL */
30311 int options; /* a combination of xmlParserOption */
30314 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30315 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30316 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30317 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30318 mem_base = xmlMemBlocks();
30319 reader = gen_xmlTextReaderPtr(n_reader, 0);
30320 filename = gen_filepath(n_filename, 1);
30321 encoding = gen_const_char_ptr(n_encoding, 2);
30322 options = gen_parseroptions(n_options, 3);
30324 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30325 desret_int(ret_val);
30327 des_xmlTextReaderPtr(n_reader, reader, 0);
30328 des_filepath(n_filename, filename, 1);
30329 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30330 des_parseroptions(n_options, options, 3);
30331 xmlResetLastError();
30332 if (mem_base != xmlMemBlocks()) {
30333 printf("Leak of %d blocks found in xmlReaderNewFile",
30334 xmlMemBlocks() - mem_base);
30336 printf(" %d", n_reader);
30337 printf(" %d", n_filename);
30338 printf(" %d", n_encoding);
30339 printf(" %d", n_options);
30354 test_xmlReaderNewMemory(void) {
30357 #if defined(LIBXML_READER_ENABLED)
30360 xmlTextReaderPtr reader; /* an XML reader */
30362 char * buffer; /* a pointer to a char array */
30364 int size; /* the size of the array */
30366 const char * URL; /* the base URL to use for the document */
30368 char * encoding; /* the document encoding, or NULL */
30370 int options; /* a combination of xmlParserOption */
30373 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30374 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30375 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30376 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30377 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30378 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30379 mem_base = xmlMemBlocks();
30380 reader = gen_xmlTextReaderPtr(n_reader, 0);
30381 buffer = gen_const_char_ptr(n_buffer, 1);
30382 size = gen_int(n_size, 2);
30383 URL = gen_filepath(n_URL, 3);
30384 encoding = gen_const_char_ptr(n_encoding, 4);
30385 options = gen_parseroptions(n_options, 5);
30387 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30388 desret_int(ret_val);
30390 des_xmlTextReaderPtr(n_reader, reader, 0);
30391 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30392 des_int(n_size, size, 2);
30393 des_filepath(n_URL, URL, 3);
30394 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30395 des_parseroptions(n_options, options, 5);
30396 xmlResetLastError();
30397 if (mem_base != xmlMemBlocks()) {
30398 printf("Leak of %d blocks found in xmlReaderNewMemory",
30399 xmlMemBlocks() - mem_base);
30401 printf(" %d", n_reader);
30402 printf(" %d", n_buffer);
30403 printf(" %d", n_size);
30404 printf(" %d", n_URL);
30405 printf(" %d", n_encoding);
30406 printf(" %d", n_options);
30423 test_xmlReaderNewWalker(void) {
30426 #if defined(LIBXML_READER_ENABLED)
30429 xmlTextReaderPtr reader; /* an XML reader */
30431 xmlDocPtr doc; /* a preparsed document */
30434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30435 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30436 mem_base = xmlMemBlocks();
30437 reader = gen_xmlTextReaderPtr(n_reader, 0);
30438 doc = gen_xmlDocPtr(n_doc, 1);
30440 ret_val = xmlReaderNewWalker(reader, doc);
30441 desret_int(ret_val);
30443 des_xmlTextReaderPtr(n_reader, reader, 0);
30444 des_xmlDocPtr(n_doc, doc, 1);
30445 xmlResetLastError();
30446 if (mem_base != xmlMemBlocks()) {
30447 printf("Leak of %d blocks found in xmlReaderNewWalker",
30448 xmlMemBlocks() - mem_base);
30450 printf(" %d", n_reader);
30451 printf(" %d", n_doc);
30464 test_xmlReaderWalker(void) {
30467 #if defined(LIBXML_READER_ENABLED)
30469 xmlTextReaderPtr ret_val;
30470 xmlDocPtr doc; /* a preparsed document */
30473 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30474 mem_base = xmlMemBlocks();
30475 doc = gen_xmlDocPtr(n_doc, 0);
30477 ret_val = xmlReaderWalker(doc);
30478 desret_xmlTextReaderPtr(ret_val);
30480 des_xmlDocPtr(n_doc, doc, 0);
30481 xmlResetLastError();
30482 if (mem_base != xmlMemBlocks()) {
30483 printf("Leak of %d blocks found in xmlReaderWalker",
30484 xmlMemBlocks() - mem_base);
30486 printf(" %d", n_doc);
30498 test_xmlTextReaderAttributeCount(void) {
30501 #if defined(LIBXML_READER_ENABLED)
30504 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30507 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30508 mem_base = xmlMemBlocks();
30509 reader = gen_xmlTextReaderPtr(n_reader, 0);
30511 ret_val = xmlTextReaderAttributeCount(reader);
30512 desret_int(ret_val);
30514 des_xmlTextReaderPtr(n_reader, reader, 0);
30515 xmlResetLastError();
30516 if (mem_base != xmlMemBlocks()) {
30517 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30518 xmlMemBlocks() - mem_base);
30520 printf(" %d", n_reader);
30532 test_xmlTextReaderBaseUri(void) {
30535 #if defined(LIBXML_READER_ENABLED)
30538 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30541 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30542 mem_base = xmlMemBlocks();
30543 reader = gen_xmlTextReaderPtr(n_reader, 0);
30545 ret_val = xmlTextReaderBaseUri(reader);
30546 desret_xmlChar_ptr(ret_val);
30548 des_xmlTextReaderPtr(n_reader, reader, 0);
30549 xmlResetLastError();
30550 if (mem_base != xmlMemBlocks()) {
30551 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30552 xmlMemBlocks() - mem_base);
30554 printf(" %d", n_reader);
30566 test_xmlTextReaderByteConsumed(void) {
30569 #if defined(LIBXML_READER_ENABLED)
30572 xmlTextReaderPtr reader; /* an XML reader */
30575 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30576 mem_base = xmlMemBlocks();
30577 reader = gen_xmlTextReaderPtr(n_reader, 0);
30579 ret_val = xmlTextReaderByteConsumed(reader);
30580 desret_long(ret_val);
30582 des_xmlTextReaderPtr(n_reader, reader, 0);
30583 xmlResetLastError();
30584 if (mem_base != xmlMemBlocks()) {
30585 printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30586 xmlMemBlocks() - mem_base);
30588 printf(" %d", n_reader);
30600 test_xmlTextReaderClose(void) {
30603 #if defined(LIBXML_READER_ENABLED)
30606 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30609 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30610 mem_base = xmlMemBlocks();
30611 reader = gen_xmlTextReaderPtr(n_reader, 0);
30613 ret_val = xmlTextReaderClose(reader);
30614 desret_int(ret_val);
30616 des_xmlTextReaderPtr(n_reader, reader, 0);
30617 xmlResetLastError();
30618 if (mem_base != xmlMemBlocks()) {
30619 printf("Leak of %d blocks found in xmlTextReaderClose",
30620 xmlMemBlocks() - mem_base);
30622 printf(" %d", n_reader);
30634 test_xmlTextReaderConstBaseUri(void) {
30637 #if defined(LIBXML_READER_ENABLED)
30639 const xmlChar * ret_val;
30640 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30643 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30644 mem_base = xmlMemBlocks();
30645 reader = gen_xmlTextReaderPtr(n_reader, 0);
30647 ret_val = xmlTextReaderConstBaseUri(reader);
30648 desret_const_xmlChar_ptr(ret_val);
30650 des_xmlTextReaderPtr(n_reader, reader, 0);
30651 xmlResetLastError();
30652 if (mem_base != xmlMemBlocks()) {
30653 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30654 xmlMemBlocks() - mem_base);
30656 printf(" %d", n_reader);
30668 test_xmlTextReaderConstEncoding(void) {
30671 #if defined(LIBXML_READER_ENABLED)
30673 const xmlChar * ret_val;
30674 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30677 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30678 mem_base = xmlMemBlocks();
30679 reader = gen_xmlTextReaderPtr(n_reader, 0);
30681 ret_val = xmlTextReaderConstEncoding(reader);
30682 desret_const_xmlChar_ptr(ret_val);
30684 des_xmlTextReaderPtr(n_reader, reader, 0);
30685 xmlResetLastError();
30686 if (mem_base != xmlMemBlocks()) {
30687 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30688 xmlMemBlocks() - mem_base);
30690 printf(" %d", n_reader);
30702 test_xmlTextReaderConstLocalName(void) {
30705 #if defined(LIBXML_READER_ENABLED)
30707 const xmlChar * ret_val;
30708 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30711 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30712 mem_base = xmlMemBlocks();
30713 reader = gen_xmlTextReaderPtr(n_reader, 0);
30715 ret_val = xmlTextReaderConstLocalName(reader);
30716 desret_const_xmlChar_ptr(ret_val);
30718 des_xmlTextReaderPtr(n_reader, reader, 0);
30719 xmlResetLastError();
30720 if (mem_base != xmlMemBlocks()) {
30721 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30722 xmlMemBlocks() - mem_base);
30724 printf(" %d", n_reader);
30736 test_xmlTextReaderConstName(void) {
30739 #if defined(LIBXML_READER_ENABLED)
30741 const xmlChar * ret_val;
30742 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30745 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30746 mem_base = xmlMemBlocks();
30747 reader = gen_xmlTextReaderPtr(n_reader, 0);
30749 ret_val = xmlTextReaderConstName(reader);
30750 desret_const_xmlChar_ptr(ret_val);
30752 des_xmlTextReaderPtr(n_reader, reader, 0);
30753 xmlResetLastError();
30754 if (mem_base != xmlMemBlocks()) {
30755 printf("Leak of %d blocks found in xmlTextReaderConstName",
30756 xmlMemBlocks() - mem_base);
30758 printf(" %d", n_reader);
30770 test_xmlTextReaderConstNamespaceUri(void) {
30773 #if defined(LIBXML_READER_ENABLED)
30775 const xmlChar * ret_val;
30776 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30779 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30780 mem_base = xmlMemBlocks();
30781 reader = gen_xmlTextReaderPtr(n_reader, 0);
30783 ret_val = xmlTextReaderConstNamespaceUri(reader);
30784 desret_const_xmlChar_ptr(ret_val);
30786 des_xmlTextReaderPtr(n_reader, reader, 0);
30787 xmlResetLastError();
30788 if (mem_base != xmlMemBlocks()) {
30789 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30790 xmlMemBlocks() - mem_base);
30792 printf(" %d", n_reader);
30804 test_xmlTextReaderConstPrefix(void) {
30807 #if defined(LIBXML_READER_ENABLED)
30809 const xmlChar * ret_val;
30810 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30813 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30814 mem_base = xmlMemBlocks();
30815 reader = gen_xmlTextReaderPtr(n_reader, 0);
30817 ret_val = xmlTextReaderConstPrefix(reader);
30818 desret_const_xmlChar_ptr(ret_val);
30820 des_xmlTextReaderPtr(n_reader, reader, 0);
30821 xmlResetLastError();
30822 if (mem_base != xmlMemBlocks()) {
30823 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30824 xmlMemBlocks() - mem_base);
30826 printf(" %d", n_reader);
30838 test_xmlTextReaderConstString(void) {
30841 #if defined(LIBXML_READER_ENABLED)
30843 const xmlChar * ret_val;
30844 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30846 xmlChar * str; /* the string to intern. */
30849 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30850 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30851 mem_base = xmlMemBlocks();
30852 reader = gen_xmlTextReaderPtr(n_reader, 0);
30853 str = gen_const_xmlChar_ptr(n_str, 1);
30855 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30856 desret_const_xmlChar_ptr(ret_val);
30858 des_xmlTextReaderPtr(n_reader, reader, 0);
30859 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30860 xmlResetLastError();
30861 if (mem_base != xmlMemBlocks()) {
30862 printf("Leak of %d blocks found in xmlTextReaderConstString",
30863 xmlMemBlocks() - mem_base);
30865 printf(" %d", n_reader);
30866 printf(" %d", n_str);
30879 test_xmlTextReaderConstValue(void) {
30882 #if defined(LIBXML_READER_ENABLED)
30884 const xmlChar * ret_val;
30885 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30888 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30889 mem_base = xmlMemBlocks();
30890 reader = gen_xmlTextReaderPtr(n_reader, 0);
30892 ret_val = xmlTextReaderConstValue(reader);
30893 desret_const_xmlChar_ptr(ret_val);
30895 des_xmlTextReaderPtr(n_reader, reader, 0);
30896 xmlResetLastError();
30897 if (mem_base != xmlMemBlocks()) {
30898 printf("Leak of %d blocks found in xmlTextReaderConstValue",
30899 xmlMemBlocks() - mem_base);
30901 printf(" %d", n_reader);
30913 test_xmlTextReaderConstXmlLang(void) {
30916 #if defined(LIBXML_READER_ENABLED)
30918 const xmlChar * ret_val;
30919 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30922 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30923 mem_base = xmlMemBlocks();
30924 reader = gen_xmlTextReaderPtr(n_reader, 0);
30926 ret_val = xmlTextReaderConstXmlLang(reader);
30927 desret_const_xmlChar_ptr(ret_val);
30929 des_xmlTextReaderPtr(n_reader, reader, 0);
30930 xmlResetLastError();
30931 if (mem_base != xmlMemBlocks()) {
30932 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30933 xmlMemBlocks() - mem_base);
30935 printf(" %d", n_reader);
30947 test_xmlTextReaderConstXmlVersion(void) {
30950 #if defined(LIBXML_READER_ENABLED)
30952 const xmlChar * ret_val;
30953 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30956 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30957 mem_base = xmlMemBlocks();
30958 reader = gen_xmlTextReaderPtr(n_reader, 0);
30960 ret_val = xmlTextReaderConstXmlVersion(reader);
30961 desret_const_xmlChar_ptr(ret_val);
30963 des_xmlTextReaderPtr(n_reader, reader, 0);
30964 xmlResetLastError();
30965 if (mem_base != xmlMemBlocks()) {
30966 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30967 xmlMemBlocks() - mem_base);
30969 printf(" %d", n_reader);
30981 test_xmlTextReaderCurrentDoc(void) {
30984 #if defined(LIBXML_READER_ENABLED)
30987 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30990 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30991 mem_base = xmlMemBlocks();
30992 reader = gen_xmlTextReaderPtr(n_reader, 0);
30994 ret_val = xmlTextReaderCurrentDoc(reader);
30995 desret_xmlDocPtr(ret_val);
30997 des_xmlTextReaderPtr(n_reader, reader, 0);
30998 xmlResetLastError();
30999 if (mem_base != xmlMemBlocks()) {
31000 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31001 xmlMemBlocks() - mem_base);
31003 printf(" %d", n_reader);
31015 test_xmlTextReaderCurrentNode(void) {
31018 #if defined(LIBXML_READER_ENABLED)
31020 xmlNodePtr ret_val;
31021 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31024 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31025 mem_base = xmlMemBlocks();
31026 reader = gen_xmlTextReaderPtr(n_reader, 0);
31028 ret_val = xmlTextReaderCurrentNode(reader);
31029 desret_xmlNodePtr(ret_val);
31031 des_xmlTextReaderPtr(n_reader, reader, 0);
31032 xmlResetLastError();
31033 if (mem_base != xmlMemBlocks()) {
31034 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31035 xmlMemBlocks() - mem_base);
31037 printf(" %d", n_reader);
31049 test_xmlTextReaderDepth(void) {
31052 #if defined(LIBXML_READER_ENABLED)
31055 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31058 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31059 mem_base = xmlMemBlocks();
31060 reader = gen_xmlTextReaderPtr(n_reader, 0);
31062 ret_val = xmlTextReaderDepth(reader);
31063 desret_int(ret_val);
31065 des_xmlTextReaderPtr(n_reader, reader, 0);
31066 xmlResetLastError();
31067 if (mem_base != xmlMemBlocks()) {
31068 printf("Leak of %d blocks found in xmlTextReaderDepth",
31069 xmlMemBlocks() - mem_base);
31071 printf(" %d", n_reader);
31083 test_xmlTextReaderExpand(void) {
31086 #if defined(LIBXML_READER_ENABLED)
31088 xmlNodePtr ret_val;
31089 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31092 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31093 mem_base = xmlMemBlocks();
31094 reader = gen_xmlTextReaderPtr(n_reader, 0);
31096 ret_val = xmlTextReaderExpand(reader);
31097 desret_xmlNodePtr(ret_val);
31099 des_xmlTextReaderPtr(n_reader, reader, 0);
31100 xmlResetLastError();
31101 if (mem_base != xmlMemBlocks()) {
31102 printf("Leak of %d blocks found in xmlTextReaderExpand",
31103 xmlMemBlocks() - mem_base);
31105 printf(" %d", n_reader);
31117 test_xmlTextReaderGetAttribute(void) {
31120 #if defined(LIBXML_READER_ENABLED)
31123 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31125 xmlChar * name; /* the qualified name of the attribute. */
31128 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31129 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31130 mem_base = xmlMemBlocks();
31131 reader = gen_xmlTextReaderPtr(n_reader, 0);
31132 name = gen_const_xmlChar_ptr(n_name, 1);
31134 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31135 desret_xmlChar_ptr(ret_val);
31137 des_xmlTextReaderPtr(n_reader, reader, 0);
31138 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31139 xmlResetLastError();
31140 if (mem_base != xmlMemBlocks()) {
31141 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31142 xmlMemBlocks() - mem_base);
31144 printf(" %d", n_reader);
31145 printf(" %d", n_name);
31158 test_xmlTextReaderGetAttributeNo(void) {
31161 #if defined(LIBXML_READER_ENABLED)
31164 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31166 int no; /* the zero-based index of the attribute relative to the containing element */
31169 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31170 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31171 mem_base = xmlMemBlocks();
31172 reader = gen_xmlTextReaderPtr(n_reader, 0);
31173 no = gen_int(n_no, 1);
31175 ret_val = xmlTextReaderGetAttributeNo(reader, no);
31176 desret_xmlChar_ptr(ret_val);
31178 des_xmlTextReaderPtr(n_reader, reader, 0);
31179 des_int(n_no, no, 1);
31180 xmlResetLastError();
31181 if (mem_base != xmlMemBlocks()) {
31182 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31183 xmlMemBlocks() - mem_base);
31185 printf(" %d", n_reader);
31186 printf(" %d", n_no);
31199 test_xmlTextReaderGetAttributeNs(void) {
31202 #if defined(LIBXML_READER_ENABLED)
31205 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31207 xmlChar * localName; /* the local name of the attribute. */
31209 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31210 int n_namespaceURI;
31212 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31213 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31214 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31215 mem_base = xmlMemBlocks();
31216 reader = gen_xmlTextReaderPtr(n_reader, 0);
31217 localName = gen_const_xmlChar_ptr(n_localName, 1);
31218 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31220 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31221 desret_xmlChar_ptr(ret_val);
31223 des_xmlTextReaderPtr(n_reader, reader, 0);
31224 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31225 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31226 xmlResetLastError();
31227 if (mem_base != xmlMemBlocks()) {
31228 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31229 xmlMemBlocks() - mem_base);
31231 printf(" %d", n_reader);
31232 printf(" %d", n_localName);
31233 printf(" %d", n_namespaceURI);
31245 #ifdef LIBXML_READER_ENABLED
31247 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31248 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31251 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31257 test_xmlTextReaderGetErrorHandler(void) {
31260 #if defined(LIBXML_READER_ENABLED)
31262 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31264 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31266 void ** arg; /* a user argument */
31269 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31270 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31271 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31272 mem_base = xmlMemBlocks();
31273 reader = gen_xmlTextReaderPtr(n_reader, 0);
31274 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31275 arg = gen_void_ptr_ptr(n_arg, 2);
31277 xmlTextReaderGetErrorHandler(reader, f, arg);
31279 des_xmlTextReaderPtr(n_reader, reader, 0);
31280 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31281 des_void_ptr_ptr(n_arg, arg, 2);
31282 xmlResetLastError();
31283 if (mem_base != xmlMemBlocks()) {
31284 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31285 xmlMemBlocks() - mem_base);
31287 printf(" %d", n_reader);
31288 printf(" %d", n_f);
31289 printf(" %d", n_arg);
31303 test_xmlTextReaderGetParserColumnNumber(void) {
31306 #if defined(LIBXML_READER_ENABLED)
31309 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31312 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31313 mem_base = xmlMemBlocks();
31314 reader = gen_xmlTextReaderPtr(n_reader, 0);
31316 ret_val = xmlTextReaderGetParserColumnNumber(reader);
31317 desret_int(ret_val);
31319 des_xmlTextReaderPtr(n_reader, reader, 0);
31320 xmlResetLastError();
31321 if (mem_base != xmlMemBlocks()) {
31322 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31323 xmlMemBlocks() - mem_base);
31325 printf(" %d", n_reader);
31337 test_xmlTextReaderGetParserLineNumber(void) {
31340 #if defined(LIBXML_READER_ENABLED)
31343 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31346 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31347 mem_base = xmlMemBlocks();
31348 reader = gen_xmlTextReaderPtr(n_reader, 0);
31350 ret_val = xmlTextReaderGetParserLineNumber(reader);
31351 desret_int(ret_val);
31353 des_xmlTextReaderPtr(n_reader, reader, 0);
31354 xmlResetLastError();
31355 if (mem_base != xmlMemBlocks()) {
31356 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31357 xmlMemBlocks() - mem_base);
31359 printf(" %d", n_reader);
31371 test_xmlTextReaderGetParserProp(void) {
31374 #if defined(LIBXML_READER_ENABLED)
31377 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31379 int prop; /* the xmlParserProperties to get */
31382 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31383 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31384 mem_base = xmlMemBlocks();
31385 reader = gen_xmlTextReaderPtr(n_reader, 0);
31386 prop = gen_int(n_prop, 1);
31388 ret_val = xmlTextReaderGetParserProp(reader, prop);
31389 desret_int(ret_val);
31391 des_xmlTextReaderPtr(n_reader, reader, 0);
31392 des_int(n_prop, prop, 1);
31393 xmlResetLastError();
31394 if (mem_base != xmlMemBlocks()) {
31395 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31396 xmlMemBlocks() - mem_base);
31398 printf(" %d", n_reader);
31399 printf(" %d", n_prop);
31412 test_xmlTextReaderGetRemainder(void) {
31415 #if defined(LIBXML_READER_ENABLED)
31417 xmlParserInputBufferPtr ret_val;
31418 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31421 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31422 mem_base = xmlMemBlocks();
31423 reader = gen_xmlTextReaderPtr(n_reader, 0);
31425 ret_val = xmlTextReaderGetRemainder(reader);
31426 desret_xmlParserInputBufferPtr(ret_val);
31428 des_xmlTextReaderPtr(n_reader, reader, 0);
31429 xmlResetLastError();
31430 if (mem_base != xmlMemBlocks()) {
31431 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31432 xmlMemBlocks() - mem_base);
31434 printf(" %d", n_reader);
31446 test_xmlTextReaderHasAttributes(void) {
31449 #if defined(LIBXML_READER_ENABLED)
31452 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31455 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31456 mem_base = xmlMemBlocks();
31457 reader = gen_xmlTextReaderPtr(n_reader, 0);
31459 ret_val = xmlTextReaderHasAttributes(reader);
31460 desret_int(ret_val);
31462 des_xmlTextReaderPtr(n_reader, reader, 0);
31463 xmlResetLastError();
31464 if (mem_base != xmlMemBlocks()) {
31465 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31466 xmlMemBlocks() - mem_base);
31468 printf(" %d", n_reader);
31480 test_xmlTextReaderHasValue(void) {
31483 #if defined(LIBXML_READER_ENABLED)
31486 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31489 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31490 mem_base = xmlMemBlocks();
31491 reader = gen_xmlTextReaderPtr(n_reader, 0);
31493 ret_val = xmlTextReaderHasValue(reader);
31494 desret_int(ret_val);
31496 des_xmlTextReaderPtr(n_reader, reader, 0);
31497 xmlResetLastError();
31498 if (mem_base != xmlMemBlocks()) {
31499 printf("Leak of %d blocks found in xmlTextReaderHasValue",
31500 xmlMemBlocks() - mem_base);
31502 printf(" %d", n_reader);
31514 test_xmlTextReaderIsDefault(void) {
31517 #if defined(LIBXML_READER_ENABLED)
31520 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31523 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31524 mem_base = xmlMemBlocks();
31525 reader = gen_xmlTextReaderPtr(n_reader, 0);
31527 ret_val = xmlTextReaderIsDefault(reader);
31528 desret_int(ret_val);
31530 des_xmlTextReaderPtr(n_reader, reader, 0);
31531 xmlResetLastError();
31532 if (mem_base != xmlMemBlocks()) {
31533 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31534 xmlMemBlocks() - mem_base);
31536 printf(" %d", n_reader);
31548 test_xmlTextReaderIsEmptyElement(void) {
31551 #if defined(LIBXML_READER_ENABLED)
31554 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31557 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31558 mem_base = xmlMemBlocks();
31559 reader = gen_xmlTextReaderPtr(n_reader, 0);
31561 ret_val = xmlTextReaderIsEmptyElement(reader);
31562 desret_int(ret_val);
31564 des_xmlTextReaderPtr(n_reader, reader, 0);
31565 xmlResetLastError();
31566 if (mem_base != xmlMemBlocks()) {
31567 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31568 xmlMemBlocks() - mem_base);
31570 printf(" %d", n_reader);
31582 test_xmlTextReaderIsNamespaceDecl(void) {
31585 #if defined(LIBXML_READER_ENABLED)
31588 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31591 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31592 mem_base = xmlMemBlocks();
31593 reader = gen_xmlTextReaderPtr(n_reader, 0);
31595 ret_val = xmlTextReaderIsNamespaceDecl(reader);
31596 desret_int(ret_val);
31598 des_xmlTextReaderPtr(n_reader, reader, 0);
31599 xmlResetLastError();
31600 if (mem_base != xmlMemBlocks()) {
31601 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31602 xmlMemBlocks() - mem_base);
31604 printf(" %d", n_reader);
31616 test_xmlTextReaderIsValid(void) {
31619 #if defined(LIBXML_READER_ENABLED)
31622 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31625 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31626 mem_base = xmlMemBlocks();
31627 reader = gen_xmlTextReaderPtr(n_reader, 0);
31629 ret_val = xmlTextReaderIsValid(reader);
31630 desret_int(ret_val);
31632 des_xmlTextReaderPtr(n_reader, reader, 0);
31633 xmlResetLastError();
31634 if (mem_base != xmlMemBlocks()) {
31635 printf("Leak of %d blocks found in xmlTextReaderIsValid",
31636 xmlMemBlocks() - mem_base);
31638 printf(" %d", n_reader);
31650 test_xmlTextReaderLocalName(void) {
31653 #if defined(LIBXML_READER_ENABLED)
31656 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31659 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31660 mem_base = xmlMemBlocks();
31661 reader = gen_xmlTextReaderPtr(n_reader, 0);
31663 ret_val = xmlTextReaderLocalName(reader);
31664 desret_xmlChar_ptr(ret_val);
31666 des_xmlTextReaderPtr(n_reader, reader, 0);
31667 xmlResetLastError();
31668 if (mem_base != xmlMemBlocks()) {
31669 printf("Leak of %d blocks found in xmlTextReaderLocalName",
31670 xmlMemBlocks() - mem_base);
31672 printf(" %d", n_reader);
31682 #ifdef LIBXML_READER_ENABLED
31684 #define gen_nb_xmlTextReaderLocatorPtr 1
31685 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31688 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31694 test_xmlTextReaderLocatorBaseURI(void) {
31697 #if defined(LIBXML_READER_ENABLED)
31700 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31703 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31704 mem_base = xmlMemBlocks();
31705 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31707 ret_val = xmlTextReaderLocatorBaseURI(locator);
31708 desret_xmlChar_ptr(ret_val);
31710 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31711 xmlResetLastError();
31712 if (mem_base != xmlMemBlocks()) {
31713 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31714 xmlMemBlocks() - mem_base);
31716 printf(" %d", n_locator);
31728 test_xmlTextReaderLocatorLineNumber(void) {
31731 #if defined(LIBXML_READER_ENABLED)
31734 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31737 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31738 mem_base = xmlMemBlocks();
31739 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31741 ret_val = xmlTextReaderLocatorLineNumber(locator);
31742 desret_int(ret_val);
31744 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31745 xmlResetLastError();
31746 if (mem_base != xmlMemBlocks()) {
31747 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31748 xmlMemBlocks() - mem_base);
31750 printf(" %d", n_locator);
31762 test_xmlTextReaderLookupNamespace(void) {
31765 #if defined(LIBXML_READER_ENABLED)
31768 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31770 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31773 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31774 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31775 mem_base = xmlMemBlocks();
31776 reader = gen_xmlTextReaderPtr(n_reader, 0);
31777 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31779 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31780 desret_xmlChar_ptr(ret_val);
31782 des_xmlTextReaderPtr(n_reader, reader, 0);
31783 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31784 xmlResetLastError();
31785 if (mem_base != xmlMemBlocks()) {
31786 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31787 xmlMemBlocks() - mem_base);
31789 printf(" %d", n_reader);
31790 printf(" %d", n_prefix);
31803 test_xmlTextReaderMoveToAttribute(void) {
31806 #if defined(LIBXML_READER_ENABLED)
31809 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31811 xmlChar * name; /* the qualified name of the attribute. */
31814 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31815 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31816 mem_base = xmlMemBlocks();
31817 reader = gen_xmlTextReaderPtr(n_reader, 0);
31818 name = gen_const_xmlChar_ptr(n_name, 1);
31820 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31821 desret_int(ret_val);
31823 des_xmlTextReaderPtr(n_reader, reader, 0);
31824 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31825 xmlResetLastError();
31826 if (mem_base != xmlMemBlocks()) {
31827 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31828 xmlMemBlocks() - mem_base);
31830 printf(" %d", n_reader);
31831 printf(" %d", n_name);
31844 test_xmlTextReaderMoveToAttributeNo(void) {
31847 #if defined(LIBXML_READER_ENABLED)
31850 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31852 int no; /* the zero-based index of the attribute relative to the containing element. */
31855 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31856 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31857 mem_base = xmlMemBlocks();
31858 reader = gen_xmlTextReaderPtr(n_reader, 0);
31859 no = gen_int(n_no, 1);
31861 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31862 desret_int(ret_val);
31864 des_xmlTextReaderPtr(n_reader, reader, 0);
31865 des_int(n_no, no, 1);
31866 xmlResetLastError();
31867 if (mem_base != xmlMemBlocks()) {
31868 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31869 xmlMemBlocks() - mem_base);
31871 printf(" %d", n_reader);
31872 printf(" %d", n_no);
31885 test_xmlTextReaderMoveToAttributeNs(void) {
31888 #if defined(LIBXML_READER_ENABLED)
31891 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31893 xmlChar * localName; /* the local name of the attribute. */
31895 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31896 int n_namespaceURI;
31898 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31899 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31900 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31901 mem_base = xmlMemBlocks();
31902 reader = gen_xmlTextReaderPtr(n_reader, 0);
31903 localName = gen_const_xmlChar_ptr(n_localName, 1);
31904 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31906 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31907 desret_int(ret_val);
31909 des_xmlTextReaderPtr(n_reader, reader, 0);
31910 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31911 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31912 xmlResetLastError();
31913 if (mem_base != xmlMemBlocks()) {
31914 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31915 xmlMemBlocks() - mem_base);
31917 printf(" %d", n_reader);
31918 printf(" %d", n_localName);
31919 printf(" %d", n_namespaceURI);
31933 test_xmlTextReaderMoveToElement(void) {
31936 #if defined(LIBXML_READER_ENABLED)
31939 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31942 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31943 mem_base = xmlMemBlocks();
31944 reader = gen_xmlTextReaderPtr(n_reader, 0);
31946 ret_val = xmlTextReaderMoveToElement(reader);
31947 desret_int(ret_val);
31949 des_xmlTextReaderPtr(n_reader, reader, 0);
31950 xmlResetLastError();
31951 if (mem_base != xmlMemBlocks()) {
31952 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31953 xmlMemBlocks() - mem_base);
31955 printf(" %d", n_reader);
31967 test_xmlTextReaderMoveToFirstAttribute(void) {
31970 #if defined(LIBXML_READER_ENABLED)
31973 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31976 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31977 mem_base = xmlMemBlocks();
31978 reader = gen_xmlTextReaderPtr(n_reader, 0);
31980 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31981 desret_int(ret_val);
31983 des_xmlTextReaderPtr(n_reader, reader, 0);
31984 xmlResetLastError();
31985 if (mem_base != xmlMemBlocks()) {
31986 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31987 xmlMemBlocks() - mem_base);
31989 printf(" %d", n_reader);
32001 test_xmlTextReaderMoveToNextAttribute(void) {
32004 #if defined(LIBXML_READER_ENABLED)
32007 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32010 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32011 mem_base = xmlMemBlocks();
32012 reader = gen_xmlTextReaderPtr(n_reader, 0);
32014 ret_val = xmlTextReaderMoveToNextAttribute(reader);
32015 desret_int(ret_val);
32017 des_xmlTextReaderPtr(n_reader, reader, 0);
32018 xmlResetLastError();
32019 if (mem_base != xmlMemBlocks()) {
32020 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32021 xmlMemBlocks() - mem_base);
32023 printf(" %d", n_reader);
32035 test_xmlTextReaderName(void) {
32038 #if defined(LIBXML_READER_ENABLED)
32041 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32044 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32045 mem_base = xmlMemBlocks();
32046 reader = gen_xmlTextReaderPtr(n_reader, 0);
32048 ret_val = xmlTextReaderName(reader);
32049 desret_xmlChar_ptr(ret_val);
32051 des_xmlTextReaderPtr(n_reader, reader, 0);
32052 xmlResetLastError();
32053 if (mem_base != xmlMemBlocks()) {
32054 printf("Leak of %d blocks found in xmlTextReaderName",
32055 xmlMemBlocks() - mem_base);
32057 printf(" %d", n_reader);
32069 test_xmlTextReaderNamespaceUri(void) {
32072 #if defined(LIBXML_READER_ENABLED)
32075 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32078 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32079 mem_base = xmlMemBlocks();
32080 reader = gen_xmlTextReaderPtr(n_reader, 0);
32082 ret_val = xmlTextReaderNamespaceUri(reader);
32083 desret_xmlChar_ptr(ret_val);
32085 des_xmlTextReaderPtr(n_reader, reader, 0);
32086 xmlResetLastError();
32087 if (mem_base != xmlMemBlocks()) {
32088 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32089 xmlMemBlocks() - mem_base);
32091 printf(" %d", n_reader);
32103 test_xmlTextReaderNext(void) {
32106 #if defined(LIBXML_READER_ENABLED)
32109 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32112 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32113 mem_base = xmlMemBlocks();
32114 reader = gen_xmlTextReaderPtr(n_reader, 0);
32116 ret_val = xmlTextReaderNext(reader);
32117 desret_int(ret_val);
32119 des_xmlTextReaderPtr(n_reader, reader, 0);
32120 xmlResetLastError();
32121 if (mem_base != xmlMemBlocks()) {
32122 printf("Leak of %d blocks found in xmlTextReaderNext",
32123 xmlMemBlocks() - mem_base);
32125 printf(" %d", n_reader);
32137 test_xmlTextReaderNextSibling(void) {
32140 #if defined(LIBXML_READER_ENABLED)
32143 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32146 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32147 mem_base = xmlMemBlocks();
32148 reader = gen_xmlTextReaderPtr(n_reader, 0);
32150 ret_val = xmlTextReaderNextSibling(reader);
32151 desret_int(ret_val);
32153 des_xmlTextReaderPtr(n_reader, reader, 0);
32154 xmlResetLastError();
32155 if (mem_base != xmlMemBlocks()) {
32156 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32157 xmlMemBlocks() - mem_base);
32159 printf(" %d", n_reader);
32171 test_xmlTextReaderNodeType(void) {
32174 #if defined(LIBXML_READER_ENABLED)
32177 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32180 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32181 mem_base = xmlMemBlocks();
32182 reader = gen_xmlTextReaderPtr(n_reader, 0);
32184 ret_val = xmlTextReaderNodeType(reader);
32185 desret_int(ret_val);
32187 des_xmlTextReaderPtr(n_reader, reader, 0);
32188 xmlResetLastError();
32189 if (mem_base != xmlMemBlocks()) {
32190 printf("Leak of %d blocks found in xmlTextReaderNodeType",
32191 xmlMemBlocks() - mem_base);
32193 printf(" %d", n_reader);
32205 test_xmlTextReaderNormalization(void) {
32208 #if defined(LIBXML_READER_ENABLED)
32211 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32214 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32215 mem_base = xmlMemBlocks();
32216 reader = gen_xmlTextReaderPtr(n_reader, 0);
32218 ret_val = xmlTextReaderNormalization(reader);
32219 desret_int(ret_val);
32221 des_xmlTextReaderPtr(n_reader, reader, 0);
32222 xmlResetLastError();
32223 if (mem_base != xmlMemBlocks()) {
32224 printf("Leak of %d blocks found in xmlTextReaderNormalization",
32225 xmlMemBlocks() - mem_base);
32227 printf(" %d", n_reader);
32239 test_xmlTextReaderPrefix(void) {
32242 #if defined(LIBXML_READER_ENABLED)
32245 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32248 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32249 mem_base = xmlMemBlocks();
32250 reader = gen_xmlTextReaderPtr(n_reader, 0);
32252 ret_val = xmlTextReaderPrefix(reader);
32253 desret_xmlChar_ptr(ret_val);
32255 des_xmlTextReaderPtr(n_reader, reader, 0);
32256 xmlResetLastError();
32257 if (mem_base != xmlMemBlocks()) {
32258 printf("Leak of %d blocks found in xmlTextReaderPrefix",
32259 xmlMemBlocks() - mem_base);
32261 printf(" %d", n_reader);
32273 test_xmlTextReaderPreserve(void) {
32276 #if defined(LIBXML_READER_ENABLED)
32278 xmlNodePtr ret_val;
32279 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32282 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32283 mem_base = xmlMemBlocks();
32284 reader = gen_xmlTextReaderPtr(n_reader, 0);
32286 ret_val = xmlTextReaderPreserve(reader);
32287 desret_xmlNodePtr(ret_val);
32289 des_xmlTextReaderPtr(n_reader, reader, 0);
32290 xmlResetLastError();
32291 if (mem_base != xmlMemBlocks()) {
32292 printf("Leak of %d blocks found in xmlTextReaderPreserve",
32293 xmlMemBlocks() - mem_base);
32295 printf(" %d", n_reader);
32307 test_xmlTextReaderPreservePattern(void) {
32310 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32311 #ifdef LIBXML_PATTERN_ENABLED
32314 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32316 xmlChar * pattern; /* an XPath subset pattern */
32318 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32321 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32322 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32323 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32324 mem_base = xmlMemBlocks();
32325 reader = gen_xmlTextReaderPtr(n_reader, 0);
32326 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32327 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32329 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32330 desret_int(ret_val);
32332 des_xmlTextReaderPtr(n_reader, reader, 0);
32333 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32334 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32335 xmlResetLastError();
32336 if (mem_base != xmlMemBlocks()) {
32337 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32338 xmlMemBlocks() - mem_base);
32340 printf(" %d", n_reader);
32341 printf(" %d", n_pattern);
32342 printf(" %d", n_namespaces);
32357 test_xmlTextReaderQuoteChar(void) {
32360 #if defined(LIBXML_READER_ENABLED)
32363 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32366 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32367 mem_base = xmlMemBlocks();
32368 reader = gen_xmlTextReaderPtr(n_reader, 0);
32370 ret_val = xmlTextReaderQuoteChar(reader);
32371 desret_int(ret_val);
32373 des_xmlTextReaderPtr(n_reader, reader, 0);
32374 xmlResetLastError();
32375 if (mem_base != xmlMemBlocks()) {
32376 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32377 xmlMemBlocks() - mem_base);
32379 printf(" %d", n_reader);
32391 test_xmlTextReaderRead(void) {
32394 #if defined(LIBXML_READER_ENABLED)
32397 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32400 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32401 mem_base = xmlMemBlocks();
32402 reader = gen_xmlTextReaderPtr(n_reader, 0);
32404 ret_val = xmlTextReaderRead(reader);
32405 desret_int(ret_val);
32407 des_xmlTextReaderPtr(n_reader, reader, 0);
32408 xmlResetLastError();
32409 if (mem_base != xmlMemBlocks()) {
32410 printf("Leak of %d blocks found in xmlTextReaderRead",
32411 xmlMemBlocks() - mem_base);
32413 printf(" %d", n_reader);
32425 test_xmlTextReaderReadAttributeValue(void) {
32428 #if defined(LIBXML_READER_ENABLED)
32431 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32435 mem_base = xmlMemBlocks();
32436 reader = gen_xmlTextReaderPtr(n_reader, 0);
32438 ret_val = xmlTextReaderReadAttributeValue(reader);
32439 desret_int(ret_val);
32441 des_xmlTextReaderPtr(n_reader, reader, 0);
32442 xmlResetLastError();
32443 if (mem_base != xmlMemBlocks()) {
32444 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32445 xmlMemBlocks() - mem_base);
32447 printf(" %d", n_reader);
32459 test_xmlTextReaderReadState(void) {
32462 #if defined(LIBXML_READER_ENABLED)
32465 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32468 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32469 mem_base = xmlMemBlocks();
32470 reader = gen_xmlTextReaderPtr(n_reader, 0);
32472 ret_val = xmlTextReaderReadState(reader);
32473 desret_int(ret_val);
32475 des_xmlTextReaderPtr(n_reader, reader, 0);
32476 xmlResetLastError();
32477 if (mem_base != xmlMemBlocks()) {
32478 printf("Leak of %d blocks found in xmlTextReaderReadState",
32479 xmlMemBlocks() - mem_base);
32481 printf(" %d", n_reader);
32493 test_xmlTextReaderRelaxNGSetSchema(void) {
32496 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32499 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32501 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32504 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32505 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32506 mem_base = xmlMemBlocks();
32507 reader = gen_xmlTextReaderPtr(n_reader, 0);
32508 schema = gen_xmlRelaxNGPtr(n_schema, 1);
32510 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32511 desret_int(ret_val);
32513 des_xmlTextReaderPtr(n_reader, reader, 0);
32514 des_xmlRelaxNGPtr(n_schema, schema, 1);
32515 xmlResetLastError();
32516 if (mem_base != xmlMemBlocks()) {
32517 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32518 xmlMemBlocks() - mem_base);
32520 printf(" %d", n_reader);
32521 printf(" %d", n_schema);
32534 test_xmlTextReaderRelaxNGValidate(void) {
32537 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32540 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32542 char * rng; /* the path to a RelaxNG schema or NULL */
32545 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32546 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32547 mem_base = xmlMemBlocks();
32548 reader = gen_xmlTextReaderPtr(n_reader, 0);
32549 rng = gen_const_char_ptr(n_rng, 1);
32551 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32552 desret_int(ret_val);
32554 des_xmlTextReaderPtr(n_reader, reader, 0);
32555 des_const_char_ptr(n_rng, (const char *)rng, 1);
32556 xmlResetLastError();
32557 if (mem_base != xmlMemBlocks()) {
32558 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32559 xmlMemBlocks() - mem_base);
32561 printf(" %d", n_reader);
32562 printf(" %d", n_rng);
32575 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32578 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32581 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32583 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32585 int options; /* options (not used yet) */
32588 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32589 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32590 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32591 mem_base = xmlMemBlocks();
32592 reader = gen_xmlTextReaderPtr(n_reader, 0);
32593 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32594 options = gen_parseroptions(n_options, 2);
32596 ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32597 desret_int(ret_val);
32599 des_xmlTextReaderPtr(n_reader, reader, 0);
32600 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32601 des_parseroptions(n_options, options, 2);
32602 xmlResetLastError();
32603 if (mem_base != xmlMemBlocks()) {
32604 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32605 xmlMemBlocks() - mem_base);
32607 printf(" %d", n_reader);
32608 printf(" %d", n_ctxt);
32609 printf(" %d", n_options);
32623 test_xmlTextReaderSchemaValidate(void) {
32626 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32628 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32630 char * xsd; /* the path to a W3C XSD schema or NULL */
32633 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32634 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32635 reader = gen_xmlTextReaderPtr(n_reader, 0);
32636 xsd = gen_const_char_ptr(n_xsd, 1);
32638 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32639 desret_int(ret_val);
32641 des_xmlTextReaderPtr(n_reader, reader, 0);
32642 des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32643 xmlResetLastError();
32654 test_xmlTextReaderSchemaValidateCtxt(void) {
32657 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32660 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32662 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32664 int options; /* options (not used yet) */
32667 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32668 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32669 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32670 mem_base = xmlMemBlocks();
32671 reader = gen_xmlTextReaderPtr(n_reader, 0);
32672 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32673 options = gen_parseroptions(n_options, 2);
32675 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32676 desret_int(ret_val);
32678 des_xmlTextReaderPtr(n_reader, reader, 0);
32679 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32680 des_parseroptions(n_options, options, 2);
32681 xmlResetLastError();
32682 if (mem_base != xmlMemBlocks()) {
32683 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32684 xmlMemBlocks() - mem_base);
32686 printf(" %d", n_reader);
32687 printf(" %d", n_ctxt);
32688 printf(" %d", n_options);
32702 test_xmlTextReaderSetErrorHandler(void) {
32706 /* missing type support */
32712 test_xmlTextReaderSetParserProp(void) {
32715 #if defined(LIBXML_READER_ENABLED)
32718 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32720 int prop; /* the xmlParserProperties to set */
32722 int value; /* usually 0 or 1 to (de)activate it */
32725 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32726 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32727 for (n_value = 0;n_value < gen_nb_int;n_value++) {
32728 mem_base = xmlMemBlocks();
32729 reader = gen_xmlTextReaderPtr(n_reader, 0);
32730 prop = gen_int(n_prop, 1);
32731 value = gen_int(n_value, 2);
32733 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32734 desret_int(ret_val);
32736 des_xmlTextReaderPtr(n_reader, reader, 0);
32737 des_int(n_prop, prop, 1);
32738 des_int(n_value, value, 2);
32739 xmlResetLastError();
32740 if (mem_base != xmlMemBlocks()) {
32741 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32742 xmlMemBlocks() - mem_base);
32744 printf(" %d", n_reader);
32745 printf(" %d", n_prop);
32746 printf(" %d", n_value);
32760 test_xmlTextReaderSetSchema(void) {
32763 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32766 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32768 xmlSchemaPtr schema; /* a precompiled Schema schema */
32771 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32772 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32773 mem_base = xmlMemBlocks();
32774 reader = gen_xmlTextReaderPtr(n_reader, 0);
32775 schema = gen_xmlSchemaPtr(n_schema, 1);
32777 ret_val = xmlTextReaderSetSchema(reader, schema);
32778 desret_int(ret_val);
32780 des_xmlTextReaderPtr(n_reader, reader, 0);
32781 des_xmlSchemaPtr(n_schema, schema, 1);
32782 xmlResetLastError();
32783 if (mem_base != xmlMemBlocks()) {
32784 printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32785 xmlMemBlocks() - mem_base);
32787 printf(" %d", n_reader);
32788 printf(" %d", n_schema);
32801 test_xmlTextReaderSetStructuredErrorHandler(void) {
32805 /* missing type support */
32811 test_xmlTextReaderSetup(void) {
32814 #if defined(LIBXML_READER_ENABLED)
32817 xmlTextReaderPtr reader; /* an XML reader */
32819 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32821 const char * URL; /* the base URL to use for the document */
32823 char * encoding; /* the document encoding, or NULL */
32825 int options; /* a combination of xmlParserOption */
32828 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32829 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32830 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32831 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32832 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32833 mem_base = xmlMemBlocks();
32834 reader = gen_xmlTextReaderPtr(n_reader, 0);
32835 input = gen_xmlParserInputBufferPtr(n_input, 1);
32836 URL = gen_filepath(n_URL, 2);
32837 encoding = gen_const_char_ptr(n_encoding, 3);
32838 options = gen_parseroptions(n_options, 4);
32840 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32841 desret_int(ret_val);
32843 des_xmlTextReaderPtr(n_reader, reader, 0);
32844 des_filepath(n_URL, URL, 2);
32845 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32846 des_parseroptions(n_options, options, 4);
32847 xmlResetLastError();
32848 if (mem_base != xmlMemBlocks()) {
32849 printf("Leak of %d blocks found in xmlTextReaderSetup",
32850 xmlMemBlocks() - mem_base);
32852 printf(" %d", n_reader);
32853 printf(" %d", n_input);
32854 printf(" %d", n_URL);
32855 printf(" %d", n_encoding);
32856 printf(" %d", n_options);
32872 test_xmlTextReaderStandalone(void) {
32875 #if defined(LIBXML_READER_ENABLED)
32878 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32881 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32882 mem_base = xmlMemBlocks();
32883 reader = gen_xmlTextReaderPtr(n_reader, 0);
32885 ret_val = xmlTextReaderStandalone(reader);
32886 desret_int(ret_val);
32888 des_xmlTextReaderPtr(n_reader, reader, 0);
32889 xmlResetLastError();
32890 if (mem_base != xmlMemBlocks()) {
32891 printf("Leak of %d blocks found in xmlTextReaderStandalone",
32892 xmlMemBlocks() - mem_base);
32894 printf(" %d", n_reader);
32906 test_xmlTextReaderValue(void) {
32909 #if defined(LIBXML_READER_ENABLED)
32912 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32915 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32916 mem_base = xmlMemBlocks();
32917 reader = gen_xmlTextReaderPtr(n_reader, 0);
32919 ret_val = xmlTextReaderValue(reader);
32920 desret_xmlChar_ptr(ret_val);
32922 des_xmlTextReaderPtr(n_reader, reader, 0);
32923 xmlResetLastError();
32924 if (mem_base != xmlMemBlocks()) {
32925 printf("Leak of %d blocks found in xmlTextReaderValue",
32926 xmlMemBlocks() - mem_base);
32928 printf(" %d", n_reader);
32940 test_xmlTextReaderXmlLang(void) {
32943 #if defined(LIBXML_READER_ENABLED)
32946 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32949 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32950 mem_base = xmlMemBlocks();
32951 reader = gen_xmlTextReaderPtr(n_reader, 0);
32953 ret_val = xmlTextReaderXmlLang(reader);
32954 desret_xmlChar_ptr(ret_val);
32956 des_xmlTextReaderPtr(n_reader, reader, 0);
32957 xmlResetLastError();
32958 if (mem_base != xmlMemBlocks()) {
32959 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32960 xmlMemBlocks() - mem_base);
32962 printf(" %d", n_reader);
32973 test_xmlreader(void) {
32976 if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
32977 test_ret += test_xmlNewTextReader();
32978 test_ret += test_xmlNewTextReaderFilename();
32979 test_ret += test_xmlReaderForDoc();
32980 test_ret += test_xmlReaderForFile();
32981 test_ret += test_xmlReaderForMemory();
32982 test_ret += test_xmlReaderNewDoc();
32983 test_ret += test_xmlReaderNewFile();
32984 test_ret += test_xmlReaderNewMemory();
32985 test_ret += test_xmlReaderNewWalker();
32986 test_ret += test_xmlReaderWalker();
32987 test_ret += test_xmlTextReaderAttributeCount();
32988 test_ret += test_xmlTextReaderBaseUri();
32989 test_ret += test_xmlTextReaderByteConsumed();
32990 test_ret += test_xmlTextReaderClose();
32991 test_ret += test_xmlTextReaderConstBaseUri();
32992 test_ret += test_xmlTextReaderConstEncoding();
32993 test_ret += test_xmlTextReaderConstLocalName();
32994 test_ret += test_xmlTextReaderConstName();
32995 test_ret += test_xmlTextReaderConstNamespaceUri();
32996 test_ret += test_xmlTextReaderConstPrefix();
32997 test_ret += test_xmlTextReaderConstString();
32998 test_ret += test_xmlTextReaderConstValue();
32999 test_ret += test_xmlTextReaderConstXmlLang();
33000 test_ret += test_xmlTextReaderConstXmlVersion();
33001 test_ret += test_xmlTextReaderCurrentDoc();
33002 test_ret += test_xmlTextReaderCurrentNode();
33003 test_ret += test_xmlTextReaderDepth();
33004 test_ret += test_xmlTextReaderExpand();
33005 test_ret += test_xmlTextReaderGetAttribute();
33006 test_ret += test_xmlTextReaderGetAttributeNo();
33007 test_ret += test_xmlTextReaderGetAttributeNs();
33008 test_ret += test_xmlTextReaderGetErrorHandler();
33009 test_ret += test_xmlTextReaderGetParserColumnNumber();
33010 test_ret += test_xmlTextReaderGetParserLineNumber();
33011 test_ret += test_xmlTextReaderGetParserProp();
33012 test_ret += test_xmlTextReaderGetRemainder();
33013 test_ret += test_xmlTextReaderHasAttributes();
33014 test_ret += test_xmlTextReaderHasValue();
33015 test_ret += test_xmlTextReaderIsDefault();
33016 test_ret += test_xmlTextReaderIsEmptyElement();
33017 test_ret += test_xmlTextReaderIsNamespaceDecl();
33018 test_ret += test_xmlTextReaderIsValid();
33019 test_ret += test_xmlTextReaderLocalName();
33020 test_ret += test_xmlTextReaderLocatorBaseURI();
33021 test_ret += test_xmlTextReaderLocatorLineNumber();
33022 test_ret += test_xmlTextReaderLookupNamespace();
33023 test_ret += test_xmlTextReaderMoveToAttribute();
33024 test_ret += test_xmlTextReaderMoveToAttributeNo();
33025 test_ret += test_xmlTextReaderMoveToAttributeNs();
33026 test_ret += test_xmlTextReaderMoveToElement();
33027 test_ret += test_xmlTextReaderMoveToFirstAttribute();
33028 test_ret += test_xmlTextReaderMoveToNextAttribute();
33029 test_ret += test_xmlTextReaderName();
33030 test_ret += test_xmlTextReaderNamespaceUri();
33031 test_ret += test_xmlTextReaderNext();
33032 test_ret += test_xmlTextReaderNextSibling();
33033 test_ret += test_xmlTextReaderNodeType();
33034 test_ret += test_xmlTextReaderNormalization();
33035 test_ret += test_xmlTextReaderPrefix();
33036 test_ret += test_xmlTextReaderPreserve();
33037 test_ret += test_xmlTextReaderPreservePattern();
33038 test_ret += test_xmlTextReaderQuoteChar();
33039 test_ret += test_xmlTextReaderRead();
33040 test_ret += test_xmlTextReaderReadAttributeValue();
33041 test_ret += test_xmlTextReaderReadState();
33042 test_ret += test_xmlTextReaderRelaxNGSetSchema();
33043 test_ret += test_xmlTextReaderRelaxNGValidate();
33044 test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33045 test_ret += test_xmlTextReaderSchemaValidate();
33046 test_ret += test_xmlTextReaderSchemaValidateCtxt();
33047 test_ret += test_xmlTextReaderSetErrorHandler();
33048 test_ret += test_xmlTextReaderSetParserProp();
33049 test_ret += test_xmlTextReaderSetSchema();
33050 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33051 test_ret += test_xmlTextReaderSetup();
33052 test_ret += test_xmlTextReaderStandalone();
33053 test_ret += test_xmlTextReaderValue();
33054 test_ret += test_xmlTextReaderXmlLang();
33057 printf("Module xmlreader: %d errors\n", test_ret);
33062 test_xmlExpCtxtNbCons(void) {
33065 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33068 xmlExpCtxtPtr ctxt; /* an expression context */
33071 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33072 mem_base = xmlMemBlocks();
33073 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33075 ret_val = xmlExpCtxtNbCons(ctxt);
33076 desret_int(ret_val);
33078 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33079 xmlResetLastError();
33080 if (mem_base != xmlMemBlocks()) {
33081 printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33082 xmlMemBlocks() - mem_base);
33084 printf(" %d", n_ctxt);
33096 test_xmlExpCtxtNbNodes(void) {
33099 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33102 xmlExpCtxtPtr ctxt; /* an expression context */
33105 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33106 mem_base = xmlMemBlocks();
33107 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33109 ret_val = xmlExpCtxtNbNodes(ctxt);
33110 desret_int(ret_val);
33112 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33113 xmlResetLastError();
33114 if (mem_base != xmlMemBlocks()) {
33115 printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33116 xmlMemBlocks() - mem_base);
33118 printf(" %d", n_ctxt);
33130 test_xmlExpDump(void) {
33133 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33135 xmlBufferPtr buf; /* a buffer to receive the output */
33137 xmlExpNodePtr expr; /* the compiled expression */
33140 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33141 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33142 mem_base = xmlMemBlocks();
33143 buf = gen_xmlBufferPtr(n_buf, 0);
33144 expr = gen_xmlExpNodePtr(n_expr, 1);
33146 xmlExpDump(buf, expr);
33148 des_xmlBufferPtr(n_buf, buf, 0);
33149 des_xmlExpNodePtr(n_expr, expr, 1);
33150 xmlResetLastError();
33151 if (mem_base != xmlMemBlocks()) {
33152 printf("Leak of %d blocks found in xmlExpDump",
33153 xmlMemBlocks() - mem_base);
33155 printf(" %d", n_buf);
33156 printf(" %d", n_expr);
33169 test_xmlExpExpDerive(void) {
33173 /* missing type support */
33179 test_xmlExpGetLanguage(void) {
33182 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33185 xmlExpCtxtPtr ctxt; /* the expression context */
33187 xmlExpNodePtr exp; /* the expression */
33189 xmlChar ** langList; /* where to store the tokens */
33191 int len; /* the allocated length of @list */
33194 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33195 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33196 for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33197 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33198 mem_base = xmlMemBlocks();
33199 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33200 exp = gen_xmlExpNodePtr(n_exp, 1);
33201 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33202 len = gen_int(n_len, 3);
33204 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33205 desret_int(ret_val);
33207 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33208 des_xmlExpNodePtr(n_exp, exp, 1);
33209 des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33210 des_int(n_len, len, 3);
33211 xmlResetLastError();
33212 if (mem_base != xmlMemBlocks()) {
33213 printf("Leak of %d blocks found in xmlExpGetLanguage",
33214 xmlMemBlocks() - mem_base);
33216 printf(" %d", n_ctxt);
33217 printf(" %d", n_exp);
33218 printf(" %d", n_langList);
33219 printf(" %d", n_len);
33234 test_xmlExpGetStart(void) {
33237 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33240 xmlExpCtxtPtr ctxt; /* the expression context */
33242 xmlExpNodePtr exp; /* the expression */
33244 xmlChar ** tokList; /* where to store the tokens */
33246 int len; /* the allocated length of @list */
33249 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33250 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33251 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33252 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33253 mem_base = xmlMemBlocks();
33254 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33255 exp = gen_xmlExpNodePtr(n_exp, 1);
33256 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33257 len = gen_int(n_len, 3);
33259 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33260 desret_int(ret_val);
33262 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33263 des_xmlExpNodePtr(n_exp, exp, 1);
33264 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33265 des_int(n_len, len, 3);
33266 xmlResetLastError();
33267 if (mem_base != xmlMemBlocks()) {
33268 printf("Leak of %d blocks found in xmlExpGetStart",
33269 xmlMemBlocks() - mem_base);
33271 printf(" %d", n_ctxt);
33272 printf(" %d", n_exp);
33273 printf(" %d", n_tokList);
33274 printf(" %d", n_len);
33289 test_xmlExpIsNillable(void) {
33292 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33295 xmlExpNodePtr exp; /* the expression */
33298 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33299 mem_base = xmlMemBlocks();
33300 exp = gen_xmlExpNodePtr(n_exp, 0);
33302 ret_val = xmlExpIsNillable(exp);
33303 desret_int(ret_val);
33305 des_xmlExpNodePtr(n_exp, exp, 0);
33306 xmlResetLastError();
33307 if (mem_base != xmlMemBlocks()) {
33308 printf("Leak of %d blocks found in xmlExpIsNillable",
33309 xmlMemBlocks() - mem_base);
33311 printf(" %d", n_exp);
33323 test_xmlExpMaxToken(void) {
33326 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33329 xmlExpNodePtr expr; /* a compiled expression */
33332 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33333 mem_base = xmlMemBlocks();
33334 expr = gen_xmlExpNodePtr(n_expr, 0);
33336 ret_val = xmlExpMaxToken(expr);
33337 desret_int(ret_val);
33339 des_xmlExpNodePtr(n_expr, expr, 0);
33340 xmlResetLastError();
33341 if (mem_base != xmlMemBlocks()) {
33342 printf("Leak of %d blocks found in xmlExpMaxToken",
33343 xmlMemBlocks() - mem_base);
33345 printf(" %d", n_expr);
33357 test_xmlExpNewAtom(void) {
33361 /* missing type support */
33367 test_xmlExpNewCtxt(void) {
33371 /* missing type support */
33377 test_xmlExpNewOr(void) {
33381 /* missing type support */
33387 test_xmlExpNewRange(void) {
33391 /* missing type support */
33397 test_xmlExpNewSeq(void) {
33401 /* missing type support */
33407 test_xmlExpParse(void) {
33411 /* missing type support */
33417 test_xmlExpRef(void) {
33420 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33422 xmlExpNodePtr exp; /* the expression */
33425 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33426 mem_base = xmlMemBlocks();
33427 exp = gen_xmlExpNodePtr(n_exp, 0);
33431 des_xmlExpNodePtr(n_exp, exp, 0);
33432 xmlResetLastError();
33433 if (mem_base != xmlMemBlocks()) {
33434 printf("Leak of %d blocks found in xmlExpRef",
33435 xmlMemBlocks() - mem_base);
33437 printf(" %d", n_exp);
33449 test_xmlExpStringDerive(void) {
33453 /* missing type support */
33459 test_xmlExpSubsume(void) {
33462 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33465 xmlExpCtxtPtr ctxt; /* the expressions context */
33467 xmlExpNodePtr exp; /* the englobing expression */
33469 xmlExpNodePtr sub; /* the subexpression */
33472 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33473 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33474 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33475 mem_base = xmlMemBlocks();
33476 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33477 exp = gen_xmlExpNodePtr(n_exp, 1);
33478 sub = gen_xmlExpNodePtr(n_sub, 2);
33480 ret_val = xmlExpSubsume(ctxt, exp, sub);
33481 desret_int(ret_val);
33483 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33484 des_xmlExpNodePtr(n_exp, exp, 1);
33485 des_xmlExpNodePtr(n_sub, sub, 2);
33486 xmlResetLastError();
33487 if (mem_base != xmlMemBlocks()) {
33488 printf("Leak of %d blocks found in xmlExpSubsume",
33489 xmlMemBlocks() - mem_base);
33491 printf(" %d", n_ctxt);
33492 printf(" %d", n_exp);
33493 printf(" %d", n_sub);
33505 #ifdef LIBXML_REGEXP_ENABLED
33507 #define gen_nb_xmlRegExecCtxtPtr 1
33508 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33511 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33517 test_xmlRegExecErrInfo(void) {
33520 #if defined(LIBXML_REGEXP_ENABLED)
33523 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33525 xmlChar ** string; /* return value for the error string */
33527 int * nbval; /* pointer to the number of accepted values IN/OUT */
33529 int * nbneg; /* return number of negative transitions */
33531 xmlChar ** values; /* pointer to the array of acceptable values */
33533 int * terminal; /* return value if this was a terminal state */
33536 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33537 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33538 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33539 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33540 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33541 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33542 mem_base = xmlMemBlocks();
33543 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33544 string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33545 nbval = gen_int_ptr(n_nbval, 2);
33546 nbneg = gen_int_ptr(n_nbneg, 3);
33547 values = gen_xmlChar_ptr_ptr(n_values, 4);
33548 terminal = gen_int_ptr(n_terminal, 5);
33550 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33551 desret_int(ret_val);
33553 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33554 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33555 des_int_ptr(n_nbval, nbval, 2);
33556 des_int_ptr(n_nbneg, nbneg, 3);
33557 des_xmlChar_ptr_ptr(n_values, values, 4);
33558 des_int_ptr(n_terminal, terminal, 5);
33559 xmlResetLastError();
33560 if (mem_base != xmlMemBlocks()) {
33561 printf("Leak of %d blocks found in xmlRegExecErrInfo",
33562 xmlMemBlocks() - mem_base);
33564 printf(" %d", n_exec);
33565 printf(" %d", n_string);
33566 printf(" %d", n_nbval);
33567 printf(" %d", n_nbneg);
33568 printf(" %d", n_values);
33569 printf(" %d", n_terminal);
33586 test_xmlRegExecNextValues(void) {
33589 #if defined(LIBXML_REGEXP_ENABLED)
33592 xmlRegExecCtxtPtr exec; /* a regexp execution context */
33594 int * nbval; /* pointer to the number of accepted values IN/OUT */
33596 int * nbneg; /* return number of negative transitions */
33598 xmlChar ** values; /* pointer to the array of acceptable values */
33600 int * terminal; /* return value if this was a terminal state */
33603 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33604 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33605 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33606 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33607 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33608 mem_base = xmlMemBlocks();
33609 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33610 nbval = gen_int_ptr(n_nbval, 1);
33611 nbneg = gen_int_ptr(n_nbneg, 2);
33612 values = gen_xmlChar_ptr_ptr(n_values, 3);
33613 terminal = gen_int_ptr(n_terminal, 4);
33615 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33616 desret_int(ret_val);
33618 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33619 des_int_ptr(n_nbval, nbval, 1);
33620 des_int_ptr(n_nbneg, nbneg, 2);
33621 des_xmlChar_ptr_ptr(n_values, values, 3);
33622 des_int_ptr(n_terminal, terminal, 4);
33623 xmlResetLastError();
33624 if (mem_base != xmlMemBlocks()) {
33625 printf("Leak of %d blocks found in xmlRegExecNextValues",
33626 xmlMemBlocks() - mem_base);
33628 printf(" %d", n_exec);
33629 printf(" %d", n_nbval);
33630 printf(" %d", n_nbneg);
33631 printf(" %d", n_values);
33632 printf(" %d", n_terminal);
33648 test_xmlRegExecPushString(void) {
33651 #if defined(LIBXML_REGEXP_ENABLED)
33654 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33656 xmlChar * value; /* a string token input */
33658 void * data; /* data associated to the token to reuse in callbacks */
33661 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33662 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33663 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33664 mem_base = xmlMemBlocks();
33665 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33666 value = gen_const_xmlChar_ptr(n_value, 1);
33667 data = gen_userdata(n_data, 2);
33669 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33670 desret_int(ret_val);
33672 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33673 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33674 des_userdata(n_data, data, 2);
33675 xmlResetLastError();
33676 if (mem_base != xmlMemBlocks()) {
33677 printf("Leak of %d blocks found in xmlRegExecPushString",
33678 xmlMemBlocks() - mem_base);
33680 printf(" %d", n_exec);
33681 printf(" %d", n_value);
33682 printf(" %d", n_data);
33696 test_xmlRegExecPushString2(void) {
33699 #if defined(LIBXML_REGEXP_ENABLED)
33702 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33704 xmlChar * value; /* the first string token input */
33706 xmlChar * value2; /* the second string token input */
33708 void * data; /* data associated to the token to reuse in callbacks */
33711 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33712 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33713 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33714 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33715 mem_base = xmlMemBlocks();
33716 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33717 value = gen_const_xmlChar_ptr(n_value, 1);
33718 value2 = gen_const_xmlChar_ptr(n_value2, 2);
33719 data = gen_userdata(n_data, 3);
33721 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33722 desret_int(ret_val);
33724 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33725 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33726 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33727 des_userdata(n_data, data, 3);
33728 xmlResetLastError();
33729 if (mem_base != xmlMemBlocks()) {
33730 printf("Leak of %d blocks found in xmlRegExecPushString2",
33731 xmlMemBlocks() - mem_base);
33733 printf(" %d", n_exec);
33734 printf(" %d", n_value);
33735 printf(" %d", n_value2);
33736 printf(" %d", n_data);
33749 #ifdef LIBXML_REGEXP_ENABLED
33751 #define gen_nb_xmlRegexpPtr 1
33752 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33755 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33761 test_xmlRegNewExecCtxt(void) {
33765 /* missing type support */
33771 test_xmlRegexpCompile(void) {
33775 /* missing type support */
33781 test_xmlRegexpExec(void) {
33784 #if defined(LIBXML_REGEXP_ENABLED)
33787 xmlRegexpPtr comp; /* the compiled regular expression */
33789 xmlChar * content; /* the value to check against the regular expression */
33792 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33793 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33794 mem_base = xmlMemBlocks();
33795 comp = gen_xmlRegexpPtr(n_comp, 0);
33796 content = gen_const_xmlChar_ptr(n_content, 1);
33798 ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33799 desret_int(ret_val);
33801 des_xmlRegexpPtr(n_comp, comp, 0);
33802 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33803 xmlResetLastError();
33804 if (mem_base != xmlMemBlocks()) {
33805 printf("Leak of %d blocks found in xmlRegexpExec",
33806 xmlMemBlocks() - mem_base);
33808 printf(" %d", n_comp);
33809 printf(" %d", n_content);
33822 test_xmlRegexpIsDeterminist(void) {
33825 #if defined(LIBXML_REGEXP_ENABLED)
33828 xmlRegexpPtr comp; /* the compiled regular expression */
33831 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33832 mem_base = xmlMemBlocks();
33833 comp = gen_xmlRegexpPtr(n_comp, 0);
33835 ret_val = xmlRegexpIsDeterminist(comp);
33836 desret_int(ret_val);
33838 des_xmlRegexpPtr(n_comp, comp, 0);
33839 xmlResetLastError();
33840 if (mem_base != xmlMemBlocks()) {
33841 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33842 xmlMemBlocks() - mem_base);
33844 printf(" %d", n_comp);
33856 test_xmlRegexpPrint(void) {
33859 #if defined(LIBXML_REGEXP_ENABLED)
33861 FILE * output; /* the file for the output debug */
33863 xmlRegexpPtr regexp; /* the compiled regexp */
33866 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33867 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33868 mem_base = xmlMemBlocks();
33869 output = gen_FILE_ptr(n_output, 0);
33870 regexp = gen_xmlRegexpPtr(n_regexp, 1);
33872 xmlRegexpPrint(output, regexp);
33874 des_FILE_ptr(n_output, output, 0);
33875 des_xmlRegexpPtr(n_regexp, regexp, 1);
33876 xmlResetLastError();
33877 if (mem_base != xmlMemBlocks()) {
33878 printf("Leak of %d blocks found in xmlRegexpPrint",
33879 xmlMemBlocks() - mem_base);
33881 printf(" %d", n_output);
33882 printf(" %d", n_regexp);
33894 test_xmlregexp(void) {
33897 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33898 test_ret += test_xmlExpCtxtNbCons();
33899 test_ret += test_xmlExpCtxtNbNodes();
33900 test_ret += test_xmlExpDump();
33901 test_ret += test_xmlExpExpDerive();
33902 test_ret += test_xmlExpGetLanguage();
33903 test_ret += test_xmlExpGetStart();
33904 test_ret += test_xmlExpIsNillable();
33905 test_ret += test_xmlExpMaxToken();
33906 test_ret += test_xmlExpNewAtom();
33907 test_ret += test_xmlExpNewCtxt();
33908 test_ret += test_xmlExpNewOr();
33909 test_ret += test_xmlExpNewRange();
33910 test_ret += test_xmlExpNewSeq();
33911 test_ret += test_xmlExpParse();
33912 test_ret += test_xmlExpRef();
33913 test_ret += test_xmlExpStringDerive();
33914 test_ret += test_xmlExpSubsume();
33915 test_ret += test_xmlRegExecErrInfo();
33916 test_ret += test_xmlRegExecNextValues();
33917 test_ret += test_xmlRegExecPushString();
33918 test_ret += test_xmlRegExecPushString2();
33919 test_ret += test_xmlRegNewExecCtxt();
33920 test_ret += test_xmlRegexpCompile();
33921 test_ret += test_xmlRegexpExec();
33922 test_ret += test_xmlRegexpIsDeterminist();
33923 test_ret += test_xmlRegexpPrint();
33926 printf("Module xmlregexp: %d errors\n", test_ret);
33929 #ifdef LIBXML_OUTPUT_ENABLED
33931 #define gen_nb_xmlSaveCtxtPtr 1
33932 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33935 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33941 test_xmlSaveClose(void) {
33944 #if defined(LIBXML_OUTPUT_ENABLED)
33947 xmlSaveCtxtPtr ctxt; /* a document saving context */
33950 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33951 mem_base = xmlMemBlocks();
33952 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33954 ret_val = xmlSaveClose(ctxt);
33955 desret_int(ret_val);
33957 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33958 xmlResetLastError();
33959 if (mem_base != xmlMemBlocks()) {
33960 printf("Leak of %d blocks found in xmlSaveClose",
33961 xmlMemBlocks() - mem_base);
33963 printf(" %d", n_ctxt);
33975 test_xmlSaveDoc(void) {
33978 #if defined(LIBXML_OUTPUT_ENABLED)
33981 xmlSaveCtxtPtr ctxt; /* a document saving context */
33983 xmlDocPtr doc; /* a document */
33986 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33987 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33988 mem_base = xmlMemBlocks();
33989 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33990 doc = gen_xmlDocPtr(n_doc, 1);
33992 ret_val = xmlSaveDoc(ctxt, doc);
33993 desret_long(ret_val);
33995 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33996 des_xmlDocPtr(n_doc, doc, 1);
33997 xmlResetLastError();
33998 if (mem_base != xmlMemBlocks()) {
33999 printf("Leak of %d blocks found in xmlSaveDoc",
34000 xmlMemBlocks() - mem_base);
34002 printf(" %d", n_ctxt);
34003 printf(" %d", n_doc);
34016 test_xmlSaveFlush(void) {
34019 #if defined(LIBXML_OUTPUT_ENABLED)
34022 xmlSaveCtxtPtr ctxt; /* a document saving context */
34025 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34026 mem_base = xmlMemBlocks();
34027 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34029 ret_val = xmlSaveFlush(ctxt);
34030 desret_int(ret_val);
34032 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34033 xmlResetLastError();
34034 if (mem_base != xmlMemBlocks()) {
34035 printf("Leak of %d blocks found in xmlSaveFlush",
34036 xmlMemBlocks() - mem_base);
34038 printf(" %d", n_ctxt);
34050 test_xmlSaveSetAttrEscape(void) {
34054 /* missing type support */
34060 test_xmlSaveSetEscape(void) {
34064 /* missing type support */
34070 test_xmlSaveToBuffer(void) {
34074 /* missing type support */
34080 test_xmlSaveToFd(void) {
34084 /* missing type support */
34090 test_xmlSaveToFilename(void) {
34094 /* missing type support */
34100 test_xmlSaveTree(void) {
34103 #if defined(LIBXML_OUTPUT_ENABLED)
34106 xmlSaveCtxtPtr ctxt; /* a document saving context */
34108 xmlNodePtr node; /* the top node of the subtree to save */
34111 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34112 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34113 mem_base = xmlMemBlocks();
34114 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34115 node = gen_xmlNodePtr(n_node, 1);
34117 ret_val = xmlSaveTree(ctxt, node);
34118 desret_long(ret_val);
34120 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34121 des_xmlNodePtr(n_node, node, 1);
34122 xmlResetLastError();
34123 if (mem_base != xmlMemBlocks()) {
34124 printf("Leak of %d blocks found in xmlSaveTree",
34125 xmlMemBlocks() - mem_base);
34127 printf(" %d", n_ctxt);
34128 printf(" %d", n_node);
34140 test_xmlsave(void) {
34143 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34144 test_ret += test_xmlSaveClose();
34145 test_ret += test_xmlSaveDoc();
34146 test_ret += test_xmlSaveFlush();
34147 test_ret += test_xmlSaveSetAttrEscape();
34148 test_ret += test_xmlSaveSetEscape();
34149 test_ret += test_xmlSaveToBuffer();
34150 test_ret += test_xmlSaveToFd();
34151 test_ret += test_xmlSaveToFilename();
34152 test_ret += test_xmlSaveTree();
34155 printf("Module xmlsave: %d errors\n", test_ret);
34160 test_xmlSchemaDump(void) {
34163 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34165 FILE * output; /* the file output */
34167 xmlSchemaPtr schema; /* a schema structure */
34170 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34171 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34172 mem_base = xmlMemBlocks();
34173 output = gen_FILE_ptr(n_output, 0);
34174 schema = gen_xmlSchemaPtr(n_schema, 1);
34176 xmlSchemaDump(output, schema);
34178 des_FILE_ptr(n_output, output, 0);
34179 des_xmlSchemaPtr(n_schema, schema, 1);
34180 xmlResetLastError();
34181 if (mem_base != xmlMemBlocks()) {
34182 printf("Leak of %d blocks found in xmlSchemaDump",
34183 xmlMemBlocks() - mem_base);
34185 printf(" %d", n_output);
34186 printf(" %d", n_schema);
34197 #ifdef LIBXML_SCHEMAS_ENABLED
34199 #define gen_nb_xmlSchemaParserCtxtPtr 1
34200 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34203 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34207 #ifdef LIBXML_SCHEMAS_ENABLED
34209 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
34210 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34213 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34217 #ifdef LIBXML_SCHEMAS_ENABLED
34219 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
34220 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34223 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34229 test_xmlSchemaGetParserErrors(void) {
34232 #if defined(LIBXML_SCHEMAS_ENABLED)
34235 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34237 xmlSchemaValidityErrorFunc * err; /* the error callback result */
34239 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34241 void ** ctx; /* contextual data for the callbacks result */
34244 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34245 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34246 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34247 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34248 mem_base = xmlMemBlocks();
34249 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34250 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34251 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34252 ctx = gen_void_ptr_ptr(n_ctx, 3);
34254 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34255 desret_int(ret_val);
34257 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34258 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34259 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34260 des_void_ptr_ptr(n_ctx, ctx, 3);
34261 xmlResetLastError();
34262 if (mem_base != xmlMemBlocks()) {
34263 printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34264 xmlMemBlocks() - mem_base);
34266 printf(" %d", n_ctxt);
34267 printf(" %d", n_err);
34268 printf(" %d", n_warn);
34269 printf(" %d", n_ctx);
34284 test_xmlSchemaGetValidErrors(void) {
34287 #if defined(LIBXML_SCHEMAS_ENABLED)
34290 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34292 xmlSchemaValidityErrorFunc * err; /* the error function result */
34294 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34296 void ** ctx; /* the functions context result */
34299 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34300 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34301 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34302 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34303 mem_base = xmlMemBlocks();
34304 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34305 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34306 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34307 ctx = gen_void_ptr_ptr(n_ctx, 3);
34309 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34310 desret_int(ret_val);
34312 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34313 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34314 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34315 des_void_ptr_ptr(n_ctx, ctx, 3);
34316 xmlResetLastError();
34317 if (mem_base != xmlMemBlocks()) {
34318 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34319 xmlMemBlocks() - mem_base);
34321 printf(" %d", n_ctxt);
34322 printf(" %d", n_err);
34323 printf(" %d", n_warn);
34324 printf(" %d", n_ctx);
34339 test_xmlSchemaIsValid(void) {
34342 #if defined(LIBXML_SCHEMAS_ENABLED)
34345 xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34348 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34349 mem_base = xmlMemBlocks();
34350 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34352 ret_val = xmlSchemaIsValid(ctxt);
34353 desret_int(ret_val);
34355 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34356 xmlResetLastError();
34357 if (mem_base != xmlMemBlocks()) {
34358 printf("Leak of %d blocks found in xmlSchemaIsValid",
34359 xmlMemBlocks() - mem_base);
34361 printf(" %d", n_ctxt);
34373 test_xmlSchemaNewDocParserCtxt(void) {
34376 #if defined(LIBXML_SCHEMAS_ENABLED)
34378 xmlSchemaParserCtxtPtr ret_val;
34379 xmlDocPtr doc; /* a preparsed document tree */
34382 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34383 mem_base = xmlMemBlocks();
34384 doc = gen_xmlDocPtr(n_doc, 0);
34386 ret_val = xmlSchemaNewDocParserCtxt(doc);
34387 desret_xmlSchemaParserCtxtPtr(ret_val);
34389 des_xmlDocPtr(n_doc, doc, 0);
34390 xmlResetLastError();
34391 if (mem_base != xmlMemBlocks()) {
34392 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34393 xmlMemBlocks() - mem_base);
34395 printf(" %d", n_doc);
34407 test_xmlSchemaNewMemParserCtxt(void) {
34410 #if defined(LIBXML_SCHEMAS_ENABLED)
34412 xmlSchemaParserCtxtPtr ret_val;
34413 char * buffer; /* a pointer to a char array containing the schemas */
34415 int size; /* the size of the array */
34418 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34419 for (n_size = 0;n_size < gen_nb_int;n_size++) {
34420 mem_base = xmlMemBlocks();
34421 buffer = gen_const_char_ptr(n_buffer, 0);
34422 size = gen_int(n_size, 1);
34424 ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34425 desret_xmlSchemaParserCtxtPtr(ret_val);
34427 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34428 des_int(n_size, size, 1);
34429 xmlResetLastError();
34430 if (mem_base != xmlMemBlocks()) {
34431 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34432 xmlMemBlocks() - mem_base);
34434 printf(" %d", n_buffer);
34435 printf(" %d", n_size);
34448 test_xmlSchemaNewParserCtxt(void) {
34451 #if defined(LIBXML_SCHEMAS_ENABLED)
34453 xmlSchemaParserCtxtPtr ret_val;
34454 char * URL; /* the location of the schema */
34457 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34458 mem_base = xmlMemBlocks();
34459 URL = gen_const_char_ptr(n_URL, 0);
34461 ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34462 desret_xmlSchemaParserCtxtPtr(ret_val);
34464 des_const_char_ptr(n_URL, (const char *)URL, 0);
34465 xmlResetLastError();
34466 if (mem_base != xmlMemBlocks()) {
34467 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34468 xmlMemBlocks() - mem_base);
34470 printf(" %d", n_URL);
34482 test_xmlSchemaNewValidCtxt(void) {
34486 /* missing type support */
34492 test_xmlSchemaParse(void) {
34496 /* missing type support */
34500 #ifdef LIBXML_SCHEMAS_ENABLED
34502 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34503 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34506 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34512 test_xmlSchemaSAXPlug(void) {
34516 /* missing type support */
34520 #ifdef LIBXML_SCHEMAS_ENABLED
34522 #define gen_nb_xmlSchemaSAXPlugPtr 1
34523 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34526 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34532 test_xmlSchemaSAXUnplug(void) {
34535 #if defined(LIBXML_SCHEMAS_ENABLED)
34538 xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34541 for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34542 mem_base = xmlMemBlocks();
34543 plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34545 ret_val = xmlSchemaSAXUnplug(plug);
34546 desret_int(ret_val);
34548 des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34549 xmlResetLastError();
34550 if (mem_base != xmlMemBlocks()) {
34551 printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34552 xmlMemBlocks() - mem_base);
34554 printf(" %d", n_plug);
34566 test_xmlSchemaSetParserErrors(void) {
34570 /* missing type support */
34576 test_xmlSchemaSetParserStructuredErrors(void) {
34580 /* missing type support */
34586 test_xmlSchemaSetValidErrors(void) {
34590 /* missing type support */
34596 test_xmlSchemaSetValidOptions(void) {
34599 #if defined(LIBXML_SCHEMAS_ENABLED)
34602 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34604 int options; /* a combination of xmlSchemaValidOption */
34607 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34608 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34609 mem_base = xmlMemBlocks();
34610 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34611 options = gen_int(n_options, 1);
34613 ret_val = xmlSchemaSetValidOptions(ctxt, options);
34614 desret_int(ret_val);
34616 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34617 des_int(n_options, options, 1);
34618 xmlResetLastError();
34619 if (mem_base != xmlMemBlocks()) {
34620 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34621 xmlMemBlocks() - mem_base);
34623 printf(" %d", n_ctxt);
34624 printf(" %d", n_options);
34637 test_xmlSchemaSetValidStructuredErrors(void) {
34641 /* missing type support */
34647 test_xmlSchemaValidCtxtGetOptions(void) {
34650 #if defined(LIBXML_SCHEMAS_ENABLED)
34653 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34656 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34657 mem_base = xmlMemBlocks();
34658 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34660 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34661 desret_int(ret_val);
34663 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34664 xmlResetLastError();
34665 if (mem_base != xmlMemBlocks()) {
34666 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34667 xmlMemBlocks() - mem_base);
34669 printf(" %d", n_ctxt);
34681 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34684 #if defined(LIBXML_SCHEMAS_ENABLED)
34686 xmlParserCtxtPtr ret_val;
34687 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34690 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34691 mem_base = xmlMemBlocks();
34692 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34694 ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34695 desret_xmlParserCtxtPtr(ret_val);
34697 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34698 xmlResetLastError();
34699 if (mem_base != xmlMemBlocks()) {
34700 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34701 xmlMemBlocks() - mem_base);
34703 printf(" %d", n_ctxt);
34715 test_xmlSchemaValidateDoc(void) {
34718 #if defined(LIBXML_SCHEMAS_ENABLED)
34721 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34723 xmlDocPtr doc; /* a parsed document tree */
34726 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34727 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34728 mem_base = xmlMemBlocks();
34729 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34730 doc = gen_xmlDocPtr(n_doc, 1);
34732 ret_val = xmlSchemaValidateDoc(ctxt, doc);
34733 desret_int(ret_val);
34735 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34736 des_xmlDocPtr(n_doc, doc, 1);
34737 xmlResetLastError();
34738 if (mem_base != xmlMemBlocks()) {
34739 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34740 xmlMemBlocks() - mem_base);
34742 printf(" %d", n_ctxt);
34743 printf(" %d", n_doc);
34756 test_xmlSchemaValidateFile(void) {
34759 #if defined(LIBXML_SCHEMAS_ENABLED)
34762 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34764 const char * filename; /* the URI of the instance */
34766 int options; /* a future set of options, currently unused */
34769 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34770 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34771 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34772 mem_base = xmlMemBlocks();
34773 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34774 filename = gen_filepath(n_filename, 1);
34775 options = gen_int(n_options, 2);
34777 ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34778 desret_int(ret_val);
34780 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34781 des_filepath(n_filename, filename, 1);
34782 des_int(n_options, options, 2);
34783 xmlResetLastError();
34784 if (mem_base != xmlMemBlocks()) {
34785 printf("Leak of %d blocks found in xmlSchemaValidateFile",
34786 xmlMemBlocks() - mem_base);
34788 printf(" %d", n_ctxt);
34789 printf(" %d", n_filename);
34790 printf(" %d", n_options);
34804 test_xmlSchemaValidateOneElement(void) {
34807 #if defined(LIBXML_SCHEMAS_ENABLED)
34810 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34812 xmlNodePtr elem; /* an element node */
34815 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34816 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34817 mem_base = xmlMemBlocks();
34818 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34819 elem = gen_xmlNodePtr(n_elem, 1);
34821 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34822 desret_int(ret_val);
34824 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34825 des_xmlNodePtr(n_elem, elem, 1);
34826 xmlResetLastError();
34827 if (mem_base != xmlMemBlocks()) {
34828 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34829 xmlMemBlocks() - mem_base);
34831 printf(" %d", n_ctxt);
34832 printf(" %d", n_elem);
34845 test_xmlSchemaValidateSetFilename(void) {
34848 #if defined(LIBXML_SCHEMAS_ENABLED)
34850 xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34852 const char * filename; /* the file name */
34855 for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34856 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34857 mem_base = xmlMemBlocks();
34858 vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34859 filename = gen_filepath(n_filename, 1);
34861 xmlSchemaValidateSetFilename(vctxt, filename);
34863 des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34864 des_filepath(n_filename, filename, 1);
34865 xmlResetLastError();
34866 if (mem_base != xmlMemBlocks()) {
34867 printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34868 xmlMemBlocks() - mem_base);
34870 printf(" %d", n_vctxt);
34871 printf(" %d", n_filename);
34884 test_xmlSchemaValidateSetLocator(void) {
34888 /* missing type support */
34894 test_xmlSchemaValidateStream(void) {
34897 #if defined(LIBXML_SCHEMAS_ENABLED)
34900 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34902 xmlParserInputBufferPtr input; /* the input to use for reading the data */
34904 xmlCharEncoding enc; /* an optional encoding information */
34906 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34908 void * user_data; /* the context to provide to the SAX handler. */
34911 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34912 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34913 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34914 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34915 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34916 mem_base = xmlMemBlocks();
34917 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34918 input = gen_xmlParserInputBufferPtr(n_input, 1);
34919 enc = gen_xmlCharEncoding(n_enc, 2);
34920 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34921 user_data = gen_userdata(n_user_data, 4);
34923 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34924 desret_int(ret_val);
34926 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34927 des_xmlParserInputBufferPtr(n_input, input, 1);
34928 des_xmlCharEncoding(n_enc, enc, 2);
34929 des_xmlSAXHandlerPtr(n_sax, sax, 3);
34930 des_userdata(n_user_data, user_data, 4);
34931 xmlResetLastError();
34932 if (mem_base != xmlMemBlocks()) {
34933 printf("Leak of %d blocks found in xmlSchemaValidateStream",
34934 xmlMemBlocks() - mem_base);
34936 printf(" %d", n_ctxt);
34937 printf(" %d", n_input);
34938 printf(" %d", n_enc);
34939 printf(" %d", n_sax);
34940 printf(" %d", n_user_data);
34955 test_xmlschemas(void) {
34958 if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
34959 test_ret += test_xmlSchemaDump();
34960 test_ret += test_xmlSchemaGetParserErrors();
34961 test_ret += test_xmlSchemaGetValidErrors();
34962 test_ret += test_xmlSchemaIsValid();
34963 test_ret += test_xmlSchemaNewDocParserCtxt();
34964 test_ret += test_xmlSchemaNewMemParserCtxt();
34965 test_ret += test_xmlSchemaNewParserCtxt();
34966 test_ret += test_xmlSchemaNewValidCtxt();
34967 test_ret += test_xmlSchemaParse();
34968 test_ret += test_xmlSchemaSAXPlug();
34969 test_ret += test_xmlSchemaSAXUnplug();
34970 test_ret += test_xmlSchemaSetParserErrors();
34971 test_ret += test_xmlSchemaSetParserStructuredErrors();
34972 test_ret += test_xmlSchemaSetValidErrors();
34973 test_ret += test_xmlSchemaSetValidOptions();
34974 test_ret += test_xmlSchemaSetValidStructuredErrors();
34975 test_ret += test_xmlSchemaValidCtxtGetOptions();
34976 test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34977 test_ret += test_xmlSchemaValidateDoc();
34978 test_ret += test_xmlSchemaValidateFile();
34979 test_ret += test_xmlSchemaValidateOneElement();
34980 test_ret += test_xmlSchemaValidateSetFilename();
34981 test_ret += test_xmlSchemaValidateSetLocator();
34982 test_ret += test_xmlSchemaValidateStream();
34985 printf("Module xmlschemas: %d errors\n", test_ret);
34988 #ifdef LIBXML_SCHEMAS_ENABLED
34990 #define gen_nb_xmlSchemaFacetPtr 1
34991 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34994 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34998 #ifdef LIBXML_SCHEMAS_ENABLED
35000 #define gen_nb_xmlSchemaTypePtr 1
35001 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35004 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35010 test_xmlSchemaCheckFacet(void) {
35013 #if defined(LIBXML_SCHEMAS_ENABLED)
35016 xmlSchemaFacetPtr facet; /* the facet */
35018 xmlSchemaTypePtr typeDecl; /* the schema type definition */
35020 xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35022 xmlChar * name; /* the optional name of the type */
35025 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35026 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35027 for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35028 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35029 mem_base = xmlMemBlocks();
35030 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35031 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35032 pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35033 name = gen_const_xmlChar_ptr(n_name, 3);
35035 ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35036 desret_int(ret_val);
35038 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35039 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35040 des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35041 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35042 xmlResetLastError();
35043 if (mem_base != xmlMemBlocks()) {
35044 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35045 xmlMemBlocks() - mem_base);
35047 printf(" %d", n_facet);
35048 printf(" %d", n_typeDecl);
35049 printf(" %d", n_pctxt);
35050 printf(" %d", n_name);
35065 test_xmlSchemaCleanupTypes(void) {
35068 #if defined(LIBXML_SCHEMAS_ENABLED)
35071 xmlSchemaCleanupTypes();
35073 xmlResetLastError();
35082 test_xmlSchemaCollapseString(void) {
35085 #if defined(LIBXML_SCHEMAS_ENABLED)
35088 xmlChar * value; /* a value */
35091 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35092 mem_base = xmlMemBlocks();
35093 value = gen_const_xmlChar_ptr(n_value, 0);
35095 ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35096 desret_xmlChar_ptr(ret_val);
35098 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35099 xmlResetLastError();
35100 if (mem_base != xmlMemBlocks()) {
35101 printf("Leak of %d blocks found in xmlSchemaCollapseString",
35102 xmlMemBlocks() - mem_base);
35104 printf(" %d", n_value);
35114 #ifdef LIBXML_SCHEMAS_ENABLED
35116 #define gen_nb_xmlSchemaValPtr 1
35117 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35120 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35126 test_xmlSchemaCompareValues(void) {
35129 #if defined(LIBXML_SCHEMAS_ENABLED)
35132 xmlSchemaValPtr x; /* a first value */
35134 xmlSchemaValPtr y; /* a second value */
35137 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35138 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35139 mem_base = xmlMemBlocks();
35140 x = gen_xmlSchemaValPtr(n_x, 0);
35141 y = gen_xmlSchemaValPtr(n_y, 1);
35143 ret_val = xmlSchemaCompareValues(x, y);
35144 desret_int(ret_val);
35146 des_xmlSchemaValPtr(n_x, x, 0);
35147 des_xmlSchemaValPtr(n_y, y, 1);
35148 xmlResetLastError();
35149 if (mem_base != xmlMemBlocks()) {
35150 printf("Leak of %d blocks found in xmlSchemaCompareValues",
35151 xmlMemBlocks() - mem_base);
35153 printf(" %d", n_x);
35154 printf(" %d", n_y);
35167 test_xmlSchemaCompareValuesWhtsp(void) {
35170 #if defined(LIBXML_SCHEMAS_ENABLED)
35173 xmlSchemaValPtr x; /* a first value */
35175 xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35177 xmlSchemaValPtr y; /* a second value */
35179 xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35182 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35183 for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35184 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35185 for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35186 mem_base = xmlMemBlocks();
35187 x = gen_xmlSchemaValPtr(n_x, 0);
35188 xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35189 y = gen_xmlSchemaValPtr(n_y, 2);
35190 yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35192 ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35193 desret_int(ret_val);
35195 des_xmlSchemaValPtr(n_x, x, 0);
35196 des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35197 des_xmlSchemaValPtr(n_y, y, 2);
35198 des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35199 xmlResetLastError();
35200 if (mem_base != xmlMemBlocks()) {
35201 printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35202 xmlMemBlocks() - mem_base);
35204 printf(" %d", n_x);
35205 printf(" %d", n_xws);
35206 printf(" %d", n_y);
35207 printf(" %d", n_yws);
35222 test_xmlSchemaCopyValue(void) {
35226 /* missing type support */
35232 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35235 #if defined(LIBXML_SCHEMAS_ENABLED)
35237 xmlSchemaTypePtr ret_val;
35238 xmlSchemaTypePtr type; /* the built-in simple type. */
35241 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35242 mem_base = xmlMemBlocks();
35243 type = gen_xmlSchemaTypePtr(n_type, 0);
35245 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35246 desret_xmlSchemaTypePtr(ret_val);
35248 des_xmlSchemaTypePtr(n_type, type, 0);
35249 xmlResetLastError();
35250 if (mem_base != xmlMemBlocks()) {
35251 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35252 xmlMemBlocks() - mem_base);
35254 printf(" %d", n_type);
35266 test_xmlSchemaGetBuiltInType(void) {
35269 #if defined(LIBXML_SCHEMAS_ENABLED)
35270 xmlSchemaTypePtr ret_val;
35271 xmlSchemaValType type; /* the type of the built in type */
35274 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35275 type = gen_xmlSchemaValType(n_type, 0);
35277 ret_val = xmlSchemaGetBuiltInType(type);
35278 desret_xmlSchemaTypePtr(ret_val);
35280 des_xmlSchemaValType(n_type, type, 0);
35281 xmlResetLastError();
35291 test_xmlSchemaGetCanonValue(void) {
35294 #if defined(LIBXML_SCHEMAS_ENABLED)
35297 xmlSchemaValPtr val; /* the precomputed value */
35299 xmlChar ** retValue; /* the returned value */
35302 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35303 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35304 mem_base = xmlMemBlocks();
35305 val = gen_xmlSchemaValPtr(n_val, 0);
35306 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35308 ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35309 desret_int(ret_val);
35311 des_xmlSchemaValPtr(n_val, val, 0);
35312 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35313 xmlResetLastError();
35314 if (mem_base != xmlMemBlocks()) {
35315 printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35316 xmlMemBlocks() - mem_base);
35318 printf(" %d", n_val);
35319 printf(" %d", n_retValue);
35332 test_xmlSchemaGetCanonValueWhtsp(void) {
35335 #if defined(LIBXML_SCHEMAS_ENABLED)
35338 xmlSchemaValPtr val; /* the precomputed value */
35340 xmlChar ** retValue; /* the returned value */
35342 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35345 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35346 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35347 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35348 mem_base = xmlMemBlocks();
35349 val = gen_xmlSchemaValPtr(n_val, 0);
35350 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35351 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35353 ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35354 desret_int(ret_val);
35356 des_xmlSchemaValPtr(n_val, val, 0);
35357 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35358 des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35359 xmlResetLastError();
35360 if (mem_base != xmlMemBlocks()) {
35361 printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35362 xmlMemBlocks() - mem_base);
35364 printf(" %d", n_val);
35365 printf(" %d", n_retValue);
35366 printf(" %d", n_ws);
35380 test_xmlSchemaGetFacetValueAsULong(void) {
35383 #if defined(LIBXML_SCHEMAS_ENABLED)
35385 unsigned long ret_val;
35386 xmlSchemaFacetPtr facet; /* an schemas type facet */
35389 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35390 mem_base = xmlMemBlocks();
35391 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35393 ret_val = xmlSchemaGetFacetValueAsULong(facet);
35394 desret_unsigned_long(ret_val);
35396 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35397 xmlResetLastError();
35398 if (mem_base != xmlMemBlocks()) {
35399 printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35400 xmlMemBlocks() - mem_base);
35402 printf(" %d", n_facet);
35414 test_xmlSchemaGetPredefinedType(void) {
35417 #if defined(LIBXML_SCHEMAS_ENABLED)
35419 xmlSchemaTypePtr ret_val;
35420 xmlChar * name; /* the type name */
35422 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35425 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35426 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35427 mem_base = xmlMemBlocks();
35428 name = gen_const_xmlChar_ptr(n_name, 0);
35429 ns = gen_const_xmlChar_ptr(n_ns, 1);
35431 ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35432 desret_xmlSchemaTypePtr(ret_val);
35434 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35435 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35436 xmlResetLastError();
35437 if (mem_base != xmlMemBlocks()) {
35438 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35439 xmlMemBlocks() - mem_base);
35441 printf(" %d", n_name);
35442 printf(" %d", n_ns);
35455 test_xmlSchemaGetValType(void) {
35458 #if defined(LIBXML_SCHEMAS_ENABLED)
35460 xmlSchemaValType ret_val;
35461 xmlSchemaValPtr val; /* a schemas value */
35464 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35465 mem_base = xmlMemBlocks();
35466 val = gen_xmlSchemaValPtr(n_val, 0);
35468 ret_val = xmlSchemaGetValType(val);
35469 desret_xmlSchemaValType(ret_val);
35471 des_xmlSchemaValPtr(n_val, val, 0);
35472 xmlResetLastError();
35473 if (mem_base != xmlMemBlocks()) {
35474 printf("Leak of %d blocks found in xmlSchemaGetValType",
35475 xmlMemBlocks() - mem_base);
35477 printf(" %d", n_val);
35489 test_xmlSchemaInitTypes(void) {
35492 #if defined(LIBXML_SCHEMAS_ENABLED)
35495 xmlSchemaInitTypes();
35497 xmlResetLastError();
35506 test_xmlSchemaIsBuiltInTypeFacet(void) {
35509 #if defined(LIBXML_SCHEMAS_ENABLED)
35512 xmlSchemaTypePtr type; /* the built-in type */
35514 int facetType; /* the facet type */
35517 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35518 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35519 mem_base = xmlMemBlocks();
35520 type = gen_xmlSchemaTypePtr(n_type, 0);
35521 facetType = gen_int(n_facetType, 1);
35523 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35524 desret_int(ret_val);
35526 des_xmlSchemaTypePtr(n_type, type, 0);
35527 des_int(n_facetType, facetType, 1);
35528 xmlResetLastError();
35529 if (mem_base != xmlMemBlocks()) {
35530 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35531 xmlMemBlocks() - mem_base);
35533 printf(" %d", n_type);
35534 printf(" %d", n_facetType);
35547 test_xmlSchemaNewFacet(void) {
35551 /* missing type support */
35557 test_xmlSchemaNewNOTATIONValue(void) {
35561 /* missing type support */
35567 test_xmlSchemaNewQNameValue(void) {
35571 /* missing type support */
35577 test_xmlSchemaNewStringValue(void) {
35581 /* missing type support */
35585 #ifdef LIBXML_SCHEMAS_ENABLED
35587 #define gen_nb_xmlSchemaValPtr_ptr 1
35588 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35591 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35597 test_xmlSchemaValPredefTypeNode(void) {
35600 #if defined(LIBXML_SCHEMAS_ENABLED)
35603 xmlSchemaTypePtr type; /* the predefined type */
35605 xmlChar * value; /* the value to check */
35607 xmlSchemaValPtr * val; /* the return computed value */
35609 xmlNodePtr node; /* the node containing the value */
35612 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35613 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35614 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35615 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35616 mem_base = xmlMemBlocks();
35617 type = gen_xmlSchemaTypePtr(n_type, 0);
35618 value = gen_const_xmlChar_ptr(n_value, 1);
35619 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35620 node = gen_xmlNodePtr(n_node, 3);
35622 ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35623 desret_int(ret_val);
35625 des_xmlSchemaTypePtr(n_type, type, 0);
35626 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35627 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35628 des_xmlNodePtr(n_node, node, 3);
35629 xmlResetLastError();
35630 if (mem_base != xmlMemBlocks()) {
35631 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35632 xmlMemBlocks() - mem_base);
35634 printf(" %d", n_type);
35635 printf(" %d", n_value);
35636 printf(" %d", n_val);
35637 printf(" %d", n_node);
35652 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35655 #if defined(LIBXML_SCHEMAS_ENABLED)
35658 xmlSchemaTypePtr type; /* the predefined type */
35660 xmlChar * value; /* the value to check */
35662 xmlSchemaValPtr * val; /* the return computed value */
35664 xmlNodePtr node; /* the node containing the value */
35667 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35668 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35669 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35670 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35671 mem_base = xmlMemBlocks();
35672 type = gen_xmlSchemaTypePtr(n_type, 0);
35673 value = gen_const_xmlChar_ptr(n_value, 1);
35674 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35675 node = gen_xmlNodePtr(n_node, 3);
35677 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35678 desret_int(ret_val);
35680 des_xmlSchemaTypePtr(n_type, type, 0);
35681 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35682 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35683 des_xmlNodePtr(n_node, node, 3);
35684 xmlResetLastError();
35685 if (mem_base != xmlMemBlocks()) {
35686 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35687 xmlMemBlocks() - mem_base);
35689 printf(" %d", n_type);
35690 printf(" %d", n_value);
35691 printf(" %d", n_val);
35692 printf(" %d", n_node);
35707 test_xmlSchemaValidateFacet(void) {
35710 #if defined(LIBXML_SCHEMAS_ENABLED)
35713 xmlSchemaTypePtr base; /* the base type */
35715 xmlSchemaFacetPtr facet; /* the facet to check */
35717 xmlChar * value; /* the lexical repr of the value to validate */
35719 xmlSchemaValPtr val; /* the precomputed value */
35722 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35723 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35724 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35725 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35726 mem_base = xmlMemBlocks();
35727 base = gen_xmlSchemaTypePtr(n_base, 0);
35728 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35729 value = gen_const_xmlChar_ptr(n_value, 2);
35730 val = gen_xmlSchemaValPtr(n_val, 3);
35732 ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35733 desret_int(ret_val);
35735 des_xmlSchemaTypePtr(n_base, base, 0);
35736 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35737 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35738 des_xmlSchemaValPtr(n_val, val, 3);
35739 xmlResetLastError();
35740 if (mem_base != xmlMemBlocks()) {
35741 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35742 xmlMemBlocks() - mem_base);
35744 printf(" %d", n_base);
35745 printf(" %d", n_facet);
35746 printf(" %d", n_value);
35747 printf(" %d", n_val);
35762 test_xmlSchemaValidateFacetWhtsp(void) {
35765 #if defined(LIBXML_SCHEMAS_ENABLED)
35768 xmlSchemaFacetPtr facet; /* the facet to check */
35770 xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35772 xmlSchemaValType valType; /* the built-in type of the value */
35774 xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35776 xmlSchemaValPtr val; /* the precomputed value */
35778 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35781 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35782 for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35783 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35784 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35785 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35786 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35787 mem_base = xmlMemBlocks();
35788 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35789 fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35790 valType = gen_xmlSchemaValType(n_valType, 2);
35791 value = gen_const_xmlChar_ptr(n_value, 3);
35792 val = gen_xmlSchemaValPtr(n_val, 4);
35793 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35795 ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35796 desret_int(ret_val);
35798 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35799 des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35800 des_xmlSchemaValType(n_valType, valType, 2);
35801 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35802 des_xmlSchemaValPtr(n_val, val, 4);
35803 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35804 xmlResetLastError();
35805 if (mem_base != xmlMemBlocks()) {
35806 printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35807 xmlMemBlocks() - mem_base);
35809 printf(" %d", n_facet);
35810 printf(" %d", n_fws);
35811 printf(" %d", n_valType);
35812 printf(" %d", n_value);
35813 printf(" %d", n_val);
35814 printf(" %d", n_ws);
35831 test_xmlSchemaValidateLengthFacet(void) {
35834 #if defined(LIBXML_SCHEMAS_ENABLED)
35837 xmlSchemaTypePtr type; /* the built-in type */
35839 xmlSchemaFacetPtr facet; /* the facet to check */
35841 xmlChar * value; /* the lexical repr. of the value to be validated */
35843 xmlSchemaValPtr val; /* the precomputed value */
35845 unsigned long * length; /* the actual length of the value */
35848 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35849 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35850 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35851 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35852 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35853 mem_base = xmlMemBlocks();
35854 type = gen_xmlSchemaTypePtr(n_type, 0);
35855 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35856 value = gen_const_xmlChar_ptr(n_value, 2);
35857 val = gen_xmlSchemaValPtr(n_val, 3);
35858 length = gen_unsigned_long_ptr(n_length, 4);
35860 ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35861 desret_int(ret_val);
35863 des_xmlSchemaTypePtr(n_type, type, 0);
35864 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35865 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35866 des_xmlSchemaValPtr(n_val, val, 3);
35867 des_unsigned_long_ptr(n_length, length, 4);
35868 xmlResetLastError();
35869 if (mem_base != xmlMemBlocks()) {
35870 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35871 xmlMemBlocks() - mem_base);
35873 printf(" %d", n_type);
35874 printf(" %d", n_facet);
35875 printf(" %d", n_value);
35876 printf(" %d", n_val);
35877 printf(" %d", n_length);
35893 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35896 #if defined(LIBXML_SCHEMAS_ENABLED)
35899 xmlSchemaFacetPtr facet; /* the facet to check */
35901 xmlSchemaValType valType; /* the built-in type */
35903 xmlChar * value; /* the lexical repr. of the value to be validated */
35905 xmlSchemaValPtr val; /* the precomputed value */
35907 unsigned long * length; /* the actual length of the value */
35909 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35912 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35913 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35914 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35915 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35916 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35917 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35918 mem_base = xmlMemBlocks();
35919 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35920 valType = gen_xmlSchemaValType(n_valType, 1);
35921 value = gen_const_xmlChar_ptr(n_value, 2);
35922 val = gen_xmlSchemaValPtr(n_val, 3);
35923 length = gen_unsigned_long_ptr(n_length, 4);
35924 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35926 ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35927 desret_int(ret_val);
35929 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35930 des_xmlSchemaValType(n_valType, valType, 1);
35931 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35932 des_xmlSchemaValPtr(n_val, val, 3);
35933 des_unsigned_long_ptr(n_length, length, 4);
35934 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35935 xmlResetLastError();
35936 if (mem_base != xmlMemBlocks()) {
35937 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35938 xmlMemBlocks() - mem_base);
35940 printf(" %d", n_facet);
35941 printf(" %d", n_valType);
35942 printf(" %d", n_value);
35943 printf(" %d", n_val);
35944 printf(" %d", n_length);
35945 printf(" %d", n_ws);
35962 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35965 #if defined(LIBXML_SCHEMAS_ENABLED)
35968 xmlSchemaFacetPtr facet; /* the facet to check */
35970 xmlChar * value; /* the lexical repr of the value to validate */
35972 unsigned long actualLen; /* the number of list items */
35974 unsigned long * expectedLen; /* the resulting expected number of list items */
35977 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35978 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35979 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35980 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35981 mem_base = xmlMemBlocks();
35982 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35983 value = gen_const_xmlChar_ptr(n_value, 1);
35984 actualLen = gen_unsigned_long(n_actualLen, 2);
35985 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35987 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35988 desret_int(ret_val);
35990 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35991 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35992 des_unsigned_long(n_actualLen, actualLen, 2);
35993 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35994 xmlResetLastError();
35995 if (mem_base != xmlMemBlocks()) {
35996 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35997 xmlMemBlocks() - mem_base);
35999 printf(" %d", n_facet);
36000 printf(" %d", n_value);
36001 printf(" %d", n_actualLen);
36002 printf(" %d", n_expectedLen);
36017 test_xmlSchemaValidatePredefinedType(void) {
36020 #if defined(LIBXML_SCHEMAS_ENABLED)
36023 xmlSchemaTypePtr type; /* the predefined type */
36025 xmlChar * value; /* the value to check */
36027 xmlSchemaValPtr * val; /* the return computed value */
36030 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36031 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36032 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36033 mem_base = xmlMemBlocks();
36034 type = gen_xmlSchemaTypePtr(n_type, 0);
36035 value = gen_const_xmlChar_ptr(n_value, 1);
36036 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36038 ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36039 desret_int(ret_val);
36041 des_xmlSchemaTypePtr(n_type, type, 0);
36042 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36043 des_xmlSchemaValPtr_ptr(n_val, val, 2);
36044 xmlResetLastError();
36045 if (mem_base != xmlMemBlocks()) {
36046 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36047 xmlMemBlocks() - mem_base);
36049 printf(" %d", n_type);
36050 printf(" %d", n_value);
36051 printf(" %d", n_val);
36065 test_xmlSchemaValueAppend(void) {
36068 #if defined(LIBXML_SCHEMAS_ENABLED)
36071 xmlSchemaValPtr prev; /* the value */
36073 xmlSchemaValPtr cur; /* the value to be appended */
36076 for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36077 for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36078 mem_base = xmlMemBlocks();
36079 prev = gen_xmlSchemaValPtr(n_prev, 0);
36080 cur = gen_xmlSchemaValPtr(n_cur, 1);
36082 ret_val = xmlSchemaValueAppend(prev, cur);
36083 desret_int(ret_val);
36085 des_xmlSchemaValPtr(n_prev, prev, 0);
36086 des_xmlSchemaValPtr(n_cur, cur, 1);
36087 xmlResetLastError();
36088 if (mem_base != xmlMemBlocks()) {
36089 printf("Leak of %d blocks found in xmlSchemaValueAppend",
36090 xmlMemBlocks() - mem_base);
36092 printf(" %d", n_prev);
36093 printf(" %d", n_cur);
36106 test_xmlSchemaValueGetAsBoolean(void) {
36109 #if defined(LIBXML_SCHEMAS_ENABLED)
36112 xmlSchemaValPtr val; /* the value */
36115 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36116 mem_base = xmlMemBlocks();
36117 val = gen_xmlSchemaValPtr(n_val, 0);
36119 ret_val = xmlSchemaValueGetAsBoolean(val);
36120 desret_int(ret_val);
36122 des_xmlSchemaValPtr(n_val, val, 0);
36123 xmlResetLastError();
36124 if (mem_base != xmlMemBlocks()) {
36125 printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36126 xmlMemBlocks() - mem_base);
36128 printf(" %d", n_val);
36140 test_xmlSchemaValueGetAsString(void) {
36143 #if defined(LIBXML_SCHEMAS_ENABLED)
36145 const xmlChar * ret_val;
36146 xmlSchemaValPtr val; /* the value */
36149 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36150 mem_base = xmlMemBlocks();
36151 val = gen_xmlSchemaValPtr(n_val, 0);
36153 ret_val = xmlSchemaValueGetAsString(val);
36154 desret_const_xmlChar_ptr(ret_val);
36156 des_xmlSchemaValPtr(n_val, val, 0);
36157 xmlResetLastError();
36158 if (mem_base != xmlMemBlocks()) {
36159 printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36160 xmlMemBlocks() - mem_base);
36162 printf(" %d", n_val);
36174 test_xmlSchemaValueGetNext(void) {
36178 /* missing type support */
36184 test_xmlSchemaWhiteSpaceReplace(void) {
36187 #if defined(LIBXML_SCHEMAS_ENABLED)
36190 xmlChar * value; /* a value */
36193 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36194 mem_base = xmlMemBlocks();
36195 value = gen_const_xmlChar_ptr(n_value, 0);
36197 ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36198 desret_xmlChar_ptr(ret_val);
36200 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36201 xmlResetLastError();
36202 if (mem_base != xmlMemBlocks()) {
36203 printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36204 xmlMemBlocks() - mem_base);
36206 printf(" %d", n_value);
36217 test_xmlschemastypes(void) {
36220 if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36221 test_ret += test_xmlSchemaCheckFacet();
36222 test_ret += test_xmlSchemaCleanupTypes();
36223 test_ret += test_xmlSchemaCollapseString();
36224 test_ret += test_xmlSchemaCompareValues();
36225 test_ret += test_xmlSchemaCompareValuesWhtsp();
36226 test_ret += test_xmlSchemaCopyValue();
36227 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36228 test_ret += test_xmlSchemaGetBuiltInType();
36229 test_ret += test_xmlSchemaGetCanonValue();
36230 test_ret += test_xmlSchemaGetCanonValueWhtsp();
36231 test_ret += test_xmlSchemaGetFacetValueAsULong();
36232 test_ret += test_xmlSchemaGetPredefinedType();
36233 test_ret += test_xmlSchemaGetValType();
36234 test_ret += test_xmlSchemaInitTypes();
36235 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36236 test_ret += test_xmlSchemaNewFacet();
36237 test_ret += test_xmlSchemaNewNOTATIONValue();
36238 test_ret += test_xmlSchemaNewQNameValue();
36239 test_ret += test_xmlSchemaNewStringValue();
36240 test_ret += test_xmlSchemaValPredefTypeNode();
36241 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36242 test_ret += test_xmlSchemaValidateFacet();
36243 test_ret += test_xmlSchemaValidateFacetWhtsp();
36244 test_ret += test_xmlSchemaValidateLengthFacet();
36245 test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36246 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36247 test_ret += test_xmlSchemaValidatePredefinedType();
36248 test_ret += test_xmlSchemaValueAppend();
36249 test_ret += test_xmlSchemaValueGetAsBoolean();
36250 test_ret += test_xmlSchemaValueGetAsString();
36251 test_ret += test_xmlSchemaValueGetNext();
36252 test_ret += test_xmlSchemaWhiteSpaceReplace();
36255 printf("Module xmlschemastypes: %d errors\n", test_ret);
36260 test_xmlCharStrdup(void) {
36265 char * cur; /* the input char * */
36268 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36269 mem_base = xmlMemBlocks();
36270 cur = gen_const_char_ptr(n_cur, 0);
36272 ret_val = xmlCharStrdup((const char *)cur);
36273 desret_xmlChar_ptr(ret_val);
36275 des_const_char_ptr(n_cur, (const char *)cur, 0);
36276 xmlResetLastError();
36277 if (mem_base != xmlMemBlocks()) {
36278 printf("Leak of %d blocks found in xmlCharStrdup",
36279 xmlMemBlocks() - mem_base);
36281 printf(" %d", n_cur);
36292 test_xmlCharStrndup(void) {
36297 char * cur; /* the input char * */
36299 int len; /* the len of @cur */
36302 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36303 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36304 mem_base = xmlMemBlocks();
36305 cur = gen_const_char_ptr(n_cur, 0);
36306 len = gen_int(n_len, 1);
36308 ret_val = xmlCharStrndup((const char *)cur, len);
36309 desret_xmlChar_ptr(ret_val);
36311 des_const_char_ptr(n_cur, (const char *)cur, 0);
36312 des_int(n_len, len, 1);
36313 xmlResetLastError();
36314 if (mem_base != xmlMemBlocks()) {
36315 printf("Leak of %d blocks found in xmlCharStrndup",
36316 xmlMemBlocks() - mem_base);
36318 printf(" %d", n_cur);
36319 printf(" %d", n_len);
36331 test_xmlCheckUTF8(void) {
36336 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36339 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36340 mem_base = xmlMemBlocks();
36341 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36343 ret_val = xmlCheckUTF8((const unsigned char *)utf);
36344 desret_int(ret_val);
36346 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36347 xmlResetLastError();
36348 if (mem_base != xmlMemBlocks()) {
36349 printf("Leak of %d blocks found in xmlCheckUTF8",
36350 xmlMemBlocks() - mem_base);
36352 printf(" %d", n_utf);
36363 test_xmlGetUTF8Char(void) {
36368 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36370 int * len; /* a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. */
36373 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36374 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36375 mem_base = xmlMemBlocks();
36376 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36377 len = gen_int_ptr(n_len, 1);
36379 ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36380 desret_int(ret_val);
36382 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36383 des_int_ptr(n_len, len, 1);
36384 xmlResetLastError();
36385 if (mem_base != xmlMemBlocks()) {
36386 printf("Leak of %d blocks found in xmlGetUTF8Char",
36387 xmlMemBlocks() - mem_base);
36389 printf(" %d", n_utf);
36390 printf(" %d", n_len);
36402 test_xmlStrEqual(void) {
36407 xmlChar * str1; /* the first xmlChar * */
36409 xmlChar * str2; /* the second xmlChar * */
36412 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36413 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36414 mem_base = xmlMemBlocks();
36415 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36416 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36418 ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36419 desret_int(ret_val);
36421 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36422 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36423 xmlResetLastError();
36424 if (mem_base != xmlMemBlocks()) {
36425 printf("Leak of %d blocks found in xmlStrEqual",
36426 xmlMemBlocks() - mem_base);
36428 printf(" %d", n_str1);
36429 printf(" %d", n_str2);
36441 test_xmlStrPrintf(void) {
36445 /* missing type support */
36451 test_xmlStrQEqual(void) {
36456 xmlChar * pref; /* the prefix of the QName */
36458 xmlChar * name; /* the localname of the QName */
36460 xmlChar * str; /* the second xmlChar * */
36463 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36464 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36465 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36466 mem_base = xmlMemBlocks();
36467 pref = gen_const_xmlChar_ptr(n_pref, 0);
36468 name = gen_const_xmlChar_ptr(n_name, 1);
36469 str = gen_const_xmlChar_ptr(n_str, 2);
36471 ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36472 desret_int(ret_val);
36474 des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36475 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36476 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36477 xmlResetLastError();
36478 if (mem_base != xmlMemBlocks()) {
36479 printf("Leak of %d blocks found in xmlStrQEqual",
36480 xmlMemBlocks() - mem_base);
36482 printf(" %d", n_pref);
36483 printf(" %d", n_name);
36484 printf(" %d", n_str);
36497 test_xmlStrVPrintf(void) {
36501 /* missing type support */
36507 test_xmlStrcasecmp(void) {
36512 xmlChar * str1; /* the first xmlChar * */
36514 xmlChar * str2; /* the second xmlChar * */
36517 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36518 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36519 mem_base = xmlMemBlocks();
36520 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36521 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36523 ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36524 desret_int(ret_val);
36526 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36527 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36528 xmlResetLastError();
36529 if (mem_base != xmlMemBlocks()) {
36530 printf("Leak of %d blocks found in xmlStrcasecmp",
36531 xmlMemBlocks() - mem_base);
36533 printf(" %d", n_str1);
36534 printf(" %d", n_str2);
36546 test_xmlStrcasestr(void) {
36550 const xmlChar * ret_val;
36551 xmlChar * str; /* the xmlChar * array (haystack) */
36553 xmlChar * val; /* the xmlChar to search (needle) */
36556 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36557 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36558 mem_base = xmlMemBlocks();
36559 str = gen_const_xmlChar_ptr(n_str, 0);
36560 val = gen_const_xmlChar_ptr(n_val, 1);
36562 ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36563 desret_const_xmlChar_ptr(ret_val);
36565 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36566 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36567 xmlResetLastError();
36568 if (mem_base != xmlMemBlocks()) {
36569 printf("Leak of %d blocks found in xmlStrcasestr",
36570 xmlMemBlocks() - mem_base);
36572 printf(" %d", n_str);
36573 printf(" %d", n_val);
36585 test_xmlStrchr(void) {
36589 const xmlChar * ret_val;
36590 xmlChar * str; /* the xmlChar * array */
36592 xmlChar val; /* the xmlChar to search */
36595 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36596 for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36597 mem_base = xmlMemBlocks();
36598 str = gen_const_xmlChar_ptr(n_str, 0);
36599 val = gen_xmlChar(n_val, 1);
36601 ret_val = xmlStrchr((const xmlChar *)str, val);
36602 desret_const_xmlChar_ptr(ret_val);
36604 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36605 des_xmlChar(n_val, val, 1);
36606 xmlResetLastError();
36607 if (mem_base != xmlMemBlocks()) {
36608 printf("Leak of %d blocks found in xmlStrchr",
36609 xmlMemBlocks() - mem_base);
36611 printf(" %d", n_str);
36612 printf(" %d", n_val);
36624 test_xmlStrcmp(void) {
36629 xmlChar * str1; /* the first xmlChar * */
36631 xmlChar * str2; /* the second xmlChar * */
36634 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36635 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36636 mem_base = xmlMemBlocks();
36637 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36638 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36640 ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36641 desret_int(ret_val);
36643 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36644 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36645 xmlResetLastError();
36646 if (mem_base != xmlMemBlocks()) {
36647 printf("Leak of %d blocks found in xmlStrcmp",
36648 xmlMemBlocks() - mem_base);
36650 printf(" %d", n_str1);
36651 printf(" %d", n_str2);
36663 test_xmlStrdup(void) {
36668 xmlChar * cur; /* the input xmlChar * */
36671 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36672 mem_base = xmlMemBlocks();
36673 cur = gen_const_xmlChar_ptr(n_cur, 0);
36675 ret_val = xmlStrdup((const xmlChar *)cur);
36676 desret_xmlChar_ptr(ret_val);
36678 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36679 xmlResetLastError();
36680 if (mem_base != xmlMemBlocks()) {
36681 printf("Leak of %d blocks found in xmlStrdup",
36682 xmlMemBlocks() - mem_base);
36684 printf(" %d", n_cur);
36695 test_xmlStrlen(void) {
36700 xmlChar * str; /* the xmlChar * array */
36703 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36704 mem_base = xmlMemBlocks();
36705 str = gen_const_xmlChar_ptr(n_str, 0);
36707 ret_val = xmlStrlen((const xmlChar *)str);
36708 desret_int(ret_val);
36710 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36711 xmlResetLastError();
36712 if (mem_base != xmlMemBlocks()) {
36713 printf("Leak of %d blocks found in xmlStrlen",
36714 xmlMemBlocks() - mem_base);
36716 printf(" %d", n_str);
36727 test_xmlStrncasecmp(void) {
36732 xmlChar * str1; /* the first xmlChar * */
36734 xmlChar * str2; /* the second xmlChar * */
36736 int len; /* the max comparison length */
36739 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36740 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36741 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36742 mem_base = xmlMemBlocks();
36743 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36744 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36745 len = gen_int(n_len, 2);
36747 ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36748 desret_int(ret_val);
36750 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36751 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36752 des_int(n_len, len, 2);
36753 xmlResetLastError();
36754 if (mem_base != xmlMemBlocks()) {
36755 printf("Leak of %d blocks found in xmlStrncasecmp",
36756 xmlMemBlocks() - mem_base);
36758 printf(" %d", n_str1);
36759 printf(" %d", n_str2);
36760 printf(" %d", n_len);
36773 test_xmlStrncatNew(void) {
36778 xmlChar * str1; /* first xmlChar string */
36780 xmlChar * str2; /* second xmlChar string */
36782 int len; /* the len of @str2 or < 0 */
36785 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36786 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36787 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36788 mem_base = xmlMemBlocks();
36789 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36790 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36791 len = gen_int(n_len, 2);
36793 ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36794 desret_xmlChar_ptr(ret_val);
36796 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36797 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36798 des_int(n_len, len, 2);
36799 xmlResetLastError();
36800 if (mem_base != xmlMemBlocks()) {
36801 printf("Leak of %d blocks found in xmlStrncatNew",
36802 xmlMemBlocks() - mem_base);
36804 printf(" %d", n_str1);
36805 printf(" %d", n_str2);
36806 printf(" %d", n_len);
36819 test_xmlStrncmp(void) {
36824 xmlChar * str1; /* the first xmlChar * */
36826 xmlChar * str2; /* the second xmlChar * */
36828 int len; /* the max comparison length */
36831 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36832 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36833 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36834 mem_base = xmlMemBlocks();
36835 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36836 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36837 len = gen_int(n_len, 2);
36839 ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36840 desret_int(ret_val);
36842 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36843 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36844 des_int(n_len, len, 2);
36845 xmlResetLastError();
36846 if (mem_base != xmlMemBlocks()) {
36847 printf("Leak of %d blocks found in xmlStrncmp",
36848 xmlMemBlocks() - mem_base);
36850 printf(" %d", n_str1);
36851 printf(" %d", n_str2);
36852 printf(" %d", n_len);
36865 test_xmlStrndup(void) {
36870 xmlChar * cur; /* the input xmlChar * */
36872 int len; /* the len of @cur */
36875 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36876 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36877 mem_base = xmlMemBlocks();
36878 cur = gen_const_xmlChar_ptr(n_cur, 0);
36879 len = gen_int(n_len, 1);
36881 ret_val = xmlStrndup((const xmlChar *)cur, len);
36882 desret_xmlChar_ptr(ret_val);
36884 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36885 des_int(n_len, len, 1);
36886 xmlResetLastError();
36887 if (mem_base != xmlMemBlocks()) {
36888 printf("Leak of %d blocks found in xmlStrndup",
36889 xmlMemBlocks() - mem_base);
36891 printf(" %d", n_cur);
36892 printf(" %d", n_len);
36904 test_xmlStrstr(void) {
36908 const xmlChar * ret_val;
36909 xmlChar * str; /* the xmlChar * array (haystack) */
36911 xmlChar * val; /* the xmlChar to search (needle) */
36914 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36915 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36916 mem_base = xmlMemBlocks();
36917 str = gen_const_xmlChar_ptr(n_str, 0);
36918 val = gen_const_xmlChar_ptr(n_val, 1);
36920 ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36921 desret_const_xmlChar_ptr(ret_val);
36923 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36924 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36925 xmlResetLastError();
36926 if (mem_base != xmlMemBlocks()) {
36927 printf("Leak of %d blocks found in xmlStrstr",
36928 xmlMemBlocks() - mem_base);
36930 printf(" %d", n_str);
36931 printf(" %d", n_val);
36943 test_xmlStrsub(void) {
36948 xmlChar * str; /* the xmlChar * array (haystack) */
36950 int start; /* the index of the first char (zero based) */
36952 int len; /* the length of the substring */
36955 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36956 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36957 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36958 mem_base = xmlMemBlocks();
36959 str = gen_const_xmlChar_ptr(n_str, 0);
36960 start = gen_int(n_start, 1);
36961 len = gen_int(n_len, 2);
36963 ret_val = xmlStrsub((const xmlChar *)str, start, len);
36964 desret_xmlChar_ptr(ret_val);
36966 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36967 des_int(n_start, start, 1);
36968 des_int(n_len, len, 2);
36969 xmlResetLastError();
36970 if (mem_base != xmlMemBlocks()) {
36971 printf("Leak of %d blocks found in xmlStrsub",
36972 xmlMemBlocks() - mem_base);
36974 printf(" %d", n_str);
36975 printf(" %d", n_start);
36976 printf(" %d", n_len);
36989 test_xmlUTF8Charcmp(void) {
36994 xmlChar * utf1; /* pointer to first UTF8 char */
36996 xmlChar * utf2; /* pointer to second UTF8 char */
36999 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
37000 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
37001 mem_base = xmlMemBlocks();
37002 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
37003 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
37005 ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
37006 desret_int(ret_val);
37008 des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
37009 des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
37010 xmlResetLastError();
37011 if (mem_base != xmlMemBlocks()) {
37012 printf("Leak of %d blocks found in xmlUTF8Charcmp",
37013 xmlMemBlocks() - mem_base);
37015 printf(" %d", n_utf1);
37016 printf(" %d", n_utf2);
37028 test_xmlUTF8Size(void) {
37033 xmlChar * utf; /* pointer to the UTF8 character */
37036 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37037 mem_base = xmlMemBlocks();
37038 utf = gen_const_xmlChar_ptr(n_utf, 0);
37040 ret_val = xmlUTF8Size((const xmlChar *)utf);
37041 desret_int(ret_val);
37043 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37044 xmlResetLastError();
37045 if (mem_base != xmlMemBlocks()) {
37046 printf("Leak of %d blocks found in xmlUTF8Size",
37047 xmlMemBlocks() - mem_base);
37049 printf(" %d", n_utf);
37060 test_xmlUTF8Strlen(void) {
37065 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37068 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37069 mem_base = xmlMemBlocks();
37070 utf = gen_const_xmlChar_ptr(n_utf, 0);
37072 ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37073 desret_int(ret_val);
37075 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37076 xmlResetLastError();
37077 if (mem_base != xmlMemBlocks()) {
37078 printf("Leak of %d blocks found in xmlUTF8Strlen",
37079 xmlMemBlocks() - mem_base);
37081 printf(" %d", n_utf);
37092 test_xmlUTF8Strloc(void) {
37097 xmlChar * utf; /* the input UTF8 * */
37099 xmlChar * utfchar; /* the UTF8 character to be found */
37102 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37103 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37104 mem_base = xmlMemBlocks();
37105 utf = gen_const_xmlChar_ptr(n_utf, 0);
37106 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37108 ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37109 desret_int(ret_val);
37111 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37112 des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37113 xmlResetLastError();
37114 if (mem_base != xmlMemBlocks()) {
37115 printf("Leak of %d blocks found in xmlUTF8Strloc",
37116 xmlMemBlocks() - mem_base);
37118 printf(" %d", n_utf);
37119 printf(" %d", n_utfchar);
37131 test_xmlUTF8Strndup(void) {
37136 xmlChar * utf; /* the input UTF8 * */
37138 int len; /* the len of @utf (in chars) */
37141 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37142 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37143 mem_base = xmlMemBlocks();
37144 utf = gen_const_xmlChar_ptr(n_utf, 0);
37145 len = gen_int(n_len, 1);
37147 ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37148 desret_xmlChar_ptr(ret_val);
37150 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37151 des_int(n_len, len, 1);
37152 xmlResetLastError();
37153 if (mem_base != xmlMemBlocks()) {
37154 printf("Leak of %d blocks found in xmlUTF8Strndup",
37155 xmlMemBlocks() - mem_base);
37157 printf(" %d", n_utf);
37158 printf(" %d", n_len);
37170 test_xmlUTF8Strpos(void) {
37174 const xmlChar * ret_val;
37175 xmlChar * utf; /* the input UTF8 * */
37177 int pos; /* the position of the desired UTF8 char (in chars) */
37180 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37181 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37182 mem_base = xmlMemBlocks();
37183 utf = gen_const_xmlChar_ptr(n_utf, 0);
37184 pos = gen_int(n_pos, 1);
37186 ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37187 desret_const_xmlChar_ptr(ret_val);
37189 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37190 des_int(n_pos, pos, 1);
37191 xmlResetLastError();
37192 if (mem_base != xmlMemBlocks()) {
37193 printf("Leak of %d blocks found in xmlUTF8Strpos",
37194 xmlMemBlocks() - mem_base);
37196 printf(" %d", n_utf);
37197 printf(" %d", n_pos);
37209 test_xmlUTF8Strsize(void) {
37214 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37216 int len; /* the number of characters in the array */
37219 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37220 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37221 mem_base = xmlMemBlocks();
37222 utf = gen_const_xmlChar_ptr(n_utf, 0);
37223 len = gen_int(n_len, 1);
37225 ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37226 desret_int(ret_val);
37228 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37229 des_int(n_len, len, 1);
37230 xmlResetLastError();
37231 if (mem_base != xmlMemBlocks()) {
37232 printf("Leak of %d blocks found in xmlUTF8Strsize",
37233 xmlMemBlocks() - mem_base);
37235 printf(" %d", n_utf);
37236 printf(" %d", n_len);
37248 test_xmlUTF8Strsub(void) {
37253 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37255 int start; /* relative pos of first char */
37257 int len; /* total number to copy */
37260 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37261 for (n_start = 0;n_start < gen_nb_int;n_start++) {
37262 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37263 mem_base = xmlMemBlocks();
37264 utf = gen_const_xmlChar_ptr(n_utf, 0);
37265 start = gen_int(n_start, 1);
37266 len = gen_int(n_len, 2);
37268 ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37269 desret_xmlChar_ptr(ret_val);
37271 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37272 des_int(n_start, start, 1);
37273 des_int(n_len, len, 2);
37274 xmlResetLastError();
37275 if (mem_base != xmlMemBlocks()) {
37276 printf("Leak of %d blocks found in xmlUTF8Strsub",
37277 xmlMemBlocks() - mem_base);
37279 printf(" %d", n_utf);
37280 printf(" %d", n_start);
37281 printf(" %d", n_len);
37293 test_xmlstring(void) {
37296 if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37297 test_ret += test_xmlCharStrdup();
37298 test_ret += test_xmlCharStrndup();
37299 test_ret += test_xmlCheckUTF8();
37300 test_ret += test_xmlGetUTF8Char();
37301 test_ret += test_xmlStrEqual();
37302 test_ret += test_xmlStrPrintf();
37303 test_ret += test_xmlStrQEqual();
37304 test_ret += test_xmlStrVPrintf();
37305 test_ret += test_xmlStrcasecmp();
37306 test_ret += test_xmlStrcasestr();
37307 test_ret += test_xmlStrchr();
37308 test_ret += test_xmlStrcmp();
37309 test_ret += test_xmlStrdup();
37310 test_ret += test_xmlStrlen();
37311 test_ret += test_xmlStrncasecmp();
37312 test_ret += test_xmlStrncatNew();
37313 test_ret += test_xmlStrncmp();
37314 test_ret += test_xmlStrndup();
37315 test_ret += test_xmlStrstr();
37316 test_ret += test_xmlStrsub();
37317 test_ret += test_xmlUTF8Charcmp();
37318 test_ret += test_xmlUTF8Size();
37319 test_ret += test_xmlUTF8Strlen();
37320 test_ret += test_xmlUTF8Strloc();
37321 test_ret += test_xmlUTF8Strndup();
37322 test_ret += test_xmlUTF8Strpos();
37323 test_ret += test_xmlUTF8Strsize();
37324 test_ret += test_xmlUTF8Strsub();
37327 printf("Module xmlstring: %d errors\n", test_ret);
37332 test_xmlUCSIsAegeanNumbers(void) {
37335 #if defined(LIBXML_UNICODE_ENABLED)
37338 int code; /* UCS code point */
37341 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37342 mem_base = xmlMemBlocks();
37343 code = gen_int(n_code, 0);
37345 ret_val = xmlUCSIsAegeanNumbers(code);
37346 desret_int(ret_val);
37348 des_int(n_code, code, 0);
37349 xmlResetLastError();
37350 if (mem_base != xmlMemBlocks()) {
37351 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37352 xmlMemBlocks() - mem_base);
37354 printf(" %d", n_code);
37366 test_xmlUCSIsAlphabeticPresentationForms(void) {
37369 #if defined(LIBXML_UNICODE_ENABLED)
37372 int code; /* UCS code point */
37375 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37376 mem_base = xmlMemBlocks();
37377 code = gen_int(n_code, 0);
37379 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37380 desret_int(ret_val);
37382 des_int(n_code, code, 0);
37383 xmlResetLastError();
37384 if (mem_base != xmlMemBlocks()) {
37385 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37386 xmlMemBlocks() - mem_base);
37388 printf(" %d", n_code);
37400 test_xmlUCSIsArabic(void) {
37403 #if defined(LIBXML_UNICODE_ENABLED)
37406 int code; /* UCS code point */
37409 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37410 mem_base = xmlMemBlocks();
37411 code = gen_int(n_code, 0);
37413 ret_val = xmlUCSIsArabic(code);
37414 desret_int(ret_val);
37416 des_int(n_code, code, 0);
37417 xmlResetLastError();
37418 if (mem_base != xmlMemBlocks()) {
37419 printf("Leak of %d blocks found in xmlUCSIsArabic",
37420 xmlMemBlocks() - mem_base);
37422 printf(" %d", n_code);
37434 test_xmlUCSIsArabicPresentationFormsA(void) {
37437 #if defined(LIBXML_UNICODE_ENABLED)
37440 int code; /* UCS code point */
37443 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37444 mem_base = xmlMemBlocks();
37445 code = gen_int(n_code, 0);
37447 ret_val = xmlUCSIsArabicPresentationFormsA(code);
37448 desret_int(ret_val);
37450 des_int(n_code, code, 0);
37451 xmlResetLastError();
37452 if (mem_base != xmlMemBlocks()) {
37453 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37454 xmlMemBlocks() - mem_base);
37456 printf(" %d", n_code);
37468 test_xmlUCSIsArabicPresentationFormsB(void) {
37471 #if defined(LIBXML_UNICODE_ENABLED)
37474 int code; /* UCS code point */
37477 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37478 mem_base = xmlMemBlocks();
37479 code = gen_int(n_code, 0);
37481 ret_val = xmlUCSIsArabicPresentationFormsB(code);
37482 desret_int(ret_val);
37484 des_int(n_code, code, 0);
37485 xmlResetLastError();
37486 if (mem_base != xmlMemBlocks()) {
37487 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37488 xmlMemBlocks() - mem_base);
37490 printf(" %d", n_code);
37502 test_xmlUCSIsArmenian(void) {
37505 #if defined(LIBXML_UNICODE_ENABLED)
37508 int code; /* UCS code point */
37511 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37512 mem_base = xmlMemBlocks();
37513 code = gen_int(n_code, 0);
37515 ret_val = xmlUCSIsArmenian(code);
37516 desret_int(ret_val);
37518 des_int(n_code, code, 0);
37519 xmlResetLastError();
37520 if (mem_base != xmlMemBlocks()) {
37521 printf("Leak of %d blocks found in xmlUCSIsArmenian",
37522 xmlMemBlocks() - mem_base);
37524 printf(" %d", n_code);
37536 test_xmlUCSIsArrows(void) {
37539 #if defined(LIBXML_UNICODE_ENABLED)
37542 int code; /* UCS code point */
37545 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37546 mem_base = xmlMemBlocks();
37547 code = gen_int(n_code, 0);
37549 ret_val = xmlUCSIsArrows(code);
37550 desret_int(ret_val);
37552 des_int(n_code, code, 0);
37553 xmlResetLastError();
37554 if (mem_base != xmlMemBlocks()) {
37555 printf("Leak of %d blocks found in xmlUCSIsArrows",
37556 xmlMemBlocks() - mem_base);
37558 printf(" %d", n_code);
37570 test_xmlUCSIsBasicLatin(void) {
37573 #if defined(LIBXML_UNICODE_ENABLED)
37576 int code; /* UCS code point */
37579 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37580 mem_base = xmlMemBlocks();
37581 code = gen_int(n_code, 0);
37583 ret_val = xmlUCSIsBasicLatin(code);
37584 desret_int(ret_val);
37586 des_int(n_code, code, 0);
37587 xmlResetLastError();
37588 if (mem_base != xmlMemBlocks()) {
37589 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37590 xmlMemBlocks() - mem_base);
37592 printf(" %d", n_code);
37604 test_xmlUCSIsBengali(void) {
37607 #if defined(LIBXML_UNICODE_ENABLED)
37610 int code; /* UCS code point */
37613 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37614 mem_base = xmlMemBlocks();
37615 code = gen_int(n_code, 0);
37617 ret_val = xmlUCSIsBengali(code);
37618 desret_int(ret_val);
37620 des_int(n_code, code, 0);
37621 xmlResetLastError();
37622 if (mem_base != xmlMemBlocks()) {
37623 printf("Leak of %d blocks found in xmlUCSIsBengali",
37624 xmlMemBlocks() - mem_base);
37626 printf(" %d", n_code);
37638 test_xmlUCSIsBlock(void) {
37641 #if defined(LIBXML_UNICODE_ENABLED)
37644 int code; /* UCS code point */
37646 char * block; /* UCS block name */
37649 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37650 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37651 mem_base = xmlMemBlocks();
37652 code = gen_int(n_code, 0);
37653 block = gen_const_char_ptr(n_block, 1);
37655 ret_val = xmlUCSIsBlock(code, (const char *)block);
37656 desret_int(ret_val);
37658 des_int(n_code, code, 0);
37659 des_const_char_ptr(n_block, (const char *)block, 1);
37660 xmlResetLastError();
37661 if (mem_base != xmlMemBlocks()) {
37662 printf("Leak of %d blocks found in xmlUCSIsBlock",
37663 xmlMemBlocks() - mem_base);
37665 printf(" %d", n_code);
37666 printf(" %d", n_block);
37679 test_xmlUCSIsBlockElements(void) {
37682 #if defined(LIBXML_UNICODE_ENABLED)
37685 int code; /* UCS code point */
37688 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37689 mem_base = xmlMemBlocks();
37690 code = gen_int(n_code, 0);
37692 ret_val = xmlUCSIsBlockElements(code);
37693 desret_int(ret_val);
37695 des_int(n_code, code, 0);
37696 xmlResetLastError();
37697 if (mem_base != xmlMemBlocks()) {
37698 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37699 xmlMemBlocks() - mem_base);
37701 printf(" %d", n_code);
37713 test_xmlUCSIsBopomofo(void) {
37716 #if defined(LIBXML_UNICODE_ENABLED)
37719 int code; /* UCS code point */
37722 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37723 mem_base = xmlMemBlocks();
37724 code = gen_int(n_code, 0);
37726 ret_val = xmlUCSIsBopomofo(code);
37727 desret_int(ret_val);
37729 des_int(n_code, code, 0);
37730 xmlResetLastError();
37731 if (mem_base != xmlMemBlocks()) {
37732 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37733 xmlMemBlocks() - mem_base);
37735 printf(" %d", n_code);
37747 test_xmlUCSIsBopomofoExtended(void) {
37750 #if defined(LIBXML_UNICODE_ENABLED)
37753 int code; /* UCS code point */
37756 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37757 mem_base = xmlMemBlocks();
37758 code = gen_int(n_code, 0);
37760 ret_val = xmlUCSIsBopomofoExtended(code);
37761 desret_int(ret_val);
37763 des_int(n_code, code, 0);
37764 xmlResetLastError();
37765 if (mem_base != xmlMemBlocks()) {
37766 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37767 xmlMemBlocks() - mem_base);
37769 printf(" %d", n_code);
37781 test_xmlUCSIsBoxDrawing(void) {
37784 #if defined(LIBXML_UNICODE_ENABLED)
37787 int code; /* UCS code point */
37790 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37791 mem_base = xmlMemBlocks();
37792 code = gen_int(n_code, 0);
37794 ret_val = xmlUCSIsBoxDrawing(code);
37795 desret_int(ret_val);
37797 des_int(n_code, code, 0);
37798 xmlResetLastError();
37799 if (mem_base != xmlMemBlocks()) {
37800 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37801 xmlMemBlocks() - mem_base);
37803 printf(" %d", n_code);
37815 test_xmlUCSIsBraillePatterns(void) {
37818 #if defined(LIBXML_UNICODE_ENABLED)
37821 int code; /* UCS code point */
37824 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37825 mem_base = xmlMemBlocks();
37826 code = gen_int(n_code, 0);
37828 ret_val = xmlUCSIsBraillePatterns(code);
37829 desret_int(ret_val);
37831 des_int(n_code, code, 0);
37832 xmlResetLastError();
37833 if (mem_base != xmlMemBlocks()) {
37834 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37835 xmlMemBlocks() - mem_base);
37837 printf(" %d", n_code);
37849 test_xmlUCSIsBuhid(void) {
37852 #if defined(LIBXML_UNICODE_ENABLED)
37855 int code; /* UCS code point */
37858 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37859 mem_base = xmlMemBlocks();
37860 code = gen_int(n_code, 0);
37862 ret_val = xmlUCSIsBuhid(code);
37863 desret_int(ret_val);
37865 des_int(n_code, code, 0);
37866 xmlResetLastError();
37867 if (mem_base != xmlMemBlocks()) {
37868 printf("Leak of %d blocks found in xmlUCSIsBuhid",
37869 xmlMemBlocks() - mem_base);
37871 printf(" %d", n_code);
37883 test_xmlUCSIsByzantineMusicalSymbols(void) {
37886 #if defined(LIBXML_UNICODE_ENABLED)
37889 int code; /* UCS code point */
37892 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37893 mem_base = xmlMemBlocks();
37894 code = gen_int(n_code, 0);
37896 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37897 desret_int(ret_val);
37899 des_int(n_code, code, 0);
37900 xmlResetLastError();
37901 if (mem_base != xmlMemBlocks()) {
37902 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37903 xmlMemBlocks() - mem_base);
37905 printf(" %d", n_code);
37917 test_xmlUCSIsCJKCompatibility(void) {
37920 #if defined(LIBXML_UNICODE_ENABLED)
37923 int code; /* UCS code point */
37926 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37927 mem_base = xmlMemBlocks();
37928 code = gen_int(n_code, 0);
37930 ret_val = xmlUCSIsCJKCompatibility(code);
37931 desret_int(ret_val);
37933 des_int(n_code, code, 0);
37934 xmlResetLastError();
37935 if (mem_base != xmlMemBlocks()) {
37936 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37937 xmlMemBlocks() - mem_base);
37939 printf(" %d", n_code);
37951 test_xmlUCSIsCJKCompatibilityForms(void) {
37954 #if defined(LIBXML_UNICODE_ENABLED)
37957 int code; /* UCS code point */
37960 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37961 mem_base = xmlMemBlocks();
37962 code = gen_int(n_code, 0);
37964 ret_val = xmlUCSIsCJKCompatibilityForms(code);
37965 desret_int(ret_val);
37967 des_int(n_code, code, 0);
37968 xmlResetLastError();
37969 if (mem_base != xmlMemBlocks()) {
37970 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37971 xmlMemBlocks() - mem_base);
37973 printf(" %d", n_code);
37985 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37988 #if defined(LIBXML_UNICODE_ENABLED)
37991 int code; /* UCS code point */
37994 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37995 mem_base = xmlMemBlocks();
37996 code = gen_int(n_code, 0);
37998 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37999 desret_int(ret_val);
38001 des_int(n_code, code, 0);
38002 xmlResetLastError();
38003 if (mem_base != xmlMemBlocks()) {
38004 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
38005 xmlMemBlocks() - mem_base);
38007 printf(" %d", n_code);
38019 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38022 #if defined(LIBXML_UNICODE_ENABLED)
38025 int code; /* UCS code point */
38028 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38029 mem_base = xmlMemBlocks();
38030 code = gen_int(n_code, 0);
38032 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38033 desret_int(ret_val);
38035 des_int(n_code, code, 0);
38036 xmlResetLastError();
38037 if (mem_base != xmlMemBlocks()) {
38038 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38039 xmlMemBlocks() - mem_base);
38041 printf(" %d", n_code);
38053 test_xmlUCSIsCJKRadicalsSupplement(void) {
38056 #if defined(LIBXML_UNICODE_ENABLED)
38059 int code; /* UCS code point */
38062 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38063 mem_base = xmlMemBlocks();
38064 code = gen_int(n_code, 0);
38066 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38067 desret_int(ret_val);
38069 des_int(n_code, code, 0);
38070 xmlResetLastError();
38071 if (mem_base != xmlMemBlocks()) {
38072 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38073 xmlMemBlocks() - mem_base);
38075 printf(" %d", n_code);
38087 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38090 #if defined(LIBXML_UNICODE_ENABLED)
38093 int code; /* UCS code point */
38096 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38097 mem_base = xmlMemBlocks();
38098 code = gen_int(n_code, 0);
38100 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38101 desret_int(ret_val);
38103 des_int(n_code, code, 0);
38104 xmlResetLastError();
38105 if (mem_base != xmlMemBlocks()) {
38106 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38107 xmlMemBlocks() - mem_base);
38109 printf(" %d", n_code);
38121 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38124 #if defined(LIBXML_UNICODE_ENABLED)
38127 int code; /* UCS code point */
38130 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38131 mem_base = xmlMemBlocks();
38132 code = gen_int(n_code, 0);
38134 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38135 desret_int(ret_val);
38137 des_int(n_code, code, 0);
38138 xmlResetLastError();
38139 if (mem_base != xmlMemBlocks()) {
38140 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38141 xmlMemBlocks() - mem_base);
38143 printf(" %d", n_code);
38155 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38158 #if defined(LIBXML_UNICODE_ENABLED)
38161 int code; /* UCS code point */
38164 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38165 mem_base = xmlMemBlocks();
38166 code = gen_int(n_code, 0);
38168 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38169 desret_int(ret_val);
38171 des_int(n_code, code, 0);
38172 xmlResetLastError();
38173 if (mem_base != xmlMemBlocks()) {
38174 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38175 xmlMemBlocks() - mem_base);
38177 printf(" %d", n_code);
38189 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38192 #if defined(LIBXML_UNICODE_ENABLED)
38195 int code; /* UCS code point */
38198 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38199 mem_base = xmlMemBlocks();
38200 code = gen_int(n_code, 0);
38202 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38203 desret_int(ret_val);
38205 des_int(n_code, code, 0);
38206 xmlResetLastError();
38207 if (mem_base != xmlMemBlocks()) {
38208 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38209 xmlMemBlocks() - mem_base);
38211 printf(" %d", n_code);
38223 test_xmlUCSIsCat(void) {
38226 #if defined(LIBXML_UNICODE_ENABLED)
38229 int code; /* UCS code point */
38231 char * cat; /* UCS Category name */
38234 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38235 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38236 mem_base = xmlMemBlocks();
38237 code = gen_int(n_code, 0);
38238 cat = gen_const_char_ptr(n_cat, 1);
38240 ret_val = xmlUCSIsCat(code, (const char *)cat);
38241 desret_int(ret_val);
38243 des_int(n_code, code, 0);
38244 des_const_char_ptr(n_cat, (const char *)cat, 1);
38245 xmlResetLastError();
38246 if (mem_base != xmlMemBlocks()) {
38247 printf("Leak of %d blocks found in xmlUCSIsCat",
38248 xmlMemBlocks() - mem_base);
38250 printf(" %d", n_code);
38251 printf(" %d", n_cat);
38264 test_xmlUCSIsCatC(void) {
38267 #if defined(LIBXML_UNICODE_ENABLED)
38270 int code; /* UCS code point */
38273 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38274 mem_base = xmlMemBlocks();
38275 code = gen_int(n_code, 0);
38277 ret_val = xmlUCSIsCatC(code);
38278 desret_int(ret_val);
38280 des_int(n_code, code, 0);
38281 xmlResetLastError();
38282 if (mem_base != xmlMemBlocks()) {
38283 printf("Leak of %d blocks found in xmlUCSIsCatC",
38284 xmlMemBlocks() - mem_base);
38286 printf(" %d", n_code);
38298 test_xmlUCSIsCatCc(void) {
38301 #if defined(LIBXML_UNICODE_ENABLED)
38304 int code; /* UCS code point */
38307 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38308 mem_base = xmlMemBlocks();
38309 code = gen_int(n_code, 0);
38311 ret_val = xmlUCSIsCatCc(code);
38312 desret_int(ret_val);
38314 des_int(n_code, code, 0);
38315 xmlResetLastError();
38316 if (mem_base != xmlMemBlocks()) {
38317 printf("Leak of %d blocks found in xmlUCSIsCatCc",
38318 xmlMemBlocks() - mem_base);
38320 printf(" %d", n_code);
38332 test_xmlUCSIsCatCf(void) {
38335 #if defined(LIBXML_UNICODE_ENABLED)
38338 int code; /* UCS code point */
38341 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38342 mem_base = xmlMemBlocks();
38343 code = gen_int(n_code, 0);
38345 ret_val = xmlUCSIsCatCf(code);
38346 desret_int(ret_val);
38348 des_int(n_code, code, 0);
38349 xmlResetLastError();
38350 if (mem_base != xmlMemBlocks()) {
38351 printf("Leak of %d blocks found in xmlUCSIsCatCf",
38352 xmlMemBlocks() - mem_base);
38354 printf(" %d", n_code);
38366 test_xmlUCSIsCatCo(void) {
38369 #if defined(LIBXML_UNICODE_ENABLED)
38372 int code; /* UCS code point */
38375 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38376 mem_base = xmlMemBlocks();
38377 code = gen_int(n_code, 0);
38379 ret_val = xmlUCSIsCatCo(code);
38380 desret_int(ret_val);
38382 des_int(n_code, code, 0);
38383 xmlResetLastError();
38384 if (mem_base != xmlMemBlocks()) {
38385 printf("Leak of %d blocks found in xmlUCSIsCatCo",
38386 xmlMemBlocks() - mem_base);
38388 printf(" %d", n_code);
38400 test_xmlUCSIsCatCs(void) {
38403 #if defined(LIBXML_UNICODE_ENABLED)
38406 int code; /* UCS code point */
38409 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38410 mem_base = xmlMemBlocks();
38411 code = gen_int(n_code, 0);
38413 ret_val = xmlUCSIsCatCs(code);
38414 desret_int(ret_val);
38416 des_int(n_code, code, 0);
38417 xmlResetLastError();
38418 if (mem_base != xmlMemBlocks()) {
38419 printf("Leak of %d blocks found in xmlUCSIsCatCs",
38420 xmlMemBlocks() - mem_base);
38422 printf(" %d", n_code);
38434 test_xmlUCSIsCatL(void) {
38437 #if defined(LIBXML_UNICODE_ENABLED)
38440 int code; /* UCS code point */
38443 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38444 mem_base = xmlMemBlocks();
38445 code = gen_int(n_code, 0);
38447 ret_val = xmlUCSIsCatL(code);
38448 desret_int(ret_val);
38450 des_int(n_code, code, 0);
38451 xmlResetLastError();
38452 if (mem_base != xmlMemBlocks()) {
38453 printf("Leak of %d blocks found in xmlUCSIsCatL",
38454 xmlMemBlocks() - mem_base);
38456 printf(" %d", n_code);
38468 test_xmlUCSIsCatLl(void) {
38471 #if defined(LIBXML_UNICODE_ENABLED)
38474 int code; /* UCS code point */
38477 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38478 mem_base = xmlMemBlocks();
38479 code = gen_int(n_code, 0);
38481 ret_val = xmlUCSIsCatLl(code);
38482 desret_int(ret_val);
38484 des_int(n_code, code, 0);
38485 xmlResetLastError();
38486 if (mem_base != xmlMemBlocks()) {
38487 printf("Leak of %d blocks found in xmlUCSIsCatLl",
38488 xmlMemBlocks() - mem_base);
38490 printf(" %d", n_code);
38502 test_xmlUCSIsCatLm(void) {
38505 #if defined(LIBXML_UNICODE_ENABLED)
38508 int code; /* UCS code point */
38511 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38512 mem_base = xmlMemBlocks();
38513 code = gen_int(n_code, 0);
38515 ret_val = xmlUCSIsCatLm(code);
38516 desret_int(ret_val);
38518 des_int(n_code, code, 0);
38519 xmlResetLastError();
38520 if (mem_base != xmlMemBlocks()) {
38521 printf("Leak of %d blocks found in xmlUCSIsCatLm",
38522 xmlMemBlocks() - mem_base);
38524 printf(" %d", n_code);
38536 test_xmlUCSIsCatLo(void) {
38539 #if defined(LIBXML_UNICODE_ENABLED)
38542 int code; /* UCS code point */
38545 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38546 mem_base = xmlMemBlocks();
38547 code = gen_int(n_code, 0);
38549 ret_val = xmlUCSIsCatLo(code);
38550 desret_int(ret_val);
38552 des_int(n_code, code, 0);
38553 xmlResetLastError();
38554 if (mem_base != xmlMemBlocks()) {
38555 printf("Leak of %d blocks found in xmlUCSIsCatLo",
38556 xmlMemBlocks() - mem_base);
38558 printf(" %d", n_code);
38570 test_xmlUCSIsCatLt(void) {
38573 #if defined(LIBXML_UNICODE_ENABLED)
38576 int code; /* UCS code point */
38579 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38580 mem_base = xmlMemBlocks();
38581 code = gen_int(n_code, 0);
38583 ret_val = xmlUCSIsCatLt(code);
38584 desret_int(ret_val);
38586 des_int(n_code, code, 0);
38587 xmlResetLastError();
38588 if (mem_base != xmlMemBlocks()) {
38589 printf("Leak of %d blocks found in xmlUCSIsCatLt",
38590 xmlMemBlocks() - mem_base);
38592 printf(" %d", n_code);
38604 test_xmlUCSIsCatLu(void) {
38607 #if defined(LIBXML_UNICODE_ENABLED)
38610 int code; /* UCS code point */
38613 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38614 mem_base = xmlMemBlocks();
38615 code = gen_int(n_code, 0);
38617 ret_val = xmlUCSIsCatLu(code);
38618 desret_int(ret_val);
38620 des_int(n_code, code, 0);
38621 xmlResetLastError();
38622 if (mem_base != xmlMemBlocks()) {
38623 printf("Leak of %d blocks found in xmlUCSIsCatLu",
38624 xmlMemBlocks() - mem_base);
38626 printf(" %d", n_code);
38638 test_xmlUCSIsCatM(void) {
38641 #if defined(LIBXML_UNICODE_ENABLED)
38644 int code; /* UCS code point */
38647 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38648 mem_base = xmlMemBlocks();
38649 code = gen_int(n_code, 0);
38651 ret_val = xmlUCSIsCatM(code);
38652 desret_int(ret_val);
38654 des_int(n_code, code, 0);
38655 xmlResetLastError();
38656 if (mem_base != xmlMemBlocks()) {
38657 printf("Leak of %d blocks found in xmlUCSIsCatM",
38658 xmlMemBlocks() - mem_base);
38660 printf(" %d", n_code);
38672 test_xmlUCSIsCatMc(void) {
38675 #if defined(LIBXML_UNICODE_ENABLED)
38678 int code; /* UCS code point */
38681 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38682 mem_base = xmlMemBlocks();
38683 code = gen_int(n_code, 0);
38685 ret_val = xmlUCSIsCatMc(code);
38686 desret_int(ret_val);
38688 des_int(n_code, code, 0);
38689 xmlResetLastError();
38690 if (mem_base != xmlMemBlocks()) {
38691 printf("Leak of %d blocks found in xmlUCSIsCatMc",
38692 xmlMemBlocks() - mem_base);
38694 printf(" %d", n_code);
38706 test_xmlUCSIsCatMe(void) {
38709 #if defined(LIBXML_UNICODE_ENABLED)
38712 int code; /* UCS code point */
38715 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38716 mem_base = xmlMemBlocks();
38717 code = gen_int(n_code, 0);
38719 ret_val = xmlUCSIsCatMe(code);
38720 desret_int(ret_val);
38722 des_int(n_code, code, 0);
38723 xmlResetLastError();
38724 if (mem_base != xmlMemBlocks()) {
38725 printf("Leak of %d blocks found in xmlUCSIsCatMe",
38726 xmlMemBlocks() - mem_base);
38728 printf(" %d", n_code);
38740 test_xmlUCSIsCatMn(void) {
38743 #if defined(LIBXML_UNICODE_ENABLED)
38746 int code; /* UCS code point */
38749 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38750 mem_base = xmlMemBlocks();
38751 code = gen_int(n_code, 0);
38753 ret_val = xmlUCSIsCatMn(code);
38754 desret_int(ret_val);
38756 des_int(n_code, code, 0);
38757 xmlResetLastError();
38758 if (mem_base != xmlMemBlocks()) {
38759 printf("Leak of %d blocks found in xmlUCSIsCatMn",
38760 xmlMemBlocks() - mem_base);
38762 printf(" %d", n_code);
38774 test_xmlUCSIsCatN(void) {
38777 #if defined(LIBXML_UNICODE_ENABLED)
38780 int code; /* UCS code point */
38783 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38784 mem_base = xmlMemBlocks();
38785 code = gen_int(n_code, 0);
38787 ret_val = xmlUCSIsCatN(code);
38788 desret_int(ret_val);
38790 des_int(n_code, code, 0);
38791 xmlResetLastError();
38792 if (mem_base != xmlMemBlocks()) {
38793 printf("Leak of %d blocks found in xmlUCSIsCatN",
38794 xmlMemBlocks() - mem_base);
38796 printf(" %d", n_code);
38808 test_xmlUCSIsCatNd(void) {
38811 #if defined(LIBXML_UNICODE_ENABLED)
38814 int code; /* UCS code point */
38817 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38818 mem_base = xmlMemBlocks();
38819 code = gen_int(n_code, 0);
38821 ret_val = xmlUCSIsCatNd(code);
38822 desret_int(ret_val);
38824 des_int(n_code, code, 0);
38825 xmlResetLastError();
38826 if (mem_base != xmlMemBlocks()) {
38827 printf("Leak of %d blocks found in xmlUCSIsCatNd",
38828 xmlMemBlocks() - mem_base);
38830 printf(" %d", n_code);
38842 test_xmlUCSIsCatNl(void) {
38845 #if defined(LIBXML_UNICODE_ENABLED)
38848 int code; /* UCS code point */
38851 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38852 mem_base = xmlMemBlocks();
38853 code = gen_int(n_code, 0);
38855 ret_val = xmlUCSIsCatNl(code);
38856 desret_int(ret_val);
38858 des_int(n_code, code, 0);
38859 xmlResetLastError();
38860 if (mem_base != xmlMemBlocks()) {
38861 printf("Leak of %d blocks found in xmlUCSIsCatNl",
38862 xmlMemBlocks() - mem_base);
38864 printf(" %d", n_code);
38876 test_xmlUCSIsCatNo(void) {
38879 #if defined(LIBXML_UNICODE_ENABLED)
38882 int code; /* UCS code point */
38885 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38886 mem_base = xmlMemBlocks();
38887 code = gen_int(n_code, 0);
38889 ret_val = xmlUCSIsCatNo(code);
38890 desret_int(ret_val);
38892 des_int(n_code, code, 0);
38893 xmlResetLastError();
38894 if (mem_base != xmlMemBlocks()) {
38895 printf("Leak of %d blocks found in xmlUCSIsCatNo",
38896 xmlMemBlocks() - mem_base);
38898 printf(" %d", n_code);
38910 test_xmlUCSIsCatP(void) {
38913 #if defined(LIBXML_UNICODE_ENABLED)
38916 int code; /* UCS code point */
38919 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38920 mem_base = xmlMemBlocks();
38921 code = gen_int(n_code, 0);
38923 ret_val = xmlUCSIsCatP(code);
38924 desret_int(ret_val);
38926 des_int(n_code, code, 0);
38927 xmlResetLastError();
38928 if (mem_base != xmlMemBlocks()) {
38929 printf("Leak of %d blocks found in xmlUCSIsCatP",
38930 xmlMemBlocks() - mem_base);
38932 printf(" %d", n_code);
38944 test_xmlUCSIsCatPc(void) {
38947 #if defined(LIBXML_UNICODE_ENABLED)
38950 int code; /* UCS code point */
38953 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38954 mem_base = xmlMemBlocks();
38955 code = gen_int(n_code, 0);
38957 ret_val = xmlUCSIsCatPc(code);
38958 desret_int(ret_val);
38960 des_int(n_code, code, 0);
38961 xmlResetLastError();
38962 if (mem_base != xmlMemBlocks()) {
38963 printf("Leak of %d blocks found in xmlUCSIsCatPc",
38964 xmlMemBlocks() - mem_base);
38966 printf(" %d", n_code);
38978 test_xmlUCSIsCatPd(void) {
38981 #if defined(LIBXML_UNICODE_ENABLED)
38984 int code; /* UCS code point */
38987 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38988 mem_base = xmlMemBlocks();
38989 code = gen_int(n_code, 0);
38991 ret_val = xmlUCSIsCatPd(code);
38992 desret_int(ret_val);
38994 des_int(n_code, code, 0);
38995 xmlResetLastError();
38996 if (mem_base != xmlMemBlocks()) {
38997 printf("Leak of %d blocks found in xmlUCSIsCatPd",
38998 xmlMemBlocks() - mem_base);
39000 printf(" %d", n_code);
39012 test_xmlUCSIsCatPe(void) {
39015 #if defined(LIBXML_UNICODE_ENABLED)
39018 int code; /* UCS code point */
39021 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39022 mem_base = xmlMemBlocks();
39023 code = gen_int(n_code, 0);
39025 ret_val = xmlUCSIsCatPe(code);
39026 desret_int(ret_val);
39028 des_int(n_code, code, 0);
39029 xmlResetLastError();
39030 if (mem_base != xmlMemBlocks()) {
39031 printf("Leak of %d blocks found in xmlUCSIsCatPe",
39032 xmlMemBlocks() - mem_base);
39034 printf(" %d", n_code);
39046 test_xmlUCSIsCatPf(void) {
39049 #if defined(LIBXML_UNICODE_ENABLED)
39052 int code; /* UCS code point */
39055 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39056 mem_base = xmlMemBlocks();
39057 code = gen_int(n_code, 0);
39059 ret_val = xmlUCSIsCatPf(code);
39060 desret_int(ret_val);
39062 des_int(n_code, code, 0);
39063 xmlResetLastError();
39064 if (mem_base != xmlMemBlocks()) {
39065 printf("Leak of %d blocks found in xmlUCSIsCatPf",
39066 xmlMemBlocks() - mem_base);
39068 printf(" %d", n_code);
39080 test_xmlUCSIsCatPi(void) {
39083 #if defined(LIBXML_UNICODE_ENABLED)
39086 int code; /* UCS code point */
39089 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39090 mem_base = xmlMemBlocks();
39091 code = gen_int(n_code, 0);
39093 ret_val = xmlUCSIsCatPi(code);
39094 desret_int(ret_val);
39096 des_int(n_code, code, 0);
39097 xmlResetLastError();
39098 if (mem_base != xmlMemBlocks()) {
39099 printf("Leak of %d blocks found in xmlUCSIsCatPi",
39100 xmlMemBlocks() - mem_base);
39102 printf(" %d", n_code);
39114 test_xmlUCSIsCatPo(void) {
39117 #if defined(LIBXML_UNICODE_ENABLED)
39120 int code; /* UCS code point */
39123 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39124 mem_base = xmlMemBlocks();
39125 code = gen_int(n_code, 0);
39127 ret_val = xmlUCSIsCatPo(code);
39128 desret_int(ret_val);
39130 des_int(n_code, code, 0);
39131 xmlResetLastError();
39132 if (mem_base != xmlMemBlocks()) {
39133 printf("Leak of %d blocks found in xmlUCSIsCatPo",
39134 xmlMemBlocks() - mem_base);
39136 printf(" %d", n_code);
39148 test_xmlUCSIsCatPs(void) {
39151 #if defined(LIBXML_UNICODE_ENABLED)
39154 int code; /* UCS code point */
39157 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39158 mem_base = xmlMemBlocks();
39159 code = gen_int(n_code, 0);
39161 ret_val = xmlUCSIsCatPs(code);
39162 desret_int(ret_val);
39164 des_int(n_code, code, 0);
39165 xmlResetLastError();
39166 if (mem_base != xmlMemBlocks()) {
39167 printf("Leak of %d blocks found in xmlUCSIsCatPs",
39168 xmlMemBlocks() - mem_base);
39170 printf(" %d", n_code);
39182 test_xmlUCSIsCatS(void) {
39185 #if defined(LIBXML_UNICODE_ENABLED)
39188 int code; /* UCS code point */
39191 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39192 mem_base = xmlMemBlocks();
39193 code = gen_int(n_code, 0);
39195 ret_val = xmlUCSIsCatS(code);
39196 desret_int(ret_val);
39198 des_int(n_code, code, 0);
39199 xmlResetLastError();
39200 if (mem_base != xmlMemBlocks()) {
39201 printf("Leak of %d blocks found in xmlUCSIsCatS",
39202 xmlMemBlocks() - mem_base);
39204 printf(" %d", n_code);
39216 test_xmlUCSIsCatSc(void) {
39219 #if defined(LIBXML_UNICODE_ENABLED)
39222 int code; /* UCS code point */
39225 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39226 mem_base = xmlMemBlocks();
39227 code = gen_int(n_code, 0);
39229 ret_val = xmlUCSIsCatSc(code);
39230 desret_int(ret_val);
39232 des_int(n_code, code, 0);
39233 xmlResetLastError();
39234 if (mem_base != xmlMemBlocks()) {
39235 printf("Leak of %d blocks found in xmlUCSIsCatSc",
39236 xmlMemBlocks() - mem_base);
39238 printf(" %d", n_code);
39250 test_xmlUCSIsCatSk(void) {
39253 #if defined(LIBXML_UNICODE_ENABLED)
39256 int code; /* UCS code point */
39259 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39260 mem_base = xmlMemBlocks();
39261 code = gen_int(n_code, 0);
39263 ret_val = xmlUCSIsCatSk(code);
39264 desret_int(ret_val);
39266 des_int(n_code, code, 0);
39267 xmlResetLastError();
39268 if (mem_base != xmlMemBlocks()) {
39269 printf("Leak of %d blocks found in xmlUCSIsCatSk",
39270 xmlMemBlocks() - mem_base);
39272 printf(" %d", n_code);
39284 test_xmlUCSIsCatSm(void) {
39287 #if defined(LIBXML_UNICODE_ENABLED)
39290 int code; /* UCS code point */
39293 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39294 mem_base = xmlMemBlocks();
39295 code = gen_int(n_code, 0);
39297 ret_val = xmlUCSIsCatSm(code);
39298 desret_int(ret_val);
39300 des_int(n_code, code, 0);
39301 xmlResetLastError();
39302 if (mem_base != xmlMemBlocks()) {
39303 printf("Leak of %d blocks found in xmlUCSIsCatSm",
39304 xmlMemBlocks() - mem_base);
39306 printf(" %d", n_code);
39318 test_xmlUCSIsCatSo(void) {
39321 #if defined(LIBXML_UNICODE_ENABLED)
39324 int code; /* UCS code point */
39327 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39328 mem_base = xmlMemBlocks();
39329 code = gen_int(n_code, 0);
39331 ret_val = xmlUCSIsCatSo(code);
39332 desret_int(ret_val);
39334 des_int(n_code, code, 0);
39335 xmlResetLastError();
39336 if (mem_base != xmlMemBlocks()) {
39337 printf("Leak of %d blocks found in xmlUCSIsCatSo",
39338 xmlMemBlocks() - mem_base);
39340 printf(" %d", n_code);
39352 test_xmlUCSIsCatZ(void) {
39355 #if defined(LIBXML_UNICODE_ENABLED)
39358 int code; /* UCS code point */
39361 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39362 mem_base = xmlMemBlocks();
39363 code = gen_int(n_code, 0);
39365 ret_val = xmlUCSIsCatZ(code);
39366 desret_int(ret_val);
39368 des_int(n_code, code, 0);
39369 xmlResetLastError();
39370 if (mem_base != xmlMemBlocks()) {
39371 printf("Leak of %d blocks found in xmlUCSIsCatZ",
39372 xmlMemBlocks() - mem_base);
39374 printf(" %d", n_code);
39386 test_xmlUCSIsCatZl(void) {
39389 #if defined(LIBXML_UNICODE_ENABLED)
39392 int code; /* UCS code point */
39395 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39396 mem_base = xmlMemBlocks();
39397 code = gen_int(n_code, 0);
39399 ret_val = xmlUCSIsCatZl(code);
39400 desret_int(ret_val);
39402 des_int(n_code, code, 0);
39403 xmlResetLastError();
39404 if (mem_base != xmlMemBlocks()) {
39405 printf("Leak of %d blocks found in xmlUCSIsCatZl",
39406 xmlMemBlocks() - mem_base);
39408 printf(" %d", n_code);
39420 test_xmlUCSIsCatZp(void) {
39423 #if defined(LIBXML_UNICODE_ENABLED)
39426 int code; /* UCS code point */
39429 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39430 mem_base = xmlMemBlocks();
39431 code = gen_int(n_code, 0);
39433 ret_val = xmlUCSIsCatZp(code);
39434 desret_int(ret_val);
39436 des_int(n_code, code, 0);
39437 xmlResetLastError();
39438 if (mem_base != xmlMemBlocks()) {
39439 printf("Leak of %d blocks found in xmlUCSIsCatZp",
39440 xmlMemBlocks() - mem_base);
39442 printf(" %d", n_code);
39454 test_xmlUCSIsCatZs(void) {
39457 #if defined(LIBXML_UNICODE_ENABLED)
39460 int code; /* UCS code point */
39463 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39464 mem_base = xmlMemBlocks();
39465 code = gen_int(n_code, 0);
39467 ret_val = xmlUCSIsCatZs(code);
39468 desret_int(ret_val);
39470 des_int(n_code, code, 0);
39471 xmlResetLastError();
39472 if (mem_base != xmlMemBlocks()) {
39473 printf("Leak of %d blocks found in xmlUCSIsCatZs",
39474 xmlMemBlocks() - mem_base);
39476 printf(" %d", n_code);
39488 test_xmlUCSIsCherokee(void) {
39491 #if defined(LIBXML_UNICODE_ENABLED)
39494 int code; /* UCS code point */
39497 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39498 mem_base = xmlMemBlocks();
39499 code = gen_int(n_code, 0);
39501 ret_val = xmlUCSIsCherokee(code);
39502 desret_int(ret_val);
39504 des_int(n_code, code, 0);
39505 xmlResetLastError();
39506 if (mem_base != xmlMemBlocks()) {
39507 printf("Leak of %d blocks found in xmlUCSIsCherokee",
39508 xmlMemBlocks() - mem_base);
39510 printf(" %d", n_code);
39522 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39525 #if defined(LIBXML_UNICODE_ENABLED)
39528 int code; /* UCS code point */
39531 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39532 mem_base = xmlMemBlocks();
39533 code = gen_int(n_code, 0);
39535 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39536 desret_int(ret_val);
39538 des_int(n_code, code, 0);
39539 xmlResetLastError();
39540 if (mem_base != xmlMemBlocks()) {
39541 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39542 xmlMemBlocks() - mem_base);
39544 printf(" %d", n_code);
39556 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39559 #if defined(LIBXML_UNICODE_ENABLED)
39562 int code; /* UCS code point */
39565 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39566 mem_base = xmlMemBlocks();
39567 code = gen_int(n_code, 0);
39569 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39570 desret_int(ret_val);
39572 des_int(n_code, code, 0);
39573 xmlResetLastError();
39574 if (mem_base != xmlMemBlocks()) {
39575 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39576 xmlMemBlocks() - mem_base);
39578 printf(" %d", n_code);
39590 test_xmlUCSIsCombiningHalfMarks(void) {
39593 #if defined(LIBXML_UNICODE_ENABLED)
39596 int code; /* UCS code point */
39599 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39600 mem_base = xmlMemBlocks();
39601 code = gen_int(n_code, 0);
39603 ret_val = xmlUCSIsCombiningHalfMarks(code);
39604 desret_int(ret_val);
39606 des_int(n_code, code, 0);
39607 xmlResetLastError();
39608 if (mem_base != xmlMemBlocks()) {
39609 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39610 xmlMemBlocks() - mem_base);
39612 printf(" %d", n_code);
39624 test_xmlUCSIsCombiningMarksforSymbols(void) {
39627 #if defined(LIBXML_UNICODE_ENABLED)
39630 int code; /* UCS code point */
39633 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39634 mem_base = xmlMemBlocks();
39635 code = gen_int(n_code, 0);
39637 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39638 desret_int(ret_val);
39640 des_int(n_code, code, 0);
39641 xmlResetLastError();
39642 if (mem_base != xmlMemBlocks()) {
39643 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39644 xmlMemBlocks() - mem_base);
39646 printf(" %d", n_code);
39658 test_xmlUCSIsControlPictures(void) {
39661 #if defined(LIBXML_UNICODE_ENABLED)
39664 int code; /* UCS code point */
39667 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39668 mem_base = xmlMemBlocks();
39669 code = gen_int(n_code, 0);
39671 ret_val = xmlUCSIsControlPictures(code);
39672 desret_int(ret_val);
39674 des_int(n_code, code, 0);
39675 xmlResetLastError();
39676 if (mem_base != xmlMemBlocks()) {
39677 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39678 xmlMemBlocks() - mem_base);
39680 printf(" %d", n_code);
39692 test_xmlUCSIsCurrencySymbols(void) {
39695 #if defined(LIBXML_UNICODE_ENABLED)
39698 int code; /* UCS code point */
39701 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39702 mem_base = xmlMemBlocks();
39703 code = gen_int(n_code, 0);
39705 ret_val = xmlUCSIsCurrencySymbols(code);
39706 desret_int(ret_val);
39708 des_int(n_code, code, 0);
39709 xmlResetLastError();
39710 if (mem_base != xmlMemBlocks()) {
39711 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39712 xmlMemBlocks() - mem_base);
39714 printf(" %d", n_code);
39726 test_xmlUCSIsCypriotSyllabary(void) {
39729 #if defined(LIBXML_UNICODE_ENABLED)
39732 int code; /* UCS code point */
39735 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39736 mem_base = xmlMemBlocks();
39737 code = gen_int(n_code, 0);
39739 ret_val = xmlUCSIsCypriotSyllabary(code);
39740 desret_int(ret_val);
39742 des_int(n_code, code, 0);
39743 xmlResetLastError();
39744 if (mem_base != xmlMemBlocks()) {
39745 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39746 xmlMemBlocks() - mem_base);
39748 printf(" %d", n_code);
39760 test_xmlUCSIsCyrillic(void) {
39763 #if defined(LIBXML_UNICODE_ENABLED)
39766 int code; /* UCS code point */
39769 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39770 mem_base = xmlMemBlocks();
39771 code = gen_int(n_code, 0);
39773 ret_val = xmlUCSIsCyrillic(code);
39774 desret_int(ret_val);
39776 des_int(n_code, code, 0);
39777 xmlResetLastError();
39778 if (mem_base != xmlMemBlocks()) {
39779 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39780 xmlMemBlocks() - mem_base);
39782 printf(" %d", n_code);
39794 test_xmlUCSIsCyrillicSupplement(void) {
39797 #if defined(LIBXML_UNICODE_ENABLED)
39800 int code; /* UCS code point */
39803 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39804 mem_base = xmlMemBlocks();
39805 code = gen_int(n_code, 0);
39807 ret_val = xmlUCSIsCyrillicSupplement(code);
39808 desret_int(ret_val);
39810 des_int(n_code, code, 0);
39811 xmlResetLastError();
39812 if (mem_base != xmlMemBlocks()) {
39813 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39814 xmlMemBlocks() - mem_base);
39816 printf(" %d", n_code);
39828 test_xmlUCSIsDeseret(void) {
39831 #if defined(LIBXML_UNICODE_ENABLED)
39834 int code; /* UCS code point */
39837 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39838 mem_base = xmlMemBlocks();
39839 code = gen_int(n_code, 0);
39841 ret_val = xmlUCSIsDeseret(code);
39842 desret_int(ret_val);
39844 des_int(n_code, code, 0);
39845 xmlResetLastError();
39846 if (mem_base != xmlMemBlocks()) {
39847 printf("Leak of %d blocks found in xmlUCSIsDeseret",
39848 xmlMemBlocks() - mem_base);
39850 printf(" %d", n_code);
39862 test_xmlUCSIsDevanagari(void) {
39865 #if defined(LIBXML_UNICODE_ENABLED)
39868 int code; /* UCS code point */
39871 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39872 mem_base = xmlMemBlocks();
39873 code = gen_int(n_code, 0);
39875 ret_val = xmlUCSIsDevanagari(code);
39876 desret_int(ret_val);
39878 des_int(n_code, code, 0);
39879 xmlResetLastError();
39880 if (mem_base != xmlMemBlocks()) {
39881 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39882 xmlMemBlocks() - mem_base);
39884 printf(" %d", n_code);
39896 test_xmlUCSIsDingbats(void) {
39899 #if defined(LIBXML_UNICODE_ENABLED)
39902 int code; /* UCS code point */
39905 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39906 mem_base = xmlMemBlocks();
39907 code = gen_int(n_code, 0);
39909 ret_val = xmlUCSIsDingbats(code);
39910 desret_int(ret_val);
39912 des_int(n_code, code, 0);
39913 xmlResetLastError();
39914 if (mem_base != xmlMemBlocks()) {
39915 printf("Leak of %d blocks found in xmlUCSIsDingbats",
39916 xmlMemBlocks() - mem_base);
39918 printf(" %d", n_code);
39930 test_xmlUCSIsEnclosedAlphanumerics(void) {
39933 #if defined(LIBXML_UNICODE_ENABLED)
39936 int code; /* UCS code point */
39939 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39940 mem_base = xmlMemBlocks();
39941 code = gen_int(n_code, 0);
39943 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39944 desret_int(ret_val);
39946 des_int(n_code, code, 0);
39947 xmlResetLastError();
39948 if (mem_base != xmlMemBlocks()) {
39949 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39950 xmlMemBlocks() - mem_base);
39952 printf(" %d", n_code);
39964 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39967 #if defined(LIBXML_UNICODE_ENABLED)
39970 int code; /* UCS code point */
39973 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39974 mem_base = xmlMemBlocks();
39975 code = gen_int(n_code, 0);
39977 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39978 desret_int(ret_val);
39980 des_int(n_code, code, 0);
39981 xmlResetLastError();
39982 if (mem_base != xmlMemBlocks()) {
39983 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39984 xmlMemBlocks() - mem_base);
39986 printf(" %d", n_code);
39998 test_xmlUCSIsEthiopic(void) {
40001 #if defined(LIBXML_UNICODE_ENABLED)
40004 int code; /* UCS code point */
40007 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40008 mem_base = xmlMemBlocks();
40009 code = gen_int(n_code, 0);
40011 ret_val = xmlUCSIsEthiopic(code);
40012 desret_int(ret_val);
40014 des_int(n_code, code, 0);
40015 xmlResetLastError();
40016 if (mem_base != xmlMemBlocks()) {
40017 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
40018 xmlMemBlocks() - mem_base);
40020 printf(" %d", n_code);
40032 test_xmlUCSIsGeneralPunctuation(void) {
40035 #if defined(LIBXML_UNICODE_ENABLED)
40038 int code; /* UCS code point */
40041 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40042 mem_base = xmlMemBlocks();
40043 code = gen_int(n_code, 0);
40045 ret_val = xmlUCSIsGeneralPunctuation(code);
40046 desret_int(ret_val);
40048 des_int(n_code, code, 0);
40049 xmlResetLastError();
40050 if (mem_base != xmlMemBlocks()) {
40051 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40052 xmlMemBlocks() - mem_base);
40054 printf(" %d", n_code);
40066 test_xmlUCSIsGeometricShapes(void) {
40069 #if defined(LIBXML_UNICODE_ENABLED)
40072 int code; /* UCS code point */
40075 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40076 mem_base = xmlMemBlocks();
40077 code = gen_int(n_code, 0);
40079 ret_val = xmlUCSIsGeometricShapes(code);
40080 desret_int(ret_val);
40082 des_int(n_code, code, 0);
40083 xmlResetLastError();
40084 if (mem_base != xmlMemBlocks()) {
40085 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40086 xmlMemBlocks() - mem_base);
40088 printf(" %d", n_code);
40100 test_xmlUCSIsGeorgian(void) {
40103 #if defined(LIBXML_UNICODE_ENABLED)
40106 int code; /* UCS code point */
40109 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40110 mem_base = xmlMemBlocks();
40111 code = gen_int(n_code, 0);
40113 ret_val = xmlUCSIsGeorgian(code);
40114 desret_int(ret_val);
40116 des_int(n_code, code, 0);
40117 xmlResetLastError();
40118 if (mem_base != xmlMemBlocks()) {
40119 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40120 xmlMemBlocks() - mem_base);
40122 printf(" %d", n_code);
40134 test_xmlUCSIsGothic(void) {
40137 #if defined(LIBXML_UNICODE_ENABLED)
40140 int code; /* UCS code point */
40143 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40144 mem_base = xmlMemBlocks();
40145 code = gen_int(n_code, 0);
40147 ret_val = xmlUCSIsGothic(code);
40148 desret_int(ret_val);
40150 des_int(n_code, code, 0);
40151 xmlResetLastError();
40152 if (mem_base != xmlMemBlocks()) {
40153 printf("Leak of %d blocks found in xmlUCSIsGothic",
40154 xmlMemBlocks() - mem_base);
40156 printf(" %d", n_code);
40168 test_xmlUCSIsGreek(void) {
40171 #if defined(LIBXML_UNICODE_ENABLED)
40174 int code; /* UCS code point */
40177 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40178 mem_base = xmlMemBlocks();
40179 code = gen_int(n_code, 0);
40181 ret_val = xmlUCSIsGreek(code);
40182 desret_int(ret_val);
40184 des_int(n_code, code, 0);
40185 xmlResetLastError();
40186 if (mem_base != xmlMemBlocks()) {
40187 printf("Leak of %d blocks found in xmlUCSIsGreek",
40188 xmlMemBlocks() - mem_base);
40190 printf(" %d", n_code);
40202 test_xmlUCSIsGreekExtended(void) {
40205 #if defined(LIBXML_UNICODE_ENABLED)
40208 int code; /* UCS code point */
40211 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40212 mem_base = xmlMemBlocks();
40213 code = gen_int(n_code, 0);
40215 ret_val = xmlUCSIsGreekExtended(code);
40216 desret_int(ret_val);
40218 des_int(n_code, code, 0);
40219 xmlResetLastError();
40220 if (mem_base != xmlMemBlocks()) {
40221 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40222 xmlMemBlocks() - mem_base);
40224 printf(" %d", n_code);
40236 test_xmlUCSIsGreekandCoptic(void) {
40239 #if defined(LIBXML_UNICODE_ENABLED)
40242 int code; /* UCS code point */
40245 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40246 mem_base = xmlMemBlocks();
40247 code = gen_int(n_code, 0);
40249 ret_val = xmlUCSIsGreekandCoptic(code);
40250 desret_int(ret_val);
40252 des_int(n_code, code, 0);
40253 xmlResetLastError();
40254 if (mem_base != xmlMemBlocks()) {
40255 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40256 xmlMemBlocks() - mem_base);
40258 printf(" %d", n_code);
40270 test_xmlUCSIsGujarati(void) {
40273 #if defined(LIBXML_UNICODE_ENABLED)
40276 int code; /* UCS code point */
40279 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40280 mem_base = xmlMemBlocks();
40281 code = gen_int(n_code, 0);
40283 ret_val = xmlUCSIsGujarati(code);
40284 desret_int(ret_val);
40286 des_int(n_code, code, 0);
40287 xmlResetLastError();
40288 if (mem_base != xmlMemBlocks()) {
40289 printf("Leak of %d blocks found in xmlUCSIsGujarati",
40290 xmlMemBlocks() - mem_base);
40292 printf(" %d", n_code);
40304 test_xmlUCSIsGurmukhi(void) {
40307 #if defined(LIBXML_UNICODE_ENABLED)
40310 int code; /* UCS code point */
40313 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40314 mem_base = xmlMemBlocks();
40315 code = gen_int(n_code, 0);
40317 ret_val = xmlUCSIsGurmukhi(code);
40318 desret_int(ret_val);
40320 des_int(n_code, code, 0);
40321 xmlResetLastError();
40322 if (mem_base != xmlMemBlocks()) {
40323 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40324 xmlMemBlocks() - mem_base);
40326 printf(" %d", n_code);
40338 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40341 #if defined(LIBXML_UNICODE_ENABLED)
40344 int code; /* UCS code point */
40347 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40348 mem_base = xmlMemBlocks();
40349 code = gen_int(n_code, 0);
40351 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40352 desret_int(ret_val);
40354 des_int(n_code, code, 0);
40355 xmlResetLastError();
40356 if (mem_base != xmlMemBlocks()) {
40357 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40358 xmlMemBlocks() - mem_base);
40360 printf(" %d", n_code);
40372 test_xmlUCSIsHangulCompatibilityJamo(void) {
40375 #if defined(LIBXML_UNICODE_ENABLED)
40378 int code; /* UCS code point */
40381 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40382 mem_base = xmlMemBlocks();
40383 code = gen_int(n_code, 0);
40385 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40386 desret_int(ret_val);
40388 des_int(n_code, code, 0);
40389 xmlResetLastError();
40390 if (mem_base != xmlMemBlocks()) {
40391 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40392 xmlMemBlocks() - mem_base);
40394 printf(" %d", n_code);
40406 test_xmlUCSIsHangulJamo(void) {
40409 #if defined(LIBXML_UNICODE_ENABLED)
40412 int code; /* UCS code point */
40415 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40416 mem_base = xmlMemBlocks();
40417 code = gen_int(n_code, 0);
40419 ret_val = xmlUCSIsHangulJamo(code);
40420 desret_int(ret_val);
40422 des_int(n_code, code, 0);
40423 xmlResetLastError();
40424 if (mem_base != xmlMemBlocks()) {
40425 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40426 xmlMemBlocks() - mem_base);
40428 printf(" %d", n_code);
40440 test_xmlUCSIsHangulSyllables(void) {
40443 #if defined(LIBXML_UNICODE_ENABLED)
40446 int code; /* UCS code point */
40449 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40450 mem_base = xmlMemBlocks();
40451 code = gen_int(n_code, 0);
40453 ret_val = xmlUCSIsHangulSyllables(code);
40454 desret_int(ret_val);
40456 des_int(n_code, code, 0);
40457 xmlResetLastError();
40458 if (mem_base != xmlMemBlocks()) {
40459 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40460 xmlMemBlocks() - mem_base);
40462 printf(" %d", n_code);
40474 test_xmlUCSIsHanunoo(void) {
40477 #if defined(LIBXML_UNICODE_ENABLED)
40480 int code; /* UCS code point */
40483 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40484 mem_base = xmlMemBlocks();
40485 code = gen_int(n_code, 0);
40487 ret_val = xmlUCSIsHanunoo(code);
40488 desret_int(ret_val);
40490 des_int(n_code, code, 0);
40491 xmlResetLastError();
40492 if (mem_base != xmlMemBlocks()) {
40493 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40494 xmlMemBlocks() - mem_base);
40496 printf(" %d", n_code);
40508 test_xmlUCSIsHebrew(void) {
40511 #if defined(LIBXML_UNICODE_ENABLED)
40514 int code; /* UCS code point */
40517 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40518 mem_base = xmlMemBlocks();
40519 code = gen_int(n_code, 0);
40521 ret_val = xmlUCSIsHebrew(code);
40522 desret_int(ret_val);
40524 des_int(n_code, code, 0);
40525 xmlResetLastError();
40526 if (mem_base != xmlMemBlocks()) {
40527 printf("Leak of %d blocks found in xmlUCSIsHebrew",
40528 xmlMemBlocks() - mem_base);
40530 printf(" %d", n_code);
40542 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40545 #if defined(LIBXML_UNICODE_ENABLED)
40548 int code; /* UCS code point */
40551 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40552 mem_base = xmlMemBlocks();
40553 code = gen_int(n_code, 0);
40555 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40556 desret_int(ret_val);
40558 des_int(n_code, code, 0);
40559 xmlResetLastError();
40560 if (mem_base != xmlMemBlocks()) {
40561 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40562 xmlMemBlocks() - mem_base);
40564 printf(" %d", n_code);
40576 test_xmlUCSIsHighSurrogates(void) {
40579 #if defined(LIBXML_UNICODE_ENABLED)
40582 int code; /* UCS code point */
40585 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40586 mem_base = xmlMemBlocks();
40587 code = gen_int(n_code, 0);
40589 ret_val = xmlUCSIsHighSurrogates(code);
40590 desret_int(ret_val);
40592 des_int(n_code, code, 0);
40593 xmlResetLastError();
40594 if (mem_base != xmlMemBlocks()) {
40595 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40596 xmlMemBlocks() - mem_base);
40598 printf(" %d", n_code);
40610 test_xmlUCSIsHiragana(void) {
40613 #if defined(LIBXML_UNICODE_ENABLED)
40616 int code; /* UCS code point */
40619 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40620 mem_base = xmlMemBlocks();
40621 code = gen_int(n_code, 0);
40623 ret_val = xmlUCSIsHiragana(code);
40624 desret_int(ret_val);
40626 des_int(n_code, code, 0);
40627 xmlResetLastError();
40628 if (mem_base != xmlMemBlocks()) {
40629 printf("Leak of %d blocks found in xmlUCSIsHiragana",
40630 xmlMemBlocks() - mem_base);
40632 printf(" %d", n_code);
40644 test_xmlUCSIsIPAExtensions(void) {
40647 #if defined(LIBXML_UNICODE_ENABLED)
40650 int code; /* UCS code point */
40653 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40654 mem_base = xmlMemBlocks();
40655 code = gen_int(n_code, 0);
40657 ret_val = xmlUCSIsIPAExtensions(code);
40658 desret_int(ret_val);
40660 des_int(n_code, code, 0);
40661 xmlResetLastError();
40662 if (mem_base != xmlMemBlocks()) {
40663 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40664 xmlMemBlocks() - mem_base);
40666 printf(" %d", n_code);
40678 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40681 #if defined(LIBXML_UNICODE_ENABLED)
40684 int code; /* UCS code point */
40687 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40688 mem_base = xmlMemBlocks();
40689 code = gen_int(n_code, 0);
40691 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40692 desret_int(ret_val);
40694 des_int(n_code, code, 0);
40695 xmlResetLastError();
40696 if (mem_base != xmlMemBlocks()) {
40697 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40698 xmlMemBlocks() - mem_base);
40700 printf(" %d", n_code);
40712 test_xmlUCSIsKanbun(void) {
40715 #if defined(LIBXML_UNICODE_ENABLED)
40718 int code; /* UCS code point */
40721 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40722 mem_base = xmlMemBlocks();
40723 code = gen_int(n_code, 0);
40725 ret_val = xmlUCSIsKanbun(code);
40726 desret_int(ret_val);
40728 des_int(n_code, code, 0);
40729 xmlResetLastError();
40730 if (mem_base != xmlMemBlocks()) {
40731 printf("Leak of %d blocks found in xmlUCSIsKanbun",
40732 xmlMemBlocks() - mem_base);
40734 printf(" %d", n_code);
40746 test_xmlUCSIsKangxiRadicals(void) {
40749 #if defined(LIBXML_UNICODE_ENABLED)
40752 int code; /* UCS code point */
40755 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40756 mem_base = xmlMemBlocks();
40757 code = gen_int(n_code, 0);
40759 ret_val = xmlUCSIsKangxiRadicals(code);
40760 desret_int(ret_val);
40762 des_int(n_code, code, 0);
40763 xmlResetLastError();
40764 if (mem_base != xmlMemBlocks()) {
40765 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40766 xmlMemBlocks() - mem_base);
40768 printf(" %d", n_code);
40780 test_xmlUCSIsKannada(void) {
40783 #if defined(LIBXML_UNICODE_ENABLED)
40786 int code; /* UCS code point */
40789 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40790 mem_base = xmlMemBlocks();
40791 code = gen_int(n_code, 0);
40793 ret_val = xmlUCSIsKannada(code);
40794 desret_int(ret_val);
40796 des_int(n_code, code, 0);
40797 xmlResetLastError();
40798 if (mem_base != xmlMemBlocks()) {
40799 printf("Leak of %d blocks found in xmlUCSIsKannada",
40800 xmlMemBlocks() - mem_base);
40802 printf(" %d", n_code);
40814 test_xmlUCSIsKatakana(void) {
40817 #if defined(LIBXML_UNICODE_ENABLED)
40820 int code; /* UCS code point */
40823 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40824 mem_base = xmlMemBlocks();
40825 code = gen_int(n_code, 0);
40827 ret_val = xmlUCSIsKatakana(code);
40828 desret_int(ret_val);
40830 des_int(n_code, code, 0);
40831 xmlResetLastError();
40832 if (mem_base != xmlMemBlocks()) {
40833 printf("Leak of %d blocks found in xmlUCSIsKatakana",
40834 xmlMemBlocks() - mem_base);
40836 printf(" %d", n_code);
40848 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40851 #if defined(LIBXML_UNICODE_ENABLED)
40854 int code; /* UCS code point */
40857 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40858 mem_base = xmlMemBlocks();
40859 code = gen_int(n_code, 0);
40861 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40862 desret_int(ret_val);
40864 des_int(n_code, code, 0);
40865 xmlResetLastError();
40866 if (mem_base != xmlMemBlocks()) {
40867 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40868 xmlMemBlocks() - mem_base);
40870 printf(" %d", n_code);
40882 test_xmlUCSIsKhmer(void) {
40885 #if defined(LIBXML_UNICODE_ENABLED)
40888 int code; /* UCS code point */
40891 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40892 mem_base = xmlMemBlocks();
40893 code = gen_int(n_code, 0);
40895 ret_val = xmlUCSIsKhmer(code);
40896 desret_int(ret_val);
40898 des_int(n_code, code, 0);
40899 xmlResetLastError();
40900 if (mem_base != xmlMemBlocks()) {
40901 printf("Leak of %d blocks found in xmlUCSIsKhmer",
40902 xmlMemBlocks() - mem_base);
40904 printf(" %d", n_code);
40916 test_xmlUCSIsKhmerSymbols(void) {
40919 #if defined(LIBXML_UNICODE_ENABLED)
40922 int code; /* UCS code point */
40925 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40926 mem_base = xmlMemBlocks();
40927 code = gen_int(n_code, 0);
40929 ret_val = xmlUCSIsKhmerSymbols(code);
40930 desret_int(ret_val);
40932 des_int(n_code, code, 0);
40933 xmlResetLastError();
40934 if (mem_base != xmlMemBlocks()) {
40935 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40936 xmlMemBlocks() - mem_base);
40938 printf(" %d", n_code);
40950 test_xmlUCSIsLao(void) {
40953 #if defined(LIBXML_UNICODE_ENABLED)
40956 int code; /* UCS code point */
40959 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40960 mem_base = xmlMemBlocks();
40961 code = gen_int(n_code, 0);
40963 ret_val = xmlUCSIsLao(code);
40964 desret_int(ret_val);
40966 des_int(n_code, code, 0);
40967 xmlResetLastError();
40968 if (mem_base != xmlMemBlocks()) {
40969 printf("Leak of %d blocks found in xmlUCSIsLao",
40970 xmlMemBlocks() - mem_base);
40972 printf(" %d", n_code);
40984 test_xmlUCSIsLatin1Supplement(void) {
40987 #if defined(LIBXML_UNICODE_ENABLED)
40990 int code; /* UCS code point */
40993 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40994 mem_base = xmlMemBlocks();
40995 code = gen_int(n_code, 0);
40997 ret_val = xmlUCSIsLatin1Supplement(code);
40998 desret_int(ret_val);
41000 des_int(n_code, code, 0);
41001 xmlResetLastError();
41002 if (mem_base != xmlMemBlocks()) {
41003 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
41004 xmlMemBlocks() - mem_base);
41006 printf(" %d", n_code);
41018 test_xmlUCSIsLatinExtendedA(void) {
41021 #if defined(LIBXML_UNICODE_ENABLED)
41024 int code; /* UCS code point */
41027 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41028 mem_base = xmlMemBlocks();
41029 code = gen_int(n_code, 0);
41031 ret_val = xmlUCSIsLatinExtendedA(code);
41032 desret_int(ret_val);
41034 des_int(n_code, code, 0);
41035 xmlResetLastError();
41036 if (mem_base != xmlMemBlocks()) {
41037 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41038 xmlMemBlocks() - mem_base);
41040 printf(" %d", n_code);
41052 test_xmlUCSIsLatinExtendedAdditional(void) {
41055 #if defined(LIBXML_UNICODE_ENABLED)
41058 int code; /* UCS code point */
41061 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41062 mem_base = xmlMemBlocks();
41063 code = gen_int(n_code, 0);
41065 ret_val = xmlUCSIsLatinExtendedAdditional(code);
41066 desret_int(ret_val);
41068 des_int(n_code, code, 0);
41069 xmlResetLastError();
41070 if (mem_base != xmlMemBlocks()) {
41071 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41072 xmlMemBlocks() - mem_base);
41074 printf(" %d", n_code);
41086 test_xmlUCSIsLatinExtendedB(void) {
41089 #if defined(LIBXML_UNICODE_ENABLED)
41092 int code; /* UCS code point */
41095 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41096 mem_base = xmlMemBlocks();
41097 code = gen_int(n_code, 0);
41099 ret_val = xmlUCSIsLatinExtendedB(code);
41100 desret_int(ret_val);
41102 des_int(n_code, code, 0);
41103 xmlResetLastError();
41104 if (mem_base != xmlMemBlocks()) {
41105 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41106 xmlMemBlocks() - mem_base);
41108 printf(" %d", n_code);
41120 test_xmlUCSIsLetterlikeSymbols(void) {
41123 #if defined(LIBXML_UNICODE_ENABLED)
41126 int code; /* UCS code point */
41129 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41130 mem_base = xmlMemBlocks();
41131 code = gen_int(n_code, 0);
41133 ret_val = xmlUCSIsLetterlikeSymbols(code);
41134 desret_int(ret_val);
41136 des_int(n_code, code, 0);
41137 xmlResetLastError();
41138 if (mem_base != xmlMemBlocks()) {
41139 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41140 xmlMemBlocks() - mem_base);
41142 printf(" %d", n_code);
41154 test_xmlUCSIsLimbu(void) {
41157 #if defined(LIBXML_UNICODE_ENABLED)
41160 int code; /* UCS code point */
41163 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41164 mem_base = xmlMemBlocks();
41165 code = gen_int(n_code, 0);
41167 ret_val = xmlUCSIsLimbu(code);
41168 desret_int(ret_val);
41170 des_int(n_code, code, 0);
41171 xmlResetLastError();
41172 if (mem_base != xmlMemBlocks()) {
41173 printf("Leak of %d blocks found in xmlUCSIsLimbu",
41174 xmlMemBlocks() - mem_base);
41176 printf(" %d", n_code);
41188 test_xmlUCSIsLinearBIdeograms(void) {
41191 #if defined(LIBXML_UNICODE_ENABLED)
41194 int code; /* UCS code point */
41197 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41198 mem_base = xmlMemBlocks();
41199 code = gen_int(n_code, 0);
41201 ret_val = xmlUCSIsLinearBIdeograms(code);
41202 desret_int(ret_val);
41204 des_int(n_code, code, 0);
41205 xmlResetLastError();
41206 if (mem_base != xmlMemBlocks()) {
41207 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41208 xmlMemBlocks() - mem_base);
41210 printf(" %d", n_code);
41222 test_xmlUCSIsLinearBSyllabary(void) {
41225 #if defined(LIBXML_UNICODE_ENABLED)
41228 int code; /* UCS code point */
41231 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41232 mem_base = xmlMemBlocks();
41233 code = gen_int(n_code, 0);
41235 ret_val = xmlUCSIsLinearBSyllabary(code);
41236 desret_int(ret_val);
41238 des_int(n_code, code, 0);
41239 xmlResetLastError();
41240 if (mem_base != xmlMemBlocks()) {
41241 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41242 xmlMemBlocks() - mem_base);
41244 printf(" %d", n_code);
41256 test_xmlUCSIsLowSurrogates(void) {
41259 #if defined(LIBXML_UNICODE_ENABLED)
41262 int code; /* UCS code point */
41265 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41266 mem_base = xmlMemBlocks();
41267 code = gen_int(n_code, 0);
41269 ret_val = xmlUCSIsLowSurrogates(code);
41270 desret_int(ret_val);
41272 des_int(n_code, code, 0);
41273 xmlResetLastError();
41274 if (mem_base != xmlMemBlocks()) {
41275 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41276 xmlMemBlocks() - mem_base);
41278 printf(" %d", n_code);
41290 test_xmlUCSIsMalayalam(void) {
41293 #if defined(LIBXML_UNICODE_ENABLED)
41296 int code; /* UCS code point */
41299 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41300 mem_base = xmlMemBlocks();
41301 code = gen_int(n_code, 0);
41303 ret_val = xmlUCSIsMalayalam(code);
41304 desret_int(ret_val);
41306 des_int(n_code, code, 0);
41307 xmlResetLastError();
41308 if (mem_base != xmlMemBlocks()) {
41309 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41310 xmlMemBlocks() - mem_base);
41312 printf(" %d", n_code);
41324 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41327 #if defined(LIBXML_UNICODE_ENABLED)
41330 int code; /* UCS code point */
41333 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41334 mem_base = xmlMemBlocks();
41335 code = gen_int(n_code, 0);
41337 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41338 desret_int(ret_val);
41340 des_int(n_code, code, 0);
41341 xmlResetLastError();
41342 if (mem_base != xmlMemBlocks()) {
41343 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41344 xmlMemBlocks() - mem_base);
41346 printf(" %d", n_code);
41358 test_xmlUCSIsMathematicalOperators(void) {
41361 #if defined(LIBXML_UNICODE_ENABLED)
41364 int code; /* UCS code point */
41367 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41368 mem_base = xmlMemBlocks();
41369 code = gen_int(n_code, 0);
41371 ret_val = xmlUCSIsMathematicalOperators(code);
41372 desret_int(ret_val);
41374 des_int(n_code, code, 0);
41375 xmlResetLastError();
41376 if (mem_base != xmlMemBlocks()) {
41377 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41378 xmlMemBlocks() - mem_base);
41380 printf(" %d", n_code);
41392 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41395 #if defined(LIBXML_UNICODE_ENABLED)
41398 int code; /* UCS code point */
41401 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41402 mem_base = xmlMemBlocks();
41403 code = gen_int(n_code, 0);
41405 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41406 desret_int(ret_val);
41408 des_int(n_code, code, 0);
41409 xmlResetLastError();
41410 if (mem_base != xmlMemBlocks()) {
41411 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41412 xmlMemBlocks() - mem_base);
41414 printf(" %d", n_code);
41426 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41429 #if defined(LIBXML_UNICODE_ENABLED)
41432 int code; /* UCS code point */
41435 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41436 mem_base = xmlMemBlocks();
41437 code = gen_int(n_code, 0);
41439 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41440 desret_int(ret_val);
41442 des_int(n_code, code, 0);
41443 xmlResetLastError();
41444 if (mem_base != xmlMemBlocks()) {
41445 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41446 xmlMemBlocks() - mem_base);
41448 printf(" %d", n_code);
41460 test_xmlUCSIsMiscellaneousSymbols(void) {
41463 #if defined(LIBXML_UNICODE_ENABLED)
41466 int code; /* UCS code point */
41469 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41470 mem_base = xmlMemBlocks();
41471 code = gen_int(n_code, 0);
41473 ret_val = xmlUCSIsMiscellaneousSymbols(code);
41474 desret_int(ret_val);
41476 des_int(n_code, code, 0);
41477 xmlResetLastError();
41478 if (mem_base != xmlMemBlocks()) {
41479 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41480 xmlMemBlocks() - mem_base);
41482 printf(" %d", n_code);
41494 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41497 #if defined(LIBXML_UNICODE_ENABLED)
41500 int code; /* UCS code point */
41503 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41504 mem_base = xmlMemBlocks();
41505 code = gen_int(n_code, 0);
41507 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41508 desret_int(ret_val);
41510 des_int(n_code, code, 0);
41511 xmlResetLastError();
41512 if (mem_base != xmlMemBlocks()) {
41513 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41514 xmlMemBlocks() - mem_base);
41516 printf(" %d", n_code);
41528 test_xmlUCSIsMiscellaneousTechnical(void) {
41531 #if defined(LIBXML_UNICODE_ENABLED)
41534 int code; /* UCS code point */
41537 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41538 mem_base = xmlMemBlocks();
41539 code = gen_int(n_code, 0);
41541 ret_val = xmlUCSIsMiscellaneousTechnical(code);
41542 desret_int(ret_val);
41544 des_int(n_code, code, 0);
41545 xmlResetLastError();
41546 if (mem_base != xmlMemBlocks()) {
41547 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41548 xmlMemBlocks() - mem_base);
41550 printf(" %d", n_code);
41562 test_xmlUCSIsMongolian(void) {
41565 #if defined(LIBXML_UNICODE_ENABLED)
41568 int code; /* UCS code point */
41571 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41572 mem_base = xmlMemBlocks();
41573 code = gen_int(n_code, 0);
41575 ret_val = xmlUCSIsMongolian(code);
41576 desret_int(ret_val);
41578 des_int(n_code, code, 0);
41579 xmlResetLastError();
41580 if (mem_base != xmlMemBlocks()) {
41581 printf("Leak of %d blocks found in xmlUCSIsMongolian",
41582 xmlMemBlocks() - mem_base);
41584 printf(" %d", n_code);
41596 test_xmlUCSIsMusicalSymbols(void) {
41599 #if defined(LIBXML_UNICODE_ENABLED)
41602 int code; /* UCS code point */
41605 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41606 mem_base = xmlMemBlocks();
41607 code = gen_int(n_code, 0);
41609 ret_val = xmlUCSIsMusicalSymbols(code);
41610 desret_int(ret_val);
41612 des_int(n_code, code, 0);
41613 xmlResetLastError();
41614 if (mem_base != xmlMemBlocks()) {
41615 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41616 xmlMemBlocks() - mem_base);
41618 printf(" %d", n_code);
41630 test_xmlUCSIsMyanmar(void) {
41633 #if defined(LIBXML_UNICODE_ENABLED)
41636 int code; /* UCS code point */
41639 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41640 mem_base = xmlMemBlocks();
41641 code = gen_int(n_code, 0);
41643 ret_val = xmlUCSIsMyanmar(code);
41644 desret_int(ret_val);
41646 des_int(n_code, code, 0);
41647 xmlResetLastError();
41648 if (mem_base != xmlMemBlocks()) {
41649 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41650 xmlMemBlocks() - mem_base);
41652 printf(" %d", n_code);
41664 test_xmlUCSIsNumberForms(void) {
41667 #if defined(LIBXML_UNICODE_ENABLED)
41670 int code; /* UCS code point */
41673 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41674 mem_base = xmlMemBlocks();
41675 code = gen_int(n_code, 0);
41677 ret_val = xmlUCSIsNumberForms(code);
41678 desret_int(ret_val);
41680 des_int(n_code, code, 0);
41681 xmlResetLastError();
41682 if (mem_base != xmlMemBlocks()) {
41683 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41684 xmlMemBlocks() - mem_base);
41686 printf(" %d", n_code);
41698 test_xmlUCSIsOgham(void) {
41701 #if defined(LIBXML_UNICODE_ENABLED)
41704 int code; /* UCS code point */
41707 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41708 mem_base = xmlMemBlocks();
41709 code = gen_int(n_code, 0);
41711 ret_val = xmlUCSIsOgham(code);
41712 desret_int(ret_val);
41714 des_int(n_code, code, 0);
41715 xmlResetLastError();
41716 if (mem_base != xmlMemBlocks()) {
41717 printf("Leak of %d blocks found in xmlUCSIsOgham",
41718 xmlMemBlocks() - mem_base);
41720 printf(" %d", n_code);
41732 test_xmlUCSIsOldItalic(void) {
41735 #if defined(LIBXML_UNICODE_ENABLED)
41738 int code; /* UCS code point */
41741 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41742 mem_base = xmlMemBlocks();
41743 code = gen_int(n_code, 0);
41745 ret_val = xmlUCSIsOldItalic(code);
41746 desret_int(ret_val);
41748 des_int(n_code, code, 0);
41749 xmlResetLastError();
41750 if (mem_base != xmlMemBlocks()) {
41751 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41752 xmlMemBlocks() - mem_base);
41754 printf(" %d", n_code);
41766 test_xmlUCSIsOpticalCharacterRecognition(void) {
41769 #if defined(LIBXML_UNICODE_ENABLED)
41772 int code; /* UCS code point */
41775 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41776 mem_base = xmlMemBlocks();
41777 code = gen_int(n_code, 0);
41779 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41780 desret_int(ret_val);
41782 des_int(n_code, code, 0);
41783 xmlResetLastError();
41784 if (mem_base != xmlMemBlocks()) {
41785 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41786 xmlMemBlocks() - mem_base);
41788 printf(" %d", n_code);
41800 test_xmlUCSIsOriya(void) {
41803 #if defined(LIBXML_UNICODE_ENABLED)
41806 int code; /* UCS code point */
41809 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41810 mem_base = xmlMemBlocks();
41811 code = gen_int(n_code, 0);
41813 ret_val = xmlUCSIsOriya(code);
41814 desret_int(ret_val);
41816 des_int(n_code, code, 0);
41817 xmlResetLastError();
41818 if (mem_base != xmlMemBlocks()) {
41819 printf("Leak of %d blocks found in xmlUCSIsOriya",
41820 xmlMemBlocks() - mem_base);
41822 printf(" %d", n_code);
41834 test_xmlUCSIsOsmanya(void) {
41837 #if defined(LIBXML_UNICODE_ENABLED)
41840 int code; /* UCS code point */
41843 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41844 mem_base = xmlMemBlocks();
41845 code = gen_int(n_code, 0);
41847 ret_val = xmlUCSIsOsmanya(code);
41848 desret_int(ret_val);
41850 des_int(n_code, code, 0);
41851 xmlResetLastError();
41852 if (mem_base != xmlMemBlocks()) {
41853 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41854 xmlMemBlocks() - mem_base);
41856 printf(" %d", n_code);
41868 test_xmlUCSIsPhoneticExtensions(void) {
41871 #if defined(LIBXML_UNICODE_ENABLED)
41874 int code; /* UCS code point */
41877 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41878 mem_base = xmlMemBlocks();
41879 code = gen_int(n_code, 0);
41881 ret_val = xmlUCSIsPhoneticExtensions(code);
41882 desret_int(ret_val);
41884 des_int(n_code, code, 0);
41885 xmlResetLastError();
41886 if (mem_base != xmlMemBlocks()) {
41887 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41888 xmlMemBlocks() - mem_base);
41890 printf(" %d", n_code);
41902 test_xmlUCSIsPrivateUse(void) {
41905 #if defined(LIBXML_UNICODE_ENABLED)
41908 int code; /* UCS code point */
41911 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41912 mem_base = xmlMemBlocks();
41913 code = gen_int(n_code, 0);
41915 ret_val = xmlUCSIsPrivateUse(code);
41916 desret_int(ret_val);
41918 des_int(n_code, code, 0);
41919 xmlResetLastError();
41920 if (mem_base != xmlMemBlocks()) {
41921 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41922 xmlMemBlocks() - mem_base);
41924 printf(" %d", n_code);
41936 test_xmlUCSIsPrivateUseArea(void) {
41939 #if defined(LIBXML_UNICODE_ENABLED)
41942 int code; /* UCS code point */
41945 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41946 mem_base = xmlMemBlocks();
41947 code = gen_int(n_code, 0);
41949 ret_val = xmlUCSIsPrivateUseArea(code);
41950 desret_int(ret_val);
41952 des_int(n_code, code, 0);
41953 xmlResetLastError();
41954 if (mem_base != xmlMemBlocks()) {
41955 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41956 xmlMemBlocks() - mem_base);
41958 printf(" %d", n_code);
41970 test_xmlUCSIsRunic(void) {
41973 #if defined(LIBXML_UNICODE_ENABLED)
41976 int code; /* UCS code point */
41979 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41980 mem_base = xmlMemBlocks();
41981 code = gen_int(n_code, 0);
41983 ret_val = xmlUCSIsRunic(code);
41984 desret_int(ret_val);
41986 des_int(n_code, code, 0);
41987 xmlResetLastError();
41988 if (mem_base != xmlMemBlocks()) {
41989 printf("Leak of %d blocks found in xmlUCSIsRunic",
41990 xmlMemBlocks() - mem_base);
41992 printf(" %d", n_code);
42004 test_xmlUCSIsShavian(void) {
42007 #if defined(LIBXML_UNICODE_ENABLED)
42010 int code; /* UCS code point */
42013 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42014 mem_base = xmlMemBlocks();
42015 code = gen_int(n_code, 0);
42017 ret_val = xmlUCSIsShavian(code);
42018 desret_int(ret_val);
42020 des_int(n_code, code, 0);
42021 xmlResetLastError();
42022 if (mem_base != xmlMemBlocks()) {
42023 printf("Leak of %d blocks found in xmlUCSIsShavian",
42024 xmlMemBlocks() - mem_base);
42026 printf(" %d", n_code);
42038 test_xmlUCSIsSinhala(void) {
42041 #if defined(LIBXML_UNICODE_ENABLED)
42044 int code; /* UCS code point */
42047 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42048 mem_base = xmlMemBlocks();
42049 code = gen_int(n_code, 0);
42051 ret_val = xmlUCSIsSinhala(code);
42052 desret_int(ret_val);
42054 des_int(n_code, code, 0);
42055 xmlResetLastError();
42056 if (mem_base != xmlMemBlocks()) {
42057 printf("Leak of %d blocks found in xmlUCSIsSinhala",
42058 xmlMemBlocks() - mem_base);
42060 printf(" %d", n_code);
42072 test_xmlUCSIsSmallFormVariants(void) {
42075 #if defined(LIBXML_UNICODE_ENABLED)
42078 int code; /* UCS code point */
42081 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42082 mem_base = xmlMemBlocks();
42083 code = gen_int(n_code, 0);
42085 ret_val = xmlUCSIsSmallFormVariants(code);
42086 desret_int(ret_val);
42088 des_int(n_code, code, 0);
42089 xmlResetLastError();
42090 if (mem_base != xmlMemBlocks()) {
42091 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42092 xmlMemBlocks() - mem_base);
42094 printf(" %d", n_code);
42106 test_xmlUCSIsSpacingModifierLetters(void) {
42109 #if defined(LIBXML_UNICODE_ENABLED)
42112 int code; /* UCS code point */
42115 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42116 mem_base = xmlMemBlocks();
42117 code = gen_int(n_code, 0);
42119 ret_val = xmlUCSIsSpacingModifierLetters(code);
42120 desret_int(ret_val);
42122 des_int(n_code, code, 0);
42123 xmlResetLastError();
42124 if (mem_base != xmlMemBlocks()) {
42125 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42126 xmlMemBlocks() - mem_base);
42128 printf(" %d", n_code);
42140 test_xmlUCSIsSpecials(void) {
42143 #if defined(LIBXML_UNICODE_ENABLED)
42146 int code; /* UCS code point */
42149 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42150 mem_base = xmlMemBlocks();
42151 code = gen_int(n_code, 0);
42153 ret_val = xmlUCSIsSpecials(code);
42154 desret_int(ret_val);
42156 des_int(n_code, code, 0);
42157 xmlResetLastError();
42158 if (mem_base != xmlMemBlocks()) {
42159 printf("Leak of %d blocks found in xmlUCSIsSpecials",
42160 xmlMemBlocks() - mem_base);
42162 printf(" %d", n_code);
42174 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42177 #if defined(LIBXML_UNICODE_ENABLED)
42180 int code; /* UCS code point */
42183 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42184 mem_base = xmlMemBlocks();
42185 code = gen_int(n_code, 0);
42187 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42188 desret_int(ret_val);
42190 des_int(n_code, code, 0);
42191 xmlResetLastError();
42192 if (mem_base != xmlMemBlocks()) {
42193 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42194 xmlMemBlocks() - mem_base);
42196 printf(" %d", n_code);
42208 test_xmlUCSIsSupplementalArrowsA(void) {
42211 #if defined(LIBXML_UNICODE_ENABLED)
42214 int code; /* UCS code point */
42217 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42218 mem_base = xmlMemBlocks();
42219 code = gen_int(n_code, 0);
42221 ret_val = xmlUCSIsSupplementalArrowsA(code);
42222 desret_int(ret_val);
42224 des_int(n_code, code, 0);
42225 xmlResetLastError();
42226 if (mem_base != xmlMemBlocks()) {
42227 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42228 xmlMemBlocks() - mem_base);
42230 printf(" %d", n_code);
42242 test_xmlUCSIsSupplementalArrowsB(void) {
42245 #if defined(LIBXML_UNICODE_ENABLED)
42248 int code; /* UCS code point */
42251 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42252 mem_base = xmlMemBlocks();
42253 code = gen_int(n_code, 0);
42255 ret_val = xmlUCSIsSupplementalArrowsB(code);
42256 desret_int(ret_val);
42258 des_int(n_code, code, 0);
42259 xmlResetLastError();
42260 if (mem_base != xmlMemBlocks()) {
42261 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42262 xmlMemBlocks() - mem_base);
42264 printf(" %d", n_code);
42276 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42279 #if defined(LIBXML_UNICODE_ENABLED)
42282 int code; /* UCS code point */
42285 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42286 mem_base = xmlMemBlocks();
42287 code = gen_int(n_code, 0);
42289 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42290 desret_int(ret_val);
42292 des_int(n_code, code, 0);
42293 xmlResetLastError();
42294 if (mem_base != xmlMemBlocks()) {
42295 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42296 xmlMemBlocks() - mem_base);
42298 printf(" %d", n_code);
42310 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42313 #if defined(LIBXML_UNICODE_ENABLED)
42316 int code; /* UCS code point */
42319 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42320 mem_base = xmlMemBlocks();
42321 code = gen_int(n_code, 0);
42323 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42324 desret_int(ret_val);
42326 des_int(n_code, code, 0);
42327 xmlResetLastError();
42328 if (mem_base != xmlMemBlocks()) {
42329 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42330 xmlMemBlocks() - mem_base);
42332 printf(" %d", n_code);
42344 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42347 #if defined(LIBXML_UNICODE_ENABLED)
42350 int code; /* UCS code point */
42353 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42354 mem_base = xmlMemBlocks();
42355 code = gen_int(n_code, 0);
42357 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42358 desret_int(ret_val);
42360 des_int(n_code, code, 0);
42361 xmlResetLastError();
42362 if (mem_base != xmlMemBlocks()) {
42363 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42364 xmlMemBlocks() - mem_base);
42366 printf(" %d", n_code);
42378 test_xmlUCSIsSyriac(void) {
42381 #if defined(LIBXML_UNICODE_ENABLED)
42384 int code; /* UCS code point */
42387 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42388 mem_base = xmlMemBlocks();
42389 code = gen_int(n_code, 0);
42391 ret_val = xmlUCSIsSyriac(code);
42392 desret_int(ret_val);
42394 des_int(n_code, code, 0);
42395 xmlResetLastError();
42396 if (mem_base != xmlMemBlocks()) {
42397 printf("Leak of %d blocks found in xmlUCSIsSyriac",
42398 xmlMemBlocks() - mem_base);
42400 printf(" %d", n_code);
42412 test_xmlUCSIsTagalog(void) {
42415 #if defined(LIBXML_UNICODE_ENABLED)
42418 int code; /* UCS code point */
42421 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42422 mem_base = xmlMemBlocks();
42423 code = gen_int(n_code, 0);
42425 ret_val = xmlUCSIsTagalog(code);
42426 desret_int(ret_val);
42428 des_int(n_code, code, 0);
42429 xmlResetLastError();
42430 if (mem_base != xmlMemBlocks()) {
42431 printf("Leak of %d blocks found in xmlUCSIsTagalog",
42432 xmlMemBlocks() - mem_base);
42434 printf(" %d", n_code);
42446 test_xmlUCSIsTagbanwa(void) {
42449 #if defined(LIBXML_UNICODE_ENABLED)
42452 int code; /* UCS code point */
42455 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42456 mem_base = xmlMemBlocks();
42457 code = gen_int(n_code, 0);
42459 ret_val = xmlUCSIsTagbanwa(code);
42460 desret_int(ret_val);
42462 des_int(n_code, code, 0);
42463 xmlResetLastError();
42464 if (mem_base != xmlMemBlocks()) {
42465 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42466 xmlMemBlocks() - mem_base);
42468 printf(" %d", n_code);
42480 test_xmlUCSIsTags(void) {
42483 #if defined(LIBXML_UNICODE_ENABLED)
42486 int code; /* UCS code point */
42489 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42490 mem_base = xmlMemBlocks();
42491 code = gen_int(n_code, 0);
42493 ret_val = xmlUCSIsTags(code);
42494 desret_int(ret_val);
42496 des_int(n_code, code, 0);
42497 xmlResetLastError();
42498 if (mem_base != xmlMemBlocks()) {
42499 printf("Leak of %d blocks found in xmlUCSIsTags",
42500 xmlMemBlocks() - mem_base);
42502 printf(" %d", n_code);
42514 test_xmlUCSIsTaiLe(void) {
42517 #if defined(LIBXML_UNICODE_ENABLED)
42520 int code; /* UCS code point */
42523 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42524 mem_base = xmlMemBlocks();
42525 code = gen_int(n_code, 0);
42527 ret_val = xmlUCSIsTaiLe(code);
42528 desret_int(ret_val);
42530 des_int(n_code, code, 0);
42531 xmlResetLastError();
42532 if (mem_base != xmlMemBlocks()) {
42533 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42534 xmlMemBlocks() - mem_base);
42536 printf(" %d", n_code);
42548 test_xmlUCSIsTaiXuanJingSymbols(void) {
42551 #if defined(LIBXML_UNICODE_ENABLED)
42554 int code; /* UCS code point */
42557 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42558 mem_base = xmlMemBlocks();
42559 code = gen_int(n_code, 0);
42561 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42562 desret_int(ret_val);
42564 des_int(n_code, code, 0);
42565 xmlResetLastError();
42566 if (mem_base != xmlMemBlocks()) {
42567 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42568 xmlMemBlocks() - mem_base);
42570 printf(" %d", n_code);
42582 test_xmlUCSIsTamil(void) {
42585 #if defined(LIBXML_UNICODE_ENABLED)
42588 int code; /* UCS code point */
42591 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42592 mem_base = xmlMemBlocks();
42593 code = gen_int(n_code, 0);
42595 ret_val = xmlUCSIsTamil(code);
42596 desret_int(ret_val);
42598 des_int(n_code, code, 0);
42599 xmlResetLastError();
42600 if (mem_base != xmlMemBlocks()) {
42601 printf("Leak of %d blocks found in xmlUCSIsTamil",
42602 xmlMemBlocks() - mem_base);
42604 printf(" %d", n_code);
42616 test_xmlUCSIsTelugu(void) {
42619 #if defined(LIBXML_UNICODE_ENABLED)
42622 int code; /* UCS code point */
42625 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42626 mem_base = xmlMemBlocks();
42627 code = gen_int(n_code, 0);
42629 ret_val = xmlUCSIsTelugu(code);
42630 desret_int(ret_val);
42632 des_int(n_code, code, 0);
42633 xmlResetLastError();
42634 if (mem_base != xmlMemBlocks()) {
42635 printf("Leak of %d blocks found in xmlUCSIsTelugu",
42636 xmlMemBlocks() - mem_base);
42638 printf(" %d", n_code);
42650 test_xmlUCSIsThaana(void) {
42653 #if defined(LIBXML_UNICODE_ENABLED)
42656 int code; /* UCS code point */
42659 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42660 mem_base = xmlMemBlocks();
42661 code = gen_int(n_code, 0);
42663 ret_val = xmlUCSIsThaana(code);
42664 desret_int(ret_val);
42666 des_int(n_code, code, 0);
42667 xmlResetLastError();
42668 if (mem_base != xmlMemBlocks()) {
42669 printf("Leak of %d blocks found in xmlUCSIsThaana",
42670 xmlMemBlocks() - mem_base);
42672 printf(" %d", n_code);
42684 test_xmlUCSIsThai(void) {
42687 #if defined(LIBXML_UNICODE_ENABLED)
42690 int code; /* UCS code point */
42693 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42694 mem_base = xmlMemBlocks();
42695 code = gen_int(n_code, 0);
42697 ret_val = xmlUCSIsThai(code);
42698 desret_int(ret_val);
42700 des_int(n_code, code, 0);
42701 xmlResetLastError();
42702 if (mem_base != xmlMemBlocks()) {
42703 printf("Leak of %d blocks found in xmlUCSIsThai",
42704 xmlMemBlocks() - mem_base);
42706 printf(" %d", n_code);
42718 test_xmlUCSIsTibetan(void) {
42721 #if defined(LIBXML_UNICODE_ENABLED)
42724 int code; /* UCS code point */
42727 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42728 mem_base = xmlMemBlocks();
42729 code = gen_int(n_code, 0);
42731 ret_val = xmlUCSIsTibetan(code);
42732 desret_int(ret_val);
42734 des_int(n_code, code, 0);
42735 xmlResetLastError();
42736 if (mem_base != xmlMemBlocks()) {
42737 printf("Leak of %d blocks found in xmlUCSIsTibetan",
42738 xmlMemBlocks() - mem_base);
42740 printf(" %d", n_code);
42752 test_xmlUCSIsUgaritic(void) {
42755 #if defined(LIBXML_UNICODE_ENABLED)
42758 int code; /* UCS code point */
42761 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42762 mem_base = xmlMemBlocks();
42763 code = gen_int(n_code, 0);
42765 ret_val = xmlUCSIsUgaritic(code);
42766 desret_int(ret_val);
42768 des_int(n_code, code, 0);
42769 xmlResetLastError();
42770 if (mem_base != xmlMemBlocks()) {
42771 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42772 xmlMemBlocks() - mem_base);
42774 printf(" %d", n_code);
42786 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42789 #if defined(LIBXML_UNICODE_ENABLED)
42792 int code; /* UCS code point */
42795 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42796 mem_base = xmlMemBlocks();
42797 code = gen_int(n_code, 0);
42799 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42800 desret_int(ret_val);
42802 des_int(n_code, code, 0);
42803 xmlResetLastError();
42804 if (mem_base != xmlMemBlocks()) {
42805 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42806 xmlMemBlocks() - mem_base);
42808 printf(" %d", n_code);
42820 test_xmlUCSIsVariationSelectors(void) {
42823 #if defined(LIBXML_UNICODE_ENABLED)
42826 int code; /* UCS code point */
42829 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42830 mem_base = xmlMemBlocks();
42831 code = gen_int(n_code, 0);
42833 ret_val = xmlUCSIsVariationSelectors(code);
42834 desret_int(ret_val);
42836 des_int(n_code, code, 0);
42837 xmlResetLastError();
42838 if (mem_base != xmlMemBlocks()) {
42839 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42840 xmlMemBlocks() - mem_base);
42842 printf(" %d", n_code);
42854 test_xmlUCSIsVariationSelectorsSupplement(void) {
42857 #if defined(LIBXML_UNICODE_ENABLED)
42860 int code; /* UCS code point */
42863 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42864 mem_base = xmlMemBlocks();
42865 code = gen_int(n_code, 0);
42867 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42868 desret_int(ret_val);
42870 des_int(n_code, code, 0);
42871 xmlResetLastError();
42872 if (mem_base != xmlMemBlocks()) {
42873 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42874 xmlMemBlocks() - mem_base);
42876 printf(" %d", n_code);
42888 test_xmlUCSIsYiRadicals(void) {
42891 #if defined(LIBXML_UNICODE_ENABLED)
42894 int code; /* UCS code point */
42897 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42898 mem_base = xmlMemBlocks();
42899 code = gen_int(n_code, 0);
42901 ret_val = xmlUCSIsYiRadicals(code);
42902 desret_int(ret_val);
42904 des_int(n_code, code, 0);
42905 xmlResetLastError();
42906 if (mem_base != xmlMemBlocks()) {
42907 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42908 xmlMemBlocks() - mem_base);
42910 printf(" %d", n_code);
42922 test_xmlUCSIsYiSyllables(void) {
42925 #if defined(LIBXML_UNICODE_ENABLED)
42928 int code; /* UCS code point */
42931 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42932 mem_base = xmlMemBlocks();
42933 code = gen_int(n_code, 0);
42935 ret_val = xmlUCSIsYiSyllables(code);
42936 desret_int(ret_val);
42938 des_int(n_code, code, 0);
42939 xmlResetLastError();
42940 if (mem_base != xmlMemBlocks()) {
42941 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42942 xmlMemBlocks() - mem_base);
42944 printf(" %d", n_code);
42956 test_xmlUCSIsYijingHexagramSymbols(void) {
42959 #if defined(LIBXML_UNICODE_ENABLED)
42962 int code; /* UCS code point */
42965 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42966 mem_base = xmlMemBlocks();
42967 code = gen_int(n_code, 0);
42969 ret_val = xmlUCSIsYijingHexagramSymbols(code);
42970 desret_int(ret_val);
42972 des_int(n_code, code, 0);
42973 xmlResetLastError();
42974 if (mem_base != xmlMemBlocks()) {
42975 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42976 xmlMemBlocks() - mem_base);
42978 printf(" %d", n_code);
42989 test_xmlunicode(void) {
42992 if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42993 test_ret += test_xmlUCSIsAegeanNumbers();
42994 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42995 test_ret += test_xmlUCSIsArabic();
42996 test_ret += test_xmlUCSIsArabicPresentationFormsA();
42997 test_ret += test_xmlUCSIsArabicPresentationFormsB();
42998 test_ret += test_xmlUCSIsArmenian();
42999 test_ret += test_xmlUCSIsArrows();
43000 test_ret += test_xmlUCSIsBasicLatin();
43001 test_ret += test_xmlUCSIsBengali();
43002 test_ret += test_xmlUCSIsBlock();
43003 test_ret += test_xmlUCSIsBlockElements();
43004 test_ret += test_xmlUCSIsBopomofo();
43005 test_ret += test_xmlUCSIsBopomofoExtended();
43006 test_ret += test_xmlUCSIsBoxDrawing();
43007 test_ret += test_xmlUCSIsBraillePatterns();
43008 test_ret += test_xmlUCSIsBuhid();
43009 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
43010 test_ret += test_xmlUCSIsCJKCompatibility();
43011 test_ret += test_xmlUCSIsCJKCompatibilityForms();
43012 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
43013 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
43014 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
43015 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
43016 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
43017 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
43018 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
43019 test_ret += test_xmlUCSIsCat();
43020 test_ret += test_xmlUCSIsCatC();
43021 test_ret += test_xmlUCSIsCatCc();
43022 test_ret += test_xmlUCSIsCatCf();
43023 test_ret += test_xmlUCSIsCatCo();
43024 test_ret += test_xmlUCSIsCatCs();
43025 test_ret += test_xmlUCSIsCatL();
43026 test_ret += test_xmlUCSIsCatLl();
43027 test_ret += test_xmlUCSIsCatLm();
43028 test_ret += test_xmlUCSIsCatLo();
43029 test_ret += test_xmlUCSIsCatLt();
43030 test_ret += test_xmlUCSIsCatLu();
43031 test_ret += test_xmlUCSIsCatM();
43032 test_ret += test_xmlUCSIsCatMc();
43033 test_ret += test_xmlUCSIsCatMe();
43034 test_ret += test_xmlUCSIsCatMn();
43035 test_ret += test_xmlUCSIsCatN();
43036 test_ret += test_xmlUCSIsCatNd();
43037 test_ret += test_xmlUCSIsCatNl();
43038 test_ret += test_xmlUCSIsCatNo();
43039 test_ret += test_xmlUCSIsCatP();
43040 test_ret += test_xmlUCSIsCatPc();
43041 test_ret += test_xmlUCSIsCatPd();
43042 test_ret += test_xmlUCSIsCatPe();
43043 test_ret += test_xmlUCSIsCatPf();
43044 test_ret += test_xmlUCSIsCatPi();
43045 test_ret += test_xmlUCSIsCatPo();
43046 test_ret += test_xmlUCSIsCatPs();
43047 test_ret += test_xmlUCSIsCatS();
43048 test_ret += test_xmlUCSIsCatSc();
43049 test_ret += test_xmlUCSIsCatSk();
43050 test_ret += test_xmlUCSIsCatSm();
43051 test_ret += test_xmlUCSIsCatSo();
43052 test_ret += test_xmlUCSIsCatZ();
43053 test_ret += test_xmlUCSIsCatZl();
43054 test_ret += test_xmlUCSIsCatZp();
43055 test_ret += test_xmlUCSIsCatZs();
43056 test_ret += test_xmlUCSIsCherokee();
43057 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43058 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43059 test_ret += test_xmlUCSIsCombiningHalfMarks();
43060 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43061 test_ret += test_xmlUCSIsControlPictures();
43062 test_ret += test_xmlUCSIsCurrencySymbols();
43063 test_ret += test_xmlUCSIsCypriotSyllabary();
43064 test_ret += test_xmlUCSIsCyrillic();
43065 test_ret += test_xmlUCSIsCyrillicSupplement();
43066 test_ret += test_xmlUCSIsDeseret();
43067 test_ret += test_xmlUCSIsDevanagari();
43068 test_ret += test_xmlUCSIsDingbats();
43069 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43070 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43071 test_ret += test_xmlUCSIsEthiopic();
43072 test_ret += test_xmlUCSIsGeneralPunctuation();
43073 test_ret += test_xmlUCSIsGeometricShapes();
43074 test_ret += test_xmlUCSIsGeorgian();
43075 test_ret += test_xmlUCSIsGothic();
43076 test_ret += test_xmlUCSIsGreek();
43077 test_ret += test_xmlUCSIsGreekExtended();
43078 test_ret += test_xmlUCSIsGreekandCoptic();
43079 test_ret += test_xmlUCSIsGujarati();
43080 test_ret += test_xmlUCSIsGurmukhi();
43081 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43082 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43083 test_ret += test_xmlUCSIsHangulJamo();
43084 test_ret += test_xmlUCSIsHangulSyllables();
43085 test_ret += test_xmlUCSIsHanunoo();
43086 test_ret += test_xmlUCSIsHebrew();
43087 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43088 test_ret += test_xmlUCSIsHighSurrogates();
43089 test_ret += test_xmlUCSIsHiragana();
43090 test_ret += test_xmlUCSIsIPAExtensions();
43091 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43092 test_ret += test_xmlUCSIsKanbun();
43093 test_ret += test_xmlUCSIsKangxiRadicals();
43094 test_ret += test_xmlUCSIsKannada();
43095 test_ret += test_xmlUCSIsKatakana();
43096 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43097 test_ret += test_xmlUCSIsKhmer();
43098 test_ret += test_xmlUCSIsKhmerSymbols();
43099 test_ret += test_xmlUCSIsLao();
43100 test_ret += test_xmlUCSIsLatin1Supplement();
43101 test_ret += test_xmlUCSIsLatinExtendedA();
43102 test_ret += test_xmlUCSIsLatinExtendedAdditional();
43103 test_ret += test_xmlUCSIsLatinExtendedB();
43104 test_ret += test_xmlUCSIsLetterlikeSymbols();
43105 test_ret += test_xmlUCSIsLimbu();
43106 test_ret += test_xmlUCSIsLinearBIdeograms();
43107 test_ret += test_xmlUCSIsLinearBSyllabary();
43108 test_ret += test_xmlUCSIsLowSurrogates();
43109 test_ret += test_xmlUCSIsMalayalam();
43110 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43111 test_ret += test_xmlUCSIsMathematicalOperators();
43112 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43113 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43114 test_ret += test_xmlUCSIsMiscellaneousSymbols();
43115 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43116 test_ret += test_xmlUCSIsMiscellaneousTechnical();
43117 test_ret += test_xmlUCSIsMongolian();
43118 test_ret += test_xmlUCSIsMusicalSymbols();
43119 test_ret += test_xmlUCSIsMyanmar();
43120 test_ret += test_xmlUCSIsNumberForms();
43121 test_ret += test_xmlUCSIsOgham();
43122 test_ret += test_xmlUCSIsOldItalic();
43123 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43124 test_ret += test_xmlUCSIsOriya();
43125 test_ret += test_xmlUCSIsOsmanya();
43126 test_ret += test_xmlUCSIsPhoneticExtensions();
43127 test_ret += test_xmlUCSIsPrivateUse();
43128 test_ret += test_xmlUCSIsPrivateUseArea();
43129 test_ret += test_xmlUCSIsRunic();
43130 test_ret += test_xmlUCSIsShavian();
43131 test_ret += test_xmlUCSIsSinhala();
43132 test_ret += test_xmlUCSIsSmallFormVariants();
43133 test_ret += test_xmlUCSIsSpacingModifierLetters();
43134 test_ret += test_xmlUCSIsSpecials();
43135 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43136 test_ret += test_xmlUCSIsSupplementalArrowsA();
43137 test_ret += test_xmlUCSIsSupplementalArrowsB();
43138 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43139 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43140 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43141 test_ret += test_xmlUCSIsSyriac();
43142 test_ret += test_xmlUCSIsTagalog();
43143 test_ret += test_xmlUCSIsTagbanwa();
43144 test_ret += test_xmlUCSIsTags();
43145 test_ret += test_xmlUCSIsTaiLe();
43146 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43147 test_ret += test_xmlUCSIsTamil();
43148 test_ret += test_xmlUCSIsTelugu();
43149 test_ret += test_xmlUCSIsThaana();
43150 test_ret += test_xmlUCSIsThai();
43151 test_ret += test_xmlUCSIsTibetan();
43152 test_ret += test_xmlUCSIsUgaritic();
43153 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43154 test_ret += test_xmlUCSIsVariationSelectors();
43155 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43156 test_ret += test_xmlUCSIsYiRadicals();
43157 test_ret += test_xmlUCSIsYiSyllables();
43158 test_ret += test_xmlUCSIsYijingHexagramSymbols();
43161 printf("Module xmlunicode: %d errors\n", test_ret);
43166 test_xmlNewTextWriter(void) {
43169 #if defined(LIBXML_WRITER_ENABLED)
43171 xmlTextWriterPtr ret_val;
43172 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43175 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43176 mem_base = xmlMemBlocks();
43177 out = gen_xmlOutputBufferPtr(n_out, 0);
43179 ret_val = xmlNewTextWriter(out);
43180 if (ret_val != NULL) out = NULL;
43181 desret_xmlTextWriterPtr(ret_val);
43183 des_xmlOutputBufferPtr(n_out, out, 0);
43184 xmlResetLastError();
43185 if (mem_base != xmlMemBlocks()) {
43186 printf("Leak of %d blocks found in xmlNewTextWriter",
43187 xmlMemBlocks() - mem_base);
43189 printf(" %d", n_out);
43201 test_xmlNewTextWriterFilename(void) {
43204 #if defined(LIBXML_WRITER_ENABLED)
43206 xmlTextWriterPtr ret_val;
43207 const char * uri; /* the URI of the resource for the output */
43209 int compression; /* compress the output? */
43212 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43213 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43214 mem_base = xmlMemBlocks();
43215 uri = gen_fileoutput(n_uri, 0);
43216 compression = gen_int(n_compression, 1);
43218 ret_val = xmlNewTextWriterFilename(uri, compression);
43219 desret_xmlTextWriterPtr(ret_val);
43221 des_fileoutput(n_uri, uri, 0);
43222 des_int(n_compression, compression, 1);
43223 xmlResetLastError();
43224 if (mem_base != xmlMemBlocks()) {
43225 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43226 xmlMemBlocks() - mem_base);
43228 printf(" %d", n_uri);
43229 printf(" %d", n_compression);
43242 test_xmlNewTextWriterMemory(void) {
43245 #if defined(LIBXML_WRITER_ENABLED)
43247 xmlTextWriterPtr ret_val;
43248 xmlBufferPtr buf; /* xmlBufferPtr */
43250 int compression; /* compress the output? */
43253 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43254 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43255 mem_base = xmlMemBlocks();
43256 buf = gen_xmlBufferPtr(n_buf, 0);
43257 compression = gen_int(n_compression, 1);
43259 ret_val = xmlNewTextWriterMemory(buf, compression);
43260 desret_xmlTextWriterPtr(ret_val);
43262 des_xmlBufferPtr(n_buf, buf, 0);
43263 des_int(n_compression, compression, 1);
43264 xmlResetLastError();
43265 if (mem_base != xmlMemBlocks()) {
43266 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43267 xmlMemBlocks() - mem_base);
43269 printf(" %d", n_buf);
43270 printf(" %d", n_compression);
43283 test_xmlNewTextWriterPushParser(void) {
43286 #if defined(LIBXML_WRITER_ENABLED)
43288 xmlTextWriterPtr ret_val;
43289 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43291 int compression; /* compress the output? */
43294 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43295 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43296 mem_base = xmlMemBlocks();
43297 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43298 compression = gen_int(n_compression, 1);
43300 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43301 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43302 desret_xmlTextWriterPtr(ret_val);
43304 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43305 des_int(n_compression, compression, 1);
43306 xmlResetLastError();
43307 if (mem_base != xmlMemBlocks()) {
43308 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43309 xmlMemBlocks() - mem_base);
43311 printf(" %d", n_ctxt);
43312 printf(" %d", n_compression);
43325 test_xmlNewTextWriterTree(void) {
43328 #if defined(LIBXML_WRITER_ENABLED)
43330 xmlTextWriterPtr ret_val;
43331 xmlDocPtr doc; /* xmlDocPtr */
43333 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43335 int compression; /* compress the output? */
43338 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43339 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43340 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43341 mem_base = xmlMemBlocks();
43342 doc = gen_xmlDocPtr(n_doc, 0);
43343 node = gen_xmlNodePtr(n_node, 1);
43344 compression = gen_int(n_compression, 2);
43346 ret_val = xmlNewTextWriterTree(doc, node, compression);
43347 desret_xmlTextWriterPtr(ret_val);
43349 des_xmlDocPtr(n_doc, doc, 0);
43350 des_xmlNodePtr(n_node, node, 1);
43351 des_int(n_compression, compression, 2);
43352 xmlResetLastError();
43353 if (mem_base != xmlMemBlocks()) {
43354 printf("Leak of %d blocks found in xmlNewTextWriterTree",
43355 xmlMemBlocks() - mem_base);
43357 printf(" %d", n_doc);
43358 printf(" %d", n_node);
43359 printf(" %d", n_compression);
43373 test_xmlTextWriterEndAttribute(void) {
43376 #if defined(LIBXML_WRITER_ENABLED)
43379 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43382 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43383 mem_base = xmlMemBlocks();
43384 writer = gen_xmlTextWriterPtr(n_writer, 0);
43386 ret_val = xmlTextWriterEndAttribute(writer);
43387 desret_int(ret_val);
43389 des_xmlTextWriterPtr(n_writer, writer, 0);
43390 xmlResetLastError();
43391 if (mem_base != xmlMemBlocks()) {
43392 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43393 xmlMemBlocks() - mem_base);
43395 printf(" %d", n_writer);
43407 test_xmlTextWriterEndCDATA(void) {
43410 #if defined(LIBXML_WRITER_ENABLED)
43413 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43416 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43417 mem_base = xmlMemBlocks();
43418 writer = gen_xmlTextWriterPtr(n_writer, 0);
43420 ret_val = xmlTextWriterEndCDATA(writer);
43421 desret_int(ret_val);
43423 des_xmlTextWriterPtr(n_writer, writer, 0);
43424 xmlResetLastError();
43425 if (mem_base != xmlMemBlocks()) {
43426 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43427 xmlMemBlocks() - mem_base);
43429 printf(" %d", n_writer);
43441 test_xmlTextWriterEndComment(void) {
43444 #if defined(LIBXML_WRITER_ENABLED)
43447 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43450 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43451 mem_base = xmlMemBlocks();
43452 writer = gen_xmlTextWriterPtr(n_writer, 0);
43454 ret_val = xmlTextWriterEndComment(writer);
43455 desret_int(ret_val);
43457 des_xmlTextWriterPtr(n_writer, writer, 0);
43458 xmlResetLastError();
43459 if (mem_base != xmlMemBlocks()) {
43460 printf("Leak of %d blocks found in xmlTextWriterEndComment",
43461 xmlMemBlocks() - mem_base);
43463 printf(" %d", n_writer);
43475 test_xmlTextWriterEndDTD(void) {
43478 #if defined(LIBXML_WRITER_ENABLED)
43481 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43484 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43485 mem_base = xmlMemBlocks();
43486 writer = gen_xmlTextWriterPtr(n_writer, 0);
43488 ret_val = xmlTextWriterEndDTD(writer);
43489 desret_int(ret_val);
43491 des_xmlTextWriterPtr(n_writer, writer, 0);
43492 xmlResetLastError();
43493 if (mem_base != xmlMemBlocks()) {
43494 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43495 xmlMemBlocks() - mem_base);
43497 printf(" %d", n_writer);
43509 test_xmlTextWriterEndDTDAttlist(void) {
43512 #if defined(LIBXML_WRITER_ENABLED)
43515 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43518 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43519 mem_base = xmlMemBlocks();
43520 writer = gen_xmlTextWriterPtr(n_writer, 0);
43522 ret_val = xmlTextWriterEndDTDAttlist(writer);
43523 desret_int(ret_val);
43525 des_xmlTextWriterPtr(n_writer, writer, 0);
43526 xmlResetLastError();
43527 if (mem_base != xmlMemBlocks()) {
43528 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43529 xmlMemBlocks() - mem_base);
43531 printf(" %d", n_writer);
43543 test_xmlTextWriterEndDTDElement(void) {
43546 #if defined(LIBXML_WRITER_ENABLED)
43549 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43552 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43553 mem_base = xmlMemBlocks();
43554 writer = gen_xmlTextWriterPtr(n_writer, 0);
43556 ret_val = xmlTextWriterEndDTDElement(writer);
43557 desret_int(ret_val);
43559 des_xmlTextWriterPtr(n_writer, writer, 0);
43560 xmlResetLastError();
43561 if (mem_base != xmlMemBlocks()) {
43562 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43563 xmlMemBlocks() - mem_base);
43565 printf(" %d", n_writer);
43577 test_xmlTextWriterEndDTDEntity(void) {
43580 #if defined(LIBXML_WRITER_ENABLED)
43583 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43586 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43587 mem_base = xmlMemBlocks();
43588 writer = gen_xmlTextWriterPtr(n_writer, 0);
43590 ret_val = xmlTextWriterEndDTDEntity(writer);
43591 desret_int(ret_val);
43593 des_xmlTextWriterPtr(n_writer, writer, 0);
43594 xmlResetLastError();
43595 if (mem_base != xmlMemBlocks()) {
43596 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43597 xmlMemBlocks() - mem_base);
43599 printf(" %d", n_writer);
43611 test_xmlTextWriterEndDocument(void) {
43614 #if defined(LIBXML_WRITER_ENABLED)
43617 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43620 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43621 mem_base = xmlMemBlocks();
43622 writer = gen_xmlTextWriterPtr(n_writer, 0);
43624 ret_val = xmlTextWriterEndDocument(writer);
43625 desret_int(ret_val);
43627 des_xmlTextWriterPtr(n_writer, writer, 0);
43628 xmlResetLastError();
43629 if (mem_base != xmlMemBlocks()) {
43630 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43631 xmlMemBlocks() - mem_base);
43633 printf(" %d", n_writer);
43645 test_xmlTextWriterEndElement(void) {
43648 #if defined(LIBXML_WRITER_ENABLED)
43651 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43654 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43655 mem_base = xmlMemBlocks();
43656 writer = gen_xmlTextWriterPtr(n_writer, 0);
43658 ret_val = xmlTextWriterEndElement(writer);
43659 desret_int(ret_val);
43661 des_xmlTextWriterPtr(n_writer, writer, 0);
43662 xmlResetLastError();
43663 if (mem_base != xmlMemBlocks()) {
43664 printf("Leak of %d blocks found in xmlTextWriterEndElement",
43665 xmlMemBlocks() - mem_base);
43667 printf(" %d", n_writer);
43679 test_xmlTextWriterEndPI(void) {
43682 #if defined(LIBXML_WRITER_ENABLED)
43685 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43688 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43689 mem_base = xmlMemBlocks();
43690 writer = gen_xmlTextWriterPtr(n_writer, 0);
43692 ret_val = xmlTextWriterEndPI(writer);
43693 desret_int(ret_val);
43695 des_xmlTextWriterPtr(n_writer, writer, 0);
43696 xmlResetLastError();
43697 if (mem_base != xmlMemBlocks()) {
43698 printf("Leak of %d blocks found in xmlTextWriterEndPI",
43699 xmlMemBlocks() - mem_base);
43701 printf(" %d", n_writer);
43713 test_xmlTextWriterFlush(void) {
43716 #if defined(LIBXML_WRITER_ENABLED)
43719 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43722 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43723 mem_base = xmlMemBlocks();
43724 writer = gen_xmlTextWriterPtr(n_writer, 0);
43726 ret_val = xmlTextWriterFlush(writer);
43727 desret_int(ret_val);
43729 des_xmlTextWriterPtr(n_writer, writer, 0);
43730 xmlResetLastError();
43731 if (mem_base != xmlMemBlocks()) {
43732 printf("Leak of %d blocks found in xmlTextWriterFlush",
43733 xmlMemBlocks() - mem_base);
43735 printf(" %d", n_writer);
43747 test_xmlTextWriterFullEndElement(void) {
43750 #if defined(LIBXML_WRITER_ENABLED)
43753 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43756 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43757 mem_base = xmlMemBlocks();
43758 writer = gen_xmlTextWriterPtr(n_writer, 0);
43760 ret_val = xmlTextWriterFullEndElement(writer);
43761 desret_int(ret_val);
43763 des_xmlTextWriterPtr(n_writer, writer, 0);
43764 xmlResetLastError();
43765 if (mem_base != xmlMemBlocks()) {
43766 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43767 xmlMemBlocks() - mem_base);
43769 printf(" %d", n_writer);
43781 test_xmlTextWriterSetIndent(void) {
43784 #if defined(LIBXML_WRITER_ENABLED)
43787 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43789 int indent; /* do indentation? */
43792 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43793 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43794 mem_base = xmlMemBlocks();
43795 writer = gen_xmlTextWriterPtr(n_writer, 0);
43796 indent = gen_int(n_indent, 1);
43798 ret_val = xmlTextWriterSetIndent(writer, indent);
43799 desret_int(ret_val);
43801 des_xmlTextWriterPtr(n_writer, writer, 0);
43802 des_int(n_indent, indent, 1);
43803 xmlResetLastError();
43804 if (mem_base != xmlMemBlocks()) {
43805 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43806 xmlMemBlocks() - mem_base);
43808 printf(" %d", n_writer);
43809 printf(" %d", n_indent);
43822 test_xmlTextWriterSetIndentString(void) {
43825 #if defined(LIBXML_WRITER_ENABLED)
43828 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43830 xmlChar * str; /* the xmlChar string */
43833 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43834 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43835 mem_base = xmlMemBlocks();
43836 writer = gen_xmlTextWriterPtr(n_writer, 0);
43837 str = gen_const_xmlChar_ptr(n_str, 1);
43839 ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43840 desret_int(ret_val);
43842 des_xmlTextWriterPtr(n_writer, writer, 0);
43843 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43844 xmlResetLastError();
43845 if (mem_base != xmlMemBlocks()) {
43846 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43847 xmlMemBlocks() - mem_base);
43849 printf(" %d", n_writer);
43850 printf(" %d", n_str);
43863 test_xmlTextWriterSetQuoteChar(void) {
43866 #if defined(LIBXML_WRITER_ENABLED)
43869 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43871 xmlChar quotechar; /* the quote character */
43874 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43875 for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
43876 mem_base = xmlMemBlocks();
43877 writer = gen_xmlTextWriterPtr(n_writer, 0);
43878 quotechar = gen_xmlChar(n_quotechar, 1);
43880 ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
43881 desret_int(ret_val);
43883 des_xmlTextWriterPtr(n_writer, writer, 0);
43884 des_xmlChar(n_quotechar, quotechar, 1);
43885 xmlResetLastError();
43886 if (mem_base != xmlMemBlocks()) {
43887 printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
43888 xmlMemBlocks() - mem_base);
43890 printf(" %d", n_writer);
43891 printf(" %d", n_quotechar);
43904 test_xmlTextWriterStartAttribute(void) {
43907 #if defined(LIBXML_WRITER_ENABLED)
43910 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43912 xmlChar * name; /* element name */
43915 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43916 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43917 mem_base = xmlMemBlocks();
43918 writer = gen_xmlTextWriterPtr(n_writer, 0);
43919 name = gen_const_xmlChar_ptr(n_name, 1);
43921 ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43922 desret_int(ret_val);
43924 des_xmlTextWriterPtr(n_writer, writer, 0);
43925 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43926 xmlResetLastError();
43927 if (mem_base != xmlMemBlocks()) {
43928 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43929 xmlMemBlocks() - mem_base);
43931 printf(" %d", n_writer);
43932 printf(" %d", n_name);
43945 test_xmlTextWriterStartAttributeNS(void) {
43948 #if defined(LIBXML_WRITER_ENABLED)
43951 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43953 xmlChar * prefix; /* namespace prefix or NULL */
43955 xmlChar * name; /* element local name */
43957 xmlChar * namespaceURI; /* namespace URI or NULL */
43958 int n_namespaceURI;
43960 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43961 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43962 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43963 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43964 mem_base = xmlMemBlocks();
43965 writer = gen_xmlTextWriterPtr(n_writer, 0);
43966 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43967 name = gen_const_xmlChar_ptr(n_name, 2);
43968 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43970 ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43971 desret_int(ret_val);
43973 des_xmlTextWriterPtr(n_writer, writer, 0);
43974 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43975 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43976 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43977 xmlResetLastError();
43978 if (mem_base != xmlMemBlocks()) {
43979 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43980 xmlMemBlocks() - mem_base);
43982 printf(" %d", n_writer);
43983 printf(" %d", n_prefix);
43984 printf(" %d", n_name);
43985 printf(" %d", n_namespaceURI);
44000 test_xmlTextWriterStartCDATA(void) {
44003 #if defined(LIBXML_WRITER_ENABLED)
44006 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44009 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44010 mem_base = xmlMemBlocks();
44011 writer = gen_xmlTextWriterPtr(n_writer, 0);
44013 ret_val = xmlTextWriterStartCDATA(writer);
44014 desret_int(ret_val);
44016 des_xmlTextWriterPtr(n_writer, writer, 0);
44017 xmlResetLastError();
44018 if (mem_base != xmlMemBlocks()) {
44019 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
44020 xmlMemBlocks() - mem_base);
44022 printf(" %d", n_writer);
44034 test_xmlTextWriterStartComment(void) {
44037 #if defined(LIBXML_WRITER_ENABLED)
44040 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44043 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44044 mem_base = xmlMemBlocks();
44045 writer = gen_xmlTextWriterPtr(n_writer, 0);
44047 ret_val = xmlTextWriterStartComment(writer);
44048 desret_int(ret_val);
44050 des_xmlTextWriterPtr(n_writer, writer, 0);
44051 xmlResetLastError();
44052 if (mem_base != xmlMemBlocks()) {
44053 printf("Leak of %d blocks found in xmlTextWriterStartComment",
44054 xmlMemBlocks() - mem_base);
44056 printf(" %d", n_writer);
44068 test_xmlTextWriterStartDTD(void) {
44071 #if defined(LIBXML_WRITER_ENABLED)
44074 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44076 xmlChar * name; /* the name of the DTD */
44078 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44080 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44083 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44084 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44085 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44086 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44087 mem_base = xmlMemBlocks();
44088 writer = gen_xmlTextWriterPtr(n_writer, 0);
44089 name = gen_const_xmlChar_ptr(n_name, 1);
44090 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44091 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44093 ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44094 desret_int(ret_val);
44096 des_xmlTextWriterPtr(n_writer, writer, 0);
44097 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44098 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44099 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44100 xmlResetLastError();
44101 if (mem_base != xmlMemBlocks()) {
44102 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44103 xmlMemBlocks() - mem_base);
44105 printf(" %d", n_writer);
44106 printf(" %d", n_name);
44107 printf(" %d", n_pubid);
44108 printf(" %d", n_sysid);
44123 test_xmlTextWriterStartDTDAttlist(void) {
44126 #if defined(LIBXML_WRITER_ENABLED)
44129 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44131 xmlChar * name; /* the name of the DTD ATTLIST */
44134 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44135 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44136 mem_base = xmlMemBlocks();
44137 writer = gen_xmlTextWriterPtr(n_writer, 0);
44138 name = gen_const_xmlChar_ptr(n_name, 1);
44140 ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44141 desret_int(ret_val);
44143 des_xmlTextWriterPtr(n_writer, writer, 0);
44144 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44145 xmlResetLastError();
44146 if (mem_base != xmlMemBlocks()) {
44147 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44148 xmlMemBlocks() - mem_base);
44150 printf(" %d", n_writer);
44151 printf(" %d", n_name);
44164 test_xmlTextWriterStartDTDElement(void) {
44167 #if defined(LIBXML_WRITER_ENABLED)
44170 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44172 xmlChar * name; /* the name of the DTD element */
44175 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44177 mem_base = xmlMemBlocks();
44178 writer = gen_xmlTextWriterPtr(n_writer, 0);
44179 name = gen_const_xmlChar_ptr(n_name, 1);
44181 ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44182 desret_int(ret_val);
44184 des_xmlTextWriterPtr(n_writer, writer, 0);
44185 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44186 xmlResetLastError();
44187 if (mem_base != xmlMemBlocks()) {
44188 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44189 xmlMemBlocks() - mem_base);
44191 printf(" %d", n_writer);
44192 printf(" %d", n_name);
44205 test_xmlTextWriterStartDTDEntity(void) {
44208 #if defined(LIBXML_WRITER_ENABLED)
44211 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44213 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44215 xmlChar * name; /* the name of the DTD ATTLIST */
44218 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44219 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44220 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44221 mem_base = xmlMemBlocks();
44222 writer = gen_xmlTextWriterPtr(n_writer, 0);
44223 pe = gen_int(n_pe, 1);
44224 name = gen_const_xmlChar_ptr(n_name, 2);
44226 ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44227 desret_int(ret_val);
44229 des_xmlTextWriterPtr(n_writer, writer, 0);
44230 des_int(n_pe, pe, 1);
44231 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44232 xmlResetLastError();
44233 if (mem_base != xmlMemBlocks()) {
44234 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44235 xmlMemBlocks() - mem_base);
44237 printf(" %d", n_writer);
44238 printf(" %d", n_pe);
44239 printf(" %d", n_name);
44253 test_xmlTextWriterStartDocument(void) {
44256 #if defined(LIBXML_WRITER_ENABLED)
44259 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44261 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44263 char * encoding; /* the encoding or NULL for default */
44265 char * standalone; /* "yes" or "no" or NULL for default */
44268 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44269 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44270 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44271 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44272 mem_base = xmlMemBlocks();
44273 writer = gen_xmlTextWriterPtr(n_writer, 0);
44274 version = gen_const_char_ptr(n_version, 1);
44275 encoding = gen_const_char_ptr(n_encoding, 2);
44276 standalone = gen_const_char_ptr(n_standalone, 3);
44278 ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44279 desret_int(ret_val);
44281 des_xmlTextWriterPtr(n_writer, writer, 0);
44282 des_const_char_ptr(n_version, (const char *)version, 1);
44283 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44284 des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44285 xmlResetLastError();
44286 if (mem_base != xmlMemBlocks()) {
44287 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44288 xmlMemBlocks() - mem_base);
44290 printf(" %d", n_writer);
44291 printf(" %d", n_version);
44292 printf(" %d", n_encoding);
44293 printf(" %d", n_standalone);
44308 test_xmlTextWriterStartElement(void) {
44311 #if defined(LIBXML_WRITER_ENABLED)
44314 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44316 xmlChar * name; /* element name */
44319 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44320 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44321 mem_base = xmlMemBlocks();
44322 writer = gen_xmlTextWriterPtr(n_writer, 0);
44323 name = gen_const_xmlChar_ptr(n_name, 1);
44325 ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44326 desret_int(ret_val);
44328 des_xmlTextWriterPtr(n_writer, writer, 0);
44329 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44330 xmlResetLastError();
44331 if (mem_base != xmlMemBlocks()) {
44332 printf("Leak of %d blocks found in xmlTextWriterStartElement",
44333 xmlMemBlocks() - mem_base);
44335 printf(" %d", n_writer);
44336 printf(" %d", n_name);
44349 test_xmlTextWriterStartElementNS(void) {
44352 #if defined(LIBXML_WRITER_ENABLED)
44355 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44357 xmlChar * prefix; /* namespace prefix or NULL */
44359 xmlChar * name; /* element local name */
44361 xmlChar * namespaceURI; /* namespace URI or NULL */
44362 int n_namespaceURI;
44364 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44365 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44366 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44367 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44368 mem_base = xmlMemBlocks();
44369 writer = gen_xmlTextWriterPtr(n_writer, 0);
44370 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44371 name = gen_const_xmlChar_ptr(n_name, 2);
44372 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44374 ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44375 desret_int(ret_val);
44377 des_xmlTextWriterPtr(n_writer, writer, 0);
44378 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44379 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44380 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44381 xmlResetLastError();
44382 if (mem_base != xmlMemBlocks()) {
44383 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44384 xmlMemBlocks() - mem_base);
44386 printf(" %d", n_writer);
44387 printf(" %d", n_prefix);
44388 printf(" %d", n_name);
44389 printf(" %d", n_namespaceURI);
44404 test_xmlTextWriterStartPI(void) {
44407 #if defined(LIBXML_WRITER_ENABLED)
44410 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44412 xmlChar * target; /* PI target */
44415 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44416 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44417 mem_base = xmlMemBlocks();
44418 writer = gen_xmlTextWriterPtr(n_writer, 0);
44419 target = gen_const_xmlChar_ptr(n_target, 1);
44421 ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44422 desret_int(ret_val);
44424 des_xmlTextWriterPtr(n_writer, writer, 0);
44425 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44426 xmlResetLastError();
44427 if (mem_base != xmlMemBlocks()) {
44428 printf("Leak of %d blocks found in xmlTextWriterStartPI",
44429 xmlMemBlocks() - mem_base);
44431 printf(" %d", n_writer);
44432 printf(" %d", n_target);
44445 test_xmlTextWriterWriteAttribute(void) {
44448 #if defined(LIBXML_WRITER_ENABLED)
44451 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44453 xmlChar * name; /* attribute name */
44455 xmlChar * content; /* attribute content */
44458 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44459 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44460 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44461 mem_base = xmlMemBlocks();
44462 writer = gen_xmlTextWriterPtr(n_writer, 0);
44463 name = gen_const_xmlChar_ptr(n_name, 1);
44464 content = gen_const_xmlChar_ptr(n_content, 2);
44466 ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44467 desret_int(ret_val);
44469 des_xmlTextWriterPtr(n_writer, writer, 0);
44470 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44471 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44472 xmlResetLastError();
44473 if (mem_base != xmlMemBlocks()) {
44474 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44475 xmlMemBlocks() - mem_base);
44477 printf(" %d", n_writer);
44478 printf(" %d", n_name);
44479 printf(" %d", n_content);
44493 test_xmlTextWriterWriteAttributeNS(void) {
44496 #if defined(LIBXML_WRITER_ENABLED)
44499 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44501 xmlChar * prefix; /* namespace prefix */
44503 xmlChar * name; /* attribute local name */
44505 xmlChar * namespaceURI; /* namespace URI */
44506 int n_namespaceURI;
44507 xmlChar * content; /* attribute content */
44510 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44511 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44512 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44513 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44514 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44515 mem_base = xmlMemBlocks();
44516 writer = gen_xmlTextWriterPtr(n_writer, 0);
44517 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44518 name = gen_const_xmlChar_ptr(n_name, 2);
44519 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44520 content = gen_const_xmlChar_ptr(n_content, 4);
44522 ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44523 desret_int(ret_val);
44525 des_xmlTextWriterPtr(n_writer, writer, 0);
44526 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44527 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44528 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44529 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44530 xmlResetLastError();
44531 if (mem_base != xmlMemBlocks()) {
44532 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44533 xmlMemBlocks() - mem_base);
44535 printf(" %d", n_writer);
44536 printf(" %d", n_prefix);
44537 printf(" %d", n_name);
44538 printf(" %d", n_namespaceURI);
44539 printf(" %d", n_content);
44555 test_xmlTextWriterWriteBase64(void) {
44558 #if defined(LIBXML_WRITER_ENABLED)
44561 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44563 char * data; /* binary data */
44565 int start; /* the position within the data of the first byte to encode */
44567 int len; /* the number of bytes to encode */
44570 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44571 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44572 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44573 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44574 mem_base = xmlMemBlocks();
44575 writer = gen_xmlTextWriterPtr(n_writer, 0);
44576 data = gen_const_char_ptr(n_data, 1);
44577 start = gen_int(n_start, 2);
44578 len = gen_int(n_len, 3);
44580 ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44581 desret_int(ret_val);
44583 des_xmlTextWriterPtr(n_writer, writer, 0);
44584 des_const_char_ptr(n_data, (const char *)data, 1);
44585 des_int(n_start, start, 2);
44586 des_int(n_len, len, 3);
44587 xmlResetLastError();
44588 if (mem_base != xmlMemBlocks()) {
44589 printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44590 xmlMemBlocks() - mem_base);
44592 printf(" %d", n_writer);
44593 printf(" %d", n_data);
44594 printf(" %d", n_start);
44595 printf(" %d", n_len);
44610 test_xmlTextWriterWriteBinHex(void) {
44613 #if defined(LIBXML_WRITER_ENABLED)
44616 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44618 char * data; /* binary data */
44620 int start; /* the position within the data of the first byte to encode */
44622 int len; /* the number of bytes to encode */
44625 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44626 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44627 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44628 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44629 mem_base = xmlMemBlocks();
44630 writer = gen_xmlTextWriterPtr(n_writer, 0);
44631 data = gen_const_char_ptr(n_data, 1);
44632 start = gen_int(n_start, 2);
44633 len = gen_int(n_len, 3);
44635 ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44636 desret_int(ret_val);
44638 des_xmlTextWriterPtr(n_writer, writer, 0);
44639 des_const_char_ptr(n_data, (const char *)data, 1);
44640 des_int(n_start, start, 2);
44641 des_int(n_len, len, 3);
44642 xmlResetLastError();
44643 if (mem_base != xmlMemBlocks()) {
44644 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44645 xmlMemBlocks() - mem_base);
44647 printf(" %d", n_writer);
44648 printf(" %d", n_data);
44649 printf(" %d", n_start);
44650 printf(" %d", n_len);
44665 test_xmlTextWriterWriteCDATA(void) {
44668 #if defined(LIBXML_WRITER_ENABLED)
44671 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44673 xmlChar * content; /* CDATA content */
44676 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44677 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44678 mem_base = xmlMemBlocks();
44679 writer = gen_xmlTextWriterPtr(n_writer, 0);
44680 content = gen_const_xmlChar_ptr(n_content, 1);
44682 ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44683 desret_int(ret_val);
44685 des_xmlTextWriterPtr(n_writer, writer, 0);
44686 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44687 xmlResetLastError();
44688 if (mem_base != xmlMemBlocks()) {
44689 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44690 xmlMemBlocks() - mem_base);
44692 printf(" %d", n_writer);
44693 printf(" %d", n_content);
44706 test_xmlTextWriterWriteComment(void) {
44709 #if defined(LIBXML_WRITER_ENABLED)
44712 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44714 xmlChar * content; /* comment string */
44717 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44718 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44719 mem_base = xmlMemBlocks();
44720 writer = gen_xmlTextWriterPtr(n_writer, 0);
44721 content = gen_const_xmlChar_ptr(n_content, 1);
44723 ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44724 desret_int(ret_val);
44726 des_xmlTextWriterPtr(n_writer, writer, 0);
44727 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44728 xmlResetLastError();
44729 if (mem_base != xmlMemBlocks()) {
44730 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44731 xmlMemBlocks() - mem_base);
44733 printf(" %d", n_writer);
44734 printf(" %d", n_content);
44747 test_xmlTextWriterWriteDTD(void) {
44750 #if defined(LIBXML_WRITER_ENABLED)
44753 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44755 xmlChar * name; /* the name of the DTD */
44757 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44759 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44761 xmlChar * subset; /* string content of the DTD */
44764 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44765 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44766 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44767 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44768 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44769 mem_base = xmlMemBlocks();
44770 writer = gen_xmlTextWriterPtr(n_writer, 0);
44771 name = gen_const_xmlChar_ptr(n_name, 1);
44772 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44773 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44774 subset = gen_const_xmlChar_ptr(n_subset, 4);
44776 ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44777 desret_int(ret_val);
44779 des_xmlTextWriterPtr(n_writer, writer, 0);
44780 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44781 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44782 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44783 des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44784 xmlResetLastError();
44785 if (mem_base != xmlMemBlocks()) {
44786 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44787 xmlMemBlocks() - mem_base);
44789 printf(" %d", n_writer);
44790 printf(" %d", n_name);
44791 printf(" %d", n_pubid);
44792 printf(" %d", n_sysid);
44793 printf(" %d", n_subset);
44809 test_xmlTextWriterWriteDTDAttlist(void) {
44812 #if defined(LIBXML_WRITER_ENABLED)
44815 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44817 xmlChar * name; /* the name of the DTD ATTLIST */
44819 xmlChar * content; /* content of the ATTLIST */
44822 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44823 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44824 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44825 mem_base = xmlMemBlocks();
44826 writer = gen_xmlTextWriterPtr(n_writer, 0);
44827 name = gen_const_xmlChar_ptr(n_name, 1);
44828 content = gen_const_xmlChar_ptr(n_content, 2);
44830 ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44831 desret_int(ret_val);
44833 des_xmlTextWriterPtr(n_writer, writer, 0);
44834 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44835 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44836 xmlResetLastError();
44837 if (mem_base != xmlMemBlocks()) {
44838 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44839 xmlMemBlocks() - mem_base);
44841 printf(" %d", n_writer);
44842 printf(" %d", n_name);
44843 printf(" %d", n_content);
44857 test_xmlTextWriterWriteDTDElement(void) {
44860 #if defined(LIBXML_WRITER_ENABLED)
44863 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44865 xmlChar * name; /* the name of the DTD element */
44867 xmlChar * content; /* content of the element */
44870 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44871 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44872 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44873 mem_base = xmlMemBlocks();
44874 writer = gen_xmlTextWriterPtr(n_writer, 0);
44875 name = gen_const_xmlChar_ptr(n_name, 1);
44876 content = gen_const_xmlChar_ptr(n_content, 2);
44878 ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44879 desret_int(ret_val);
44881 des_xmlTextWriterPtr(n_writer, writer, 0);
44882 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44883 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44884 xmlResetLastError();
44885 if (mem_base != xmlMemBlocks()) {
44886 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44887 xmlMemBlocks() - mem_base);
44889 printf(" %d", n_writer);
44890 printf(" %d", n_name);
44891 printf(" %d", n_content);
44905 test_xmlTextWriterWriteDTDEntity(void) {
44908 #if defined(LIBXML_WRITER_ENABLED)
44911 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44913 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44915 xmlChar * name; /* the name of the DTD entity */
44917 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44919 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44921 xmlChar * ndataid; /* the xml notation name. */
44923 xmlChar * content; /* content of the entity */
44926 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44927 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44928 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44929 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44930 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44931 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44932 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44933 mem_base = xmlMemBlocks();
44934 writer = gen_xmlTextWriterPtr(n_writer, 0);
44935 pe = gen_int(n_pe, 1);
44936 name = gen_const_xmlChar_ptr(n_name, 2);
44937 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44938 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44939 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44940 content = gen_const_xmlChar_ptr(n_content, 6);
44942 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44943 desret_int(ret_val);
44945 des_xmlTextWriterPtr(n_writer, writer, 0);
44946 des_int(n_pe, pe, 1);
44947 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44948 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44949 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44950 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44951 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44952 xmlResetLastError();
44953 if (mem_base != xmlMemBlocks()) {
44954 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44955 xmlMemBlocks() - mem_base);
44957 printf(" %d", n_writer);
44958 printf(" %d", n_pe);
44959 printf(" %d", n_name);
44960 printf(" %d", n_pubid);
44961 printf(" %d", n_sysid);
44962 printf(" %d", n_ndataid);
44963 printf(" %d", n_content);
44981 test_xmlTextWriterWriteDTDExternalEntity(void) {
44984 #if defined(LIBXML_WRITER_ENABLED)
44987 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44989 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44991 xmlChar * name; /* the name of the DTD entity */
44993 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44995 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44997 xmlChar * ndataid; /* the xml notation name. */
45000 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45001 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45002 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45003 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45004 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45005 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45006 mem_base = xmlMemBlocks();
45007 writer = gen_xmlTextWriterPtr(n_writer, 0);
45008 pe = gen_int(n_pe, 1);
45009 name = gen_const_xmlChar_ptr(n_name, 2);
45010 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45011 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45012 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45014 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45015 desret_int(ret_val);
45017 des_xmlTextWriterPtr(n_writer, writer, 0);
45018 des_int(n_pe, pe, 1);
45019 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45020 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45021 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45022 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45023 xmlResetLastError();
45024 if (mem_base != xmlMemBlocks()) {
45025 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45026 xmlMemBlocks() - mem_base);
45028 printf(" %d", n_writer);
45029 printf(" %d", n_pe);
45030 printf(" %d", n_name);
45031 printf(" %d", n_pubid);
45032 printf(" %d", n_sysid);
45033 printf(" %d", n_ndataid);
45050 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45053 #if defined(LIBXML_WRITER_ENABLED)
45056 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45058 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45060 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45062 xmlChar * ndataid; /* the xml notation name. */
45065 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45066 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45067 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45068 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45069 mem_base = xmlMemBlocks();
45070 writer = gen_xmlTextWriterPtr(n_writer, 0);
45071 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45072 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45073 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45075 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45076 desret_int(ret_val);
45078 des_xmlTextWriterPtr(n_writer, writer, 0);
45079 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45080 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45081 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45082 xmlResetLastError();
45083 if (mem_base != xmlMemBlocks()) {
45084 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45085 xmlMemBlocks() - mem_base);
45087 printf(" %d", n_writer);
45088 printf(" %d", n_pubid);
45089 printf(" %d", n_sysid);
45090 printf(" %d", n_ndataid);
45105 test_xmlTextWriterWriteDTDInternalEntity(void) {
45108 #if defined(LIBXML_WRITER_ENABLED)
45111 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45113 int pe; /* TRUE if this is a parameter entity, FALSE if not */
45115 xmlChar * name; /* the name of the DTD entity */
45117 xmlChar * content; /* content of the entity */
45120 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45121 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45122 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45123 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45124 mem_base = xmlMemBlocks();
45125 writer = gen_xmlTextWriterPtr(n_writer, 0);
45126 pe = gen_int(n_pe, 1);
45127 name = gen_const_xmlChar_ptr(n_name, 2);
45128 content = gen_const_xmlChar_ptr(n_content, 3);
45130 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45131 desret_int(ret_val);
45133 des_xmlTextWriterPtr(n_writer, writer, 0);
45134 des_int(n_pe, pe, 1);
45135 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45136 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45137 xmlResetLastError();
45138 if (mem_base != xmlMemBlocks()) {
45139 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45140 xmlMemBlocks() - mem_base);
45142 printf(" %d", n_writer);
45143 printf(" %d", n_pe);
45144 printf(" %d", n_name);
45145 printf(" %d", n_content);
45160 test_xmlTextWriterWriteDTDNotation(void) {
45163 #if defined(LIBXML_WRITER_ENABLED)
45166 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45168 xmlChar * name; /* the name of the xml notation */
45170 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45172 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45175 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45177 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45178 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45179 mem_base = xmlMemBlocks();
45180 writer = gen_xmlTextWriterPtr(n_writer, 0);
45181 name = gen_const_xmlChar_ptr(n_name, 1);
45182 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45183 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45185 ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45186 desret_int(ret_val);
45188 des_xmlTextWriterPtr(n_writer, writer, 0);
45189 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45190 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45191 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45192 xmlResetLastError();
45193 if (mem_base != xmlMemBlocks()) {
45194 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45195 xmlMemBlocks() - mem_base);
45197 printf(" %d", n_writer);
45198 printf(" %d", n_name);
45199 printf(" %d", n_pubid);
45200 printf(" %d", n_sysid);
45215 test_xmlTextWriterWriteElement(void) {
45218 #if defined(LIBXML_WRITER_ENABLED)
45221 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45223 xmlChar * name; /* element name */
45225 xmlChar * content; /* element content */
45228 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45229 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45230 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45231 mem_base = xmlMemBlocks();
45232 writer = gen_xmlTextWriterPtr(n_writer, 0);
45233 name = gen_const_xmlChar_ptr(n_name, 1);
45234 content = gen_const_xmlChar_ptr(n_content, 2);
45236 ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45237 desret_int(ret_val);
45239 des_xmlTextWriterPtr(n_writer, writer, 0);
45240 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45241 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45242 xmlResetLastError();
45243 if (mem_base != xmlMemBlocks()) {
45244 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45245 xmlMemBlocks() - mem_base);
45247 printf(" %d", n_writer);
45248 printf(" %d", n_name);
45249 printf(" %d", n_content);
45263 test_xmlTextWriterWriteElementNS(void) {
45266 #if defined(LIBXML_WRITER_ENABLED)
45269 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45271 xmlChar * prefix; /* namespace prefix */
45273 xmlChar * name; /* element local name */
45275 xmlChar * namespaceURI; /* namespace URI */
45276 int n_namespaceURI;
45277 xmlChar * content; /* element content */
45280 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45281 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45282 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45283 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45284 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45285 mem_base = xmlMemBlocks();
45286 writer = gen_xmlTextWriterPtr(n_writer, 0);
45287 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45288 name = gen_const_xmlChar_ptr(n_name, 2);
45289 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45290 content = gen_const_xmlChar_ptr(n_content, 4);
45292 ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45293 desret_int(ret_val);
45295 des_xmlTextWriterPtr(n_writer, writer, 0);
45296 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45297 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45298 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45299 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45300 xmlResetLastError();
45301 if (mem_base != xmlMemBlocks()) {
45302 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45303 xmlMemBlocks() - mem_base);
45305 printf(" %d", n_writer);
45306 printf(" %d", n_prefix);
45307 printf(" %d", n_name);
45308 printf(" %d", n_namespaceURI);
45309 printf(" %d", n_content);
45325 test_xmlTextWriterWriteFormatAttribute(void) {
45329 /* missing type support */
45335 test_xmlTextWriterWriteFormatAttributeNS(void) {
45339 /* missing type support */
45345 test_xmlTextWriterWriteFormatCDATA(void) {
45349 /* missing type support */
45355 test_xmlTextWriterWriteFormatComment(void) {
45359 /* missing type support */
45365 test_xmlTextWriterWriteFormatDTD(void) {
45369 /* missing type support */
45375 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45379 /* missing type support */
45385 test_xmlTextWriterWriteFormatDTDElement(void) {
45389 /* missing type support */
45395 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45399 /* missing type support */
45405 test_xmlTextWriterWriteFormatElement(void) {
45409 /* missing type support */
45415 test_xmlTextWriterWriteFormatElementNS(void) {
45419 /* missing type support */
45425 test_xmlTextWriterWriteFormatPI(void) {
45429 /* missing type support */
45435 test_xmlTextWriterWriteFormatRaw(void) {
45439 /* missing type support */
45445 test_xmlTextWriterWriteFormatString(void) {
45449 /* missing type support */
45455 test_xmlTextWriterWritePI(void) {
45458 #if defined(LIBXML_WRITER_ENABLED)
45461 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45463 xmlChar * target; /* PI target */
45465 xmlChar * content; /* PI content */
45468 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45469 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45470 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45471 mem_base = xmlMemBlocks();
45472 writer = gen_xmlTextWriterPtr(n_writer, 0);
45473 target = gen_const_xmlChar_ptr(n_target, 1);
45474 content = gen_const_xmlChar_ptr(n_content, 2);
45476 ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45477 desret_int(ret_val);
45479 des_xmlTextWriterPtr(n_writer, writer, 0);
45480 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45481 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45482 xmlResetLastError();
45483 if (mem_base != xmlMemBlocks()) {
45484 printf("Leak of %d blocks found in xmlTextWriterWritePI",
45485 xmlMemBlocks() - mem_base);
45487 printf(" %d", n_writer);
45488 printf(" %d", n_target);
45489 printf(" %d", n_content);
45503 test_xmlTextWriterWriteRaw(void) {
45506 #if defined(LIBXML_WRITER_ENABLED)
45509 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45511 xmlChar * content; /* text string */
45514 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45515 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45516 mem_base = xmlMemBlocks();
45517 writer = gen_xmlTextWriterPtr(n_writer, 0);
45518 content = gen_const_xmlChar_ptr(n_content, 1);
45520 ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45521 desret_int(ret_val);
45523 des_xmlTextWriterPtr(n_writer, writer, 0);
45524 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45525 xmlResetLastError();
45526 if (mem_base != xmlMemBlocks()) {
45527 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45528 xmlMemBlocks() - mem_base);
45530 printf(" %d", n_writer);
45531 printf(" %d", n_content);
45544 test_xmlTextWriterWriteRawLen(void) {
45547 #if defined(LIBXML_WRITER_ENABLED)
45550 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45552 xmlChar * content; /* text string */
45554 int len; /* length of the text string */
45557 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45558 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45559 for (n_len = 0;n_len < gen_nb_int;n_len++) {
45560 mem_base = xmlMemBlocks();
45561 writer = gen_xmlTextWriterPtr(n_writer, 0);
45562 content = gen_const_xmlChar_ptr(n_content, 1);
45563 len = gen_int(n_len, 2);
45565 ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45566 desret_int(ret_val);
45568 des_xmlTextWriterPtr(n_writer, writer, 0);
45569 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45570 des_int(n_len, len, 2);
45571 xmlResetLastError();
45572 if (mem_base != xmlMemBlocks()) {
45573 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45574 xmlMemBlocks() - mem_base);
45576 printf(" %d", n_writer);
45577 printf(" %d", n_content);
45578 printf(" %d", n_len);
45592 test_xmlTextWriterWriteString(void) {
45595 #if defined(LIBXML_WRITER_ENABLED)
45598 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45600 xmlChar * content; /* text string */
45603 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45604 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45605 mem_base = xmlMemBlocks();
45606 writer = gen_xmlTextWriterPtr(n_writer, 0);
45607 content = gen_const_xmlChar_ptr(n_content, 1);
45609 ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45610 desret_int(ret_val);
45612 des_xmlTextWriterPtr(n_writer, writer, 0);
45613 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45614 xmlResetLastError();
45615 if (mem_base != xmlMemBlocks()) {
45616 printf("Leak of %d blocks found in xmlTextWriterWriteString",
45617 xmlMemBlocks() - mem_base);
45619 printf(" %d", n_writer);
45620 printf(" %d", n_content);
45633 test_xmlTextWriterWriteVFormatAttribute(void) {
45637 /* missing type support */
45643 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45647 /* missing type support */
45653 test_xmlTextWriterWriteVFormatCDATA(void) {
45657 /* missing type support */
45663 test_xmlTextWriterWriteVFormatComment(void) {
45667 /* missing type support */
45673 test_xmlTextWriterWriteVFormatDTD(void) {
45677 /* missing type support */
45683 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45687 /* missing type support */
45693 test_xmlTextWriterWriteVFormatDTDElement(void) {
45697 /* missing type support */
45703 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45707 /* missing type support */
45713 test_xmlTextWriterWriteVFormatElement(void) {
45717 /* missing type support */
45723 test_xmlTextWriterWriteVFormatElementNS(void) {
45727 /* missing type support */
45733 test_xmlTextWriterWriteVFormatPI(void) {
45737 /* missing type support */
45743 test_xmlTextWriterWriteVFormatRaw(void) {
45747 /* missing type support */
45753 test_xmlTextWriterWriteVFormatString(void) {
45757 /* missing type support */
45762 test_xmlwriter(void) {
45765 if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45766 test_ret += test_xmlNewTextWriter();
45767 test_ret += test_xmlNewTextWriterFilename();
45768 test_ret += test_xmlNewTextWriterMemory();
45769 test_ret += test_xmlNewTextWriterPushParser();
45770 test_ret += test_xmlNewTextWriterTree();
45771 test_ret += test_xmlTextWriterEndAttribute();
45772 test_ret += test_xmlTextWriterEndCDATA();
45773 test_ret += test_xmlTextWriterEndComment();
45774 test_ret += test_xmlTextWriterEndDTD();
45775 test_ret += test_xmlTextWriterEndDTDAttlist();
45776 test_ret += test_xmlTextWriterEndDTDElement();
45777 test_ret += test_xmlTextWriterEndDTDEntity();
45778 test_ret += test_xmlTextWriterEndDocument();
45779 test_ret += test_xmlTextWriterEndElement();
45780 test_ret += test_xmlTextWriterEndPI();
45781 test_ret += test_xmlTextWriterFlush();
45782 test_ret += test_xmlTextWriterFullEndElement();
45783 test_ret += test_xmlTextWriterSetIndent();
45784 test_ret += test_xmlTextWriterSetIndentString();
45785 test_ret += test_xmlTextWriterSetQuoteChar();
45786 test_ret += test_xmlTextWriterStartAttribute();
45787 test_ret += test_xmlTextWriterStartAttributeNS();
45788 test_ret += test_xmlTextWriterStartCDATA();
45789 test_ret += test_xmlTextWriterStartComment();
45790 test_ret += test_xmlTextWriterStartDTD();
45791 test_ret += test_xmlTextWriterStartDTDAttlist();
45792 test_ret += test_xmlTextWriterStartDTDElement();
45793 test_ret += test_xmlTextWriterStartDTDEntity();
45794 test_ret += test_xmlTextWriterStartDocument();
45795 test_ret += test_xmlTextWriterStartElement();
45796 test_ret += test_xmlTextWriterStartElementNS();
45797 test_ret += test_xmlTextWriterStartPI();
45798 test_ret += test_xmlTextWriterWriteAttribute();
45799 test_ret += test_xmlTextWriterWriteAttributeNS();
45800 test_ret += test_xmlTextWriterWriteBase64();
45801 test_ret += test_xmlTextWriterWriteBinHex();
45802 test_ret += test_xmlTextWriterWriteCDATA();
45803 test_ret += test_xmlTextWriterWriteComment();
45804 test_ret += test_xmlTextWriterWriteDTD();
45805 test_ret += test_xmlTextWriterWriteDTDAttlist();
45806 test_ret += test_xmlTextWriterWriteDTDElement();
45807 test_ret += test_xmlTextWriterWriteDTDEntity();
45808 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45809 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45810 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45811 test_ret += test_xmlTextWriterWriteDTDNotation();
45812 test_ret += test_xmlTextWriterWriteElement();
45813 test_ret += test_xmlTextWriterWriteElementNS();
45814 test_ret += test_xmlTextWriterWriteFormatAttribute();
45815 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45816 test_ret += test_xmlTextWriterWriteFormatCDATA();
45817 test_ret += test_xmlTextWriterWriteFormatComment();
45818 test_ret += test_xmlTextWriterWriteFormatDTD();
45819 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45820 test_ret += test_xmlTextWriterWriteFormatDTDElement();
45821 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45822 test_ret += test_xmlTextWriterWriteFormatElement();
45823 test_ret += test_xmlTextWriterWriteFormatElementNS();
45824 test_ret += test_xmlTextWriterWriteFormatPI();
45825 test_ret += test_xmlTextWriterWriteFormatRaw();
45826 test_ret += test_xmlTextWriterWriteFormatString();
45827 test_ret += test_xmlTextWriterWritePI();
45828 test_ret += test_xmlTextWriterWriteRaw();
45829 test_ret += test_xmlTextWriterWriteRawLen();
45830 test_ret += test_xmlTextWriterWriteString();
45831 test_ret += test_xmlTextWriterWriteVFormatAttribute();
45832 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45833 test_ret += test_xmlTextWriterWriteVFormatCDATA();
45834 test_ret += test_xmlTextWriterWriteVFormatComment();
45835 test_ret += test_xmlTextWriterWriteVFormatDTD();
45836 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45837 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45838 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45839 test_ret += test_xmlTextWriterWriteVFormatElement();
45840 test_ret += test_xmlTextWriterWriteVFormatElementNS();
45841 test_ret += test_xmlTextWriterWriteVFormatPI();
45842 test_ret += test_xmlTextWriterWriteVFormatRaw();
45843 test_ret += test_xmlTextWriterWriteVFormatString();
45846 printf("Module xmlwriter: %d errors\n", test_ret);
45851 test_xmlXPathCastBooleanToNumber(void) {
45854 #if defined(LIBXML_XPATH_ENABLED)
45857 int val; /* a boolean */
45860 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45861 mem_base = xmlMemBlocks();
45862 val = gen_int(n_val, 0);
45864 ret_val = xmlXPathCastBooleanToNumber(val);
45865 desret_double(ret_val);
45867 des_int(n_val, val, 0);
45868 xmlResetLastError();
45869 if (mem_base != xmlMemBlocks()) {
45870 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45871 xmlMemBlocks() - mem_base);
45873 printf(" %d", n_val);
45885 test_xmlXPathCastBooleanToString(void) {
45888 #if defined(LIBXML_XPATH_ENABLED)
45891 int val; /* a boolean */
45894 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45895 mem_base = xmlMemBlocks();
45896 val = gen_int(n_val, 0);
45898 ret_val = xmlXPathCastBooleanToString(val);
45899 desret_xmlChar_ptr(ret_val);
45901 des_int(n_val, val, 0);
45902 xmlResetLastError();
45903 if (mem_base != xmlMemBlocks()) {
45904 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45905 xmlMemBlocks() - mem_base);
45907 printf(" %d", n_val);
45919 test_xmlXPathCastNodeSetToBoolean(void) {
45922 #if defined(LIBXML_XPATH_ENABLED)
45925 xmlNodeSetPtr ns; /* a node-set */
45928 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45929 mem_base = xmlMemBlocks();
45930 ns = gen_xmlNodeSetPtr(n_ns, 0);
45932 ret_val = xmlXPathCastNodeSetToBoolean(ns);
45933 desret_int(ret_val);
45935 des_xmlNodeSetPtr(n_ns, ns, 0);
45936 xmlResetLastError();
45937 if (mem_base != xmlMemBlocks()) {
45938 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45939 xmlMemBlocks() - mem_base);
45941 printf(" %d", n_ns);
45953 test_xmlXPathCastNodeSetToNumber(void) {
45956 #if defined(LIBXML_XPATH_ENABLED)
45959 xmlNodeSetPtr ns; /* a node-set */
45962 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45963 mem_base = xmlMemBlocks();
45964 ns = gen_xmlNodeSetPtr(n_ns, 0);
45966 ret_val = xmlXPathCastNodeSetToNumber(ns);
45967 desret_double(ret_val);
45969 des_xmlNodeSetPtr(n_ns, ns, 0);
45970 xmlResetLastError();
45971 if (mem_base != xmlMemBlocks()) {
45972 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45973 xmlMemBlocks() - mem_base);
45975 printf(" %d", n_ns);
45987 test_xmlXPathCastNodeSetToString(void) {
45990 #if defined(LIBXML_XPATH_ENABLED)
45993 xmlNodeSetPtr ns; /* a node-set */
45996 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45997 mem_base = xmlMemBlocks();
45998 ns = gen_xmlNodeSetPtr(n_ns, 0);
46000 ret_val = xmlXPathCastNodeSetToString(ns);
46001 desret_xmlChar_ptr(ret_val);
46003 des_xmlNodeSetPtr(n_ns, ns, 0);
46004 xmlResetLastError();
46005 if (mem_base != xmlMemBlocks()) {
46006 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
46007 xmlMemBlocks() - mem_base);
46009 printf(" %d", n_ns);
46021 test_xmlXPathCastNodeToNumber(void) {
46024 #if defined(LIBXML_XPATH_ENABLED)
46027 xmlNodePtr node; /* a node */
46030 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46031 mem_base = xmlMemBlocks();
46032 node = gen_xmlNodePtr(n_node, 0);
46034 ret_val = xmlXPathCastNodeToNumber(node);
46035 desret_double(ret_val);
46037 des_xmlNodePtr(n_node, node, 0);
46038 xmlResetLastError();
46039 if (mem_base != xmlMemBlocks()) {
46040 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46041 xmlMemBlocks() - mem_base);
46043 printf(" %d", n_node);
46055 test_xmlXPathCastNodeToString(void) {
46058 #if defined(LIBXML_XPATH_ENABLED)
46061 xmlNodePtr node; /* a node */
46064 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46065 mem_base = xmlMemBlocks();
46066 node = gen_xmlNodePtr(n_node, 0);
46068 ret_val = xmlXPathCastNodeToString(node);
46069 desret_xmlChar_ptr(ret_val);
46071 des_xmlNodePtr(n_node, node, 0);
46072 xmlResetLastError();
46073 if (mem_base != xmlMemBlocks()) {
46074 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46075 xmlMemBlocks() - mem_base);
46077 printf(" %d", n_node);
46089 test_xmlXPathCastNumberToBoolean(void) {
46092 #if defined(LIBXML_XPATH_ENABLED)
46095 double val; /* a number */
46098 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46099 mem_base = xmlMemBlocks();
46100 val = gen_double(n_val, 0);
46102 ret_val = xmlXPathCastNumberToBoolean(val);
46103 desret_int(ret_val);
46105 des_double(n_val, val, 0);
46106 xmlResetLastError();
46107 if (mem_base != xmlMemBlocks()) {
46108 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46109 xmlMemBlocks() - mem_base);
46111 printf(" %d", n_val);
46123 test_xmlXPathCastNumberToString(void) {
46126 #if defined(LIBXML_XPATH_ENABLED)
46129 double val; /* a number */
46132 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46133 mem_base = xmlMemBlocks();
46134 val = gen_double(n_val, 0);
46136 ret_val = xmlXPathCastNumberToString(val);
46137 desret_xmlChar_ptr(ret_val);
46139 des_double(n_val, val, 0);
46140 xmlResetLastError();
46141 if (mem_base != xmlMemBlocks()) {
46142 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46143 xmlMemBlocks() - mem_base);
46145 printf(" %d", n_val);
46157 test_xmlXPathCastStringToBoolean(void) {
46160 #if defined(LIBXML_XPATH_ENABLED)
46163 xmlChar * val; /* a string */
46166 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46167 mem_base = xmlMemBlocks();
46168 val = gen_const_xmlChar_ptr(n_val, 0);
46170 ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46171 desret_int(ret_val);
46173 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46174 xmlResetLastError();
46175 if (mem_base != xmlMemBlocks()) {
46176 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46177 xmlMemBlocks() - mem_base);
46179 printf(" %d", n_val);
46191 test_xmlXPathCastStringToNumber(void) {
46194 #if defined(LIBXML_XPATH_ENABLED)
46197 xmlChar * val; /* a string */
46200 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46201 mem_base = xmlMemBlocks();
46202 val = gen_const_xmlChar_ptr(n_val, 0);
46204 ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46205 desret_double(ret_val);
46207 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46208 xmlResetLastError();
46209 if (mem_base != xmlMemBlocks()) {
46210 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46211 xmlMemBlocks() - mem_base);
46213 printf(" %d", n_val);
46225 test_xmlXPathCastToBoolean(void) {
46228 #if defined(LIBXML_XPATH_ENABLED)
46231 xmlXPathObjectPtr val; /* an XPath object */
46234 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46235 mem_base = xmlMemBlocks();
46236 val = gen_xmlXPathObjectPtr(n_val, 0);
46238 ret_val = xmlXPathCastToBoolean(val);
46239 desret_int(ret_val);
46241 des_xmlXPathObjectPtr(n_val, val, 0);
46242 xmlResetLastError();
46243 if (mem_base != xmlMemBlocks()) {
46244 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46245 xmlMemBlocks() - mem_base);
46247 printf(" %d", n_val);
46259 test_xmlXPathCastToNumber(void) {
46262 #if defined(LIBXML_XPATH_ENABLED)
46265 xmlXPathObjectPtr val; /* an XPath object */
46268 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46269 mem_base = xmlMemBlocks();
46270 val = gen_xmlXPathObjectPtr(n_val, 0);
46272 ret_val = xmlXPathCastToNumber(val);
46273 desret_double(ret_val);
46275 des_xmlXPathObjectPtr(n_val, val, 0);
46276 xmlResetLastError();
46277 if (mem_base != xmlMemBlocks()) {
46278 printf("Leak of %d blocks found in xmlXPathCastToNumber",
46279 xmlMemBlocks() - mem_base);
46281 printf(" %d", n_val);
46293 test_xmlXPathCastToString(void) {
46296 #if defined(LIBXML_XPATH_ENABLED)
46299 xmlXPathObjectPtr val; /* an XPath object */
46302 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46303 mem_base = xmlMemBlocks();
46304 val = gen_xmlXPathObjectPtr(n_val, 0);
46306 ret_val = xmlXPathCastToString(val);
46307 desret_xmlChar_ptr(ret_val);
46309 des_xmlXPathObjectPtr(n_val, val, 0);
46310 xmlResetLastError();
46311 if (mem_base != xmlMemBlocks()) {
46312 printf("Leak of %d blocks found in xmlXPathCastToString",
46313 xmlMemBlocks() - mem_base);
46315 printf(" %d", n_val);
46327 test_xmlXPathCmpNodes(void) {
46330 #if defined(LIBXML_XPATH_ENABLED)
46333 xmlNodePtr node1; /* the first node */
46335 xmlNodePtr node2; /* the second node */
46338 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46339 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46340 mem_base = xmlMemBlocks();
46341 node1 = gen_xmlNodePtr(n_node1, 0);
46342 node2 = gen_xmlNodePtr(n_node2, 1);
46344 ret_val = xmlXPathCmpNodes(node1, node2);
46345 desret_int(ret_val);
46347 des_xmlNodePtr(n_node1, node1, 0);
46348 des_xmlNodePtr(n_node2, node2, 1);
46349 xmlResetLastError();
46350 if (mem_base != xmlMemBlocks()) {
46351 printf("Leak of %d blocks found in xmlXPathCmpNodes",
46352 xmlMemBlocks() - mem_base);
46354 printf(" %d", n_node1);
46355 printf(" %d", n_node2);
46368 test_xmlXPathCompile(void) {
46372 /* missing type support */
46376 #ifdef LIBXML_XPATH_ENABLED
46378 #define gen_nb_xmlXPathCompExprPtr 1
46379 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46382 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46386 #ifdef LIBXML_XPATH_ENABLED
46388 #define gen_nb_xmlXPathContextPtr 1
46389 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46392 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46398 test_xmlXPathCompiledEval(void) {
46401 #if defined(LIBXML_XPATH_ENABLED)
46403 xmlXPathObjectPtr ret_val;
46404 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46406 xmlXPathContextPtr ctx; /* the XPath context */
46409 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46410 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46411 mem_base = xmlMemBlocks();
46412 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46413 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46415 ret_val = xmlXPathCompiledEval(comp, ctx);
46416 desret_xmlXPathObjectPtr(ret_val);
46418 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46419 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46420 xmlResetLastError();
46421 if (mem_base != xmlMemBlocks()) {
46422 printf("Leak of %d blocks found in xmlXPathCompiledEval",
46423 xmlMemBlocks() - mem_base);
46425 printf(" %d", n_comp);
46426 printf(" %d", n_ctx);
46439 test_xmlXPathCompiledEvalToBoolean(void) {
46442 #if defined(LIBXML_XPATH_ENABLED)
46445 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46447 xmlXPathContextPtr ctxt; /* the XPath context */
46450 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46451 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46452 mem_base = xmlMemBlocks();
46453 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46454 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46456 ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46457 desret_int(ret_val);
46459 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46460 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46461 xmlResetLastError();
46462 if (mem_base != xmlMemBlocks()) {
46463 printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46464 xmlMemBlocks() - mem_base);
46466 printf(" %d", n_comp);
46467 printf(" %d", n_ctxt);
46480 test_xmlXPathContextSetCache(void) {
46483 #if defined(LIBXML_XPATH_ENABLED)
46486 xmlXPathContextPtr ctxt; /* the XPath context */
46488 int active; /* enables/disables (creates/frees) the cache */
46490 int value; /* a value with semantics dependant on @options */
46492 int options; /* options (currently only the value 0 is used) */
46495 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46496 for (n_active = 0;n_active < gen_nb_int;n_active++) {
46497 for (n_value = 0;n_value < gen_nb_int;n_value++) {
46498 for (n_options = 0;n_options < gen_nb_int;n_options++) {
46499 mem_base = xmlMemBlocks();
46500 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46501 active = gen_int(n_active, 1);
46502 value = gen_int(n_value, 2);
46503 options = gen_int(n_options, 3);
46505 ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46506 desret_int(ret_val);
46508 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46509 des_int(n_active, active, 1);
46510 des_int(n_value, value, 2);
46511 des_int(n_options, options, 3);
46512 xmlResetLastError();
46513 if (mem_base != xmlMemBlocks()) {
46514 printf("Leak of %d blocks found in xmlXPathContextSetCache",
46515 xmlMemBlocks() - mem_base);
46517 printf(" %d", n_ctxt);
46518 printf(" %d", n_active);
46519 printf(" %d", n_value);
46520 printf(" %d", n_options);
46535 test_xmlXPathConvertBoolean(void) {
46538 #if defined(LIBXML_XPATH_ENABLED)
46540 xmlXPathObjectPtr ret_val;
46541 xmlXPathObjectPtr val; /* an XPath object */
46544 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46545 mem_base = xmlMemBlocks();
46546 val = gen_xmlXPathObjectPtr(n_val, 0);
46548 ret_val = xmlXPathConvertBoolean(val);
46550 desret_xmlXPathObjectPtr(ret_val);
46552 des_xmlXPathObjectPtr(n_val, val, 0);
46553 xmlResetLastError();
46554 if (mem_base != xmlMemBlocks()) {
46555 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46556 xmlMemBlocks() - mem_base);
46558 printf(" %d", n_val);
46570 test_xmlXPathConvertNumber(void) {
46573 #if defined(LIBXML_XPATH_ENABLED)
46575 xmlXPathObjectPtr ret_val;
46576 xmlXPathObjectPtr val; /* an XPath object */
46579 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46580 mem_base = xmlMemBlocks();
46581 val = gen_xmlXPathObjectPtr(n_val, 0);
46583 ret_val = xmlXPathConvertNumber(val);
46585 desret_xmlXPathObjectPtr(ret_val);
46587 des_xmlXPathObjectPtr(n_val, val, 0);
46588 xmlResetLastError();
46589 if (mem_base != xmlMemBlocks()) {
46590 printf("Leak of %d blocks found in xmlXPathConvertNumber",
46591 xmlMemBlocks() - mem_base);
46593 printf(" %d", n_val);
46605 test_xmlXPathConvertString(void) {
46608 #if defined(LIBXML_XPATH_ENABLED)
46610 xmlXPathObjectPtr ret_val;
46611 xmlXPathObjectPtr val; /* an XPath object */
46614 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46615 mem_base = xmlMemBlocks();
46616 val = gen_xmlXPathObjectPtr(n_val, 0);
46618 ret_val = xmlXPathConvertString(val);
46620 desret_xmlXPathObjectPtr(ret_val);
46622 des_xmlXPathObjectPtr(n_val, val, 0);
46623 xmlResetLastError();
46624 if (mem_base != xmlMemBlocks()) {
46625 printf("Leak of %d blocks found in xmlXPathConvertString",
46626 xmlMemBlocks() - mem_base);
46628 printf(" %d", n_val);
46640 test_xmlXPathCtxtCompile(void) {
46644 /* missing type support */
46650 test_xmlXPathEval(void) {
46653 #if defined(LIBXML_XPATH_ENABLED)
46655 xmlXPathObjectPtr ret_val;
46656 xmlChar * str; /* the XPath expression */
46658 xmlXPathContextPtr ctx; /* the XPath context */
46661 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46662 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46663 mem_base = xmlMemBlocks();
46664 str = gen_const_xmlChar_ptr(n_str, 0);
46665 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46667 ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46668 desret_xmlXPathObjectPtr(ret_val);
46670 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46671 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46672 xmlResetLastError();
46673 if (mem_base != xmlMemBlocks()) {
46674 printf("Leak of %d blocks found in xmlXPathEval",
46675 xmlMemBlocks() - mem_base);
46677 printf(" %d", n_str);
46678 printf(" %d", n_ctx);
46691 test_xmlXPathEvalExpression(void) {
46694 #if defined(LIBXML_XPATH_ENABLED)
46696 xmlXPathObjectPtr ret_val;
46697 xmlChar * str; /* the XPath expression */
46699 xmlXPathContextPtr ctxt; /* the XPath context */
46702 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46703 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46704 mem_base = xmlMemBlocks();
46705 str = gen_const_xmlChar_ptr(n_str, 0);
46706 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46708 ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46709 desret_xmlXPathObjectPtr(ret_val);
46711 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46712 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46713 xmlResetLastError();
46714 if (mem_base != xmlMemBlocks()) {
46715 printf("Leak of %d blocks found in xmlXPathEvalExpression",
46716 xmlMemBlocks() - mem_base);
46718 printf(" %d", n_str);
46719 printf(" %d", n_ctxt);
46732 test_xmlXPathEvalPredicate(void) {
46735 #if defined(LIBXML_XPATH_ENABLED)
46738 xmlXPathContextPtr ctxt; /* the XPath context */
46740 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46743 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46744 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46745 mem_base = xmlMemBlocks();
46746 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46747 res = gen_xmlXPathObjectPtr(n_res, 1);
46749 ret_val = xmlXPathEvalPredicate(ctxt, res);
46750 desret_int(ret_val);
46752 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46753 des_xmlXPathObjectPtr(n_res, res, 1);
46754 xmlResetLastError();
46755 if (mem_base != xmlMemBlocks()) {
46756 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46757 xmlMemBlocks() - mem_base);
46759 printf(" %d", n_ctxt);
46760 printf(" %d", n_res);
46773 test_xmlXPathInit(void) {
46776 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46779 mem_base = xmlMemBlocks();
46783 xmlResetLastError();
46784 if (mem_base != xmlMemBlocks()) {
46785 printf("Leak of %d blocks found in xmlXPathInit",
46786 xmlMemBlocks() - mem_base);
46798 test_xmlXPathIsInf(void) {
46801 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46804 double val; /* a double value */
46807 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46808 mem_base = xmlMemBlocks();
46809 val = gen_double(n_val, 0);
46811 ret_val = xmlXPathIsInf(val);
46812 desret_int(ret_val);
46814 des_double(n_val, val, 0);
46815 xmlResetLastError();
46816 if (mem_base != xmlMemBlocks()) {
46817 printf("Leak of %d blocks found in xmlXPathIsInf",
46818 xmlMemBlocks() - mem_base);
46820 printf(" %d", n_val);
46832 test_xmlXPathIsNaN(void) {
46835 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46838 double val; /* a double value */
46841 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46842 mem_base = xmlMemBlocks();
46843 val = gen_double(n_val, 0);
46845 ret_val = xmlXPathIsNaN(val);
46846 desret_int(ret_val);
46848 des_double(n_val, val, 0);
46849 xmlResetLastError();
46850 if (mem_base != xmlMemBlocks()) {
46851 printf("Leak of %d blocks found in xmlXPathIsNaN",
46852 xmlMemBlocks() - mem_base);
46854 printf(" %d", n_val);
46866 test_xmlXPathNewContext(void) {
46870 /* missing type support */
46876 test_xmlXPathNodeEval(void) {
46879 #if defined(LIBXML_XPATH_ENABLED)
46881 xmlXPathObjectPtr ret_val;
46882 xmlNodePtr node; /* the node to to use as the context node */
46884 xmlChar * str; /* the XPath expression */
46886 xmlXPathContextPtr ctx; /* the XPath context */
46889 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46890 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46891 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46892 mem_base = xmlMemBlocks();
46893 node = gen_xmlNodePtr(n_node, 0);
46894 str = gen_const_xmlChar_ptr(n_str, 1);
46895 ctx = gen_xmlXPathContextPtr(n_ctx, 2);
46897 ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
46898 desret_xmlXPathObjectPtr(ret_val);
46900 des_xmlNodePtr(n_node, node, 0);
46901 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
46902 des_xmlXPathContextPtr(n_ctx, ctx, 2);
46903 xmlResetLastError();
46904 if (mem_base != xmlMemBlocks()) {
46905 printf("Leak of %d blocks found in xmlXPathNodeEval",
46906 xmlMemBlocks() - mem_base);
46908 printf(" %d", n_node);
46909 printf(" %d", n_str);
46910 printf(" %d", n_ctx);
46924 test_xmlXPathNodeSetCreate(void) {
46927 #if defined(LIBXML_XPATH_ENABLED)
46929 xmlNodeSetPtr ret_val;
46930 xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46933 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46934 mem_base = xmlMemBlocks();
46935 val = gen_xmlNodePtr(n_val, 0);
46937 ret_val = xmlXPathNodeSetCreate(val);
46938 desret_xmlNodeSetPtr(ret_val);
46940 des_xmlNodePtr(n_val, val, 0);
46941 xmlResetLastError();
46942 if (mem_base != xmlMemBlocks()) {
46943 printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46944 xmlMemBlocks() - mem_base);
46946 printf(" %d", n_val);
46958 test_xmlXPathObjectCopy(void) {
46961 #if defined(LIBXML_XPATH_ENABLED)
46963 xmlXPathObjectPtr ret_val;
46964 xmlXPathObjectPtr val; /* the original object */
46967 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46968 mem_base = xmlMemBlocks();
46969 val = gen_xmlXPathObjectPtr(n_val, 0);
46971 ret_val = xmlXPathObjectCopy(val);
46972 desret_xmlXPathObjectPtr(ret_val);
46974 des_xmlXPathObjectPtr(n_val, val, 0);
46975 xmlResetLastError();
46976 if (mem_base != xmlMemBlocks()) {
46977 printf("Leak of %d blocks found in xmlXPathObjectCopy",
46978 xmlMemBlocks() - mem_base);
46980 printf(" %d", n_val);
46992 test_xmlXPathOrderDocElems(void) {
46995 #if defined(LIBXML_XPATH_ENABLED)
46998 xmlDocPtr doc; /* an input document */
47001 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
47002 mem_base = xmlMemBlocks();
47003 doc = gen_xmlDocPtr(n_doc, 0);
47005 ret_val = xmlXPathOrderDocElems(doc);
47006 desret_long(ret_val);
47008 des_xmlDocPtr(n_doc, doc, 0);
47009 xmlResetLastError();
47010 if (mem_base != xmlMemBlocks()) {
47011 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
47012 xmlMemBlocks() - mem_base);
47014 printf(" %d", n_doc);
47026 test_xmlXPathSetContextNode(void) {
47029 #if defined(LIBXML_XPATH_ENABLED)
47032 xmlNodePtr node; /* the node to to use as the context node */
47034 xmlXPathContextPtr ctx; /* the XPath context */
47037 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47038 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47039 mem_base = xmlMemBlocks();
47040 node = gen_xmlNodePtr(n_node, 0);
47041 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47043 ret_val = xmlXPathSetContextNode(node, ctx);
47044 desret_int(ret_val);
47046 des_xmlNodePtr(n_node, node, 0);
47047 des_xmlXPathContextPtr(n_ctx, ctx, 1);
47048 xmlResetLastError();
47049 if (mem_base != xmlMemBlocks()) {
47050 printf("Leak of %d blocks found in xmlXPathSetContextNode",
47051 xmlMemBlocks() - mem_base);
47053 printf(" %d", n_node);
47054 printf(" %d", n_ctx);
47069 if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47070 test_ret += test_xmlXPathCastBooleanToNumber();
47071 test_ret += test_xmlXPathCastBooleanToString();
47072 test_ret += test_xmlXPathCastNodeSetToBoolean();
47073 test_ret += test_xmlXPathCastNodeSetToNumber();
47074 test_ret += test_xmlXPathCastNodeSetToString();
47075 test_ret += test_xmlXPathCastNodeToNumber();
47076 test_ret += test_xmlXPathCastNodeToString();
47077 test_ret += test_xmlXPathCastNumberToBoolean();
47078 test_ret += test_xmlXPathCastNumberToString();
47079 test_ret += test_xmlXPathCastStringToBoolean();
47080 test_ret += test_xmlXPathCastStringToNumber();
47081 test_ret += test_xmlXPathCastToBoolean();
47082 test_ret += test_xmlXPathCastToNumber();
47083 test_ret += test_xmlXPathCastToString();
47084 test_ret += test_xmlXPathCmpNodes();
47085 test_ret += test_xmlXPathCompile();
47086 test_ret += test_xmlXPathCompiledEval();
47087 test_ret += test_xmlXPathCompiledEvalToBoolean();
47088 test_ret += test_xmlXPathContextSetCache();
47089 test_ret += test_xmlXPathConvertBoolean();
47090 test_ret += test_xmlXPathConvertNumber();
47091 test_ret += test_xmlXPathConvertString();
47092 test_ret += test_xmlXPathCtxtCompile();
47093 test_ret += test_xmlXPathEval();
47094 test_ret += test_xmlXPathEvalExpression();
47095 test_ret += test_xmlXPathEvalPredicate();
47096 test_ret += test_xmlXPathInit();
47097 test_ret += test_xmlXPathIsInf();
47098 test_ret += test_xmlXPathIsNaN();
47099 test_ret += test_xmlXPathNewContext();
47100 test_ret += test_xmlXPathNodeEval();
47101 test_ret += test_xmlXPathNodeSetCreate();
47102 test_ret += test_xmlXPathObjectCopy();
47103 test_ret += test_xmlXPathOrderDocElems();
47104 test_ret += test_xmlXPathSetContextNode();
47107 printf("Module xpath: %d errors\n", test_ret);
47110 #ifdef LIBXML_XPATH_ENABLED
47112 #define gen_nb_xmlXPathParserContextPtr 1
47113 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47116 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47122 test_valuePop(void) {
47125 #if defined(LIBXML_XPATH_ENABLED)
47127 xmlXPathObjectPtr ret_val;
47128 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47131 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47132 mem_base = xmlMemBlocks();
47133 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47135 ret_val = valuePop(ctxt);
47136 desret_xmlXPathObjectPtr(ret_val);
47138 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47139 xmlResetLastError();
47140 if (mem_base != xmlMemBlocks()) {
47141 printf("Leak of %d blocks found in valuePop",
47142 xmlMemBlocks() - mem_base);
47144 printf(" %d", n_ctxt);
47156 test_valuePush(void) {
47159 #if defined(LIBXML_XPATH_ENABLED)
47162 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47164 xmlXPathObjectPtr value; /* the XPath object */
47167 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47168 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47169 mem_base = xmlMemBlocks();
47170 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47171 value = gen_xmlXPathObjectPtr(n_value, 1);
47173 ret_val = valuePush(ctxt, value);
47174 desret_int(ret_val);
47176 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47177 des_xmlXPathObjectPtr(n_value, value, 1);
47178 xmlResetLastError();
47179 if (mem_base != xmlMemBlocks()) {
47180 printf("Leak of %d blocks found in valuePush",
47181 xmlMemBlocks() - mem_base);
47183 printf(" %d", n_ctxt);
47184 printf(" %d", n_value);
47197 test_xmlXPathAddValues(void) {
47200 #if defined(LIBXML_XPATH_ENABLED)
47202 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47205 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47206 mem_base = xmlMemBlocks();
47207 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47209 xmlXPathAddValues(ctxt);
47211 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47212 xmlResetLastError();
47213 if (mem_base != xmlMemBlocks()) {
47214 printf("Leak of %d blocks found in xmlXPathAddValues",
47215 xmlMemBlocks() - mem_base);
47217 printf(" %d", n_ctxt);
47229 test_xmlXPathBooleanFunction(void) {
47232 #if defined(LIBXML_XPATH_ENABLED)
47234 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47236 int nargs; /* the number of arguments */
47239 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47240 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47241 mem_base = xmlMemBlocks();
47242 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47243 nargs = gen_int(n_nargs, 1);
47245 xmlXPathBooleanFunction(ctxt, nargs);
47247 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47248 des_int(n_nargs, nargs, 1);
47249 xmlResetLastError();
47250 if (mem_base != xmlMemBlocks()) {
47251 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47252 xmlMemBlocks() - mem_base);
47254 printf(" %d", n_ctxt);
47255 printf(" %d", n_nargs);
47268 test_xmlXPathCeilingFunction(void) {
47271 #if defined(LIBXML_XPATH_ENABLED)
47273 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47275 int nargs; /* the number of arguments */
47278 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47279 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47280 mem_base = xmlMemBlocks();
47281 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47282 nargs = gen_int(n_nargs, 1);
47284 xmlXPathCeilingFunction(ctxt, nargs);
47286 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47287 des_int(n_nargs, nargs, 1);
47288 xmlResetLastError();
47289 if (mem_base != xmlMemBlocks()) {
47290 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47291 xmlMemBlocks() - mem_base);
47293 printf(" %d", n_ctxt);
47294 printf(" %d", n_nargs);
47307 test_xmlXPathCompareValues(void) {
47310 #if defined(LIBXML_XPATH_ENABLED)
47313 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47315 int inf; /* less than (1) or greater than (0) */
47317 int strict; /* is the comparison strict */
47320 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47321 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47322 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47323 mem_base = xmlMemBlocks();
47324 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47325 inf = gen_int(n_inf, 1);
47326 strict = gen_int(n_strict, 2);
47328 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47329 desret_int(ret_val);
47331 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47332 des_int(n_inf, inf, 1);
47333 des_int(n_strict, strict, 2);
47334 xmlResetLastError();
47335 if (mem_base != xmlMemBlocks()) {
47336 printf("Leak of %d blocks found in xmlXPathCompareValues",
47337 xmlMemBlocks() - mem_base);
47339 printf(" %d", n_ctxt);
47340 printf(" %d", n_inf);
47341 printf(" %d", n_strict);
47355 test_xmlXPathConcatFunction(void) {
47358 #if defined(LIBXML_XPATH_ENABLED)
47360 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47362 int nargs; /* the number of arguments */
47365 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47366 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47367 mem_base = xmlMemBlocks();
47368 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47369 nargs = gen_int(n_nargs, 1);
47371 xmlXPathConcatFunction(ctxt, nargs);
47373 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47374 des_int(n_nargs, nargs, 1);
47375 xmlResetLastError();
47376 if (mem_base != xmlMemBlocks()) {
47377 printf("Leak of %d blocks found in xmlXPathConcatFunction",
47378 xmlMemBlocks() - mem_base);
47380 printf(" %d", n_ctxt);
47381 printf(" %d", n_nargs);
47394 test_xmlXPathContainsFunction(void) {
47397 #if defined(LIBXML_XPATH_ENABLED)
47399 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47401 int nargs; /* the number of arguments */
47404 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47405 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47406 mem_base = xmlMemBlocks();
47407 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47408 nargs = gen_int(n_nargs, 1);
47410 xmlXPathContainsFunction(ctxt, nargs);
47412 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47413 des_int(n_nargs, nargs, 1);
47414 xmlResetLastError();
47415 if (mem_base != xmlMemBlocks()) {
47416 printf("Leak of %d blocks found in xmlXPathContainsFunction",
47417 xmlMemBlocks() - mem_base);
47419 printf(" %d", n_ctxt);
47420 printf(" %d", n_nargs);
47433 test_xmlXPathCountFunction(void) {
47436 #if defined(LIBXML_XPATH_ENABLED)
47438 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47440 int nargs; /* the number of arguments */
47443 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47444 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47445 mem_base = xmlMemBlocks();
47446 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47447 nargs = gen_int(n_nargs, 1);
47449 xmlXPathCountFunction(ctxt, nargs);
47451 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47452 des_int(n_nargs, nargs, 1);
47453 xmlResetLastError();
47454 if (mem_base != xmlMemBlocks()) {
47455 printf("Leak of %d blocks found in xmlXPathCountFunction",
47456 xmlMemBlocks() - mem_base);
47458 printf(" %d", n_ctxt);
47459 printf(" %d", n_nargs);
47472 test_xmlXPathDebugDumpCompExpr(void) {
47475 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47477 FILE * output; /* the FILE * for the output */
47479 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47481 int depth; /* the indentation level. */
47484 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47485 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47486 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47487 mem_base = xmlMemBlocks();
47488 output = gen_FILE_ptr(n_output, 0);
47489 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47490 depth = gen_int(n_depth, 2);
47492 xmlXPathDebugDumpCompExpr(output, comp, depth);
47494 des_FILE_ptr(n_output, output, 0);
47495 des_xmlXPathCompExprPtr(n_comp, comp, 1);
47496 des_int(n_depth, depth, 2);
47497 xmlResetLastError();
47498 if (mem_base != xmlMemBlocks()) {
47499 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47500 xmlMemBlocks() - mem_base);
47502 printf(" %d", n_output);
47503 printf(" %d", n_comp);
47504 printf(" %d", n_depth);
47518 test_xmlXPathDebugDumpObject(void) {
47521 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47523 FILE * output; /* the FILE * to dump the output */
47525 xmlXPathObjectPtr cur; /* the object to inspect */
47527 int depth; /* indentation level */
47530 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47531 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47532 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47533 mem_base = xmlMemBlocks();
47534 output = gen_FILE_ptr(n_output, 0);
47535 cur = gen_xmlXPathObjectPtr(n_cur, 1);
47536 depth = gen_int(n_depth, 2);
47538 xmlXPathDebugDumpObject(output, cur, depth);
47540 des_FILE_ptr(n_output, output, 0);
47541 des_xmlXPathObjectPtr(n_cur, cur, 1);
47542 des_int(n_depth, depth, 2);
47543 xmlResetLastError();
47544 if (mem_base != xmlMemBlocks()) {
47545 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47546 xmlMemBlocks() - mem_base);
47548 printf(" %d", n_output);
47549 printf(" %d", n_cur);
47550 printf(" %d", n_depth);
47564 test_xmlXPathDifference(void) {
47567 #if defined(LIBXML_XPATH_ENABLED)
47569 xmlNodeSetPtr ret_val;
47570 xmlNodeSetPtr nodes1; /* a node-set */
47572 xmlNodeSetPtr nodes2; /* a node-set */
47575 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47576 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47577 mem_base = xmlMemBlocks();
47578 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47579 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47581 ret_val = xmlXPathDifference(nodes1, nodes2);
47582 desret_xmlNodeSetPtr(ret_val);
47584 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47585 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47586 xmlResetLastError();
47587 if (mem_base != xmlMemBlocks()) {
47588 printf("Leak of %d blocks found in xmlXPathDifference",
47589 xmlMemBlocks() - mem_base);
47591 printf(" %d", n_nodes1);
47592 printf(" %d", n_nodes2);
47605 test_xmlXPathDistinct(void) {
47608 #if defined(LIBXML_XPATH_ENABLED)
47610 xmlNodeSetPtr ret_val;
47611 xmlNodeSetPtr nodes; /* a node-set */
47614 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47615 mem_base = xmlMemBlocks();
47616 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47618 ret_val = xmlXPathDistinct(nodes);
47619 desret_xmlNodeSetPtr(ret_val);
47621 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47622 xmlResetLastError();
47623 if (mem_base != xmlMemBlocks()) {
47624 printf("Leak of %d blocks found in xmlXPathDistinct",
47625 xmlMemBlocks() - mem_base);
47627 printf(" %d", n_nodes);
47639 test_xmlXPathDistinctSorted(void) {
47642 #if defined(LIBXML_XPATH_ENABLED)
47644 xmlNodeSetPtr ret_val;
47645 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47648 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47649 mem_base = xmlMemBlocks();
47650 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47652 ret_val = xmlXPathDistinctSorted(nodes);
47653 desret_xmlNodeSetPtr(ret_val);
47655 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47656 xmlResetLastError();
47657 if (mem_base != xmlMemBlocks()) {
47658 printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47659 xmlMemBlocks() - mem_base);
47661 printf(" %d", n_nodes);
47673 test_xmlXPathDivValues(void) {
47676 #if defined(LIBXML_XPATH_ENABLED)
47678 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47681 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47682 mem_base = xmlMemBlocks();
47683 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47685 xmlXPathDivValues(ctxt);
47687 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47688 xmlResetLastError();
47689 if (mem_base != xmlMemBlocks()) {
47690 printf("Leak of %d blocks found in xmlXPathDivValues",
47691 xmlMemBlocks() - mem_base);
47693 printf(" %d", n_ctxt);
47705 test_xmlXPathEqualValues(void) {
47708 #if defined(LIBXML_XPATH_ENABLED)
47711 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47714 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47715 mem_base = xmlMemBlocks();
47716 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47718 ret_val = xmlXPathEqualValues(ctxt);
47719 desret_int(ret_val);
47721 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47722 xmlResetLastError();
47723 if (mem_base != xmlMemBlocks()) {
47724 printf("Leak of %d blocks found in xmlXPathEqualValues",
47725 xmlMemBlocks() - mem_base);
47727 printf(" %d", n_ctxt);
47739 test_xmlXPathErr(void) {
47742 #if defined(LIBXML_XPATH_ENABLED)
47744 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47746 int error; /* the error code */
47749 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47750 for (n_error = 0;n_error < gen_nb_int;n_error++) {
47751 mem_base = xmlMemBlocks();
47752 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47753 error = gen_int(n_error, 1);
47755 xmlXPathErr(ctxt, error);
47757 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47758 des_int(n_error, error, 1);
47759 xmlResetLastError();
47760 if (mem_base != xmlMemBlocks()) {
47761 printf("Leak of %d blocks found in xmlXPathErr",
47762 xmlMemBlocks() - mem_base);
47764 printf(" %d", n_ctxt);
47765 printf(" %d", n_error);
47778 test_xmlXPathEvalExpr(void) {
47781 #if defined(LIBXML_XPATH_ENABLED)
47783 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47786 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47787 mem_base = xmlMemBlocks();
47788 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47790 xmlXPathEvalExpr(ctxt);
47792 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47793 xmlResetLastError();
47794 if (mem_base != xmlMemBlocks()) {
47795 printf("Leak of %d blocks found in xmlXPathEvalExpr",
47796 xmlMemBlocks() - mem_base);
47798 printf(" %d", n_ctxt);
47810 test_xmlXPathEvaluatePredicateResult(void) {
47813 #if defined(LIBXML_XPATH_ENABLED)
47816 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47818 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47821 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47822 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47823 mem_base = xmlMemBlocks();
47824 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47825 res = gen_xmlXPathObjectPtr(n_res, 1);
47827 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47828 desret_int(ret_val);
47830 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47831 des_xmlXPathObjectPtr(n_res, res, 1);
47832 xmlResetLastError();
47833 if (mem_base != xmlMemBlocks()) {
47834 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47835 xmlMemBlocks() - mem_base);
47837 printf(" %d", n_ctxt);
47838 printf(" %d", n_res);
47851 test_xmlXPathFalseFunction(void) {
47854 #if defined(LIBXML_XPATH_ENABLED)
47856 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47858 int nargs; /* the number of arguments */
47861 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47862 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47863 mem_base = xmlMemBlocks();
47864 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47865 nargs = gen_int(n_nargs, 1);
47867 xmlXPathFalseFunction(ctxt, nargs);
47869 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47870 des_int(n_nargs, nargs, 1);
47871 xmlResetLastError();
47872 if (mem_base != xmlMemBlocks()) {
47873 printf("Leak of %d blocks found in xmlXPathFalseFunction",
47874 xmlMemBlocks() - mem_base);
47876 printf(" %d", n_ctxt);
47877 printf(" %d", n_nargs);
47890 test_xmlXPathFloorFunction(void) {
47893 #if defined(LIBXML_XPATH_ENABLED)
47895 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47897 int nargs; /* the number of arguments */
47900 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47901 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47902 mem_base = xmlMemBlocks();
47903 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47904 nargs = gen_int(n_nargs, 1);
47906 xmlXPathFloorFunction(ctxt, nargs);
47908 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47909 des_int(n_nargs, nargs, 1);
47910 xmlResetLastError();
47911 if (mem_base != xmlMemBlocks()) {
47912 printf("Leak of %d blocks found in xmlXPathFloorFunction",
47913 xmlMemBlocks() - mem_base);
47915 printf(" %d", n_ctxt);
47916 printf(" %d", n_nargs);
47929 test_xmlXPathFunctionLookup(void) {
47933 /* missing type support */
47939 test_xmlXPathFunctionLookupNS(void) {
47943 /* missing type support */
47949 test_xmlXPathHasSameNodes(void) {
47952 #if defined(LIBXML_XPATH_ENABLED)
47955 xmlNodeSetPtr nodes1; /* a node-set */
47957 xmlNodeSetPtr nodes2; /* a node-set */
47960 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47961 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47962 mem_base = xmlMemBlocks();
47963 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47964 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47966 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47967 desret_int(ret_val);
47969 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47970 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47971 xmlResetLastError();
47972 if (mem_base != xmlMemBlocks()) {
47973 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47974 xmlMemBlocks() - mem_base);
47976 printf(" %d", n_nodes1);
47977 printf(" %d", n_nodes2);
47990 test_xmlXPathIdFunction(void) {
47993 #if defined(LIBXML_XPATH_ENABLED)
47995 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47997 int nargs; /* the number of arguments */
48000 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48001 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48002 mem_base = xmlMemBlocks();
48003 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48004 nargs = gen_int(n_nargs, 1);
48006 xmlXPathIdFunction(ctxt, nargs);
48008 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48009 des_int(n_nargs, nargs, 1);
48010 xmlResetLastError();
48011 if (mem_base != xmlMemBlocks()) {
48012 printf("Leak of %d blocks found in xmlXPathIdFunction",
48013 xmlMemBlocks() - mem_base);
48015 printf(" %d", n_ctxt);
48016 printf(" %d", n_nargs);
48029 test_xmlXPathIntersection(void) {
48032 #if defined(LIBXML_XPATH_ENABLED)
48034 xmlNodeSetPtr ret_val;
48035 xmlNodeSetPtr nodes1; /* a node-set */
48037 xmlNodeSetPtr nodes2; /* a node-set */
48040 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48041 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48042 mem_base = xmlMemBlocks();
48043 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48044 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48046 ret_val = xmlXPathIntersection(nodes1, nodes2);
48047 desret_xmlNodeSetPtr(ret_val);
48049 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48050 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48051 xmlResetLastError();
48052 if (mem_base != xmlMemBlocks()) {
48053 printf("Leak of %d blocks found in xmlXPathIntersection",
48054 xmlMemBlocks() - mem_base);
48056 printf(" %d", n_nodes1);
48057 printf(" %d", n_nodes2);
48070 test_xmlXPathIsNodeType(void) {
48073 #if defined(LIBXML_XPATH_ENABLED)
48076 xmlChar * name; /* a name string */
48079 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48080 mem_base = xmlMemBlocks();
48081 name = gen_const_xmlChar_ptr(n_name, 0);
48083 ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48084 desret_int(ret_val);
48086 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48087 xmlResetLastError();
48088 if (mem_base != xmlMemBlocks()) {
48089 printf("Leak of %d blocks found in xmlXPathIsNodeType",
48090 xmlMemBlocks() - mem_base);
48092 printf(" %d", n_name);
48104 test_xmlXPathLangFunction(void) {
48107 #if defined(LIBXML_XPATH_ENABLED)
48109 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48111 int nargs; /* the number of arguments */
48114 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48115 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48116 mem_base = xmlMemBlocks();
48117 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48118 nargs = gen_int(n_nargs, 1);
48120 xmlXPathLangFunction(ctxt, nargs);
48122 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48123 des_int(n_nargs, nargs, 1);
48124 xmlResetLastError();
48125 if (mem_base != xmlMemBlocks()) {
48126 printf("Leak of %d blocks found in xmlXPathLangFunction",
48127 xmlMemBlocks() - mem_base);
48129 printf(" %d", n_ctxt);
48130 printf(" %d", n_nargs);
48143 test_xmlXPathLastFunction(void) {
48146 #if defined(LIBXML_XPATH_ENABLED)
48148 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48150 int nargs; /* the number of arguments */
48153 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48154 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48155 mem_base = xmlMemBlocks();
48156 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48157 nargs = gen_int(n_nargs, 1);
48159 xmlXPathLastFunction(ctxt, nargs);
48161 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48162 des_int(n_nargs, nargs, 1);
48163 xmlResetLastError();
48164 if (mem_base != xmlMemBlocks()) {
48165 printf("Leak of %d blocks found in xmlXPathLastFunction",
48166 xmlMemBlocks() - mem_base);
48168 printf(" %d", n_ctxt);
48169 printf(" %d", n_nargs);
48182 test_xmlXPathLeading(void) {
48185 #if defined(LIBXML_XPATH_ENABLED)
48187 xmlNodeSetPtr ret_val;
48188 xmlNodeSetPtr nodes1; /* a node-set */
48190 xmlNodeSetPtr nodes2; /* a node-set */
48193 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48194 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48195 mem_base = xmlMemBlocks();
48196 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48197 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48199 ret_val = xmlXPathLeading(nodes1, nodes2);
48200 desret_xmlNodeSetPtr(ret_val);
48202 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48203 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48204 xmlResetLastError();
48205 if (mem_base != xmlMemBlocks()) {
48206 printf("Leak of %d blocks found in xmlXPathLeading",
48207 xmlMemBlocks() - mem_base);
48209 printf(" %d", n_nodes1);
48210 printf(" %d", n_nodes2);
48223 test_xmlXPathLeadingSorted(void) {
48226 #if defined(LIBXML_XPATH_ENABLED)
48228 xmlNodeSetPtr ret_val;
48229 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48231 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48234 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48235 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48236 mem_base = xmlMemBlocks();
48237 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48238 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48240 ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48241 desret_xmlNodeSetPtr(ret_val);
48243 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48244 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48245 xmlResetLastError();
48246 if (mem_base != xmlMemBlocks()) {
48247 printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48248 xmlMemBlocks() - mem_base);
48250 printf(" %d", n_nodes1);
48251 printf(" %d", n_nodes2);
48264 test_xmlXPathLocalNameFunction(void) {
48267 #if defined(LIBXML_XPATH_ENABLED)
48269 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48271 int nargs; /* the number of arguments */
48274 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48275 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48276 mem_base = xmlMemBlocks();
48277 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48278 nargs = gen_int(n_nargs, 1);
48280 xmlXPathLocalNameFunction(ctxt, nargs);
48282 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48283 des_int(n_nargs, nargs, 1);
48284 xmlResetLastError();
48285 if (mem_base != xmlMemBlocks()) {
48286 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48287 xmlMemBlocks() - mem_base);
48289 printf(" %d", n_ctxt);
48290 printf(" %d", n_nargs);
48303 test_xmlXPathModValues(void) {
48306 #if defined(LIBXML_XPATH_ENABLED)
48308 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48311 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48312 mem_base = xmlMemBlocks();
48313 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48315 xmlXPathModValues(ctxt);
48317 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48318 xmlResetLastError();
48319 if (mem_base != xmlMemBlocks()) {
48320 printf("Leak of %d blocks found in xmlXPathModValues",
48321 xmlMemBlocks() - mem_base);
48323 printf(" %d", n_ctxt);
48335 test_xmlXPathMultValues(void) {
48338 #if defined(LIBXML_XPATH_ENABLED)
48340 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48343 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48344 mem_base = xmlMemBlocks();
48345 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48347 xmlXPathMultValues(ctxt);
48349 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48350 xmlResetLastError();
48351 if (mem_base != xmlMemBlocks()) {
48352 printf("Leak of %d blocks found in xmlXPathMultValues",
48353 xmlMemBlocks() - mem_base);
48355 printf(" %d", n_ctxt);
48367 test_xmlXPathNamespaceURIFunction(void) {
48370 #if defined(LIBXML_XPATH_ENABLED)
48372 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48374 int nargs; /* the number of arguments */
48377 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48378 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48379 mem_base = xmlMemBlocks();
48380 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48381 nargs = gen_int(n_nargs, 1);
48383 xmlXPathNamespaceURIFunction(ctxt, nargs);
48385 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48386 des_int(n_nargs, nargs, 1);
48387 xmlResetLastError();
48388 if (mem_base != xmlMemBlocks()) {
48389 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48390 xmlMemBlocks() - mem_base);
48392 printf(" %d", n_ctxt);
48393 printf(" %d", n_nargs);
48406 test_xmlXPathNewBoolean(void) {
48409 #if defined(LIBXML_XPATH_ENABLED)
48411 xmlXPathObjectPtr ret_val;
48412 int val; /* the boolean value */
48415 for (n_val = 0;n_val < gen_nb_int;n_val++) {
48416 mem_base = xmlMemBlocks();
48417 val = gen_int(n_val, 0);
48419 ret_val = xmlXPathNewBoolean(val);
48420 desret_xmlXPathObjectPtr(ret_val);
48422 des_int(n_val, val, 0);
48423 xmlResetLastError();
48424 if (mem_base != xmlMemBlocks()) {
48425 printf("Leak of %d blocks found in xmlXPathNewBoolean",
48426 xmlMemBlocks() - mem_base);
48428 printf(" %d", n_val);
48440 test_xmlXPathNewCString(void) {
48443 #if defined(LIBXML_XPATH_ENABLED)
48445 xmlXPathObjectPtr ret_val;
48446 char * val; /* the char * value */
48449 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48450 mem_base = xmlMemBlocks();
48451 val = gen_const_char_ptr(n_val, 0);
48453 ret_val = xmlXPathNewCString((const char *)val);
48454 desret_xmlXPathObjectPtr(ret_val);
48456 des_const_char_ptr(n_val, (const char *)val, 0);
48457 xmlResetLastError();
48458 if (mem_base != xmlMemBlocks()) {
48459 printf("Leak of %d blocks found in xmlXPathNewCString",
48460 xmlMemBlocks() - mem_base);
48462 printf(" %d", n_val);
48474 test_xmlXPathNewFloat(void) {
48477 #if defined(LIBXML_XPATH_ENABLED)
48479 xmlXPathObjectPtr ret_val;
48480 double val; /* the double value */
48483 for (n_val = 0;n_val < gen_nb_double;n_val++) {
48484 mem_base = xmlMemBlocks();
48485 val = gen_double(n_val, 0);
48487 ret_val = xmlXPathNewFloat(val);
48488 desret_xmlXPathObjectPtr(ret_val);
48490 des_double(n_val, val, 0);
48491 xmlResetLastError();
48492 if (mem_base != xmlMemBlocks()) {
48493 printf("Leak of %d blocks found in xmlXPathNewFloat",
48494 xmlMemBlocks() - mem_base);
48496 printf(" %d", n_val);
48508 test_xmlXPathNewNodeSet(void) {
48511 #if defined(LIBXML_XPATH_ENABLED)
48513 xmlXPathObjectPtr ret_val;
48514 xmlNodePtr val; /* the NodePtr value */
48517 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48518 mem_base = xmlMemBlocks();
48519 val = gen_xmlNodePtr(n_val, 0);
48521 ret_val = xmlXPathNewNodeSet(val);
48522 desret_xmlXPathObjectPtr(ret_val);
48524 des_xmlNodePtr(n_val, val, 0);
48525 xmlResetLastError();
48526 if (mem_base != xmlMemBlocks()) {
48527 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48528 xmlMemBlocks() - mem_base);
48530 printf(" %d", n_val);
48542 test_xmlXPathNewNodeSetList(void) {
48545 #if defined(LIBXML_XPATH_ENABLED)
48547 xmlXPathObjectPtr ret_val;
48548 xmlNodeSetPtr val; /* an existing NodeSet */
48551 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48552 mem_base = xmlMemBlocks();
48553 val = gen_xmlNodeSetPtr(n_val, 0);
48555 ret_val = xmlXPathNewNodeSetList(val);
48556 desret_xmlXPathObjectPtr(ret_val);
48558 des_xmlNodeSetPtr(n_val, val, 0);
48559 xmlResetLastError();
48560 if (mem_base != xmlMemBlocks()) {
48561 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48562 xmlMemBlocks() - mem_base);
48564 printf(" %d", n_val);
48576 test_xmlXPathNewParserContext(void) {
48580 /* missing type support */
48586 test_xmlXPathNewString(void) {
48589 #if defined(LIBXML_XPATH_ENABLED)
48591 xmlXPathObjectPtr ret_val;
48592 xmlChar * val; /* the xmlChar * value */
48595 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48596 mem_base = xmlMemBlocks();
48597 val = gen_const_xmlChar_ptr(n_val, 0);
48599 ret_val = xmlXPathNewString((const xmlChar *)val);
48600 desret_xmlXPathObjectPtr(ret_val);
48602 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48603 xmlResetLastError();
48604 if (mem_base != xmlMemBlocks()) {
48605 printf("Leak of %d blocks found in xmlXPathNewString",
48606 xmlMemBlocks() - mem_base);
48608 printf(" %d", n_val);
48620 test_xmlXPathNextAncestor(void) {
48623 #if defined(LIBXML_XPATH_ENABLED)
48625 xmlNodePtr ret_val;
48626 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48628 xmlNodePtr cur; /* the current node in the traversal */
48631 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48632 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48633 mem_base = xmlMemBlocks();
48634 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48635 cur = gen_xmlNodePtr(n_cur, 1);
48637 ret_val = xmlXPathNextAncestor(ctxt, cur);
48638 desret_xmlNodePtr(ret_val);
48640 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48641 des_xmlNodePtr(n_cur, cur, 1);
48642 xmlResetLastError();
48643 if (mem_base != xmlMemBlocks()) {
48644 printf("Leak of %d blocks found in xmlXPathNextAncestor",
48645 xmlMemBlocks() - mem_base);
48647 printf(" %d", n_ctxt);
48648 printf(" %d", n_cur);
48661 test_xmlXPathNextAncestorOrSelf(void) {
48664 #if defined(LIBXML_XPATH_ENABLED)
48666 xmlNodePtr ret_val;
48667 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48669 xmlNodePtr cur; /* the current node in the traversal */
48672 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48673 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48674 mem_base = xmlMemBlocks();
48675 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48676 cur = gen_xmlNodePtr(n_cur, 1);
48678 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48679 desret_xmlNodePtr(ret_val);
48681 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48682 des_xmlNodePtr(n_cur, cur, 1);
48683 xmlResetLastError();
48684 if (mem_base != xmlMemBlocks()) {
48685 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48686 xmlMemBlocks() - mem_base);
48688 printf(" %d", n_ctxt);
48689 printf(" %d", n_cur);
48702 test_xmlXPathNextAttribute(void) {
48705 #if defined(LIBXML_XPATH_ENABLED)
48707 xmlNodePtr ret_val;
48708 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48710 xmlNodePtr cur; /* the current attribute in the traversal */
48713 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48714 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48715 mem_base = xmlMemBlocks();
48716 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48717 cur = gen_xmlNodePtr(n_cur, 1);
48719 ret_val = xmlXPathNextAttribute(ctxt, cur);
48720 desret_xmlNodePtr(ret_val);
48722 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48723 des_xmlNodePtr(n_cur, cur, 1);
48724 xmlResetLastError();
48725 if (mem_base != xmlMemBlocks()) {
48726 printf("Leak of %d blocks found in xmlXPathNextAttribute",
48727 xmlMemBlocks() - mem_base);
48729 printf(" %d", n_ctxt);
48730 printf(" %d", n_cur);
48743 test_xmlXPathNextChild(void) {
48746 #if defined(LIBXML_XPATH_ENABLED)
48748 xmlNodePtr ret_val;
48749 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48751 xmlNodePtr cur; /* the current node in the traversal */
48754 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48755 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48756 mem_base = xmlMemBlocks();
48757 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48758 cur = gen_xmlNodePtr(n_cur, 1);
48760 ret_val = xmlXPathNextChild(ctxt, cur);
48761 desret_xmlNodePtr(ret_val);
48763 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48764 des_xmlNodePtr(n_cur, cur, 1);
48765 xmlResetLastError();
48766 if (mem_base != xmlMemBlocks()) {
48767 printf("Leak of %d blocks found in xmlXPathNextChild",
48768 xmlMemBlocks() - mem_base);
48770 printf(" %d", n_ctxt);
48771 printf(" %d", n_cur);
48784 test_xmlXPathNextDescendant(void) {
48787 #if defined(LIBXML_XPATH_ENABLED)
48789 xmlNodePtr ret_val;
48790 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48792 xmlNodePtr cur; /* the current node in the traversal */
48795 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48796 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48797 mem_base = xmlMemBlocks();
48798 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48799 cur = gen_xmlNodePtr(n_cur, 1);
48801 ret_val = xmlXPathNextDescendant(ctxt, cur);
48802 desret_xmlNodePtr(ret_val);
48804 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48805 des_xmlNodePtr(n_cur, cur, 1);
48806 xmlResetLastError();
48807 if (mem_base != xmlMemBlocks()) {
48808 printf("Leak of %d blocks found in xmlXPathNextDescendant",
48809 xmlMemBlocks() - mem_base);
48811 printf(" %d", n_ctxt);
48812 printf(" %d", n_cur);
48825 test_xmlXPathNextDescendantOrSelf(void) {
48828 #if defined(LIBXML_XPATH_ENABLED)
48830 xmlNodePtr ret_val;
48831 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48833 xmlNodePtr cur; /* the current node in the traversal */
48836 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48837 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48838 mem_base = xmlMemBlocks();
48839 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48840 cur = gen_xmlNodePtr(n_cur, 1);
48842 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48843 desret_xmlNodePtr(ret_val);
48845 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48846 des_xmlNodePtr(n_cur, cur, 1);
48847 xmlResetLastError();
48848 if (mem_base != xmlMemBlocks()) {
48849 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48850 xmlMemBlocks() - mem_base);
48852 printf(" %d", n_ctxt);
48853 printf(" %d", n_cur);
48866 test_xmlXPathNextFollowing(void) {
48869 #if defined(LIBXML_XPATH_ENABLED)
48871 xmlNodePtr ret_val;
48872 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48874 xmlNodePtr cur; /* the current node in the traversal */
48877 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48878 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48879 mem_base = xmlMemBlocks();
48880 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48881 cur = gen_xmlNodePtr(n_cur, 1);
48883 ret_val = xmlXPathNextFollowing(ctxt, cur);
48884 desret_xmlNodePtr(ret_val);
48886 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48887 des_xmlNodePtr(n_cur, cur, 1);
48888 xmlResetLastError();
48889 if (mem_base != xmlMemBlocks()) {
48890 printf("Leak of %d blocks found in xmlXPathNextFollowing",
48891 xmlMemBlocks() - mem_base);
48893 printf(" %d", n_ctxt);
48894 printf(" %d", n_cur);
48907 test_xmlXPathNextFollowingSibling(void) {
48910 #if defined(LIBXML_XPATH_ENABLED)
48912 xmlNodePtr ret_val;
48913 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48915 xmlNodePtr cur; /* the current node in the traversal */
48918 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48919 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48920 mem_base = xmlMemBlocks();
48921 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48922 cur = gen_xmlNodePtr(n_cur, 1);
48924 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48925 desret_xmlNodePtr(ret_val);
48927 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48928 des_xmlNodePtr(n_cur, cur, 1);
48929 xmlResetLastError();
48930 if (mem_base != xmlMemBlocks()) {
48931 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48932 xmlMemBlocks() - mem_base);
48934 printf(" %d", n_ctxt);
48935 printf(" %d", n_cur);
48948 test_xmlXPathNextNamespace(void) {
48951 #if defined(LIBXML_XPATH_ENABLED)
48953 xmlNodePtr ret_val;
48954 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48956 xmlNodePtr cur; /* the current attribute in the traversal */
48959 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48960 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48961 mem_base = xmlMemBlocks();
48962 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48963 cur = gen_xmlNodePtr(n_cur, 1);
48965 ret_val = xmlXPathNextNamespace(ctxt, cur);
48966 desret_xmlNodePtr(ret_val);
48968 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48969 des_xmlNodePtr(n_cur, cur, 1);
48970 xmlResetLastError();
48971 if (mem_base != xmlMemBlocks()) {
48972 printf("Leak of %d blocks found in xmlXPathNextNamespace",
48973 xmlMemBlocks() - mem_base);
48975 printf(" %d", n_ctxt);
48976 printf(" %d", n_cur);
48989 test_xmlXPathNextParent(void) {
48992 #if defined(LIBXML_XPATH_ENABLED)
48994 xmlNodePtr ret_val;
48995 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48997 xmlNodePtr cur; /* the current node in the traversal */
49000 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49001 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49002 mem_base = xmlMemBlocks();
49003 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49004 cur = gen_xmlNodePtr(n_cur, 1);
49006 ret_val = xmlXPathNextParent(ctxt, cur);
49007 desret_xmlNodePtr(ret_val);
49009 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49010 des_xmlNodePtr(n_cur, cur, 1);
49011 xmlResetLastError();
49012 if (mem_base != xmlMemBlocks()) {
49013 printf("Leak of %d blocks found in xmlXPathNextParent",
49014 xmlMemBlocks() - mem_base);
49016 printf(" %d", n_ctxt);
49017 printf(" %d", n_cur);
49030 test_xmlXPathNextPreceding(void) {
49033 #if defined(LIBXML_XPATH_ENABLED)
49035 xmlNodePtr ret_val;
49036 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49038 xmlNodePtr cur; /* the current node in the traversal */
49041 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49042 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49043 mem_base = xmlMemBlocks();
49044 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49045 cur = gen_xmlNodePtr(n_cur, 1);
49047 ret_val = xmlXPathNextPreceding(ctxt, cur);
49048 desret_xmlNodePtr(ret_val);
49050 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49051 des_xmlNodePtr(n_cur, cur, 1);
49052 xmlResetLastError();
49053 if (mem_base != xmlMemBlocks()) {
49054 printf("Leak of %d blocks found in xmlXPathNextPreceding",
49055 xmlMemBlocks() - mem_base);
49057 printf(" %d", n_ctxt);
49058 printf(" %d", n_cur);
49071 test_xmlXPathNextPrecedingSibling(void) {
49074 #if defined(LIBXML_XPATH_ENABLED)
49076 xmlNodePtr ret_val;
49077 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49079 xmlNodePtr cur; /* the current node in the traversal */
49082 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49083 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49084 mem_base = xmlMemBlocks();
49085 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49086 cur = gen_xmlNodePtr(n_cur, 1);
49088 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49089 desret_xmlNodePtr(ret_val);
49091 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49092 des_xmlNodePtr(n_cur, cur, 1);
49093 xmlResetLastError();
49094 if (mem_base != xmlMemBlocks()) {
49095 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49096 xmlMemBlocks() - mem_base);
49098 printf(" %d", n_ctxt);
49099 printf(" %d", n_cur);
49112 test_xmlXPathNextSelf(void) {
49115 #if defined(LIBXML_XPATH_ENABLED)
49117 xmlNodePtr ret_val;
49118 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49120 xmlNodePtr cur; /* the current node in the traversal */
49123 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49124 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49125 mem_base = xmlMemBlocks();
49126 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49127 cur = gen_xmlNodePtr(n_cur, 1);
49129 ret_val = xmlXPathNextSelf(ctxt, cur);
49130 desret_xmlNodePtr(ret_val);
49132 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49133 des_xmlNodePtr(n_cur, cur, 1);
49134 xmlResetLastError();
49135 if (mem_base != xmlMemBlocks()) {
49136 printf("Leak of %d blocks found in xmlXPathNextSelf",
49137 xmlMemBlocks() - mem_base);
49139 printf(" %d", n_ctxt);
49140 printf(" %d", n_cur);
49153 test_xmlXPathNodeLeading(void) {
49156 #if defined(LIBXML_XPATH_ENABLED)
49158 xmlNodeSetPtr ret_val;
49159 xmlNodeSetPtr nodes; /* a node-set */
49161 xmlNodePtr node; /* a node */
49164 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49165 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49166 mem_base = xmlMemBlocks();
49167 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49168 node = gen_xmlNodePtr(n_node, 1);
49170 ret_val = xmlXPathNodeLeading(nodes, node);
49171 desret_xmlNodeSetPtr(ret_val);
49173 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49174 des_xmlNodePtr(n_node, node, 1);
49175 xmlResetLastError();
49176 if (mem_base != xmlMemBlocks()) {
49177 printf("Leak of %d blocks found in xmlXPathNodeLeading",
49178 xmlMemBlocks() - mem_base);
49180 printf(" %d", n_nodes);
49181 printf(" %d", n_node);
49194 test_xmlXPathNodeLeadingSorted(void) {
49197 #if defined(LIBXML_XPATH_ENABLED)
49199 xmlNodeSetPtr ret_val;
49200 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49202 xmlNodePtr node; /* a node */
49205 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49206 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49207 mem_base = xmlMemBlocks();
49208 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49209 node = gen_xmlNodePtr(n_node, 1);
49211 ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49212 desret_xmlNodeSetPtr(ret_val);
49214 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49215 des_xmlNodePtr(n_node, node, 1);
49216 xmlResetLastError();
49217 if (mem_base != xmlMemBlocks()) {
49218 printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49219 xmlMemBlocks() - mem_base);
49221 printf(" %d", n_nodes);
49222 printf(" %d", n_node);
49235 test_xmlXPathNodeSetAdd(void) {
49238 #if defined(LIBXML_XPATH_ENABLED)
49241 xmlNodeSetPtr cur; /* the initial node set */
49243 xmlNodePtr val; /* a new xmlNodePtr */
49246 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49247 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49248 mem_base = xmlMemBlocks();
49249 cur = gen_xmlNodeSetPtr(n_cur, 0);
49250 val = gen_xmlNodePtr(n_val, 1);
49252 ret_val = xmlXPathNodeSetAdd(cur, val);
49253 desret_int(ret_val);
49255 des_xmlNodeSetPtr(n_cur, cur, 0);
49256 des_xmlNodePtr(n_val, val, 1);
49257 xmlResetLastError();
49258 if (mem_base != xmlMemBlocks()) {
49259 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49260 xmlMemBlocks() - mem_base);
49262 printf(" %d", n_cur);
49263 printf(" %d", n_val);
49276 test_xmlXPathNodeSetAddNs(void) {
49279 #if defined(LIBXML_XPATH_ENABLED)
49282 xmlNodeSetPtr cur; /* the initial node set */
49284 xmlNodePtr node; /* the hosting node */
49286 xmlNsPtr ns; /* a the namespace node */
49289 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49290 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49291 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49292 mem_base = xmlMemBlocks();
49293 cur = gen_xmlNodeSetPtr(n_cur, 0);
49294 node = gen_xmlNodePtr(n_node, 1);
49295 ns = gen_xmlNsPtr(n_ns, 2);
49297 ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49298 desret_int(ret_val);
49300 des_xmlNodeSetPtr(n_cur, cur, 0);
49301 des_xmlNodePtr(n_node, node, 1);
49302 des_xmlNsPtr(n_ns, ns, 2);
49303 xmlResetLastError();
49304 if (mem_base != xmlMemBlocks()) {
49305 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49306 xmlMemBlocks() - mem_base);
49308 printf(" %d", n_cur);
49309 printf(" %d", n_node);
49310 printf(" %d", n_ns);
49324 test_xmlXPathNodeSetAddUnique(void) {
49327 #if defined(LIBXML_XPATH_ENABLED)
49330 xmlNodeSetPtr cur; /* the initial node set */
49332 xmlNodePtr val; /* a new xmlNodePtr */
49335 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49336 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49337 mem_base = xmlMemBlocks();
49338 cur = gen_xmlNodeSetPtr(n_cur, 0);
49339 val = gen_xmlNodePtr(n_val, 1);
49341 ret_val = xmlXPathNodeSetAddUnique(cur, val);
49342 desret_int(ret_val);
49344 des_xmlNodeSetPtr(n_cur, cur, 0);
49345 des_xmlNodePtr(n_val, val, 1);
49346 xmlResetLastError();
49347 if (mem_base != xmlMemBlocks()) {
49348 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49349 xmlMemBlocks() - mem_base);
49351 printf(" %d", n_cur);
49352 printf(" %d", n_val);
49365 test_xmlXPathNodeSetContains(void) {
49368 #if defined(LIBXML_XPATH_ENABLED)
49371 xmlNodeSetPtr cur; /* the node-set */
49373 xmlNodePtr val; /* the node */
49376 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49377 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49378 mem_base = xmlMemBlocks();
49379 cur = gen_xmlNodeSetPtr(n_cur, 0);
49380 val = gen_xmlNodePtr(n_val, 1);
49382 ret_val = xmlXPathNodeSetContains(cur, val);
49383 desret_int(ret_val);
49385 des_xmlNodeSetPtr(n_cur, cur, 0);
49386 des_xmlNodePtr(n_val, val, 1);
49387 xmlResetLastError();
49388 if (mem_base != xmlMemBlocks()) {
49389 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49390 xmlMemBlocks() - mem_base);
49392 printf(" %d", n_cur);
49393 printf(" %d", n_val);
49406 test_xmlXPathNodeSetDel(void) {
49409 #if defined(LIBXML_XPATH_ENABLED)
49411 xmlNodeSetPtr cur; /* the initial node set */
49413 xmlNodePtr val; /* an xmlNodePtr */
49416 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49417 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49418 mem_base = xmlMemBlocks();
49419 cur = gen_xmlNodeSetPtr(n_cur, 0);
49420 val = gen_xmlNodePtr(n_val, 1);
49422 xmlXPathNodeSetDel(cur, val);
49424 des_xmlNodeSetPtr(n_cur, cur, 0);
49425 des_xmlNodePtr(n_val, val, 1);
49426 xmlResetLastError();
49427 if (mem_base != xmlMemBlocks()) {
49428 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49429 xmlMemBlocks() - mem_base);
49431 printf(" %d", n_cur);
49432 printf(" %d", n_val);
49445 test_xmlXPathNodeSetMerge(void) {
49448 #if defined(LIBXML_XPATH_ENABLED)
49450 xmlNodeSetPtr ret_val;
49451 xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49453 xmlNodeSetPtr val2; /* the second NodeSet */
49456 for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49457 for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49458 mem_base = xmlMemBlocks();
49459 val1 = gen_xmlNodeSetPtr(n_val1, 0);
49460 val2 = gen_xmlNodeSetPtr(n_val2, 1);
49462 ret_val = xmlXPathNodeSetMerge(val1, val2);
49463 desret_xmlNodeSetPtr(ret_val);
49465 des_xmlNodeSetPtr(n_val1, val1, 0);
49466 des_xmlNodeSetPtr(n_val2, val2, 1);
49467 xmlResetLastError();
49468 if (mem_base != xmlMemBlocks()) {
49469 printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49470 xmlMemBlocks() - mem_base);
49472 printf(" %d", n_val1);
49473 printf(" %d", n_val2);
49486 test_xmlXPathNodeSetRemove(void) {
49489 #if defined(LIBXML_XPATH_ENABLED)
49491 xmlNodeSetPtr cur; /* the initial node set */
49493 int val; /* the index to remove */
49496 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49497 for (n_val = 0;n_val < gen_nb_int;n_val++) {
49498 mem_base = xmlMemBlocks();
49499 cur = gen_xmlNodeSetPtr(n_cur, 0);
49500 val = gen_int(n_val, 1);
49502 xmlXPathNodeSetRemove(cur, val);
49504 des_xmlNodeSetPtr(n_cur, cur, 0);
49505 des_int(n_val, val, 1);
49506 xmlResetLastError();
49507 if (mem_base != xmlMemBlocks()) {
49508 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49509 xmlMemBlocks() - mem_base);
49511 printf(" %d", n_cur);
49512 printf(" %d", n_val);
49525 test_xmlXPathNodeSetSort(void) {
49528 #if defined(LIBXML_XPATH_ENABLED)
49530 xmlNodeSetPtr set; /* the node set */
49533 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49534 mem_base = xmlMemBlocks();
49535 set = gen_xmlNodeSetPtr(n_set, 0);
49537 xmlXPathNodeSetSort(set);
49539 des_xmlNodeSetPtr(n_set, set, 0);
49540 xmlResetLastError();
49541 if (mem_base != xmlMemBlocks()) {
49542 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49543 xmlMemBlocks() - mem_base);
49545 printf(" %d", n_set);
49557 test_xmlXPathNodeTrailing(void) {
49560 #if defined(LIBXML_XPATH_ENABLED)
49562 xmlNodeSetPtr ret_val;
49563 xmlNodeSetPtr nodes; /* a node-set */
49565 xmlNodePtr node; /* a node */
49568 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49569 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49570 mem_base = xmlMemBlocks();
49571 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49572 node = gen_xmlNodePtr(n_node, 1);
49574 ret_val = xmlXPathNodeTrailing(nodes, node);
49575 desret_xmlNodeSetPtr(ret_val);
49577 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49578 des_xmlNodePtr(n_node, node, 1);
49579 xmlResetLastError();
49580 if (mem_base != xmlMemBlocks()) {
49581 printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49582 xmlMemBlocks() - mem_base);
49584 printf(" %d", n_nodes);
49585 printf(" %d", n_node);
49598 test_xmlXPathNodeTrailingSorted(void) {
49601 #if defined(LIBXML_XPATH_ENABLED)
49603 xmlNodeSetPtr ret_val;
49604 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49606 xmlNodePtr node; /* a node */
49609 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49610 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49611 mem_base = xmlMemBlocks();
49612 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49613 node = gen_xmlNodePtr(n_node, 1);
49615 ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49616 desret_xmlNodeSetPtr(ret_val);
49618 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49619 des_xmlNodePtr(n_node, node, 1);
49620 xmlResetLastError();
49621 if (mem_base != xmlMemBlocks()) {
49622 printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49623 xmlMemBlocks() - mem_base);
49625 printf(" %d", n_nodes);
49626 printf(" %d", n_node);
49639 test_xmlXPathNormalizeFunction(void) {
49642 #if defined(LIBXML_XPATH_ENABLED)
49644 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49646 int nargs; /* the number of arguments */
49649 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49650 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49651 mem_base = xmlMemBlocks();
49652 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49653 nargs = gen_int(n_nargs, 1);
49655 xmlXPathNormalizeFunction(ctxt, nargs);
49657 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49658 des_int(n_nargs, nargs, 1);
49659 xmlResetLastError();
49660 if (mem_base != xmlMemBlocks()) {
49661 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49662 xmlMemBlocks() - mem_base);
49664 printf(" %d", n_ctxt);
49665 printf(" %d", n_nargs);
49678 test_xmlXPathNotEqualValues(void) {
49681 #if defined(LIBXML_XPATH_ENABLED)
49684 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49687 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49688 mem_base = xmlMemBlocks();
49689 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49691 ret_val = xmlXPathNotEqualValues(ctxt);
49692 desret_int(ret_val);
49694 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49695 xmlResetLastError();
49696 if (mem_base != xmlMemBlocks()) {
49697 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49698 xmlMemBlocks() - mem_base);
49700 printf(" %d", n_ctxt);
49712 test_xmlXPathNotFunction(void) {
49715 #if defined(LIBXML_XPATH_ENABLED)
49717 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49719 int nargs; /* the number of arguments */
49722 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49723 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49724 mem_base = xmlMemBlocks();
49725 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49726 nargs = gen_int(n_nargs, 1);
49728 xmlXPathNotFunction(ctxt, nargs);
49730 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49731 des_int(n_nargs, nargs, 1);
49732 xmlResetLastError();
49733 if (mem_base != xmlMemBlocks()) {
49734 printf("Leak of %d blocks found in xmlXPathNotFunction",
49735 xmlMemBlocks() - mem_base);
49737 printf(" %d", n_ctxt);
49738 printf(" %d", n_nargs);
49751 test_xmlXPathNsLookup(void) {
49754 #if defined(LIBXML_XPATH_ENABLED)
49756 const xmlChar * ret_val;
49757 xmlXPathContextPtr ctxt; /* the XPath context */
49759 xmlChar * prefix; /* the namespace prefix value */
49762 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49763 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49764 mem_base = xmlMemBlocks();
49765 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49766 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49768 ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49769 desret_const_xmlChar_ptr(ret_val);
49771 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49772 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49773 xmlResetLastError();
49774 if (mem_base != xmlMemBlocks()) {
49775 printf("Leak of %d blocks found in xmlXPathNsLookup",
49776 xmlMemBlocks() - mem_base);
49778 printf(" %d", n_ctxt);
49779 printf(" %d", n_prefix);
49792 test_xmlXPathNumberFunction(void) {
49795 #if defined(LIBXML_XPATH_ENABLED)
49797 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49799 int nargs; /* the number of arguments */
49802 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49803 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49804 mem_base = xmlMemBlocks();
49805 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49806 nargs = gen_int(n_nargs, 1);
49808 xmlXPathNumberFunction(ctxt, nargs);
49810 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49811 des_int(n_nargs, nargs, 1);
49812 xmlResetLastError();
49813 if (mem_base != xmlMemBlocks()) {
49814 printf("Leak of %d blocks found in xmlXPathNumberFunction",
49815 xmlMemBlocks() - mem_base);
49817 printf(" %d", n_ctxt);
49818 printf(" %d", n_nargs);
49831 test_xmlXPathParseNCName(void) {
49834 #if defined(LIBXML_XPATH_ENABLED)
49837 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49840 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49841 mem_base = xmlMemBlocks();
49842 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49844 ret_val = xmlXPathParseNCName(ctxt);
49845 desret_xmlChar_ptr(ret_val);
49847 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49848 xmlResetLastError();
49849 if (mem_base != xmlMemBlocks()) {
49850 printf("Leak of %d blocks found in xmlXPathParseNCName",
49851 xmlMemBlocks() - mem_base);
49853 printf(" %d", n_ctxt);
49865 test_xmlXPathParseName(void) {
49868 #if defined(LIBXML_XPATH_ENABLED)
49871 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49874 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49875 mem_base = xmlMemBlocks();
49876 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49878 ret_val = xmlXPathParseName(ctxt);
49879 desret_xmlChar_ptr(ret_val);
49881 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49882 xmlResetLastError();
49883 if (mem_base != xmlMemBlocks()) {
49884 printf("Leak of %d blocks found in xmlXPathParseName",
49885 xmlMemBlocks() - mem_base);
49887 printf(" %d", n_ctxt);
49899 test_xmlXPathPopBoolean(void) {
49902 #if defined(LIBXML_XPATH_ENABLED)
49905 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49908 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49909 mem_base = xmlMemBlocks();
49910 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49912 ret_val = xmlXPathPopBoolean(ctxt);
49913 desret_int(ret_val);
49915 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49916 xmlResetLastError();
49917 if (mem_base != xmlMemBlocks()) {
49918 printf("Leak of %d blocks found in xmlXPathPopBoolean",
49919 xmlMemBlocks() - mem_base);
49921 printf(" %d", n_ctxt);
49933 test_xmlXPathPopExternal(void) {
49936 #if defined(LIBXML_XPATH_ENABLED)
49939 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49942 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49943 mem_base = xmlMemBlocks();
49944 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49946 ret_val = xmlXPathPopExternal(ctxt);
49947 desret_void_ptr(ret_val);
49949 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49950 xmlResetLastError();
49951 if (mem_base != xmlMemBlocks()) {
49952 printf("Leak of %d blocks found in xmlXPathPopExternal",
49953 xmlMemBlocks() - mem_base);
49955 printf(" %d", n_ctxt);
49967 test_xmlXPathPopNodeSet(void) {
49970 #if defined(LIBXML_XPATH_ENABLED)
49972 xmlNodeSetPtr ret_val;
49973 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49976 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49977 mem_base = xmlMemBlocks();
49978 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49980 ret_val = xmlXPathPopNodeSet(ctxt);
49981 desret_xmlNodeSetPtr(ret_val);
49983 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49984 xmlResetLastError();
49985 if (mem_base != xmlMemBlocks()) {
49986 printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49987 xmlMemBlocks() - mem_base);
49989 printf(" %d", n_ctxt);
50001 test_xmlXPathPopNumber(void) {
50004 #if defined(LIBXML_XPATH_ENABLED)
50007 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50010 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50011 mem_base = xmlMemBlocks();
50012 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50014 ret_val = xmlXPathPopNumber(ctxt);
50015 desret_double(ret_val);
50017 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50018 xmlResetLastError();
50019 if (mem_base != xmlMemBlocks()) {
50020 printf("Leak of %d blocks found in xmlXPathPopNumber",
50021 xmlMemBlocks() - mem_base);
50023 printf(" %d", n_ctxt);
50035 test_xmlXPathPopString(void) {
50038 #if defined(LIBXML_XPATH_ENABLED)
50041 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50044 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50045 mem_base = xmlMemBlocks();
50046 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50048 ret_val = xmlXPathPopString(ctxt);
50049 desret_xmlChar_ptr(ret_val);
50051 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50052 xmlResetLastError();
50053 if (mem_base != xmlMemBlocks()) {
50054 printf("Leak of %d blocks found in xmlXPathPopString",
50055 xmlMemBlocks() - mem_base);
50057 printf(" %d", n_ctxt);
50069 test_xmlXPathPositionFunction(void) {
50072 #if defined(LIBXML_XPATH_ENABLED)
50074 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50076 int nargs; /* the number of arguments */
50079 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50080 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50081 mem_base = xmlMemBlocks();
50082 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50083 nargs = gen_int(n_nargs, 1);
50085 xmlXPathPositionFunction(ctxt, nargs);
50087 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50088 des_int(n_nargs, nargs, 1);
50089 xmlResetLastError();
50090 if (mem_base != xmlMemBlocks()) {
50091 printf("Leak of %d blocks found in xmlXPathPositionFunction",
50092 xmlMemBlocks() - mem_base);
50094 printf(" %d", n_ctxt);
50095 printf(" %d", n_nargs);
50108 test_xmlXPathRegisterAllFunctions(void) {
50111 #if defined(LIBXML_XPATH_ENABLED)
50113 xmlXPathContextPtr ctxt; /* the XPath context */
50116 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50117 mem_base = xmlMemBlocks();
50118 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50120 xmlXPathRegisterAllFunctions(ctxt);
50122 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50123 xmlResetLastError();
50124 if (mem_base != xmlMemBlocks()) {
50125 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50126 xmlMemBlocks() - mem_base);
50128 printf(" %d", n_ctxt);
50140 test_xmlXPathRegisterFunc(void) {
50144 /* missing type support */
50150 test_xmlXPathRegisterFuncLookup(void) {
50154 /* missing type support */
50160 test_xmlXPathRegisterFuncNS(void) {
50164 /* missing type support */
50170 test_xmlXPathRegisterNs(void) {
50173 #if defined(LIBXML_XPATH_ENABLED)
50176 xmlXPathContextPtr ctxt; /* the XPath context */
50178 xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50180 xmlChar * ns_uri; /* the namespace name */
50183 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50184 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50185 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50186 mem_base = xmlMemBlocks();
50187 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50188 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50189 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50191 ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50192 desret_int(ret_val);
50194 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50195 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50196 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50197 xmlResetLastError();
50198 if (mem_base != xmlMemBlocks()) {
50199 printf("Leak of %d blocks found in xmlXPathRegisterNs",
50200 xmlMemBlocks() - mem_base);
50202 printf(" %d", n_ctxt);
50203 printf(" %d", n_prefix);
50204 printf(" %d", n_ns_uri);
50218 test_xmlXPathRegisterVariable(void) {
50221 #if defined(LIBXML_XPATH_ENABLED)
50224 xmlXPathContextPtr ctxt; /* the XPath context */
50226 xmlChar * name; /* the variable name */
50228 xmlXPathObjectPtr value; /* the variable value or NULL */
50231 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50232 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50233 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50234 mem_base = xmlMemBlocks();
50235 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50236 name = gen_const_xmlChar_ptr(n_name, 1);
50237 value = gen_xmlXPathObjectPtr(n_value, 2);
50239 ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50240 desret_int(ret_val);
50242 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50243 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50244 des_xmlXPathObjectPtr(n_value, value, 2);
50245 xmlResetLastError();
50246 if (mem_base != xmlMemBlocks()) {
50247 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50248 xmlMemBlocks() - mem_base);
50250 printf(" %d", n_ctxt);
50251 printf(" %d", n_name);
50252 printf(" %d", n_value);
50266 test_xmlXPathRegisterVariableLookup(void) {
50270 /* missing type support */
50276 test_xmlXPathRegisterVariableNS(void) {
50279 #if defined(LIBXML_XPATH_ENABLED)
50282 xmlXPathContextPtr ctxt; /* the XPath context */
50284 xmlChar * name; /* the variable name */
50286 xmlChar * ns_uri; /* the variable namespace URI */
50288 xmlXPathObjectPtr value; /* the variable value or NULL */
50291 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50292 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50293 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50294 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50295 mem_base = xmlMemBlocks();
50296 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50297 name = gen_const_xmlChar_ptr(n_name, 1);
50298 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50299 value = gen_xmlXPathObjectPtr(n_value, 3);
50301 ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50302 desret_int(ret_val);
50304 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50305 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50306 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50307 des_xmlXPathObjectPtr(n_value, value, 3);
50308 xmlResetLastError();
50309 if (mem_base != xmlMemBlocks()) {
50310 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50311 xmlMemBlocks() - mem_base);
50313 printf(" %d", n_ctxt);
50314 printf(" %d", n_name);
50315 printf(" %d", n_ns_uri);
50316 printf(" %d", n_value);
50331 test_xmlXPathRegisteredFuncsCleanup(void) {
50334 #if defined(LIBXML_XPATH_ENABLED)
50336 xmlXPathContextPtr ctxt; /* the XPath context */
50339 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50340 mem_base = xmlMemBlocks();
50341 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50343 xmlXPathRegisteredFuncsCleanup(ctxt);
50345 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50346 xmlResetLastError();
50347 if (mem_base != xmlMemBlocks()) {
50348 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50349 xmlMemBlocks() - mem_base);
50351 printf(" %d", n_ctxt);
50363 test_xmlXPathRegisteredNsCleanup(void) {
50366 #if defined(LIBXML_XPATH_ENABLED)
50368 xmlXPathContextPtr ctxt; /* the XPath context */
50371 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50372 mem_base = xmlMemBlocks();
50373 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50375 xmlXPathRegisteredNsCleanup(ctxt);
50377 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50378 xmlResetLastError();
50379 if (mem_base != xmlMemBlocks()) {
50380 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50381 xmlMemBlocks() - mem_base);
50383 printf(" %d", n_ctxt);
50395 test_xmlXPathRegisteredVariablesCleanup(void) {
50398 #if defined(LIBXML_XPATH_ENABLED)
50400 xmlXPathContextPtr ctxt; /* the XPath context */
50403 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50404 mem_base = xmlMemBlocks();
50405 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50407 xmlXPathRegisteredVariablesCleanup(ctxt);
50409 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50410 xmlResetLastError();
50411 if (mem_base != xmlMemBlocks()) {
50412 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50413 xmlMemBlocks() - mem_base);
50415 printf(" %d", n_ctxt);
50427 test_xmlXPathRoot(void) {
50430 #if defined(LIBXML_XPATH_ENABLED)
50432 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50435 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50436 mem_base = xmlMemBlocks();
50437 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50439 xmlXPathRoot(ctxt);
50441 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50442 xmlResetLastError();
50443 if (mem_base != xmlMemBlocks()) {
50444 printf("Leak of %d blocks found in xmlXPathRoot",
50445 xmlMemBlocks() - mem_base);
50447 printf(" %d", n_ctxt);
50459 test_xmlXPathRoundFunction(void) {
50462 #if defined(LIBXML_XPATH_ENABLED)
50464 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50466 int nargs; /* the number of arguments */
50469 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50470 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50471 mem_base = xmlMemBlocks();
50472 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50473 nargs = gen_int(n_nargs, 1);
50475 xmlXPathRoundFunction(ctxt, nargs);
50477 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50478 des_int(n_nargs, nargs, 1);
50479 xmlResetLastError();
50480 if (mem_base != xmlMemBlocks()) {
50481 printf("Leak of %d blocks found in xmlXPathRoundFunction",
50482 xmlMemBlocks() - mem_base);
50484 printf(" %d", n_ctxt);
50485 printf(" %d", n_nargs);
50498 test_xmlXPathStartsWithFunction(void) {
50501 #if defined(LIBXML_XPATH_ENABLED)
50503 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50505 int nargs; /* the number of arguments */
50508 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50509 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50510 mem_base = xmlMemBlocks();
50511 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50512 nargs = gen_int(n_nargs, 1);
50514 xmlXPathStartsWithFunction(ctxt, nargs);
50516 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50517 des_int(n_nargs, nargs, 1);
50518 xmlResetLastError();
50519 if (mem_base != xmlMemBlocks()) {
50520 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50521 xmlMemBlocks() - mem_base);
50523 printf(" %d", n_ctxt);
50524 printf(" %d", n_nargs);
50537 test_xmlXPathStringEvalNumber(void) {
50540 #if defined(LIBXML_XPATH_ENABLED)
50543 xmlChar * str; /* A string to scan */
50546 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50547 mem_base = xmlMemBlocks();
50548 str = gen_const_xmlChar_ptr(n_str, 0);
50550 ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50551 desret_double(ret_val);
50553 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50554 xmlResetLastError();
50555 if (mem_base != xmlMemBlocks()) {
50556 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50557 xmlMemBlocks() - mem_base);
50559 printf(" %d", n_str);
50571 test_xmlXPathStringFunction(void) {
50574 #if defined(LIBXML_XPATH_ENABLED)
50576 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50578 int nargs; /* the number of arguments */
50581 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50582 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50583 mem_base = xmlMemBlocks();
50584 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50585 nargs = gen_int(n_nargs, 1);
50587 xmlXPathStringFunction(ctxt, nargs);
50589 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50590 des_int(n_nargs, nargs, 1);
50591 xmlResetLastError();
50592 if (mem_base != xmlMemBlocks()) {
50593 printf("Leak of %d blocks found in xmlXPathStringFunction",
50594 xmlMemBlocks() - mem_base);
50596 printf(" %d", n_ctxt);
50597 printf(" %d", n_nargs);
50610 test_xmlXPathStringLengthFunction(void) {
50613 #if defined(LIBXML_XPATH_ENABLED)
50615 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50617 int nargs; /* the number of arguments */
50620 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50621 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50622 mem_base = xmlMemBlocks();
50623 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50624 nargs = gen_int(n_nargs, 1);
50626 xmlXPathStringLengthFunction(ctxt, nargs);
50628 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50629 des_int(n_nargs, nargs, 1);
50630 xmlResetLastError();
50631 if (mem_base != xmlMemBlocks()) {
50632 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50633 xmlMemBlocks() - mem_base);
50635 printf(" %d", n_ctxt);
50636 printf(" %d", n_nargs);
50649 test_xmlXPathSubValues(void) {
50652 #if defined(LIBXML_XPATH_ENABLED)
50654 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50657 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50658 mem_base = xmlMemBlocks();
50659 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50661 xmlXPathSubValues(ctxt);
50663 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50664 xmlResetLastError();
50665 if (mem_base != xmlMemBlocks()) {
50666 printf("Leak of %d blocks found in xmlXPathSubValues",
50667 xmlMemBlocks() - mem_base);
50669 printf(" %d", n_ctxt);
50681 test_xmlXPathSubstringAfterFunction(void) {
50684 #if defined(LIBXML_XPATH_ENABLED)
50686 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50688 int nargs; /* the number of arguments */
50691 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50692 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50693 mem_base = xmlMemBlocks();
50694 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50695 nargs = gen_int(n_nargs, 1);
50697 xmlXPathSubstringAfterFunction(ctxt, nargs);
50699 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50700 des_int(n_nargs, nargs, 1);
50701 xmlResetLastError();
50702 if (mem_base != xmlMemBlocks()) {
50703 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50704 xmlMemBlocks() - mem_base);
50706 printf(" %d", n_ctxt);
50707 printf(" %d", n_nargs);
50720 test_xmlXPathSubstringBeforeFunction(void) {
50723 #if defined(LIBXML_XPATH_ENABLED)
50725 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50727 int nargs; /* the number of arguments */
50730 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50731 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50732 mem_base = xmlMemBlocks();
50733 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50734 nargs = gen_int(n_nargs, 1);
50736 xmlXPathSubstringBeforeFunction(ctxt, nargs);
50738 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50739 des_int(n_nargs, nargs, 1);
50740 xmlResetLastError();
50741 if (mem_base != xmlMemBlocks()) {
50742 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50743 xmlMemBlocks() - mem_base);
50745 printf(" %d", n_ctxt);
50746 printf(" %d", n_nargs);
50759 test_xmlXPathSubstringFunction(void) {
50762 #if defined(LIBXML_XPATH_ENABLED)
50764 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50766 int nargs; /* the number of arguments */
50769 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50770 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50771 mem_base = xmlMemBlocks();
50772 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50773 nargs = gen_int(n_nargs, 1);
50775 xmlXPathSubstringFunction(ctxt, nargs);
50777 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50778 des_int(n_nargs, nargs, 1);
50779 xmlResetLastError();
50780 if (mem_base != xmlMemBlocks()) {
50781 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50782 xmlMemBlocks() - mem_base);
50784 printf(" %d", n_ctxt);
50785 printf(" %d", n_nargs);
50798 test_xmlXPathSumFunction(void) {
50801 #if defined(LIBXML_XPATH_ENABLED)
50803 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50805 int nargs; /* the number of arguments */
50808 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50809 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50810 mem_base = xmlMemBlocks();
50811 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50812 nargs = gen_int(n_nargs, 1);
50814 xmlXPathSumFunction(ctxt, nargs);
50816 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50817 des_int(n_nargs, nargs, 1);
50818 xmlResetLastError();
50819 if (mem_base != xmlMemBlocks()) {
50820 printf("Leak of %d blocks found in xmlXPathSumFunction",
50821 xmlMemBlocks() - mem_base);
50823 printf(" %d", n_ctxt);
50824 printf(" %d", n_nargs);
50837 test_xmlXPathTrailing(void) {
50840 #if defined(LIBXML_XPATH_ENABLED)
50842 xmlNodeSetPtr ret_val;
50843 xmlNodeSetPtr nodes1; /* a node-set */
50845 xmlNodeSetPtr nodes2; /* a node-set */
50848 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50849 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50850 mem_base = xmlMemBlocks();
50851 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50852 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50854 ret_val = xmlXPathTrailing(nodes1, nodes2);
50855 desret_xmlNodeSetPtr(ret_val);
50857 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50858 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50859 xmlResetLastError();
50860 if (mem_base != xmlMemBlocks()) {
50861 printf("Leak of %d blocks found in xmlXPathTrailing",
50862 xmlMemBlocks() - mem_base);
50864 printf(" %d", n_nodes1);
50865 printf(" %d", n_nodes2);
50878 test_xmlXPathTrailingSorted(void) {
50881 #if defined(LIBXML_XPATH_ENABLED)
50883 xmlNodeSetPtr ret_val;
50884 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50886 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50889 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50890 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50891 mem_base = xmlMemBlocks();
50892 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50893 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50895 ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50896 desret_xmlNodeSetPtr(ret_val);
50898 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50899 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50900 xmlResetLastError();
50901 if (mem_base != xmlMemBlocks()) {
50902 printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50903 xmlMemBlocks() - mem_base);
50905 printf(" %d", n_nodes1);
50906 printf(" %d", n_nodes2);
50919 test_xmlXPathTranslateFunction(void) {
50922 #if defined(LIBXML_XPATH_ENABLED)
50924 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50926 int nargs; /* the number of arguments */
50929 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50930 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50931 mem_base = xmlMemBlocks();
50932 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50933 nargs = gen_int(n_nargs, 1);
50935 xmlXPathTranslateFunction(ctxt, nargs);
50937 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50938 des_int(n_nargs, nargs, 1);
50939 xmlResetLastError();
50940 if (mem_base != xmlMemBlocks()) {
50941 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50942 xmlMemBlocks() - mem_base);
50944 printf(" %d", n_ctxt);
50945 printf(" %d", n_nargs);
50958 test_xmlXPathTrueFunction(void) {
50961 #if defined(LIBXML_XPATH_ENABLED)
50963 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50965 int nargs; /* the number of arguments */
50968 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50969 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50970 mem_base = xmlMemBlocks();
50971 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50972 nargs = gen_int(n_nargs, 1);
50974 xmlXPathTrueFunction(ctxt, nargs);
50976 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50977 des_int(n_nargs, nargs, 1);
50978 xmlResetLastError();
50979 if (mem_base != xmlMemBlocks()) {
50980 printf("Leak of %d blocks found in xmlXPathTrueFunction",
50981 xmlMemBlocks() - mem_base);
50983 printf(" %d", n_ctxt);
50984 printf(" %d", n_nargs);
50997 test_xmlXPathValueFlipSign(void) {
51000 #if defined(LIBXML_XPATH_ENABLED)
51002 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51005 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51006 mem_base = xmlMemBlocks();
51007 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51009 xmlXPathValueFlipSign(ctxt);
51011 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51012 xmlResetLastError();
51013 if (mem_base != xmlMemBlocks()) {
51014 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
51015 xmlMemBlocks() - mem_base);
51017 printf(" %d", n_ctxt);
51029 test_xmlXPathVariableLookup(void) {
51032 #if defined(LIBXML_XPATH_ENABLED)
51034 xmlXPathObjectPtr ret_val;
51035 xmlXPathContextPtr ctxt; /* the XPath context */
51037 xmlChar * name; /* the variable name */
51040 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51041 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51042 mem_base = xmlMemBlocks();
51043 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51044 name = gen_const_xmlChar_ptr(n_name, 1);
51046 ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51047 desret_xmlXPathObjectPtr(ret_val);
51049 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51050 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51051 xmlResetLastError();
51052 if (mem_base != xmlMemBlocks()) {
51053 printf("Leak of %d blocks found in xmlXPathVariableLookup",
51054 xmlMemBlocks() - mem_base);
51056 printf(" %d", n_ctxt);
51057 printf(" %d", n_name);
51070 test_xmlXPathVariableLookupNS(void) {
51073 #if defined(LIBXML_XPATH_ENABLED)
51075 xmlXPathObjectPtr ret_val;
51076 xmlXPathContextPtr ctxt; /* the XPath context */
51078 xmlChar * name; /* the variable name */
51080 xmlChar * ns_uri; /* the variable namespace URI */
51083 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51084 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51085 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51086 mem_base = xmlMemBlocks();
51087 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51088 name = gen_const_xmlChar_ptr(n_name, 1);
51089 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51091 ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51092 desret_xmlXPathObjectPtr(ret_val);
51094 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51095 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51096 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51097 xmlResetLastError();
51098 if (mem_base != xmlMemBlocks()) {
51099 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51100 xmlMemBlocks() - mem_base);
51102 printf(" %d", n_ctxt);
51103 printf(" %d", n_name);
51104 printf(" %d", n_ns_uri);
51118 test_xmlXPathWrapCString(void) {
51121 #if defined(LIBXML_XPATH_ENABLED)
51123 xmlXPathObjectPtr ret_val;
51124 char * val; /* the char * value */
51127 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51128 mem_base = xmlMemBlocks();
51129 val = gen_char_ptr(n_val, 0);
51131 ret_val = xmlXPathWrapCString(val);
51132 desret_xmlXPathObjectPtr(ret_val);
51134 des_char_ptr(n_val, val, 0);
51135 xmlResetLastError();
51136 if (mem_base != xmlMemBlocks()) {
51137 printf("Leak of %d blocks found in xmlXPathWrapCString",
51138 xmlMemBlocks() - mem_base);
51140 printf(" %d", n_val);
51152 test_xmlXPathWrapExternal(void) {
51155 #if defined(LIBXML_XPATH_ENABLED)
51157 xmlXPathObjectPtr ret_val;
51158 void * val; /* the user data */
51161 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51162 mem_base = xmlMemBlocks();
51163 val = gen_void_ptr(n_val, 0);
51165 ret_val = xmlXPathWrapExternal(val);
51166 desret_xmlXPathObjectPtr(ret_val);
51168 des_void_ptr(n_val, val, 0);
51169 xmlResetLastError();
51170 if (mem_base != xmlMemBlocks()) {
51171 printf("Leak of %d blocks found in xmlXPathWrapExternal",
51172 xmlMemBlocks() - mem_base);
51174 printf(" %d", n_val);
51186 test_xmlXPathWrapNodeSet(void) {
51189 #if defined(LIBXML_XPATH_ENABLED)
51191 xmlXPathObjectPtr ret_val;
51192 xmlNodeSetPtr val; /* the NodePtr value */
51195 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51196 mem_base = xmlMemBlocks();
51197 val = gen_xmlNodeSetPtr(n_val, 0);
51199 ret_val = xmlXPathWrapNodeSet(val);
51200 desret_xmlXPathObjectPtr(ret_val);
51202 des_xmlNodeSetPtr(n_val, val, 0);
51203 xmlResetLastError();
51204 if (mem_base != xmlMemBlocks()) {
51205 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51206 xmlMemBlocks() - mem_base);
51208 printf(" %d", n_val);
51220 test_xmlXPatherror(void) {
51223 #if defined(LIBXML_XPATH_ENABLED)
51225 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51227 const char * file; /* the file name */
51229 int line; /* the line number */
51231 int no; /* the error number */
51234 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51235 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51236 for (n_line = 0;n_line < gen_nb_int;n_line++) {
51237 for (n_no = 0;n_no < gen_nb_int;n_no++) {
51238 mem_base = xmlMemBlocks();
51239 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51240 file = gen_filepath(n_file, 1);
51241 line = gen_int(n_line, 2);
51242 no = gen_int(n_no, 3);
51244 xmlXPatherror(ctxt, file, line, no);
51246 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51247 des_filepath(n_file, file, 1);
51248 des_int(n_line, line, 2);
51249 des_int(n_no, no, 3);
51250 xmlResetLastError();
51251 if (mem_base != xmlMemBlocks()) {
51252 printf("Leak of %d blocks found in xmlXPatherror",
51253 xmlMemBlocks() - mem_base);
51255 printf(" %d", n_ctxt);
51256 printf(" %d", n_file);
51257 printf(" %d", n_line);
51258 printf(" %d", n_no);
51272 test_xpathInternals(void) {
51275 if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51276 test_ret += test_valuePop();
51277 test_ret += test_valuePush();
51278 test_ret += test_xmlXPathAddValues();
51279 test_ret += test_xmlXPathBooleanFunction();
51280 test_ret += test_xmlXPathCeilingFunction();
51281 test_ret += test_xmlXPathCompareValues();
51282 test_ret += test_xmlXPathConcatFunction();
51283 test_ret += test_xmlXPathContainsFunction();
51284 test_ret += test_xmlXPathCountFunction();
51285 test_ret += test_xmlXPathDebugDumpCompExpr();
51286 test_ret += test_xmlXPathDebugDumpObject();
51287 test_ret += test_xmlXPathDifference();
51288 test_ret += test_xmlXPathDistinct();
51289 test_ret += test_xmlXPathDistinctSorted();
51290 test_ret += test_xmlXPathDivValues();
51291 test_ret += test_xmlXPathEqualValues();
51292 test_ret += test_xmlXPathErr();
51293 test_ret += test_xmlXPathEvalExpr();
51294 test_ret += test_xmlXPathEvaluatePredicateResult();
51295 test_ret += test_xmlXPathFalseFunction();
51296 test_ret += test_xmlXPathFloorFunction();
51297 test_ret += test_xmlXPathFunctionLookup();
51298 test_ret += test_xmlXPathFunctionLookupNS();
51299 test_ret += test_xmlXPathHasSameNodes();
51300 test_ret += test_xmlXPathIdFunction();
51301 test_ret += test_xmlXPathIntersection();
51302 test_ret += test_xmlXPathIsNodeType();
51303 test_ret += test_xmlXPathLangFunction();
51304 test_ret += test_xmlXPathLastFunction();
51305 test_ret += test_xmlXPathLeading();
51306 test_ret += test_xmlXPathLeadingSorted();
51307 test_ret += test_xmlXPathLocalNameFunction();
51308 test_ret += test_xmlXPathModValues();
51309 test_ret += test_xmlXPathMultValues();
51310 test_ret += test_xmlXPathNamespaceURIFunction();
51311 test_ret += test_xmlXPathNewBoolean();
51312 test_ret += test_xmlXPathNewCString();
51313 test_ret += test_xmlXPathNewFloat();
51314 test_ret += test_xmlXPathNewNodeSet();
51315 test_ret += test_xmlXPathNewNodeSetList();
51316 test_ret += test_xmlXPathNewParserContext();
51317 test_ret += test_xmlXPathNewString();
51318 test_ret += test_xmlXPathNextAncestor();
51319 test_ret += test_xmlXPathNextAncestorOrSelf();
51320 test_ret += test_xmlXPathNextAttribute();
51321 test_ret += test_xmlXPathNextChild();
51322 test_ret += test_xmlXPathNextDescendant();
51323 test_ret += test_xmlXPathNextDescendantOrSelf();
51324 test_ret += test_xmlXPathNextFollowing();
51325 test_ret += test_xmlXPathNextFollowingSibling();
51326 test_ret += test_xmlXPathNextNamespace();
51327 test_ret += test_xmlXPathNextParent();
51328 test_ret += test_xmlXPathNextPreceding();
51329 test_ret += test_xmlXPathNextPrecedingSibling();
51330 test_ret += test_xmlXPathNextSelf();
51331 test_ret += test_xmlXPathNodeLeading();
51332 test_ret += test_xmlXPathNodeLeadingSorted();
51333 test_ret += test_xmlXPathNodeSetAdd();
51334 test_ret += test_xmlXPathNodeSetAddNs();
51335 test_ret += test_xmlXPathNodeSetAddUnique();
51336 test_ret += test_xmlXPathNodeSetContains();
51337 test_ret += test_xmlXPathNodeSetDel();
51338 test_ret += test_xmlXPathNodeSetMerge();
51339 test_ret += test_xmlXPathNodeSetRemove();
51340 test_ret += test_xmlXPathNodeSetSort();
51341 test_ret += test_xmlXPathNodeTrailing();
51342 test_ret += test_xmlXPathNodeTrailingSorted();
51343 test_ret += test_xmlXPathNormalizeFunction();
51344 test_ret += test_xmlXPathNotEqualValues();
51345 test_ret += test_xmlXPathNotFunction();
51346 test_ret += test_xmlXPathNsLookup();
51347 test_ret += test_xmlXPathNumberFunction();
51348 test_ret += test_xmlXPathParseNCName();
51349 test_ret += test_xmlXPathParseName();
51350 test_ret += test_xmlXPathPopBoolean();
51351 test_ret += test_xmlXPathPopExternal();
51352 test_ret += test_xmlXPathPopNodeSet();
51353 test_ret += test_xmlXPathPopNumber();
51354 test_ret += test_xmlXPathPopString();
51355 test_ret += test_xmlXPathPositionFunction();
51356 test_ret += test_xmlXPathRegisterAllFunctions();
51357 test_ret += test_xmlXPathRegisterFunc();
51358 test_ret += test_xmlXPathRegisterFuncLookup();
51359 test_ret += test_xmlXPathRegisterFuncNS();
51360 test_ret += test_xmlXPathRegisterNs();
51361 test_ret += test_xmlXPathRegisterVariable();
51362 test_ret += test_xmlXPathRegisterVariableLookup();
51363 test_ret += test_xmlXPathRegisterVariableNS();
51364 test_ret += test_xmlXPathRegisteredFuncsCleanup();
51365 test_ret += test_xmlXPathRegisteredNsCleanup();
51366 test_ret += test_xmlXPathRegisteredVariablesCleanup();
51367 test_ret += test_xmlXPathRoot();
51368 test_ret += test_xmlXPathRoundFunction();
51369 test_ret += test_xmlXPathStartsWithFunction();
51370 test_ret += test_xmlXPathStringEvalNumber();
51371 test_ret += test_xmlXPathStringFunction();
51372 test_ret += test_xmlXPathStringLengthFunction();
51373 test_ret += test_xmlXPathSubValues();
51374 test_ret += test_xmlXPathSubstringAfterFunction();
51375 test_ret += test_xmlXPathSubstringBeforeFunction();
51376 test_ret += test_xmlXPathSubstringFunction();
51377 test_ret += test_xmlXPathSumFunction();
51378 test_ret += test_xmlXPathTrailing();
51379 test_ret += test_xmlXPathTrailingSorted();
51380 test_ret += test_xmlXPathTranslateFunction();
51381 test_ret += test_xmlXPathTrueFunction();
51382 test_ret += test_xmlXPathValueFlipSign();
51383 test_ret += test_xmlXPathVariableLookup();
51384 test_ret += test_xmlXPathVariableLookupNS();
51385 test_ret += test_xmlXPathWrapCString();
51386 test_ret += test_xmlXPathWrapExternal();
51387 test_ret += test_xmlXPathWrapNodeSet();
51388 test_ret += test_xmlXPatherror();
51391 printf("Module xpathInternals: %d errors\n", test_ret);
51396 test_xmlXPtrBuildNodeList(void) {
51399 #if defined(LIBXML_XPTR_ENABLED)
51401 xmlNodePtr ret_val;
51402 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51405 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51406 mem_base = xmlMemBlocks();
51407 obj = gen_xmlXPathObjectPtr(n_obj, 0);
51409 ret_val = xmlXPtrBuildNodeList(obj);
51410 desret_xmlNodePtr(ret_val);
51412 des_xmlXPathObjectPtr(n_obj, obj, 0);
51413 xmlResetLastError();
51414 if (mem_base != xmlMemBlocks()) {
51415 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51416 xmlMemBlocks() - mem_base);
51418 printf(" %d", n_obj);
51430 test_xmlXPtrEval(void) {
51433 #if defined(LIBXML_XPTR_ENABLED)
51435 xmlXPathObjectPtr ret_val;
51436 xmlChar * str; /* the XPointer expression */
51438 xmlXPathContextPtr ctx; /* the XPointer context */
51441 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51442 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51443 mem_base = xmlMemBlocks();
51444 str = gen_const_xmlChar_ptr(n_str, 0);
51445 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51447 ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51448 desret_xmlXPathObjectPtr(ret_val);
51450 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51451 des_xmlXPathContextPtr(n_ctx, ctx, 1);
51452 xmlResetLastError();
51453 if (mem_base != xmlMemBlocks()) {
51454 printf("Leak of %d blocks found in xmlXPtrEval",
51455 xmlMemBlocks() - mem_base);
51457 printf(" %d", n_str);
51458 printf(" %d", n_ctx);
51471 test_xmlXPtrEvalRangePredicate(void) {
51474 #if defined(LIBXML_XPTR_ENABLED)
51476 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51479 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51480 mem_base = xmlMemBlocks();
51481 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51483 xmlXPtrEvalRangePredicate(ctxt);
51485 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51486 xmlResetLastError();
51487 if (mem_base != xmlMemBlocks()) {
51488 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51489 xmlMemBlocks() - mem_base);
51491 printf(" %d", n_ctxt);
51501 #ifdef LIBXML_XPTR_ENABLED
51503 #define gen_nb_xmlLocationSetPtr 1
51504 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51507 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51513 test_xmlXPtrLocationSetAdd(void) {
51516 #if defined(LIBXML_XPTR_ENABLED)
51518 xmlLocationSetPtr cur; /* the initial range set */
51520 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51523 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51524 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51525 mem_base = xmlMemBlocks();
51526 cur = gen_xmlLocationSetPtr(n_cur, 0);
51527 val = gen_xmlXPathObjectPtr(n_val, 1);
51529 xmlXPtrLocationSetAdd(cur, val);
51531 des_xmlLocationSetPtr(n_cur, cur, 0);
51532 des_xmlXPathObjectPtr(n_val, val, 1);
51533 xmlResetLastError();
51534 if (mem_base != xmlMemBlocks()) {
51535 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51536 xmlMemBlocks() - mem_base);
51538 printf(" %d", n_cur);
51539 printf(" %d", n_val);
51552 test_xmlXPtrLocationSetCreate(void) {
51556 /* missing type support */
51562 test_xmlXPtrLocationSetDel(void) {
51565 #if defined(LIBXML_XPTR_ENABLED)
51567 xmlLocationSetPtr cur; /* the initial range set */
51569 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51572 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51573 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51574 mem_base = xmlMemBlocks();
51575 cur = gen_xmlLocationSetPtr(n_cur, 0);
51576 val = gen_xmlXPathObjectPtr(n_val, 1);
51578 xmlXPtrLocationSetDel(cur, val);
51580 des_xmlLocationSetPtr(n_cur, cur, 0);
51581 des_xmlXPathObjectPtr(n_val, val, 1);
51582 xmlResetLastError();
51583 if (mem_base != xmlMemBlocks()) {
51584 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51585 xmlMemBlocks() - mem_base);
51587 printf(" %d", n_cur);
51588 printf(" %d", n_val);
51601 test_xmlXPtrLocationSetMerge(void) {
51605 /* missing type support */
51611 test_xmlXPtrLocationSetRemove(void) {
51614 #if defined(LIBXML_XPTR_ENABLED)
51616 xmlLocationSetPtr cur; /* the initial range set */
51618 int val; /* the index to remove */
51621 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51622 for (n_val = 0;n_val < gen_nb_int;n_val++) {
51623 mem_base = xmlMemBlocks();
51624 cur = gen_xmlLocationSetPtr(n_cur, 0);
51625 val = gen_int(n_val, 1);
51627 xmlXPtrLocationSetRemove(cur, val);
51629 des_xmlLocationSetPtr(n_cur, cur, 0);
51630 des_int(n_val, val, 1);
51631 xmlResetLastError();
51632 if (mem_base != xmlMemBlocks()) {
51633 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51634 xmlMemBlocks() - mem_base);
51636 printf(" %d", n_cur);
51637 printf(" %d", n_val);
51650 test_xmlXPtrNewCollapsedRange(void) {
51653 #if defined(LIBXML_XPTR_ENABLED)
51655 xmlXPathObjectPtr ret_val;
51656 xmlNodePtr start; /* the starting and ending node */
51659 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51660 mem_base = xmlMemBlocks();
51661 start = gen_xmlNodePtr(n_start, 0);
51663 ret_val = xmlXPtrNewCollapsedRange(start);
51664 desret_xmlXPathObjectPtr(ret_val);
51666 des_xmlNodePtr(n_start, start, 0);
51667 xmlResetLastError();
51668 if (mem_base != xmlMemBlocks()) {
51669 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51670 xmlMemBlocks() - mem_base);
51672 printf(" %d", n_start);
51684 test_xmlXPtrNewContext(void) {
51688 /* missing type support */
51694 test_xmlXPtrNewLocationSetNodeSet(void) {
51697 #if defined(LIBXML_XPTR_ENABLED)
51699 xmlXPathObjectPtr ret_val;
51700 xmlNodeSetPtr set; /* a node set */
51703 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51704 mem_base = xmlMemBlocks();
51705 set = gen_xmlNodeSetPtr(n_set, 0);
51707 ret_val = xmlXPtrNewLocationSetNodeSet(set);
51708 desret_xmlXPathObjectPtr(ret_val);
51710 des_xmlNodeSetPtr(n_set, set, 0);
51711 xmlResetLastError();
51712 if (mem_base != xmlMemBlocks()) {
51713 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51714 xmlMemBlocks() - mem_base);
51716 printf(" %d", n_set);
51728 test_xmlXPtrNewLocationSetNodes(void) {
51731 #if defined(LIBXML_XPTR_ENABLED)
51733 xmlXPathObjectPtr ret_val;
51734 xmlNodePtr start; /* the start NodePtr value */
51736 xmlNodePtr end; /* the end NodePtr value or NULL */
51739 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51740 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51741 mem_base = xmlMemBlocks();
51742 start = gen_xmlNodePtr(n_start, 0);
51743 end = gen_xmlNodePtr(n_end, 1);
51745 ret_val = xmlXPtrNewLocationSetNodes(start, end);
51746 desret_xmlXPathObjectPtr(ret_val);
51748 des_xmlNodePtr(n_start, start, 0);
51749 des_xmlNodePtr(n_end, end, 1);
51750 xmlResetLastError();
51751 if (mem_base != xmlMemBlocks()) {
51752 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51753 xmlMemBlocks() - mem_base);
51755 printf(" %d", n_start);
51756 printf(" %d", n_end);
51769 test_xmlXPtrNewRange(void) {
51772 #if defined(LIBXML_XPTR_ENABLED)
51774 xmlXPathObjectPtr ret_val;
51775 xmlNodePtr start; /* the starting node */
51777 int startindex; /* the start index */
51779 xmlNodePtr end; /* the ending point */
51781 int endindex; /* the ending index */
51784 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51785 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51786 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51787 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51788 mem_base = xmlMemBlocks();
51789 start = gen_xmlNodePtr(n_start, 0);
51790 startindex = gen_int(n_startindex, 1);
51791 end = gen_xmlNodePtr(n_end, 2);
51792 endindex = gen_int(n_endindex, 3);
51794 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51795 desret_xmlXPathObjectPtr(ret_val);
51797 des_xmlNodePtr(n_start, start, 0);
51798 des_int(n_startindex, startindex, 1);
51799 des_xmlNodePtr(n_end, end, 2);
51800 des_int(n_endindex, endindex, 3);
51801 xmlResetLastError();
51802 if (mem_base != xmlMemBlocks()) {
51803 printf("Leak of %d blocks found in xmlXPtrNewRange",
51804 xmlMemBlocks() - mem_base);
51806 printf(" %d", n_start);
51807 printf(" %d", n_startindex);
51808 printf(" %d", n_end);
51809 printf(" %d", n_endindex);
51824 test_xmlXPtrNewRangeNodeObject(void) {
51827 #if defined(LIBXML_XPTR_ENABLED)
51829 xmlXPathObjectPtr ret_val;
51830 xmlNodePtr start; /* the starting node */
51832 xmlXPathObjectPtr end; /* the ending object */
51835 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51836 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51837 mem_base = xmlMemBlocks();
51838 start = gen_xmlNodePtr(n_start, 0);
51839 end = gen_xmlXPathObjectPtr(n_end, 1);
51841 ret_val = xmlXPtrNewRangeNodeObject(start, end);
51842 desret_xmlXPathObjectPtr(ret_val);
51844 des_xmlNodePtr(n_start, start, 0);
51845 des_xmlXPathObjectPtr(n_end, end, 1);
51846 xmlResetLastError();
51847 if (mem_base != xmlMemBlocks()) {
51848 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51849 xmlMemBlocks() - mem_base);
51851 printf(" %d", n_start);
51852 printf(" %d", n_end);
51865 test_xmlXPtrNewRangeNodePoint(void) {
51868 #if defined(LIBXML_XPTR_ENABLED)
51870 xmlXPathObjectPtr ret_val;
51871 xmlNodePtr start; /* the starting node */
51873 xmlXPathObjectPtr end; /* the ending point */
51876 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51877 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51878 mem_base = xmlMemBlocks();
51879 start = gen_xmlNodePtr(n_start, 0);
51880 end = gen_xmlXPathObjectPtr(n_end, 1);
51882 ret_val = xmlXPtrNewRangeNodePoint(start, end);
51883 desret_xmlXPathObjectPtr(ret_val);
51885 des_xmlNodePtr(n_start, start, 0);
51886 des_xmlXPathObjectPtr(n_end, end, 1);
51887 xmlResetLastError();
51888 if (mem_base != xmlMemBlocks()) {
51889 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51890 xmlMemBlocks() - mem_base);
51892 printf(" %d", n_start);
51893 printf(" %d", n_end);
51906 test_xmlXPtrNewRangeNodes(void) {
51909 #if defined(LIBXML_XPTR_ENABLED)
51911 xmlXPathObjectPtr ret_val;
51912 xmlNodePtr start; /* the starting node */
51914 xmlNodePtr end; /* the ending node */
51917 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51918 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51919 mem_base = xmlMemBlocks();
51920 start = gen_xmlNodePtr(n_start, 0);
51921 end = gen_xmlNodePtr(n_end, 1);
51923 ret_val = xmlXPtrNewRangeNodes(start, end);
51924 desret_xmlXPathObjectPtr(ret_val);
51926 des_xmlNodePtr(n_start, start, 0);
51927 des_xmlNodePtr(n_end, end, 1);
51928 xmlResetLastError();
51929 if (mem_base != xmlMemBlocks()) {
51930 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51931 xmlMemBlocks() - mem_base);
51933 printf(" %d", n_start);
51934 printf(" %d", n_end);
51947 test_xmlXPtrNewRangePointNode(void) {
51950 #if defined(LIBXML_XPTR_ENABLED)
51952 xmlXPathObjectPtr ret_val;
51953 xmlXPathObjectPtr start; /* the starting point */
51955 xmlNodePtr end; /* the ending node */
51958 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51959 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51960 mem_base = xmlMemBlocks();
51961 start = gen_xmlXPathObjectPtr(n_start, 0);
51962 end = gen_xmlNodePtr(n_end, 1);
51964 ret_val = xmlXPtrNewRangePointNode(start, end);
51965 desret_xmlXPathObjectPtr(ret_val);
51967 des_xmlXPathObjectPtr(n_start, start, 0);
51968 des_xmlNodePtr(n_end, end, 1);
51969 xmlResetLastError();
51970 if (mem_base != xmlMemBlocks()) {
51971 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51972 xmlMemBlocks() - mem_base);
51974 printf(" %d", n_start);
51975 printf(" %d", n_end);
51988 test_xmlXPtrNewRangePoints(void) {
51991 #if defined(LIBXML_XPTR_ENABLED)
51993 xmlXPathObjectPtr ret_val;
51994 xmlXPathObjectPtr start; /* the starting point */
51996 xmlXPathObjectPtr end; /* the ending point */
51999 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52000 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52001 mem_base = xmlMemBlocks();
52002 start = gen_xmlXPathObjectPtr(n_start, 0);
52003 end = gen_xmlXPathObjectPtr(n_end, 1);
52005 ret_val = xmlXPtrNewRangePoints(start, end);
52006 desret_xmlXPathObjectPtr(ret_val);
52008 des_xmlXPathObjectPtr(n_start, start, 0);
52009 des_xmlXPathObjectPtr(n_end, end, 1);
52010 xmlResetLastError();
52011 if (mem_base != xmlMemBlocks()) {
52012 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
52013 xmlMemBlocks() - mem_base);
52015 printf(" %d", n_start);
52016 printf(" %d", n_end);
52029 test_xmlXPtrRangeToFunction(void) {
52032 #if defined(LIBXML_XPTR_ENABLED)
52034 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52036 int nargs; /* the number of args */
52039 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52040 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52041 mem_base = xmlMemBlocks();
52042 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52043 nargs = gen_int(n_nargs, 1);
52045 xmlXPtrRangeToFunction(ctxt, nargs);
52047 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52048 des_int(n_nargs, nargs, 1);
52049 xmlResetLastError();
52050 if (mem_base != xmlMemBlocks()) {
52051 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52052 xmlMemBlocks() - mem_base);
52054 printf(" %d", n_ctxt);
52055 printf(" %d", n_nargs);
52068 test_xmlXPtrWrapLocationSet(void) {
52071 #if defined(LIBXML_XPTR_ENABLED)
52073 xmlXPathObjectPtr ret_val;
52074 xmlLocationSetPtr val; /* the LocationSet value */
52077 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52078 mem_base = xmlMemBlocks();
52079 val = gen_xmlLocationSetPtr(n_val, 0);
52081 ret_val = xmlXPtrWrapLocationSet(val);
52082 desret_xmlXPathObjectPtr(ret_val);
52084 des_xmlLocationSetPtr(n_val, val, 0);
52085 xmlResetLastError();
52086 if (mem_base != xmlMemBlocks()) {
52087 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52088 xmlMemBlocks() - mem_base);
52090 printf(" %d", n_val);
52101 test_xpointer(void) {
52104 if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52105 test_ret += test_xmlXPtrBuildNodeList();
52106 test_ret += test_xmlXPtrEval();
52107 test_ret += test_xmlXPtrEvalRangePredicate();
52108 test_ret += test_xmlXPtrLocationSetAdd();
52109 test_ret += test_xmlXPtrLocationSetCreate();
52110 test_ret += test_xmlXPtrLocationSetDel();
52111 test_ret += test_xmlXPtrLocationSetMerge();
52112 test_ret += test_xmlXPtrLocationSetRemove();
52113 test_ret += test_xmlXPtrNewCollapsedRange();
52114 test_ret += test_xmlXPtrNewContext();
52115 test_ret += test_xmlXPtrNewLocationSetNodeSet();
52116 test_ret += test_xmlXPtrNewLocationSetNodes();
52117 test_ret += test_xmlXPtrNewRange();
52118 test_ret += test_xmlXPtrNewRangeNodeObject();
52119 test_ret += test_xmlXPtrNewRangeNodePoint();
52120 test_ret += test_xmlXPtrNewRangeNodes();
52121 test_ret += test_xmlXPtrNewRangePointNode();
52122 test_ret += test_xmlXPtrNewRangePoints();
52123 test_ret += test_xmlXPtrRangeToFunction();
52124 test_ret += test_xmlXPtrWrapLocationSet();
52127 printf("Module xpointer: %d errors\n", test_ret);
52131 test_module(const char *module) {
52132 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52133 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52134 if (!strcmp(module, "SAX2")) return(test_SAX2());
52135 if (!strcmp(module, "c14n")) return(test_c14n());
52136 if (!strcmp(module, "catalog")) return(test_catalog());
52137 if (!strcmp(module, "chvalid")) return(test_chvalid());
52138 if (!strcmp(module, "debugXML")) return(test_debugXML());
52139 if (!strcmp(module, "dict")) return(test_dict());
52140 if (!strcmp(module, "encoding")) return(test_encoding());
52141 if (!strcmp(module, "entities")) return(test_entities());
52142 if (!strcmp(module, "hash")) return(test_hash());
52143 if (!strcmp(module, "list")) return(test_list());
52144 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52145 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52146 if (!strcmp(module, "parser")) return(test_parser());
52147 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52148 if (!strcmp(module, "pattern")) return(test_pattern());
52149 if (!strcmp(module, "relaxng")) return(test_relaxng());
52150 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52151 if (!strcmp(module, "schematron")) return(test_schematron());
52152 if (!strcmp(module, "tree")) return(test_tree());
52153 if (!strcmp(module, "uri")) return(test_uri());
52154 if (!strcmp(module, "valid")) return(test_valid());
52155 if (!strcmp(module, "xinclude")) return(test_xinclude());
52156 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52157 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52158 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52159 if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52160 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52161 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52162 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52163 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52164 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52165 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52166 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52167 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52168 if (!strcmp(module, "xpath")) return(test_xpath());
52169 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52170 if (!strcmp(module, "xpointer")) return(test_xpointer());