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)
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)
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);
9458 test_xmlEncodeSpecialChars(void) {
9463 xmlDocPtr doc; /* the document containing the string */
9465 xmlChar * input; /* A string to convert to XML. */
9468 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9469 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9470 mem_base = xmlMemBlocks();
9471 doc = gen_xmlDocPtr(n_doc, 0);
9472 input = gen_const_xmlChar_ptr(n_input, 1);
9474 ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9475 desret_xmlChar_ptr(ret_val);
9477 des_xmlDocPtr(n_doc, doc, 0);
9478 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9479 xmlResetLastError();
9480 if (mem_base != xmlMemBlocks()) {
9481 printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9482 xmlMemBlocks() - mem_base);
9484 printf(" %d", n_doc);
9485 printf(" %d", n_input);
9497 test_xmlGetDocEntity(void) {
9501 xmlEntityPtr ret_val;
9502 xmlDocPtr doc; /* the document referencing the entity */
9504 xmlChar * name; /* the entity name */
9507 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9508 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9509 mem_base = xmlMemBlocks();
9510 doc = gen_xmlDocPtr(n_doc, 0);
9511 name = gen_const_xmlChar_ptr(n_name, 1);
9513 ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9514 desret_xmlEntityPtr(ret_val);
9516 des_xmlDocPtr(n_doc, doc, 0);
9517 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9518 xmlResetLastError();
9519 if (mem_base != xmlMemBlocks()) {
9520 printf("Leak of %d blocks found in xmlGetDocEntity",
9521 xmlMemBlocks() - mem_base);
9523 printf(" %d", n_doc);
9524 printf(" %d", n_name);
9536 test_xmlGetDtdEntity(void) {
9540 xmlEntityPtr ret_val;
9541 xmlDocPtr doc; /* the document referencing the entity */
9543 xmlChar * name; /* the entity name */
9546 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9547 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9548 mem_base = xmlMemBlocks();
9549 doc = gen_xmlDocPtr(n_doc, 0);
9550 name = gen_const_xmlChar_ptr(n_name, 1);
9552 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9553 desret_xmlEntityPtr(ret_val);
9555 des_xmlDocPtr(n_doc, doc, 0);
9556 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9557 xmlResetLastError();
9558 if (mem_base != xmlMemBlocks()) {
9559 printf("Leak of %d blocks found in xmlGetDtdEntity",
9560 xmlMemBlocks() - mem_base);
9562 printf(" %d", n_doc);
9563 printf(" %d", n_name);
9575 test_xmlGetParameterEntity(void) {
9579 xmlEntityPtr ret_val;
9580 xmlDocPtr doc; /* the document referencing the entity */
9582 xmlChar * name; /* the entity name */
9585 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9586 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9587 mem_base = xmlMemBlocks();
9588 doc = gen_xmlDocPtr(n_doc, 0);
9589 name = gen_const_xmlChar_ptr(n_name, 1);
9591 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9592 desret_xmlEntityPtr(ret_val);
9594 des_xmlDocPtr(n_doc, doc, 0);
9595 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9596 xmlResetLastError();
9597 if (mem_base != xmlMemBlocks()) {
9598 printf("Leak of %d blocks found in xmlGetParameterEntity",
9599 xmlMemBlocks() - mem_base);
9601 printf(" %d", n_doc);
9602 printf(" %d", n_name);
9614 test_xmlGetPredefinedEntity(void) {
9618 xmlEntityPtr ret_val;
9619 xmlChar * name; /* the entity name */
9622 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9623 mem_base = xmlMemBlocks();
9624 name = gen_const_xmlChar_ptr(n_name, 0);
9626 ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9627 desret_xmlEntityPtr(ret_val);
9629 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9630 xmlResetLastError();
9631 if (mem_base != xmlMemBlocks()) {
9632 printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9633 xmlMemBlocks() - mem_base);
9635 printf(" %d", n_name);
9646 test_xmlInitializePredefinedEntities(void) {
9649 #if defined(LIBXML_LEGACY_ENABLED)
9650 #ifdef LIBXML_LEGACY_ENABLED
9653 mem_base = xmlMemBlocks();
9655 xmlInitializePredefinedEntities();
9657 xmlResetLastError();
9658 if (mem_base != xmlMemBlocks()) {
9659 printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9660 xmlMemBlocks() - mem_base);
9673 test_xmlNewEntity(void) {
9677 xmlEntityPtr ret_val;
9678 xmlDocPtr doc; /* the document */
9680 xmlChar * name; /* the entity name */
9682 int type; /* the entity type XML_xxx_yyy_ENTITY */
9684 xmlChar * ExternalID; /* the entity external ID if available */
9686 xmlChar * SystemID; /* the entity system ID if available */
9688 xmlChar * content; /* the entity content */
9691 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9692 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9693 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9694 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9695 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9696 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9697 mem_base = xmlMemBlocks();
9698 doc = gen_xmlDocPtr(n_doc, 0);
9699 name = gen_const_xmlChar_ptr(n_name, 1);
9700 type = gen_int(n_type, 2);
9701 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9702 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9703 content = gen_const_xmlChar_ptr(n_content, 5);
9705 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9706 desret_xmlEntityPtr(ret_val);
9708 des_xmlDocPtr(n_doc, doc, 0);
9709 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9710 des_int(n_type, type, 2);
9711 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9712 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9713 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9714 xmlResetLastError();
9715 if (mem_base != xmlMemBlocks()) {
9716 printf("Leak of %d blocks found in xmlNewEntity",
9717 xmlMemBlocks() - mem_base);
9719 printf(" %d", n_doc);
9720 printf(" %d", n_name);
9721 printf(" %d", n_type);
9722 printf(" %d", n_ExternalID);
9723 printf(" %d", n_SystemID);
9724 printf(" %d", n_content);
9739 test_entities(void) {
9742 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9743 test_ret += test_xmlAddDocEntity();
9744 test_ret += test_xmlAddDtdEntity();
9745 test_ret += test_xmlCleanupPredefinedEntities();
9746 test_ret += test_xmlCopyEntitiesTable();
9747 test_ret += test_xmlCreateEntitiesTable();
9748 test_ret += test_xmlDumpEntitiesTable();
9749 test_ret += test_xmlDumpEntityDecl();
9750 test_ret += test_xmlEncodeEntitiesReentrant();
9751 test_ret += test_xmlEncodeSpecialChars();
9752 test_ret += test_xmlGetDocEntity();
9753 test_ret += test_xmlGetDtdEntity();
9754 test_ret += test_xmlGetParameterEntity();
9755 test_ret += test_xmlGetPredefinedEntity();
9756 test_ret += test_xmlInitializePredefinedEntities();
9757 test_ret += test_xmlNewEntity();
9760 printf("Module entities: %d errors\n", test_ret);
9765 test_xmlHashAddEntry(void) {
9770 xmlHashTablePtr table; /* the hash table */
9772 xmlChar * name; /* the name of the userdata */
9774 void * userdata; /* a pointer to the userdata */
9777 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9778 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9779 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9780 mem_base = xmlMemBlocks();
9781 table = gen_xmlHashTablePtr(n_table, 0);
9782 name = gen_const_xmlChar_ptr(n_name, 1);
9783 userdata = gen_userdata(n_userdata, 2);
9785 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9786 desret_int(ret_val);
9788 des_xmlHashTablePtr(n_table, table, 0);
9789 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9790 des_userdata(n_userdata, userdata, 2);
9791 xmlResetLastError();
9792 if (mem_base != xmlMemBlocks()) {
9793 printf("Leak of %d blocks found in xmlHashAddEntry",
9794 xmlMemBlocks() - mem_base);
9796 printf(" %d", n_table);
9797 printf(" %d", n_name);
9798 printf(" %d", n_userdata);
9811 test_xmlHashAddEntry2(void) {
9816 xmlHashTablePtr table; /* the hash table */
9818 xmlChar * name; /* the name of the userdata */
9820 xmlChar * name2; /* a second name of the userdata */
9822 void * userdata; /* a pointer to the userdata */
9825 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9826 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9827 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9828 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9829 mem_base = xmlMemBlocks();
9830 table = gen_xmlHashTablePtr(n_table, 0);
9831 name = gen_const_xmlChar_ptr(n_name, 1);
9832 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9833 userdata = gen_userdata(n_userdata, 3);
9835 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9836 desret_int(ret_val);
9838 des_xmlHashTablePtr(n_table, table, 0);
9839 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9840 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9841 des_userdata(n_userdata, userdata, 3);
9842 xmlResetLastError();
9843 if (mem_base != xmlMemBlocks()) {
9844 printf("Leak of %d blocks found in xmlHashAddEntry2",
9845 xmlMemBlocks() - mem_base);
9847 printf(" %d", n_table);
9848 printf(" %d", n_name);
9849 printf(" %d", n_name2);
9850 printf(" %d", n_userdata);
9864 test_xmlHashAddEntry3(void) {
9869 xmlHashTablePtr table; /* the hash table */
9871 xmlChar * name; /* the name of the userdata */
9873 xmlChar * name2; /* a second name of the userdata */
9875 xmlChar * name3; /* a third name of the userdata */
9877 void * userdata; /* a pointer to the userdata */
9880 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9881 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9882 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9883 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9884 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9885 mem_base = xmlMemBlocks();
9886 table = gen_xmlHashTablePtr(n_table, 0);
9887 name = gen_const_xmlChar_ptr(n_name, 1);
9888 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9889 name3 = gen_const_xmlChar_ptr(n_name3, 3);
9890 userdata = gen_userdata(n_userdata, 4);
9892 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9893 desret_int(ret_val);
9895 des_xmlHashTablePtr(n_table, table, 0);
9896 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9897 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9898 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9899 des_userdata(n_userdata, userdata, 4);
9900 xmlResetLastError();
9901 if (mem_base != xmlMemBlocks()) {
9902 printf("Leak of %d blocks found in xmlHashAddEntry3",
9903 xmlMemBlocks() - mem_base);
9905 printf(" %d", n_table);
9906 printf(" %d", n_name);
9907 printf(" %d", n_name2);
9908 printf(" %d", n_name3);
9909 printf(" %d", n_userdata);
9924 test_xmlHashCopy(void) {
9928 /* missing type support */
9934 test_xmlHashCreate(void) {
9938 /* missing type support */
9944 test_xmlHashCreateDict(void) {
9948 /* missing type support */
9954 test_xmlHashLookup(void) {
9959 xmlHashTablePtr table; /* the hash table */
9961 xmlChar * name; /* the name of the userdata */
9964 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9965 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9966 mem_base = xmlMemBlocks();
9967 table = gen_xmlHashTablePtr(n_table, 0);
9968 name = gen_const_xmlChar_ptr(n_name, 1);
9970 ret_val = xmlHashLookup(table, (const xmlChar *)name);
9971 desret_void_ptr(ret_val);
9973 des_xmlHashTablePtr(n_table, table, 0);
9974 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9975 xmlResetLastError();
9976 if (mem_base != xmlMemBlocks()) {
9977 printf("Leak of %d blocks found in xmlHashLookup",
9978 xmlMemBlocks() - mem_base);
9980 printf(" %d", n_table);
9981 printf(" %d", n_name);
9993 test_xmlHashLookup2(void) {
9998 xmlHashTablePtr table; /* the hash table */
10000 xmlChar * name; /* the name of the userdata */
10002 xmlChar * name2; /* a second name of the userdata */
10005 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10006 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10007 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10008 mem_base = xmlMemBlocks();
10009 table = gen_xmlHashTablePtr(n_table, 0);
10010 name = gen_const_xmlChar_ptr(n_name, 1);
10011 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10013 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10014 desret_void_ptr(ret_val);
10016 des_xmlHashTablePtr(n_table, table, 0);
10017 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10018 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10019 xmlResetLastError();
10020 if (mem_base != xmlMemBlocks()) {
10021 printf("Leak of %d blocks found in xmlHashLookup2",
10022 xmlMemBlocks() - mem_base);
10024 printf(" %d", n_table);
10025 printf(" %d", n_name);
10026 printf(" %d", n_name2);
10039 test_xmlHashLookup3(void) {
10044 xmlHashTablePtr table; /* the hash table */
10046 xmlChar * name; /* the name of the userdata */
10048 xmlChar * name2; /* a second name of the userdata */
10050 xmlChar * name3; /* a third name of the userdata */
10053 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10054 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10055 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10056 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10057 mem_base = xmlMemBlocks();
10058 table = gen_xmlHashTablePtr(n_table, 0);
10059 name = gen_const_xmlChar_ptr(n_name, 1);
10060 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10061 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10063 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10064 desret_void_ptr(ret_val);
10066 des_xmlHashTablePtr(n_table, table, 0);
10067 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10068 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10069 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10070 xmlResetLastError();
10071 if (mem_base != xmlMemBlocks()) {
10072 printf("Leak of %d blocks found in xmlHashLookup3",
10073 xmlMemBlocks() - mem_base);
10075 printf(" %d", n_table);
10076 printf(" %d", n_name);
10077 printf(" %d", n_name2);
10078 printf(" %d", n_name3);
10092 test_xmlHashQLookup(void) {
10097 xmlHashTablePtr table; /* the hash table */
10099 xmlChar * prefix; /* the prefix of the userdata */
10101 xmlChar * name; /* the name of the userdata */
10104 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10105 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10106 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10107 mem_base = xmlMemBlocks();
10108 table = gen_xmlHashTablePtr(n_table, 0);
10109 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10110 name = gen_const_xmlChar_ptr(n_name, 2);
10112 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10113 desret_void_ptr(ret_val);
10115 des_xmlHashTablePtr(n_table, table, 0);
10116 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10117 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10118 xmlResetLastError();
10119 if (mem_base != xmlMemBlocks()) {
10120 printf("Leak of %d blocks found in xmlHashQLookup",
10121 xmlMemBlocks() - mem_base);
10123 printf(" %d", n_table);
10124 printf(" %d", n_prefix);
10125 printf(" %d", n_name);
10138 test_xmlHashQLookup2(void) {
10143 xmlHashTablePtr table; /* the hash table */
10145 xmlChar * prefix; /* the prefix of the userdata */
10147 xmlChar * name; /* the name of the userdata */
10149 xmlChar * prefix2; /* the second prefix of the userdata */
10151 xmlChar * name2; /* a second name of the userdata */
10154 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10155 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10156 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10157 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10158 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10159 mem_base = xmlMemBlocks();
10160 table = gen_xmlHashTablePtr(n_table, 0);
10161 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10162 name = gen_const_xmlChar_ptr(n_name, 2);
10163 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10164 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10166 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10167 desret_void_ptr(ret_val);
10169 des_xmlHashTablePtr(n_table, table, 0);
10170 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10171 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10172 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10173 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10174 xmlResetLastError();
10175 if (mem_base != xmlMemBlocks()) {
10176 printf("Leak of %d blocks found in xmlHashQLookup2",
10177 xmlMemBlocks() - mem_base);
10179 printf(" %d", n_table);
10180 printf(" %d", n_prefix);
10181 printf(" %d", n_name);
10182 printf(" %d", n_prefix2);
10183 printf(" %d", n_name2);
10198 test_xmlHashQLookup3(void) {
10203 xmlHashTablePtr table; /* the hash table */
10205 xmlChar * prefix; /* the prefix of the userdata */
10207 xmlChar * name; /* the name of the userdata */
10209 xmlChar * prefix2; /* the second prefix of the userdata */
10211 xmlChar * name2; /* a second name of the userdata */
10213 xmlChar * prefix3; /* the third prefix of the userdata */
10215 xmlChar * name3; /* a third name of the userdata */
10218 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10219 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10220 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10221 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10222 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10223 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10224 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10225 mem_base = xmlMemBlocks();
10226 table = gen_xmlHashTablePtr(n_table, 0);
10227 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10228 name = gen_const_xmlChar_ptr(n_name, 2);
10229 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10230 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10231 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10232 name3 = gen_const_xmlChar_ptr(n_name3, 6);
10234 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10235 desret_void_ptr(ret_val);
10237 des_xmlHashTablePtr(n_table, table, 0);
10238 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10239 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10240 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10241 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10242 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10243 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10244 xmlResetLastError();
10245 if (mem_base != xmlMemBlocks()) {
10246 printf("Leak of %d blocks found in xmlHashQLookup3",
10247 xmlMemBlocks() - mem_base);
10249 printf(" %d", n_table);
10250 printf(" %d", n_prefix);
10251 printf(" %d", n_name);
10252 printf(" %d", n_prefix2);
10253 printf(" %d", n_name2);
10254 printf(" %d", n_prefix3);
10255 printf(" %d", n_name3);
10272 test_xmlHashRemoveEntry(void) {
10277 xmlHashTablePtr table; /* the hash table */
10279 xmlChar * name; /* the name of the userdata */
10281 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10284 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10285 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10286 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10287 mem_base = xmlMemBlocks();
10288 table = gen_xmlHashTablePtr(n_table, 0);
10289 name = gen_const_xmlChar_ptr(n_name, 1);
10290 f = gen_xmlHashDeallocator(n_f, 2);
10292 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10293 desret_int(ret_val);
10295 des_xmlHashTablePtr(n_table, table, 0);
10296 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10297 des_xmlHashDeallocator(n_f, f, 2);
10298 xmlResetLastError();
10299 if (mem_base != xmlMemBlocks()) {
10300 printf("Leak of %d blocks found in xmlHashRemoveEntry",
10301 xmlMemBlocks() - mem_base);
10303 printf(" %d", n_table);
10304 printf(" %d", n_name);
10305 printf(" %d", n_f);
10318 test_xmlHashRemoveEntry2(void) {
10323 xmlHashTablePtr table; /* the hash table */
10325 xmlChar * name; /* the name of the userdata */
10327 xmlChar * name2; /* a second name of the userdata */
10329 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10332 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10333 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10334 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10335 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10336 mem_base = xmlMemBlocks();
10337 table = gen_xmlHashTablePtr(n_table, 0);
10338 name = gen_const_xmlChar_ptr(n_name, 1);
10339 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10340 f = gen_xmlHashDeallocator(n_f, 3);
10342 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10343 desret_int(ret_val);
10345 des_xmlHashTablePtr(n_table, table, 0);
10346 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10347 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10348 des_xmlHashDeallocator(n_f, f, 3);
10349 xmlResetLastError();
10350 if (mem_base != xmlMemBlocks()) {
10351 printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10352 xmlMemBlocks() - mem_base);
10354 printf(" %d", n_table);
10355 printf(" %d", n_name);
10356 printf(" %d", n_name2);
10357 printf(" %d", n_f);
10371 test_xmlHashRemoveEntry3(void) {
10376 xmlHashTablePtr table; /* the hash table */
10378 xmlChar * name; /* the name of the userdata */
10380 xmlChar * name2; /* a second name of the userdata */
10382 xmlChar * name3; /* a third name of the userdata */
10384 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10387 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10388 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10389 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10390 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10391 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10392 mem_base = xmlMemBlocks();
10393 table = gen_xmlHashTablePtr(n_table, 0);
10394 name = gen_const_xmlChar_ptr(n_name, 1);
10395 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10396 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10397 f = gen_xmlHashDeallocator(n_f, 4);
10399 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10400 desret_int(ret_val);
10402 des_xmlHashTablePtr(n_table, table, 0);
10403 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10404 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10405 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10406 des_xmlHashDeallocator(n_f, f, 4);
10407 xmlResetLastError();
10408 if (mem_base != xmlMemBlocks()) {
10409 printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10410 xmlMemBlocks() - mem_base);
10412 printf(" %d", n_table);
10413 printf(" %d", n_name);
10414 printf(" %d", n_name2);
10415 printf(" %d", n_name3);
10416 printf(" %d", n_f);
10431 test_xmlHashScan(void) {
10435 /* missing type support */
10441 test_xmlHashScan3(void) {
10445 /* missing type support */
10451 test_xmlHashScanFull(void) {
10455 /* missing type support */
10461 test_xmlHashScanFull3(void) {
10465 /* missing type support */
10471 test_xmlHashSize(void) {
10476 xmlHashTablePtr table; /* the hash table */
10479 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10480 mem_base = xmlMemBlocks();
10481 table = gen_xmlHashTablePtr(n_table, 0);
10483 ret_val = xmlHashSize(table);
10484 desret_int(ret_val);
10486 des_xmlHashTablePtr(n_table, table, 0);
10487 xmlResetLastError();
10488 if (mem_base != xmlMemBlocks()) {
10489 printf("Leak of %d blocks found in xmlHashSize",
10490 xmlMemBlocks() - mem_base);
10492 printf(" %d", n_table);
10503 test_xmlHashUpdateEntry(void) {
10508 xmlHashTablePtr table; /* the hash table */
10510 xmlChar * name; /* the name of the userdata */
10512 void * userdata; /* a pointer to the userdata */
10514 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10517 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10518 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10519 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10520 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10521 mem_base = xmlMemBlocks();
10522 table = gen_xmlHashTablePtr(n_table, 0);
10523 name = gen_const_xmlChar_ptr(n_name, 1);
10524 userdata = gen_userdata(n_userdata, 2);
10525 f = gen_xmlHashDeallocator(n_f, 3);
10527 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10528 desret_int(ret_val);
10530 des_xmlHashTablePtr(n_table, table, 0);
10531 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10532 des_userdata(n_userdata, userdata, 2);
10533 des_xmlHashDeallocator(n_f, f, 3);
10534 xmlResetLastError();
10535 if (mem_base != xmlMemBlocks()) {
10536 printf("Leak of %d blocks found in xmlHashUpdateEntry",
10537 xmlMemBlocks() - mem_base);
10539 printf(" %d", n_table);
10540 printf(" %d", n_name);
10541 printf(" %d", n_userdata);
10542 printf(" %d", n_f);
10556 test_xmlHashUpdateEntry2(void) {
10561 xmlHashTablePtr table; /* the hash table */
10563 xmlChar * name; /* the name of the userdata */
10565 xmlChar * name2; /* a second name of the userdata */
10567 void * userdata; /* a pointer to the userdata */
10569 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10572 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10573 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10574 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10575 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10576 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10577 mem_base = xmlMemBlocks();
10578 table = gen_xmlHashTablePtr(n_table, 0);
10579 name = gen_const_xmlChar_ptr(n_name, 1);
10580 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10581 userdata = gen_userdata(n_userdata, 3);
10582 f = gen_xmlHashDeallocator(n_f, 4);
10584 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10585 desret_int(ret_val);
10587 des_xmlHashTablePtr(n_table, table, 0);
10588 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10589 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10590 des_userdata(n_userdata, userdata, 3);
10591 des_xmlHashDeallocator(n_f, f, 4);
10592 xmlResetLastError();
10593 if (mem_base != xmlMemBlocks()) {
10594 printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10595 xmlMemBlocks() - mem_base);
10597 printf(" %d", n_table);
10598 printf(" %d", n_name);
10599 printf(" %d", n_name2);
10600 printf(" %d", n_userdata);
10601 printf(" %d", n_f);
10616 test_xmlHashUpdateEntry3(void) {
10621 xmlHashTablePtr table; /* the hash table */
10623 xmlChar * name; /* the name of the userdata */
10625 xmlChar * name2; /* a second name of the userdata */
10627 xmlChar * name3; /* a third name of the userdata */
10629 void * userdata; /* a pointer to the userdata */
10631 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10634 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10635 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10636 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10637 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10638 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10639 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10640 mem_base = xmlMemBlocks();
10641 table = gen_xmlHashTablePtr(n_table, 0);
10642 name = gen_const_xmlChar_ptr(n_name, 1);
10643 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10644 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10645 userdata = gen_userdata(n_userdata, 4);
10646 f = gen_xmlHashDeallocator(n_f, 5);
10648 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10649 desret_int(ret_val);
10651 des_xmlHashTablePtr(n_table, table, 0);
10652 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10653 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10654 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10655 des_userdata(n_userdata, userdata, 4);
10656 des_xmlHashDeallocator(n_f, f, 5);
10657 xmlResetLastError();
10658 if (mem_base != xmlMemBlocks()) {
10659 printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10660 xmlMemBlocks() - mem_base);
10662 printf(" %d", n_table);
10663 printf(" %d", n_name);
10664 printf(" %d", n_name2);
10665 printf(" %d", n_name3);
10666 printf(" %d", n_userdata);
10667 printf(" %d", n_f);
10685 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10686 test_ret += test_xmlHashAddEntry();
10687 test_ret += test_xmlHashAddEntry2();
10688 test_ret += test_xmlHashAddEntry3();
10689 test_ret += test_xmlHashCopy();
10690 test_ret += test_xmlHashCreate();
10691 test_ret += test_xmlHashCreateDict();
10692 test_ret += test_xmlHashLookup();
10693 test_ret += test_xmlHashLookup2();
10694 test_ret += test_xmlHashLookup3();
10695 test_ret += test_xmlHashQLookup();
10696 test_ret += test_xmlHashQLookup2();
10697 test_ret += test_xmlHashQLookup3();
10698 test_ret += test_xmlHashRemoveEntry();
10699 test_ret += test_xmlHashRemoveEntry2();
10700 test_ret += test_xmlHashRemoveEntry3();
10701 test_ret += test_xmlHashScan();
10702 test_ret += test_xmlHashScan3();
10703 test_ret += test_xmlHashScanFull();
10704 test_ret += test_xmlHashScanFull3();
10705 test_ret += test_xmlHashSize();
10706 test_ret += test_xmlHashUpdateEntry();
10707 test_ret += test_xmlHashUpdateEntry2();
10708 test_ret += test_xmlHashUpdateEntry3();
10711 printf("Module hash: %d errors\n", test_ret);
10715 #define gen_nb_xmlLinkPtr 1
10716 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10719 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10723 test_xmlLinkGetData(void) {
10728 xmlLinkPtr lk; /* a link */
10731 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10732 mem_base = xmlMemBlocks();
10733 lk = gen_xmlLinkPtr(n_lk, 0);
10735 ret_val = xmlLinkGetData(lk);
10736 desret_void_ptr(ret_val);
10738 des_xmlLinkPtr(n_lk, lk, 0);
10739 xmlResetLastError();
10740 if (mem_base != xmlMemBlocks()) {
10741 printf("Leak of %d blocks found in xmlLinkGetData",
10742 xmlMemBlocks() - mem_base);
10744 printf(" %d", n_lk);
10755 test_xmlListAppend(void) {
10760 xmlListPtr l; /* a list */
10762 void * data; /* the data */
10765 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10766 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10767 mem_base = xmlMemBlocks();
10768 l = gen_xmlListPtr(n_l, 0);
10769 data = gen_userdata(n_data, 1);
10771 ret_val = xmlListAppend(l, data);
10772 desret_int(ret_val);
10774 des_xmlListPtr(n_l, l, 0);
10775 des_userdata(n_data, data, 1);
10776 xmlResetLastError();
10777 if (mem_base != xmlMemBlocks()) {
10778 printf("Leak of %d blocks found in xmlListAppend",
10779 xmlMemBlocks() - mem_base);
10781 printf(" %d", n_l);
10782 printf(" %d", n_data);
10794 test_xmlListClear(void) {
10798 xmlListPtr l; /* a list */
10801 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10802 mem_base = xmlMemBlocks();
10803 l = gen_xmlListPtr(n_l, 0);
10807 des_xmlListPtr(n_l, l, 0);
10808 xmlResetLastError();
10809 if (mem_base != xmlMemBlocks()) {
10810 printf("Leak of %d blocks found in xmlListClear",
10811 xmlMemBlocks() - mem_base);
10813 printf(" %d", n_l);
10823 #define gen_nb_const_xmlListPtr 1
10824 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10827 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10831 test_xmlListCopy(void) {
10836 xmlListPtr cur; /* the new list */
10838 xmlListPtr old; /* the old list */
10841 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10842 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10843 mem_base = xmlMemBlocks();
10844 cur = gen_xmlListPtr(n_cur, 0);
10845 old = gen_const_xmlListPtr(n_old, 1);
10847 ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10848 desret_int(ret_val);
10850 des_xmlListPtr(n_cur, cur, 0);
10851 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10852 xmlResetLastError();
10853 if (mem_base != xmlMemBlocks()) {
10854 printf("Leak of %d blocks found in xmlListCopy",
10855 xmlMemBlocks() - mem_base);
10857 printf(" %d", n_cur);
10858 printf(" %d", n_old);
10870 test_xmlListCreate(void) {
10874 /* missing type support */
10880 test_xmlListDup(void) {
10884 /* missing type support */
10890 test_xmlListEmpty(void) {
10895 xmlListPtr l; /* a list */
10898 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10899 mem_base = xmlMemBlocks();
10900 l = gen_xmlListPtr(n_l, 0);
10902 ret_val = xmlListEmpty(l);
10903 desret_int(ret_val);
10905 des_xmlListPtr(n_l, l, 0);
10906 xmlResetLastError();
10907 if (mem_base != xmlMemBlocks()) {
10908 printf("Leak of %d blocks found in xmlListEmpty",
10909 xmlMemBlocks() - mem_base);
10911 printf(" %d", n_l);
10922 test_xmlListEnd(void) {
10926 /* missing type support */
10932 test_xmlListFront(void) {
10936 /* missing type support */
10942 test_xmlListInsert(void) {
10947 xmlListPtr l; /* a list */
10949 void * data; /* the data */
10952 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10953 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10954 mem_base = xmlMemBlocks();
10955 l = gen_xmlListPtr(n_l, 0);
10956 data = gen_userdata(n_data, 1);
10958 ret_val = xmlListInsert(l, data);
10959 desret_int(ret_val);
10961 des_xmlListPtr(n_l, l, 0);
10962 des_userdata(n_data, data, 1);
10963 xmlResetLastError();
10964 if (mem_base != xmlMemBlocks()) {
10965 printf("Leak of %d blocks found in xmlListInsert",
10966 xmlMemBlocks() - mem_base);
10968 printf(" %d", n_l);
10969 printf(" %d", n_data);
10981 test_xmlListMerge(void) {
10985 xmlListPtr l1; /* the original list */
10987 xmlListPtr l2; /* the new list */
10990 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10991 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10992 mem_base = xmlMemBlocks();
10993 l1 = gen_xmlListPtr(n_l1, 0);
10994 l2 = gen_xmlListPtr(n_l2, 1);
10996 xmlListMerge(l1, l2);
10998 des_xmlListPtr(n_l1, l1, 0);
10999 des_xmlListPtr(n_l2, l2, 1);
11000 xmlResetLastError();
11001 if (mem_base != xmlMemBlocks()) {
11002 printf("Leak of %d blocks found in xmlListMerge",
11003 xmlMemBlocks() - mem_base);
11005 printf(" %d", n_l1);
11006 printf(" %d", n_l2);
11018 test_xmlListPopBack(void) {
11022 xmlListPtr l; /* a list */
11025 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11026 mem_base = xmlMemBlocks();
11027 l = gen_xmlListPtr(n_l, 0);
11031 des_xmlListPtr(n_l, l, 0);
11032 xmlResetLastError();
11033 if (mem_base != xmlMemBlocks()) {
11034 printf("Leak of %d blocks found in xmlListPopBack",
11035 xmlMemBlocks() - mem_base);
11037 printf(" %d", n_l);
11048 test_xmlListPopFront(void) {
11052 xmlListPtr l; /* a list */
11055 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11056 mem_base = xmlMemBlocks();
11057 l = gen_xmlListPtr(n_l, 0);
11059 xmlListPopFront(l);
11061 des_xmlListPtr(n_l, l, 0);
11062 xmlResetLastError();
11063 if (mem_base != xmlMemBlocks()) {
11064 printf("Leak of %d blocks found in xmlListPopFront",
11065 xmlMemBlocks() - mem_base);
11067 printf(" %d", n_l);
11078 test_xmlListPushBack(void) {
11083 xmlListPtr l; /* a list */
11085 void * data; /* new data */
11088 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11089 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11090 mem_base = xmlMemBlocks();
11091 l = gen_xmlListPtr(n_l, 0);
11092 data = gen_userdata(n_data, 1);
11094 ret_val = xmlListPushBack(l, data);
11095 desret_int(ret_val);
11097 des_xmlListPtr(n_l, l, 0);
11098 des_userdata(n_data, data, 1);
11099 xmlResetLastError();
11100 if (mem_base != xmlMemBlocks()) {
11101 printf("Leak of %d blocks found in xmlListPushBack",
11102 xmlMemBlocks() - mem_base);
11104 printf(" %d", n_l);
11105 printf(" %d", n_data);
11117 test_xmlListPushFront(void) {
11122 xmlListPtr l; /* a list */
11124 void * data; /* new data */
11127 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11128 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11129 mem_base = xmlMemBlocks();
11130 l = gen_xmlListPtr(n_l, 0);
11131 data = gen_userdata(n_data, 1);
11133 ret_val = xmlListPushFront(l, data);
11134 desret_int(ret_val);
11136 des_xmlListPtr(n_l, l, 0);
11137 des_userdata(n_data, data, 1);
11138 xmlResetLastError();
11139 if (mem_base != xmlMemBlocks()) {
11140 printf("Leak of %d blocks found in xmlListPushFront",
11141 xmlMemBlocks() - mem_base);
11143 printf(" %d", n_l);
11144 printf(" %d", n_data);
11156 test_xmlListRemoveAll(void) {
11161 xmlListPtr l; /* a list */
11163 void * data; /* list data */
11166 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11167 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11168 mem_base = xmlMemBlocks();
11169 l = gen_xmlListPtr(n_l, 0);
11170 data = gen_userdata(n_data, 1);
11172 ret_val = xmlListRemoveAll(l, data);
11173 desret_int(ret_val);
11175 des_xmlListPtr(n_l, l, 0);
11176 des_userdata(n_data, data, 1);
11177 xmlResetLastError();
11178 if (mem_base != xmlMemBlocks()) {
11179 printf("Leak of %d blocks found in xmlListRemoveAll",
11180 xmlMemBlocks() - mem_base);
11182 printf(" %d", n_l);
11183 printf(" %d", n_data);
11195 test_xmlListRemoveFirst(void) {
11200 xmlListPtr l; /* a list */
11202 void * data; /* list data */
11205 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11206 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11207 mem_base = xmlMemBlocks();
11208 l = gen_xmlListPtr(n_l, 0);
11209 data = gen_userdata(n_data, 1);
11211 ret_val = xmlListRemoveFirst(l, data);
11212 desret_int(ret_val);
11214 des_xmlListPtr(n_l, l, 0);
11215 des_userdata(n_data, data, 1);
11216 xmlResetLastError();
11217 if (mem_base != xmlMemBlocks()) {
11218 printf("Leak of %d blocks found in xmlListRemoveFirst",
11219 xmlMemBlocks() - mem_base);
11221 printf(" %d", n_l);
11222 printf(" %d", n_data);
11234 test_xmlListRemoveLast(void) {
11239 xmlListPtr l; /* a list */
11241 void * data; /* list data */
11244 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11245 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11246 mem_base = xmlMemBlocks();
11247 l = gen_xmlListPtr(n_l, 0);
11248 data = gen_userdata(n_data, 1);
11250 ret_val = xmlListRemoveLast(l, data);
11251 desret_int(ret_val);
11253 des_xmlListPtr(n_l, l, 0);
11254 des_userdata(n_data, data, 1);
11255 xmlResetLastError();
11256 if (mem_base != xmlMemBlocks()) {
11257 printf("Leak of %d blocks found in xmlListRemoveLast",
11258 xmlMemBlocks() - mem_base);
11260 printf(" %d", n_l);
11261 printf(" %d", n_data);
11273 test_xmlListReverse(void) {
11277 xmlListPtr l; /* a list */
11280 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11281 mem_base = xmlMemBlocks();
11282 l = gen_xmlListPtr(n_l, 0);
11286 des_xmlListPtr(n_l, l, 0);
11287 xmlResetLastError();
11288 if (mem_base != xmlMemBlocks()) {
11289 printf("Leak of %d blocks found in xmlListReverse",
11290 xmlMemBlocks() - mem_base);
11292 printf(" %d", n_l);
11303 test_xmlListReverseSearch(void) {
11308 xmlListPtr l; /* a list */
11310 void * data; /* a search value */
11313 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11314 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11315 mem_base = xmlMemBlocks();
11316 l = gen_xmlListPtr(n_l, 0);
11317 data = gen_userdata(n_data, 1);
11319 ret_val = xmlListReverseSearch(l, data);
11320 desret_void_ptr(ret_val);
11322 des_xmlListPtr(n_l, l, 0);
11323 des_userdata(n_data, data, 1);
11324 xmlResetLastError();
11325 if (mem_base != xmlMemBlocks()) {
11326 printf("Leak of %d blocks found in xmlListReverseSearch",
11327 xmlMemBlocks() - mem_base);
11329 printf(" %d", n_l);
11330 printf(" %d", n_data);
11342 test_xmlListReverseWalk(void) {
11346 /* missing type support */
11352 test_xmlListSearch(void) {
11357 xmlListPtr l; /* a list */
11359 void * data; /* a search value */
11362 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11363 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11364 mem_base = xmlMemBlocks();
11365 l = gen_xmlListPtr(n_l, 0);
11366 data = gen_userdata(n_data, 1);
11368 ret_val = xmlListSearch(l, data);
11369 desret_void_ptr(ret_val);
11371 des_xmlListPtr(n_l, l, 0);
11372 des_userdata(n_data, data, 1);
11373 xmlResetLastError();
11374 if (mem_base != xmlMemBlocks()) {
11375 printf("Leak of %d blocks found in xmlListSearch",
11376 xmlMemBlocks() - mem_base);
11378 printf(" %d", n_l);
11379 printf(" %d", n_data);
11391 test_xmlListSize(void) {
11396 xmlListPtr l; /* a list */
11399 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11400 mem_base = xmlMemBlocks();
11401 l = gen_xmlListPtr(n_l, 0);
11403 ret_val = xmlListSize(l);
11404 desret_int(ret_val);
11406 des_xmlListPtr(n_l, l, 0);
11407 xmlResetLastError();
11408 if (mem_base != xmlMemBlocks()) {
11409 printf("Leak of %d blocks found in xmlListSize",
11410 xmlMemBlocks() - mem_base);
11412 printf(" %d", n_l);
11423 test_xmlListSort(void) {
11427 xmlListPtr l; /* a list */
11430 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11431 mem_base = xmlMemBlocks();
11432 l = gen_xmlListPtr(n_l, 0);
11436 des_xmlListPtr(n_l, l, 0);
11437 xmlResetLastError();
11438 if (mem_base != xmlMemBlocks()) {
11439 printf("Leak of %d blocks found in xmlListSort",
11440 xmlMemBlocks() - mem_base);
11442 printf(" %d", n_l);
11453 test_xmlListWalk(void) {
11457 /* missing type support */
11465 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11466 test_ret += test_xmlLinkGetData();
11467 test_ret += test_xmlListAppend();
11468 test_ret += test_xmlListClear();
11469 test_ret += test_xmlListCopy();
11470 test_ret += test_xmlListCreate();
11471 test_ret += test_xmlListDup();
11472 test_ret += test_xmlListEmpty();
11473 test_ret += test_xmlListEnd();
11474 test_ret += test_xmlListFront();
11475 test_ret += test_xmlListInsert();
11476 test_ret += test_xmlListMerge();
11477 test_ret += test_xmlListPopBack();
11478 test_ret += test_xmlListPopFront();
11479 test_ret += test_xmlListPushBack();
11480 test_ret += test_xmlListPushFront();
11481 test_ret += test_xmlListRemoveAll();
11482 test_ret += test_xmlListRemoveFirst();
11483 test_ret += test_xmlListRemoveLast();
11484 test_ret += test_xmlListReverse();
11485 test_ret += test_xmlListReverseSearch();
11486 test_ret += test_xmlListReverseWalk();
11487 test_ret += test_xmlListSearch();
11488 test_ret += test_xmlListSize();
11489 test_ret += test_xmlListSort();
11490 test_ret += test_xmlListWalk();
11493 printf("Module list: %d errors\n", test_ret);
11498 test_xmlNanoFTPCheckResponse(void) {
11501 #if defined(LIBXML_FTP_ENABLED)
11504 void * ctx; /* an FTP context */
11507 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11508 mem_base = xmlMemBlocks();
11509 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11511 ret_val = xmlNanoFTPCheckResponse(ctx);
11512 desret_int(ret_val);
11514 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11515 xmlResetLastError();
11516 if (mem_base != xmlMemBlocks()) {
11517 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11518 xmlMemBlocks() - mem_base);
11520 printf(" %d", n_ctx);
11532 test_xmlNanoFTPCleanup(void) {
11535 #if defined(LIBXML_FTP_ENABLED)
11538 mem_base = xmlMemBlocks();
11540 xmlNanoFTPCleanup();
11542 xmlResetLastError();
11543 if (mem_base != xmlMemBlocks()) {
11544 printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11545 xmlMemBlocks() - mem_base);
11557 test_xmlNanoFTPCloseConnection(void) {
11560 #if defined(LIBXML_FTP_ENABLED)
11563 void * ctx; /* an FTP context */
11566 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11567 mem_base = xmlMemBlocks();
11568 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11570 ret_val = xmlNanoFTPCloseConnection(ctx);
11571 desret_int(ret_val);
11573 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11574 xmlResetLastError();
11575 if (mem_base != xmlMemBlocks()) {
11576 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11577 xmlMemBlocks() - mem_base);
11579 printf(" %d", n_ctx);
11591 test_xmlNanoFTPCwd(void) {
11594 #if defined(LIBXML_FTP_ENABLED)
11597 void * ctx; /* an FTP context */
11599 char * directory; /* a directory on the server */
11602 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11603 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11604 mem_base = xmlMemBlocks();
11605 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11606 directory = gen_const_char_ptr(n_directory, 1);
11608 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11609 desret_int(ret_val);
11611 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11612 des_const_char_ptr(n_directory, (const char *)directory, 1);
11613 xmlResetLastError();
11614 if (mem_base != xmlMemBlocks()) {
11615 printf("Leak of %d blocks found in xmlNanoFTPCwd",
11616 xmlMemBlocks() - mem_base);
11618 printf(" %d", n_ctx);
11619 printf(" %d", n_directory);
11632 test_xmlNanoFTPDele(void) {
11635 #if defined(LIBXML_FTP_ENABLED)
11638 void * ctx; /* an FTP context */
11640 const char * file; /* a file or directory on the server */
11643 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11644 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11645 mem_base = xmlMemBlocks();
11646 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11647 file = gen_filepath(n_file, 1);
11649 ret_val = xmlNanoFTPDele(ctx, file);
11650 desret_int(ret_val);
11652 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11653 des_filepath(n_file, file, 1);
11654 xmlResetLastError();
11655 if (mem_base != xmlMemBlocks()) {
11656 printf("Leak of %d blocks found in xmlNanoFTPDele",
11657 xmlMemBlocks() - mem_base);
11659 printf(" %d", n_ctx);
11660 printf(" %d", n_file);
11673 test_xmlNanoFTPGet(void) {
11677 /* missing type support */
11683 test_xmlNanoFTPGetConnection(void) {
11687 /* missing type support */
11693 test_xmlNanoFTPGetResponse(void) {
11696 #if defined(LIBXML_FTP_ENABLED)
11699 void * ctx; /* an FTP context */
11702 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11703 mem_base = xmlMemBlocks();
11704 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11706 ret_val = xmlNanoFTPGetResponse(ctx);
11707 desret_int(ret_val);
11709 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11710 xmlResetLastError();
11711 if (mem_base != xmlMemBlocks()) {
11712 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11713 xmlMemBlocks() - mem_base);
11715 printf(" %d", n_ctx);
11727 test_xmlNanoFTPGetSocket(void) {
11731 /* missing type support */
11737 test_xmlNanoFTPInit(void) {
11740 #if defined(LIBXML_FTP_ENABLED)
11743 mem_base = xmlMemBlocks();
11747 xmlResetLastError();
11748 if (mem_base != xmlMemBlocks()) {
11749 printf("Leak of %d blocks found in xmlNanoFTPInit",
11750 xmlMemBlocks() - mem_base);
11762 test_xmlNanoFTPList(void) {
11766 /* missing type support */
11772 test_xmlNanoFTPNewCtxt(void) {
11775 #if defined(LIBXML_FTP_ENABLED)
11778 const char * URL; /* The URL used to initialize the context */
11781 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11782 mem_base = xmlMemBlocks();
11783 URL = gen_filepath(n_URL, 0);
11785 ret_val = xmlNanoFTPNewCtxt(URL);
11786 desret_xmlNanoFTPCtxtPtr(ret_val);
11788 des_filepath(n_URL, URL, 0);
11789 xmlResetLastError();
11790 if (mem_base != xmlMemBlocks()) {
11791 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11792 xmlMemBlocks() - mem_base);
11794 printf(" %d", n_URL);
11806 test_xmlNanoFTPOpen(void) {
11809 #if defined(LIBXML_FTP_ENABLED)
11812 const char * URL; /* the URL to the resource */
11815 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11816 mem_base = xmlMemBlocks();
11817 URL = gen_filepath(n_URL, 0);
11819 ret_val = xmlNanoFTPOpen(URL);
11820 desret_xmlNanoFTPCtxtPtr(ret_val);
11822 des_filepath(n_URL, URL, 0);
11823 xmlResetLastError();
11824 if (mem_base != xmlMemBlocks()) {
11825 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11826 xmlMemBlocks() - mem_base);
11828 printf(" %d", n_URL);
11840 test_xmlNanoFTPProxy(void) {
11843 #if defined(LIBXML_FTP_ENABLED)
11844 char * host; /* the proxy host name */
11846 int port; /* the proxy port */
11848 char * user; /* the proxy user name */
11850 char * passwd; /* the proxy password */
11852 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11855 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11856 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11857 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11858 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11859 for (n_type = 0;n_type < gen_nb_int;n_type++) {
11860 host = gen_const_char_ptr(n_host, 0);
11861 port = gen_int(n_port, 1);
11862 user = gen_const_char_ptr(n_user, 2);
11863 passwd = gen_const_char_ptr(n_passwd, 3);
11864 type = gen_int(n_type, 4);
11866 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11868 des_const_char_ptr(n_host, (const char *)host, 0);
11869 des_int(n_port, port, 1);
11870 des_const_char_ptr(n_user, (const char *)user, 2);
11871 des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11872 des_int(n_type, type, 4);
11873 xmlResetLastError();
11887 test_xmlNanoFTPQuit(void) {
11890 #if defined(LIBXML_FTP_ENABLED)
11893 void * ctx; /* an FTP context */
11896 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11897 mem_base = xmlMemBlocks();
11898 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11900 ret_val = xmlNanoFTPQuit(ctx);
11901 desret_int(ret_val);
11903 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11904 xmlResetLastError();
11905 if (mem_base != xmlMemBlocks()) {
11906 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11907 xmlMemBlocks() - mem_base);
11909 printf(" %d", n_ctx);
11921 test_xmlNanoFTPRead(void) {
11924 #if defined(LIBXML_FTP_ENABLED)
11927 void * ctx; /* the FTP context */
11929 void * dest; /* a buffer */
11931 int len; /* the buffer length */
11934 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11935 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11936 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11937 mem_base = xmlMemBlocks();
11938 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11939 dest = gen_void_ptr(n_dest, 1);
11940 len = gen_int(n_len, 2);
11942 ret_val = xmlNanoFTPRead(ctx, dest, len);
11943 desret_int(ret_val);
11945 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11946 des_void_ptr(n_dest, dest, 1);
11947 des_int(n_len, len, 2);
11948 xmlResetLastError();
11949 if (mem_base != xmlMemBlocks()) {
11950 printf("Leak of %d blocks found in xmlNanoFTPRead",
11951 xmlMemBlocks() - mem_base);
11953 printf(" %d", n_ctx);
11954 printf(" %d", n_dest);
11955 printf(" %d", n_len);
11969 test_xmlNanoFTPScanProxy(void) {
11972 #if defined(LIBXML_FTP_ENABLED)
11973 const char * URL; /* The proxy URL used to initialize the proxy context */
11976 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11977 URL = gen_filepath(n_URL, 0);
11979 xmlNanoFTPScanProxy(URL);
11981 des_filepath(n_URL, URL, 0);
11982 xmlResetLastError();
11992 test_xmlNanoFTPUpdateURL(void) {
11995 #if defined(LIBXML_FTP_ENABLED)
11998 void * ctx; /* an FTP context */
12000 const char * URL; /* The URL used to update the context */
12003 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12004 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12005 mem_base = xmlMemBlocks();
12006 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12007 URL = gen_filepath(n_URL, 1);
12009 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12010 desret_int(ret_val);
12012 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12013 des_filepath(n_URL, URL, 1);
12014 xmlResetLastError();
12015 if (mem_base != xmlMemBlocks()) {
12016 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12017 xmlMemBlocks() - mem_base);
12019 printf(" %d", n_ctx);
12020 printf(" %d", n_URL);
12032 test_nanoftp(void) {
12035 if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12036 test_ret += test_xmlNanoFTPCheckResponse();
12037 test_ret += test_xmlNanoFTPCleanup();
12038 test_ret += test_xmlNanoFTPCloseConnection();
12039 test_ret += test_xmlNanoFTPCwd();
12040 test_ret += test_xmlNanoFTPDele();
12041 test_ret += test_xmlNanoFTPGet();
12042 test_ret += test_xmlNanoFTPGetConnection();
12043 test_ret += test_xmlNanoFTPGetResponse();
12044 test_ret += test_xmlNanoFTPGetSocket();
12045 test_ret += test_xmlNanoFTPInit();
12046 test_ret += test_xmlNanoFTPList();
12047 test_ret += test_xmlNanoFTPNewCtxt();
12048 test_ret += test_xmlNanoFTPOpen();
12049 test_ret += test_xmlNanoFTPProxy();
12050 test_ret += test_xmlNanoFTPQuit();
12051 test_ret += test_xmlNanoFTPRead();
12052 test_ret += test_xmlNanoFTPScanProxy();
12053 test_ret += test_xmlNanoFTPUpdateURL();
12056 printf("Module nanoftp: %d errors\n", test_ret);
12061 test_xmlNanoHTTPAuthHeader(void) {
12064 #if defined(LIBXML_HTTP_ENABLED)
12066 const char * ret_val;
12067 void * ctx; /* the HTTP context */
12070 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12071 mem_base = xmlMemBlocks();
12072 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12074 ret_val = xmlNanoHTTPAuthHeader(ctx);
12075 desret_const_char_ptr(ret_val);
12077 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12078 xmlResetLastError();
12079 if (mem_base != xmlMemBlocks()) {
12080 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12081 xmlMemBlocks() - mem_base);
12083 printf(" %d", n_ctx);
12095 test_xmlNanoHTTPCleanup(void) {
12098 #if defined(LIBXML_HTTP_ENABLED)
12101 mem_base = xmlMemBlocks();
12103 xmlNanoHTTPCleanup();
12105 xmlResetLastError();
12106 if (mem_base != xmlMemBlocks()) {
12107 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12108 xmlMemBlocks() - mem_base);
12120 test_xmlNanoHTTPContentLength(void) {
12123 #if defined(LIBXML_HTTP_ENABLED)
12126 void * ctx; /* the HTTP context */
12129 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12130 mem_base = xmlMemBlocks();
12131 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12133 ret_val = xmlNanoHTTPContentLength(ctx);
12134 desret_int(ret_val);
12136 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12137 xmlResetLastError();
12138 if (mem_base != xmlMemBlocks()) {
12139 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12140 xmlMemBlocks() - mem_base);
12142 printf(" %d", n_ctx);
12154 test_xmlNanoHTTPEncoding(void) {
12157 #if defined(LIBXML_HTTP_ENABLED)
12159 const char * ret_val;
12160 void * ctx; /* the HTTP context */
12163 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12164 mem_base = xmlMemBlocks();
12165 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12167 ret_val = xmlNanoHTTPEncoding(ctx);
12168 desret_const_char_ptr(ret_val);
12170 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12171 xmlResetLastError();
12172 if (mem_base != xmlMemBlocks()) {
12173 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12174 xmlMemBlocks() - mem_base);
12176 printf(" %d", n_ctx);
12187 #define gen_nb_char_ptr_ptr 1
12188 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12191 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12195 test_xmlNanoHTTPFetch(void) {
12198 #if defined(LIBXML_HTTP_ENABLED)
12201 const char * URL; /* The URL to load */
12203 const char * filename; /* the filename where the content should be saved */
12205 char ** contentType; /* if available the Content-Type information will be returned at that location */
12208 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12209 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12210 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12211 mem_base = xmlMemBlocks();
12212 URL = gen_fileoutput(n_URL, 0);
12213 filename = gen_fileoutput(n_filename, 1);
12214 contentType = gen_char_ptr_ptr(n_contentType, 2);
12216 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12217 desret_int(ret_val);
12219 des_fileoutput(n_URL, URL, 0);
12220 des_fileoutput(n_filename, filename, 1);
12221 des_char_ptr_ptr(n_contentType, contentType, 2);
12222 xmlResetLastError();
12223 if (mem_base != xmlMemBlocks()) {
12224 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12225 xmlMemBlocks() - mem_base);
12227 printf(" %d", n_URL);
12228 printf(" %d", n_filename);
12229 printf(" %d", n_contentType);
12243 test_xmlNanoHTTPInit(void) {
12246 #if defined(LIBXML_HTTP_ENABLED)
12249 mem_base = xmlMemBlocks();
12253 xmlResetLastError();
12254 if (mem_base != xmlMemBlocks()) {
12255 printf("Leak of %d blocks found in xmlNanoHTTPInit",
12256 xmlMemBlocks() - mem_base);
12268 test_xmlNanoHTTPMimeType(void) {
12271 #if defined(LIBXML_HTTP_ENABLED)
12273 const char * ret_val;
12274 void * ctx; /* the HTTP context */
12277 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12278 mem_base = xmlMemBlocks();
12279 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12281 ret_val = xmlNanoHTTPMimeType(ctx);
12282 desret_const_char_ptr(ret_val);
12284 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12285 xmlResetLastError();
12286 if (mem_base != xmlMemBlocks()) {
12287 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12288 xmlMemBlocks() - mem_base);
12290 printf(" %d", n_ctx);
12302 test_xmlNanoHTTPOpen(void) {
12305 #if defined(LIBXML_HTTP_ENABLED)
12308 const char * URL; /* The URL to load */
12310 char ** contentType; /* if available the Content-Type information will be returned at that location */
12313 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12314 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12315 mem_base = xmlMemBlocks();
12316 URL = gen_filepath(n_URL, 0);
12317 contentType = gen_char_ptr_ptr(n_contentType, 1);
12319 ret_val = xmlNanoHTTPOpen(URL, contentType);
12320 desret_xmlNanoHTTPCtxtPtr(ret_val);
12322 des_filepath(n_URL, URL, 0);
12323 des_char_ptr_ptr(n_contentType, contentType, 1);
12324 xmlResetLastError();
12325 if (mem_base != xmlMemBlocks()) {
12326 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12327 xmlMemBlocks() - mem_base);
12329 printf(" %d", n_URL);
12330 printf(" %d", n_contentType);
12343 test_xmlNanoHTTPOpenRedir(void) {
12346 #if defined(LIBXML_HTTP_ENABLED)
12349 const char * URL; /* The URL to load */
12351 char ** contentType; /* if available the Content-Type information will be returned at that location */
12353 char ** redir; /* if available the redirected URL will be returned */
12356 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12357 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12358 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12359 mem_base = xmlMemBlocks();
12360 URL = gen_filepath(n_URL, 0);
12361 contentType = gen_char_ptr_ptr(n_contentType, 1);
12362 redir = gen_char_ptr_ptr(n_redir, 2);
12364 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12365 desret_xmlNanoHTTPCtxtPtr(ret_val);
12367 des_filepath(n_URL, URL, 0);
12368 des_char_ptr_ptr(n_contentType, contentType, 1);
12369 des_char_ptr_ptr(n_redir, redir, 2);
12370 xmlResetLastError();
12371 if (mem_base != xmlMemBlocks()) {
12372 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12373 xmlMemBlocks() - mem_base);
12375 printf(" %d", n_URL);
12376 printf(" %d", n_contentType);
12377 printf(" %d", n_redir);
12391 test_xmlNanoHTTPRead(void) {
12394 #if defined(LIBXML_HTTP_ENABLED)
12397 void * ctx; /* the HTTP context */
12399 void * dest; /* a buffer */
12401 int len; /* the buffer length */
12404 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12405 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12406 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12407 mem_base = xmlMemBlocks();
12408 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12409 dest = gen_void_ptr(n_dest, 1);
12410 len = gen_int(n_len, 2);
12412 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12413 desret_int(ret_val);
12415 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12416 des_void_ptr(n_dest, dest, 1);
12417 des_int(n_len, len, 2);
12418 xmlResetLastError();
12419 if (mem_base != xmlMemBlocks()) {
12420 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12421 xmlMemBlocks() - mem_base);
12423 printf(" %d", n_ctx);
12424 printf(" %d", n_dest);
12425 printf(" %d", n_len);
12439 test_xmlNanoHTTPRedir(void) {
12443 /* missing type support */
12449 test_xmlNanoHTTPReturnCode(void) {
12452 #if defined(LIBXML_HTTP_ENABLED)
12455 void * ctx; /* the HTTP context */
12458 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12459 mem_base = xmlMemBlocks();
12460 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12462 ret_val = xmlNanoHTTPReturnCode(ctx);
12463 desret_int(ret_val);
12465 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12466 xmlResetLastError();
12467 if (mem_base != xmlMemBlocks()) {
12468 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12469 xmlMemBlocks() - mem_base);
12471 printf(" %d", n_ctx);
12483 test_xmlNanoHTTPSave(void) {
12486 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12489 void * ctxt; /* the HTTP context */
12491 const char * filename; /* the filename where the content should be saved */
12494 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12495 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12496 mem_base = xmlMemBlocks();
12497 ctxt = gen_void_ptr(n_ctxt, 0);
12498 filename = gen_fileoutput(n_filename, 1);
12500 ret_val = xmlNanoHTTPSave(ctxt, filename);
12501 desret_int(ret_val);
12503 des_void_ptr(n_ctxt, ctxt, 0);
12504 des_fileoutput(n_filename, filename, 1);
12505 xmlResetLastError();
12506 if (mem_base != xmlMemBlocks()) {
12507 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12508 xmlMemBlocks() - mem_base);
12510 printf(" %d", n_ctxt);
12511 printf(" %d", n_filename);
12524 test_xmlNanoHTTPScanProxy(void) {
12527 #if defined(LIBXML_HTTP_ENABLED)
12528 const char * URL; /* The proxy URL used to initialize the proxy context */
12531 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12532 URL = gen_filepath(n_URL, 0);
12534 xmlNanoHTTPScanProxy(URL);
12536 des_filepath(n_URL, URL, 0);
12537 xmlResetLastError();
12546 test_nanohttp(void) {
12549 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12550 test_ret += test_xmlNanoHTTPAuthHeader();
12551 test_ret += test_xmlNanoHTTPCleanup();
12552 test_ret += test_xmlNanoHTTPContentLength();
12553 test_ret += test_xmlNanoHTTPEncoding();
12554 test_ret += test_xmlNanoHTTPFetch();
12555 test_ret += test_xmlNanoHTTPInit();
12556 test_ret += test_xmlNanoHTTPMimeType();
12557 test_ret += test_xmlNanoHTTPOpen();
12558 test_ret += test_xmlNanoHTTPOpenRedir();
12559 test_ret += test_xmlNanoHTTPRead();
12560 test_ret += test_xmlNanoHTTPRedir();
12561 test_ret += test_xmlNanoHTTPReturnCode();
12562 test_ret += test_xmlNanoHTTPSave();
12563 test_ret += test_xmlNanoHTTPScanProxy();
12566 printf("Module nanohttp: %d errors\n", test_ret);
12571 test_xmlByteConsumed(void) {
12576 xmlParserCtxtPtr ctxt; /* an XML parser context */
12579 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12580 mem_base = xmlMemBlocks();
12581 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12583 ret_val = xmlByteConsumed(ctxt);
12584 desret_long(ret_val);
12586 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12587 xmlResetLastError();
12588 if (mem_base != xmlMemBlocks()) {
12589 printf("Leak of %d blocks found in xmlByteConsumed",
12590 xmlMemBlocks() - mem_base);
12592 printf(" %d", n_ctxt);
12603 test_xmlClearNodeInfoSeq(void) {
12607 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12610 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12611 mem_base = xmlMemBlocks();
12612 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12614 xmlClearNodeInfoSeq(seq);
12616 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12617 xmlResetLastError();
12618 if (mem_base != xmlMemBlocks()) {
12619 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12620 xmlMemBlocks() - mem_base);
12622 printf(" %d", n_seq);
12633 test_xmlClearParserCtxt(void) {
12637 xmlParserCtxtPtr ctxt; /* an XML parser context */
12640 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12641 mem_base = xmlMemBlocks();
12642 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12644 xmlClearParserCtxt(ctxt);
12646 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12647 xmlResetLastError();
12648 if (mem_base != xmlMemBlocks()) {
12649 printf("Leak of %d blocks found in xmlClearParserCtxt",
12650 xmlMemBlocks() - mem_base);
12652 printf(" %d", n_ctxt);
12663 test_xmlCreateDocParserCtxt(void) {
12667 xmlParserCtxtPtr ret_val;
12668 xmlChar * cur; /* a pointer to an array of xmlChar */
12671 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12672 mem_base = xmlMemBlocks();
12673 cur = gen_const_xmlChar_ptr(n_cur, 0);
12675 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12676 desret_xmlParserCtxtPtr(ret_val);
12678 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12679 xmlResetLastError();
12680 if (mem_base != xmlMemBlocks()) {
12681 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12682 xmlMemBlocks() - mem_base);
12684 printf(" %d", n_cur);
12695 test_xmlCreatePushParserCtxt(void) {
12698 #if defined(LIBXML_PUSH_ENABLED)
12700 xmlParserCtxtPtr ret_val;
12701 xmlSAXHandlerPtr sax; /* a SAX handler */
12703 void * user_data; /* The user data returned on SAX callbacks */
12705 char * chunk; /* a pointer to an array of chars */
12707 int size; /* number of chars in the array */
12709 const char * filename; /* an optional file name or URI */
12712 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12713 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12714 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12715 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12716 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12717 mem_base = xmlMemBlocks();
12718 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12719 user_data = gen_userdata(n_user_data, 1);
12720 chunk = gen_const_char_ptr(n_chunk, 2);
12721 size = gen_int(n_size, 3);
12722 filename = gen_fileoutput(n_filename, 4);
12724 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12725 desret_xmlParserCtxtPtr(ret_val);
12727 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12728 des_userdata(n_user_data, user_data, 1);
12729 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12730 des_int(n_size, size, 3);
12731 des_fileoutput(n_filename, filename, 4);
12732 xmlResetLastError();
12733 if (mem_base != xmlMemBlocks()) {
12734 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12735 xmlMemBlocks() - mem_base);
12737 printf(" %d", n_sax);
12738 printf(" %d", n_user_data);
12739 printf(" %d", n_chunk);
12740 printf(" %d", n_size);
12741 printf(" %d", n_filename);
12757 test_xmlCtxtReadDoc(void) {
12762 xmlParserCtxtPtr ctxt; /* an XML parser context */
12764 xmlChar * cur; /* a pointer to a zero terminated string */
12766 const char * URL; /* the base URL to use for the document */
12768 char * encoding; /* the document encoding, or NULL */
12770 int options; /* a combination of xmlParserOption */
12773 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12774 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12775 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12776 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12777 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12778 mem_base = xmlMemBlocks();
12779 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12780 cur = gen_const_xmlChar_ptr(n_cur, 1);
12781 URL = gen_filepath(n_URL, 2);
12782 encoding = gen_const_char_ptr(n_encoding, 3);
12783 options = gen_parseroptions(n_options, 4);
12785 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12786 desret_xmlDocPtr(ret_val);
12788 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12789 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12790 des_filepath(n_URL, URL, 2);
12791 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12792 des_parseroptions(n_options, options, 4);
12793 xmlResetLastError();
12794 if (mem_base != xmlMemBlocks()) {
12795 printf("Leak of %d blocks found in xmlCtxtReadDoc",
12796 xmlMemBlocks() - mem_base);
12798 printf(" %d", n_ctxt);
12799 printf(" %d", n_cur);
12800 printf(" %d", n_URL);
12801 printf(" %d", n_encoding);
12802 printf(" %d", n_options);
12817 test_xmlCtxtReadFile(void) {
12822 xmlParserCtxtPtr ctxt; /* an XML parser context */
12824 const char * filename; /* a file or URL */
12826 char * encoding; /* the document encoding, or NULL */
12828 int options; /* a combination of xmlParserOption */
12831 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12832 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12833 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12834 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12835 mem_base = xmlMemBlocks();
12836 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12837 filename = gen_filepath(n_filename, 1);
12838 encoding = gen_const_char_ptr(n_encoding, 2);
12839 options = gen_parseroptions(n_options, 3);
12841 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12842 desret_xmlDocPtr(ret_val);
12844 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12845 des_filepath(n_filename, filename, 1);
12846 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12847 des_parseroptions(n_options, options, 3);
12848 xmlResetLastError();
12849 if (mem_base != xmlMemBlocks()) {
12850 printf("Leak of %d blocks found in xmlCtxtReadFile",
12851 xmlMemBlocks() - mem_base);
12853 printf(" %d", n_ctxt);
12854 printf(" %d", n_filename);
12855 printf(" %d", n_encoding);
12856 printf(" %d", n_options);
12870 test_xmlCtxtReadMemory(void) {
12875 xmlParserCtxtPtr ctxt; /* an XML parser context */
12877 char * buffer; /* a pointer to a char array */
12879 int size; /* the size of the array */
12881 const char * URL; /* the base URL to use for the document */
12883 char * encoding; /* the document encoding, or NULL */
12885 int options; /* a combination of xmlParserOption */
12888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12889 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12890 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12891 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12892 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12893 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12894 mem_base = xmlMemBlocks();
12895 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12896 buffer = gen_const_char_ptr(n_buffer, 1);
12897 size = gen_int(n_size, 2);
12898 URL = gen_filepath(n_URL, 3);
12899 encoding = gen_const_char_ptr(n_encoding, 4);
12900 options = gen_parseroptions(n_options, 5);
12902 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12903 desret_xmlDocPtr(ret_val);
12905 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12906 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12907 des_int(n_size, size, 2);
12908 des_filepath(n_URL, URL, 3);
12909 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12910 des_parseroptions(n_options, options, 5);
12911 xmlResetLastError();
12912 if (mem_base != xmlMemBlocks()) {
12913 printf("Leak of %d blocks found in xmlCtxtReadMemory",
12914 xmlMemBlocks() - mem_base);
12916 printf(" %d", n_ctxt);
12917 printf(" %d", n_buffer);
12918 printf(" %d", n_size);
12919 printf(" %d", n_URL);
12920 printf(" %d", n_encoding);
12921 printf(" %d", n_options);
12937 test_xmlCtxtReset(void) {
12941 xmlParserCtxtPtr ctxt; /* an XML parser context */
12944 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12945 mem_base = xmlMemBlocks();
12946 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12948 xmlCtxtReset(ctxt);
12950 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12951 xmlResetLastError();
12952 if (mem_base != xmlMemBlocks()) {
12953 printf("Leak of %d blocks found in xmlCtxtReset",
12954 xmlMemBlocks() - mem_base);
12956 printf(" %d", n_ctxt);
12967 test_xmlCtxtResetPush(void) {
12972 xmlParserCtxtPtr ctxt; /* an XML parser context */
12974 char * chunk; /* a pointer to an array of chars */
12976 int size; /* number of chars in the array */
12978 const char * filename; /* an optional file name or URI */
12980 char * encoding; /* the document encoding, or NULL */
12983 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12984 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12985 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12986 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12987 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12988 mem_base = xmlMemBlocks();
12989 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12990 chunk = gen_const_char_ptr(n_chunk, 1);
12991 size = gen_int(n_size, 2);
12992 filename = gen_filepath(n_filename, 3);
12993 encoding = gen_const_char_ptr(n_encoding, 4);
12995 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12996 desret_int(ret_val);
12998 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12999 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13000 des_int(n_size, size, 2);
13001 des_filepath(n_filename, filename, 3);
13002 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13003 xmlResetLastError();
13004 if (mem_base != xmlMemBlocks()) {
13005 printf("Leak of %d blocks found in xmlCtxtResetPush",
13006 xmlMemBlocks() - mem_base);
13008 printf(" %d", n_ctxt);
13009 printf(" %d", n_chunk);
13010 printf(" %d", n_size);
13011 printf(" %d", n_filename);
13012 printf(" %d", n_encoding);
13027 test_xmlCtxtUseOptions(void) {
13032 xmlParserCtxtPtr ctxt; /* an XML parser context */
13034 int options; /* a combination of xmlParserOption */
13037 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13038 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13039 mem_base = xmlMemBlocks();
13040 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13041 options = gen_parseroptions(n_options, 1);
13043 ret_val = xmlCtxtUseOptions(ctxt, options);
13044 desret_int(ret_val);
13046 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13047 des_parseroptions(n_options, options, 1);
13048 xmlResetLastError();
13049 if (mem_base != xmlMemBlocks()) {
13050 printf("Leak of %d blocks found in xmlCtxtUseOptions",
13051 xmlMemBlocks() - mem_base);
13053 printf(" %d", n_ctxt);
13054 printf(" %d", n_options);
13066 test_xmlGetExternalEntityLoader(void) {
13070 /* missing type support */
13076 test_xmlGetFeature(void) {
13079 #if defined(LIBXML_LEGACY_ENABLED)
13080 #ifdef LIBXML_LEGACY_ENABLED
13083 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13085 char * name; /* the feature name */
13087 void * result; /* location to store the result */
13090 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13091 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13092 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13093 mem_base = xmlMemBlocks();
13094 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13095 name = gen_const_char_ptr(n_name, 1);
13096 result = gen_void_ptr(n_result, 2);
13098 ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13099 desret_int(ret_val);
13101 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13102 des_const_char_ptr(n_name, (const char *)name, 1);
13103 des_void_ptr(n_result, result, 2);
13104 xmlResetLastError();
13105 if (mem_base != xmlMemBlocks()) {
13106 printf("Leak of %d blocks found in xmlGetFeature",
13107 xmlMemBlocks() - mem_base);
13109 printf(" %d", n_ctxt);
13110 printf(" %d", n_name);
13111 printf(" %d", n_result);
13125 #define gen_nb_const_char_ptr_ptr 1
13126 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13129 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13133 test_xmlGetFeaturesList(void) {
13136 #if defined(LIBXML_LEGACY_ENABLED)
13137 #ifdef LIBXML_LEGACY_ENABLED
13140 int * len; /* the length of the features name array (input/output) */
13142 char ** result; /* an array of string to be filled with the features name. */
13145 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13146 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13147 mem_base = xmlMemBlocks();
13148 len = gen_int_ptr(n_len, 0);
13149 result = gen_const_char_ptr_ptr(n_result, 1);
13151 ret_val = xmlGetFeaturesList(len, (const char **)result);
13152 desret_int(ret_val);
13154 des_int_ptr(n_len, len, 0);
13155 des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13156 xmlResetLastError();
13157 if (mem_base != xmlMemBlocks()) {
13158 printf("Leak of %d blocks found in xmlGetFeaturesList",
13159 xmlMemBlocks() - mem_base);
13161 printf(" %d", n_len);
13162 printf(" %d", n_result);
13176 test_xmlHasFeature(void) {
13181 xmlFeature feature; /* the feature to be examined */
13184 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13185 mem_base = xmlMemBlocks();
13186 feature = gen_xmlFeature(n_feature, 0);
13188 ret_val = xmlHasFeature(feature);
13189 desret_int(ret_val);
13191 des_xmlFeature(n_feature, feature, 0);
13192 xmlResetLastError();
13193 if (mem_base != xmlMemBlocks()) {
13194 printf("Leak of %d blocks found in xmlHasFeature",
13195 xmlMemBlocks() - mem_base);
13197 printf(" %d", n_feature);
13208 test_xmlIOParseDTD(void) {
13211 #if defined(LIBXML_VALID_ENABLED)
13212 #ifdef LIBXML_VALID_ENABLED
13214 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13216 xmlParserInputBufferPtr input; /* an Input Buffer */
13218 xmlCharEncoding enc; /* the charset encoding if known */
13221 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13222 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13223 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13224 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13225 input = gen_xmlParserInputBufferPtr(n_input, 1);
13226 enc = gen_xmlCharEncoding(n_enc, 2);
13228 ret_val = xmlIOParseDTD(sax, input, enc);
13230 desret_xmlDtdPtr(ret_val);
13232 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13233 des_xmlParserInputBufferPtr(n_input, input, 1);
13234 des_xmlCharEncoding(n_enc, enc, 2);
13235 xmlResetLastError();
13248 test_xmlInitNodeInfoSeq(void) {
13252 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13255 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13256 mem_base = xmlMemBlocks();
13257 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13259 xmlInitNodeInfoSeq(seq);
13261 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13262 xmlResetLastError();
13263 if (mem_base != xmlMemBlocks()) {
13264 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13265 xmlMemBlocks() - mem_base);
13267 printf(" %d", n_seq);
13278 test_xmlInitParser(void) {
13283 mem_base = xmlMemBlocks();
13287 xmlResetLastError();
13288 if (mem_base != xmlMemBlocks()) {
13289 printf("Leak of %d blocks found in xmlInitParser",
13290 xmlMemBlocks() - mem_base);
13301 test_xmlInitParserCtxt(void) {
13306 xmlParserCtxtPtr ctxt; /* an XML parser context */
13309 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13310 mem_base = xmlMemBlocks();
13311 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13313 ret_val = xmlInitParserCtxt(ctxt);
13314 desret_int(ret_val);
13316 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13317 xmlResetLastError();
13318 if (mem_base != xmlMemBlocks()) {
13319 printf("Leak of %d blocks found in xmlInitParserCtxt",
13320 xmlMemBlocks() - mem_base);
13322 printf(" %d", n_ctxt);
13333 test_xmlKeepBlanksDefault(void) {
13338 int val; /* int 0 or 1 */
13341 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13342 mem_base = xmlMemBlocks();
13343 val = gen_int(n_val, 0);
13345 ret_val = xmlKeepBlanksDefault(val);
13346 desret_int(ret_val);
13348 des_int(n_val, val, 0);
13349 xmlResetLastError();
13350 if (mem_base != xmlMemBlocks()) {
13351 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13352 xmlMemBlocks() - mem_base);
13354 printf(" %d", n_val);
13365 test_xmlLineNumbersDefault(void) {
13370 int val; /* int 0 or 1 */
13373 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13374 mem_base = xmlMemBlocks();
13375 val = gen_int(n_val, 0);
13377 ret_val = xmlLineNumbersDefault(val);
13378 desret_int(ret_val);
13380 des_int(n_val, val, 0);
13381 xmlResetLastError();
13382 if (mem_base != xmlMemBlocks()) {
13383 printf("Leak of %d blocks found in xmlLineNumbersDefault",
13384 xmlMemBlocks() - mem_base);
13386 printf(" %d", n_val);
13397 test_xmlLoadExternalEntity(void) {
13401 xmlParserInputPtr ret_val;
13402 const char * URL; /* the URL for the entity to load */
13404 char * ID; /* the Public ID for the entity to load */
13406 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13409 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13410 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13411 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13412 mem_base = xmlMemBlocks();
13413 URL = gen_filepath(n_URL, 0);
13414 ID = gen_const_char_ptr(n_ID, 1);
13415 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13417 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13418 desret_xmlParserInputPtr(ret_val);
13420 des_filepath(n_URL, URL, 0);
13421 des_const_char_ptr(n_ID, (const char *)ID, 1);
13422 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13423 xmlResetLastError();
13424 if (mem_base != xmlMemBlocks()) {
13425 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13426 xmlMemBlocks() - mem_base);
13428 printf(" %d", n_URL);
13429 printf(" %d", n_ID);
13430 printf(" %d", n_ctxt);
13443 test_xmlNewIOInputStream(void) {
13447 xmlParserInputPtr ret_val;
13448 xmlParserCtxtPtr ctxt; /* an XML parser context */
13450 xmlParserInputBufferPtr input; /* an I/O Input */
13452 xmlCharEncoding enc; /* the charset encoding if known */
13455 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13456 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13457 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13458 mem_base = xmlMemBlocks();
13459 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13460 input = gen_xmlParserInputBufferPtr(n_input, 1);
13461 enc = gen_xmlCharEncoding(n_enc, 2);
13463 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13464 if (ret_val != NULL) input = NULL;
13465 desret_xmlParserInputPtr(ret_val);
13467 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13468 des_xmlParserInputBufferPtr(n_input, input, 1);
13469 des_xmlCharEncoding(n_enc, enc, 2);
13470 xmlResetLastError();
13471 if (mem_base != xmlMemBlocks()) {
13472 printf("Leak of %d blocks found in xmlNewIOInputStream",
13473 xmlMemBlocks() - mem_base);
13475 printf(" %d", n_ctxt);
13476 printf(" %d", n_input);
13477 printf(" %d", n_enc);
13490 test_xmlNewParserCtxt(void) {
13494 xmlParserCtxtPtr ret_val;
13496 mem_base = xmlMemBlocks();
13498 ret_val = xmlNewParserCtxt();
13499 desret_xmlParserCtxtPtr(ret_val);
13501 xmlResetLastError();
13502 if (mem_base != xmlMemBlocks()) {
13503 printf("Leak of %d blocks found in xmlNewParserCtxt",
13504 xmlMemBlocks() - mem_base);
13514 #define gen_nb_xmlNodePtr_ptr 1
13515 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13518 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13522 test_xmlParseBalancedChunkMemory(void) {
13525 #if defined(LIBXML_SAX1_ENABLED)
13526 #ifdef LIBXML_SAX1_ENABLED
13529 xmlDocPtr doc; /* the document the chunk pertains to */
13531 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13533 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13535 int depth; /* Used for loop detection, use 0 */
13537 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13539 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13542 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13543 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13544 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13545 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13546 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13547 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13548 mem_base = xmlMemBlocks();
13549 doc = gen_xmlDocPtr(n_doc, 0);
13550 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13551 user_data = gen_userdata(n_user_data, 2);
13552 depth = gen_int(n_depth, 3);
13553 string = gen_const_xmlChar_ptr(n_string, 4);
13554 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13556 #ifdef LIBXML_SAX1_ENABLED
13557 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13561 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13562 desret_int(ret_val);
13564 des_xmlDocPtr(n_doc, doc, 0);
13565 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13566 des_userdata(n_user_data, user_data, 2);
13567 des_int(n_depth, depth, 3);
13568 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13569 des_xmlNodePtr_ptr(n_lst, lst, 5);
13570 xmlResetLastError();
13571 if (mem_base != xmlMemBlocks()) {
13572 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13573 xmlMemBlocks() - mem_base);
13575 printf(" %d", n_doc);
13576 printf(" %d", n_sax);
13577 printf(" %d", n_user_data);
13578 printf(" %d", n_depth);
13579 printf(" %d", n_string);
13580 printf(" %d", n_lst);
13598 test_xmlParseBalancedChunkMemoryRecover(void) {
13601 #if defined(LIBXML_SAX1_ENABLED)
13602 #ifdef LIBXML_SAX1_ENABLED
13605 xmlDocPtr doc; /* the document the chunk pertains to */
13607 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13609 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13611 int depth; /* Used for loop detection, use 0 */
13613 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13615 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13617 int recover; /* return nodes even if the data is broken (use 0) */
13620 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13621 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13622 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13623 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13624 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13625 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13626 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13627 mem_base = xmlMemBlocks();
13628 doc = gen_xmlDocPtr(n_doc, 0);
13629 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13630 user_data = gen_userdata(n_user_data, 2);
13631 depth = gen_int(n_depth, 3);
13632 string = gen_const_xmlChar_ptr(n_string, 4);
13633 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13634 recover = gen_int(n_recover, 6);
13636 #ifdef LIBXML_SAX1_ENABLED
13637 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13641 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13642 desret_int(ret_val);
13644 des_xmlDocPtr(n_doc, doc, 0);
13645 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13646 des_userdata(n_user_data, user_data, 2);
13647 des_int(n_depth, depth, 3);
13648 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13649 des_xmlNodePtr_ptr(n_lst, lst, 5);
13650 des_int(n_recover, recover, 6);
13651 xmlResetLastError();
13652 if (mem_base != xmlMemBlocks()) {
13653 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13654 xmlMemBlocks() - mem_base);
13656 printf(" %d", n_doc);
13657 printf(" %d", n_sax);
13658 printf(" %d", n_user_data);
13659 printf(" %d", n_depth);
13660 printf(" %d", n_string);
13661 printf(" %d", n_lst);
13662 printf(" %d", n_recover);
13681 test_xmlParseChunk(void) {
13684 #if defined(LIBXML_PUSH_ENABLED)
13687 xmlParserCtxtPtr ctxt; /* an XML parser context */
13689 char * chunk; /* an char array */
13691 int size; /* the size in byte of the chunk */
13693 int terminate; /* last chunk indicator */
13696 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13697 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13698 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13699 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13700 mem_base = xmlMemBlocks();
13701 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13702 chunk = gen_const_char_ptr(n_chunk, 1);
13703 size = gen_int(n_size, 2);
13704 terminate = gen_int(n_terminate, 3);
13706 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13707 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13708 desret_int(ret_val);
13710 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13711 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13712 des_int(n_size, size, 2);
13713 des_int(n_terminate, terminate, 3);
13714 xmlResetLastError();
13715 if (mem_base != xmlMemBlocks()) {
13716 printf("Leak of %d blocks found in xmlParseChunk",
13717 xmlMemBlocks() - mem_base);
13719 printf(" %d", n_ctxt);
13720 printf(" %d", n_chunk);
13721 printf(" %d", n_size);
13722 printf(" %d", n_terminate);
13737 test_xmlParseCtxtExternalEntity(void) {
13742 xmlParserCtxtPtr ctx; /* the existing parsing context */
13744 xmlChar * URL; /* the URL for the entity to load */
13746 xmlChar * ID; /* the System ID for the entity to load */
13748 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13751 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13752 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13753 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13754 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13755 mem_base = xmlMemBlocks();
13756 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13757 URL = gen_const_xmlChar_ptr(n_URL, 1);
13758 ID = gen_const_xmlChar_ptr(n_ID, 2);
13759 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13761 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13762 desret_int(ret_val);
13764 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13765 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13766 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13767 des_xmlNodePtr_ptr(n_lst, lst, 3);
13768 xmlResetLastError();
13769 if (mem_base != xmlMemBlocks()) {
13770 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13771 xmlMemBlocks() - mem_base);
13773 printf(" %d", n_ctx);
13774 printf(" %d", n_URL);
13775 printf(" %d", n_ID);
13776 printf(" %d", n_lst);
13790 test_xmlParseDTD(void) {
13793 #if defined(LIBXML_VALID_ENABLED)
13794 #ifdef LIBXML_VALID_ENABLED
13797 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13799 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13802 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13803 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13804 mem_base = xmlMemBlocks();
13805 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13806 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13808 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13809 desret_xmlDtdPtr(ret_val);
13811 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13812 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13813 xmlResetLastError();
13814 if (mem_base != xmlMemBlocks()) {
13815 printf("Leak of %d blocks found in xmlParseDTD",
13816 xmlMemBlocks() - mem_base);
13818 printf(" %d", n_ExternalID);
13819 printf(" %d", n_SystemID);
13833 test_xmlParseDoc(void) {
13836 #if defined(LIBXML_SAX1_ENABLED)
13837 #ifdef LIBXML_SAX1_ENABLED
13840 xmlChar * cur; /* a pointer to an array of xmlChar */
13843 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13844 mem_base = xmlMemBlocks();
13845 cur = gen_const_xmlChar_ptr(n_cur, 0);
13847 ret_val = xmlParseDoc((const xmlChar *)cur);
13848 desret_xmlDocPtr(ret_val);
13850 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13851 xmlResetLastError();
13852 if (mem_base != xmlMemBlocks()) {
13853 printf("Leak of %d blocks found in xmlParseDoc",
13854 xmlMemBlocks() - mem_base);
13856 printf(" %d", n_cur);
13869 test_xmlParseDocument(void) {
13874 xmlParserCtxtPtr ctxt; /* an XML parser context */
13877 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13878 mem_base = xmlMemBlocks();
13879 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13881 ret_val = xmlParseDocument(ctxt);
13882 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13883 desret_int(ret_val);
13885 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13886 xmlResetLastError();
13887 if (mem_base != xmlMemBlocks()) {
13888 printf("Leak of %d blocks found in xmlParseDocument",
13889 xmlMemBlocks() - mem_base);
13891 printf(" %d", n_ctxt);
13902 test_xmlParseEntity(void) {
13905 #if defined(LIBXML_SAX1_ENABLED)
13906 #ifdef LIBXML_SAX1_ENABLED
13909 const char * filename; /* the filename */
13912 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13913 mem_base = xmlMemBlocks();
13914 filename = gen_filepath(n_filename, 0);
13916 ret_val = xmlParseEntity(filename);
13917 desret_xmlDocPtr(ret_val);
13919 des_filepath(n_filename, filename, 0);
13920 xmlResetLastError();
13921 if (mem_base != xmlMemBlocks()) {
13922 printf("Leak of %d blocks found in xmlParseEntity",
13923 xmlMemBlocks() - mem_base);
13925 printf(" %d", n_filename);
13938 test_xmlParseExtParsedEnt(void) {
13943 xmlParserCtxtPtr ctxt; /* an XML parser context */
13946 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13947 mem_base = xmlMemBlocks();
13948 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13950 ret_val = xmlParseExtParsedEnt(ctxt);
13951 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13952 desret_int(ret_val);
13954 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13955 xmlResetLastError();
13956 if (mem_base != xmlMemBlocks()) {
13957 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13958 xmlMemBlocks() - mem_base);
13960 printf(" %d", n_ctxt);
13971 test_xmlParseExternalEntity(void) {
13974 #if defined(LIBXML_SAX1_ENABLED)
13975 #ifdef LIBXML_SAX1_ENABLED
13978 xmlDocPtr doc; /* the document the chunk pertains to */
13980 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13982 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13984 int depth; /* Used for loop detection, use 0 */
13986 xmlChar * URL; /* the URL for the entity to load */
13988 xmlChar * ID; /* the System ID for the entity to load */
13990 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13993 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13994 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13995 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13996 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13997 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13998 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13999 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14000 mem_base = xmlMemBlocks();
14001 doc = gen_xmlDocPtr(n_doc, 0);
14002 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14003 user_data = gen_userdata(n_user_data, 2);
14004 depth = gen_int(n_depth, 3);
14005 URL = gen_const_xmlChar_ptr(n_URL, 4);
14006 ID = gen_const_xmlChar_ptr(n_ID, 5);
14007 lst = gen_xmlNodePtr_ptr(n_lst, 6);
14009 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14010 desret_int(ret_val);
14012 des_xmlDocPtr(n_doc, doc, 0);
14013 des_xmlSAXHandlerPtr(n_sax, sax, 1);
14014 des_userdata(n_user_data, user_data, 2);
14015 des_int(n_depth, depth, 3);
14016 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14017 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14018 des_xmlNodePtr_ptr(n_lst, lst, 6);
14019 xmlResetLastError();
14020 if (mem_base != xmlMemBlocks()) {
14021 printf("Leak of %d blocks found in xmlParseExternalEntity",
14022 xmlMemBlocks() - mem_base);
14024 printf(" %d", n_doc);
14025 printf(" %d", n_sax);
14026 printf(" %d", n_user_data);
14027 printf(" %d", n_depth);
14028 printf(" %d", n_URL);
14029 printf(" %d", n_ID);
14030 printf(" %d", n_lst);
14049 test_xmlParseFile(void) {
14052 #if defined(LIBXML_SAX1_ENABLED)
14053 #ifdef LIBXML_SAX1_ENABLED
14056 const char * filename; /* the filename */
14059 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14060 mem_base = xmlMemBlocks();
14061 filename = gen_filepath(n_filename, 0);
14063 ret_val = xmlParseFile(filename);
14064 desret_xmlDocPtr(ret_val);
14066 des_filepath(n_filename, filename, 0);
14067 xmlResetLastError();
14068 if (mem_base != xmlMemBlocks()) {
14069 printf("Leak of %d blocks found in xmlParseFile",
14070 xmlMemBlocks() - mem_base);
14072 printf(" %d", n_filename);
14085 test_xmlParseInNodeContext(void) {
14089 xmlParserErrors ret_val;
14090 xmlNodePtr node; /* the context node */
14092 char * data; /* the input string */
14094 int datalen; /* the input string length in bytes */
14096 int options; /* a combination of xmlParserOption */
14098 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14101 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14102 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14103 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14104 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14105 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14106 mem_base = xmlMemBlocks();
14107 node = gen_xmlNodePtr(n_node, 0);
14108 data = gen_const_char_ptr(n_data, 1);
14109 datalen = gen_int(n_datalen, 2);
14110 options = gen_parseroptions(n_options, 3);
14111 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14113 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14114 desret_xmlParserErrors(ret_val);
14116 des_xmlNodePtr(n_node, node, 0);
14117 des_const_char_ptr(n_data, (const char *)data, 1);
14118 des_int(n_datalen, datalen, 2);
14119 des_parseroptions(n_options, options, 3);
14120 des_xmlNodePtr_ptr(n_lst, lst, 4);
14121 xmlResetLastError();
14122 if (mem_base != xmlMemBlocks()) {
14123 printf("Leak of %d blocks found in xmlParseInNodeContext",
14124 xmlMemBlocks() - mem_base);
14126 printf(" %d", n_node);
14127 printf(" %d", n_data);
14128 printf(" %d", n_datalen);
14129 printf(" %d", n_options);
14130 printf(" %d", n_lst);
14145 test_xmlParseMemory(void) {
14148 #if defined(LIBXML_SAX1_ENABLED)
14149 #ifdef LIBXML_SAX1_ENABLED
14152 char * buffer; /* an pointer to a char array */
14154 int size; /* the size of the array */
14157 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14158 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14159 mem_base = xmlMemBlocks();
14160 buffer = gen_const_char_ptr(n_buffer, 0);
14161 size = gen_int(n_size, 1);
14163 ret_val = xmlParseMemory((const char *)buffer, size);
14164 desret_xmlDocPtr(ret_val);
14166 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14167 des_int(n_size, size, 1);
14168 xmlResetLastError();
14169 if (mem_base != xmlMemBlocks()) {
14170 printf("Leak of %d blocks found in xmlParseMemory",
14171 xmlMemBlocks() - mem_base);
14173 printf(" %d", n_buffer);
14174 printf(" %d", n_size);
14187 #define gen_nb_const_xmlParserNodeInfoPtr 1
14188 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14191 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14195 test_xmlParserAddNodeInfo(void) {
14199 xmlParserCtxtPtr ctxt; /* an XML parser context */
14201 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14204 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14205 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14206 mem_base = xmlMemBlocks();
14207 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14208 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14210 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14212 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14213 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14214 xmlResetLastError();
14215 if (mem_base != xmlMemBlocks()) {
14216 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14217 xmlMemBlocks() - mem_base);
14219 printf(" %d", n_ctxt);
14220 printf(" %d", n_info);
14231 #define gen_nb_const_xmlParserCtxtPtr 1
14232 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14235 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14238 #define gen_nb_const_xmlNodePtr 1
14239 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14242 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14246 test_xmlParserFindNodeInfo(void) {
14250 const xmlParserNodeInfo * ret_val;
14251 xmlParserCtxtPtr ctx; /* an XML parser context */
14253 xmlNodePtr node; /* an XML node within the tree */
14256 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14257 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14258 mem_base = xmlMemBlocks();
14259 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14260 node = gen_const_xmlNodePtr(n_node, 1);
14262 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14263 desret_const_xmlParserNodeInfo_ptr(ret_val);
14265 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14266 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14267 xmlResetLastError();
14268 if (mem_base != xmlMemBlocks()) {
14269 printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14270 xmlMemBlocks() - mem_base);
14272 printf(" %d", n_ctx);
14273 printf(" %d", n_node);
14284 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14285 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14288 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14292 test_xmlParserFindNodeInfoIndex(void) {
14296 unsigned long ret_val;
14297 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14299 xmlNodePtr node; /* an XML node pointer */
14302 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14303 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14304 mem_base = xmlMemBlocks();
14305 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14306 node = gen_const_xmlNodePtr(n_node, 1);
14308 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14309 desret_unsigned_long(ret_val);
14311 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14312 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14313 xmlResetLastError();
14314 if (mem_base != xmlMemBlocks()) {
14315 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14316 xmlMemBlocks() - mem_base);
14318 printf(" %d", n_seq);
14319 printf(" %d", n_node);
14330 #define gen_nb_xmlParserInputPtr 1
14331 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14334 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14338 test_xmlParserInputGrow(void) {
14343 xmlParserInputPtr in; /* an XML parser input */
14345 int len; /* an indicative size for the lookahead */
14348 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14349 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14350 mem_base = xmlMemBlocks();
14351 in = gen_xmlParserInputPtr(n_in, 0);
14352 len = gen_int(n_len, 1);
14354 ret_val = xmlParserInputGrow(in, len);
14355 desret_int(ret_val);
14357 des_xmlParserInputPtr(n_in, in, 0);
14358 des_int(n_len, len, 1);
14359 xmlResetLastError();
14360 if (mem_base != xmlMemBlocks()) {
14361 printf("Leak of %d blocks found in xmlParserInputGrow",
14362 xmlMemBlocks() - mem_base);
14364 printf(" %d", n_in);
14365 printf(" %d", n_len);
14377 test_xmlParserInputRead(void) {
14382 xmlParserInputPtr in; /* an XML parser input */
14384 int len; /* an indicative size for the lookahead */
14387 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14388 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14389 mem_base = xmlMemBlocks();
14390 in = gen_xmlParserInputPtr(n_in, 0);
14391 len = gen_int(n_len, 1);
14393 ret_val = xmlParserInputRead(in, len);
14394 desret_int(ret_val);
14396 des_xmlParserInputPtr(n_in, in, 0);
14397 des_int(n_len, len, 1);
14398 xmlResetLastError();
14399 if (mem_base != xmlMemBlocks()) {
14400 printf("Leak of %d blocks found in xmlParserInputRead",
14401 xmlMemBlocks() - mem_base);
14403 printf(" %d", n_in);
14404 printf(" %d", n_len);
14416 test_xmlPedanticParserDefault(void) {
14421 int val; /* int 0 or 1 */
14424 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14425 mem_base = xmlMemBlocks();
14426 val = gen_int(n_val, 0);
14428 ret_val = xmlPedanticParserDefault(val);
14429 desret_int(ret_val);
14431 des_int(n_val, val, 0);
14432 xmlResetLastError();
14433 if (mem_base != xmlMemBlocks()) {
14434 printf("Leak of %d blocks found in xmlPedanticParserDefault",
14435 xmlMemBlocks() - mem_base);
14437 printf(" %d", n_val);
14448 test_xmlReadDoc(void) {
14453 xmlChar * cur; /* a pointer to a zero terminated string */
14455 const char * URL; /* the base URL to use for the document */
14457 char * encoding; /* the document encoding, or NULL */
14459 int options; /* a combination of xmlParserOption */
14462 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14463 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14464 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14465 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14466 mem_base = xmlMemBlocks();
14467 cur = gen_const_xmlChar_ptr(n_cur, 0);
14468 URL = gen_filepath(n_URL, 1);
14469 encoding = gen_const_char_ptr(n_encoding, 2);
14470 options = gen_parseroptions(n_options, 3);
14472 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14473 desret_xmlDocPtr(ret_val);
14475 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14476 des_filepath(n_URL, URL, 1);
14477 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14478 des_parseroptions(n_options, options, 3);
14479 xmlResetLastError();
14480 if (mem_base != xmlMemBlocks()) {
14481 printf("Leak of %d blocks found in xmlReadDoc",
14482 xmlMemBlocks() - mem_base);
14484 printf(" %d", n_cur);
14485 printf(" %d", n_URL);
14486 printf(" %d", n_encoding);
14487 printf(" %d", n_options);
14501 test_xmlReadFile(void) {
14506 const char * filename; /* a file or URL */
14508 char * encoding; /* the document encoding, or NULL */
14510 int options; /* a combination of xmlParserOption */
14513 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14514 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14515 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14516 mem_base = xmlMemBlocks();
14517 filename = gen_filepath(n_filename, 0);
14518 encoding = gen_const_char_ptr(n_encoding, 1);
14519 options = gen_parseroptions(n_options, 2);
14521 ret_val = xmlReadFile(filename, (const char *)encoding, options);
14522 desret_xmlDocPtr(ret_val);
14524 des_filepath(n_filename, filename, 0);
14525 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14526 des_parseroptions(n_options, options, 2);
14527 xmlResetLastError();
14528 if (mem_base != xmlMemBlocks()) {
14529 printf("Leak of %d blocks found in xmlReadFile",
14530 xmlMemBlocks() - mem_base);
14532 printf(" %d", n_filename);
14533 printf(" %d", n_encoding);
14534 printf(" %d", n_options);
14547 test_xmlReadMemory(void) {
14552 char * buffer; /* a pointer to a char array */
14554 int size; /* the size of the array */
14556 const char * URL; /* the base URL to use for the document */
14558 char * encoding; /* the document encoding, or NULL */
14560 int options; /* a combination of xmlParserOption */
14563 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14564 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14565 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14566 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14567 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14568 mem_base = xmlMemBlocks();
14569 buffer = gen_const_char_ptr(n_buffer, 0);
14570 size = gen_int(n_size, 1);
14571 URL = gen_filepath(n_URL, 2);
14572 encoding = gen_const_char_ptr(n_encoding, 3);
14573 options = gen_parseroptions(n_options, 4);
14575 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14576 desret_xmlDocPtr(ret_val);
14578 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14579 des_int(n_size, size, 1);
14580 des_filepath(n_URL, URL, 2);
14581 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14582 des_parseroptions(n_options, options, 4);
14583 xmlResetLastError();
14584 if (mem_base != xmlMemBlocks()) {
14585 printf("Leak of %d blocks found in xmlReadMemory",
14586 xmlMemBlocks() - mem_base);
14588 printf(" %d", n_buffer);
14589 printf(" %d", n_size);
14590 printf(" %d", n_URL);
14591 printf(" %d", n_encoding);
14592 printf(" %d", n_options);
14607 test_xmlRecoverDoc(void) {
14610 #if defined(LIBXML_SAX1_ENABLED)
14611 #ifdef LIBXML_SAX1_ENABLED
14614 xmlChar * cur; /* a pointer to an array of xmlChar */
14617 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14618 mem_base = xmlMemBlocks();
14619 cur = gen_const_xmlChar_ptr(n_cur, 0);
14621 ret_val = xmlRecoverDoc((const xmlChar *)cur);
14622 desret_xmlDocPtr(ret_val);
14624 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14625 xmlResetLastError();
14626 if (mem_base != xmlMemBlocks()) {
14627 printf("Leak of %d blocks found in xmlRecoverDoc",
14628 xmlMemBlocks() - mem_base);
14630 printf(" %d", n_cur);
14643 test_xmlRecoverFile(void) {
14646 #if defined(LIBXML_SAX1_ENABLED)
14647 #ifdef LIBXML_SAX1_ENABLED
14650 const char * filename; /* the filename */
14653 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14654 mem_base = xmlMemBlocks();
14655 filename = gen_filepath(n_filename, 0);
14657 ret_val = xmlRecoverFile(filename);
14658 desret_xmlDocPtr(ret_val);
14660 des_filepath(n_filename, filename, 0);
14661 xmlResetLastError();
14662 if (mem_base != xmlMemBlocks()) {
14663 printf("Leak of %d blocks found in xmlRecoverFile",
14664 xmlMemBlocks() - mem_base);
14666 printf(" %d", n_filename);
14679 test_xmlRecoverMemory(void) {
14682 #if defined(LIBXML_SAX1_ENABLED)
14683 #ifdef LIBXML_SAX1_ENABLED
14686 char * buffer; /* an pointer to a char array */
14688 int size; /* the size of the array */
14691 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14692 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14693 mem_base = xmlMemBlocks();
14694 buffer = gen_const_char_ptr(n_buffer, 0);
14695 size = gen_int(n_size, 1);
14697 ret_val = xmlRecoverMemory((const char *)buffer, size);
14698 desret_xmlDocPtr(ret_val);
14700 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14701 des_int(n_size, size, 1);
14702 xmlResetLastError();
14703 if (mem_base != xmlMemBlocks()) {
14704 printf("Leak of %d blocks found in xmlRecoverMemory",
14705 xmlMemBlocks() - mem_base);
14707 printf(" %d", n_buffer);
14708 printf(" %d", n_size);
14722 test_xmlSAXParseDTD(void) {
14725 #if defined(LIBXML_VALID_ENABLED)
14726 #ifdef LIBXML_SAX1_ENABLED
14729 xmlSAXHandlerPtr sax; /* the SAX handler block */
14731 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14733 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14736 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14737 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14738 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14739 mem_base = xmlMemBlocks();
14740 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14741 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14742 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14744 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14745 desret_xmlDtdPtr(ret_val);
14747 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14748 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14749 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14750 xmlResetLastError();
14751 if (mem_base != xmlMemBlocks()) {
14752 printf("Leak of %d blocks found in xmlSAXParseDTD",
14753 xmlMemBlocks() - mem_base);
14755 printf(" %d", n_sax);
14756 printf(" %d", n_ExternalID);
14757 printf(" %d", n_SystemID);
14772 test_xmlSAXParseDoc(void) {
14775 #if defined(LIBXML_SAX1_ENABLED)
14776 #ifdef LIBXML_SAX1_ENABLED
14779 xmlSAXHandlerPtr sax; /* the SAX handler block */
14781 xmlChar * cur; /* a pointer to an array of xmlChar */
14783 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14786 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14787 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14788 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14789 mem_base = xmlMemBlocks();
14790 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14791 cur = gen_const_xmlChar_ptr(n_cur, 1);
14792 recovery = gen_int(n_recovery, 2);
14794 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14795 desret_xmlDocPtr(ret_val);
14797 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14798 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14799 des_int(n_recovery, recovery, 2);
14800 xmlResetLastError();
14801 if (mem_base != xmlMemBlocks()) {
14802 printf("Leak of %d blocks found in xmlSAXParseDoc",
14803 xmlMemBlocks() - mem_base);
14805 printf(" %d", n_sax);
14806 printf(" %d", n_cur);
14807 printf(" %d", n_recovery);
14822 test_xmlSAXParseEntity(void) {
14825 #if defined(LIBXML_SAX1_ENABLED)
14826 #ifdef LIBXML_SAX1_ENABLED
14829 xmlSAXHandlerPtr sax; /* the SAX handler block */
14831 const char * filename; /* the filename */
14834 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14835 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14836 mem_base = xmlMemBlocks();
14837 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14838 filename = gen_filepath(n_filename, 1);
14840 ret_val = xmlSAXParseEntity(sax, filename);
14841 desret_xmlDocPtr(ret_val);
14843 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14844 des_filepath(n_filename, filename, 1);
14845 xmlResetLastError();
14846 if (mem_base != xmlMemBlocks()) {
14847 printf("Leak of %d blocks found in xmlSAXParseEntity",
14848 xmlMemBlocks() - mem_base);
14850 printf(" %d", n_sax);
14851 printf(" %d", n_filename);
14865 test_xmlSAXParseFile(void) {
14868 #if defined(LIBXML_SAX1_ENABLED)
14869 #ifdef LIBXML_SAX1_ENABLED
14872 xmlSAXHandlerPtr sax; /* the SAX handler block */
14874 const char * filename; /* the filename */
14876 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14879 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14880 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14881 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14882 mem_base = xmlMemBlocks();
14883 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14884 filename = gen_filepath(n_filename, 1);
14885 recovery = gen_int(n_recovery, 2);
14887 ret_val = xmlSAXParseFile(sax, filename, recovery);
14888 desret_xmlDocPtr(ret_val);
14890 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14891 des_filepath(n_filename, filename, 1);
14892 des_int(n_recovery, recovery, 2);
14893 xmlResetLastError();
14894 if (mem_base != xmlMemBlocks()) {
14895 printf("Leak of %d blocks found in xmlSAXParseFile",
14896 xmlMemBlocks() - mem_base);
14898 printf(" %d", n_sax);
14899 printf(" %d", n_filename);
14900 printf(" %d", n_recovery);
14915 test_xmlSAXParseFileWithData(void) {
14918 #if defined(LIBXML_SAX1_ENABLED)
14919 #ifdef LIBXML_SAX1_ENABLED
14922 xmlSAXHandlerPtr sax; /* the SAX handler block */
14924 const char * filename; /* the filename */
14926 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14928 void * data; /* the userdata */
14931 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14932 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14933 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14934 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14935 mem_base = xmlMemBlocks();
14936 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14937 filename = gen_filepath(n_filename, 1);
14938 recovery = gen_int(n_recovery, 2);
14939 data = gen_userdata(n_data, 3);
14941 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14942 desret_xmlDocPtr(ret_val);
14944 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14945 des_filepath(n_filename, filename, 1);
14946 des_int(n_recovery, recovery, 2);
14947 des_userdata(n_data, data, 3);
14948 xmlResetLastError();
14949 if (mem_base != xmlMemBlocks()) {
14950 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14951 xmlMemBlocks() - mem_base);
14953 printf(" %d", n_sax);
14954 printf(" %d", n_filename);
14955 printf(" %d", n_recovery);
14956 printf(" %d", n_data);
14972 test_xmlSAXParseMemory(void) {
14975 #if defined(LIBXML_SAX1_ENABLED)
14976 #ifdef LIBXML_SAX1_ENABLED
14979 xmlSAXHandlerPtr sax; /* the SAX handler block */
14981 char * buffer; /* an pointer to a char array */
14983 int size; /* the size of the array */
14985 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14988 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14989 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14990 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14991 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14992 mem_base = xmlMemBlocks();
14993 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14994 buffer = gen_const_char_ptr(n_buffer, 1);
14995 size = gen_int(n_size, 2);
14996 recovery = gen_int(n_recovery, 3);
14998 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14999 desret_xmlDocPtr(ret_val);
15001 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15002 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15003 des_int(n_size, size, 2);
15004 des_int(n_recovery, recovery, 3);
15005 xmlResetLastError();
15006 if (mem_base != xmlMemBlocks()) {
15007 printf("Leak of %d blocks found in xmlSAXParseMemory",
15008 xmlMemBlocks() - mem_base);
15010 printf(" %d", n_sax);
15011 printf(" %d", n_buffer);
15012 printf(" %d", n_size);
15013 printf(" %d", n_recovery);
15029 test_xmlSAXParseMemoryWithData(void) {
15032 #if defined(LIBXML_SAX1_ENABLED)
15033 #ifdef LIBXML_SAX1_ENABLED
15036 xmlSAXHandlerPtr sax; /* the SAX handler block */
15038 char * buffer; /* an pointer to a char array */
15040 int size; /* the size of the array */
15042 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15044 void * data; /* the userdata */
15047 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15048 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15049 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15050 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15051 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15052 mem_base = xmlMemBlocks();
15053 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15054 buffer = gen_const_char_ptr(n_buffer, 1);
15055 size = gen_int(n_size, 2);
15056 recovery = gen_int(n_recovery, 3);
15057 data = gen_userdata(n_data, 4);
15059 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15060 desret_xmlDocPtr(ret_val);
15062 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15063 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15064 des_int(n_size, size, 2);
15065 des_int(n_recovery, recovery, 3);
15066 des_userdata(n_data, data, 4);
15067 xmlResetLastError();
15068 if (mem_base != xmlMemBlocks()) {
15069 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15070 xmlMemBlocks() - mem_base);
15072 printf(" %d", n_sax);
15073 printf(" %d", n_buffer);
15074 printf(" %d", n_size);
15075 printf(" %d", n_recovery);
15076 printf(" %d", n_data);
15093 test_xmlSAXUserParseFile(void) {
15096 #if defined(LIBXML_SAX1_ENABLED)
15097 #ifdef LIBXML_SAX1_ENABLED
15100 xmlSAXHandlerPtr sax; /* a SAX handler */
15102 void * user_data; /* The user data returned on SAX callbacks */
15104 const char * filename; /* a file name */
15107 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15108 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15109 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15110 mem_base = xmlMemBlocks();
15111 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15112 user_data = gen_userdata(n_user_data, 1);
15113 filename = gen_filepath(n_filename, 2);
15115 #ifdef LIBXML_SAX1_ENABLED
15116 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15120 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15121 desret_int(ret_val);
15123 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15124 des_userdata(n_user_data, user_data, 1);
15125 des_filepath(n_filename, filename, 2);
15126 xmlResetLastError();
15127 if (mem_base != xmlMemBlocks()) {
15128 printf("Leak of %d blocks found in xmlSAXUserParseFile",
15129 xmlMemBlocks() - mem_base);
15131 printf(" %d", n_sax);
15132 printf(" %d", n_user_data);
15133 printf(" %d", n_filename);
15148 test_xmlSAXUserParseMemory(void) {
15151 #if defined(LIBXML_SAX1_ENABLED)
15152 #ifdef LIBXML_SAX1_ENABLED
15155 xmlSAXHandlerPtr sax; /* a SAX handler */
15157 void * user_data; /* The user data returned on SAX callbacks */
15159 char * buffer; /* an in-memory XML document input */
15161 int size; /* the length of the XML document in bytes */
15164 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15165 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15166 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15167 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15168 mem_base = xmlMemBlocks();
15169 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15170 user_data = gen_userdata(n_user_data, 1);
15171 buffer = gen_const_char_ptr(n_buffer, 2);
15172 size = gen_int(n_size, 3);
15174 #ifdef LIBXML_SAX1_ENABLED
15175 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15179 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15180 desret_int(ret_val);
15182 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15183 des_userdata(n_user_data, user_data, 1);
15184 des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15185 des_int(n_size, size, 3);
15186 xmlResetLastError();
15187 if (mem_base != xmlMemBlocks()) {
15188 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15189 xmlMemBlocks() - mem_base);
15191 printf(" %d", n_sax);
15192 printf(" %d", n_user_data);
15193 printf(" %d", n_buffer);
15194 printf(" %d", n_size);
15210 test_xmlSetExternalEntityLoader(void) {
15214 /* missing type support */
15220 test_xmlSetFeature(void) {
15223 #if defined(LIBXML_LEGACY_ENABLED)
15224 #ifdef LIBXML_LEGACY_ENABLED
15227 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15229 char * name; /* the feature name */
15231 void * value; /* pointer to the location of the new value */
15234 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15235 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15236 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15237 mem_base = xmlMemBlocks();
15238 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15239 name = gen_const_char_ptr(n_name, 1);
15240 value = gen_void_ptr(n_value, 2);
15242 ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15243 desret_int(ret_val);
15245 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15246 des_const_char_ptr(n_name, (const char *)name, 1);
15247 des_void_ptr(n_value, value, 2);
15248 xmlResetLastError();
15249 if (mem_base != xmlMemBlocks()) {
15250 printf("Leak of %d blocks found in xmlSetFeature",
15251 xmlMemBlocks() - mem_base);
15253 printf(" %d", n_ctxt);
15254 printf(" %d", n_name);
15255 printf(" %d", n_value);
15270 test_xmlSetupParserForBuffer(void) {
15273 #if defined(LIBXML_SAX1_ENABLED)
15274 #ifdef LIBXML_SAX1_ENABLED
15276 xmlParserCtxtPtr ctxt; /* an XML parser context */
15278 xmlChar * buffer; /* a xmlChar * buffer */
15280 const char * filename; /* a file name */
15283 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15284 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15285 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15286 mem_base = xmlMemBlocks();
15287 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15288 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15289 filename = gen_filepath(n_filename, 2);
15291 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15293 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15294 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15295 des_filepath(n_filename, filename, 2);
15296 xmlResetLastError();
15297 if (mem_base != xmlMemBlocks()) {
15298 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15299 xmlMemBlocks() - mem_base);
15301 printf(" %d", n_ctxt);
15302 printf(" %d", n_buffer);
15303 printf(" %d", n_filename);
15318 test_xmlStopParser(void) {
15321 #ifdef LIBXML_PUSH_ENABLED
15323 xmlParserCtxtPtr ctxt; /* an XML parser context */
15326 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15327 mem_base = xmlMemBlocks();
15328 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15330 xmlStopParser(ctxt);
15332 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15333 xmlResetLastError();
15334 if (mem_base != xmlMemBlocks()) {
15335 printf("Leak of %d blocks found in xmlStopParser",
15336 xmlMemBlocks() - mem_base);
15338 printf(" %d", n_ctxt);
15350 test_xmlSubstituteEntitiesDefault(void) {
15355 int val; /* int 0 or 1 */
15358 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15359 mem_base = xmlMemBlocks();
15360 val = gen_int(n_val, 0);
15362 ret_val = xmlSubstituteEntitiesDefault(val);
15363 desret_int(ret_val);
15365 des_int(n_val, val, 0);
15366 xmlResetLastError();
15367 if (mem_base != xmlMemBlocks()) {
15368 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15369 xmlMemBlocks() - mem_base);
15371 printf(" %d", n_val);
15381 test_parser(void) {
15384 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15385 test_ret += test_xmlByteConsumed();
15386 test_ret += test_xmlClearNodeInfoSeq();
15387 test_ret += test_xmlClearParserCtxt();
15388 test_ret += test_xmlCreateDocParserCtxt();
15389 test_ret += test_xmlCreatePushParserCtxt();
15390 test_ret += test_xmlCtxtReadDoc();
15391 test_ret += test_xmlCtxtReadFile();
15392 test_ret += test_xmlCtxtReadMemory();
15393 test_ret += test_xmlCtxtReset();
15394 test_ret += test_xmlCtxtResetPush();
15395 test_ret += test_xmlCtxtUseOptions();
15396 test_ret += test_xmlGetExternalEntityLoader();
15397 test_ret += test_xmlGetFeature();
15398 test_ret += test_xmlGetFeaturesList();
15399 test_ret += test_xmlHasFeature();
15400 test_ret += test_xmlIOParseDTD();
15401 test_ret += test_xmlInitNodeInfoSeq();
15402 test_ret += test_xmlInitParser();
15403 test_ret += test_xmlInitParserCtxt();
15404 test_ret += test_xmlKeepBlanksDefault();
15405 test_ret += test_xmlLineNumbersDefault();
15406 test_ret += test_xmlLoadExternalEntity();
15407 test_ret += test_xmlNewIOInputStream();
15408 test_ret += test_xmlNewParserCtxt();
15409 test_ret += test_xmlParseBalancedChunkMemory();
15410 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15411 test_ret += test_xmlParseChunk();
15412 test_ret += test_xmlParseCtxtExternalEntity();
15413 test_ret += test_xmlParseDTD();
15414 test_ret += test_xmlParseDoc();
15415 test_ret += test_xmlParseDocument();
15416 test_ret += test_xmlParseEntity();
15417 test_ret += test_xmlParseExtParsedEnt();
15418 test_ret += test_xmlParseExternalEntity();
15419 test_ret += test_xmlParseFile();
15420 test_ret += test_xmlParseInNodeContext();
15421 test_ret += test_xmlParseMemory();
15422 test_ret += test_xmlParserAddNodeInfo();
15423 test_ret += test_xmlParserFindNodeInfo();
15424 test_ret += test_xmlParserFindNodeInfoIndex();
15425 test_ret += test_xmlParserInputGrow();
15426 test_ret += test_xmlParserInputRead();
15427 test_ret += test_xmlPedanticParserDefault();
15428 test_ret += test_xmlReadDoc();
15429 test_ret += test_xmlReadFile();
15430 test_ret += test_xmlReadMemory();
15431 test_ret += test_xmlRecoverDoc();
15432 test_ret += test_xmlRecoverFile();
15433 test_ret += test_xmlRecoverMemory();
15434 test_ret += test_xmlSAXParseDTD();
15435 test_ret += test_xmlSAXParseDoc();
15436 test_ret += test_xmlSAXParseEntity();
15437 test_ret += test_xmlSAXParseFile();
15438 test_ret += test_xmlSAXParseFileWithData();
15439 test_ret += test_xmlSAXParseMemory();
15440 test_ret += test_xmlSAXParseMemoryWithData();
15441 test_ret += test_xmlSAXUserParseFile();
15442 test_ret += test_xmlSAXUserParseMemory();
15443 test_ret += test_xmlSetExternalEntityLoader();
15444 test_ret += test_xmlSetFeature();
15445 test_ret += test_xmlSetupParserForBuffer();
15446 test_ret += test_xmlStopParser();
15447 test_ret += test_xmlSubstituteEntitiesDefault();
15450 printf("Module parser: %d errors\n", test_ret);
15455 test_htmlCreateFileParserCtxt(void) {
15458 #if defined(LIBXML_HTML_ENABLED)
15460 htmlParserCtxtPtr ret_val;
15461 const char * filename; /* the filename */
15463 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15466 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15467 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15468 mem_base = xmlMemBlocks();
15469 filename = gen_fileoutput(n_filename, 0);
15470 encoding = gen_const_char_ptr(n_encoding, 1);
15472 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15473 desret_htmlParserCtxtPtr(ret_val);
15475 des_fileoutput(n_filename, filename, 0);
15476 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15477 xmlResetLastError();
15478 if (mem_base != xmlMemBlocks()) {
15479 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15480 xmlMemBlocks() - mem_base);
15482 printf(" %d", n_filename);
15483 printf(" %d", n_encoding);
15496 test_htmlInitAutoClose(void) {
15499 #if defined(LIBXML_HTML_ENABLED)
15502 mem_base = xmlMemBlocks();
15504 htmlInitAutoClose();
15506 xmlResetLastError();
15507 if (mem_base != xmlMemBlocks()) {
15508 printf("Leak of %d blocks found in htmlInitAutoClose",
15509 xmlMemBlocks() - mem_base);
15521 test_inputPop(void) {
15525 xmlParserInputPtr ret_val;
15526 xmlParserCtxtPtr ctxt; /* an XML parser context */
15529 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15530 mem_base = xmlMemBlocks();
15531 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15533 ret_val = inputPop(ctxt);
15534 desret_xmlParserInputPtr(ret_val);
15536 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15537 xmlResetLastError();
15538 if (mem_base != xmlMemBlocks()) {
15539 printf("Leak of %d blocks found in inputPop",
15540 xmlMemBlocks() - mem_base);
15542 printf(" %d", n_ctxt);
15553 test_inputPush(void) {
15558 xmlParserCtxtPtr ctxt; /* an XML parser context */
15560 xmlParserInputPtr value; /* the parser input */
15563 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15564 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15565 mem_base = xmlMemBlocks();
15566 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15567 value = gen_xmlParserInputPtr(n_value, 1);
15569 ret_val = inputPush(ctxt, value);
15570 desret_int(ret_val);
15572 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15573 des_xmlParserInputPtr(n_value, value, 1);
15574 xmlResetLastError();
15575 if (mem_base != xmlMemBlocks()) {
15576 printf("Leak of %d blocks found in inputPush",
15577 xmlMemBlocks() - mem_base);
15579 printf(" %d", n_ctxt);
15580 printf(" %d", n_value);
15592 test_namePop(void) {
15596 const xmlChar * ret_val;
15597 xmlParserCtxtPtr ctxt; /* an XML parser context */
15600 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15601 mem_base = xmlMemBlocks();
15602 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15604 ret_val = namePop(ctxt);
15605 desret_const_xmlChar_ptr(ret_val);
15607 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15608 xmlResetLastError();
15609 if (mem_base != xmlMemBlocks()) {
15610 printf("Leak of %d blocks found in namePop",
15611 xmlMemBlocks() - mem_base);
15613 printf(" %d", n_ctxt);
15624 test_namePush(void) {
15629 xmlParserCtxtPtr ctxt; /* an XML parser context */
15631 xmlChar * value; /* the element name */
15634 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15635 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15636 mem_base = xmlMemBlocks();
15637 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15638 value = gen_const_xmlChar_ptr(n_value, 1);
15640 ret_val = namePush(ctxt, (const xmlChar *)value);
15641 desret_int(ret_val);
15643 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15644 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15645 xmlResetLastError();
15646 if (mem_base != xmlMemBlocks()) {
15647 printf("Leak of %d blocks found in namePush",
15648 xmlMemBlocks() - mem_base);
15650 printf(" %d", n_ctxt);
15651 printf(" %d", n_value);
15663 test_nodePop(void) {
15667 xmlNodePtr ret_val;
15668 xmlParserCtxtPtr ctxt; /* an XML parser context */
15671 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15672 mem_base = xmlMemBlocks();
15673 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15675 ret_val = nodePop(ctxt);
15676 desret_xmlNodePtr(ret_val);
15678 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15679 xmlResetLastError();
15680 if (mem_base != xmlMemBlocks()) {
15681 printf("Leak of %d blocks found in nodePop",
15682 xmlMemBlocks() - mem_base);
15684 printf(" %d", n_ctxt);
15695 test_nodePush(void) {
15700 xmlParserCtxtPtr ctxt; /* an XML parser context */
15702 xmlNodePtr value; /* the element node */
15705 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15706 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15707 mem_base = xmlMemBlocks();
15708 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15709 value = gen_xmlNodePtr(n_value, 1);
15711 ret_val = nodePush(ctxt, value);
15712 desret_int(ret_val);
15714 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15715 des_xmlNodePtr(n_value, value, 1);
15716 xmlResetLastError();
15717 if (mem_base != xmlMemBlocks()) {
15718 printf("Leak of %d blocks found in nodePush",
15719 xmlMemBlocks() - mem_base);
15721 printf(" %d", n_ctxt);
15722 printf(" %d", n_value);
15734 test_xmlCheckLanguageID(void) {
15739 xmlChar * lang; /* pointer to the string value */
15742 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15743 mem_base = xmlMemBlocks();
15744 lang = gen_const_xmlChar_ptr(n_lang, 0);
15746 ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15747 desret_int(ret_val);
15749 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15750 xmlResetLastError();
15751 if (mem_base != xmlMemBlocks()) {
15752 printf("Leak of %d blocks found in xmlCheckLanguageID",
15753 xmlMemBlocks() - mem_base);
15755 printf(" %d", n_lang);
15766 test_xmlCopyChar(void) {
15771 int len; /* Ignored, compatibility */
15773 xmlChar * out; /* pointer to an array of xmlChar */
15775 int val; /* the char value */
15778 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15779 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15780 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15781 mem_base = xmlMemBlocks();
15782 len = gen_int(n_len, 0);
15783 out = gen_xmlChar_ptr(n_out, 1);
15784 val = gen_int(n_val, 2);
15786 ret_val = xmlCopyChar(len, out, val);
15787 desret_int(ret_val);
15789 des_int(n_len, len, 0);
15790 des_xmlChar_ptr(n_out, out, 1);
15791 des_int(n_val, val, 2);
15792 xmlResetLastError();
15793 if (mem_base != xmlMemBlocks()) {
15794 printf("Leak of %d blocks found in xmlCopyChar",
15795 xmlMemBlocks() - mem_base);
15797 printf(" %d", n_len);
15798 printf(" %d", n_out);
15799 printf(" %d", n_val);
15812 test_xmlCopyCharMultiByte(void) {
15817 xmlChar * out; /* pointer to an array of xmlChar */
15819 int val; /* the char value */
15822 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15823 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15824 mem_base = xmlMemBlocks();
15825 out = gen_xmlChar_ptr(n_out, 0);
15826 val = gen_int(n_val, 1);
15828 ret_val = xmlCopyCharMultiByte(out, val);
15829 desret_int(ret_val);
15831 des_xmlChar_ptr(n_out, out, 0);
15832 des_int(n_val, val, 1);
15833 xmlResetLastError();
15834 if (mem_base != xmlMemBlocks()) {
15835 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15836 xmlMemBlocks() - mem_base);
15838 printf(" %d", n_out);
15839 printf(" %d", n_val);
15851 test_xmlCreateEntityParserCtxt(void) {
15855 xmlParserCtxtPtr ret_val;
15856 xmlChar * URL; /* the entity URL */
15858 xmlChar * ID; /* the entity PUBLIC ID */
15860 xmlChar * base; /* a possible base for the target URI */
15863 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15864 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15865 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15866 mem_base = xmlMemBlocks();
15867 URL = gen_const_xmlChar_ptr(n_URL, 0);
15868 ID = gen_const_xmlChar_ptr(n_ID, 1);
15869 base = gen_const_xmlChar_ptr(n_base, 2);
15871 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15872 desret_xmlParserCtxtPtr(ret_val);
15874 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15875 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15876 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15877 xmlResetLastError();
15878 if (mem_base != xmlMemBlocks()) {
15879 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15880 xmlMemBlocks() - mem_base);
15882 printf(" %d", n_URL);
15883 printf(" %d", n_ID);
15884 printf(" %d", n_base);
15897 test_xmlCreateFileParserCtxt(void) {
15901 xmlParserCtxtPtr ret_val;
15902 const char * filename; /* the filename */
15905 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15906 mem_base = xmlMemBlocks();
15907 filename = gen_fileoutput(n_filename, 0);
15909 ret_val = xmlCreateFileParserCtxt(filename);
15910 desret_xmlParserCtxtPtr(ret_val);
15912 des_fileoutput(n_filename, filename, 0);
15913 xmlResetLastError();
15914 if (mem_base != xmlMemBlocks()) {
15915 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15916 xmlMemBlocks() - mem_base);
15918 printf(" %d", n_filename);
15929 test_xmlCreateMemoryParserCtxt(void) {
15933 xmlParserCtxtPtr ret_val;
15934 char * buffer; /* a pointer to a char array */
15936 int size; /* the size of the array */
15939 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15940 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15941 mem_base = xmlMemBlocks();
15942 buffer = gen_const_char_ptr(n_buffer, 0);
15943 size = gen_int(n_size, 1);
15945 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15946 desret_xmlParserCtxtPtr(ret_val);
15948 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15949 des_int(n_size, size, 1);
15950 xmlResetLastError();
15951 if (mem_base != xmlMemBlocks()) {
15952 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15953 xmlMemBlocks() - mem_base);
15955 printf(" %d", n_buffer);
15956 printf(" %d", n_size);
15968 test_xmlCreateURLParserCtxt(void) {
15972 xmlParserCtxtPtr ret_val;
15973 const char * filename; /* the filename or URL */
15975 int options; /* a combination of xmlParserOption */
15978 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15979 for (n_options = 0;n_options < gen_nb_int;n_options++) {
15980 mem_base = xmlMemBlocks();
15981 filename = gen_fileoutput(n_filename, 0);
15982 options = gen_int(n_options, 1);
15984 ret_val = xmlCreateURLParserCtxt(filename, options);
15985 desret_xmlParserCtxtPtr(ret_val);
15987 des_fileoutput(n_filename, filename, 0);
15988 des_int(n_options, options, 1);
15989 xmlResetLastError();
15990 if (mem_base != xmlMemBlocks()) {
15991 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15992 xmlMemBlocks() - mem_base);
15994 printf(" %d", n_filename);
15995 printf(" %d", n_options);
16007 test_xmlCurrentChar(void) {
16012 xmlParserCtxtPtr ctxt; /* the XML parser context */
16014 int * len; /* pointer to the length of the char read */
16017 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16018 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16019 mem_base = xmlMemBlocks();
16020 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16021 len = gen_int_ptr(n_len, 1);
16023 ret_val = xmlCurrentChar(ctxt, len);
16024 desret_int(ret_val);
16026 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16027 des_int_ptr(n_len, len, 1);
16028 xmlResetLastError();
16029 if (mem_base != xmlMemBlocks()) {
16030 printf("Leak of %d blocks found in xmlCurrentChar",
16031 xmlMemBlocks() - mem_base);
16033 printf(" %d", n_ctxt);
16034 printf(" %d", n_len);
16046 test_xmlErrMemory(void) {
16050 xmlParserCtxtPtr ctxt; /* an XML parser context */
16052 char * extra; /* extra informations */
16055 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16056 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16057 mem_base = xmlMemBlocks();
16058 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16059 extra = gen_const_char_ptr(n_extra, 1);
16061 xmlErrMemory(ctxt, (const char *)extra);
16063 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16064 des_const_char_ptr(n_extra, (const char *)extra, 1);
16065 xmlResetLastError();
16066 if (mem_base != xmlMemBlocks()) {
16067 printf("Leak of %d blocks found in xmlErrMemory",
16068 xmlMemBlocks() - mem_base);
16070 printf(" %d", n_ctxt);
16071 printf(" %d", n_extra);
16083 test_xmlIsLetter(void) {
16088 int c; /* an unicode character (int) */
16091 for (n_c = 0;n_c < gen_nb_int;n_c++) {
16092 mem_base = xmlMemBlocks();
16093 c = gen_int(n_c, 0);
16095 ret_val = xmlIsLetter(c);
16096 desret_int(ret_val);
16098 des_int(n_c, c, 0);
16099 xmlResetLastError();
16100 if (mem_base != xmlMemBlocks()) {
16101 printf("Leak of %d blocks found in xmlIsLetter",
16102 xmlMemBlocks() - mem_base);
16104 printf(" %d", n_c);
16115 test_xmlNewEntityInputStream(void) {
16119 xmlParserInputPtr ret_val;
16120 xmlParserCtxtPtr ctxt; /* an XML parser context */
16122 xmlEntityPtr entity; /* an Entity pointer */
16125 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16126 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16127 mem_base = xmlMemBlocks();
16128 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16129 entity = gen_xmlEntityPtr(n_entity, 1);
16131 ret_val = xmlNewEntityInputStream(ctxt, entity);
16132 desret_xmlParserInputPtr(ret_val);
16134 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16135 des_xmlEntityPtr(n_entity, entity, 1);
16136 xmlResetLastError();
16137 if (mem_base != xmlMemBlocks()) {
16138 printf("Leak of %d blocks found in xmlNewEntityInputStream",
16139 xmlMemBlocks() - mem_base);
16141 printf(" %d", n_ctxt);
16142 printf(" %d", n_entity);
16154 test_xmlNewInputFromFile(void) {
16158 xmlParserInputPtr ret_val;
16159 xmlParserCtxtPtr ctxt; /* an XML parser context */
16161 const char * filename; /* the filename to use as entity */
16164 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16165 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16166 mem_base = xmlMemBlocks();
16167 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16168 filename = gen_filepath(n_filename, 1);
16170 ret_val = xmlNewInputFromFile(ctxt, filename);
16171 desret_xmlParserInputPtr(ret_val);
16173 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16174 des_filepath(n_filename, filename, 1);
16175 xmlResetLastError();
16176 if (mem_base != xmlMemBlocks()) {
16177 printf("Leak of %d blocks found in xmlNewInputFromFile",
16178 xmlMemBlocks() - mem_base);
16180 printf(" %d", n_ctxt);
16181 printf(" %d", n_filename);
16193 test_xmlNewInputStream(void) {
16197 xmlParserInputPtr ret_val;
16198 xmlParserCtxtPtr ctxt; /* an XML parser context */
16201 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16202 mem_base = xmlMemBlocks();
16203 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16205 ret_val = xmlNewInputStream(ctxt);
16206 desret_xmlParserInputPtr(ret_val);
16208 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16209 xmlResetLastError();
16210 if (mem_base != xmlMemBlocks()) {
16211 printf("Leak of %d blocks found in xmlNewInputStream",
16212 xmlMemBlocks() - mem_base);
16214 printf(" %d", n_ctxt);
16225 test_xmlNewStringInputStream(void) {
16229 xmlParserInputPtr ret_val;
16230 xmlParserCtxtPtr ctxt; /* an XML parser context */
16232 xmlChar * buffer; /* an memory buffer */
16235 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16236 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16237 mem_base = xmlMemBlocks();
16238 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16239 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16241 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16242 desret_xmlParserInputPtr(ret_val);
16244 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16245 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16246 xmlResetLastError();
16247 if (mem_base != xmlMemBlocks()) {
16248 printf("Leak of %d blocks found in xmlNewStringInputStream",
16249 xmlMemBlocks() - mem_base);
16251 printf(" %d", n_ctxt);
16252 printf(" %d", n_buffer);
16264 test_xmlNextChar(void) {
16268 xmlParserCtxtPtr ctxt; /* the XML parser context */
16271 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16272 mem_base = xmlMemBlocks();
16273 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16277 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16278 xmlResetLastError();
16279 if (mem_base != xmlMemBlocks()) {
16280 printf("Leak of %d blocks found in xmlNextChar",
16281 xmlMemBlocks() - mem_base);
16283 printf(" %d", n_ctxt);
16294 test_xmlParserInputShrink(void) {
16298 xmlParserInputPtr in; /* an XML parser input */
16301 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16302 mem_base = xmlMemBlocks();
16303 in = gen_xmlParserInputPtr(n_in, 0);
16305 xmlParserInputShrink(in);
16307 des_xmlParserInputPtr(n_in, in, 0);
16308 xmlResetLastError();
16309 if (mem_base != xmlMemBlocks()) {
16310 printf("Leak of %d blocks found in xmlParserInputShrink",
16311 xmlMemBlocks() - mem_base);
16313 printf(" %d", n_in);
16324 test_xmlPopInput(void) {
16329 xmlParserCtxtPtr ctxt; /* an XML parser context */
16332 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16333 mem_base = xmlMemBlocks();
16334 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16336 ret_val = xmlPopInput(ctxt);
16337 desret_xmlChar(ret_val);
16339 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16340 xmlResetLastError();
16341 if (mem_base != xmlMemBlocks()) {
16342 printf("Leak of %d blocks found in xmlPopInput",
16343 xmlMemBlocks() - mem_base);
16345 printf(" %d", n_ctxt);
16356 test_xmlPushInput(void) {
16361 xmlParserCtxtPtr ctxt; /* an XML parser context */
16363 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16366 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16367 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16368 mem_base = xmlMemBlocks();
16369 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16370 input = gen_xmlParserInputPtr(n_input, 1);
16372 ret_val = xmlPushInput(ctxt, input);
16373 desret_int(ret_val);
16375 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16376 des_xmlParserInputPtr(n_input, input, 1);
16377 xmlResetLastError();
16378 if (mem_base != xmlMemBlocks()) {
16379 printf("Leak of %d blocks found in xmlPushInput",
16380 xmlMemBlocks() - mem_base);
16382 printf(" %d", n_ctxt);
16383 printf(" %d", n_input);
16395 test_xmlSetEntityReferenceFunc(void) {
16399 /* missing type support */
16405 test_xmlSplitQName(void) {
16410 xmlParserCtxtPtr ctxt; /* an XML parser context */
16412 xmlChar * name; /* an XML parser context */
16414 xmlChar ** prefix; /* a xmlChar ** */
16417 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16418 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16419 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16420 mem_base = xmlMemBlocks();
16421 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16422 name = gen_const_xmlChar_ptr(n_name, 1);
16423 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16425 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16426 desret_xmlChar_ptr(ret_val);
16428 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16429 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16430 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16431 xmlResetLastError();
16432 if (mem_base != xmlMemBlocks()) {
16433 printf("Leak of %d blocks found in xmlSplitQName",
16434 xmlMemBlocks() - mem_base);
16436 printf(" %d", n_ctxt);
16437 printf(" %d", n_name);
16438 printf(" %d", n_prefix);
16451 test_xmlStringCurrentChar(void) {
16456 xmlParserCtxtPtr ctxt; /* the XML parser context */
16458 xmlChar * cur; /* pointer to the beginning of the char */
16460 int * len; /* pointer to the length of the char read */
16463 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16464 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16465 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16466 mem_base = xmlMemBlocks();
16467 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16468 cur = gen_const_xmlChar_ptr(n_cur, 1);
16469 len = gen_int_ptr(n_len, 2);
16471 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16472 desret_int(ret_val);
16474 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16475 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16476 des_int_ptr(n_len, len, 2);
16477 xmlResetLastError();
16478 if (mem_base != xmlMemBlocks()) {
16479 printf("Leak of %d blocks found in xmlStringCurrentChar",
16480 xmlMemBlocks() - mem_base);
16482 printf(" %d", n_ctxt);
16483 printf(" %d", n_cur);
16484 printf(" %d", n_len);
16497 test_xmlStringDecodeEntities(void) {
16502 xmlParserCtxtPtr ctxt; /* the parser context */
16504 xmlChar * str; /* the input string */
16506 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16508 xmlChar end; /* an end marker xmlChar, 0 if none */
16510 xmlChar end2; /* an end marker xmlChar, 0 if none */
16512 xmlChar end3; /* an end marker xmlChar, 0 if none */
16515 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16516 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16517 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16518 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16519 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16520 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16521 mem_base = xmlMemBlocks();
16522 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16523 str = gen_const_xmlChar_ptr(n_str, 1);
16524 what = gen_int(n_what, 2);
16525 end = gen_xmlChar(n_end, 3);
16526 end2 = gen_xmlChar(n_end2, 4);
16527 end3 = gen_xmlChar(n_end3, 5);
16529 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16530 desret_xmlChar_ptr(ret_val);
16532 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16533 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16534 des_int(n_what, what, 2);
16535 des_xmlChar(n_end, end, 3);
16536 des_xmlChar(n_end2, end2, 4);
16537 des_xmlChar(n_end3, end3, 5);
16538 xmlResetLastError();
16539 if (mem_base != xmlMemBlocks()) {
16540 printf("Leak of %d blocks found in xmlStringDecodeEntities",
16541 xmlMemBlocks() - mem_base);
16543 printf(" %d", n_ctxt);
16544 printf(" %d", n_str);
16545 printf(" %d", n_what);
16546 printf(" %d", n_end);
16547 printf(" %d", n_end2);
16548 printf(" %d", n_end3);
16564 test_xmlStringLenDecodeEntities(void) {
16569 xmlParserCtxtPtr ctxt; /* the parser context */
16571 xmlChar * str; /* the input string */
16573 int len; /* the string length */
16575 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16577 xmlChar end; /* an end marker xmlChar, 0 if none */
16579 xmlChar end2; /* an end marker xmlChar, 0 if none */
16581 xmlChar end3; /* an end marker xmlChar, 0 if none */
16584 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16585 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16586 for (n_len = 0;n_len < gen_nb_int;n_len++) {
16587 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16588 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16589 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16590 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16591 mem_base = xmlMemBlocks();
16592 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16593 str = gen_const_xmlChar_ptr(n_str, 1);
16594 len = gen_int(n_len, 2);
16595 what = gen_int(n_what, 3);
16596 end = gen_xmlChar(n_end, 4);
16597 end2 = gen_xmlChar(n_end2, 5);
16598 end3 = gen_xmlChar(n_end3, 6);
16600 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16601 desret_xmlChar_ptr(ret_val);
16603 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16604 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16605 des_int(n_len, len, 2);
16606 des_int(n_what, what, 3);
16607 des_xmlChar(n_end, end, 4);
16608 des_xmlChar(n_end2, end2, 5);
16609 des_xmlChar(n_end3, end3, 6);
16610 xmlResetLastError();
16611 if (mem_base != xmlMemBlocks()) {
16612 printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16613 xmlMemBlocks() - mem_base);
16615 printf(" %d", n_ctxt);
16616 printf(" %d", n_str);
16617 printf(" %d", n_len);
16618 printf(" %d", n_what);
16619 printf(" %d", n_end);
16620 printf(" %d", n_end2);
16621 printf(" %d", n_end3);
16638 test_xmlSwitchEncoding(void) {
16643 xmlParserCtxtPtr ctxt; /* the parser context */
16645 xmlCharEncoding enc; /* the encoding value (number) */
16648 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16649 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16650 mem_base = xmlMemBlocks();
16651 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16652 enc = gen_xmlCharEncoding(n_enc, 1);
16654 ret_val = xmlSwitchEncoding(ctxt, enc);
16655 desret_int(ret_val);
16657 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16658 des_xmlCharEncoding(n_enc, enc, 1);
16659 xmlResetLastError();
16660 if (mem_base != xmlMemBlocks()) {
16661 printf("Leak of %d blocks found in xmlSwitchEncoding",
16662 xmlMemBlocks() - mem_base);
16664 printf(" %d", n_ctxt);
16665 printf(" %d", n_enc);
16677 test_xmlSwitchInputEncoding(void) {
16682 xmlParserCtxtPtr ctxt; /* the parser context */
16684 xmlParserInputPtr input; /* the input stream */
16686 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16689 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16690 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16691 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16692 mem_base = xmlMemBlocks();
16693 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16694 input = gen_xmlParserInputPtr(n_input, 1);
16695 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16697 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16698 desret_int(ret_val);
16700 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16701 des_xmlParserInputPtr(n_input, input, 1);
16702 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16703 xmlResetLastError();
16704 if (mem_base != xmlMemBlocks()) {
16705 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16706 xmlMemBlocks() - mem_base);
16708 printf(" %d", n_ctxt);
16709 printf(" %d", n_input);
16710 printf(" %d", n_handler);
16723 test_xmlSwitchToEncoding(void) {
16728 xmlParserCtxtPtr ctxt; /* the parser context */
16730 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16733 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16734 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16735 mem_base = xmlMemBlocks();
16736 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16737 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16739 ret_val = xmlSwitchToEncoding(ctxt, handler);
16740 desret_int(ret_val);
16742 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16743 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16744 xmlResetLastError();
16745 if (mem_base != xmlMemBlocks()) {
16746 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16747 xmlMemBlocks() - mem_base);
16749 printf(" %d", n_ctxt);
16750 printf(" %d", n_handler);
16761 test_parserInternals(void) {
16764 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16765 test_ret += test_htmlCreateFileParserCtxt();
16766 test_ret += test_htmlInitAutoClose();
16767 test_ret += test_inputPop();
16768 test_ret += test_inputPush();
16769 test_ret += test_namePop();
16770 test_ret += test_namePush();
16771 test_ret += test_nodePop();
16772 test_ret += test_nodePush();
16773 test_ret += test_xmlCheckLanguageID();
16774 test_ret += test_xmlCopyChar();
16775 test_ret += test_xmlCopyCharMultiByte();
16776 test_ret += test_xmlCreateEntityParserCtxt();
16777 test_ret += test_xmlCreateFileParserCtxt();
16778 test_ret += test_xmlCreateMemoryParserCtxt();
16779 test_ret += test_xmlCreateURLParserCtxt();
16780 test_ret += test_xmlCurrentChar();
16781 test_ret += test_xmlErrMemory();
16782 test_ret += test_xmlIsLetter();
16783 test_ret += test_xmlNewEntityInputStream();
16784 test_ret += test_xmlNewInputFromFile();
16785 test_ret += test_xmlNewInputStream();
16786 test_ret += test_xmlNewStringInputStream();
16787 test_ret += test_xmlNextChar();
16788 test_ret += test_xmlParserInputShrink();
16789 test_ret += test_xmlPopInput();
16790 test_ret += test_xmlPushInput();
16791 test_ret += test_xmlSetEntityReferenceFunc();
16792 test_ret += test_xmlSplitQName();
16793 test_ret += test_xmlStringCurrentChar();
16794 test_ret += test_xmlStringDecodeEntities();
16795 test_ret += test_xmlStringLenDecodeEntities();
16796 test_ret += test_xmlSwitchEncoding();
16797 test_ret += test_xmlSwitchInputEncoding();
16798 test_ret += test_xmlSwitchToEncoding();
16801 printf("Module parserInternals: %d errors\n", test_ret);
16806 test_xmlPatternFromRoot(void) {
16809 #if defined(LIBXML_PATTERN_ENABLED)
16812 xmlPatternPtr comp; /* the precompiled pattern */
16815 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16816 mem_base = xmlMemBlocks();
16817 comp = gen_xmlPatternPtr(n_comp, 0);
16819 ret_val = xmlPatternFromRoot(comp);
16820 desret_int(ret_val);
16822 des_xmlPatternPtr(n_comp, comp, 0);
16823 xmlResetLastError();
16824 if (mem_base != xmlMemBlocks()) {
16825 printf("Leak of %d blocks found in xmlPatternFromRoot",
16826 xmlMemBlocks() - mem_base);
16828 printf(" %d", n_comp);
16840 test_xmlPatternGetStreamCtxt(void) {
16844 /* missing type support */
16850 test_xmlPatternMatch(void) {
16853 #if defined(LIBXML_PATTERN_ENABLED)
16856 xmlPatternPtr comp; /* the precompiled pattern */
16858 xmlNodePtr node; /* a node */
16861 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16862 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16863 mem_base = xmlMemBlocks();
16864 comp = gen_xmlPatternPtr(n_comp, 0);
16865 node = gen_xmlNodePtr(n_node, 1);
16867 ret_val = xmlPatternMatch(comp, node);
16868 desret_int(ret_val);
16870 des_xmlPatternPtr(n_comp, comp, 0);
16871 des_xmlNodePtr(n_node, node, 1);
16872 xmlResetLastError();
16873 if (mem_base != xmlMemBlocks()) {
16874 printf("Leak of %d blocks found in xmlPatternMatch",
16875 xmlMemBlocks() - mem_base);
16877 printf(" %d", n_comp);
16878 printf(" %d", n_node);
16891 test_xmlPatternMaxDepth(void) {
16894 #if defined(LIBXML_PATTERN_ENABLED)
16897 xmlPatternPtr comp; /* the precompiled pattern */
16900 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16901 mem_base = xmlMemBlocks();
16902 comp = gen_xmlPatternPtr(n_comp, 0);
16904 ret_val = xmlPatternMaxDepth(comp);
16905 desret_int(ret_val);
16907 des_xmlPatternPtr(n_comp, comp, 0);
16908 xmlResetLastError();
16909 if (mem_base != xmlMemBlocks()) {
16910 printf("Leak of %d blocks found in xmlPatternMaxDepth",
16911 xmlMemBlocks() - mem_base);
16913 printf(" %d", n_comp);
16925 test_xmlPatternMinDepth(void) {
16928 #if defined(LIBXML_PATTERN_ENABLED)
16931 xmlPatternPtr comp; /* the precompiled pattern */
16934 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16935 mem_base = xmlMemBlocks();
16936 comp = gen_xmlPatternPtr(n_comp, 0);
16938 ret_val = xmlPatternMinDepth(comp);
16939 desret_int(ret_val);
16941 des_xmlPatternPtr(n_comp, comp, 0);
16942 xmlResetLastError();
16943 if (mem_base != xmlMemBlocks()) {
16944 printf("Leak of %d blocks found in xmlPatternMinDepth",
16945 xmlMemBlocks() - mem_base);
16947 printf(" %d", n_comp);
16959 test_xmlPatternStreamable(void) {
16962 #if defined(LIBXML_PATTERN_ENABLED)
16965 xmlPatternPtr comp; /* the precompiled pattern */
16968 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16969 mem_base = xmlMemBlocks();
16970 comp = gen_xmlPatternPtr(n_comp, 0);
16972 ret_val = xmlPatternStreamable(comp);
16973 desret_int(ret_val);
16975 des_xmlPatternPtr(n_comp, comp, 0);
16976 xmlResetLastError();
16977 if (mem_base != xmlMemBlocks()) {
16978 printf("Leak of %d blocks found in xmlPatternStreamable",
16979 xmlMemBlocks() - mem_base);
16981 printf(" %d", n_comp);
16993 test_xmlPatterncompile(void) {
16997 /* missing type support */
17001 #ifdef LIBXML_PATTERN_ENABLED
17003 #define gen_nb_xmlStreamCtxtPtr 1
17004 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17007 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17013 test_xmlStreamPop(void) {
17016 #if defined(LIBXML_PATTERN_ENABLED)
17019 xmlStreamCtxtPtr stream; /* the stream context */
17022 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17023 mem_base = xmlMemBlocks();
17024 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17026 ret_val = xmlStreamPop(stream);
17027 desret_int(ret_val);
17029 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17030 xmlResetLastError();
17031 if (mem_base != xmlMemBlocks()) {
17032 printf("Leak of %d blocks found in xmlStreamPop",
17033 xmlMemBlocks() - mem_base);
17035 printf(" %d", n_stream);
17047 test_xmlStreamPush(void) {
17050 #if defined(LIBXML_PATTERN_ENABLED)
17053 xmlStreamCtxtPtr stream; /* the stream context */
17055 xmlChar * name; /* the current name */
17057 xmlChar * ns; /* the namespace name */
17060 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17061 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17062 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17063 mem_base = xmlMemBlocks();
17064 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17065 name = gen_const_xmlChar_ptr(n_name, 1);
17066 ns = gen_const_xmlChar_ptr(n_ns, 2);
17068 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17069 desret_int(ret_val);
17071 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17072 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17073 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17074 xmlResetLastError();
17075 if (mem_base != xmlMemBlocks()) {
17076 printf("Leak of %d blocks found in xmlStreamPush",
17077 xmlMemBlocks() - mem_base);
17079 printf(" %d", n_stream);
17080 printf(" %d", n_name);
17081 printf(" %d", n_ns);
17095 test_xmlStreamPushAttr(void) {
17098 #if defined(LIBXML_PATTERN_ENABLED)
17101 xmlStreamCtxtPtr stream; /* the stream context */
17103 xmlChar * name; /* the current name */
17105 xmlChar * ns; /* the namespace name */
17108 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17109 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17110 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17111 mem_base = xmlMemBlocks();
17112 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17113 name = gen_const_xmlChar_ptr(n_name, 1);
17114 ns = gen_const_xmlChar_ptr(n_ns, 2);
17116 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17117 desret_int(ret_val);
17119 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17120 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17121 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17122 xmlResetLastError();
17123 if (mem_base != xmlMemBlocks()) {
17124 printf("Leak of %d blocks found in xmlStreamPushAttr",
17125 xmlMemBlocks() - mem_base);
17127 printf(" %d", n_stream);
17128 printf(" %d", n_name);
17129 printf(" %d", n_ns);
17143 test_xmlStreamPushNode(void) {
17146 #if defined(LIBXML_PATTERN_ENABLED)
17149 xmlStreamCtxtPtr stream; /* the stream context */
17151 xmlChar * name; /* the current name */
17153 xmlChar * ns; /* the namespace name */
17155 int nodeType; /* the type of the node being pushed */
17158 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17159 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17160 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17161 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17162 mem_base = xmlMemBlocks();
17163 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17164 name = gen_const_xmlChar_ptr(n_name, 1);
17165 ns = gen_const_xmlChar_ptr(n_ns, 2);
17166 nodeType = gen_int(n_nodeType, 3);
17168 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17169 desret_int(ret_val);
17171 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17172 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17173 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17174 des_int(n_nodeType, nodeType, 3);
17175 xmlResetLastError();
17176 if (mem_base != xmlMemBlocks()) {
17177 printf("Leak of %d blocks found in xmlStreamPushNode",
17178 xmlMemBlocks() - mem_base);
17180 printf(" %d", n_stream);
17181 printf(" %d", n_name);
17182 printf(" %d", n_ns);
17183 printf(" %d", n_nodeType);
17198 test_xmlStreamWantsAnyNode(void) {
17201 #if defined(LIBXML_PATTERN_ENABLED)
17204 xmlStreamCtxtPtr streamCtxt; /* the stream context */
17207 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17208 mem_base = xmlMemBlocks();
17209 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17211 ret_val = xmlStreamWantsAnyNode(streamCtxt);
17212 desret_int(ret_val);
17214 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17215 xmlResetLastError();
17216 if (mem_base != xmlMemBlocks()) {
17217 printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17218 xmlMemBlocks() - mem_base);
17220 printf(" %d", n_streamCtxt);
17231 test_pattern(void) {
17234 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17235 test_ret += test_xmlPatternFromRoot();
17236 test_ret += test_xmlPatternGetStreamCtxt();
17237 test_ret += test_xmlPatternMatch();
17238 test_ret += test_xmlPatternMaxDepth();
17239 test_ret += test_xmlPatternMinDepth();
17240 test_ret += test_xmlPatternStreamable();
17241 test_ret += test_xmlPatterncompile();
17242 test_ret += test_xmlStreamPop();
17243 test_ret += test_xmlStreamPush();
17244 test_ret += test_xmlStreamPushAttr();
17245 test_ret += test_xmlStreamPushNode();
17246 test_ret += test_xmlStreamWantsAnyNode();
17249 printf("Module pattern: %d errors\n", test_ret);
17252 #ifdef LIBXML_SCHEMAS_ENABLED
17254 #define gen_nb_xmlRelaxNGPtr 1
17255 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17258 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17264 test_xmlRelaxNGDump(void) {
17267 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17269 FILE * output; /* the file output */
17271 xmlRelaxNGPtr schema; /* a schema structure */
17274 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17275 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17276 mem_base = xmlMemBlocks();
17277 output = gen_FILE_ptr(n_output, 0);
17278 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17280 xmlRelaxNGDump(output, schema);
17282 des_FILE_ptr(n_output, output, 0);
17283 des_xmlRelaxNGPtr(n_schema, schema, 1);
17284 xmlResetLastError();
17285 if (mem_base != xmlMemBlocks()) {
17286 printf("Leak of %d blocks found in xmlRelaxNGDump",
17287 xmlMemBlocks() - mem_base);
17289 printf(" %d", n_output);
17290 printf(" %d", n_schema);
17303 test_xmlRelaxNGDumpTree(void) {
17306 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17308 FILE * output; /* the file output */
17310 xmlRelaxNGPtr schema; /* a schema structure */
17313 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17314 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17315 mem_base = xmlMemBlocks();
17316 output = gen_FILE_ptr(n_output, 0);
17317 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17319 xmlRelaxNGDumpTree(output, schema);
17321 des_FILE_ptr(n_output, output, 0);
17322 des_xmlRelaxNGPtr(n_schema, schema, 1);
17323 xmlResetLastError();
17324 if (mem_base != xmlMemBlocks()) {
17325 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17326 xmlMemBlocks() - mem_base);
17328 printf(" %d", n_output);
17329 printf(" %d", n_schema);
17340 #ifdef LIBXML_SCHEMAS_ENABLED
17342 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17343 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17346 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17350 #ifdef LIBXML_SCHEMAS_ENABLED
17352 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17353 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17356 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17360 #ifdef LIBXML_SCHEMAS_ENABLED
17362 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17363 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17366 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17372 test_xmlRelaxNGGetParserErrors(void) {
17375 #if defined(LIBXML_SCHEMAS_ENABLED)
17378 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17380 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17382 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17384 void ** ctx; /* contextual data for the callbacks result */
17387 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17388 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17389 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17390 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17391 mem_base = xmlMemBlocks();
17392 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17393 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17394 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17395 ctx = gen_void_ptr_ptr(n_ctx, 3);
17397 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17398 desret_int(ret_val);
17400 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17401 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17402 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17403 des_void_ptr_ptr(n_ctx, ctx, 3);
17404 xmlResetLastError();
17405 if (mem_base != xmlMemBlocks()) {
17406 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17407 xmlMemBlocks() - mem_base);
17409 printf(" %d", n_ctxt);
17410 printf(" %d", n_err);
17411 printf(" %d", n_warn);
17412 printf(" %d", n_ctx);
17425 #ifdef LIBXML_SCHEMAS_ENABLED
17427 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17428 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17431 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17437 test_xmlRelaxNGGetValidErrors(void) {
17440 #if defined(LIBXML_SCHEMAS_ENABLED)
17443 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17445 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17447 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17449 void ** ctx; /* the functions context result */
17452 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17453 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17454 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17455 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17456 mem_base = xmlMemBlocks();
17457 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17458 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17459 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17460 ctx = gen_void_ptr_ptr(n_ctx, 3);
17462 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17463 desret_int(ret_val);
17465 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17466 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17467 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17468 des_void_ptr_ptr(n_ctx, ctx, 3);
17469 xmlResetLastError();
17470 if (mem_base != xmlMemBlocks()) {
17471 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17472 xmlMemBlocks() - mem_base);
17474 printf(" %d", n_ctxt);
17475 printf(" %d", n_err);
17476 printf(" %d", n_warn);
17477 printf(" %d", n_ctx);
17492 test_xmlRelaxNGInitTypes(void) {
17495 #if defined(LIBXML_SCHEMAS_ENABLED)
17499 mem_base = xmlMemBlocks();
17501 ret_val = xmlRelaxNGInitTypes();
17502 desret_int(ret_val);
17504 xmlResetLastError();
17505 if (mem_base != xmlMemBlocks()) {
17506 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17507 xmlMemBlocks() - mem_base);
17519 test_xmlRelaxNGNewDocParserCtxt(void) {
17522 #if defined(LIBXML_SCHEMAS_ENABLED)
17524 xmlRelaxNGParserCtxtPtr ret_val;
17525 xmlDocPtr doc; /* a preparsed document tree */
17528 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17529 mem_base = xmlMemBlocks();
17530 doc = gen_xmlDocPtr(n_doc, 0);
17532 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17533 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17535 des_xmlDocPtr(n_doc, doc, 0);
17536 xmlResetLastError();
17537 if (mem_base != xmlMemBlocks()) {
17538 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17539 xmlMemBlocks() - mem_base);
17541 printf(" %d", n_doc);
17553 test_xmlRelaxNGNewMemParserCtxt(void) {
17556 #if defined(LIBXML_SCHEMAS_ENABLED)
17558 xmlRelaxNGParserCtxtPtr ret_val;
17559 char * buffer; /* a pointer to a char array containing the schemas */
17561 int size; /* the size of the array */
17564 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17565 for (n_size = 0;n_size < gen_nb_int;n_size++) {
17566 mem_base = xmlMemBlocks();
17567 buffer = gen_const_char_ptr(n_buffer, 0);
17568 size = gen_int(n_size, 1);
17570 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17571 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17573 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17574 des_int(n_size, size, 1);
17575 xmlResetLastError();
17576 if (mem_base != xmlMemBlocks()) {
17577 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17578 xmlMemBlocks() - mem_base);
17580 printf(" %d", n_buffer);
17581 printf(" %d", n_size);
17594 test_xmlRelaxNGNewParserCtxt(void) {
17597 #if defined(LIBXML_SCHEMAS_ENABLED)
17599 xmlRelaxNGParserCtxtPtr ret_val;
17600 char * URL; /* the location of the schema */
17603 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17604 mem_base = xmlMemBlocks();
17605 URL = gen_const_char_ptr(n_URL, 0);
17607 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17608 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17610 des_const_char_ptr(n_URL, (const char *)URL, 0);
17611 xmlResetLastError();
17612 if (mem_base != xmlMemBlocks()) {
17613 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17614 xmlMemBlocks() - mem_base);
17616 printf(" %d", n_URL);
17628 test_xmlRelaxNGNewValidCtxt(void) {
17632 /* missing type support */
17638 test_xmlRelaxNGParse(void) {
17642 /* missing type support */
17648 test_xmlRelaxNGSetParserErrors(void) {
17652 /* missing type support */
17658 test_xmlRelaxNGSetParserStructuredErrors(void) {
17662 /* missing type support */
17668 test_xmlRelaxNGSetValidErrors(void) {
17672 /* missing type support */
17678 test_xmlRelaxNGSetValidStructuredErrors(void) {
17682 /* missing type support */
17688 test_xmlRelaxNGValidateDoc(void) {
17691 #if defined(LIBXML_SCHEMAS_ENABLED)
17694 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17696 xmlDocPtr doc; /* a parsed document tree */
17699 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17700 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17701 mem_base = xmlMemBlocks();
17702 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17703 doc = gen_xmlDocPtr(n_doc, 1);
17705 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17706 desret_int(ret_val);
17708 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17709 des_xmlDocPtr(n_doc, doc, 1);
17710 xmlResetLastError();
17711 if (mem_base != xmlMemBlocks()) {
17712 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17713 xmlMemBlocks() - mem_base);
17715 printf(" %d", n_ctxt);
17716 printf(" %d", n_doc);
17729 test_xmlRelaxNGValidateFullElement(void) {
17732 #if defined(LIBXML_SCHEMAS_ENABLED)
17735 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17737 xmlDocPtr doc; /* a document instance */
17739 xmlNodePtr elem; /* an element instance */
17742 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17743 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17744 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17745 mem_base = xmlMemBlocks();
17746 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17747 doc = gen_xmlDocPtr(n_doc, 1);
17748 elem = gen_xmlNodePtr(n_elem, 2);
17750 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17751 desret_int(ret_val);
17753 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17754 des_xmlDocPtr(n_doc, doc, 1);
17755 des_xmlNodePtr(n_elem, elem, 2);
17756 xmlResetLastError();
17757 if (mem_base != xmlMemBlocks()) {
17758 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17759 xmlMemBlocks() - mem_base);
17761 printf(" %d", n_ctxt);
17762 printf(" %d", n_doc);
17763 printf(" %d", n_elem);
17777 test_xmlRelaxNGValidatePopElement(void) {
17780 #if defined(LIBXML_SCHEMAS_ENABLED)
17783 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17785 xmlDocPtr doc; /* a document instance */
17787 xmlNodePtr elem; /* an element instance */
17790 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17791 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17792 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17793 mem_base = xmlMemBlocks();
17794 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17795 doc = gen_xmlDocPtr(n_doc, 1);
17796 elem = gen_xmlNodePtr(n_elem, 2);
17798 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17799 desret_int(ret_val);
17801 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17802 des_xmlDocPtr(n_doc, doc, 1);
17803 des_xmlNodePtr(n_elem, elem, 2);
17804 xmlResetLastError();
17805 if (mem_base != xmlMemBlocks()) {
17806 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17807 xmlMemBlocks() - mem_base);
17809 printf(" %d", n_ctxt);
17810 printf(" %d", n_doc);
17811 printf(" %d", n_elem);
17825 test_xmlRelaxNGValidatePushCData(void) {
17828 #if defined(LIBXML_SCHEMAS_ENABLED)
17831 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17833 xmlChar * data; /* some character data read */
17835 int len; /* the length of the data */
17838 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17839 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17840 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17841 mem_base = xmlMemBlocks();
17842 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17843 data = gen_const_xmlChar_ptr(n_data, 1);
17844 len = gen_int(n_len, 2);
17846 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17847 desret_int(ret_val);
17849 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17850 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17851 des_int(n_len, len, 2);
17852 xmlResetLastError();
17853 if (mem_base != xmlMemBlocks()) {
17854 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17855 xmlMemBlocks() - mem_base);
17857 printf(" %d", n_ctxt);
17858 printf(" %d", n_data);
17859 printf(" %d", n_len);
17873 test_xmlRelaxNGValidatePushElement(void) {
17876 #if defined(LIBXML_SCHEMAS_ENABLED)
17879 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17881 xmlDocPtr doc; /* a document instance */
17883 xmlNodePtr elem; /* an element instance */
17886 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17887 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17888 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17889 mem_base = xmlMemBlocks();
17890 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17891 doc = gen_xmlDocPtr(n_doc, 1);
17892 elem = gen_xmlNodePtr(n_elem, 2);
17894 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17895 desret_int(ret_val);
17897 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17898 des_xmlDocPtr(n_doc, doc, 1);
17899 des_xmlNodePtr(n_elem, elem, 2);
17900 xmlResetLastError();
17901 if (mem_base != xmlMemBlocks()) {
17902 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17903 xmlMemBlocks() - mem_base);
17905 printf(" %d", n_ctxt);
17906 printf(" %d", n_doc);
17907 printf(" %d", n_elem);
17921 test_xmlRelaxParserSetFlag(void) {
17924 #if defined(LIBXML_SCHEMAS_ENABLED)
17927 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17929 int flags; /* a set of flags values */
17932 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17933 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17934 mem_base = xmlMemBlocks();
17935 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17936 flags = gen_int(n_flags, 1);
17938 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17939 desret_int(ret_val);
17941 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17942 des_int(n_flags, flags, 1);
17943 xmlResetLastError();
17944 if (mem_base != xmlMemBlocks()) {
17945 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17946 xmlMemBlocks() - mem_base);
17948 printf(" %d", n_ctxt);
17949 printf(" %d", n_flags);
17961 test_relaxng(void) {
17964 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17965 test_ret += test_xmlRelaxNGDump();
17966 test_ret += test_xmlRelaxNGDumpTree();
17967 test_ret += test_xmlRelaxNGGetParserErrors();
17968 test_ret += test_xmlRelaxNGGetValidErrors();
17969 test_ret += test_xmlRelaxNGInitTypes();
17970 test_ret += test_xmlRelaxNGNewDocParserCtxt();
17971 test_ret += test_xmlRelaxNGNewMemParserCtxt();
17972 test_ret += test_xmlRelaxNGNewParserCtxt();
17973 test_ret += test_xmlRelaxNGNewValidCtxt();
17974 test_ret += test_xmlRelaxNGParse();
17975 test_ret += test_xmlRelaxNGSetParserErrors();
17976 test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17977 test_ret += test_xmlRelaxNGSetValidErrors();
17978 test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17979 test_ret += test_xmlRelaxNGValidateDoc();
17980 test_ret += test_xmlRelaxNGValidateFullElement();
17981 test_ret += test_xmlRelaxNGValidatePopElement();
17982 test_ret += test_xmlRelaxNGValidatePushCData();
17983 test_ret += test_xmlRelaxNGValidatePushElement();
17984 test_ret += test_xmlRelaxParserSetFlag();
17987 printf("Module relaxng: %d errors\n", test_ret);
17991 test_schemasInternals(void) {
17994 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17997 printf("Module schemasInternals: %d errors\n", test_ret);
18002 test_xmlSchematronNewDocParserCtxt(void) {
18006 /* missing type support */
18012 test_xmlSchematronNewMemParserCtxt(void) {
18016 /* missing type support */
18022 test_xmlSchematronNewParserCtxt(void) {
18026 /* missing type support */
18030 #ifdef LIBXML_SCHEMATRON_ENABLED
18032 #define gen_nb_xmlSchematronPtr 1
18033 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18036 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18042 test_xmlSchematronNewValidCtxt(void) {
18046 /* missing type support */
18050 #ifdef LIBXML_SCHEMATRON_ENABLED
18052 #define gen_nb_xmlSchematronParserCtxtPtr 1
18053 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18056 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18062 test_xmlSchematronParse(void) {
18066 /* missing type support */
18070 #ifdef LIBXML_SCHEMATRON_ENABLED
18072 #define gen_nb_xmlSchematronValidCtxtPtr 1
18073 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18076 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18082 test_xmlSchematronSetValidStructuredErrors(void) {
18086 /* missing type support */
18092 test_xmlSchematronValidateDoc(void) {
18095 #if defined(LIBXML_SCHEMATRON_ENABLED)
18098 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18100 xmlDocPtr instance; /* the document instace tree */
18103 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18104 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18105 mem_base = xmlMemBlocks();
18106 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18107 instance = gen_xmlDocPtr(n_instance, 1);
18109 ret_val = xmlSchematronValidateDoc(ctxt, instance);
18110 desret_int(ret_val);
18112 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18113 des_xmlDocPtr(n_instance, instance, 1);
18114 xmlResetLastError();
18115 if (mem_base != xmlMemBlocks()) {
18116 printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18117 xmlMemBlocks() - mem_base);
18119 printf(" %d", n_ctxt);
18120 printf(" %d", n_instance);
18132 test_schematron(void) {
18135 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18136 test_ret += test_xmlSchematronNewDocParserCtxt();
18137 test_ret += test_xmlSchematronNewMemParserCtxt();
18138 test_ret += test_xmlSchematronNewParserCtxt();
18139 test_ret += test_xmlSchematronNewValidCtxt();
18140 test_ret += test_xmlSchematronParse();
18141 test_ret += test_xmlSchematronSetValidStructuredErrors();
18142 test_ret += test_xmlSchematronValidateDoc();
18145 printf("Module schematron: %d errors\n", test_ret);
18150 test_xmlAddChild(void) {
18154 xmlNodePtr ret_val;
18155 xmlNodePtr parent; /* the parent node */
18157 xmlNodePtr cur; /* the child node */
18160 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18161 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18162 mem_base = xmlMemBlocks();
18163 parent = gen_xmlNodePtr(n_parent, 0);
18164 cur = gen_xmlNodePtr_in(n_cur, 1);
18166 ret_val = xmlAddChild(parent, cur);
18167 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18168 desret_xmlNodePtr(ret_val);
18170 des_xmlNodePtr(n_parent, parent, 0);
18171 des_xmlNodePtr_in(n_cur, cur, 1);
18172 xmlResetLastError();
18173 if (mem_base != xmlMemBlocks()) {
18174 printf("Leak of %d blocks found in xmlAddChild",
18175 xmlMemBlocks() - mem_base);
18177 printf(" %d", n_parent);
18178 printf(" %d", n_cur);
18190 test_xmlAddChildList(void) {
18194 xmlNodePtr ret_val;
18195 xmlNodePtr parent; /* the parent node */
18197 xmlNodePtr cur; /* the first node in the list */
18200 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18201 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18202 mem_base = xmlMemBlocks();
18203 parent = gen_xmlNodePtr(n_parent, 0);
18204 cur = gen_xmlNodePtr_in(n_cur, 1);
18206 ret_val = xmlAddChildList(parent, cur);
18207 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18208 desret_xmlNodePtr(ret_val);
18210 des_xmlNodePtr(n_parent, parent, 0);
18211 des_xmlNodePtr_in(n_cur, cur, 1);
18212 xmlResetLastError();
18213 if (mem_base != xmlMemBlocks()) {
18214 printf("Leak of %d blocks found in xmlAddChildList",
18215 xmlMemBlocks() - mem_base);
18217 printf(" %d", n_parent);
18218 printf(" %d", n_cur);
18230 test_xmlAddNextSibling(void) {
18234 xmlNodePtr ret_val;
18235 xmlNodePtr cur; /* the child node */
18237 xmlNodePtr elem; /* the new node */
18240 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18241 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18242 mem_base = xmlMemBlocks();
18243 cur = gen_xmlNodePtr(n_cur, 0);
18244 elem = gen_xmlNodePtr_in(n_elem, 1);
18246 ret_val = xmlAddNextSibling(cur, elem);
18247 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18248 desret_xmlNodePtr(ret_val);
18250 des_xmlNodePtr(n_cur, cur, 0);
18251 des_xmlNodePtr_in(n_elem, elem, 1);
18252 xmlResetLastError();
18253 if (mem_base != xmlMemBlocks()) {
18254 printf("Leak of %d blocks found in xmlAddNextSibling",
18255 xmlMemBlocks() - mem_base);
18257 printf(" %d", n_cur);
18258 printf(" %d", n_elem);
18270 test_xmlAddPrevSibling(void) {
18273 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18275 xmlNodePtr ret_val;
18276 xmlNodePtr cur; /* the child node */
18278 xmlNodePtr elem; /* the new node */
18281 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18282 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18283 mem_base = xmlMemBlocks();
18284 cur = gen_xmlNodePtr(n_cur, 0);
18285 elem = gen_xmlNodePtr_in(n_elem, 1);
18287 ret_val = xmlAddPrevSibling(cur, elem);
18288 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18289 desret_xmlNodePtr(ret_val);
18291 des_xmlNodePtr(n_cur, cur, 0);
18292 des_xmlNodePtr_in(n_elem, elem, 1);
18293 xmlResetLastError();
18294 if (mem_base != xmlMemBlocks()) {
18295 printf("Leak of %d blocks found in xmlAddPrevSibling",
18296 xmlMemBlocks() - mem_base);
18298 printf(" %d", n_cur);
18299 printf(" %d", n_elem);
18312 test_xmlAddSibling(void) {
18316 xmlNodePtr ret_val;
18317 xmlNodePtr cur; /* the child node */
18319 xmlNodePtr elem; /* the new node */
18322 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18323 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18324 mem_base = xmlMemBlocks();
18325 cur = gen_xmlNodePtr(n_cur, 0);
18326 elem = gen_xmlNodePtr_in(n_elem, 1);
18328 ret_val = xmlAddSibling(cur, elem);
18329 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18330 desret_xmlNodePtr(ret_val);
18332 des_xmlNodePtr(n_cur, cur, 0);
18333 des_xmlNodePtr_in(n_elem, elem, 1);
18334 xmlResetLastError();
18335 if (mem_base != xmlMemBlocks()) {
18336 printf("Leak of %d blocks found in xmlAddSibling",
18337 xmlMemBlocks() - mem_base);
18339 printf(" %d", n_cur);
18340 printf(" %d", n_elem);
18352 test_xmlAttrSerializeTxtContent(void) {
18355 #if defined(LIBXML_OUTPUT_ENABLED)
18356 #ifdef LIBXML_OUTPUT_ENABLED
18358 xmlBufferPtr buf; /* the XML buffer output */
18360 xmlDocPtr doc; /* the document */
18362 xmlAttrPtr attr; /* the attribute node */
18364 xmlChar * string; /* the text content */
18367 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18368 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18369 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18370 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18371 mem_base = xmlMemBlocks();
18372 buf = gen_xmlBufferPtr(n_buf, 0);
18373 doc = gen_xmlDocPtr(n_doc, 1);
18374 attr = gen_xmlAttrPtr(n_attr, 2);
18375 string = gen_const_xmlChar_ptr(n_string, 3);
18377 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18379 des_xmlBufferPtr(n_buf, buf, 0);
18380 des_xmlDocPtr(n_doc, doc, 1);
18381 des_xmlAttrPtr(n_attr, attr, 2);
18382 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18383 xmlResetLastError();
18384 if (mem_base != xmlMemBlocks()) {
18385 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18386 xmlMemBlocks() - mem_base);
18388 printf(" %d", n_buf);
18389 printf(" %d", n_doc);
18390 printf(" %d", n_attr);
18391 printf(" %d", n_string);
18406 #define gen_nb_const_xmlBufPtr 1
18407 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18410 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18414 test_xmlBufContent(void) {
18419 xmlBufPtr buf; /* the buffer */
18422 for (n_buf = 0;n_buf < gen_nb_const_xmlBufPtr;n_buf++) {
18423 mem_base = xmlMemBlocks();
18424 buf = gen_const_xmlBufPtr(n_buf, 0);
18426 ret_val = xmlBufContent((const xmlBufPtr)buf);
18427 desret_xmlChar_ptr(ret_val);
18429 des_const_xmlBufPtr(n_buf, (const xmlBufPtr)buf, 0);
18430 xmlResetLastError();
18431 if (mem_base != xmlMemBlocks()) {
18432 printf("Leak of %d blocks found in xmlBufContent",
18433 xmlMemBlocks() - mem_base);
18435 printf(" %d", n_buf);
18446 test_xmlBufEnd(void) {
18451 xmlBufPtr buf; /* the buffer */
18454 for (n_buf = 0;n_buf < gen_nb_const_xmlBufPtr;n_buf++) {
18455 mem_base = xmlMemBlocks();
18456 buf = gen_const_xmlBufPtr(n_buf, 0);
18458 ret_val = xmlBufEnd((const xmlBufPtr)buf);
18459 desret_xmlChar_ptr(ret_val);
18461 des_const_xmlBufPtr(n_buf, (const xmlBufPtr)buf, 0);
18462 xmlResetLastError();
18463 if (mem_base != xmlMemBlocks()) {
18464 printf("Leak of %d blocks found in xmlBufEnd",
18465 xmlMemBlocks() - mem_base);
18467 printf(" %d", n_buf);
18477 #define gen_nb_xmlBufPtr 1
18478 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18481 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18485 test_xmlBufGetNodeContent(void) {
18490 xmlBufPtr buf; /* a buffer xmlBufPtr */
18492 xmlNodePtr cur; /* the node being read */
18495 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18496 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18497 mem_base = xmlMemBlocks();
18498 buf = gen_xmlBufPtr(n_buf, 0);
18499 cur = gen_xmlNodePtr(n_cur, 1);
18501 ret_val = xmlBufGetNodeContent(buf, cur);
18502 desret_int(ret_val);
18504 des_xmlBufPtr(n_buf, buf, 0);
18505 des_xmlNodePtr(n_cur, cur, 1);
18506 xmlResetLastError();
18507 if (mem_base != xmlMemBlocks()) {
18508 printf("Leak of %d blocks found in xmlBufGetNodeContent",
18509 xmlMemBlocks() - mem_base);
18511 printf(" %d", n_buf);
18512 printf(" %d", n_cur);
18524 test_xmlBufNodeDump(void) {
18528 /* missing type support */
18534 test_xmlBufShrink(void) {
18538 /* missing type support */
18544 test_xmlBufUse(void) {
18548 /* missing type support */
18554 test_xmlBufferAdd(void) {
18559 xmlBufferPtr buf; /* the buffer to dump */
18561 xmlChar * str; /* the #xmlChar string */
18563 int len; /* the number of #xmlChar to add */
18566 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18567 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18568 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18569 mem_base = xmlMemBlocks();
18570 buf = gen_xmlBufferPtr(n_buf, 0);
18571 str = gen_const_xmlChar_ptr(n_str, 1);
18572 len = gen_int(n_len, 2);
18574 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18575 desret_int(ret_val);
18577 des_xmlBufferPtr(n_buf, buf, 0);
18578 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18579 des_int(n_len, len, 2);
18580 xmlResetLastError();
18581 if (mem_base != xmlMemBlocks()) {
18582 printf("Leak of %d blocks found in xmlBufferAdd",
18583 xmlMemBlocks() - mem_base);
18585 printf(" %d", n_buf);
18586 printf(" %d", n_str);
18587 printf(" %d", n_len);
18600 test_xmlBufferAddHead(void) {
18605 xmlBufferPtr buf; /* the buffer */
18607 xmlChar * str; /* the #xmlChar string */
18609 int len; /* the number of #xmlChar to add */
18612 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18613 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18614 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18615 mem_base = xmlMemBlocks();
18616 buf = gen_xmlBufferPtr(n_buf, 0);
18617 str = gen_const_xmlChar_ptr(n_str, 1);
18618 len = gen_int(n_len, 2);
18620 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18621 desret_int(ret_val);
18623 des_xmlBufferPtr(n_buf, buf, 0);
18624 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18625 des_int(n_len, len, 2);
18626 xmlResetLastError();
18627 if (mem_base != xmlMemBlocks()) {
18628 printf("Leak of %d blocks found in xmlBufferAddHead",
18629 xmlMemBlocks() - mem_base);
18631 printf(" %d", n_buf);
18632 printf(" %d", n_str);
18633 printf(" %d", n_len);
18646 test_xmlBufferCCat(void) {
18651 xmlBufferPtr buf; /* the buffer to dump */
18653 char * str; /* the C char string */
18656 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18657 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18658 mem_base = xmlMemBlocks();
18659 buf = gen_xmlBufferPtr(n_buf, 0);
18660 str = gen_const_char_ptr(n_str, 1);
18662 ret_val = xmlBufferCCat(buf, (const char *)str);
18663 desret_int(ret_val);
18665 des_xmlBufferPtr(n_buf, buf, 0);
18666 des_const_char_ptr(n_str, (const char *)str, 1);
18667 xmlResetLastError();
18668 if (mem_base != xmlMemBlocks()) {
18669 printf("Leak of %d blocks found in xmlBufferCCat",
18670 xmlMemBlocks() - mem_base);
18672 printf(" %d", n_buf);
18673 printf(" %d", n_str);
18685 test_xmlBufferCat(void) {
18690 xmlBufferPtr buf; /* the buffer to add to */
18692 xmlChar * str; /* the #xmlChar string */
18695 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18696 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18697 mem_base = xmlMemBlocks();
18698 buf = gen_xmlBufferPtr(n_buf, 0);
18699 str = gen_const_xmlChar_ptr(n_str, 1);
18701 ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18702 desret_int(ret_val);
18704 des_xmlBufferPtr(n_buf, buf, 0);
18705 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18706 xmlResetLastError();
18707 if (mem_base != xmlMemBlocks()) {
18708 printf("Leak of %d blocks found in xmlBufferCat",
18709 xmlMemBlocks() - mem_base);
18711 printf(" %d", n_buf);
18712 printf(" %d", n_str);
18723 #define gen_nb_const_xmlBufferPtr 1
18724 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18727 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18731 test_xmlBufferContent(void) {
18735 const xmlChar * ret_val;
18736 xmlBufferPtr buf; /* the buffer */
18739 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18740 mem_base = xmlMemBlocks();
18741 buf = gen_const_xmlBufferPtr(n_buf, 0);
18743 ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18744 desret_const_xmlChar_ptr(ret_val);
18746 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18747 xmlResetLastError();
18748 if (mem_base != xmlMemBlocks()) {
18749 printf("Leak of %d blocks found in xmlBufferContent",
18750 xmlMemBlocks() - mem_base);
18752 printf(" %d", n_buf);
18763 test_xmlBufferCreate(void) {
18767 xmlBufferPtr ret_val;
18769 mem_base = xmlMemBlocks();
18771 ret_val = xmlBufferCreate();
18772 desret_xmlBufferPtr(ret_val);
18774 xmlResetLastError();
18775 if (mem_base != xmlMemBlocks()) {
18776 printf("Leak of %d blocks found in xmlBufferCreate",
18777 xmlMemBlocks() - mem_base);
18788 test_xmlBufferCreateSize(void) {
18792 /* missing type support */
18798 test_xmlBufferCreateStatic(void) {
18802 /* missing type support */
18808 test_xmlBufferDetach(void) {
18813 xmlBufferPtr buf; /* the buffer */
18816 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18817 mem_base = xmlMemBlocks();
18818 buf = gen_xmlBufferPtr(n_buf, 0);
18820 ret_val = xmlBufferDetach(buf);
18821 desret_xmlChar_ptr(ret_val);
18823 des_xmlBufferPtr(n_buf, buf, 0);
18824 xmlResetLastError();
18825 if (mem_base != xmlMemBlocks()) {
18826 printf("Leak of %d blocks found in xmlBufferDetach",
18827 xmlMemBlocks() - mem_base);
18829 printf(" %d", n_buf);
18840 test_xmlBufferEmpty(void) {
18844 xmlBufferPtr buf; /* the buffer */
18847 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18848 mem_base = xmlMemBlocks();
18849 buf = gen_xmlBufferPtr(n_buf, 0);
18851 xmlBufferEmpty(buf);
18853 des_xmlBufferPtr(n_buf, buf, 0);
18854 xmlResetLastError();
18855 if (mem_base != xmlMemBlocks()) {
18856 printf("Leak of %d blocks found in xmlBufferEmpty",
18857 xmlMemBlocks() - mem_base);
18859 printf(" %d", n_buf);
18870 test_xmlBufferGrow(void) {
18875 xmlBufferPtr buf; /* the buffer */
18877 unsigned int len; /* the minimum free size to allocate */
18880 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18881 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18882 mem_base = xmlMemBlocks();
18883 buf = gen_xmlBufferPtr(n_buf, 0);
18884 len = gen_unsigned_int(n_len, 1);
18886 ret_val = xmlBufferGrow(buf, len);
18887 desret_int(ret_val);
18889 des_xmlBufferPtr(n_buf, buf, 0);
18890 des_unsigned_int(n_len, len, 1);
18891 xmlResetLastError();
18892 if (mem_base != xmlMemBlocks()) {
18893 printf("Leak of %d blocks found in xmlBufferGrow",
18894 xmlMemBlocks() - mem_base);
18896 printf(" %d", n_buf);
18897 printf(" %d", n_len);
18909 test_xmlBufferLength(void) {
18914 xmlBufferPtr buf; /* the buffer */
18917 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18918 mem_base = xmlMemBlocks();
18919 buf = gen_const_xmlBufferPtr(n_buf, 0);
18921 ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18922 desret_int(ret_val);
18924 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18925 xmlResetLastError();
18926 if (mem_base != xmlMemBlocks()) {
18927 printf("Leak of %d blocks found in xmlBufferLength",
18928 xmlMemBlocks() - mem_base);
18930 printf(" %d", n_buf);
18941 test_xmlBufferResize(void) {
18946 xmlBufferPtr buf; /* the buffer to resize */
18948 unsigned int size; /* the desired size */
18951 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18952 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18953 mem_base = xmlMemBlocks();
18954 buf = gen_xmlBufferPtr(n_buf, 0);
18955 size = gen_unsigned_int(n_size, 1);
18957 ret_val = xmlBufferResize(buf, size);
18958 desret_int(ret_val);
18960 des_xmlBufferPtr(n_buf, buf, 0);
18961 des_unsigned_int(n_size, size, 1);
18962 xmlResetLastError();
18963 if (mem_base != xmlMemBlocks()) {
18964 printf("Leak of %d blocks found in xmlBufferResize",
18965 xmlMemBlocks() - mem_base);
18967 printf(" %d", n_buf);
18968 printf(" %d", n_size);
18980 test_xmlBufferSetAllocationScheme(void) {
18984 xmlBufferPtr buf; /* the buffer to tune */
18986 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18989 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18990 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18991 mem_base = xmlMemBlocks();
18992 buf = gen_xmlBufferPtr(n_buf, 0);
18993 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18995 xmlBufferSetAllocationScheme(buf, scheme);
18996 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18998 des_xmlBufferPtr(n_buf, buf, 0);
18999 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19000 xmlResetLastError();
19001 if (mem_base != xmlMemBlocks()) {
19002 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19003 xmlMemBlocks() - mem_base);
19005 printf(" %d", n_buf);
19006 printf(" %d", n_scheme);
19018 test_xmlBufferShrink(void) {
19023 xmlBufferPtr buf; /* the buffer to dump */
19025 unsigned int len; /* the number of xmlChar to remove */
19028 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19029 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19030 mem_base = xmlMemBlocks();
19031 buf = gen_xmlBufferPtr(n_buf, 0);
19032 len = gen_unsigned_int(n_len, 1);
19034 ret_val = xmlBufferShrink(buf, len);
19035 desret_int(ret_val);
19037 des_xmlBufferPtr(n_buf, buf, 0);
19038 des_unsigned_int(n_len, len, 1);
19039 xmlResetLastError();
19040 if (mem_base != xmlMemBlocks()) {
19041 printf("Leak of %d blocks found in xmlBufferShrink",
19042 xmlMemBlocks() - mem_base);
19044 printf(" %d", n_buf);
19045 printf(" %d", n_len);
19057 test_xmlBufferWriteCHAR(void) {
19061 xmlBufferPtr buf; /* the XML buffer */
19063 xmlChar * string; /* the string to add */
19066 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19067 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19068 mem_base = xmlMemBlocks();
19069 buf = gen_xmlBufferPtr(n_buf, 0);
19070 string = gen_const_xmlChar_ptr(n_string, 1);
19072 xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19074 des_xmlBufferPtr(n_buf, buf, 0);
19075 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19076 xmlResetLastError();
19077 if (mem_base != xmlMemBlocks()) {
19078 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19079 xmlMemBlocks() - mem_base);
19081 printf(" %d", n_buf);
19082 printf(" %d", n_string);
19094 test_xmlBufferWriteChar(void) {
19098 xmlBufferPtr buf; /* the XML buffer output */
19100 char * string; /* the string to add */
19103 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19104 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19105 mem_base = xmlMemBlocks();
19106 buf = gen_xmlBufferPtr(n_buf, 0);
19107 string = gen_const_char_ptr(n_string, 1);
19109 xmlBufferWriteChar(buf, (const char *)string);
19111 des_xmlBufferPtr(n_buf, buf, 0);
19112 des_const_char_ptr(n_string, (const char *)string, 1);
19113 xmlResetLastError();
19114 if (mem_base != xmlMemBlocks()) {
19115 printf("Leak of %d blocks found in xmlBufferWriteChar",
19116 xmlMemBlocks() - mem_base);
19118 printf(" %d", n_buf);
19119 printf(" %d", n_string);
19131 test_xmlBufferWriteQuotedString(void) {
19135 xmlBufferPtr buf; /* the XML buffer output */
19137 xmlChar * string; /* the string to add */
19140 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19141 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19142 mem_base = xmlMemBlocks();
19143 buf = gen_xmlBufferPtr(n_buf, 0);
19144 string = gen_const_xmlChar_ptr(n_string, 1);
19146 xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19148 des_xmlBufferPtr(n_buf, buf, 0);
19149 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19150 xmlResetLastError();
19151 if (mem_base != xmlMemBlocks()) {
19152 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19153 xmlMemBlocks() - mem_base);
19155 printf(" %d", n_buf);
19156 printf(" %d", n_string);
19168 test_xmlBuildQName(void) {
19173 xmlChar * ncname; /* the Name */
19175 xmlChar * prefix; /* the prefix */
19177 xmlChar * memory; /* preallocated memory */
19179 int len; /* preallocated memory length */
19182 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19183 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19184 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19185 for (n_len = 0;n_len < gen_nb_int;n_len++) {
19186 mem_base = xmlMemBlocks();
19187 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19188 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19189 memory = gen_xmlChar_ptr(n_memory, 2);
19190 len = gen_int(n_len, 3);
19192 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19193 if ((ret_val != NULL) && (ret_val != ncname) &&
19194 (ret_val != prefix) && (ret_val != memory))
19197 desret_xmlChar_ptr(ret_val);
19199 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19200 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19201 des_xmlChar_ptr(n_memory, memory, 2);
19202 des_int(n_len, len, 3);
19203 xmlResetLastError();
19204 if (mem_base != xmlMemBlocks()) {
19205 printf("Leak of %d blocks found in xmlBuildQName",
19206 xmlMemBlocks() - mem_base);
19208 printf(" %d", n_ncname);
19209 printf(" %d", n_prefix);
19210 printf(" %d", n_memory);
19211 printf(" %d", n_len);
19225 test_xmlChildElementCount(void) {
19228 #if defined(LIBXML_TREE_ENABLED)
19230 unsigned long ret_val;
19231 xmlNodePtr parent; /* the parent node */
19234 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19235 mem_base = xmlMemBlocks();
19236 parent = gen_xmlNodePtr(n_parent, 0);
19238 ret_val = xmlChildElementCount(parent);
19239 desret_unsigned_long(ret_val);
19241 des_xmlNodePtr(n_parent, parent, 0);
19242 xmlResetLastError();
19243 if (mem_base != xmlMemBlocks()) {
19244 printf("Leak of %d blocks found in xmlChildElementCount",
19245 xmlMemBlocks() - mem_base);
19247 printf(" %d", n_parent);
19259 test_xmlCopyDoc(void) {
19262 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19265 xmlDocPtr doc; /* the document */
19267 int recursive; /* if not zero do a recursive copy. */
19270 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19271 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19272 mem_base = xmlMemBlocks();
19273 doc = gen_xmlDocPtr(n_doc, 0);
19274 recursive = gen_int(n_recursive, 1);
19276 ret_val = xmlCopyDoc(doc, recursive);
19277 desret_xmlDocPtr(ret_val);
19279 des_xmlDocPtr(n_doc, doc, 0);
19280 des_int(n_recursive, recursive, 1);
19281 xmlResetLastError();
19282 if (mem_base != xmlMemBlocks()) {
19283 printf("Leak of %d blocks found in xmlCopyDoc",
19284 xmlMemBlocks() - mem_base);
19286 printf(" %d", n_doc);
19287 printf(" %d", n_recursive);
19300 test_xmlCopyDtd(void) {
19303 #if defined(LIBXML_TREE_ENABLED)
19306 xmlDtdPtr dtd; /* the dtd */
19309 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19310 mem_base = xmlMemBlocks();
19311 dtd = gen_xmlDtdPtr(n_dtd, 0);
19313 ret_val = xmlCopyDtd(dtd);
19314 desret_xmlDtdPtr(ret_val);
19316 des_xmlDtdPtr(n_dtd, dtd, 0);
19317 xmlResetLastError();
19318 if (mem_base != xmlMemBlocks()) {
19319 printf("Leak of %d blocks found in xmlCopyDtd",
19320 xmlMemBlocks() - mem_base);
19322 printf(" %d", n_dtd);
19334 test_xmlCopyNamespace(void) {
19339 xmlNsPtr cur; /* the namespace */
19342 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19343 mem_base = xmlMemBlocks();
19344 cur = gen_xmlNsPtr(n_cur, 0);
19346 ret_val = xmlCopyNamespace(cur);
19347 if (ret_val != NULL) xmlFreeNs(ret_val);
19348 desret_xmlNsPtr(ret_val);
19350 des_xmlNsPtr(n_cur, cur, 0);
19351 xmlResetLastError();
19352 if (mem_base != xmlMemBlocks()) {
19353 printf("Leak of %d blocks found in xmlCopyNamespace",
19354 xmlMemBlocks() - mem_base);
19356 printf(" %d", n_cur);
19367 test_xmlCopyNamespaceList(void) {
19372 xmlNsPtr cur; /* the first namespace */
19375 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19376 mem_base = xmlMemBlocks();
19377 cur = gen_xmlNsPtr(n_cur, 0);
19379 ret_val = xmlCopyNamespaceList(cur);
19380 if (ret_val != NULL) xmlFreeNsList(ret_val);
19381 desret_xmlNsPtr(ret_val);
19383 des_xmlNsPtr(n_cur, cur, 0);
19384 xmlResetLastError();
19385 if (mem_base != xmlMemBlocks()) {
19386 printf("Leak of %d blocks found in xmlCopyNamespaceList",
19387 xmlMemBlocks() - mem_base);
19389 printf(" %d", n_cur);
19400 test_xmlCopyNode(void) {
19404 xmlNodePtr ret_val;
19405 xmlNodePtr node; /* the node */
19407 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19410 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19411 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19412 mem_base = xmlMemBlocks();
19413 node = gen_const_xmlNodePtr(n_node, 0);
19414 extended = gen_int(n_extended, 1);
19416 ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19417 desret_xmlNodePtr(ret_val);
19419 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19420 des_int(n_extended, extended, 1);
19421 xmlResetLastError();
19422 if (mem_base != xmlMemBlocks()) {
19423 printf("Leak of %d blocks found in xmlCopyNode",
19424 xmlMemBlocks() - mem_base);
19426 printf(" %d", n_node);
19427 printf(" %d", n_extended);
19439 test_xmlCopyNodeList(void) {
19443 xmlNodePtr ret_val;
19444 xmlNodePtr node; /* the first node in the list. */
19447 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19448 mem_base = xmlMemBlocks();
19449 node = gen_const_xmlNodePtr(n_node, 0);
19451 ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19452 desret_xmlNodePtr(ret_val);
19454 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19455 xmlResetLastError();
19456 if (mem_base != xmlMemBlocks()) {
19457 printf("Leak of %d blocks found in xmlCopyNodeList",
19458 xmlMemBlocks() - mem_base);
19460 printf(" %d", n_node);
19471 test_xmlCopyProp(void) {
19475 xmlAttrPtr ret_val;
19476 xmlNodePtr target; /* the element where the attribute will be grafted */
19478 xmlAttrPtr cur; /* the attribute */
19481 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19482 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19483 mem_base = xmlMemBlocks();
19484 target = gen_xmlNodePtr(n_target, 0);
19485 cur = gen_xmlAttrPtr(n_cur, 1);
19487 ret_val = xmlCopyProp(target, cur);
19488 desret_xmlAttrPtr(ret_val);
19490 des_xmlNodePtr(n_target, target, 0);
19491 des_xmlAttrPtr(n_cur, cur, 1);
19492 xmlResetLastError();
19493 if (mem_base != xmlMemBlocks()) {
19494 printf("Leak of %d blocks found in xmlCopyProp",
19495 xmlMemBlocks() - mem_base);
19497 printf(" %d", n_target);
19498 printf(" %d", n_cur);
19510 test_xmlCopyPropList(void) {
19514 xmlAttrPtr ret_val;
19515 xmlNodePtr target; /* the element where the attributes will be grafted */
19517 xmlAttrPtr cur; /* the first attribute */
19520 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19521 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19522 mem_base = xmlMemBlocks();
19523 target = gen_xmlNodePtr(n_target, 0);
19524 cur = gen_xmlAttrPtr(n_cur, 1);
19526 ret_val = xmlCopyPropList(target, cur);
19527 desret_xmlAttrPtr(ret_val);
19529 des_xmlNodePtr(n_target, target, 0);
19530 des_xmlAttrPtr(n_cur, cur, 1);
19531 xmlResetLastError();
19532 if (mem_base != xmlMemBlocks()) {
19533 printf("Leak of %d blocks found in xmlCopyPropList",
19534 xmlMemBlocks() - mem_base);
19536 printf(" %d", n_target);
19537 printf(" %d", n_cur);
19549 test_xmlCreateIntSubset(void) {
19554 xmlDocPtr doc; /* the document pointer */
19556 xmlChar * name; /* the DTD name */
19558 xmlChar * ExternalID; /* the external (PUBLIC) ID */
19560 xmlChar * SystemID; /* the system ID */
19563 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19564 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19565 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19566 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19567 mem_base = xmlMemBlocks();
19568 doc = gen_xmlDocPtr(n_doc, 0);
19569 name = gen_const_xmlChar_ptr(n_name, 1);
19570 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19571 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19573 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19574 desret_xmlDtdPtr(ret_val);
19576 des_xmlDocPtr(n_doc, doc, 0);
19577 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19578 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19579 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19580 xmlResetLastError();
19581 if (mem_base != xmlMemBlocks()) {
19582 printf("Leak of %d blocks found in xmlCreateIntSubset",
19583 xmlMemBlocks() - mem_base);
19585 printf(" %d", n_doc);
19586 printf(" %d", n_name);
19587 printf(" %d", n_ExternalID);
19588 printf(" %d", n_SystemID);
19601 #define gen_nb_xmlDOMWrapCtxtPtr 1
19602 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19605 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19609 test_xmlDOMWrapAdoptNode(void) {
19614 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19616 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19618 xmlNodePtr node; /* the node to start with */
19620 xmlDocPtr destDoc; /* the destination doc */
19622 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19624 int options; /* option flags */
19627 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19628 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19629 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19630 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19631 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19632 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19633 mem_base = xmlMemBlocks();
19634 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19635 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19636 node = gen_xmlNodePtr(n_node, 2);
19637 destDoc = gen_xmlDocPtr(n_destDoc, 3);
19638 destParent = gen_xmlNodePtr(n_destParent, 4);
19639 options = gen_int(n_options, 5);
19641 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19642 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19643 desret_int(ret_val);
19645 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19646 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19647 des_xmlNodePtr(n_node, node, 2);
19648 des_xmlDocPtr(n_destDoc, destDoc, 3);
19649 des_xmlNodePtr(n_destParent, destParent, 4);
19650 des_int(n_options, options, 5);
19651 xmlResetLastError();
19652 if (mem_base != xmlMemBlocks()) {
19653 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19654 xmlMemBlocks() - mem_base);
19656 printf(" %d", n_ctxt);
19657 printf(" %d", n_sourceDoc);
19658 printf(" %d", n_node);
19659 printf(" %d", n_destDoc);
19660 printf(" %d", n_destParent);
19661 printf(" %d", n_options);
19677 test_xmlDOMWrapCloneNode(void) {
19682 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19684 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19686 xmlNodePtr node; /* the node to start with */
19688 xmlNodePtr * resNode; /* the clone of the given @node */
19690 xmlDocPtr destDoc; /* the destination doc */
19692 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19694 int deep; /* descend into child if set */
19696 int options; /* option flags */
19699 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19700 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19701 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19702 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19703 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19704 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19705 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19706 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19707 mem_base = xmlMemBlocks();
19708 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19709 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19710 node = gen_xmlNodePtr(n_node, 2);
19711 resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19712 destDoc = gen_xmlDocPtr(n_destDoc, 4);
19713 destParent = gen_xmlNodePtr(n_destParent, 5);
19714 deep = gen_int(n_deep, 6);
19715 options = gen_int(n_options, 7);
19717 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19718 desret_int(ret_val);
19720 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19721 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19722 des_xmlNodePtr(n_node, node, 2);
19723 des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19724 des_xmlDocPtr(n_destDoc, destDoc, 4);
19725 des_xmlNodePtr(n_destParent, destParent, 5);
19726 des_int(n_deep, deep, 6);
19727 des_int(n_options, options, 7);
19728 xmlResetLastError();
19729 if (mem_base != xmlMemBlocks()) {
19730 printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19731 xmlMemBlocks() - mem_base);
19733 printf(" %d", n_ctxt);
19734 printf(" %d", n_sourceDoc);
19735 printf(" %d", n_node);
19736 printf(" %d", n_resNode);
19737 printf(" %d", n_destDoc);
19738 printf(" %d", n_destParent);
19739 printf(" %d", n_deep);
19740 printf(" %d", n_options);
19758 test_xmlDOMWrapNewCtxt(void) {
19762 /* missing type support */
19768 test_xmlDOMWrapReconcileNamespaces(void) {
19773 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19775 xmlNodePtr elem; /* the element-node */
19777 int options; /* option flags */
19780 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19781 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19782 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19783 mem_base = xmlMemBlocks();
19784 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19785 elem = gen_xmlNodePtr(n_elem, 1);
19786 options = gen_int(n_options, 2);
19788 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19789 desret_int(ret_val);
19791 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19792 des_xmlNodePtr(n_elem, elem, 1);
19793 des_int(n_options, options, 2);
19794 xmlResetLastError();
19795 if (mem_base != xmlMemBlocks()) {
19796 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19797 xmlMemBlocks() - mem_base);
19799 printf(" %d", n_ctxt);
19800 printf(" %d", n_elem);
19801 printf(" %d", n_options);
19814 test_xmlDOMWrapRemoveNode(void) {
19819 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19821 xmlDocPtr doc; /* the doc */
19823 xmlNodePtr node; /* the node to be removed. */
19825 int options; /* set of options, unused at the moment */
19828 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19829 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19830 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19831 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19832 mem_base = xmlMemBlocks();
19833 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19834 doc = gen_xmlDocPtr(n_doc, 1);
19835 node = gen_xmlNodePtr(n_node, 2);
19836 options = gen_int(n_options, 3);
19838 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19839 desret_int(ret_val);
19841 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19842 des_xmlDocPtr(n_doc, doc, 1);
19843 des_xmlNodePtr(n_node, node, 2);
19844 des_int(n_options, options, 3);
19845 xmlResetLastError();
19846 if (mem_base != xmlMemBlocks()) {
19847 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19848 xmlMemBlocks() - mem_base);
19850 printf(" %d", n_ctxt);
19851 printf(" %d", n_doc);
19852 printf(" %d", n_node);
19853 printf(" %d", n_options);
19867 test_xmlDocCopyNode(void) {
19871 xmlNodePtr ret_val;
19872 xmlNodePtr node; /* the node */
19874 xmlDocPtr doc; /* the document */
19876 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19879 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19880 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19881 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19882 mem_base = xmlMemBlocks();
19883 node = gen_const_xmlNodePtr(n_node, 0);
19884 doc = gen_xmlDocPtr(n_doc, 1);
19885 extended = gen_int(n_extended, 2);
19887 ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19888 desret_xmlNodePtr(ret_val);
19890 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19891 des_xmlDocPtr(n_doc, doc, 1);
19892 des_int(n_extended, extended, 2);
19893 xmlResetLastError();
19894 if (mem_base != xmlMemBlocks()) {
19895 printf("Leak of %d blocks found in xmlDocCopyNode",
19896 xmlMemBlocks() - mem_base);
19898 printf(" %d", n_node);
19899 printf(" %d", n_doc);
19900 printf(" %d", n_extended);
19913 test_xmlDocCopyNodeList(void) {
19917 xmlNodePtr ret_val;
19918 xmlDocPtr doc; /* the target document */
19920 xmlNodePtr node; /* the first node in the list. */
19923 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19924 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19925 mem_base = xmlMemBlocks();
19926 doc = gen_xmlDocPtr(n_doc, 0);
19927 node = gen_const_xmlNodePtr(n_node, 1);
19929 ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19930 desret_xmlNodePtr(ret_val);
19932 des_xmlDocPtr(n_doc, doc, 0);
19933 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19934 xmlResetLastError();
19935 if (mem_base != xmlMemBlocks()) {
19936 printf("Leak of %d blocks found in xmlDocCopyNodeList",
19937 xmlMemBlocks() - mem_base);
19939 printf(" %d", n_doc);
19940 printf(" %d", n_node);
19952 test_xmlDocDump(void) {
19955 #if defined(LIBXML_OUTPUT_ENABLED)
19958 FILE * f; /* the FILE* */
19960 xmlDocPtr cur; /* the document */
19963 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19964 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19965 mem_base = xmlMemBlocks();
19966 f = gen_FILE_ptr(n_f, 0);
19967 cur = gen_xmlDocPtr(n_cur, 1);
19969 ret_val = xmlDocDump(f, cur);
19970 desret_int(ret_val);
19972 des_FILE_ptr(n_f, f, 0);
19973 des_xmlDocPtr(n_cur, cur, 1);
19974 xmlResetLastError();
19975 if (mem_base != xmlMemBlocks()) {
19976 printf("Leak of %d blocks found in xmlDocDump",
19977 xmlMemBlocks() - mem_base);
19979 printf(" %d", n_f);
19980 printf(" %d", n_cur);
19993 test_xmlDocDumpFormatMemory(void) {
19996 #if defined(LIBXML_OUTPUT_ENABLED)
19998 xmlDocPtr cur; /* the document */
20000 xmlChar ** mem; /* OUT: the memory pointer */
20002 int * size; /* OUT: the memory length */
20004 int format; /* should formatting spaces been added */
20007 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20008 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20009 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20010 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20011 mem_base = xmlMemBlocks();
20012 cur = gen_xmlDocPtr(n_cur, 0);
20013 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20014 size = gen_int_ptr(n_size, 2);
20015 format = gen_int(n_format, 3);
20017 xmlDocDumpFormatMemory(cur, mem, size, format);
20019 des_xmlDocPtr(n_cur, cur, 0);
20020 des_xmlChar_ptr_ptr(n_mem, mem, 1);
20021 des_int_ptr(n_size, size, 2);
20022 des_int(n_format, format, 3);
20023 xmlResetLastError();
20024 if (mem_base != xmlMemBlocks()) {
20025 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20026 xmlMemBlocks() - mem_base);
20028 printf(" %d", n_cur);
20029 printf(" %d", n_mem);
20030 printf(" %d", n_size);
20031 printf(" %d", n_format);
20046 test_xmlDocDumpFormatMemoryEnc(void) {
20049 #if defined(LIBXML_OUTPUT_ENABLED)
20051 xmlDocPtr out_doc; /* Document to generate XML text from */
20053 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20055 int * doc_txt_len; /* Length of the generated XML text */
20057 char * txt_encoding; /* Character encoding to use when generating XML text */
20058 int n_txt_encoding;
20059 int format; /* should formatting spaces been added */
20062 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20063 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20064 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20065 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20066 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20067 mem_base = xmlMemBlocks();
20068 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20069 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20070 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20071 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20072 format = gen_int(n_format, 4);
20074 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20076 des_xmlDocPtr(n_out_doc, out_doc, 0);
20077 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20078 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20079 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20080 des_int(n_format, format, 4);
20081 xmlResetLastError();
20082 if (mem_base != xmlMemBlocks()) {
20083 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20084 xmlMemBlocks() - mem_base);
20086 printf(" %d", n_out_doc);
20087 printf(" %d", n_doc_txt_ptr);
20088 printf(" %d", n_doc_txt_len);
20089 printf(" %d", n_txt_encoding);
20090 printf(" %d", n_format);
20106 test_xmlDocDumpMemory(void) {
20109 #if defined(LIBXML_OUTPUT_ENABLED)
20111 xmlDocPtr cur; /* the document */
20113 xmlChar ** mem; /* OUT: the memory pointer */
20115 int * size; /* OUT: the memory length */
20118 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20119 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20120 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20121 mem_base = xmlMemBlocks();
20122 cur = gen_xmlDocPtr(n_cur, 0);
20123 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20124 size = gen_int_ptr(n_size, 2);
20126 xmlDocDumpMemory(cur, mem, size);
20128 des_xmlDocPtr(n_cur, cur, 0);
20129 des_xmlChar_ptr_ptr(n_mem, mem, 1);
20130 des_int_ptr(n_size, size, 2);
20131 xmlResetLastError();
20132 if (mem_base != xmlMemBlocks()) {
20133 printf("Leak of %d blocks found in xmlDocDumpMemory",
20134 xmlMemBlocks() - mem_base);
20136 printf(" %d", n_cur);
20137 printf(" %d", n_mem);
20138 printf(" %d", n_size);
20152 test_xmlDocDumpMemoryEnc(void) {
20155 #if defined(LIBXML_OUTPUT_ENABLED)
20157 xmlDocPtr out_doc; /* Document to generate XML text from */
20159 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20161 int * doc_txt_len; /* Length of the generated XML text */
20163 char * txt_encoding; /* Character encoding to use when generating XML text */
20164 int n_txt_encoding;
20166 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20167 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20168 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20169 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20170 mem_base = xmlMemBlocks();
20171 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20172 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20173 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20174 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20176 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20178 des_xmlDocPtr(n_out_doc, out_doc, 0);
20179 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20180 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20181 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20182 xmlResetLastError();
20183 if (mem_base != xmlMemBlocks()) {
20184 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20185 xmlMemBlocks() - mem_base);
20187 printf(" %d", n_out_doc);
20188 printf(" %d", n_doc_txt_ptr);
20189 printf(" %d", n_doc_txt_len);
20190 printf(" %d", n_txt_encoding);
20205 test_xmlDocFormatDump(void) {
20208 #if defined(LIBXML_OUTPUT_ENABLED)
20211 FILE * f; /* the FILE* */
20213 xmlDocPtr cur; /* the document */
20215 int format; /* should formatting spaces been added */
20218 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20219 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20220 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20221 mem_base = xmlMemBlocks();
20222 f = gen_FILE_ptr(n_f, 0);
20223 cur = gen_xmlDocPtr(n_cur, 1);
20224 format = gen_int(n_format, 2);
20226 ret_val = xmlDocFormatDump(f, cur, format);
20227 desret_int(ret_val);
20229 des_FILE_ptr(n_f, f, 0);
20230 des_xmlDocPtr(n_cur, cur, 1);
20231 des_int(n_format, format, 2);
20232 xmlResetLastError();
20233 if (mem_base != xmlMemBlocks()) {
20234 printf("Leak of %d blocks found in xmlDocFormatDump",
20235 xmlMemBlocks() - mem_base);
20237 printf(" %d", n_f);
20238 printf(" %d", n_cur);
20239 printf(" %d", n_format);
20253 test_xmlDocGetRootElement(void) {
20257 xmlNodePtr ret_val;
20258 xmlDocPtr doc; /* the document */
20261 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20262 mem_base = xmlMemBlocks();
20263 doc = gen_xmlDocPtr(n_doc, 0);
20265 ret_val = xmlDocGetRootElement(doc);
20266 desret_xmlNodePtr(ret_val);
20268 des_xmlDocPtr(n_doc, doc, 0);
20269 xmlResetLastError();
20270 if (mem_base != xmlMemBlocks()) {
20271 printf("Leak of %d blocks found in xmlDocGetRootElement",
20272 xmlMemBlocks() - mem_base);
20274 printf(" %d", n_doc);
20285 test_xmlDocSetRootElement(void) {
20288 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20290 xmlNodePtr ret_val;
20291 xmlDocPtr doc; /* the document */
20293 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. */
20296 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20297 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20298 mem_base = xmlMemBlocks();
20299 doc = gen_xmlDocPtr(n_doc, 0);
20300 root = gen_xmlNodePtr_in(n_root, 1);
20302 ret_val = xmlDocSetRootElement(doc, root);
20303 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20304 desret_xmlNodePtr(ret_val);
20306 des_xmlDocPtr(n_doc, doc, 0);
20307 des_xmlNodePtr_in(n_root, root, 1);
20308 xmlResetLastError();
20309 if (mem_base != xmlMemBlocks()) {
20310 printf("Leak of %d blocks found in xmlDocSetRootElement",
20311 xmlMemBlocks() - mem_base);
20313 printf(" %d", n_doc);
20314 printf(" %d", n_root);
20327 test_xmlElemDump(void) {
20330 #if defined(LIBXML_OUTPUT_ENABLED)
20332 FILE * f; /* the FILE * for the output */
20334 xmlDocPtr doc; /* the document */
20336 xmlNodePtr cur; /* the current node */
20339 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20340 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20341 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20342 mem_base = xmlMemBlocks();
20343 f = gen_FILE_ptr(n_f, 0);
20344 doc = gen_xmlDocPtr(n_doc, 1);
20345 cur = gen_xmlNodePtr(n_cur, 2);
20347 xmlElemDump(f, doc, cur);
20349 des_FILE_ptr(n_f, f, 0);
20350 des_xmlDocPtr(n_doc, doc, 1);
20351 des_xmlNodePtr(n_cur, cur, 2);
20352 xmlResetLastError();
20353 if (mem_base != xmlMemBlocks()) {
20354 printf("Leak of %d blocks found in xmlElemDump",
20355 xmlMemBlocks() - mem_base);
20357 printf(" %d", n_f);
20358 printf(" %d", n_doc);
20359 printf(" %d", n_cur);
20373 test_xmlFirstElementChild(void) {
20376 #if defined(LIBXML_TREE_ENABLED)
20378 xmlNodePtr ret_val;
20379 xmlNodePtr parent; /* the parent node */
20382 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20383 mem_base = xmlMemBlocks();
20384 parent = gen_xmlNodePtr(n_parent, 0);
20386 ret_val = xmlFirstElementChild(parent);
20387 desret_xmlNodePtr(ret_val);
20389 des_xmlNodePtr(n_parent, parent, 0);
20390 xmlResetLastError();
20391 if (mem_base != xmlMemBlocks()) {
20392 printf("Leak of %d blocks found in xmlFirstElementChild",
20393 xmlMemBlocks() - mem_base);
20395 printf(" %d", n_parent);
20407 test_xmlGetBufferAllocationScheme(void) {
20411 xmlBufferAllocationScheme ret_val;
20413 mem_base = xmlMemBlocks();
20415 ret_val = xmlGetBufferAllocationScheme();
20416 desret_xmlBufferAllocationScheme(ret_val);
20418 xmlResetLastError();
20419 if (mem_base != xmlMemBlocks()) {
20420 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20421 xmlMemBlocks() - mem_base);
20432 test_xmlGetCompressMode(void) {
20438 mem_base = xmlMemBlocks();
20440 ret_val = xmlGetCompressMode();
20441 desret_int(ret_val);
20443 xmlResetLastError();
20444 if (mem_base != xmlMemBlocks()) {
20445 printf("Leak of %d blocks found in xmlGetCompressMode",
20446 xmlMemBlocks() - mem_base);
20457 test_xmlGetDocCompressMode(void) {
20462 xmlDocPtr doc; /* the document */
20465 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20466 mem_base = xmlMemBlocks();
20467 doc = gen_xmlDocPtr(n_doc, 0);
20469 ret_val = xmlGetDocCompressMode(doc);
20470 desret_int(ret_val);
20472 des_xmlDocPtr(n_doc, doc, 0);
20473 xmlResetLastError();
20474 if (mem_base != xmlMemBlocks()) {
20475 printf("Leak of %d blocks found in xmlGetDocCompressMode",
20476 xmlMemBlocks() - mem_base);
20478 printf(" %d", n_doc);
20489 test_xmlGetIntSubset(void) {
20494 xmlDocPtr doc; /* the document pointer */
20497 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20498 mem_base = xmlMemBlocks();
20499 doc = gen_xmlDocPtr(n_doc, 0);
20501 ret_val = xmlGetIntSubset(doc);
20502 desret_xmlDtdPtr(ret_val);
20504 des_xmlDocPtr(n_doc, doc, 0);
20505 xmlResetLastError();
20506 if (mem_base != xmlMemBlocks()) {
20507 printf("Leak of %d blocks found in xmlGetIntSubset",
20508 xmlMemBlocks() - mem_base);
20510 printf(" %d", n_doc);
20521 test_xmlGetLastChild(void) {
20525 xmlNodePtr ret_val;
20526 xmlNodePtr parent; /* the parent node */
20529 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20530 mem_base = xmlMemBlocks();
20531 parent = gen_xmlNodePtr(n_parent, 0);
20533 ret_val = xmlGetLastChild(parent);
20534 desret_xmlNodePtr(ret_val);
20536 des_xmlNodePtr(n_parent, parent, 0);
20537 xmlResetLastError();
20538 if (mem_base != xmlMemBlocks()) {
20539 printf("Leak of %d blocks found in xmlGetLastChild",
20540 xmlMemBlocks() - mem_base);
20542 printf(" %d", n_parent);
20553 test_xmlGetLineNo(void) {
20558 xmlNodePtr node; /* valid node */
20561 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20562 mem_base = xmlMemBlocks();
20563 node = gen_xmlNodePtr(n_node, 0);
20565 ret_val = xmlGetLineNo(node);
20566 desret_long(ret_val);
20568 des_xmlNodePtr(n_node, node, 0);
20569 xmlResetLastError();
20570 if (mem_base != xmlMemBlocks()) {
20571 printf("Leak of %d blocks found in xmlGetLineNo",
20572 xmlMemBlocks() - mem_base);
20574 printf(" %d", n_node);
20585 test_xmlGetNoNsProp(void) {
20590 xmlNodePtr node; /* the node */
20592 xmlChar * name; /* the attribute name */
20595 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20596 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20597 mem_base = xmlMemBlocks();
20598 node = gen_xmlNodePtr(n_node, 0);
20599 name = gen_const_xmlChar_ptr(n_name, 1);
20601 ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20602 desret_xmlChar_ptr(ret_val);
20604 des_xmlNodePtr(n_node, node, 0);
20605 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20606 xmlResetLastError();
20607 if (mem_base != xmlMemBlocks()) {
20608 printf("Leak of %d blocks found in xmlGetNoNsProp",
20609 xmlMemBlocks() - mem_base);
20611 printf(" %d", n_node);
20612 printf(" %d", n_name);
20624 test_xmlGetNodePath(void) {
20627 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20630 xmlNodePtr node; /* a node */
20633 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20634 mem_base = xmlMemBlocks();
20635 node = gen_xmlNodePtr(n_node, 0);
20637 ret_val = xmlGetNodePath(node);
20638 desret_xmlChar_ptr(ret_val);
20640 des_xmlNodePtr(n_node, node, 0);
20641 xmlResetLastError();
20642 if (mem_base != xmlMemBlocks()) {
20643 printf("Leak of %d blocks found in xmlGetNodePath",
20644 xmlMemBlocks() - mem_base);
20646 printf(" %d", n_node);
20658 test_xmlGetNsList(void) {
20662 /* missing type support */
20668 test_xmlGetNsProp(void) {
20673 xmlNodePtr node; /* the node */
20675 xmlChar * name; /* the attribute name */
20677 xmlChar * nameSpace; /* the URI of the namespace */
20680 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20681 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20682 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20683 mem_base = xmlMemBlocks();
20684 node = gen_xmlNodePtr(n_node, 0);
20685 name = gen_const_xmlChar_ptr(n_name, 1);
20686 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20688 ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20689 desret_xmlChar_ptr(ret_val);
20691 des_xmlNodePtr(n_node, node, 0);
20692 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20693 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20694 xmlResetLastError();
20695 if (mem_base != xmlMemBlocks()) {
20696 printf("Leak of %d blocks found in xmlGetNsProp",
20697 xmlMemBlocks() - mem_base);
20699 printf(" %d", n_node);
20700 printf(" %d", n_name);
20701 printf(" %d", n_nameSpace);
20714 test_xmlGetProp(void) {
20719 xmlNodePtr node; /* the node */
20721 xmlChar * name; /* the attribute name */
20724 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20725 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20726 mem_base = xmlMemBlocks();
20727 node = gen_xmlNodePtr(n_node, 0);
20728 name = gen_const_xmlChar_ptr(n_name, 1);
20730 ret_val = xmlGetProp(node, (const xmlChar *)name);
20731 desret_xmlChar_ptr(ret_val);
20733 des_xmlNodePtr(n_node, node, 0);
20734 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20735 xmlResetLastError();
20736 if (mem_base != xmlMemBlocks()) {
20737 printf("Leak of %d blocks found in xmlGetProp",
20738 xmlMemBlocks() - mem_base);
20740 printf(" %d", n_node);
20741 printf(" %d", n_name);
20753 test_xmlHasNsProp(void) {
20757 xmlAttrPtr ret_val;
20758 xmlNodePtr node; /* the node */
20760 xmlChar * name; /* the attribute name */
20762 xmlChar * nameSpace; /* the URI of the namespace */
20765 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20766 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20767 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20768 mem_base = xmlMemBlocks();
20769 node = gen_xmlNodePtr(n_node, 0);
20770 name = gen_const_xmlChar_ptr(n_name, 1);
20771 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20773 ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20774 desret_xmlAttrPtr(ret_val);
20776 des_xmlNodePtr(n_node, node, 0);
20777 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20778 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20779 xmlResetLastError();
20780 if (mem_base != xmlMemBlocks()) {
20781 printf("Leak of %d blocks found in xmlHasNsProp",
20782 xmlMemBlocks() - mem_base);
20784 printf(" %d", n_node);
20785 printf(" %d", n_name);
20786 printf(" %d", n_nameSpace);
20799 test_xmlHasProp(void) {
20803 xmlAttrPtr ret_val;
20804 xmlNodePtr node; /* the node */
20806 xmlChar * name; /* the attribute name */
20809 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20810 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20811 mem_base = xmlMemBlocks();
20812 node = gen_xmlNodePtr(n_node, 0);
20813 name = gen_const_xmlChar_ptr(n_name, 1);
20815 ret_val = xmlHasProp(node, (const xmlChar *)name);
20816 desret_xmlAttrPtr(ret_val);
20818 des_xmlNodePtr(n_node, node, 0);
20819 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20820 xmlResetLastError();
20821 if (mem_base != xmlMemBlocks()) {
20822 printf("Leak of %d blocks found in xmlHasProp",
20823 xmlMemBlocks() - mem_base);
20825 printf(" %d", n_node);
20826 printf(" %d", n_name);
20838 test_xmlIsBlankNode(void) {
20843 xmlNodePtr node; /* the node */
20846 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20847 mem_base = xmlMemBlocks();
20848 node = gen_xmlNodePtr(n_node, 0);
20850 ret_val = xmlIsBlankNode(node);
20851 desret_int(ret_val);
20853 des_xmlNodePtr(n_node, node, 0);
20854 xmlResetLastError();
20855 if (mem_base != xmlMemBlocks()) {
20856 printf("Leak of %d blocks found in xmlIsBlankNode",
20857 xmlMemBlocks() - mem_base);
20859 printf(" %d", n_node);
20870 test_xmlIsXHTML(void) {
20875 xmlChar * systemID; /* the system identifier */
20877 xmlChar * publicID; /* the public identifier */
20880 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20881 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20882 mem_base = xmlMemBlocks();
20883 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20884 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20886 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20887 desret_int(ret_val);
20889 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20890 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20891 xmlResetLastError();
20892 if (mem_base != xmlMemBlocks()) {
20893 printf("Leak of %d blocks found in xmlIsXHTML",
20894 xmlMemBlocks() - mem_base);
20896 printf(" %d", n_systemID);
20897 printf(" %d", n_publicID);
20909 test_xmlLastElementChild(void) {
20912 #if defined(LIBXML_TREE_ENABLED)
20914 xmlNodePtr ret_val;
20915 xmlNodePtr parent; /* the parent node */
20918 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20919 mem_base = xmlMemBlocks();
20920 parent = gen_xmlNodePtr(n_parent, 0);
20922 ret_val = xmlLastElementChild(parent);
20923 desret_xmlNodePtr(ret_val);
20925 des_xmlNodePtr(n_parent, parent, 0);
20926 xmlResetLastError();
20927 if (mem_base != xmlMemBlocks()) {
20928 printf("Leak of %d blocks found in xmlLastElementChild",
20929 xmlMemBlocks() - mem_base);
20931 printf(" %d", n_parent);
20943 test_xmlNewCDataBlock(void) {
20947 xmlNodePtr ret_val;
20948 xmlDocPtr doc; /* the document */
20950 xmlChar * content; /* the CDATA block content content */
20952 int len; /* the length of the block */
20955 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20956 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20957 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20958 mem_base = xmlMemBlocks();
20959 doc = gen_xmlDocPtr(n_doc, 0);
20960 content = gen_const_xmlChar_ptr(n_content, 1);
20961 len = gen_int(n_len, 2);
20963 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20964 desret_xmlNodePtr(ret_val);
20966 des_xmlDocPtr(n_doc, doc, 0);
20967 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20968 des_int(n_len, len, 2);
20969 xmlResetLastError();
20970 if (mem_base != xmlMemBlocks()) {
20971 printf("Leak of %d blocks found in xmlNewCDataBlock",
20972 xmlMemBlocks() - mem_base);
20974 printf(" %d", n_doc);
20975 printf(" %d", n_content);
20976 printf(" %d", n_len);
20989 test_xmlNewCharRef(void) {
20993 xmlNodePtr ret_val;
20994 xmlDocPtr doc; /* the document */
20996 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20999 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21000 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21001 mem_base = xmlMemBlocks();
21002 doc = gen_xmlDocPtr(n_doc, 0);
21003 name = gen_const_xmlChar_ptr(n_name, 1);
21005 ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21006 desret_xmlNodePtr(ret_val);
21008 des_xmlDocPtr(n_doc, doc, 0);
21009 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21010 xmlResetLastError();
21011 if (mem_base != xmlMemBlocks()) {
21012 printf("Leak of %d blocks found in xmlNewCharRef",
21013 xmlMemBlocks() - mem_base);
21015 printf(" %d", n_doc);
21016 printf(" %d", n_name);
21028 test_xmlNewChild(void) {
21031 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21032 #ifdef LIBXML_TREE_ENABLED
21034 xmlNodePtr ret_val;
21035 xmlNodePtr parent; /* the parent node */
21037 xmlNsPtr ns; /* a namespace if any */
21039 xmlChar * name; /* the name of the child */
21041 xmlChar * content; /* the XML content of the child if any. */
21044 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21045 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21046 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21047 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21048 mem_base = xmlMemBlocks();
21049 parent = gen_xmlNodePtr(n_parent, 0);
21050 ns = gen_xmlNsPtr(n_ns, 1);
21051 name = gen_const_xmlChar_ptr(n_name, 2);
21052 content = gen_const_xmlChar_ptr(n_content, 3);
21054 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21055 desret_xmlNodePtr(ret_val);
21057 des_xmlNodePtr(n_parent, parent, 0);
21058 des_xmlNsPtr(n_ns, ns, 1);
21059 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21060 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21061 xmlResetLastError();
21062 if (mem_base != xmlMemBlocks()) {
21063 printf("Leak of %d blocks found in xmlNewChild",
21064 xmlMemBlocks() - mem_base);
21066 printf(" %d", n_parent);
21067 printf(" %d", n_ns);
21068 printf(" %d", n_name);
21069 printf(" %d", n_content);
21085 test_xmlNewComment(void) {
21089 xmlNodePtr ret_val;
21090 xmlChar * content; /* the comment content */
21093 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21094 mem_base = xmlMemBlocks();
21095 content = gen_const_xmlChar_ptr(n_content, 0);
21097 ret_val = xmlNewComment((const xmlChar *)content);
21098 desret_xmlNodePtr(ret_val);
21100 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21101 xmlResetLastError();
21102 if (mem_base != xmlMemBlocks()) {
21103 printf("Leak of %d blocks found in xmlNewComment",
21104 xmlMemBlocks() - mem_base);
21106 printf(" %d", n_content);
21117 test_xmlNewDoc(void) {
21122 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21125 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21126 mem_base = xmlMemBlocks();
21127 version = gen_const_xmlChar_ptr(n_version, 0);
21129 ret_val = xmlNewDoc((const xmlChar *)version);
21130 desret_xmlDocPtr(ret_val);
21132 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21133 xmlResetLastError();
21134 if (mem_base != xmlMemBlocks()) {
21135 printf("Leak of %d blocks found in xmlNewDoc",
21136 xmlMemBlocks() - mem_base);
21138 printf(" %d", n_version);
21149 test_xmlNewDocComment(void) {
21153 xmlNodePtr ret_val;
21154 xmlDocPtr doc; /* the document */
21156 xmlChar * content; /* the comment content */
21159 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21160 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21161 mem_base = xmlMemBlocks();
21162 doc = gen_xmlDocPtr(n_doc, 0);
21163 content = gen_const_xmlChar_ptr(n_content, 1);
21165 ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21166 desret_xmlNodePtr(ret_val);
21168 des_xmlDocPtr(n_doc, doc, 0);
21169 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21170 xmlResetLastError();
21171 if (mem_base != xmlMemBlocks()) {
21172 printf("Leak of %d blocks found in xmlNewDocComment",
21173 xmlMemBlocks() - mem_base);
21175 printf(" %d", n_doc);
21176 printf(" %d", n_content);
21188 test_xmlNewDocFragment(void) {
21191 #if defined(LIBXML_TREE_ENABLED)
21193 xmlNodePtr ret_val;
21194 xmlDocPtr doc; /* the document owning the fragment */
21197 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21198 mem_base = xmlMemBlocks();
21199 doc = gen_xmlDocPtr(n_doc, 0);
21201 ret_val = xmlNewDocFragment(doc);
21202 desret_xmlNodePtr(ret_val);
21204 des_xmlDocPtr(n_doc, doc, 0);
21205 xmlResetLastError();
21206 if (mem_base != xmlMemBlocks()) {
21207 printf("Leak of %d blocks found in xmlNewDocFragment",
21208 xmlMemBlocks() - mem_base);
21210 printf(" %d", n_doc);
21222 test_xmlNewDocNode(void) {
21226 xmlNodePtr ret_val;
21227 xmlDocPtr doc; /* the document */
21229 xmlNsPtr ns; /* namespace if any */
21231 xmlChar * name; /* the node name */
21233 xmlChar * content; /* the XML text content if any */
21236 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21237 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21238 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21239 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21240 mem_base = xmlMemBlocks();
21241 doc = gen_xmlDocPtr(n_doc, 0);
21242 ns = gen_xmlNsPtr(n_ns, 1);
21243 name = gen_const_xmlChar_ptr(n_name, 2);
21244 content = gen_const_xmlChar_ptr(n_content, 3);
21246 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21247 desret_xmlNodePtr(ret_val);
21249 des_xmlDocPtr(n_doc, doc, 0);
21250 des_xmlNsPtr(n_ns, ns, 1);
21251 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21252 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21253 xmlResetLastError();
21254 if (mem_base != xmlMemBlocks()) {
21255 printf("Leak of %d blocks found in xmlNewDocNode",
21256 xmlMemBlocks() - mem_base);
21258 printf(" %d", n_doc);
21259 printf(" %d", n_ns);
21260 printf(" %d", n_name);
21261 printf(" %d", n_content);
21275 test_xmlNewDocNodeEatName(void) {
21279 xmlNodePtr ret_val;
21280 xmlDocPtr doc; /* the document */
21282 xmlNsPtr ns; /* namespace if any */
21284 xmlChar * name; /* the node name */
21286 xmlChar * content; /* the XML text content if any */
21289 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21290 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21291 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21292 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21293 mem_base = xmlMemBlocks();
21294 doc = gen_xmlDocPtr(n_doc, 0);
21295 ns = gen_xmlNsPtr(n_ns, 1);
21296 name = gen_eaten_name(n_name, 2);
21297 content = gen_const_xmlChar_ptr(n_content, 3);
21299 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21300 desret_xmlNodePtr(ret_val);
21302 des_xmlDocPtr(n_doc, doc, 0);
21303 des_xmlNsPtr(n_ns, ns, 1);
21304 des_eaten_name(n_name, name, 2);
21305 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21306 xmlResetLastError();
21307 if (mem_base != xmlMemBlocks()) {
21308 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21309 xmlMemBlocks() - mem_base);
21311 printf(" %d", n_doc);
21312 printf(" %d", n_ns);
21313 printf(" %d", n_name);
21314 printf(" %d", n_content);
21328 test_xmlNewDocPI(void) {
21332 xmlNodePtr ret_val;
21333 xmlDocPtr doc; /* the target document */
21335 xmlChar * name; /* the processing instruction name */
21337 xmlChar * content; /* the PI content */
21340 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21341 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21342 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21343 mem_base = xmlMemBlocks();
21344 doc = gen_xmlDocPtr(n_doc, 0);
21345 name = gen_const_xmlChar_ptr(n_name, 1);
21346 content = gen_const_xmlChar_ptr(n_content, 2);
21348 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21349 desret_xmlNodePtr(ret_val);
21351 des_xmlDocPtr(n_doc, doc, 0);
21352 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21353 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21354 xmlResetLastError();
21355 if (mem_base != xmlMemBlocks()) {
21356 printf("Leak of %d blocks found in xmlNewDocPI",
21357 xmlMemBlocks() - mem_base);
21359 printf(" %d", n_doc);
21360 printf(" %d", n_name);
21361 printf(" %d", n_content);
21374 test_xmlNewDocProp(void) {
21378 xmlAttrPtr ret_val;
21379 xmlDocPtr doc; /* the document */
21381 xmlChar * name; /* the name of the attribute */
21383 xmlChar * value; /* the value of the attribute */
21386 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21387 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21388 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21389 mem_base = xmlMemBlocks();
21390 doc = gen_xmlDocPtr(n_doc, 0);
21391 name = gen_const_xmlChar_ptr(n_name, 1);
21392 value = gen_const_xmlChar_ptr(n_value, 2);
21394 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21395 desret_xmlAttrPtr(ret_val);
21397 des_xmlDocPtr(n_doc, doc, 0);
21398 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21399 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21400 xmlResetLastError();
21401 if (mem_base != xmlMemBlocks()) {
21402 printf("Leak of %d blocks found in xmlNewDocProp",
21403 xmlMemBlocks() - mem_base);
21405 printf(" %d", n_doc);
21406 printf(" %d", n_name);
21407 printf(" %d", n_value);
21420 test_xmlNewDocRawNode(void) {
21423 #if defined(LIBXML_TREE_ENABLED)
21424 #ifdef LIBXML_TREE_ENABLED
21426 xmlNodePtr ret_val;
21427 xmlDocPtr doc; /* the document */
21429 xmlNsPtr ns; /* namespace if any */
21431 xmlChar * name; /* the node name */
21433 xmlChar * content; /* the text content if any */
21436 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21437 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21438 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21439 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21440 mem_base = xmlMemBlocks();
21441 doc = gen_xmlDocPtr(n_doc, 0);
21442 ns = gen_xmlNsPtr(n_ns, 1);
21443 name = gen_const_xmlChar_ptr(n_name, 2);
21444 content = gen_const_xmlChar_ptr(n_content, 3);
21446 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21447 desret_xmlNodePtr(ret_val);
21449 des_xmlDocPtr(n_doc, doc, 0);
21450 des_xmlNsPtr(n_ns, ns, 1);
21451 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21452 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21453 xmlResetLastError();
21454 if (mem_base != xmlMemBlocks()) {
21455 printf("Leak of %d blocks found in xmlNewDocRawNode",
21456 xmlMemBlocks() - mem_base);
21458 printf(" %d", n_doc);
21459 printf(" %d", n_ns);
21460 printf(" %d", n_name);
21461 printf(" %d", n_content);
21477 test_xmlNewDocText(void) {
21481 xmlNodePtr ret_val;
21482 xmlDocPtr doc; /* the document */
21484 xmlChar * content; /* the text content */
21487 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21488 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21489 mem_base = xmlMemBlocks();
21490 doc = gen_xmlDocPtr(n_doc, 0);
21491 content = gen_const_xmlChar_ptr(n_content, 1);
21493 ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21494 desret_xmlNodePtr(ret_val);
21496 des_xmlDocPtr(n_doc, doc, 0);
21497 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21498 xmlResetLastError();
21499 if (mem_base != xmlMemBlocks()) {
21500 printf("Leak of %d blocks found in xmlNewDocText",
21501 xmlMemBlocks() - mem_base);
21503 printf(" %d", n_doc);
21504 printf(" %d", n_content);
21516 test_xmlNewDocTextLen(void) {
21520 xmlNodePtr ret_val;
21521 xmlDocPtr doc; /* the document */
21523 xmlChar * content; /* the text content */
21525 int len; /* the text len. */
21528 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21529 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21530 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21531 mem_base = xmlMemBlocks();
21532 doc = gen_xmlDocPtr(n_doc, 0);
21533 content = gen_const_xmlChar_ptr(n_content, 1);
21534 len = gen_int(n_len, 2);
21536 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21537 desret_xmlNodePtr(ret_val);
21539 des_xmlDocPtr(n_doc, doc, 0);
21540 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21541 des_int(n_len, len, 2);
21542 xmlResetLastError();
21543 if (mem_base != xmlMemBlocks()) {
21544 printf("Leak of %d blocks found in xmlNewDocTextLen",
21545 xmlMemBlocks() - mem_base);
21547 printf(" %d", n_doc);
21548 printf(" %d", n_content);
21549 printf(" %d", n_len);
21562 test_xmlNewDtd(void) {
21567 xmlDocPtr doc; /* the document pointer */
21569 xmlChar * name; /* the DTD name */
21571 xmlChar * ExternalID; /* the external ID */
21573 xmlChar * SystemID; /* the system ID */
21576 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21577 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21578 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21579 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21580 mem_base = xmlMemBlocks();
21581 doc = gen_xmlDocPtr(n_doc, 0);
21582 name = gen_const_xmlChar_ptr(n_name, 1);
21583 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21584 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21586 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21587 desret_xmlDtdPtr(ret_val);
21589 des_xmlDocPtr(n_doc, doc, 0);
21590 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21591 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21592 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21593 xmlResetLastError();
21594 if (mem_base != xmlMemBlocks()) {
21595 printf("Leak of %d blocks found in xmlNewDtd",
21596 xmlMemBlocks() - mem_base);
21598 printf(" %d", n_doc);
21599 printf(" %d", n_name);
21600 printf(" %d", n_ExternalID);
21601 printf(" %d", n_SystemID);
21615 test_xmlNewNode(void) {
21619 xmlNodePtr ret_val;
21620 xmlNsPtr ns; /* namespace if any */
21622 xmlChar * name; /* the node name */
21625 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21626 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21627 mem_base = xmlMemBlocks();
21628 ns = gen_xmlNsPtr(n_ns, 0);
21629 name = gen_const_xmlChar_ptr(n_name, 1);
21631 ret_val = xmlNewNode(ns, (const xmlChar *)name);
21632 desret_xmlNodePtr(ret_val);
21634 des_xmlNsPtr(n_ns, ns, 0);
21635 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21636 xmlResetLastError();
21637 if (mem_base != xmlMemBlocks()) {
21638 printf("Leak of %d blocks found in xmlNewNode",
21639 xmlMemBlocks() - mem_base);
21641 printf(" %d", n_ns);
21642 printf(" %d", n_name);
21654 test_xmlNewNodeEatName(void) {
21658 xmlNodePtr ret_val;
21659 xmlNsPtr ns; /* namespace if any */
21661 xmlChar * name; /* the node name */
21664 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21665 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21666 mem_base = xmlMemBlocks();
21667 ns = gen_xmlNsPtr(n_ns, 0);
21668 name = gen_eaten_name(n_name, 1);
21670 ret_val = xmlNewNodeEatName(ns, name);
21671 desret_xmlNodePtr(ret_val);
21673 des_xmlNsPtr(n_ns, ns, 0);
21674 des_eaten_name(n_name, name, 1);
21675 xmlResetLastError();
21676 if (mem_base != xmlMemBlocks()) {
21677 printf("Leak of %d blocks found in xmlNewNodeEatName",
21678 xmlMemBlocks() - mem_base);
21680 printf(" %d", n_ns);
21681 printf(" %d", n_name);
21693 test_xmlNewNs(void) {
21698 xmlNodePtr node; /* the element carrying the namespace */
21700 xmlChar * href; /* the URI associated */
21702 xmlChar * prefix; /* the prefix for the namespace */
21705 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21706 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21707 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21708 mem_base = xmlMemBlocks();
21709 node = gen_xmlNodePtr(n_node, 0);
21710 href = gen_const_xmlChar_ptr(n_href, 1);
21711 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21713 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21714 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21715 desret_xmlNsPtr(ret_val);
21717 des_xmlNodePtr(n_node, node, 0);
21718 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21719 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21720 xmlResetLastError();
21721 if (mem_base != xmlMemBlocks()) {
21722 printf("Leak of %d blocks found in xmlNewNs",
21723 xmlMemBlocks() - mem_base);
21725 printf(" %d", n_node);
21726 printf(" %d", n_href);
21727 printf(" %d", n_prefix);
21740 test_xmlNewNsProp(void) {
21744 xmlAttrPtr ret_val;
21745 xmlNodePtr node; /* the holding node */
21747 xmlNsPtr ns; /* the namespace */
21749 xmlChar * name; /* the name of the attribute */
21751 xmlChar * value; /* the value of the attribute */
21754 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21755 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21756 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21757 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21758 mem_base = xmlMemBlocks();
21759 node = gen_xmlNodePtr(n_node, 0);
21760 ns = gen_xmlNsPtr(n_ns, 1);
21761 name = gen_const_xmlChar_ptr(n_name, 2);
21762 value = gen_const_xmlChar_ptr(n_value, 3);
21764 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21765 desret_xmlAttrPtr(ret_val);
21767 des_xmlNodePtr(n_node, node, 0);
21768 des_xmlNsPtr(n_ns, ns, 1);
21769 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21770 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21771 xmlResetLastError();
21772 if (mem_base != xmlMemBlocks()) {
21773 printf("Leak of %d blocks found in xmlNewNsProp",
21774 xmlMemBlocks() - mem_base);
21776 printf(" %d", n_node);
21777 printf(" %d", n_ns);
21778 printf(" %d", n_name);
21779 printf(" %d", n_value);
21793 test_xmlNewNsPropEatName(void) {
21797 xmlAttrPtr ret_val;
21798 xmlNodePtr node; /* the holding node */
21800 xmlNsPtr ns; /* the namespace */
21802 xmlChar * name; /* the name of the attribute */
21804 xmlChar * value; /* the value of the attribute */
21807 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21808 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21809 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21810 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21811 mem_base = xmlMemBlocks();
21812 node = gen_xmlNodePtr(n_node, 0);
21813 ns = gen_xmlNsPtr(n_ns, 1);
21814 name = gen_eaten_name(n_name, 2);
21815 value = gen_const_xmlChar_ptr(n_value, 3);
21817 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21818 desret_xmlAttrPtr(ret_val);
21820 des_xmlNodePtr(n_node, node, 0);
21821 des_xmlNsPtr(n_ns, ns, 1);
21822 des_eaten_name(n_name, name, 2);
21823 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21824 xmlResetLastError();
21825 if (mem_base != xmlMemBlocks()) {
21826 printf("Leak of %d blocks found in xmlNewNsPropEatName",
21827 xmlMemBlocks() - mem_base);
21829 printf(" %d", n_node);
21830 printf(" %d", n_ns);
21831 printf(" %d", n_name);
21832 printf(" %d", n_value);
21846 test_xmlNewPI(void) {
21850 xmlNodePtr ret_val;
21851 xmlChar * name; /* the processing instruction name */
21853 xmlChar * content; /* the PI content */
21856 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21857 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21858 mem_base = xmlMemBlocks();
21859 name = gen_const_xmlChar_ptr(n_name, 0);
21860 content = gen_const_xmlChar_ptr(n_content, 1);
21862 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21863 desret_xmlNodePtr(ret_val);
21865 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21866 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21867 xmlResetLastError();
21868 if (mem_base != xmlMemBlocks()) {
21869 printf("Leak of %d blocks found in xmlNewPI",
21870 xmlMemBlocks() - mem_base);
21872 printf(" %d", n_name);
21873 printf(" %d", n_content);
21885 test_xmlNewProp(void) {
21888 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21889 #ifdef LIBXML_TREE_ENABLED
21891 xmlAttrPtr ret_val;
21892 xmlNodePtr node; /* the holding node */
21894 xmlChar * name; /* the name of the attribute */
21896 xmlChar * value; /* the value of the attribute */
21899 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21900 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21901 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21902 mem_base = xmlMemBlocks();
21903 node = gen_xmlNodePtr(n_node, 0);
21904 name = gen_const_xmlChar_ptr(n_name, 1);
21905 value = gen_const_xmlChar_ptr(n_value, 2);
21907 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21908 desret_xmlAttrPtr(ret_val);
21910 des_xmlNodePtr(n_node, node, 0);
21911 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21912 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21913 xmlResetLastError();
21914 if (mem_base != xmlMemBlocks()) {
21915 printf("Leak of %d blocks found in xmlNewProp",
21916 xmlMemBlocks() - mem_base);
21918 printf(" %d", n_node);
21919 printf(" %d", n_name);
21920 printf(" %d", n_value);
21935 test_xmlNewReference(void) {
21939 xmlNodePtr ret_val;
21940 xmlDocPtr doc; /* the document */
21942 xmlChar * name; /* the reference name, or the reference string with & and ; */
21945 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21946 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21947 mem_base = xmlMemBlocks();
21948 doc = gen_xmlDocPtr(n_doc, 0);
21949 name = gen_const_xmlChar_ptr(n_name, 1);
21951 ret_val = xmlNewReference(doc, (const xmlChar *)name);
21952 desret_xmlNodePtr(ret_val);
21954 des_xmlDocPtr(n_doc, doc, 0);
21955 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21956 xmlResetLastError();
21957 if (mem_base != xmlMemBlocks()) {
21958 printf("Leak of %d blocks found in xmlNewReference",
21959 xmlMemBlocks() - mem_base);
21961 printf(" %d", n_doc);
21962 printf(" %d", n_name);
21974 test_xmlNewText(void) {
21978 xmlNodePtr ret_val;
21979 xmlChar * content; /* the text content */
21982 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21983 mem_base = xmlMemBlocks();
21984 content = gen_const_xmlChar_ptr(n_content, 0);
21986 ret_val = xmlNewText((const xmlChar *)content);
21987 desret_xmlNodePtr(ret_val);
21989 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21990 xmlResetLastError();
21991 if (mem_base != xmlMemBlocks()) {
21992 printf("Leak of %d blocks found in xmlNewText",
21993 xmlMemBlocks() - mem_base);
21995 printf(" %d", n_content);
22006 test_xmlNewTextChild(void) {
22009 #if defined(LIBXML_TREE_ENABLED)
22010 #ifdef LIBXML_TREE_ENABLED
22012 xmlNodePtr ret_val;
22013 xmlNodePtr parent; /* the parent node */
22015 xmlNsPtr ns; /* a namespace if any */
22017 xmlChar * name; /* the name of the child */
22019 xmlChar * content; /* the text content of the child if any. */
22022 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22023 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22024 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22025 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22026 mem_base = xmlMemBlocks();
22027 parent = gen_xmlNodePtr(n_parent, 0);
22028 ns = gen_xmlNsPtr(n_ns, 1);
22029 name = gen_const_xmlChar_ptr(n_name, 2);
22030 content = gen_const_xmlChar_ptr(n_content, 3);
22032 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22033 desret_xmlNodePtr(ret_val);
22035 des_xmlNodePtr(n_parent, parent, 0);
22036 des_xmlNsPtr(n_ns, ns, 1);
22037 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22038 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22039 xmlResetLastError();
22040 if (mem_base != xmlMemBlocks()) {
22041 printf("Leak of %d blocks found in xmlNewTextChild",
22042 xmlMemBlocks() - mem_base);
22044 printf(" %d", n_parent);
22045 printf(" %d", n_ns);
22046 printf(" %d", n_name);
22047 printf(" %d", n_content);
22063 test_xmlNewTextLen(void) {
22067 xmlNodePtr ret_val;
22068 xmlChar * content; /* the text content */
22070 int len; /* the text len. */
22073 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22074 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22075 mem_base = xmlMemBlocks();
22076 content = gen_const_xmlChar_ptr(n_content, 0);
22077 len = gen_int(n_len, 1);
22079 ret_val = xmlNewTextLen((const xmlChar *)content, len);
22080 desret_xmlNodePtr(ret_val);
22082 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22083 des_int(n_len, len, 1);
22084 xmlResetLastError();
22085 if (mem_base != xmlMemBlocks()) {
22086 printf("Leak of %d blocks found in xmlNewTextLen",
22087 xmlMemBlocks() - mem_base);
22089 printf(" %d", n_content);
22090 printf(" %d", n_len);
22102 test_xmlNextElementSibling(void) {
22105 #if defined(LIBXML_TREE_ENABLED)
22107 xmlNodePtr ret_val;
22108 xmlNodePtr node; /* the current node */
22111 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22112 mem_base = xmlMemBlocks();
22113 node = gen_xmlNodePtr(n_node, 0);
22115 ret_val = xmlNextElementSibling(node);
22116 desret_xmlNodePtr(ret_val);
22118 des_xmlNodePtr(n_node, node, 0);
22119 xmlResetLastError();
22120 if (mem_base != xmlMemBlocks()) {
22121 printf("Leak of %d blocks found in xmlNextElementSibling",
22122 xmlMemBlocks() - mem_base);
22124 printf(" %d", n_node);
22136 test_xmlNodeAddContent(void) {
22140 xmlNodePtr cur; /* the node being modified */
22142 xmlChar * content; /* extra content */
22145 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22146 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22147 mem_base = xmlMemBlocks();
22148 cur = gen_xmlNodePtr(n_cur, 0);
22149 content = gen_const_xmlChar_ptr(n_content, 1);
22151 xmlNodeAddContent(cur, (const xmlChar *)content);
22153 des_xmlNodePtr(n_cur, cur, 0);
22154 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22155 xmlResetLastError();
22156 if (mem_base != xmlMemBlocks()) {
22157 printf("Leak of %d blocks found in xmlNodeAddContent",
22158 xmlMemBlocks() - mem_base);
22160 printf(" %d", n_cur);
22161 printf(" %d", n_content);
22173 test_xmlNodeAddContentLen(void) {
22177 xmlNodePtr cur; /* the node being modified */
22179 xmlChar * content; /* extra content */
22181 int len; /* the size of @content */
22184 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22185 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22186 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22187 mem_base = xmlMemBlocks();
22188 cur = gen_xmlNodePtr(n_cur, 0);
22189 content = gen_const_xmlChar_ptr(n_content, 1);
22190 len = gen_int(n_len, 2);
22192 xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22194 des_xmlNodePtr(n_cur, cur, 0);
22195 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22196 des_int(n_len, len, 2);
22197 xmlResetLastError();
22198 if (mem_base != xmlMemBlocks()) {
22199 printf("Leak of %d blocks found in xmlNodeAddContentLen",
22200 xmlMemBlocks() - mem_base);
22202 printf(" %d", n_cur);
22203 printf(" %d", n_content);
22204 printf(" %d", n_len);
22217 test_xmlNodeBufGetContent(void) {
22222 xmlBufferPtr buffer; /* a buffer */
22224 xmlNodePtr cur; /* the node being read */
22227 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22228 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22229 mem_base = xmlMemBlocks();
22230 buffer = gen_xmlBufferPtr(n_buffer, 0);
22231 cur = gen_xmlNodePtr(n_cur, 1);
22233 ret_val = xmlNodeBufGetContent(buffer, cur);
22234 desret_int(ret_val);
22236 des_xmlBufferPtr(n_buffer, buffer, 0);
22237 des_xmlNodePtr(n_cur, cur, 1);
22238 xmlResetLastError();
22239 if (mem_base != xmlMemBlocks()) {
22240 printf("Leak of %d blocks found in xmlNodeBufGetContent",
22241 xmlMemBlocks() - mem_base);
22243 printf(" %d", n_buffer);
22244 printf(" %d", n_cur);
22256 test_xmlNodeDump(void) {
22259 #if defined(LIBXML_OUTPUT_ENABLED)
22262 xmlBufferPtr buf; /* the XML buffer output */
22264 xmlDocPtr doc; /* the document */
22266 xmlNodePtr cur; /* the current node */
22268 int level; /* the imbrication level for indenting */
22270 int format; /* is formatting allowed */
22273 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22274 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22275 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22276 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22277 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22278 mem_base = xmlMemBlocks();
22279 buf = gen_xmlBufferPtr(n_buf, 0);
22280 doc = gen_xmlDocPtr(n_doc, 1);
22281 cur = gen_xmlNodePtr(n_cur, 2);
22282 level = gen_int(n_level, 3);
22283 format = gen_int(n_format, 4);
22285 ret_val = xmlNodeDump(buf, doc, cur, level, format);
22286 desret_int(ret_val);
22288 des_xmlBufferPtr(n_buf, buf, 0);
22289 des_xmlDocPtr(n_doc, doc, 1);
22290 des_xmlNodePtr(n_cur, cur, 2);
22291 des_int(n_level, level, 3);
22292 des_int(n_format, format, 4);
22293 xmlResetLastError();
22294 if (mem_base != xmlMemBlocks()) {
22295 printf("Leak of %d blocks found in xmlNodeDump",
22296 xmlMemBlocks() - mem_base);
22298 printf(" %d", n_buf);
22299 printf(" %d", n_doc);
22300 printf(" %d", n_cur);
22301 printf(" %d", n_level);
22302 printf(" %d", n_format);
22318 test_xmlNodeDumpOutput(void) {
22321 #if defined(LIBXML_OUTPUT_ENABLED)
22323 xmlOutputBufferPtr buf; /* the XML buffer output */
22325 xmlDocPtr doc; /* the document */
22327 xmlNodePtr cur; /* the current node */
22329 int level; /* the imbrication level for indenting */
22331 int format; /* is formatting allowed */
22333 char * encoding; /* an optional encoding string */
22336 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22337 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22338 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22339 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22340 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22341 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22342 mem_base = xmlMemBlocks();
22343 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22344 doc = gen_xmlDocPtr(n_doc, 1);
22345 cur = gen_xmlNodePtr(n_cur, 2);
22346 level = gen_int(n_level, 3);
22347 format = gen_int(n_format, 4);
22348 encoding = gen_const_char_ptr(n_encoding, 5);
22350 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22352 des_xmlOutputBufferPtr(n_buf, buf, 0);
22353 des_xmlDocPtr(n_doc, doc, 1);
22354 des_xmlNodePtr(n_cur, cur, 2);
22355 des_int(n_level, level, 3);
22356 des_int(n_format, format, 4);
22357 des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22358 xmlResetLastError();
22359 if (mem_base != xmlMemBlocks()) {
22360 printf("Leak of %d blocks found in xmlNodeDumpOutput",
22361 xmlMemBlocks() - mem_base);
22363 printf(" %d", n_buf);
22364 printf(" %d", n_doc);
22365 printf(" %d", n_cur);
22366 printf(" %d", n_level);
22367 printf(" %d", n_format);
22368 printf(" %d", n_encoding);
22385 test_xmlNodeGetBase(void) {
22390 xmlDocPtr doc; /* the document the node pertains to */
22392 xmlNodePtr cur; /* the node being checked */
22395 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22396 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22397 mem_base = xmlMemBlocks();
22398 doc = gen_xmlDocPtr(n_doc, 0);
22399 cur = gen_xmlNodePtr(n_cur, 1);
22401 ret_val = xmlNodeGetBase(doc, cur);
22402 desret_xmlChar_ptr(ret_val);
22404 des_xmlDocPtr(n_doc, doc, 0);
22405 des_xmlNodePtr(n_cur, cur, 1);
22406 xmlResetLastError();
22407 if (mem_base != xmlMemBlocks()) {
22408 printf("Leak of %d blocks found in xmlNodeGetBase",
22409 xmlMemBlocks() - mem_base);
22411 printf(" %d", n_doc);
22412 printf(" %d", n_cur);
22424 test_xmlNodeGetContent(void) {
22429 xmlNodePtr cur; /* the node being read */
22432 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22433 mem_base = xmlMemBlocks();
22434 cur = gen_xmlNodePtr(n_cur, 0);
22436 ret_val = xmlNodeGetContent(cur);
22437 desret_xmlChar_ptr(ret_val);
22439 des_xmlNodePtr(n_cur, cur, 0);
22440 xmlResetLastError();
22441 if (mem_base != xmlMemBlocks()) {
22442 printf("Leak of %d blocks found in xmlNodeGetContent",
22443 xmlMemBlocks() - mem_base);
22445 printf(" %d", n_cur);
22456 test_xmlNodeGetLang(void) {
22461 xmlNodePtr cur; /* the node being checked */
22464 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22465 mem_base = xmlMemBlocks();
22466 cur = gen_xmlNodePtr(n_cur, 0);
22468 ret_val = xmlNodeGetLang(cur);
22469 desret_xmlChar_ptr(ret_val);
22471 des_xmlNodePtr(n_cur, cur, 0);
22472 xmlResetLastError();
22473 if (mem_base != xmlMemBlocks()) {
22474 printf("Leak of %d blocks found in xmlNodeGetLang",
22475 xmlMemBlocks() - mem_base);
22477 printf(" %d", n_cur);
22488 test_xmlNodeGetSpacePreserve(void) {
22493 xmlNodePtr cur; /* the node being checked */
22496 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22497 mem_base = xmlMemBlocks();
22498 cur = gen_xmlNodePtr(n_cur, 0);
22500 ret_val = xmlNodeGetSpacePreserve(cur);
22501 desret_int(ret_val);
22503 des_xmlNodePtr(n_cur, cur, 0);
22504 xmlResetLastError();
22505 if (mem_base != xmlMemBlocks()) {
22506 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22507 xmlMemBlocks() - mem_base);
22509 printf(" %d", n_cur);
22520 test_xmlNodeIsText(void) {
22525 xmlNodePtr node; /* the node */
22528 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22529 mem_base = xmlMemBlocks();
22530 node = gen_xmlNodePtr(n_node, 0);
22532 ret_val = xmlNodeIsText(node);
22533 desret_int(ret_val);
22535 des_xmlNodePtr(n_node, node, 0);
22536 xmlResetLastError();
22537 if (mem_base != xmlMemBlocks()) {
22538 printf("Leak of %d blocks found in xmlNodeIsText",
22539 xmlMemBlocks() - mem_base);
22541 printf(" %d", n_node);
22552 test_xmlNodeListGetRawString(void) {
22555 #if defined(LIBXML_TREE_ENABLED)
22558 xmlDocPtr doc; /* the document */
22560 xmlNodePtr list; /* a Node list */
22562 int inLine; /* should we replace entity contents or show their external form */
22565 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22566 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22567 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22568 mem_base = xmlMemBlocks();
22569 doc = gen_xmlDocPtr(n_doc, 0);
22570 list = gen_xmlNodePtr(n_list, 1);
22571 inLine = gen_int(n_inLine, 2);
22573 ret_val = xmlNodeListGetRawString(doc, list, inLine);
22574 desret_xmlChar_ptr(ret_val);
22576 des_xmlDocPtr(n_doc, doc, 0);
22577 des_xmlNodePtr(n_list, list, 1);
22578 des_int(n_inLine, inLine, 2);
22579 xmlResetLastError();
22580 if (mem_base != xmlMemBlocks()) {
22581 printf("Leak of %d blocks found in xmlNodeListGetRawString",
22582 xmlMemBlocks() - mem_base);
22584 printf(" %d", n_doc);
22585 printf(" %d", n_list);
22586 printf(" %d", n_inLine);
22600 test_xmlNodeListGetString(void) {
22605 xmlDocPtr doc; /* the document */
22607 xmlNodePtr list; /* a Node list */
22609 int inLine; /* should we replace entity contents or show their external form */
22612 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22613 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22614 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22615 mem_base = xmlMemBlocks();
22616 doc = gen_xmlDocPtr(n_doc, 0);
22617 list = gen_xmlNodePtr(n_list, 1);
22618 inLine = gen_int(n_inLine, 2);
22620 ret_val = xmlNodeListGetString(doc, list, inLine);
22621 desret_xmlChar_ptr(ret_val);
22623 des_xmlDocPtr(n_doc, doc, 0);
22624 des_xmlNodePtr(n_list, list, 1);
22625 des_int(n_inLine, inLine, 2);
22626 xmlResetLastError();
22627 if (mem_base != xmlMemBlocks()) {
22628 printf("Leak of %d blocks found in xmlNodeListGetString",
22629 xmlMemBlocks() - mem_base);
22631 printf(" %d", n_doc);
22632 printf(" %d", n_list);
22633 printf(" %d", n_inLine);
22646 test_xmlNodeSetBase(void) {
22649 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22651 xmlNodePtr cur; /* the node being changed */
22653 xmlChar * uri; /* the new base URI */
22656 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22657 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22658 mem_base = xmlMemBlocks();
22659 cur = gen_xmlNodePtr(n_cur, 0);
22660 uri = gen_const_xmlChar_ptr(n_uri, 1);
22662 xmlNodeSetBase(cur, (const xmlChar *)uri);
22664 des_xmlNodePtr(n_cur, cur, 0);
22665 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22666 xmlResetLastError();
22667 if (mem_base != xmlMemBlocks()) {
22668 printf("Leak of %d blocks found in xmlNodeSetBase",
22669 xmlMemBlocks() - mem_base);
22671 printf(" %d", n_cur);
22672 printf(" %d", n_uri);
22685 test_xmlNodeSetContent(void) {
22689 xmlNodePtr cur; /* the node being modified */
22691 xmlChar * content; /* the new value of the content */
22694 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22695 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22696 mem_base = xmlMemBlocks();
22697 cur = gen_xmlNodePtr(n_cur, 0);
22698 content = gen_const_xmlChar_ptr(n_content, 1);
22700 xmlNodeSetContent(cur, (const xmlChar *)content);
22702 des_xmlNodePtr(n_cur, cur, 0);
22703 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22704 xmlResetLastError();
22705 if (mem_base != xmlMemBlocks()) {
22706 printf("Leak of %d blocks found in xmlNodeSetContent",
22707 xmlMemBlocks() - mem_base);
22709 printf(" %d", n_cur);
22710 printf(" %d", n_content);
22722 test_xmlNodeSetContentLen(void) {
22725 #if defined(LIBXML_TREE_ENABLED)
22727 xmlNodePtr cur; /* the node being modified */
22729 xmlChar * content; /* the new value of the content */
22731 int len; /* the size of @content */
22734 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22735 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22736 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22737 mem_base = xmlMemBlocks();
22738 cur = gen_xmlNodePtr(n_cur, 0);
22739 content = gen_const_xmlChar_ptr(n_content, 1);
22740 len = gen_int(n_len, 2);
22742 xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22744 des_xmlNodePtr(n_cur, cur, 0);
22745 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22746 des_int(n_len, len, 2);
22747 xmlResetLastError();
22748 if (mem_base != xmlMemBlocks()) {
22749 printf("Leak of %d blocks found in xmlNodeSetContentLen",
22750 xmlMemBlocks() - mem_base);
22752 printf(" %d", n_cur);
22753 printf(" %d", n_content);
22754 printf(" %d", n_len);
22768 test_xmlNodeSetLang(void) {
22771 #if defined(LIBXML_TREE_ENABLED)
22773 xmlNodePtr cur; /* the node being changed */
22775 xmlChar * lang; /* the language description */
22778 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22779 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22780 mem_base = xmlMemBlocks();
22781 cur = gen_xmlNodePtr(n_cur, 0);
22782 lang = gen_const_xmlChar_ptr(n_lang, 1);
22784 xmlNodeSetLang(cur, (const xmlChar *)lang);
22786 des_xmlNodePtr(n_cur, cur, 0);
22787 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22788 xmlResetLastError();
22789 if (mem_base != xmlMemBlocks()) {
22790 printf("Leak of %d blocks found in xmlNodeSetLang",
22791 xmlMemBlocks() - mem_base);
22793 printf(" %d", n_cur);
22794 printf(" %d", n_lang);
22807 test_xmlNodeSetName(void) {
22810 #if defined(LIBXML_TREE_ENABLED)
22812 xmlNodePtr cur; /* the node being changed */
22814 xmlChar * name; /* the new tag name */
22817 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22818 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22819 mem_base = xmlMemBlocks();
22820 cur = gen_xmlNodePtr(n_cur, 0);
22821 name = gen_const_xmlChar_ptr(n_name, 1);
22823 xmlNodeSetName(cur, (const xmlChar *)name);
22825 des_xmlNodePtr(n_cur, cur, 0);
22826 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22827 xmlResetLastError();
22828 if (mem_base != xmlMemBlocks()) {
22829 printf("Leak of %d blocks found in xmlNodeSetName",
22830 xmlMemBlocks() - mem_base);
22832 printf(" %d", n_cur);
22833 printf(" %d", n_name);
22846 test_xmlNodeSetSpacePreserve(void) {
22849 #if defined(LIBXML_TREE_ENABLED)
22851 xmlNodePtr cur; /* the node being changed */
22853 int val; /* the xml:space value ("0": default, 1: "preserve") */
22856 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22857 for (n_val = 0;n_val < gen_nb_int;n_val++) {
22858 mem_base = xmlMemBlocks();
22859 cur = gen_xmlNodePtr(n_cur, 0);
22860 val = gen_int(n_val, 1);
22862 xmlNodeSetSpacePreserve(cur, val);
22864 des_xmlNodePtr(n_cur, cur, 0);
22865 des_int(n_val, val, 1);
22866 xmlResetLastError();
22867 if (mem_base != xmlMemBlocks()) {
22868 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22869 xmlMemBlocks() - mem_base);
22871 printf(" %d", n_cur);
22872 printf(" %d", n_val);
22885 test_xmlPreviousElementSibling(void) {
22888 #if defined(LIBXML_TREE_ENABLED)
22890 xmlNodePtr ret_val;
22891 xmlNodePtr node; /* the current node */
22894 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22895 mem_base = xmlMemBlocks();
22896 node = gen_xmlNodePtr(n_node, 0);
22898 ret_val = xmlPreviousElementSibling(node);
22899 desret_xmlNodePtr(ret_val);
22901 des_xmlNodePtr(n_node, node, 0);
22902 xmlResetLastError();
22903 if (mem_base != xmlMemBlocks()) {
22904 printf("Leak of %d blocks found in xmlPreviousElementSibling",
22905 xmlMemBlocks() - mem_base);
22907 printf(" %d", n_node);
22919 test_xmlReconciliateNs(void) {
22922 #if defined(LIBXML_TREE_ENABLED)
22923 #ifdef LIBXML_TREE_ENABLED
22926 xmlDocPtr doc; /* the document */
22928 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22931 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22932 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22933 mem_base = xmlMemBlocks();
22934 doc = gen_xmlDocPtr(n_doc, 0);
22935 tree = gen_xmlNodePtr(n_tree, 1);
22937 ret_val = xmlReconciliateNs(doc, tree);
22938 desret_int(ret_val);
22940 des_xmlDocPtr(n_doc, doc, 0);
22941 des_xmlNodePtr(n_tree, tree, 1);
22942 xmlResetLastError();
22943 if (mem_base != xmlMemBlocks()) {
22944 printf("Leak of %d blocks found in xmlReconciliateNs",
22945 xmlMemBlocks() - mem_base);
22947 printf(" %d", n_doc);
22948 printf(" %d", n_tree);
22962 test_xmlRemoveProp(void) {
22967 xmlAttrPtr cur; /* an attribute */
22970 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22971 mem_base = xmlMemBlocks();
22972 cur = gen_xmlAttrPtr(n_cur, 0);
22974 ret_val = xmlRemoveProp(cur);
22976 desret_int(ret_val);
22978 des_xmlAttrPtr(n_cur, cur, 0);
22979 xmlResetLastError();
22980 if (mem_base != xmlMemBlocks()) {
22981 printf("Leak of %d blocks found in xmlRemoveProp",
22982 xmlMemBlocks() - mem_base);
22984 printf(" %d", n_cur);
22995 test_xmlReplaceNode(void) {
22998 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23000 xmlNodePtr ret_val;
23001 xmlNodePtr old; /* the old node */
23003 xmlNodePtr cur; /* the node */
23006 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23007 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23008 mem_base = xmlMemBlocks();
23009 old = gen_xmlNodePtr(n_old, 0);
23010 cur = gen_xmlNodePtr_in(n_cur, 1);
23012 ret_val = xmlReplaceNode(old, cur);
23014 xmlUnlinkNode(cur);
23015 xmlFreeNode(cur) ; cur = NULL ; }
23017 xmlUnlinkNode(old);
23018 xmlFreeNode(old) ; old = NULL ; }
23020 desret_xmlNodePtr(ret_val);
23022 des_xmlNodePtr(n_old, old, 0);
23023 des_xmlNodePtr_in(n_cur, cur, 1);
23024 xmlResetLastError();
23025 if (mem_base != xmlMemBlocks()) {
23026 printf("Leak of %d blocks found in xmlReplaceNode",
23027 xmlMemBlocks() - mem_base);
23029 printf(" %d", n_old);
23030 printf(" %d", n_cur);
23043 test_xmlSaveFile(void) {
23046 #if defined(LIBXML_OUTPUT_ENABLED)
23049 const char * filename; /* the filename (or URL) */
23051 xmlDocPtr cur; /* the document */
23054 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23055 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23056 mem_base = xmlMemBlocks();
23057 filename = gen_fileoutput(n_filename, 0);
23058 cur = gen_xmlDocPtr(n_cur, 1);
23060 ret_val = xmlSaveFile(filename, cur);
23061 desret_int(ret_val);
23063 des_fileoutput(n_filename, filename, 0);
23064 des_xmlDocPtr(n_cur, cur, 1);
23065 xmlResetLastError();
23066 if (mem_base != xmlMemBlocks()) {
23067 printf("Leak of %d blocks found in xmlSaveFile",
23068 xmlMemBlocks() - mem_base);
23070 printf(" %d", n_filename);
23071 printf(" %d", n_cur);
23084 test_xmlSaveFileEnc(void) {
23087 #if defined(LIBXML_OUTPUT_ENABLED)
23090 const char * filename; /* the filename (or URL) */
23092 xmlDocPtr cur; /* the document */
23094 char * encoding; /* the name of an encoding (or NULL) */
23097 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23098 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23099 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23100 mem_base = xmlMemBlocks();
23101 filename = gen_fileoutput(n_filename, 0);
23102 cur = gen_xmlDocPtr(n_cur, 1);
23103 encoding = gen_const_char_ptr(n_encoding, 2);
23105 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23106 desret_int(ret_val);
23108 des_fileoutput(n_filename, filename, 0);
23109 des_xmlDocPtr(n_cur, cur, 1);
23110 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23111 xmlResetLastError();
23112 if (mem_base != xmlMemBlocks()) {
23113 printf("Leak of %d blocks found in xmlSaveFileEnc",
23114 xmlMemBlocks() - mem_base);
23116 printf(" %d", n_filename);
23117 printf(" %d", n_cur);
23118 printf(" %d", n_encoding);
23132 test_xmlSaveFileTo(void) {
23135 #if defined(LIBXML_OUTPUT_ENABLED)
23138 xmlOutputBufferPtr buf; /* an output I/O buffer */
23140 xmlDocPtr cur; /* the document */
23142 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23145 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23146 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23147 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23148 mem_base = xmlMemBlocks();
23149 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23150 cur = gen_xmlDocPtr(n_cur, 1);
23151 encoding = gen_const_char_ptr(n_encoding, 2);
23153 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23155 desret_int(ret_val);
23157 des_xmlOutputBufferPtr(n_buf, buf, 0);
23158 des_xmlDocPtr(n_cur, cur, 1);
23159 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23160 xmlResetLastError();
23161 if (mem_base != xmlMemBlocks()) {
23162 printf("Leak of %d blocks found in xmlSaveFileTo",
23163 xmlMemBlocks() - mem_base);
23165 printf(" %d", n_buf);
23166 printf(" %d", n_cur);
23167 printf(" %d", n_encoding);
23181 test_xmlSaveFormatFile(void) {
23184 #if defined(LIBXML_OUTPUT_ENABLED)
23187 const char * filename; /* the filename (or URL) */
23189 xmlDocPtr cur; /* the document */
23191 int format; /* should formatting spaces been added */
23194 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23195 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23196 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23197 mem_base = xmlMemBlocks();
23198 filename = gen_fileoutput(n_filename, 0);
23199 cur = gen_xmlDocPtr(n_cur, 1);
23200 format = gen_int(n_format, 2);
23202 ret_val = xmlSaveFormatFile(filename, cur, format);
23203 desret_int(ret_val);
23205 des_fileoutput(n_filename, filename, 0);
23206 des_xmlDocPtr(n_cur, cur, 1);
23207 des_int(n_format, format, 2);
23208 xmlResetLastError();
23209 if (mem_base != xmlMemBlocks()) {
23210 printf("Leak of %d blocks found in xmlSaveFormatFile",
23211 xmlMemBlocks() - mem_base);
23213 printf(" %d", n_filename);
23214 printf(" %d", n_cur);
23215 printf(" %d", n_format);
23229 test_xmlSaveFormatFileEnc(void) {
23232 #if defined(LIBXML_OUTPUT_ENABLED)
23235 const char * filename; /* the filename or URL to output */
23237 xmlDocPtr cur; /* the document being saved */
23239 char * encoding; /* the name of the encoding to use or NULL. */
23241 int format; /* should formatting spaces be added. */
23244 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23245 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23246 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23247 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23248 mem_base = xmlMemBlocks();
23249 filename = gen_fileoutput(n_filename, 0);
23250 cur = gen_xmlDocPtr(n_cur, 1);
23251 encoding = gen_const_char_ptr(n_encoding, 2);
23252 format = gen_int(n_format, 3);
23254 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23255 desret_int(ret_val);
23257 des_fileoutput(n_filename, filename, 0);
23258 des_xmlDocPtr(n_cur, cur, 1);
23259 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23260 des_int(n_format, format, 3);
23261 xmlResetLastError();
23262 if (mem_base != xmlMemBlocks()) {
23263 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23264 xmlMemBlocks() - mem_base);
23266 printf(" %d", n_filename);
23267 printf(" %d", n_cur);
23268 printf(" %d", n_encoding);
23269 printf(" %d", n_format);
23284 test_xmlSaveFormatFileTo(void) {
23287 #if defined(LIBXML_OUTPUT_ENABLED)
23290 xmlOutputBufferPtr buf; /* an output I/O buffer */
23292 xmlDocPtr cur; /* the document */
23294 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23296 int format; /* should formatting spaces been added */
23299 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23300 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23301 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23302 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23303 mem_base = xmlMemBlocks();
23304 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23305 cur = gen_xmlDocPtr(n_cur, 1);
23306 encoding = gen_const_char_ptr(n_encoding, 2);
23307 format = gen_int(n_format, 3);
23309 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23311 desret_int(ret_val);
23313 des_xmlOutputBufferPtr(n_buf, buf, 0);
23314 des_xmlDocPtr(n_cur, cur, 1);
23315 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23316 des_int(n_format, format, 3);
23317 xmlResetLastError();
23318 if (mem_base != xmlMemBlocks()) {
23319 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23320 xmlMemBlocks() - mem_base);
23322 printf(" %d", n_buf);
23323 printf(" %d", n_cur);
23324 printf(" %d", n_encoding);
23325 printf(" %d", n_format);
23340 test_xmlSearchNs(void) {
23345 xmlDocPtr doc; /* the document */
23347 xmlNodePtr node; /* the current node */
23349 xmlChar * nameSpace; /* the namespace prefix */
23352 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23353 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23354 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23355 mem_base = xmlMemBlocks();
23356 doc = gen_xmlDocPtr(n_doc, 0);
23357 node = gen_xmlNodePtr(n_node, 1);
23358 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23360 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23361 desret_xmlNsPtr(ret_val);
23363 des_xmlDocPtr(n_doc, doc, 0);
23364 des_xmlNodePtr(n_node, node, 1);
23365 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23366 xmlResetLastError();
23367 if (mem_base != xmlMemBlocks()) {
23368 printf("Leak of %d blocks found in xmlSearchNs",
23369 xmlMemBlocks() - mem_base);
23371 printf(" %d", n_doc);
23372 printf(" %d", n_node);
23373 printf(" %d", n_nameSpace);
23386 test_xmlSearchNsByHref(void) {
23391 xmlDocPtr doc; /* the document */
23393 xmlNodePtr node; /* the current node */
23395 xmlChar * href; /* the namespace value */
23398 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23399 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23400 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23401 mem_base = xmlMemBlocks();
23402 doc = gen_xmlDocPtr(n_doc, 0);
23403 node = gen_xmlNodePtr(n_node, 1);
23404 href = gen_const_xmlChar_ptr(n_href, 2);
23406 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23407 desret_xmlNsPtr(ret_val);
23409 des_xmlDocPtr(n_doc, doc, 0);
23410 des_xmlNodePtr(n_node, node, 1);
23411 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23412 xmlResetLastError();
23413 if (mem_base != xmlMemBlocks()) {
23414 printf("Leak of %d blocks found in xmlSearchNsByHref",
23415 xmlMemBlocks() - mem_base);
23417 printf(" %d", n_doc);
23418 printf(" %d", n_node);
23419 printf(" %d", n_href);
23432 test_xmlSetBufferAllocationScheme(void) {
23436 xmlBufferAllocationScheme scheme; /* allocation method to use */
23439 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23440 mem_base = xmlMemBlocks();
23441 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23443 xmlSetBufferAllocationScheme(scheme);
23445 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23446 xmlResetLastError();
23447 if (mem_base != xmlMemBlocks()) {
23448 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23449 xmlMemBlocks() - mem_base);
23451 printf(" %d", n_scheme);
23462 test_xmlSetCompressMode(void) {
23466 int mode; /* the compression ratio */
23469 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23470 mem_base = xmlMemBlocks();
23471 mode = gen_int(n_mode, 0);
23473 xmlSetCompressMode(mode);
23475 des_int(n_mode, mode, 0);
23476 xmlResetLastError();
23477 if (mem_base != xmlMemBlocks()) {
23478 printf("Leak of %d blocks found in xmlSetCompressMode",
23479 xmlMemBlocks() - mem_base);
23481 printf(" %d", n_mode);
23492 test_xmlSetDocCompressMode(void) {
23496 xmlDocPtr doc; /* the document */
23498 int mode; /* the compression ratio */
23501 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23502 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23503 mem_base = xmlMemBlocks();
23504 doc = gen_xmlDocPtr(n_doc, 0);
23505 mode = gen_int(n_mode, 1);
23507 xmlSetDocCompressMode(doc, mode);
23509 des_xmlDocPtr(n_doc, doc, 0);
23510 des_int(n_mode, mode, 1);
23511 xmlResetLastError();
23512 if (mem_base != xmlMemBlocks()) {
23513 printf("Leak of %d blocks found in xmlSetDocCompressMode",
23514 xmlMemBlocks() - mem_base);
23516 printf(" %d", n_doc);
23517 printf(" %d", n_mode);
23529 test_xmlSetNs(void) {
23533 xmlNodePtr node; /* a node in the document */
23535 xmlNsPtr ns; /* a namespace pointer */
23538 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23539 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23540 mem_base = xmlMemBlocks();
23541 node = gen_xmlNodePtr(n_node, 0);
23542 ns = gen_xmlNsPtr(n_ns, 1);
23544 xmlSetNs(node, ns);
23546 des_xmlNodePtr(n_node, node, 0);
23547 des_xmlNsPtr(n_ns, ns, 1);
23548 xmlResetLastError();
23549 if (mem_base != xmlMemBlocks()) {
23550 printf("Leak of %d blocks found in xmlSetNs",
23551 xmlMemBlocks() - mem_base);
23553 printf(" %d", n_node);
23554 printf(" %d", n_ns);
23566 test_xmlSetNsProp(void) {
23569 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23571 xmlAttrPtr ret_val;
23572 xmlNodePtr node; /* the node */
23574 xmlNsPtr ns; /* the namespace definition */
23576 xmlChar * name; /* the attribute name */
23578 xmlChar * value; /* the attribute value */
23581 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23582 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23583 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23584 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23585 mem_base = xmlMemBlocks();
23586 node = gen_xmlNodePtr(n_node, 0);
23587 ns = gen_xmlNsPtr(n_ns, 1);
23588 name = gen_const_xmlChar_ptr(n_name, 2);
23589 value = gen_const_xmlChar_ptr(n_value, 3);
23591 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23592 desret_xmlAttrPtr(ret_val);
23594 des_xmlNodePtr(n_node, node, 0);
23595 des_xmlNsPtr(n_ns, ns, 1);
23596 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23597 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23598 xmlResetLastError();
23599 if (mem_base != xmlMemBlocks()) {
23600 printf("Leak of %d blocks found in xmlSetNsProp",
23601 xmlMemBlocks() - mem_base);
23603 printf(" %d", n_node);
23604 printf(" %d", n_ns);
23605 printf(" %d", n_name);
23606 printf(" %d", n_value);
23621 test_xmlSetProp(void) {
23624 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23626 xmlAttrPtr ret_val;
23627 xmlNodePtr node; /* the node */
23629 xmlChar * name; /* the attribute name (a QName) */
23631 xmlChar * value; /* the attribute value */
23634 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23635 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23636 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23637 mem_base = xmlMemBlocks();
23638 node = gen_xmlNodePtr(n_node, 0);
23639 name = gen_const_xmlChar_ptr(n_name, 1);
23640 value = gen_const_xmlChar_ptr(n_value, 2);
23642 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23643 desret_xmlAttrPtr(ret_val);
23645 des_xmlNodePtr(n_node, node, 0);
23646 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23647 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23648 xmlResetLastError();
23649 if (mem_base != xmlMemBlocks()) {
23650 printf("Leak of %d blocks found in xmlSetProp",
23651 xmlMemBlocks() - mem_base);
23653 printf(" %d", n_node);
23654 printf(" %d", n_name);
23655 printf(" %d", n_value);
23669 test_xmlSplitQName2(void) {
23674 xmlChar * name; /* the full QName */
23676 xmlChar ** prefix; /* a xmlChar ** */
23679 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23680 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23681 mem_base = xmlMemBlocks();
23682 name = gen_const_xmlChar_ptr(n_name, 0);
23683 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23685 ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23686 desret_xmlChar_ptr(ret_val);
23688 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23689 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23690 xmlResetLastError();
23691 if (mem_base != xmlMemBlocks()) {
23692 printf("Leak of %d blocks found in xmlSplitQName2",
23693 xmlMemBlocks() - mem_base);
23695 printf(" %d", n_name);
23696 printf(" %d", n_prefix);
23708 test_xmlSplitQName3(void) {
23712 const xmlChar * ret_val;
23713 xmlChar * name; /* the full QName */
23715 int * len; /* an int * */
23718 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23719 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23720 mem_base = xmlMemBlocks();
23721 name = gen_const_xmlChar_ptr(n_name, 0);
23722 len = gen_int_ptr(n_len, 1);
23724 ret_val = xmlSplitQName3((const xmlChar *)name, len);
23725 desret_const_xmlChar_ptr(ret_val);
23727 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23728 des_int_ptr(n_len, len, 1);
23729 xmlResetLastError();
23730 if (mem_base != xmlMemBlocks()) {
23731 printf("Leak of %d blocks found in xmlSplitQName3",
23732 xmlMemBlocks() - mem_base);
23734 printf(" %d", n_name);
23735 printf(" %d", n_len);
23747 test_xmlStringGetNodeList(void) {
23751 xmlNodePtr ret_val;
23752 xmlDocPtr doc; /* the document */
23754 xmlChar * value; /* the value of the attribute */
23757 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23758 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23759 mem_base = xmlMemBlocks();
23760 doc = gen_xmlDocPtr(n_doc, 0);
23761 value = gen_const_xmlChar_ptr(n_value, 1);
23763 ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23764 desret_xmlNodePtr(ret_val);
23766 des_xmlDocPtr(n_doc, doc, 0);
23767 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23768 xmlResetLastError();
23769 if (mem_base != xmlMemBlocks()) {
23770 printf("Leak of %d blocks found in xmlStringGetNodeList",
23771 xmlMemBlocks() - mem_base);
23773 printf(" %d", n_doc);
23774 printf(" %d", n_value);
23786 test_xmlStringLenGetNodeList(void) {
23790 xmlNodePtr ret_val;
23791 xmlDocPtr doc; /* the document */
23793 xmlChar * value; /* the value of the text */
23795 int len; /* the length of the string value */
23798 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23799 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23800 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23801 mem_base = xmlMemBlocks();
23802 doc = gen_xmlDocPtr(n_doc, 0);
23803 value = gen_const_xmlChar_ptr(n_value, 1);
23804 len = gen_int(n_len, 2);
23806 ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23807 desret_xmlNodePtr(ret_val);
23809 des_xmlDocPtr(n_doc, doc, 0);
23810 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23811 des_int(n_len, len, 2);
23812 xmlResetLastError();
23813 if (mem_base != xmlMemBlocks()) {
23814 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23815 xmlMemBlocks() - mem_base);
23817 printf(" %d", n_doc);
23818 printf(" %d", n_value);
23819 printf(" %d", n_len);
23832 test_xmlTextConcat(void) {
23837 xmlNodePtr node; /* the node */
23839 xmlChar * content; /* the content */
23841 int len; /* @content length */
23844 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23845 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23846 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23847 mem_base = xmlMemBlocks();
23848 node = gen_xmlNodePtr(n_node, 0);
23849 content = gen_const_xmlChar_ptr(n_content, 1);
23850 len = gen_int(n_len, 2);
23852 ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23853 desret_int(ret_val);
23855 des_xmlNodePtr(n_node, node, 0);
23856 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23857 des_int(n_len, len, 2);
23858 xmlResetLastError();
23859 if (mem_base != xmlMemBlocks()) {
23860 printf("Leak of %d blocks found in xmlTextConcat",
23861 xmlMemBlocks() - mem_base);
23863 printf(" %d", n_node);
23864 printf(" %d", n_content);
23865 printf(" %d", n_len);
23878 test_xmlTextMerge(void) {
23882 xmlNodePtr ret_val;
23883 xmlNodePtr first; /* the first text node */
23885 xmlNodePtr second; /* the second text node being merged */
23888 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23889 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23890 mem_base = xmlMemBlocks();
23891 first = gen_xmlNodePtr_in(n_first, 0);
23892 second = gen_xmlNodePtr_in(n_second, 1);
23894 ret_val = xmlTextMerge(first, second);
23895 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23896 xmlUnlinkNode(second);
23897 xmlFreeNode(second) ; second = NULL ; }
23898 desret_xmlNodePtr(ret_val);
23900 des_xmlNodePtr_in(n_first, first, 0);
23901 des_xmlNodePtr_in(n_second, second, 1);
23902 xmlResetLastError();
23903 if (mem_base != xmlMemBlocks()) {
23904 printf("Leak of %d blocks found in xmlTextMerge",
23905 xmlMemBlocks() - mem_base);
23907 printf(" %d", n_first);
23908 printf(" %d", n_second);
23920 test_xmlUnsetNsProp(void) {
23923 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23926 xmlNodePtr node; /* the node */
23928 xmlNsPtr ns; /* the namespace definition */
23930 xmlChar * name; /* the attribute name */
23933 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23934 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23935 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23936 mem_base = xmlMemBlocks();
23937 node = gen_xmlNodePtr(n_node, 0);
23938 ns = gen_xmlNsPtr(n_ns, 1);
23939 name = gen_const_xmlChar_ptr(n_name, 2);
23941 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23942 desret_int(ret_val);
23944 des_xmlNodePtr(n_node, node, 0);
23945 des_xmlNsPtr(n_ns, ns, 1);
23946 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23947 xmlResetLastError();
23948 if (mem_base != xmlMemBlocks()) {
23949 printf("Leak of %d blocks found in xmlUnsetNsProp",
23950 xmlMemBlocks() - mem_base);
23952 printf(" %d", n_node);
23953 printf(" %d", n_ns);
23954 printf(" %d", n_name);
23968 test_xmlUnsetProp(void) {
23971 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23974 xmlNodePtr node; /* the node */
23976 xmlChar * name; /* the attribute name */
23979 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23980 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23981 mem_base = xmlMemBlocks();
23982 node = gen_xmlNodePtr(n_node, 0);
23983 name = gen_const_xmlChar_ptr(n_name, 1);
23985 ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23986 desret_int(ret_val);
23988 des_xmlNodePtr(n_node, node, 0);
23989 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23990 xmlResetLastError();
23991 if (mem_base != xmlMemBlocks()) {
23992 printf("Leak of %d blocks found in xmlUnsetProp",
23993 xmlMemBlocks() - mem_base);
23995 printf(" %d", n_node);
23996 printf(" %d", n_name);
24009 test_xmlValidateNCName(void) {
24012 #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)
24013 #ifdef LIBXML_TREE_ENABLED
24016 xmlChar * value; /* the value to check */
24018 int space; /* allow spaces in front and end of the string */
24021 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24022 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24023 mem_base = xmlMemBlocks();
24024 value = gen_const_xmlChar_ptr(n_value, 0);
24025 space = gen_int(n_space, 1);
24027 ret_val = xmlValidateNCName((const xmlChar *)value, space);
24028 desret_int(ret_val);
24030 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24031 des_int(n_space, space, 1);
24032 xmlResetLastError();
24033 if (mem_base != xmlMemBlocks()) {
24034 printf("Leak of %d blocks found in xmlValidateNCName",
24035 xmlMemBlocks() - mem_base);
24037 printf(" %d", n_value);
24038 printf(" %d", n_space);
24052 test_xmlValidateNMToken(void) {
24055 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24056 #ifdef LIBXML_TREE_ENABLED
24059 xmlChar * value; /* the value to check */
24061 int space; /* allow spaces in front and end of the string */
24064 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24065 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24066 mem_base = xmlMemBlocks();
24067 value = gen_const_xmlChar_ptr(n_value, 0);
24068 space = gen_int(n_space, 1);
24070 ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24071 desret_int(ret_val);
24073 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24074 des_int(n_space, space, 1);
24075 xmlResetLastError();
24076 if (mem_base != xmlMemBlocks()) {
24077 printf("Leak of %d blocks found in xmlValidateNMToken",
24078 xmlMemBlocks() - mem_base);
24080 printf(" %d", n_value);
24081 printf(" %d", n_space);
24095 test_xmlValidateName(void) {
24098 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24099 #ifdef LIBXML_TREE_ENABLED
24102 xmlChar * value; /* the value to check */
24104 int space; /* allow spaces in front and end of the string */
24107 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24108 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24109 mem_base = xmlMemBlocks();
24110 value = gen_const_xmlChar_ptr(n_value, 0);
24111 space = gen_int(n_space, 1);
24113 ret_val = xmlValidateName((const xmlChar *)value, space);
24114 desret_int(ret_val);
24116 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24117 des_int(n_space, space, 1);
24118 xmlResetLastError();
24119 if (mem_base != xmlMemBlocks()) {
24120 printf("Leak of %d blocks found in xmlValidateName",
24121 xmlMemBlocks() - mem_base);
24123 printf(" %d", n_value);
24124 printf(" %d", n_space);
24138 test_xmlValidateQName(void) {
24141 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24142 #ifdef LIBXML_TREE_ENABLED
24145 xmlChar * value; /* the value to check */
24147 int space; /* allow spaces in front and end of the string */
24150 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24151 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24152 mem_base = xmlMemBlocks();
24153 value = gen_const_xmlChar_ptr(n_value, 0);
24154 space = gen_int(n_space, 1);
24156 ret_val = xmlValidateQName((const xmlChar *)value, space);
24157 desret_int(ret_val);
24159 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24160 des_int(n_space, space, 1);
24161 xmlResetLastError();
24162 if (mem_base != xmlMemBlocks()) {
24163 printf("Leak of %d blocks found in xmlValidateQName",
24164 xmlMemBlocks() - mem_base);
24166 printf(" %d", n_value);
24167 printf(" %d", n_space);
24183 if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24184 test_ret += test_xmlAddChild();
24185 test_ret += test_xmlAddChildList();
24186 test_ret += test_xmlAddNextSibling();
24187 test_ret += test_xmlAddPrevSibling();
24188 test_ret += test_xmlAddSibling();
24189 test_ret += test_xmlAttrSerializeTxtContent();
24190 test_ret += test_xmlBufContent();
24191 test_ret += test_xmlBufEnd();
24192 test_ret += test_xmlBufGetNodeContent();
24193 test_ret += test_xmlBufNodeDump();
24194 test_ret += test_xmlBufShrink();
24195 test_ret += test_xmlBufUse();
24196 test_ret += test_xmlBufferAdd();
24197 test_ret += test_xmlBufferAddHead();
24198 test_ret += test_xmlBufferCCat();
24199 test_ret += test_xmlBufferCat();
24200 test_ret += test_xmlBufferContent();
24201 test_ret += test_xmlBufferCreate();
24202 test_ret += test_xmlBufferCreateSize();
24203 test_ret += test_xmlBufferCreateStatic();
24204 test_ret += test_xmlBufferDetach();
24205 test_ret += test_xmlBufferEmpty();
24206 test_ret += test_xmlBufferGrow();
24207 test_ret += test_xmlBufferLength();
24208 test_ret += test_xmlBufferResize();
24209 test_ret += test_xmlBufferSetAllocationScheme();
24210 test_ret += test_xmlBufferShrink();
24211 test_ret += test_xmlBufferWriteCHAR();
24212 test_ret += test_xmlBufferWriteChar();
24213 test_ret += test_xmlBufferWriteQuotedString();
24214 test_ret += test_xmlBuildQName();
24215 test_ret += test_xmlChildElementCount();
24216 test_ret += test_xmlCopyDoc();
24217 test_ret += test_xmlCopyDtd();
24218 test_ret += test_xmlCopyNamespace();
24219 test_ret += test_xmlCopyNamespaceList();
24220 test_ret += test_xmlCopyNode();
24221 test_ret += test_xmlCopyNodeList();
24222 test_ret += test_xmlCopyProp();
24223 test_ret += test_xmlCopyPropList();
24224 test_ret += test_xmlCreateIntSubset();
24225 test_ret += test_xmlDOMWrapAdoptNode();
24226 test_ret += test_xmlDOMWrapCloneNode();
24227 test_ret += test_xmlDOMWrapNewCtxt();
24228 test_ret += test_xmlDOMWrapReconcileNamespaces();
24229 test_ret += test_xmlDOMWrapRemoveNode();
24230 test_ret += test_xmlDocCopyNode();
24231 test_ret += test_xmlDocCopyNodeList();
24232 test_ret += test_xmlDocDump();
24233 test_ret += test_xmlDocDumpFormatMemory();
24234 test_ret += test_xmlDocDumpFormatMemoryEnc();
24235 test_ret += test_xmlDocDumpMemory();
24236 test_ret += test_xmlDocDumpMemoryEnc();
24237 test_ret += test_xmlDocFormatDump();
24238 test_ret += test_xmlDocGetRootElement();
24239 test_ret += test_xmlDocSetRootElement();
24240 test_ret += test_xmlElemDump();
24241 test_ret += test_xmlFirstElementChild();
24242 test_ret += test_xmlGetBufferAllocationScheme();
24243 test_ret += test_xmlGetCompressMode();
24244 test_ret += test_xmlGetDocCompressMode();
24245 test_ret += test_xmlGetIntSubset();
24246 test_ret += test_xmlGetLastChild();
24247 test_ret += test_xmlGetLineNo();
24248 test_ret += test_xmlGetNoNsProp();
24249 test_ret += test_xmlGetNodePath();
24250 test_ret += test_xmlGetNsList();
24251 test_ret += test_xmlGetNsProp();
24252 test_ret += test_xmlGetProp();
24253 test_ret += test_xmlHasNsProp();
24254 test_ret += test_xmlHasProp();
24255 test_ret += test_xmlIsBlankNode();
24256 test_ret += test_xmlIsXHTML();
24257 test_ret += test_xmlLastElementChild();
24258 test_ret += test_xmlNewCDataBlock();
24259 test_ret += test_xmlNewCharRef();
24260 test_ret += test_xmlNewChild();
24261 test_ret += test_xmlNewComment();
24262 test_ret += test_xmlNewDoc();
24263 test_ret += test_xmlNewDocComment();
24264 test_ret += test_xmlNewDocFragment();
24265 test_ret += test_xmlNewDocNode();
24266 test_ret += test_xmlNewDocNodeEatName();
24267 test_ret += test_xmlNewDocPI();
24268 test_ret += test_xmlNewDocProp();
24269 test_ret += test_xmlNewDocRawNode();
24270 test_ret += test_xmlNewDocText();
24271 test_ret += test_xmlNewDocTextLen();
24272 test_ret += test_xmlNewDtd();
24273 test_ret += test_xmlNewNode();
24274 test_ret += test_xmlNewNodeEatName();
24275 test_ret += test_xmlNewNs();
24276 test_ret += test_xmlNewNsProp();
24277 test_ret += test_xmlNewNsPropEatName();
24278 test_ret += test_xmlNewPI();
24279 test_ret += test_xmlNewProp();
24280 test_ret += test_xmlNewReference();
24281 test_ret += test_xmlNewText();
24282 test_ret += test_xmlNewTextChild();
24283 test_ret += test_xmlNewTextLen();
24284 test_ret += test_xmlNextElementSibling();
24285 test_ret += test_xmlNodeAddContent();
24286 test_ret += test_xmlNodeAddContentLen();
24287 test_ret += test_xmlNodeBufGetContent();
24288 test_ret += test_xmlNodeDump();
24289 test_ret += test_xmlNodeDumpOutput();
24290 test_ret += test_xmlNodeGetBase();
24291 test_ret += test_xmlNodeGetContent();
24292 test_ret += test_xmlNodeGetLang();
24293 test_ret += test_xmlNodeGetSpacePreserve();
24294 test_ret += test_xmlNodeIsText();
24295 test_ret += test_xmlNodeListGetRawString();
24296 test_ret += test_xmlNodeListGetString();
24297 test_ret += test_xmlNodeSetBase();
24298 test_ret += test_xmlNodeSetContent();
24299 test_ret += test_xmlNodeSetContentLen();
24300 test_ret += test_xmlNodeSetLang();
24301 test_ret += test_xmlNodeSetName();
24302 test_ret += test_xmlNodeSetSpacePreserve();
24303 test_ret += test_xmlPreviousElementSibling();
24304 test_ret += test_xmlReconciliateNs();
24305 test_ret += test_xmlRemoveProp();
24306 test_ret += test_xmlReplaceNode();
24307 test_ret += test_xmlSaveFile();
24308 test_ret += test_xmlSaveFileEnc();
24309 test_ret += test_xmlSaveFileTo();
24310 test_ret += test_xmlSaveFormatFile();
24311 test_ret += test_xmlSaveFormatFileEnc();
24312 test_ret += test_xmlSaveFormatFileTo();
24313 test_ret += test_xmlSearchNs();
24314 test_ret += test_xmlSearchNsByHref();
24315 test_ret += test_xmlSetBufferAllocationScheme();
24316 test_ret += test_xmlSetCompressMode();
24317 test_ret += test_xmlSetDocCompressMode();
24318 test_ret += test_xmlSetNs();
24319 test_ret += test_xmlSetNsProp();
24320 test_ret += test_xmlSetProp();
24321 test_ret += test_xmlSplitQName2();
24322 test_ret += test_xmlSplitQName3();
24323 test_ret += test_xmlStringGetNodeList();
24324 test_ret += test_xmlStringLenGetNodeList();
24325 test_ret += test_xmlTextConcat();
24326 test_ret += test_xmlTextMerge();
24327 test_ret += test_xmlUnsetNsProp();
24328 test_ret += test_xmlUnsetProp();
24329 test_ret += test_xmlValidateNCName();
24330 test_ret += test_xmlValidateNMToken();
24331 test_ret += test_xmlValidateName();
24332 test_ret += test_xmlValidateQName();
24335 printf("Module tree: %d errors\n", test_ret);
24340 test_xmlBuildRelativeURI(void) {
24345 xmlChar * URI; /* the URI reference under consideration */
24347 xmlChar * base; /* the base value */
24350 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24351 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24352 mem_base = xmlMemBlocks();
24353 URI = gen_const_xmlChar_ptr(n_URI, 0);
24354 base = gen_const_xmlChar_ptr(n_base, 1);
24356 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24357 desret_xmlChar_ptr(ret_val);
24359 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24360 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24361 xmlResetLastError();
24362 if (mem_base != xmlMemBlocks()) {
24363 printf("Leak of %d blocks found in xmlBuildRelativeURI",
24364 xmlMemBlocks() - mem_base);
24366 printf(" %d", n_URI);
24367 printf(" %d", n_base);
24379 test_xmlBuildURI(void) {
24384 xmlChar * URI; /* the URI instance found in the document */
24386 xmlChar * base; /* the base value */
24389 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24390 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24391 mem_base = xmlMemBlocks();
24392 URI = gen_const_xmlChar_ptr(n_URI, 0);
24393 base = gen_const_xmlChar_ptr(n_base, 1);
24395 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24396 desret_xmlChar_ptr(ret_val);
24398 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24399 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24400 xmlResetLastError();
24401 if (mem_base != xmlMemBlocks()) {
24402 printf("Leak of %d blocks found in xmlBuildURI",
24403 xmlMemBlocks() - mem_base);
24405 printf(" %d", n_URI);
24406 printf(" %d", n_base);
24418 test_xmlCanonicPath(void) {
24423 xmlChar * path; /* the resource locator in a filesystem notation */
24426 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24427 mem_base = xmlMemBlocks();
24428 path = gen_const_xmlChar_ptr(n_path, 0);
24430 ret_val = xmlCanonicPath((const xmlChar *)path);
24431 desret_xmlChar_ptr(ret_val);
24433 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24434 xmlResetLastError();
24435 if (mem_base != xmlMemBlocks()) {
24436 printf("Leak of %d blocks found in xmlCanonicPath",
24437 xmlMemBlocks() - mem_base);
24439 printf(" %d", n_path);
24450 test_xmlCreateURI(void) {
24454 /* missing type support */
24460 test_xmlNormalizeURIPath(void) {
24465 char * path; /* pointer to the path string */
24468 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24469 mem_base = xmlMemBlocks();
24470 path = gen_char_ptr(n_path, 0);
24472 ret_val = xmlNormalizeURIPath(path);
24473 desret_int(ret_val);
24475 des_char_ptr(n_path, path, 0);
24476 xmlResetLastError();
24477 if (mem_base != xmlMemBlocks()) {
24478 printf("Leak of %d blocks found in xmlNormalizeURIPath",
24479 xmlMemBlocks() - mem_base);
24481 printf(" %d", n_path);
24492 test_xmlParseURI(void) {
24496 /* missing type support */
24502 test_xmlParseURIRaw(void) {
24506 /* missing type support */
24511 #define gen_nb_xmlURIPtr 1
24512 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24515 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24519 test_xmlParseURIReference(void) {
24524 xmlURIPtr uri; /* pointer to an URI structure */
24526 char * str; /* the string to analyze */
24529 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24530 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24531 mem_base = xmlMemBlocks();
24532 uri = gen_xmlURIPtr(n_uri, 0);
24533 str = gen_const_char_ptr(n_str, 1);
24535 ret_val = xmlParseURIReference(uri, (const char *)str);
24536 desret_int(ret_val);
24538 des_xmlURIPtr(n_uri, uri, 0);
24539 des_const_char_ptr(n_str, (const char *)str, 1);
24540 xmlResetLastError();
24541 if (mem_base != xmlMemBlocks()) {
24542 printf("Leak of %d blocks found in xmlParseURIReference",
24543 xmlMemBlocks() - mem_base);
24545 printf(" %d", n_uri);
24546 printf(" %d", n_str);
24558 test_xmlPathToURI(void) {
24563 xmlChar * path; /* the resource locator in a filesystem notation */
24566 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24567 mem_base = xmlMemBlocks();
24568 path = gen_const_xmlChar_ptr(n_path, 0);
24570 ret_val = xmlPathToURI((const xmlChar *)path);
24571 desret_xmlChar_ptr(ret_val);
24573 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24574 xmlResetLastError();
24575 if (mem_base != xmlMemBlocks()) {
24576 printf("Leak of %d blocks found in xmlPathToURI",
24577 xmlMemBlocks() - mem_base);
24579 printf(" %d", n_path);
24590 test_xmlPrintURI(void) {
24594 FILE * stream; /* a FILE* for the output */
24596 xmlURIPtr uri; /* pointer to an xmlURI */
24599 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24600 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24601 mem_base = xmlMemBlocks();
24602 stream = gen_FILE_ptr(n_stream, 0);
24603 uri = gen_xmlURIPtr(n_uri, 1);
24605 xmlPrintURI(stream, uri);
24607 des_FILE_ptr(n_stream, stream, 0);
24608 des_xmlURIPtr(n_uri, uri, 1);
24609 xmlResetLastError();
24610 if (mem_base != xmlMemBlocks()) {
24611 printf("Leak of %d blocks found in xmlPrintURI",
24612 xmlMemBlocks() - mem_base);
24614 printf(" %d", n_stream);
24615 printf(" %d", n_uri);
24627 test_xmlSaveUri(void) {
24632 xmlURIPtr uri; /* pointer to an xmlURI */
24635 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24636 mem_base = xmlMemBlocks();
24637 uri = gen_xmlURIPtr(n_uri, 0);
24639 ret_val = xmlSaveUri(uri);
24640 desret_xmlChar_ptr(ret_val);
24642 des_xmlURIPtr(n_uri, uri, 0);
24643 xmlResetLastError();
24644 if (mem_base != xmlMemBlocks()) {
24645 printf("Leak of %d blocks found in xmlSaveUri",
24646 xmlMemBlocks() - mem_base);
24648 printf(" %d", n_uri);
24659 test_xmlURIEscape(void) {
24664 xmlChar * str; /* the string of the URI to escape */
24667 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24668 mem_base = xmlMemBlocks();
24669 str = gen_const_xmlChar_ptr(n_str, 0);
24671 ret_val = xmlURIEscape((const xmlChar *)str);
24672 desret_xmlChar_ptr(ret_val);
24674 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24675 xmlResetLastError();
24676 if (mem_base != xmlMemBlocks()) {
24677 printf("Leak of %d blocks found in xmlURIEscape",
24678 xmlMemBlocks() - mem_base);
24680 printf(" %d", n_str);
24691 test_xmlURIEscapeStr(void) {
24696 xmlChar * str; /* string to escape */
24698 xmlChar * list; /* exception list string of chars not to escape */
24701 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24702 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24703 mem_base = xmlMemBlocks();
24704 str = gen_const_xmlChar_ptr(n_str, 0);
24705 list = gen_const_xmlChar_ptr(n_list, 1);
24707 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24708 desret_xmlChar_ptr(ret_val);
24710 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24711 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24712 xmlResetLastError();
24713 if (mem_base != xmlMemBlocks()) {
24714 printf("Leak of %d blocks found in xmlURIEscapeStr",
24715 xmlMemBlocks() - mem_base);
24717 printf(" %d", n_str);
24718 printf(" %d", n_list);
24730 test_xmlURIUnescapeString(void) {
24734 /* missing type support */
24742 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24743 test_ret += test_xmlBuildRelativeURI();
24744 test_ret += test_xmlBuildURI();
24745 test_ret += test_xmlCanonicPath();
24746 test_ret += test_xmlCreateURI();
24747 test_ret += test_xmlNormalizeURIPath();
24748 test_ret += test_xmlParseURI();
24749 test_ret += test_xmlParseURIRaw();
24750 test_ret += test_xmlParseURIReference();
24751 test_ret += test_xmlPathToURI();
24752 test_ret += test_xmlPrintURI();
24753 test_ret += test_xmlSaveUri();
24754 test_ret += test_xmlURIEscape();
24755 test_ret += test_xmlURIEscapeStr();
24756 test_ret += test_xmlURIUnescapeString();
24759 printf("Module uri: %d errors\n", test_ret);
24764 test_xmlAddAttributeDecl(void) {
24768 xmlAttributePtr ret_val;
24769 xmlValidCtxtPtr ctxt; /* the validation context */
24771 xmlDtdPtr dtd; /* pointer to the DTD */
24773 xmlChar * elem; /* the element name */
24775 xmlChar * name; /* the attribute name */
24777 xmlChar * ns; /* the attribute namespace prefix */
24779 xmlAttributeType type; /* the attribute type */
24781 xmlAttributeDefault def; /* the attribute default type */
24783 xmlChar * defaultValue; /* the attribute default value */
24784 int n_defaultValue;
24785 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24788 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24789 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24790 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24791 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24792 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24793 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24794 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24795 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24796 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24797 mem_base = xmlMemBlocks();
24798 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24799 dtd = gen_xmlDtdPtr(n_dtd, 1);
24800 elem = gen_const_xmlChar_ptr(n_elem, 2);
24801 name = gen_const_xmlChar_ptr(n_name, 3);
24802 ns = gen_const_xmlChar_ptr(n_ns, 4);
24803 type = gen_xmlAttributeType(n_type, 5);
24804 def = gen_xmlAttributeDefault(n_def, 6);
24805 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24806 tree = gen_xmlEnumerationPtr(n_tree, 8);
24808 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24809 desret_xmlAttributePtr(ret_val);
24811 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24812 des_xmlDtdPtr(n_dtd, dtd, 1);
24813 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24814 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24815 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24816 des_xmlAttributeType(n_type, type, 5);
24817 des_xmlAttributeDefault(n_def, def, 6);
24818 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24819 des_xmlEnumerationPtr(n_tree, tree, 8);
24820 xmlResetLastError();
24821 if (mem_base != xmlMemBlocks()) {
24822 printf("Leak of %d blocks found in xmlAddAttributeDecl",
24823 xmlMemBlocks() - mem_base);
24825 printf(" %d", n_ctxt);
24826 printf(" %d", n_dtd);
24827 printf(" %d", n_elem);
24828 printf(" %d", n_name);
24829 printf(" %d", n_ns);
24830 printf(" %d", n_type);
24831 printf(" %d", n_def);
24832 printf(" %d", n_defaultValue);
24833 printf(" %d", n_tree);
24852 test_xmlAddElementDecl(void) {
24856 xmlElementPtr ret_val;
24857 xmlValidCtxtPtr ctxt; /* the validation context */
24859 xmlDtdPtr dtd; /* pointer to the DTD */
24861 xmlChar * name; /* the entity name */
24863 xmlElementTypeVal type; /* the element type */
24865 xmlElementContentPtr content; /* the element content tree or NULL */
24868 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24869 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24870 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24871 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24872 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24873 mem_base = xmlMemBlocks();
24874 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24875 dtd = gen_xmlDtdPtr(n_dtd, 1);
24876 name = gen_const_xmlChar_ptr(n_name, 2);
24877 type = gen_xmlElementTypeVal(n_type, 3);
24878 content = gen_xmlElementContentPtr(n_content, 4);
24880 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24881 desret_xmlElementPtr(ret_val);
24883 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24884 des_xmlDtdPtr(n_dtd, dtd, 1);
24885 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24886 des_xmlElementTypeVal(n_type, type, 3);
24887 des_xmlElementContentPtr(n_content, content, 4);
24888 xmlResetLastError();
24889 if (mem_base != xmlMemBlocks()) {
24890 printf("Leak of %d blocks found in xmlAddElementDecl",
24891 xmlMemBlocks() - mem_base);
24893 printf(" %d", n_ctxt);
24894 printf(" %d", n_dtd);
24895 printf(" %d", n_name);
24896 printf(" %d", n_type);
24897 printf(" %d", n_content);
24912 test_xmlAddID(void) {
24916 /* missing type support */
24922 test_xmlAddNotationDecl(void) {
24926 /* missing type support */
24932 test_xmlAddRef(void) {
24936 /* missing type support */
24941 #define gen_nb_xmlAttributeTablePtr 1
24942 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24945 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24949 test_xmlCopyAttributeTable(void) {
24953 /* missing type support */
24959 test_xmlCopyDocElementContent(void) {
24963 xmlElementContentPtr ret_val;
24964 xmlDocPtr doc; /* the document owning the element declaration */
24966 xmlElementContentPtr cur; /* An element content pointer. */
24969 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24970 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24971 mem_base = xmlMemBlocks();
24972 doc = gen_xmlDocPtr(n_doc, 0);
24973 cur = gen_xmlElementContentPtr(n_cur, 1);
24975 ret_val = xmlCopyDocElementContent(doc, cur);
24976 desret_xmlElementContentPtr(ret_val);
24978 des_xmlDocPtr(n_doc, doc, 0);
24979 des_xmlElementContentPtr(n_cur, cur, 1);
24980 xmlResetLastError();
24981 if (mem_base != xmlMemBlocks()) {
24982 printf("Leak of %d blocks found in xmlCopyDocElementContent",
24983 xmlMemBlocks() - mem_base);
24985 printf(" %d", n_doc);
24986 printf(" %d", n_cur);
24998 test_xmlCopyElementContent(void) {
25002 xmlElementContentPtr ret_val;
25003 xmlElementContentPtr cur; /* An element content pointer. */
25006 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25007 mem_base = xmlMemBlocks();
25008 cur = gen_xmlElementContentPtr(n_cur, 0);
25010 ret_val = xmlCopyElementContent(cur);
25011 desret_xmlElementContentPtr(ret_val);
25013 des_xmlElementContentPtr(n_cur, cur, 0);
25014 xmlResetLastError();
25015 if (mem_base != xmlMemBlocks()) {
25016 printf("Leak of %d blocks found in xmlCopyElementContent",
25017 xmlMemBlocks() - mem_base);
25019 printf(" %d", n_cur);
25029 #define gen_nb_xmlElementTablePtr 1
25030 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25033 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25037 test_xmlCopyElementTable(void) {
25041 /* missing type support */
25047 test_xmlCopyEnumeration(void) {
25051 /* missing type support */
25056 #define gen_nb_xmlNotationTablePtr 1
25057 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25060 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25064 test_xmlCopyNotationTable(void) {
25068 /* missing type support */
25074 test_xmlCreateEnumeration(void) {
25078 /* missing type support */
25083 #define gen_nb_xmlAttributePtr 1
25084 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25087 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25091 test_xmlDumpAttributeDecl(void) {
25094 #if defined(LIBXML_OUTPUT_ENABLED)
25096 xmlBufferPtr buf; /* the XML buffer output */
25098 xmlAttributePtr attr; /* An attribute declaration */
25101 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25102 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25103 mem_base = xmlMemBlocks();
25104 buf = gen_xmlBufferPtr(n_buf, 0);
25105 attr = gen_xmlAttributePtr(n_attr, 1);
25107 xmlDumpAttributeDecl(buf, attr);
25109 des_xmlBufferPtr(n_buf, buf, 0);
25110 des_xmlAttributePtr(n_attr, attr, 1);
25111 xmlResetLastError();
25112 if (mem_base != xmlMemBlocks()) {
25113 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25114 xmlMemBlocks() - mem_base);
25116 printf(" %d", n_buf);
25117 printf(" %d", n_attr);
25130 test_xmlDumpAttributeTable(void) {
25133 #if defined(LIBXML_OUTPUT_ENABLED)
25135 xmlBufferPtr buf; /* the XML buffer output */
25137 xmlAttributeTablePtr table; /* An attribute table */
25140 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25141 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25142 mem_base = xmlMemBlocks();
25143 buf = gen_xmlBufferPtr(n_buf, 0);
25144 table = gen_xmlAttributeTablePtr(n_table, 1);
25146 xmlDumpAttributeTable(buf, table);
25148 des_xmlBufferPtr(n_buf, buf, 0);
25149 des_xmlAttributeTablePtr(n_table, table, 1);
25150 xmlResetLastError();
25151 if (mem_base != xmlMemBlocks()) {
25152 printf("Leak of %d blocks found in xmlDumpAttributeTable",
25153 xmlMemBlocks() - mem_base);
25155 printf(" %d", n_buf);
25156 printf(" %d", n_table);
25168 #define gen_nb_xmlElementPtr 1
25169 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25172 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25176 test_xmlDumpElementDecl(void) {
25179 #if defined(LIBXML_OUTPUT_ENABLED)
25181 xmlBufferPtr buf; /* the XML buffer output */
25183 xmlElementPtr elem; /* An element table */
25186 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25187 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25188 mem_base = xmlMemBlocks();
25189 buf = gen_xmlBufferPtr(n_buf, 0);
25190 elem = gen_xmlElementPtr(n_elem, 1);
25192 xmlDumpElementDecl(buf, elem);
25194 des_xmlBufferPtr(n_buf, buf, 0);
25195 des_xmlElementPtr(n_elem, elem, 1);
25196 xmlResetLastError();
25197 if (mem_base != xmlMemBlocks()) {
25198 printf("Leak of %d blocks found in xmlDumpElementDecl",
25199 xmlMemBlocks() - mem_base);
25201 printf(" %d", n_buf);
25202 printf(" %d", n_elem);
25215 test_xmlDumpElementTable(void) {
25218 #if defined(LIBXML_OUTPUT_ENABLED)
25220 xmlBufferPtr buf; /* the XML buffer output */
25222 xmlElementTablePtr table; /* An element table */
25225 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25226 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25227 mem_base = xmlMemBlocks();
25228 buf = gen_xmlBufferPtr(n_buf, 0);
25229 table = gen_xmlElementTablePtr(n_table, 1);
25231 xmlDumpElementTable(buf, table);
25233 des_xmlBufferPtr(n_buf, buf, 0);
25234 des_xmlElementTablePtr(n_table, table, 1);
25235 xmlResetLastError();
25236 if (mem_base != xmlMemBlocks()) {
25237 printf("Leak of %d blocks found in xmlDumpElementTable",
25238 xmlMemBlocks() - mem_base);
25240 printf(" %d", n_buf);
25241 printf(" %d", n_table);
25253 #define gen_nb_xmlNotationPtr 1
25254 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25257 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25261 test_xmlDumpNotationDecl(void) {
25264 #if defined(LIBXML_OUTPUT_ENABLED)
25266 xmlBufferPtr buf; /* the XML buffer output */
25268 xmlNotationPtr nota; /* A notation declaration */
25271 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25272 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25273 mem_base = xmlMemBlocks();
25274 buf = gen_xmlBufferPtr(n_buf, 0);
25275 nota = gen_xmlNotationPtr(n_nota, 1);
25277 xmlDumpNotationDecl(buf, nota);
25279 des_xmlBufferPtr(n_buf, buf, 0);
25280 des_xmlNotationPtr(n_nota, nota, 1);
25281 xmlResetLastError();
25282 if (mem_base != xmlMemBlocks()) {
25283 printf("Leak of %d blocks found in xmlDumpNotationDecl",
25284 xmlMemBlocks() - mem_base);
25286 printf(" %d", n_buf);
25287 printf(" %d", n_nota);
25300 test_xmlDumpNotationTable(void) {
25303 #if defined(LIBXML_OUTPUT_ENABLED)
25305 xmlBufferPtr buf; /* the XML buffer output */
25307 xmlNotationTablePtr table; /* A notation table */
25310 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25311 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25312 mem_base = xmlMemBlocks();
25313 buf = gen_xmlBufferPtr(n_buf, 0);
25314 table = gen_xmlNotationTablePtr(n_table, 1);
25316 xmlDumpNotationTable(buf, table);
25318 des_xmlBufferPtr(n_buf, buf, 0);
25319 des_xmlNotationTablePtr(n_table, table, 1);
25320 xmlResetLastError();
25321 if (mem_base != xmlMemBlocks()) {
25322 printf("Leak of %d blocks found in xmlDumpNotationTable",
25323 xmlMemBlocks() - mem_base);
25325 printf(" %d", n_buf);
25326 printf(" %d", n_table);
25339 test_xmlGetDtdAttrDesc(void) {
25343 xmlAttributePtr ret_val;
25344 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25346 xmlChar * elem; /* the element name */
25348 xmlChar * name; /* the attribute name */
25351 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25352 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25353 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25354 mem_base = xmlMemBlocks();
25355 dtd = gen_xmlDtdPtr(n_dtd, 0);
25356 elem = gen_const_xmlChar_ptr(n_elem, 1);
25357 name = gen_const_xmlChar_ptr(n_name, 2);
25359 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25360 desret_xmlAttributePtr(ret_val);
25362 des_xmlDtdPtr(n_dtd, dtd, 0);
25363 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25364 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25365 xmlResetLastError();
25366 if (mem_base != xmlMemBlocks()) {
25367 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25368 xmlMemBlocks() - mem_base);
25370 printf(" %d", n_dtd);
25371 printf(" %d", n_elem);
25372 printf(" %d", n_name);
25385 test_xmlGetDtdElementDesc(void) {
25389 xmlElementPtr ret_val;
25390 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25392 xmlChar * name; /* the element name */
25395 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25396 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25397 mem_base = xmlMemBlocks();
25398 dtd = gen_xmlDtdPtr(n_dtd, 0);
25399 name = gen_const_xmlChar_ptr(n_name, 1);
25401 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25402 desret_xmlElementPtr(ret_val);
25404 des_xmlDtdPtr(n_dtd, dtd, 0);
25405 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25406 xmlResetLastError();
25407 if (mem_base != xmlMemBlocks()) {
25408 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25409 xmlMemBlocks() - mem_base);
25411 printf(" %d", n_dtd);
25412 printf(" %d", n_name);
25424 test_xmlGetDtdNotationDesc(void) {
25428 /* missing type support */
25434 test_xmlGetDtdQAttrDesc(void) {
25438 xmlAttributePtr ret_val;
25439 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25441 xmlChar * elem; /* the element name */
25443 xmlChar * name; /* the attribute name */
25445 xmlChar * prefix; /* the attribute namespace prefix */
25448 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25449 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25450 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25451 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25452 mem_base = xmlMemBlocks();
25453 dtd = gen_xmlDtdPtr(n_dtd, 0);
25454 elem = gen_const_xmlChar_ptr(n_elem, 1);
25455 name = gen_const_xmlChar_ptr(n_name, 2);
25456 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25458 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25459 desret_xmlAttributePtr(ret_val);
25461 des_xmlDtdPtr(n_dtd, dtd, 0);
25462 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25463 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25464 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25465 xmlResetLastError();
25466 if (mem_base != xmlMemBlocks()) {
25467 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25468 xmlMemBlocks() - mem_base);
25470 printf(" %d", n_dtd);
25471 printf(" %d", n_elem);
25472 printf(" %d", n_name);
25473 printf(" %d", n_prefix);
25487 test_xmlGetDtdQElementDesc(void) {
25491 xmlElementPtr ret_val;
25492 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25494 xmlChar * name; /* the element name */
25496 xmlChar * prefix; /* the element namespace prefix */
25499 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25500 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25501 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25502 mem_base = xmlMemBlocks();
25503 dtd = gen_xmlDtdPtr(n_dtd, 0);
25504 name = gen_const_xmlChar_ptr(n_name, 1);
25505 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25507 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25508 desret_xmlElementPtr(ret_val);
25510 des_xmlDtdPtr(n_dtd, dtd, 0);
25511 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25512 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25513 xmlResetLastError();
25514 if (mem_base != xmlMemBlocks()) {
25515 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25516 xmlMemBlocks() - mem_base);
25518 printf(" %d", n_dtd);
25519 printf(" %d", n_name);
25520 printf(" %d", n_prefix);
25533 test_xmlGetID(void) {
25537 xmlAttrPtr ret_val;
25538 xmlDocPtr doc; /* pointer to the document */
25540 xmlChar * ID; /* the ID value */
25543 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25544 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25545 mem_base = xmlMemBlocks();
25546 doc = gen_xmlDocPtr(n_doc, 0);
25547 ID = gen_const_xmlChar_ptr(n_ID, 1);
25549 ret_val = xmlGetID(doc, (const xmlChar *)ID);
25550 desret_xmlAttrPtr(ret_val);
25552 des_xmlDocPtr(n_doc, doc, 0);
25553 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25554 xmlResetLastError();
25555 if (mem_base != xmlMemBlocks()) {
25556 printf("Leak of %d blocks found in xmlGetID",
25557 xmlMemBlocks() - mem_base);
25559 printf(" %d", n_doc);
25560 printf(" %d", n_ID);
25572 test_xmlGetRefs(void) {
25576 /* missing type support */
25582 test_xmlIsID(void) {
25587 xmlDocPtr doc; /* the document */
25589 xmlNodePtr elem; /* the element carrying the attribute */
25591 xmlAttrPtr attr; /* the attribute */
25594 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25595 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25596 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25597 mem_base = xmlMemBlocks();
25598 doc = gen_xmlDocPtr(n_doc, 0);
25599 elem = gen_xmlNodePtr(n_elem, 1);
25600 attr = gen_xmlAttrPtr(n_attr, 2);
25602 ret_val = xmlIsID(doc, elem, attr);
25603 desret_int(ret_val);
25605 des_xmlDocPtr(n_doc, doc, 0);
25606 des_xmlNodePtr(n_elem, elem, 1);
25607 des_xmlAttrPtr(n_attr, attr, 2);
25608 xmlResetLastError();
25609 if (mem_base != xmlMemBlocks()) {
25610 printf("Leak of %d blocks found in xmlIsID",
25611 xmlMemBlocks() - mem_base);
25613 printf(" %d", n_doc);
25614 printf(" %d", n_elem);
25615 printf(" %d", n_attr);
25628 test_xmlIsMixedElement(void) {
25633 xmlDocPtr doc; /* the document */
25635 xmlChar * name; /* the element name */
25638 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25639 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25640 mem_base = xmlMemBlocks();
25641 doc = gen_xmlDocPtr(n_doc, 0);
25642 name = gen_const_xmlChar_ptr(n_name, 1);
25644 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25645 desret_int(ret_val);
25647 des_xmlDocPtr(n_doc, doc, 0);
25648 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25649 xmlResetLastError();
25650 if (mem_base != xmlMemBlocks()) {
25651 printf("Leak of %d blocks found in xmlIsMixedElement",
25652 xmlMemBlocks() - mem_base);
25654 printf(" %d", n_doc);
25655 printf(" %d", n_name);
25667 test_xmlIsRef(void) {
25672 xmlDocPtr doc; /* the document */
25674 xmlNodePtr elem; /* the element carrying the attribute */
25676 xmlAttrPtr attr; /* the attribute */
25679 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25680 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25681 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25682 mem_base = xmlMemBlocks();
25683 doc = gen_xmlDocPtr(n_doc, 0);
25684 elem = gen_xmlNodePtr(n_elem, 1);
25685 attr = gen_xmlAttrPtr(n_attr, 2);
25687 ret_val = xmlIsRef(doc, elem, attr);
25688 desret_int(ret_val);
25690 des_xmlDocPtr(n_doc, doc, 0);
25691 des_xmlNodePtr(n_elem, elem, 1);
25692 des_xmlAttrPtr(n_attr, attr, 2);
25693 xmlResetLastError();
25694 if (mem_base != xmlMemBlocks()) {
25695 printf("Leak of %d blocks found in xmlIsRef",
25696 xmlMemBlocks() - mem_base);
25698 printf(" %d", n_doc);
25699 printf(" %d", n_elem);
25700 printf(" %d", n_attr);
25713 test_xmlNewDocElementContent(void) {
25717 xmlElementContentPtr ret_val;
25718 xmlDocPtr doc; /* the document */
25720 xmlChar * name; /* the subelement name or NULL */
25722 xmlElementContentType type; /* the type of element content decl */
25725 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25726 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25727 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25728 mem_base = xmlMemBlocks();
25729 doc = gen_xmlDocPtr(n_doc, 0);
25730 name = gen_const_xmlChar_ptr(n_name, 1);
25731 type = gen_xmlElementContentType(n_type, 2);
25733 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25734 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25735 desret_xmlElementContentPtr(ret_val);
25737 des_xmlDocPtr(n_doc, doc, 0);
25738 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25739 des_xmlElementContentType(n_type, type, 2);
25740 xmlResetLastError();
25741 if (mem_base != xmlMemBlocks()) {
25742 printf("Leak of %d blocks found in xmlNewDocElementContent",
25743 xmlMemBlocks() - mem_base);
25745 printf(" %d", n_doc);
25746 printf(" %d", n_name);
25747 printf(" %d", n_type);
25760 test_xmlNewElementContent(void) {
25764 xmlElementContentPtr ret_val;
25765 xmlChar * name; /* the subelement name or NULL */
25767 xmlElementContentType type; /* the type of element content decl */
25770 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25771 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25772 mem_base = xmlMemBlocks();
25773 name = gen_const_xmlChar_ptr(n_name, 0);
25774 type = gen_xmlElementContentType(n_type, 1);
25776 ret_val = xmlNewElementContent((const xmlChar *)name, type);
25777 desret_xmlElementContentPtr(ret_val);
25779 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25780 des_xmlElementContentType(n_type, type, 1);
25781 xmlResetLastError();
25782 if (mem_base != xmlMemBlocks()) {
25783 printf("Leak of %d blocks found in xmlNewElementContent",
25784 xmlMemBlocks() - mem_base);
25786 printf(" %d", n_name);
25787 printf(" %d", n_type);
25799 test_xmlNewValidCtxt(void) {
25803 /* missing type support */
25809 test_xmlRemoveID(void) {
25814 xmlDocPtr doc; /* the document */
25816 xmlAttrPtr attr; /* the attribute */
25819 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25820 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25821 mem_base = xmlMemBlocks();
25822 doc = gen_xmlDocPtr(n_doc, 0);
25823 attr = gen_xmlAttrPtr(n_attr, 1);
25825 ret_val = xmlRemoveID(doc, attr);
25826 desret_int(ret_val);
25828 des_xmlDocPtr(n_doc, doc, 0);
25829 des_xmlAttrPtr(n_attr, attr, 1);
25830 xmlResetLastError();
25831 if (mem_base != xmlMemBlocks()) {
25832 printf("Leak of %d blocks found in xmlRemoveID",
25833 xmlMemBlocks() - mem_base);
25835 printf(" %d", n_doc);
25836 printf(" %d", n_attr);
25848 test_xmlRemoveRef(void) {
25853 xmlDocPtr doc; /* the document */
25855 xmlAttrPtr attr; /* the attribute */
25858 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25859 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25860 mem_base = xmlMemBlocks();
25861 doc = gen_xmlDocPtr(n_doc, 0);
25862 attr = gen_xmlAttrPtr(n_attr, 1);
25864 ret_val = xmlRemoveRef(doc, attr);
25865 desret_int(ret_val);
25867 des_xmlDocPtr(n_doc, doc, 0);
25868 des_xmlAttrPtr(n_attr, attr, 1);
25869 xmlResetLastError();
25870 if (mem_base != xmlMemBlocks()) {
25871 printf("Leak of %d blocks found in xmlRemoveRef",
25872 xmlMemBlocks() - mem_base);
25874 printf(" %d", n_doc);
25875 printf(" %d", n_attr);
25887 test_xmlSnprintfElementContent(void) {
25891 char * buf; /* an output buffer */
25893 int size; /* the buffer size */
25895 xmlElementContentPtr content; /* An element table */
25897 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25900 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25901 for (n_size = 0;n_size < gen_nb_int;n_size++) {
25902 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25903 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25904 mem_base = xmlMemBlocks();
25905 buf = gen_char_ptr(n_buf, 0);
25906 size = gen_int(n_size, 1);
25907 content = gen_xmlElementContentPtr(n_content, 2);
25908 englob = gen_int(n_englob, 3);
25910 xmlSnprintfElementContent(buf, size, content, englob);
25912 des_char_ptr(n_buf, buf, 0);
25913 des_int(n_size, size, 1);
25914 des_xmlElementContentPtr(n_content, content, 2);
25915 des_int(n_englob, englob, 3);
25916 xmlResetLastError();
25917 if (mem_base != xmlMemBlocks()) {
25918 printf("Leak of %d blocks found in xmlSnprintfElementContent",
25919 xmlMemBlocks() - mem_base);
25921 printf(" %d", n_buf);
25922 printf(" %d", n_size);
25923 printf(" %d", n_content);
25924 printf(" %d", n_englob);
25938 test_xmlSprintfElementContent(void) {
25941 #if defined(LIBXML_OUTPUT_ENABLED)
25942 #ifdef LIBXML_OUTPUT_ENABLED
25944 char * buf; /* an output buffer */
25946 xmlElementContentPtr content; /* An element table */
25948 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25951 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25952 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25953 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25954 mem_base = xmlMemBlocks();
25955 buf = gen_char_ptr(n_buf, 0);
25956 content = gen_xmlElementContentPtr(n_content, 1);
25957 englob = gen_int(n_englob, 2);
25959 xmlSprintfElementContent(buf, content, englob);
25961 des_char_ptr(n_buf, buf, 0);
25962 des_xmlElementContentPtr(n_content, content, 1);
25963 des_int(n_englob, englob, 2);
25964 xmlResetLastError();
25965 if (mem_base != xmlMemBlocks()) {
25966 printf("Leak of %d blocks found in xmlSprintfElementContent",
25967 xmlMemBlocks() - mem_base);
25969 printf(" %d", n_buf);
25970 printf(" %d", n_content);
25971 printf(" %d", n_englob);
25986 test_xmlValidBuildContentModel(void) {
25989 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25992 xmlValidCtxtPtr ctxt; /* a validation context */
25994 xmlElementPtr elem; /* an element declaration node */
25997 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25998 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25999 mem_base = xmlMemBlocks();
26000 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26001 elem = gen_xmlElementPtr(n_elem, 1);
26003 ret_val = xmlValidBuildContentModel(ctxt, elem);
26004 desret_int(ret_val);
26006 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26007 des_xmlElementPtr(n_elem, elem, 1);
26008 xmlResetLastError();
26009 if (mem_base != xmlMemBlocks()) {
26010 printf("Leak of %d blocks found in xmlValidBuildContentModel",
26011 xmlMemBlocks() - mem_base);
26013 printf(" %d", n_ctxt);
26014 printf(" %d", n_elem);
26027 test_xmlValidCtxtNormalizeAttributeValue(void) {
26030 #if defined(LIBXML_VALID_ENABLED)
26033 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26035 xmlDocPtr doc; /* the document */
26037 xmlNodePtr elem; /* the parent */
26039 xmlChar * name; /* the attribute name */
26041 xmlChar * value; /* the attribute value */
26044 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26045 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26046 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26047 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26048 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26049 mem_base = xmlMemBlocks();
26050 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26051 doc = gen_xmlDocPtr(n_doc, 1);
26052 elem = gen_xmlNodePtr(n_elem, 2);
26053 name = gen_const_xmlChar_ptr(n_name, 3);
26054 value = gen_const_xmlChar_ptr(n_value, 4);
26056 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26057 desret_xmlChar_ptr(ret_val);
26059 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26060 des_xmlDocPtr(n_doc, doc, 1);
26061 des_xmlNodePtr(n_elem, elem, 2);
26062 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26063 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26064 xmlResetLastError();
26065 if (mem_base != xmlMemBlocks()) {
26066 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26067 xmlMemBlocks() - mem_base);
26069 printf(" %d", n_ctxt);
26070 printf(" %d", n_doc);
26071 printf(" %d", n_elem);
26072 printf(" %d", n_name);
26073 printf(" %d", n_value);
26088 #define gen_nb_xmlElementContent_ptr 1
26089 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26092 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26096 test_xmlValidGetPotentialChildren(void) {
26099 #if defined(LIBXML_VALID_ENABLED)
26100 #ifdef LIBXML_VALID_ENABLED
26103 xmlElementContent * ctree; /* an element content tree */
26105 xmlChar ** names; /* an array to store the list of child names */
26107 int * len; /* a pointer to the number of element in the list */
26109 int max; /* the size of the array */
26112 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26113 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26114 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26115 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26116 mem_base = xmlMemBlocks();
26117 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26118 names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26119 len = gen_int_ptr(n_len, 2);
26120 max = gen_int(n_max, 3);
26122 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26123 desret_int(ret_val);
26125 des_xmlElementContent_ptr(n_ctree, ctree, 0);
26126 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26127 des_int_ptr(n_len, len, 2);
26128 des_int(n_max, max, 3);
26129 xmlResetLastError();
26130 if (mem_base != xmlMemBlocks()) {
26131 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26132 xmlMemBlocks() - mem_base);
26134 printf(" %d", n_ctree);
26135 printf(" %d", n_names);
26136 printf(" %d", n_len);
26137 printf(" %d", n_max);
26153 test_xmlValidGetValidElements(void) {
26156 #if defined(LIBXML_VALID_ENABLED)
26157 #ifdef LIBXML_VALID_ENABLED
26160 xmlNode * prev; /* an element to insert after */
26162 xmlNode * next; /* an element to insert next */
26164 xmlChar ** names; /* an array to store the list of child names */
26166 int max; /* the size of the array */
26169 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26170 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26171 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26172 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26173 mem_base = xmlMemBlocks();
26174 prev = gen_xmlNodePtr(n_prev, 0);
26175 next = gen_xmlNodePtr(n_next, 1);
26176 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26177 max = gen_int(n_max, 3);
26179 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26180 desret_int(ret_val);
26182 des_xmlNodePtr(n_prev, prev, 0);
26183 des_xmlNodePtr(n_next, next, 1);
26184 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26185 des_int(n_max, max, 3);
26186 xmlResetLastError();
26187 if (mem_base != xmlMemBlocks()) {
26188 printf("Leak of %d blocks found in xmlValidGetValidElements",
26189 xmlMemBlocks() - mem_base);
26191 printf(" %d", n_prev);
26192 printf(" %d", n_next);
26193 printf(" %d", n_names);
26194 printf(" %d", n_max);
26210 test_xmlValidNormalizeAttributeValue(void) {
26213 #if defined(LIBXML_VALID_ENABLED)
26216 xmlDocPtr doc; /* the document */
26218 xmlNodePtr elem; /* the parent */
26220 xmlChar * name; /* the attribute name */
26222 xmlChar * value; /* the attribute value */
26225 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26226 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26227 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26228 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26229 mem_base = xmlMemBlocks();
26230 doc = gen_xmlDocPtr(n_doc, 0);
26231 elem = gen_xmlNodePtr(n_elem, 1);
26232 name = gen_const_xmlChar_ptr(n_name, 2);
26233 value = gen_const_xmlChar_ptr(n_value, 3);
26235 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26236 desret_xmlChar_ptr(ret_val);
26238 des_xmlDocPtr(n_doc, doc, 0);
26239 des_xmlNodePtr(n_elem, elem, 1);
26240 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26241 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26242 xmlResetLastError();
26243 if (mem_base != xmlMemBlocks()) {
26244 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26245 xmlMemBlocks() - mem_base);
26247 printf(" %d", n_doc);
26248 printf(" %d", n_elem);
26249 printf(" %d", n_name);
26250 printf(" %d", n_value);
26265 test_xmlValidateAttributeDecl(void) {
26268 #if defined(LIBXML_VALID_ENABLED)
26271 xmlValidCtxtPtr ctxt; /* the validation context */
26273 xmlDocPtr doc; /* a document instance */
26275 xmlAttributePtr attr; /* an attribute definition */
26278 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26279 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26280 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26281 mem_base = xmlMemBlocks();
26282 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26283 doc = gen_xmlDocPtr(n_doc, 1);
26284 attr = gen_xmlAttributePtr(n_attr, 2);
26286 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26287 desret_int(ret_val);
26289 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26290 des_xmlDocPtr(n_doc, doc, 1);
26291 des_xmlAttributePtr(n_attr, attr, 2);
26292 xmlResetLastError();
26293 if (mem_base != xmlMemBlocks()) {
26294 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26295 xmlMemBlocks() - mem_base);
26297 printf(" %d", n_ctxt);
26298 printf(" %d", n_doc);
26299 printf(" %d", n_attr);
26313 test_xmlValidateAttributeValue(void) {
26316 #if defined(LIBXML_VALID_ENABLED)
26319 xmlAttributeType type; /* an attribute type */
26321 xmlChar * value; /* an attribute value */
26324 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26325 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26326 mem_base = xmlMemBlocks();
26327 type = gen_xmlAttributeType(n_type, 0);
26328 value = gen_const_xmlChar_ptr(n_value, 1);
26330 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26331 desret_int(ret_val);
26333 des_xmlAttributeType(n_type, type, 0);
26334 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26335 xmlResetLastError();
26336 if (mem_base != xmlMemBlocks()) {
26337 printf("Leak of %d blocks found in xmlValidateAttributeValue",
26338 xmlMemBlocks() - mem_base);
26340 printf(" %d", n_type);
26341 printf(" %d", n_value);
26354 test_xmlValidateDocument(void) {
26357 #if defined(LIBXML_VALID_ENABLED)
26360 xmlValidCtxtPtr ctxt; /* the validation context */
26362 xmlDocPtr doc; /* a document instance */
26365 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26366 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26367 mem_base = xmlMemBlocks();
26368 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26369 doc = gen_xmlDocPtr(n_doc, 1);
26371 ret_val = xmlValidateDocument(ctxt, doc);
26372 desret_int(ret_val);
26374 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26375 des_xmlDocPtr(n_doc, doc, 1);
26376 xmlResetLastError();
26377 if (mem_base != xmlMemBlocks()) {
26378 printf("Leak of %d blocks found in xmlValidateDocument",
26379 xmlMemBlocks() - mem_base);
26381 printf(" %d", n_ctxt);
26382 printf(" %d", n_doc);
26395 test_xmlValidateDocumentFinal(void) {
26398 #if defined(LIBXML_VALID_ENABLED)
26401 xmlValidCtxtPtr ctxt; /* the validation context */
26403 xmlDocPtr doc; /* a document instance */
26406 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26407 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26408 mem_base = xmlMemBlocks();
26409 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26410 doc = gen_xmlDocPtr(n_doc, 1);
26412 ret_val = xmlValidateDocumentFinal(ctxt, doc);
26413 desret_int(ret_val);
26415 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26416 des_xmlDocPtr(n_doc, doc, 1);
26417 xmlResetLastError();
26418 if (mem_base != xmlMemBlocks()) {
26419 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26420 xmlMemBlocks() - mem_base);
26422 printf(" %d", n_ctxt);
26423 printf(" %d", n_doc);
26436 test_xmlValidateDtd(void) {
26439 #if defined(LIBXML_VALID_ENABLED)
26442 xmlValidCtxtPtr ctxt; /* the validation context */
26444 xmlDocPtr doc; /* a document instance */
26446 xmlDtdPtr dtd; /* a dtd instance */
26449 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26450 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26451 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26452 mem_base = xmlMemBlocks();
26453 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26454 doc = gen_xmlDocPtr(n_doc, 1);
26455 dtd = gen_xmlDtdPtr(n_dtd, 2);
26457 ret_val = xmlValidateDtd(ctxt, doc, dtd);
26458 desret_int(ret_val);
26460 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26461 des_xmlDocPtr(n_doc, doc, 1);
26462 des_xmlDtdPtr(n_dtd, dtd, 2);
26463 xmlResetLastError();
26464 if (mem_base != xmlMemBlocks()) {
26465 printf("Leak of %d blocks found in xmlValidateDtd",
26466 xmlMemBlocks() - mem_base);
26468 printf(" %d", n_ctxt);
26469 printf(" %d", n_doc);
26470 printf(" %d", n_dtd);
26484 test_xmlValidateDtdFinal(void) {
26487 #if defined(LIBXML_VALID_ENABLED)
26490 xmlValidCtxtPtr ctxt; /* the validation context */
26492 xmlDocPtr doc; /* a document instance */
26495 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26496 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26497 mem_base = xmlMemBlocks();
26498 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26499 doc = gen_xmlDocPtr(n_doc, 1);
26501 ret_val = xmlValidateDtdFinal(ctxt, doc);
26502 desret_int(ret_val);
26504 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26505 des_xmlDocPtr(n_doc, doc, 1);
26506 xmlResetLastError();
26507 if (mem_base != xmlMemBlocks()) {
26508 printf("Leak of %d blocks found in xmlValidateDtdFinal",
26509 xmlMemBlocks() - mem_base);
26511 printf(" %d", n_ctxt);
26512 printf(" %d", n_doc);
26525 test_xmlValidateElement(void) {
26528 #if defined(LIBXML_VALID_ENABLED)
26531 xmlValidCtxtPtr ctxt; /* the validation context */
26533 xmlDocPtr doc; /* a document instance */
26535 xmlNodePtr elem; /* an element instance */
26538 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26539 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26540 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26541 mem_base = xmlMemBlocks();
26542 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26543 doc = gen_xmlDocPtr(n_doc, 1);
26544 elem = gen_xmlNodePtr(n_elem, 2);
26546 ret_val = xmlValidateElement(ctxt, doc, elem);
26547 desret_int(ret_val);
26549 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26550 des_xmlDocPtr(n_doc, doc, 1);
26551 des_xmlNodePtr(n_elem, elem, 2);
26552 xmlResetLastError();
26553 if (mem_base != xmlMemBlocks()) {
26554 printf("Leak of %d blocks found in xmlValidateElement",
26555 xmlMemBlocks() - mem_base);
26557 printf(" %d", n_ctxt);
26558 printf(" %d", n_doc);
26559 printf(" %d", n_elem);
26573 test_xmlValidateElementDecl(void) {
26576 #if defined(LIBXML_VALID_ENABLED)
26579 xmlValidCtxtPtr ctxt; /* the validation context */
26581 xmlDocPtr doc; /* a document instance */
26583 xmlElementPtr elem; /* an element definition */
26586 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26587 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26588 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26589 mem_base = xmlMemBlocks();
26590 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26591 doc = gen_xmlDocPtr(n_doc, 1);
26592 elem = gen_xmlElementPtr(n_elem, 2);
26594 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26595 desret_int(ret_val);
26597 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26598 des_xmlDocPtr(n_doc, doc, 1);
26599 des_xmlElementPtr(n_elem, elem, 2);
26600 xmlResetLastError();
26601 if (mem_base != xmlMemBlocks()) {
26602 printf("Leak of %d blocks found in xmlValidateElementDecl",
26603 xmlMemBlocks() - mem_base);
26605 printf(" %d", n_ctxt);
26606 printf(" %d", n_doc);
26607 printf(" %d", n_elem);
26621 test_xmlValidateNameValue(void) {
26624 #if defined(LIBXML_VALID_ENABLED)
26627 xmlChar * value; /* an Name value */
26630 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26631 mem_base = xmlMemBlocks();
26632 value = gen_const_xmlChar_ptr(n_value, 0);
26634 ret_val = xmlValidateNameValue((const xmlChar *)value);
26635 desret_int(ret_val);
26637 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26638 xmlResetLastError();
26639 if (mem_base != xmlMemBlocks()) {
26640 printf("Leak of %d blocks found in xmlValidateNameValue",
26641 xmlMemBlocks() - mem_base);
26643 printf(" %d", n_value);
26655 test_xmlValidateNamesValue(void) {
26658 #if defined(LIBXML_VALID_ENABLED)
26661 xmlChar * value; /* an Names value */
26664 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26665 mem_base = xmlMemBlocks();
26666 value = gen_const_xmlChar_ptr(n_value, 0);
26668 ret_val = xmlValidateNamesValue((const xmlChar *)value);
26669 desret_int(ret_val);
26671 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26672 xmlResetLastError();
26673 if (mem_base != xmlMemBlocks()) {
26674 printf("Leak of %d blocks found in xmlValidateNamesValue",
26675 xmlMemBlocks() - mem_base);
26677 printf(" %d", n_value);
26689 test_xmlValidateNmtokenValue(void) {
26692 #if defined(LIBXML_VALID_ENABLED)
26695 xmlChar * value; /* an Nmtoken value */
26698 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26699 mem_base = xmlMemBlocks();
26700 value = gen_const_xmlChar_ptr(n_value, 0);
26702 ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26703 desret_int(ret_val);
26705 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26706 xmlResetLastError();
26707 if (mem_base != xmlMemBlocks()) {
26708 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26709 xmlMemBlocks() - mem_base);
26711 printf(" %d", n_value);
26723 test_xmlValidateNmtokensValue(void) {
26726 #if defined(LIBXML_VALID_ENABLED)
26729 xmlChar * value; /* an Nmtokens value */
26732 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26733 mem_base = xmlMemBlocks();
26734 value = gen_const_xmlChar_ptr(n_value, 0);
26736 ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26737 desret_int(ret_val);
26739 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26740 xmlResetLastError();
26741 if (mem_base != xmlMemBlocks()) {
26742 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26743 xmlMemBlocks() - mem_base);
26745 printf(" %d", n_value);
26757 test_xmlValidateNotationDecl(void) {
26760 #if defined(LIBXML_VALID_ENABLED)
26763 xmlValidCtxtPtr ctxt; /* the validation context */
26765 xmlDocPtr doc; /* a document instance */
26767 xmlNotationPtr nota; /* a notation definition */
26770 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26771 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26772 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26773 mem_base = xmlMemBlocks();
26774 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26775 doc = gen_xmlDocPtr(n_doc, 1);
26776 nota = gen_xmlNotationPtr(n_nota, 2);
26778 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26779 desret_int(ret_val);
26781 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26782 des_xmlDocPtr(n_doc, doc, 1);
26783 des_xmlNotationPtr(n_nota, nota, 2);
26784 xmlResetLastError();
26785 if (mem_base != xmlMemBlocks()) {
26786 printf("Leak of %d blocks found in xmlValidateNotationDecl",
26787 xmlMemBlocks() - mem_base);
26789 printf(" %d", n_ctxt);
26790 printf(" %d", n_doc);
26791 printf(" %d", n_nota);
26805 test_xmlValidateNotationUse(void) {
26808 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26811 xmlValidCtxtPtr ctxt; /* the validation context */
26813 xmlDocPtr doc; /* the document */
26815 xmlChar * notationName; /* the notation name to check */
26816 int n_notationName;
26818 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26819 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26820 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26821 mem_base = xmlMemBlocks();
26822 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26823 doc = gen_xmlDocPtr(n_doc, 1);
26824 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26826 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26827 desret_int(ret_val);
26829 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26830 des_xmlDocPtr(n_doc, doc, 1);
26831 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26832 xmlResetLastError();
26833 if (mem_base != xmlMemBlocks()) {
26834 printf("Leak of %d blocks found in xmlValidateNotationUse",
26835 xmlMemBlocks() - mem_base);
26837 printf(" %d", n_ctxt);
26838 printf(" %d", n_doc);
26839 printf(" %d", n_notationName);
26853 test_xmlValidateOneAttribute(void) {
26856 #if defined(LIBXML_VALID_ENABLED)
26859 xmlValidCtxtPtr ctxt; /* the validation context */
26861 xmlDocPtr doc; /* a document instance */
26863 xmlNodePtr elem; /* an element instance */
26865 xmlAttrPtr attr; /* an attribute instance */
26867 xmlChar * value; /* the attribute value (without entities processing) */
26870 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26871 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26872 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26873 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26874 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26875 mem_base = xmlMemBlocks();
26876 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26877 doc = gen_xmlDocPtr(n_doc, 1);
26878 elem = gen_xmlNodePtr(n_elem, 2);
26879 attr = gen_xmlAttrPtr(n_attr, 3);
26880 value = gen_const_xmlChar_ptr(n_value, 4);
26882 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26883 desret_int(ret_val);
26885 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26886 des_xmlDocPtr(n_doc, doc, 1);
26887 des_xmlNodePtr(n_elem, elem, 2);
26888 des_xmlAttrPtr(n_attr, attr, 3);
26889 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26890 xmlResetLastError();
26891 if (mem_base != xmlMemBlocks()) {
26892 printf("Leak of %d blocks found in xmlValidateOneAttribute",
26893 xmlMemBlocks() - mem_base);
26895 printf(" %d", n_ctxt);
26896 printf(" %d", n_doc);
26897 printf(" %d", n_elem);
26898 printf(" %d", n_attr);
26899 printf(" %d", n_value);
26915 test_xmlValidateOneElement(void) {
26918 #if defined(LIBXML_VALID_ENABLED)
26921 xmlValidCtxtPtr ctxt; /* the validation context */
26923 xmlDocPtr doc; /* a document instance */
26925 xmlNodePtr elem; /* an element instance */
26928 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26929 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26930 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26931 mem_base = xmlMemBlocks();
26932 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26933 doc = gen_xmlDocPtr(n_doc, 1);
26934 elem = gen_xmlNodePtr(n_elem, 2);
26936 ret_val = xmlValidateOneElement(ctxt, doc, elem);
26937 desret_int(ret_val);
26939 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26940 des_xmlDocPtr(n_doc, doc, 1);
26941 des_xmlNodePtr(n_elem, elem, 2);
26942 xmlResetLastError();
26943 if (mem_base != xmlMemBlocks()) {
26944 printf("Leak of %d blocks found in xmlValidateOneElement",
26945 xmlMemBlocks() - mem_base);
26947 printf(" %d", n_ctxt);
26948 printf(" %d", n_doc);
26949 printf(" %d", n_elem);
26963 test_xmlValidateOneNamespace(void) {
26966 #if defined(LIBXML_VALID_ENABLED)
26969 xmlValidCtxtPtr ctxt; /* the validation context */
26971 xmlDocPtr doc; /* a document instance */
26973 xmlNodePtr elem; /* an element instance */
26975 xmlChar * prefix; /* the namespace prefix */
26977 xmlNsPtr ns; /* an namespace declaration instance */
26979 xmlChar * value; /* the attribute value (without entities processing) */
26982 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26983 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26984 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26985 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26986 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26987 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26988 mem_base = xmlMemBlocks();
26989 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26990 doc = gen_xmlDocPtr(n_doc, 1);
26991 elem = gen_xmlNodePtr(n_elem, 2);
26992 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26993 ns = gen_xmlNsPtr(n_ns, 4);
26994 value = gen_const_xmlChar_ptr(n_value, 5);
26996 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26997 desret_int(ret_val);
26999 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27000 des_xmlDocPtr(n_doc, doc, 1);
27001 des_xmlNodePtr(n_elem, elem, 2);
27002 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27003 des_xmlNsPtr(n_ns, ns, 4);
27004 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27005 xmlResetLastError();
27006 if (mem_base != xmlMemBlocks()) {
27007 printf("Leak of %d blocks found in xmlValidateOneNamespace",
27008 xmlMemBlocks() - mem_base);
27010 printf(" %d", n_ctxt);
27011 printf(" %d", n_doc);
27012 printf(" %d", n_elem);
27013 printf(" %d", n_prefix);
27014 printf(" %d", n_ns);
27015 printf(" %d", n_value);
27032 test_xmlValidatePopElement(void) {
27035 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27038 xmlValidCtxtPtr ctxt; /* the validation context */
27040 xmlDocPtr doc; /* a document instance */
27042 xmlNodePtr elem; /* an element instance */
27044 xmlChar * qname; /* the qualified name as appearing in the serialization */
27047 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27048 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27049 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27050 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27051 mem_base = xmlMemBlocks();
27052 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27053 doc = gen_xmlDocPtr(n_doc, 1);
27054 elem = gen_xmlNodePtr(n_elem, 2);
27055 qname = gen_const_xmlChar_ptr(n_qname, 3);
27057 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27058 desret_int(ret_val);
27060 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27061 des_xmlDocPtr(n_doc, doc, 1);
27062 des_xmlNodePtr(n_elem, elem, 2);
27063 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27064 xmlResetLastError();
27065 if (mem_base != xmlMemBlocks()) {
27066 printf("Leak of %d blocks found in xmlValidatePopElement",
27067 xmlMemBlocks() - mem_base);
27069 printf(" %d", n_ctxt);
27070 printf(" %d", n_doc);
27071 printf(" %d", n_elem);
27072 printf(" %d", n_qname);
27087 test_xmlValidatePushCData(void) {
27090 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27093 xmlValidCtxtPtr ctxt; /* the validation context */
27095 xmlChar * data; /* some character data read */
27097 int len; /* the length of the data */
27100 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27101 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27102 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27103 mem_base = xmlMemBlocks();
27104 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27105 data = gen_const_xmlChar_ptr(n_data, 1);
27106 len = gen_int(n_len, 2);
27108 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27109 desret_int(ret_val);
27111 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27112 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27113 des_int(n_len, len, 2);
27114 xmlResetLastError();
27115 if (mem_base != xmlMemBlocks()) {
27116 printf("Leak of %d blocks found in xmlValidatePushCData",
27117 xmlMemBlocks() - mem_base);
27119 printf(" %d", n_ctxt);
27120 printf(" %d", n_data);
27121 printf(" %d", n_len);
27135 test_xmlValidatePushElement(void) {
27138 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27141 xmlValidCtxtPtr ctxt; /* the validation context */
27143 xmlDocPtr doc; /* a document instance */
27145 xmlNodePtr elem; /* an element instance */
27147 xmlChar * qname; /* the qualified name as appearing in the serialization */
27150 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27151 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27152 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27153 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27154 mem_base = xmlMemBlocks();
27155 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27156 doc = gen_xmlDocPtr(n_doc, 1);
27157 elem = gen_xmlNodePtr(n_elem, 2);
27158 qname = gen_const_xmlChar_ptr(n_qname, 3);
27160 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27161 desret_int(ret_val);
27163 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27164 des_xmlDocPtr(n_doc, doc, 1);
27165 des_xmlNodePtr(n_elem, elem, 2);
27166 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27167 xmlResetLastError();
27168 if (mem_base != xmlMemBlocks()) {
27169 printf("Leak of %d blocks found in xmlValidatePushElement",
27170 xmlMemBlocks() - mem_base);
27172 printf(" %d", n_ctxt);
27173 printf(" %d", n_doc);
27174 printf(" %d", n_elem);
27175 printf(" %d", n_qname);
27190 test_xmlValidateRoot(void) {
27193 #if defined(LIBXML_VALID_ENABLED)
27196 xmlValidCtxtPtr ctxt; /* the validation context */
27198 xmlDocPtr doc; /* a document instance */
27201 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27202 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27203 mem_base = xmlMemBlocks();
27204 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27205 doc = gen_xmlDocPtr(n_doc, 1);
27207 ret_val = xmlValidateRoot(ctxt, doc);
27208 desret_int(ret_val);
27210 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27211 des_xmlDocPtr(n_doc, doc, 1);
27212 xmlResetLastError();
27213 if (mem_base != xmlMemBlocks()) {
27214 printf("Leak of %d blocks found in xmlValidateRoot",
27215 xmlMemBlocks() - mem_base);
27217 printf(" %d", n_ctxt);
27218 printf(" %d", n_doc);
27233 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27234 test_ret += test_xmlAddAttributeDecl();
27235 test_ret += test_xmlAddElementDecl();
27236 test_ret += test_xmlAddID();
27237 test_ret += test_xmlAddNotationDecl();
27238 test_ret += test_xmlAddRef();
27239 test_ret += test_xmlCopyAttributeTable();
27240 test_ret += test_xmlCopyDocElementContent();
27241 test_ret += test_xmlCopyElementContent();
27242 test_ret += test_xmlCopyElementTable();
27243 test_ret += test_xmlCopyEnumeration();
27244 test_ret += test_xmlCopyNotationTable();
27245 test_ret += test_xmlCreateEnumeration();
27246 test_ret += test_xmlDumpAttributeDecl();
27247 test_ret += test_xmlDumpAttributeTable();
27248 test_ret += test_xmlDumpElementDecl();
27249 test_ret += test_xmlDumpElementTable();
27250 test_ret += test_xmlDumpNotationDecl();
27251 test_ret += test_xmlDumpNotationTable();
27252 test_ret += test_xmlGetDtdAttrDesc();
27253 test_ret += test_xmlGetDtdElementDesc();
27254 test_ret += test_xmlGetDtdNotationDesc();
27255 test_ret += test_xmlGetDtdQAttrDesc();
27256 test_ret += test_xmlGetDtdQElementDesc();
27257 test_ret += test_xmlGetID();
27258 test_ret += test_xmlGetRefs();
27259 test_ret += test_xmlIsID();
27260 test_ret += test_xmlIsMixedElement();
27261 test_ret += test_xmlIsRef();
27262 test_ret += test_xmlNewDocElementContent();
27263 test_ret += test_xmlNewElementContent();
27264 test_ret += test_xmlNewValidCtxt();
27265 test_ret += test_xmlRemoveID();
27266 test_ret += test_xmlRemoveRef();
27267 test_ret += test_xmlSnprintfElementContent();
27268 test_ret += test_xmlSprintfElementContent();
27269 test_ret += test_xmlValidBuildContentModel();
27270 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27271 test_ret += test_xmlValidGetPotentialChildren();
27272 test_ret += test_xmlValidGetValidElements();
27273 test_ret += test_xmlValidNormalizeAttributeValue();
27274 test_ret += test_xmlValidateAttributeDecl();
27275 test_ret += test_xmlValidateAttributeValue();
27276 test_ret += test_xmlValidateDocument();
27277 test_ret += test_xmlValidateDocumentFinal();
27278 test_ret += test_xmlValidateDtd();
27279 test_ret += test_xmlValidateDtdFinal();
27280 test_ret += test_xmlValidateElement();
27281 test_ret += test_xmlValidateElementDecl();
27282 test_ret += test_xmlValidateNameValue();
27283 test_ret += test_xmlValidateNamesValue();
27284 test_ret += test_xmlValidateNmtokenValue();
27285 test_ret += test_xmlValidateNmtokensValue();
27286 test_ret += test_xmlValidateNotationDecl();
27287 test_ret += test_xmlValidateNotationUse();
27288 test_ret += test_xmlValidateOneAttribute();
27289 test_ret += test_xmlValidateOneElement();
27290 test_ret += test_xmlValidateOneNamespace();
27291 test_ret += test_xmlValidatePopElement();
27292 test_ret += test_xmlValidatePushCData();
27293 test_ret += test_xmlValidatePushElement();
27294 test_ret += test_xmlValidateRoot();
27297 printf("Module valid: %d errors\n", test_ret);
27302 test_xmlXIncludeNewContext(void) {
27306 /* missing type support */
27312 test_xmlXIncludeProcess(void) {
27315 #if defined(LIBXML_XINCLUDE_ENABLED)
27318 xmlDocPtr doc; /* an XML document */
27321 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27322 mem_base = xmlMemBlocks();
27323 doc = gen_xmlDocPtr(n_doc, 0);
27325 ret_val = xmlXIncludeProcess(doc);
27326 desret_int(ret_val);
27328 des_xmlDocPtr(n_doc, doc, 0);
27329 xmlResetLastError();
27330 if (mem_base != xmlMemBlocks()) {
27331 printf("Leak of %d blocks found in xmlXIncludeProcess",
27332 xmlMemBlocks() - mem_base);
27334 printf(" %d", n_doc);
27346 test_xmlXIncludeProcessFlags(void) {
27349 #if defined(LIBXML_XINCLUDE_ENABLED)
27352 xmlDocPtr doc; /* an XML document */
27354 int flags; /* a set of xmlParserOption used for parsing XML includes */
27357 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27358 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27359 mem_base = xmlMemBlocks();
27360 doc = gen_xmlDocPtr(n_doc, 0);
27361 flags = gen_int(n_flags, 1);
27363 ret_val = xmlXIncludeProcessFlags(doc, flags);
27364 desret_int(ret_val);
27366 des_xmlDocPtr(n_doc, doc, 0);
27367 des_int(n_flags, flags, 1);
27368 xmlResetLastError();
27369 if (mem_base != xmlMemBlocks()) {
27370 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27371 xmlMemBlocks() - mem_base);
27373 printf(" %d", n_doc);
27374 printf(" %d", n_flags);
27387 test_xmlXIncludeProcessFlagsData(void) {
27390 #if defined(LIBXML_XINCLUDE_ENABLED)
27393 xmlDocPtr doc; /* an XML document */
27395 int flags; /* a set of xmlParserOption used for parsing XML includes */
27397 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27400 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27401 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27402 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27403 mem_base = xmlMemBlocks();
27404 doc = gen_xmlDocPtr(n_doc, 0);
27405 flags = gen_int(n_flags, 1);
27406 data = gen_userdata(n_data, 2);
27408 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27409 desret_int(ret_val);
27411 des_xmlDocPtr(n_doc, doc, 0);
27412 des_int(n_flags, flags, 1);
27413 des_userdata(n_data, data, 2);
27414 xmlResetLastError();
27415 if (mem_base != xmlMemBlocks()) {
27416 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27417 xmlMemBlocks() - mem_base);
27419 printf(" %d", n_doc);
27420 printf(" %d", n_flags);
27421 printf(" %d", n_data);
27433 #ifdef LIBXML_XINCLUDE_ENABLED
27435 #define gen_nb_xmlXIncludeCtxtPtr 1
27436 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27439 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27445 test_xmlXIncludeProcessNode(void) {
27448 #if defined(LIBXML_XINCLUDE_ENABLED)
27451 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27453 xmlNodePtr node; /* a node in an XML document */
27456 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27457 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27458 mem_base = xmlMemBlocks();
27459 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27460 node = gen_xmlNodePtr(n_node, 1);
27462 ret_val = xmlXIncludeProcessNode(ctxt, node);
27463 desret_int(ret_val);
27465 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27466 des_xmlNodePtr(n_node, node, 1);
27467 xmlResetLastError();
27468 if (mem_base != xmlMemBlocks()) {
27469 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27470 xmlMemBlocks() - mem_base);
27472 printf(" %d", n_ctxt);
27473 printf(" %d", n_node);
27486 test_xmlXIncludeProcessTree(void) {
27489 #if defined(LIBXML_XINCLUDE_ENABLED)
27492 xmlNodePtr tree; /* a node in an XML document */
27495 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27496 mem_base = xmlMemBlocks();
27497 tree = gen_xmlNodePtr(n_tree, 0);
27499 ret_val = xmlXIncludeProcessTree(tree);
27500 desret_int(ret_val);
27502 des_xmlNodePtr(n_tree, tree, 0);
27503 xmlResetLastError();
27504 if (mem_base != xmlMemBlocks()) {
27505 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27506 xmlMemBlocks() - mem_base);
27508 printf(" %d", n_tree);
27520 test_xmlXIncludeProcessTreeFlags(void) {
27523 #if defined(LIBXML_XINCLUDE_ENABLED)
27526 xmlNodePtr tree; /* a node in an XML document */
27528 int flags; /* a set of xmlParserOption used for parsing XML includes */
27531 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27532 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27533 mem_base = xmlMemBlocks();
27534 tree = gen_xmlNodePtr(n_tree, 0);
27535 flags = gen_int(n_flags, 1);
27537 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27538 desret_int(ret_val);
27540 des_xmlNodePtr(n_tree, tree, 0);
27541 des_int(n_flags, flags, 1);
27542 xmlResetLastError();
27543 if (mem_base != xmlMemBlocks()) {
27544 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27545 xmlMemBlocks() - mem_base);
27547 printf(" %d", n_tree);
27548 printf(" %d", n_flags);
27561 test_xmlXIncludeProcessTreeFlagsData(void) {
27564 #if defined(LIBXML_XINCLUDE_ENABLED)
27567 xmlNodePtr tree; /* an XML node */
27569 int flags; /* a set of xmlParserOption used for parsing XML includes */
27571 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27574 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27575 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27576 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27577 mem_base = xmlMemBlocks();
27578 tree = gen_xmlNodePtr(n_tree, 0);
27579 flags = gen_int(n_flags, 1);
27580 data = gen_userdata(n_data, 2);
27582 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27583 desret_int(ret_val);
27585 des_xmlNodePtr(n_tree, tree, 0);
27586 des_int(n_flags, flags, 1);
27587 des_userdata(n_data, data, 2);
27588 xmlResetLastError();
27589 if (mem_base != xmlMemBlocks()) {
27590 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27591 xmlMemBlocks() - mem_base);
27593 printf(" %d", n_tree);
27594 printf(" %d", n_flags);
27595 printf(" %d", n_data);
27609 test_xmlXIncludeSetFlags(void) {
27612 #if defined(LIBXML_XINCLUDE_ENABLED)
27615 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27617 int flags; /* a set of xmlParserOption used for parsing XML includes */
27620 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27621 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27622 mem_base = xmlMemBlocks();
27623 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27624 flags = gen_int(n_flags, 1);
27626 ret_val = xmlXIncludeSetFlags(ctxt, flags);
27627 desret_int(ret_val);
27629 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27630 des_int(n_flags, flags, 1);
27631 xmlResetLastError();
27632 if (mem_base != xmlMemBlocks()) {
27633 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27634 xmlMemBlocks() - mem_base);
27636 printf(" %d", n_ctxt);
27637 printf(" %d", n_flags);
27649 test_xinclude(void) {
27652 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27653 test_ret += test_xmlXIncludeNewContext();
27654 test_ret += test_xmlXIncludeProcess();
27655 test_ret += test_xmlXIncludeProcessFlags();
27656 test_ret += test_xmlXIncludeProcessFlagsData();
27657 test_ret += test_xmlXIncludeProcessNode();
27658 test_ret += test_xmlXIncludeProcessTree();
27659 test_ret += test_xmlXIncludeProcessTreeFlags();
27660 test_ret += test_xmlXIncludeProcessTreeFlagsData();
27661 test_ret += test_xmlXIncludeSetFlags();
27664 printf("Module xinclude: %d errors\n", test_ret);
27669 test_xmlAllocOutputBuffer(void) {
27672 #if defined(LIBXML_OUTPUT_ENABLED)
27674 xmlOutputBufferPtr ret_val;
27675 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27678 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27679 mem_base = xmlMemBlocks();
27680 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27682 ret_val = xmlAllocOutputBuffer(encoder);
27683 desret_xmlOutputBufferPtr(ret_val);
27685 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27686 xmlResetLastError();
27687 if (mem_base != xmlMemBlocks()) {
27688 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27689 xmlMemBlocks() - mem_base);
27691 printf(" %d", n_encoder);
27703 test_xmlAllocParserInputBuffer(void) {
27707 xmlParserInputBufferPtr ret_val;
27708 xmlCharEncoding enc; /* the charset encoding if known */
27711 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27712 mem_base = xmlMemBlocks();
27713 enc = gen_xmlCharEncoding(n_enc, 0);
27715 ret_val = xmlAllocParserInputBuffer(enc);
27716 desret_xmlParserInputBufferPtr(ret_val);
27718 des_xmlCharEncoding(n_enc, enc, 0);
27719 xmlResetLastError();
27720 if (mem_base != xmlMemBlocks()) {
27721 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27722 xmlMemBlocks() - mem_base);
27724 printf(" %d", n_enc);
27735 test_xmlCheckFilename(void) {
27740 char * path; /* the path to check */
27743 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27744 mem_base = xmlMemBlocks();
27745 path = gen_const_char_ptr(n_path, 0);
27747 ret_val = xmlCheckFilename((const char *)path);
27748 desret_int(ret_val);
27750 des_const_char_ptr(n_path, (const char *)path, 0);
27751 xmlResetLastError();
27752 if (mem_base != xmlMemBlocks()) {
27753 printf("Leak of %d blocks found in xmlCheckFilename",
27754 xmlMemBlocks() - mem_base);
27756 printf(" %d", n_path);
27767 test_xmlCheckHTTPInput(void) {
27771 xmlParserInputPtr ret_val;
27772 xmlParserCtxtPtr ctxt; /* an XML parser context */
27774 xmlParserInputPtr ret; /* an XML parser input */
27777 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27778 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27779 mem_base = xmlMemBlocks();
27780 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27781 ret = gen_xmlParserInputPtr(n_ret, 1);
27783 ret_val = xmlCheckHTTPInput(ctxt, ret);
27784 desret_xmlParserInputPtr(ret_val);
27786 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27787 des_xmlParserInputPtr(n_ret, ret, 1);
27788 xmlResetLastError();
27789 if (mem_base != xmlMemBlocks()) {
27790 printf("Leak of %d blocks found in xmlCheckHTTPInput",
27791 xmlMemBlocks() - mem_base);
27793 printf(" %d", n_ctxt);
27794 printf(" %d", n_ret);
27806 test_xmlCleanupInputCallbacks(void) {
27811 mem_base = xmlMemBlocks();
27813 xmlCleanupInputCallbacks();
27815 xmlResetLastError();
27816 if (mem_base != xmlMemBlocks()) {
27817 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27818 xmlMemBlocks() - mem_base);
27829 test_xmlCleanupOutputCallbacks(void) {
27832 #if defined(LIBXML_OUTPUT_ENABLED)
27835 mem_base = xmlMemBlocks();
27837 xmlCleanupOutputCallbacks();
27839 xmlResetLastError();
27840 if (mem_base != xmlMemBlocks()) {
27841 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27842 xmlMemBlocks() - mem_base);
27854 test_xmlFileClose(void) {
27859 void * context; /* the I/O context */
27862 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27863 mem_base = xmlMemBlocks();
27864 context = gen_void_ptr(n_context, 0);
27866 ret_val = xmlFileClose(context);
27867 desret_int(ret_val);
27869 des_void_ptr(n_context, context, 0);
27870 xmlResetLastError();
27871 if (mem_base != xmlMemBlocks()) {
27872 printf("Leak of %d blocks found in xmlFileClose",
27873 xmlMemBlocks() - mem_base);
27875 printf(" %d", n_context);
27886 test_xmlFileMatch(void) {
27891 const char * filename; /* the URI for matching */
27894 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27895 mem_base = xmlMemBlocks();
27896 filename = gen_filepath(n_filename, 0);
27898 ret_val = xmlFileMatch(filename);
27899 desret_int(ret_val);
27901 des_filepath(n_filename, filename, 0);
27902 xmlResetLastError();
27903 if (mem_base != xmlMemBlocks()) {
27904 printf("Leak of %d blocks found in xmlFileMatch",
27905 xmlMemBlocks() - mem_base);
27907 printf(" %d", n_filename);
27918 test_xmlFileOpen(void) {
27923 const char * filename; /* the URI for matching */
27926 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27927 mem_base = xmlMemBlocks();
27928 filename = gen_filepath(n_filename, 0);
27930 ret_val = xmlFileOpen(filename);
27931 desret_void_ptr(ret_val);
27933 des_filepath(n_filename, filename, 0);
27934 xmlResetLastError();
27935 if (mem_base != xmlMemBlocks()) {
27936 printf("Leak of %d blocks found in xmlFileOpen",
27937 xmlMemBlocks() - mem_base);
27939 printf(" %d", n_filename);
27950 test_xmlFileRead(void) {
27955 void * context; /* the I/O context */
27957 char * buffer; /* where to drop data */
27959 int len; /* number of bytes to write */
27962 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27963 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27964 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27965 mem_base = xmlMemBlocks();
27966 context = gen_void_ptr(n_context, 0);
27967 buffer = gen_char_ptr(n_buffer, 1);
27968 len = gen_int(n_len, 2);
27970 ret_val = xmlFileRead(context, buffer, len);
27971 desret_int(ret_val);
27973 des_void_ptr(n_context, context, 0);
27974 des_char_ptr(n_buffer, buffer, 1);
27975 des_int(n_len, len, 2);
27976 xmlResetLastError();
27977 if (mem_base != xmlMemBlocks()) {
27978 printf("Leak of %d blocks found in xmlFileRead",
27979 xmlMemBlocks() - mem_base);
27981 printf(" %d", n_context);
27982 printf(" %d", n_buffer);
27983 printf(" %d", n_len);
27996 test_xmlIOFTPClose(void) {
27999 #if defined(LIBXML_FTP_ENABLED)
28002 void * context; /* the I/O context */
28005 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28006 mem_base = xmlMemBlocks();
28007 context = gen_void_ptr(n_context, 0);
28009 ret_val = xmlIOFTPClose(context);
28010 desret_int(ret_val);
28012 des_void_ptr(n_context, context, 0);
28013 xmlResetLastError();
28014 if (mem_base != xmlMemBlocks()) {
28015 printf("Leak of %d blocks found in xmlIOFTPClose",
28016 xmlMemBlocks() - mem_base);
28018 printf(" %d", n_context);
28030 test_xmlIOFTPMatch(void) {
28033 #if defined(LIBXML_FTP_ENABLED)
28036 const char * filename; /* the URI for matching */
28039 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28040 mem_base = xmlMemBlocks();
28041 filename = gen_filepath(n_filename, 0);
28043 ret_val = xmlIOFTPMatch(filename);
28044 desret_int(ret_val);
28046 des_filepath(n_filename, filename, 0);
28047 xmlResetLastError();
28048 if (mem_base != xmlMemBlocks()) {
28049 printf("Leak of %d blocks found in xmlIOFTPMatch",
28050 xmlMemBlocks() - mem_base);
28052 printf(" %d", n_filename);
28064 test_xmlIOFTPOpen(void) {
28067 #if defined(LIBXML_FTP_ENABLED)
28070 const char * filename; /* the URI for matching */
28073 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28074 mem_base = xmlMemBlocks();
28075 filename = gen_filepath(n_filename, 0);
28077 ret_val = xmlIOFTPOpen(filename);
28078 desret_void_ptr(ret_val);
28080 des_filepath(n_filename, filename, 0);
28081 xmlResetLastError();
28082 if (mem_base != xmlMemBlocks()) {
28083 printf("Leak of %d blocks found in xmlIOFTPOpen",
28084 xmlMemBlocks() - mem_base);
28086 printf(" %d", n_filename);
28098 test_xmlIOFTPRead(void) {
28101 #if defined(LIBXML_FTP_ENABLED)
28104 void * context; /* the I/O context */
28106 char * buffer; /* where to drop data */
28108 int len; /* number of bytes to write */
28111 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28112 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28113 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28114 mem_base = xmlMemBlocks();
28115 context = gen_void_ptr(n_context, 0);
28116 buffer = gen_char_ptr(n_buffer, 1);
28117 len = gen_int(n_len, 2);
28119 ret_val = xmlIOFTPRead(context, buffer, len);
28120 desret_int(ret_val);
28122 des_void_ptr(n_context, context, 0);
28123 des_char_ptr(n_buffer, buffer, 1);
28124 des_int(n_len, len, 2);
28125 xmlResetLastError();
28126 if (mem_base != xmlMemBlocks()) {
28127 printf("Leak of %d blocks found in xmlIOFTPRead",
28128 xmlMemBlocks() - mem_base);
28130 printf(" %d", n_context);
28131 printf(" %d", n_buffer);
28132 printf(" %d", n_len);
28146 test_xmlIOHTTPClose(void) {
28149 #if defined(LIBXML_HTTP_ENABLED)
28152 void * context; /* the I/O context */
28155 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28156 mem_base = xmlMemBlocks();
28157 context = gen_void_ptr(n_context, 0);
28159 ret_val = xmlIOHTTPClose(context);
28160 desret_int(ret_val);
28162 des_void_ptr(n_context, context, 0);
28163 xmlResetLastError();
28164 if (mem_base != xmlMemBlocks()) {
28165 printf("Leak of %d blocks found in xmlIOHTTPClose",
28166 xmlMemBlocks() - mem_base);
28168 printf(" %d", n_context);
28180 test_xmlIOHTTPMatch(void) {
28183 #if defined(LIBXML_HTTP_ENABLED)
28186 const char * filename; /* the URI for matching */
28189 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28190 mem_base = xmlMemBlocks();
28191 filename = gen_filepath(n_filename, 0);
28193 ret_val = xmlIOHTTPMatch(filename);
28194 desret_int(ret_val);
28196 des_filepath(n_filename, filename, 0);
28197 xmlResetLastError();
28198 if (mem_base != xmlMemBlocks()) {
28199 printf("Leak of %d blocks found in xmlIOHTTPMatch",
28200 xmlMemBlocks() - mem_base);
28202 printf(" %d", n_filename);
28214 test_xmlIOHTTPOpen(void) {
28217 #if defined(LIBXML_HTTP_ENABLED)
28220 const char * filename; /* the URI for matching */
28223 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28224 mem_base = xmlMemBlocks();
28225 filename = gen_filepath(n_filename, 0);
28227 ret_val = xmlIOHTTPOpen(filename);
28228 desret_xmlNanoHTTPCtxtPtr(ret_val);
28230 des_filepath(n_filename, filename, 0);
28231 xmlResetLastError();
28232 if (mem_base != xmlMemBlocks()) {
28233 printf("Leak of %d blocks found in xmlIOHTTPOpen",
28234 xmlMemBlocks() - mem_base);
28236 printf(" %d", n_filename);
28248 test_xmlIOHTTPRead(void) {
28251 #if defined(LIBXML_HTTP_ENABLED)
28254 void * context; /* the I/O context */
28256 char * buffer; /* where to drop data */
28258 int len; /* number of bytes to write */
28261 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28262 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28263 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28264 mem_base = xmlMemBlocks();
28265 context = gen_void_ptr(n_context, 0);
28266 buffer = gen_char_ptr(n_buffer, 1);
28267 len = gen_int(n_len, 2);
28269 ret_val = xmlIOHTTPRead(context, buffer, len);
28270 desret_int(ret_val);
28272 des_void_ptr(n_context, context, 0);
28273 des_char_ptr(n_buffer, buffer, 1);
28274 des_int(n_len, len, 2);
28275 xmlResetLastError();
28276 if (mem_base != xmlMemBlocks()) {
28277 printf("Leak of %d blocks found in xmlIOHTTPRead",
28278 xmlMemBlocks() - mem_base);
28280 printf(" %d", n_context);
28281 printf(" %d", n_buffer);
28282 printf(" %d", n_len);
28296 test_xmlNoNetExternalEntityLoader(void) {
28300 xmlParserInputPtr ret_val;
28301 const char * URL; /* the URL for the entity to load */
28303 char * ID; /* the System ID for the entity to load */
28305 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28308 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28309 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28310 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28311 mem_base = xmlMemBlocks();
28312 URL = gen_filepath(n_URL, 0);
28313 ID = gen_const_char_ptr(n_ID, 1);
28314 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28316 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28317 desret_xmlParserInputPtr(ret_val);
28319 des_filepath(n_URL, URL, 0);
28320 des_const_char_ptr(n_ID, (const char *)ID, 1);
28321 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28322 xmlResetLastError();
28323 if (mem_base != xmlMemBlocks()) {
28324 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28325 xmlMemBlocks() - mem_base);
28327 printf(" %d", n_URL);
28328 printf(" %d", n_ID);
28329 printf(" %d", n_ctxt);
28342 test_xmlNormalizeWindowsPath(void) {
28347 xmlChar * path; /* the input file path */
28350 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28351 mem_base = xmlMemBlocks();
28352 path = gen_const_xmlChar_ptr(n_path, 0);
28354 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28355 desret_xmlChar_ptr(ret_val);
28357 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28358 xmlResetLastError();
28359 if (mem_base != xmlMemBlocks()) {
28360 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28361 xmlMemBlocks() - mem_base);
28363 printf(" %d", n_path);
28374 test_xmlOutputBufferCreateBuffer(void) {
28377 #if defined(LIBXML_OUTPUT_ENABLED)
28379 xmlOutputBufferPtr ret_val;
28380 xmlBufferPtr buffer; /* a xmlBufferPtr */
28382 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28385 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28386 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28387 mem_base = xmlMemBlocks();
28388 buffer = gen_xmlBufferPtr(n_buffer, 0);
28389 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28391 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28392 desret_xmlOutputBufferPtr(ret_val);
28394 des_xmlBufferPtr(n_buffer, buffer, 0);
28395 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28396 xmlResetLastError();
28397 if (mem_base != xmlMemBlocks()) {
28398 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28399 xmlMemBlocks() - mem_base);
28401 printf(" %d", n_buffer);
28402 printf(" %d", n_encoder);
28415 test_xmlOutputBufferCreateFd(void) {
28418 #if defined(LIBXML_OUTPUT_ENABLED)
28420 xmlOutputBufferPtr ret_val;
28421 int fd; /* a file descriptor number */
28423 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28426 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28427 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28428 mem_base = xmlMemBlocks();
28429 fd = gen_int(n_fd, 0);
28430 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28432 ret_val = xmlOutputBufferCreateFd(fd, encoder);
28433 desret_xmlOutputBufferPtr(ret_val);
28435 des_int(n_fd, fd, 0);
28436 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28437 xmlResetLastError();
28438 if (mem_base != xmlMemBlocks()) {
28439 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28440 xmlMemBlocks() - mem_base);
28442 printf(" %d", n_fd);
28443 printf(" %d", n_encoder);
28456 test_xmlOutputBufferCreateFile(void) {
28459 #if defined(LIBXML_OUTPUT_ENABLED)
28461 xmlOutputBufferPtr ret_val;
28462 FILE * file; /* a FILE* */
28464 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28467 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28468 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28469 mem_base = xmlMemBlocks();
28470 file = gen_FILE_ptr(n_file, 0);
28471 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28473 ret_val = xmlOutputBufferCreateFile(file, encoder);
28474 desret_xmlOutputBufferPtr(ret_val);
28476 des_FILE_ptr(n_file, file, 0);
28477 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28478 xmlResetLastError();
28479 if (mem_base != xmlMemBlocks()) {
28480 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28481 xmlMemBlocks() - mem_base);
28483 printf(" %d", n_file);
28484 printf(" %d", n_encoder);
28497 test_xmlOutputBufferCreateFilename(void) {
28500 #if defined(LIBXML_OUTPUT_ENABLED)
28502 xmlOutputBufferPtr ret_val;
28503 const char * URI; /* a C string containing the URI or filename */
28505 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28507 int compression; /* the compression ration (0 none, 9 max). */
28510 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28511 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28512 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28513 mem_base = xmlMemBlocks();
28514 URI = gen_fileoutput(n_URI, 0);
28515 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28516 compression = gen_int(n_compression, 2);
28518 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28519 desret_xmlOutputBufferPtr(ret_val);
28521 des_fileoutput(n_URI, URI, 0);
28522 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28523 des_int(n_compression, compression, 2);
28524 xmlResetLastError();
28525 if (mem_base != xmlMemBlocks()) {
28526 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28527 xmlMemBlocks() - mem_base);
28529 printf(" %d", n_URI);
28530 printf(" %d", n_encoder);
28531 printf(" %d", n_compression);
28545 test_xmlOutputBufferFlush(void) {
28548 #if defined(LIBXML_OUTPUT_ENABLED)
28551 xmlOutputBufferPtr out; /* a buffered output */
28554 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28555 mem_base = xmlMemBlocks();
28556 out = gen_xmlOutputBufferPtr(n_out, 0);
28558 ret_val = xmlOutputBufferFlush(out);
28559 desret_int(ret_val);
28561 des_xmlOutputBufferPtr(n_out, out, 0);
28562 xmlResetLastError();
28563 if (mem_base != xmlMemBlocks()) {
28564 printf("Leak of %d blocks found in xmlOutputBufferFlush",
28565 xmlMemBlocks() - mem_base);
28567 printf(" %d", n_out);
28579 test_xmlOutputBufferGetContent(void) {
28582 #if defined(LIBXML_OUTPUT_ENABLED)
28584 const xmlChar * ret_val;
28585 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28588 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28589 mem_base = xmlMemBlocks();
28590 out = gen_xmlOutputBufferPtr(n_out, 0);
28592 ret_val = xmlOutputBufferGetContent(out);
28593 desret_const_xmlChar_ptr(ret_val);
28595 des_xmlOutputBufferPtr(n_out, out, 0);
28596 xmlResetLastError();
28597 if (mem_base != xmlMemBlocks()) {
28598 printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28599 xmlMemBlocks() - mem_base);
28601 printf(" %d", n_out);
28613 test_xmlOutputBufferGetSize(void) {
28617 /* missing type support */
28623 test_xmlOutputBufferWrite(void) {
28626 #if defined(LIBXML_OUTPUT_ENABLED)
28629 xmlOutputBufferPtr out; /* a buffered parser output */
28631 int len; /* the size in bytes of the array. */
28633 char * buf; /* an char array */
28636 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28637 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28638 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28639 mem_base = xmlMemBlocks();
28640 out = gen_xmlOutputBufferPtr(n_out, 0);
28641 len = gen_int(n_len, 1);
28642 buf = gen_const_char_ptr(n_buf, 2);
28644 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28645 desret_int(ret_val);
28647 des_xmlOutputBufferPtr(n_out, out, 0);
28648 des_int(n_len, len, 1);
28649 des_const_char_ptr(n_buf, (const char *)buf, 2);
28650 xmlResetLastError();
28651 if (mem_base != xmlMemBlocks()) {
28652 printf("Leak of %d blocks found in xmlOutputBufferWrite",
28653 xmlMemBlocks() - mem_base);
28655 printf(" %d", n_out);
28656 printf(" %d", n_len);
28657 printf(" %d", n_buf);
28671 test_xmlOutputBufferWriteEscape(void) {
28675 /* missing type support */
28681 test_xmlOutputBufferWriteString(void) {
28684 #if defined(LIBXML_OUTPUT_ENABLED)
28687 xmlOutputBufferPtr out; /* a buffered parser output */
28689 char * str; /* a zero terminated C string */
28692 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28693 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28694 mem_base = xmlMemBlocks();
28695 out = gen_xmlOutputBufferPtr(n_out, 0);
28696 str = gen_const_char_ptr(n_str, 1);
28698 ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28699 desret_int(ret_val);
28701 des_xmlOutputBufferPtr(n_out, out, 0);
28702 des_const_char_ptr(n_str, (const char *)str, 1);
28703 xmlResetLastError();
28704 if (mem_base != xmlMemBlocks()) {
28705 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28706 xmlMemBlocks() - mem_base);
28708 printf(" %d", n_out);
28709 printf(" %d", n_str);
28722 test_xmlParserGetDirectory(void) {
28726 /* missing type support */
28732 test_xmlParserInputBufferCreateFd(void) {
28736 xmlParserInputBufferPtr ret_val;
28737 int fd; /* a file descriptor number */
28739 xmlCharEncoding enc; /* the charset encoding if known */
28742 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28743 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28744 mem_base = xmlMemBlocks();
28745 fd = gen_int(n_fd, 0);
28746 enc = gen_xmlCharEncoding(n_enc, 1);
28747 if (fd >= 0) fd = -1;
28749 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28750 desret_xmlParserInputBufferPtr(ret_val);
28752 des_int(n_fd, fd, 0);
28753 des_xmlCharEncoding(n_enc, enc, 1);
28754 xmlResetLastError();
28755 if (mem_base != xmlMemBlocks()) {
28756 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28757 xmlMemBlocks() - mem_base);
28759 printf(" %d", n_fd);
28760 printf(" %d", n_enc);
28772 test_xmlParserInputBufferCreateFile(void) {
28776 xmlParserInputBufferPtr ret_val;
28777 FILE * file; /* a FILE* */
28779 xmlCharEncoding enc; /* the charset encoding if known */
28782 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28783 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28784 mem_base = xmlMemBlocks();
28785 file = gen_FILE_ptr(n_file, 0);
28786 enc = gen_xmlCharEncoding(n_enc, 1);
28788 ret_val = xmlParserInputBufferCreateFile(file, enc);
28789 desret_xmlParserInputBufferPtr(ret_val);
28791 des_FILE_ptr(n_file, file, 0);
28792 des_xmlCharEncoding(n_enc, enc, 1);
28793 xmlResetLastError();
28794 if (mem_base != xmlMemBlocks()) {
28795 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28796 xmlMemBlocks() - mem_base);
28798 printf(" %d", n_file);
28799 printf(" %d", n_enc);
28811 test_xmlParserInputBufferCreateFilename(void) {
28815 xmlParserInputBufferPtr ret_val;
28816 const char * URI; /* a C string containing the URI or filename */
28818 xmlCharEncoding enc; /* the charset encoding if known */
28821 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28822 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28823 mem_base = xmlMemBlocks();
28824 URI = gen_fileoutput(n_URI, 0);
28825 enc = gen_xmlCharEncoding(n_enc, 1);
28827 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28828 desret_xmlParserInputBufferPtr(ret_val);
28830 des_fileoutput(n_URI, URI, 0);
28831 des_xmlCharEncoding(n_enc, enc, 1);
28832 xmlResetLastError();
28833 if (mem_base != xmlMemBlocks()) {
28834 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28835 xmlMemBlocks() - mem_base);
28837 printf(" %d", n_URI);
28838 printf(" %d", n_enc);
28850 test_xmlParserInputBufferCreateMem(void) {
28854 xmlParserInputBufferPtr ret_val;
28855 char * mem; /* the memory input */
28857 int size; /* the length of the memory block */
28859 xmlCharEncoding enc; /* the charset encoding if known */
28862 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28863 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28864 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28865 mem_base = xmlMemBlocks();
28866 mem = gen_const_char_ptr(n_mem, 0);
28867 size = gen_int(n_size, 1);
28868 enc = gen_xmlCharEncoding(n_enc, 2);
28870 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28871 desret_xmlParserInputBufferPtr(ret_val);
28873 des_const_char_ptr(n_mem, (const char *)mem, 0);
28874 des_int(n_size, size, 1);
28875 des_xmlCharEncoding(n_enc, enc, 2);
28876 xmlResetLastError();
28877 if (mem_base != xmlMemBlocks()) {
28878 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28879 xmlMemBlocks() - mem_base);
28881 printf(" %d", n_mem);
28882 printf(" %d", n_size);
28883 printf(" %d", n_enc);
28896 test_xmlParserInputBufferCreateStatic(void) {
28900 xmlParserInputBufferPtr ret_val;
28901 char * mem; /* the memory input */
28903 int size; /* the length of the memory block */
28905 xmlCharEncoding enc; /* the charset encoding if known */
28908 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28909 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28910 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28911 mem_base = xmlMemBlocks();
28912 mem = gen_const_char_ptr(n_mem, 0);
28913 size = gen_int(n_size, 1);
28914 enc = gen_xmlCharEncoding(n_enc, 2);
28916 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28917 desret_xmlParserInputBufferPtr(ret_val);
28919 des_const_char_ptr(n_mem, (const char *)mem, 0);
28920 des_int(n_size, size, 1);
28921 des_xmlCharEncoding(n_enc, enc, 2);
28922 xmlResetLastError();
28923 if (mem_base != xmlMemBlocks()) {
28924 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28925 xmlMemBlocks() - mem_base);
28927 printf(" %d", n_mem);
28928 printf(" %d", n_size);
28929 printf(" %d", n_enc);
28942 test_xmlParserInputBufferGrow(void) {
28947 xmlParserInputBufferPtr in; /* a buffered parser input */
28949 int len; /* indicative value of the amount of chars to read */
28952 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28953 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28954 mem_base = xmlMemBlocks();
28955 in = gen_xmlParserInputBufferPtr(n_in, 0);
28956 len = gen_int(n_len, 1);
28958 ret_val = xmlParserInputBufferGrow(in, len);
28959 desret_int(ret_val);
28961 des_xmlParserInputBufferPtr(n_in, in, 0);
28962 des_int(n_len, len, 1);
28963 xmlResetLastError();
28964 if (mem_base != xmlMemBlocks()) {
28965 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28966 xmlMemBlocks() - mem_base);
28968 printf(" %d", n_in);
28969 printf(" %d", n_len);
28981 test_xmlParserInputBufferPush(void) {
28986 xmlParserInputBufferPtr in; /* a buffered parser input */
28988 int len; /* the size in bytes of the array. */
28990 char * buf; /* an char array */
28993 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28994 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28995 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28996 mem_base = xmlMemBlocks();
28997 in = gen_xmlParserInputBufferPtr(n_in, 0);
28998 len = gen_int(n_len, 1);
28999 buf = gen_const_char_ptr(n_buf, 2);
29001 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29002 desret_int(ret_val);
29004 des_xmlParserInputBufferPtr(n_in, in, 0);
29005 des_int(n_len, len, 1);
29006 des_const_char_ptr(n_buf, (const char *)buf, 2);
29007 xmlResetLastError();
29008 if (mem_base != xmlMemBlocks()) {
29009 printf("Leak of %d blocks found in xmlParserInputBufferPush",
29010 xmlMemBlocks() - mem_base);
29012 printf(" %d", n_in);
29013 printf(" %d", n_len);
29014 printf(" %d", n_buf);
29027 test_xmlParserInputBufferRead(void) {
29032 xmlParserInputBufferPtr in; /* a buffered parser input */
29034 int len; /* indicative value of the amount of chars to read */
29037 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29038 for (n_len = 0;n_len < gen_nb_int;n_len++) {
29039 mem_base = xmlMemBlocks();
29040 in = gen_xmlParserInputBufferPtr(n_in, 0);
29041 len = gen_int(n_len, 1);
29043 ret_val = xmlParserInputBufferRead(in, len);
29044 desret_int(ret_val);
29046 des_xmlParserInputBufferPtr(n_in, in, 0);
29047 des_int(n_len, len, 1);
29048 xmlResetLastError();
29049 if (mem_base != xmlMemBlocks()) {
29050 printf("Leak of %d blocks found in xmlParserInputBufferRead",
29051 xmlMemBlocks() - mem_base);
29053 printf(" %d", n_in);
29054 printf(" %d", n_len);
29066 test_xmlPopInputCallbacks(void) {
29072 mem_base = xmlMemBlocks();
29074 ret_val = xmlPopInputCallbacks();
29075 desret_int(ret_val);
29077 xmlResetLastError();
29078 if (mem_base != xmlMemBlocks()) {
29079 printf("Leak of %d blocks found in xmlPopInputCallbacks",
29080 xmlMemBlocks() - mem_base);
29091 test_xmlRegisterDefaultInputCallbacks(void) {
29096 mem_base = xmlMemBlocks();
29098 xmlRegisterDefaultInputCallbacks();
29100 xmlResetLastError();
29101 if (mem_base != xmlMemBlocks()) {
29102 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29103 xmlMemBlocks() - mem_base);
29114 test_xmlRegisterDefaultOutputCallbacks(void) {
29117 #if defined(LIBXML_OUTPUT_ENABLED)
29120 mem_base = xmlMemBlocks();
29122 xmlRegisterDefaultOutputCallbacks();
29124 xmlResetLastError();
29125 if (mem_base != xmlMemBlocks()) {
29126 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29127 xmlMemBlocks() - mem_base);
29139 test_xmlRegisterHTTPPostCallbacks(void) {
29142 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29145 mem_base = xmlMemBlocks();
29147 xmlRegisterHTTPPostCallbacks();
29149 xmlResetLastError();
29150 if (mem_base != xmlMemBlocks()) {
29151 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29152 xmlMemBlocks() - mem_base);
29166 if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29167 test_ret += test_xmlAllocOutputBuffer();
29168 test_ret += test_xmlAllocParserInputBuffer();
29169 test_ret += test_xmlCheckFilename();
29170 test_ret += test_xmlCheckHTTPInput();
29171 test_ret += test_xmlCleanupInputCallbacks();
29172 test_ret += test_xmlCleanupOutputCallbacks();
29173 test_ret += test_xmlFileClose();
29174 test_ret += test_xmlFileMatch();
29175 test_ret += test_xmlFileOpen();
29176 test_ret += test_xmlFileRead();
29177 test_ret += test_xmlIOFTPClose();
29178 test_ret += test_xmlIOFTPMatch();
29179 test_ret += test_xmlIOFTPOpen();
29180 test_ret += test_xmlIOFTPRead();
29181 test_ret += test_xmlIOHTTPClose();
29182 test_ret += test_xmlIOHTTPMatch();
29183 test_ret += test_xmlIOHTTPOpen();
29184 test_ret += test_xmlIOHTTPRead();
29185 test_ret += test_xmlNoNetExternalEntityLoader();
29186 test_ret += test_xmlNormalizeWindowsPath();
29187 test_ret += test_xmlOutputBufferCreateBuffer();
29188 test_ret += test_xmlOutputBufferCreateFd();
29189 test_ret += test_xmlOutputBufferCreateFile();
29190 test_ret += test_xmlOutputBufferCreateFilename();
29191 test_ret += test_xmlOutputBufferFlush();
29192 test_ret += test_xmlOutputBufferGetContent();
29193 test_ret += test_xmlOutputBufferGetSize();
29194 test_ret += test_xmlOutputBufferWrite();
29195 test_ret += test_xmlOutputBufferWriteEscape();
29196 test_ret += test_xmlOutputBufferWriteString();
29197 test_ret += test_xmlParserGetDirectory();
29198 test_ret += test_xmlParserInputBufferCreateFd();
29199 test_ret += test_xmlParserInputBufferCreateFile();
29200 test_ret += test_xmlParserInputBufferCreateFilename();
29201 test_ret += test_xmlParserInputBufferCreateMem();
29202 test_ret += test_xmlParserInputBufferCreateStatic();
29203 test_ret += test_xmlParserInputBufferGrow();
29204 test_ret += test_xmlParserInputBufferPush();
29205 test_ret += test_xmlParserInputBufferRead();
29206 test_ret += test_xmlPopInputCallbacks();
29207 test_ret += test_xmlRegisterDefaultInputCallbacks();
29208 test_ret += test_xmlRegisterDefaultOutputCallbacks();
29209 test_ret += test_xmlRegisterHTTPPostCallbacks();
29212 printf("Module xmlIO: %d errors\n", test_ret);
29215 #ifdef LIBXML_AUTOMATA_ENABLED
29217 #define gen_nb_xmlAutomataPtr 1
29218 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29221 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29227 test_xmlAutomataCompile(void) {
29231 /* missing type support */
29237 test_xmlAutomataGetInitState(void) {
29241 /* missing type support */
29247 test_xmlAutomataIsDeterminist(void) {
29250 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29253 xmlAutomataPtr am; /* an automata */
29256 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29257 mem_base = xmlMemBlocks();
29258 am = gen_xmlAutomataPtr(n_am, 0);
29260 ret_val = xmlAutomataIsDeterminist(am);
29261 desret_int(ret_val);
29263 des_xmlAutomataPtr(n_am, am, 0);
29264 xmlResetLastError();
29265 if (mem_base != xmlMemBlocks()) {
29266 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29267 xmlMemBlocks() - mem_base);
29269 printf(" %d", n_am);
29279 #ifdef LIBXML_AUTOMATA_ENABLED
29281 #define gen_nb_xmlAutomataStatePtr 1
29282 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29285 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29291 test_xmlAutomataNewAllTrans(void) {
29295 /* missing type support */
29301 test_xmlAutomataNewCountTrans(void) {
29305 /* missing type support */
29311 test_xmlAutomataNewCountTrans2(void) {
29315 /* missing type support */
29321 test_xmlAutomataNewCountedTrans(void) {
29325 /* missing type support */
29331 test_xmlAutomataNewCounter(void) {
29334 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29337 xmlAutomataPtr am; /* an automata */
29339 int min; /* the minimal value on the counter */
29341 int max; /* the maximal value on the counter */
29344 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29345 for (n_min = 0;n_min < gen_nb_int;n_min++) {
29346 for (n_max = 0;n_max < gen_nb_int;n_max++) {
29347 mem_base = xmlMemBlocks();
29348 am = gen_xmlAutomataPtr(n_am, 0);
29349 min = gen_int(n_min, 1);
29350 max = gen_int(n_max, 2);
29352 ret_val = xmlAutomataNewCounter(am, min, max);
29353 desret_int(ret_val);
29355 des_xmlAutomataPtr(n_am, am, 0);
29356 des_int(n_min, min, 1);
29357 des_int(n_max, max, 2);
29358 xmlResetLastError();
29359 if (mem_base != xmlMemBlocks()) {
29360 printf("Leak of %d blocks found in xmlAutomataNewCounter",
29361 xmlMemBlocks() - mem_base);
29363 printf(" %d", n_am);
29364 printf(" %d", n_min);
29365 printf(" %d", n_max);
29379 test_xmlAutomataNewCounterTrans(void) {
29383 /* missing type support */
29389 test_xmlAutomataNewEpsilon(void) {
29393 /* missing type support */
29399 test_xmlAutomataNewNegTrans(void) {
29403 /* missing type support */
29409 test_xmlAutomataNewOnceTrans(void) {
29413 /* missing type support */
29419 test_xmlAutomataNewOnceTrans2(void) {
29423 /* missing type support */
29429 test_xmlAutomataNewState(void) {
29433 /* missing type support */
29439 test_xmlAutomataNewTransition(void) {
29443 /* missing type support */
29449 test_xmlAutomataNewTransition2(void) {
29453 /* missing type support */
29459 test_xmlAutomataSetFinalState(void) {
29462 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29465 xmlAutomataPtr am; /* an automata */
29467 xmlAutomataStatePtr state; /* a state in this automata */
29470 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29471 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29472 mem_base = xmlMemBlocks();
29473 am = gen_xmlAutomataPtr(n_am, 0);
29474 state = gen_xmlAutomataStatePtr(n_state, 1);
29476 ret_val = xmlAutomataSetFinalState(am, state);
29477 desret_int(ret_val);
29479 des_xmlAutomataPtr(n_am, am, 0);
29480 des_xmlAutomataStatePtr(n_state, state, 1);
29481 xmlResetLastError();
29482 if (mem_base != xmlMemBlocks()) {
29483 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29484 xmlMemBlocks() - mem_base);
29486 printf(" %d", n_am);
29487 printf(" %d", n_state);
29500 test_xmlNewAutomata(void) {
29504 /* missing type support */
29509 test_xmlautomata(void) {
29512 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29513 test_ret += test_xmlAutomataCompile();
29514 test_ret += test_xmlAutomataGetInitState();
29515 test_ret += test_xmlAutomataIsDeterminist();
29516 test_ret += test_xmlAutomataNewAllTrans();
29517 test_ret += test_xmlAutomataNewCountTrans();
29518 test_ret += test_xmlAutomataNewCountTrans2();
29519 test_ret += test_xmlAutomataNewCountedTrans();
29520 test_ret += test_xmlAutomataNewCounter();
29521 test_ret += test_xmlAutomataNewCounterTrans();
29522 test_ret += test_xmlAutomataNewEpsilon();
29523 test_ret += test_xmlAutomataNewNegTrans();
29524 test_ret += test_xmlAutomataNewOnceTrans();
29525 test_ret += test_xmlAutomataNewOnceTrans2();
29526 test_ret += test_xmlAutomataNewState();
29527 test_ret += test_xmlAutomataNewTransition();
29528 test_ret += test_xmlAutomataNewTransition2();
29529 test_ret += test_xmlAutomataSetFinalState();
29530 test_ret += test_xmlNewAutomata();
29533 printf("Module xmlautomata: %d errors\n", test_ret);
29537 #define gen_nb_xmlGenericErrorFunc_ptr 1
29538 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29541 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29545 test_initGenericErrorDefaultFunc(void) {
29549 xmlGenericErrorFunc * handler; /* the handler */
29552 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29553 mem_base = xmlMemBlocks();
29554 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29556 initGenericErrorDefaultFunc(handler);
29558 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29559 xmlResetLastError();
29560 if (mem_base != xmlMemBlocks()) {
29561 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29562 xmlMemBlocks() - mem_base);
29564 printf(" %d", n_handler);
29574 #define gen_nb_xmlErrorPtr 1
29575 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29578 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29582 test_xmlCopyError(void) {
29587 xmlErrorPtr from; /* a source error */
29589 xmlErrorPtr to; /* a target error */
29592 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29593 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29594 mem_base = xmlMemBlocks();
29595 from = gen_xmlErrorPtr(n_from, 0);
29596 to = gen_xmlErrorPtr(n_to, 1);
29598 ret_val = xmlCopyError(from, to);
29599 desret_int(ret_val);
29601 des_xmlErrorPtr(n_from, from, 0);
29602 des_xmlErrorPtr(n_to, to, 1);
29603 xmlResetLastError();
29604 if (mem_base != xmlMemBlocks()) {
29605 printf("Leak of %d blocks found in xmlCopyError",
29606 xmlMemBlocks() - mem_base);
29608 printf(" %d", n_from);
29609 printf(" %d", n_to);
29621 test_xmlCtxtGetLastError(void) {
29625 /* missing type support */
29631 test_xmlCtxtResetLastError(void) {
29635 void * ctx; /* an XML parser context */
29638 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29639 mem_base = xmlMemBlocks();
29640 ctx = gen_void_ptr(n_ctx, 0);
29642 xmlCtxtResetLastError(ctx);
29644 des_void_ptr(n_ctx, ctx, 0);
29645 xmlResetLastError();
29646 if (mem_base != xmlMemBlocks()) {
29647 printf("Leak of %d blocks found in xmlCtxtResetLastError",
29648 xmlMemBlocks() - mem_base);
29650 printf(" %d", n_ctx);
29661 test_xmlGetLastError(void) {
29665 /* missing type support */
29671 test_xmlParserError(void) {
29675 /* missing type support */
29681 test_xmlParserPrintFileContext(void) {
29685 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29688 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29689 mem_base = xmlMemBlocks();
29690 input = gen_xmlParserInputPtr(n_input, 0);
29692 xmlParserPrintFileContext(input);
29694 des_xmlParserInputPtr(n_input, input, 0);
29695 xmlResetLastError();
29696 if (mem_base != xmlMemBlocks()) {
29697 printf("Leak of %d blocks found in xmlParserPrintFileContext",
29698 xmlMemBlocks() - mem_base);
29700 printf(" %d", n_input);
29711 test_xmlParserPrintFileInfo(void) {
29715 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29718 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29719 mem_base = xmlMemBlocks();
29720 input = gen_xmlParserInputPtr(n_input, 0);
29722 xmlParserPrintFileInfo(input);
29724 des_xmlParserInputPtr(n_input, input, 0);
29725 xmlResetLastError();
29726 if (mem_base != xmlMemBlocks()) {
29727 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29728 xmlMemBlocks() - mem_base);
29730 printf(" %d", n_input);
29741 test_xmlParserValidityError(void) {
29745 /* missing type support */
29751 test_xmlParserValidityWarning(void) {
29755 /* missing type support */
29761 test_xmlParserWarning(void) {
29765 /* missing type support */
29771 test_xmlResetError(void) {
29775 xmlErrorPtr err; /* pointer to the error. */
29778 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29779 mem_base = xmlMemBlocks();
29780 err = gen_xmlErrorPtr(n_err, 0);
29782 xmlResetError(err);
29784 des_xmlErrorPtr(n_err, err, 0);
29785 xmlResetLastError();
29786 if (mem_base != xmlMemBlocks()) {
29787 printf("Leak of %d blocks found in xmlResetError",
29788 xmlMemBlocks() - mem_base);
29790 printf(" %d", n_err);
29801 test_xmlResetLastError(void) {
29806 xmlResetLastError();
29808 xmlResetLastError();
29816 test_xmlSetGenericErrorFunc(void) {
29820 /* missing type support */
29826 test_xmlSetStructuredErrorFunc(void) {
29830 /* missing type support */
29835 test_xmlerror(void) {
29838 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29839 test_ret += test_initGenericErrorDefaultFunc();
29840 test_ret += test_xmlCopyError();
29841 test_ret += test_xmlCtxtGetLastError();
29842 test_ret += test_xmlCtxtResetLastError();
29843 test_ret += test_xmlGetLastError();
29844 test_ret += test_xmlParserError();
29845 test_ret += test_xmlParserPrintFileContext();
29846 test_ret += test_xmlParserPrintFileInfo();
29847 test_ret += test_xmlParserValidityError();
29848 test_ret += test_xmlParserValidityWarning();
29849 test_ret += test_xmlParserWarning();
29850 test_ret += test_xmlResetError();
29851 test_ret += test_xmlResetLastError();
29852 test_ret += test_xmlSetGenericErrorFunc();
29853 test_ret += test_xmlSetStructuredErrorFunc();
29856 printf("Module xmlerror: %d errors\n", test_ret);
29859 #ifdef LIBXML_MODULES_ENABLED
29861 #define gen_nb_xmlModulePtr 1
29862 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29865 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29871 test_xmlModuleClose(void) {
29874 #if defined(LIBXML_MODULES_ENABLED)
29877 xmlModulePtr module; /* the module handle */
29880 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29881 mem_base = xmlMemBlocks();
29882 module = gen_xmlModulePtr(n_module, 0);
29884 ret_val = xmlModuleClose(module);
29885 desret_int(ret_val);
29887 des_xmlModulePtr(n_module, module, 0);
29888 xmlResetLastError();
29889 if (mem_base != xmlMemBlocks()) {
29890 printf("Leak of %d blocks found in xmlModuleClose",
29891 xmlMemBlocks() - mem_base);
29893 printf(" %d", n_module);
29905 test_xmlModuleOpen(void) {
29909 /* missing type support */
29915 test_xmlModuleSymbol(void) {
29918 #if defined(LIBXML_MODULES_ENABLED)
29921 xmlModulePtr module; /* the module */
29923 char * name; /* the name of the symbol */
29925 void ** symbol; /* the resulting symbol address */
29928 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29929 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29930 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29931 mem_base = xmlMemBlocks();
29932 module = gen_xmlModulePtr(n_module, 0);
29933 name = gen_const_char_ptr(n_name, 1);
29934 symbol = gen_void_ptr_ptr(n_symbol, 2);
29936 ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29937 desret_int(ret_val);
29939 des_xmlModulePtr(n_module, module, 0);
29940 des_const_char_ptr(n_name, (const char *)name, 1);
29941 des_void_ptr_ptr(n_symbol, symbol, 2);
29942 xmlResetLastError();
29943 if (mem_base != xmlMemBlocks()) {
29944 printf("Leak of %d blocks found in xmlModuleSymbol",
29945 xmlMemBlocks() - mem_base);
29947 printf(" %d", n_module);
29948 printf(" %d", n_name);
29949 printf(" %d", n_symbol);
29962 test_xmlmodule(void) {
29965 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29966 test_ret += test_xmlModuleClose();
29967 test_ret += test_xmlModuleOpen();
29968 test_ret += test_xmlModuleSymbol();
29971 printf("Module xmlmodule: %d errors\n", test_ret);
29976 test_xmlNewTextReader(void) {
29979 #if defined(LIBXML_READER_ENABLED)
29981 xmlTextReaderPtr ret_val;
29982 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29984 const char * URI; /* the URI information for the source if available */
29987 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29988 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29989 mem_base = xmlMemBlocks();
29990 input = gen_xmlParserInputBufferPtr(n_input, 0);
29991 URI = gen_filepath(n_URI, 1);
29993 ret_val = xmlNewTextReader(input, URI);
29994 desret_xmlTextReaderPtr(ret_val);
29996 des_xmlParserInputBufferPtr(n_input, input, 0);
29997 des_filepath(n_URI, URI, 1);
29998 xmlResetLastError();
29999 if (mem_base != xmlMemBlocks()) {
30000 printf("Leak of %d blocks found in xmlNewTextReader",
30001 xmlMemBlocks() - mem_base);
30003 printf(" %d", n_input);
30004 printf(" %d", n_URI);
30017 test_xmlNewTextReaderFilename(void) {
30020 #if defined(LIBXML_READER_ENABLED)
30022 xmlTextReaderPtr ret_val;
30023 const char * URI; /* the URI of the resource to process */
30026 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30027 mem_base = xmlMemBlocks();
30028 URI = gen_filepath(n_URI, 0);
30030 ret_val = xmlNewTextReaderFilename(URI);
30031 desret_xmlTextReaderPtr(ret_val);
30033 des_filepath(n_URI, URI, 0);
30034 xmlResetLastError();
30035 if (mem_base != xmlMemBlocks()) {
30036 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30037 xmlMemBlocks() - mem_base);
30039 printf(" %d", n_URI);
30051 test_xmlReaderForDoc(void) {
30054 #if defined(LIBXML_READER_ENABLED)
30056 xmlTextReaderPtr ret_val;
30057 xmlChar * cur; /* a pointer to a zero terminated string */
30059 const char * URL; /* the base URL to use for the document */
30061 char * encoding; /* the document encoding, or NULL */
30063 int options; /* a combination of xmlParserOption */
30066 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30067 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30068 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30069 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30070 mem_base = xmlMemBlocks();
30071 cur = gen_const_xmlChar_ptr(n_cur, 0);
30072 URL = gen_filepath(n_URL, 1);
30073 encoding = gen_const_char_ptr(n_encoding, 2);
30074 options = gen_parseroptions(n_options, 3);
30076 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30077 desret_xmlTextReaderPtr(ret_val);
30079 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30080 des_filepath(n_URL, URL, 1);
30081 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30082 des_parseroptions(n_options, options, 3);
30083 xmlResetLastError();
30084 if (mem_base != xmlMemBlocks()) {
30085 printf("Leak of %d blocks found in xmlReaderForDoc",
30086 xmlMemBlocks() - mem_base);
30088 printf(" %d", n_cur);
30089 printf(" %d", n_URL);
30090 printf(" %d", n_encoding);
30091 printf(" %d", n_options);
30106 test_xmlReaderForFile(void) {
30109 #if defined(LIBXML_READER_ENABLED)
30111 xmlTextReaderPtr ret_val;
30112 const char * filename; /* a file or URL */
30114 char * encoding; /* the document encoding, or NULL */
30116 int options; /* a combination of xmlParserOption */
30119 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30120 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30121 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30122 mem_base = xmlMemBlocks();
30123 filename = gen_filepath(n_filename, 0);
30124 encoding = gen_const_char_ptr(n_encoding, 1);
30125 options = gen_parseroptions(n_options, 2);
30127 ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30128 desret_xmlTextReaderPtr(ret_val);
30130 des_filepath(n_filename, filename, 0);
30131 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30132 des_parseroptions(n_options, options, 2);
30133 xmlResetLastError();
30134 if (mem_base != xmlMemBlocks()) {
30135 printf("Leak of %d blocks found in xmlReaderForFile",
30136 xmlMemBlocks() - mem_base);
30138 printf(" %d", n_filename);
30139 printf(" %d", n_encoding);
30140 printf(" %d", n_options);
30154 test_xmlReaderForMemory(void) {
30157 #if defined(LIBXML_READER_ENABLED)
30159 xmlTextReaderPtr ret_val;
30160 char * buffer; /* a pointer to a char array */
30162 int size; /* the size of the array */
30164 const char * URL; /* the base URL to use for the document */
30166 char * encoding; /* the document encoding, or NULL */
30168 int options; /* a combination of xmlParserOption */
30171 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30172 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30173 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30174 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30175 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30176 mem_base = xmlMemBlocks();
30177 buffer = gen_const_char_ptr(n_buffer, 0);
30178 size = gen_int(n_size, 1);
30179 URL = gen_filepath(n_URL, 2);
30180 encoding = gen_const_char_ptr(n_encoding, 3);
30181 options = gen_parseroptions(n_options, 4);
30183 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30184 desret_xmlTextReaderPtr(ret_val);
30186 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30187 des_int(n_size, size, 1);
30188 des_filepath(n_URL, URL, 2);
30189 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30190 des_parseroptions(n_options, options, 4);
30191 xmlResetLastError();
30192 if (mem_base != xmlMemBlocks()) {
30193 printf("Leak of %d blocks found in xmlReaderForMemory",
30194 xmlMemBlocks() - mem_base);
30196 printf(" %d", n_buffer);
30197 printf(" %d", n_size);
30198 printf(" %d", n_URL);
30199 printf(" %d", n_encoding);
30200 printf(" %d", n_options);
30216 test_xmlReaderNewDoc(void) {
30219 #if defined(LIBXML_READER_ENABLED)
30222 xmlTextReaderPtr reader; /* an XML reader */
30224 xmlChar * cur; /* a pointer to a zero terminated string */
30226 const char * URL; /* the base URL to use for the document */
30228 char * encoding; /* the document encoding, or NULL */
30230 int options; /* a combination of xmlParserOption */
30233 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30234 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30235 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30236 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30237 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30238 mem_base = xmlMemBlocks();
30239 reader = gen_xmlTextReaderPtr(n_reader, 0);
30240 cur = gen_const_xmlChar_ptr(n_cur, 1);
30241 URL = gen_filepath(n_URL, 2);
30242 encoding = gen_const_char_ptr(n_encoding, 3);
30243 options = gen_parseroptions(n_options, 4);
30245 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30246 desret_int(ret_val);
30248 des_xmlTextReaderPtr(n_reader, reader, 0);
30249 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30250 des_filepath(n_URL, URL, 2);
30251 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30252 des_parseroptions(n_options, options, 4);
30253 xmlResetLastError();
30254 if (mem_base != xmlMemBlocks()) {
30255 printf("Leak of %d blocks found in xmlReaderNewDoc",
30256 xmlMemBlocks() - mem_base);
30258 printf(" %d", n_reader);
30259 printf(" %d", n_cur);
30260 printf(" %d", n_URL);
30261 printf(" %d", n_encoding);
30262 printf(" %d", n_options);
30278 test_xmlReaderNewFile(void) {
30281 #if defined(LIBXML_READER_ENABLED)
30284 xmlTextReaderPtr reader; /* an XML reader */
30286 const char * filename; /* a file or URL */
30288 char * encoding; /* the document encoding, or NULL */
30290 int options; /* a combination of xmlParserOption */
30293 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30294 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30295 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30296 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30297 mem_base = xmlMemBlocks();
30298 reader = gen_xmlTextReaderPtr(n_reader, 0);
30299 filename = gen_filepath(n_filename, 1);
30300 encoding = gen_const_char_ptr(n_encoding, 2);
30301 options = gen_parseroptions(n_options, 3);
30303 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30304 desret_int(ret_val);
30306 des_xmlTextReaderPtr(n_reader, reader, 0);
30307 des_filepath(n_filename, filename, 1);
30308 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30309 des_parseroptions(n_options, options, 3);
30310 xmlResetLastError();
30311 if (mem_base != xmlMemBlocks()) {
30312 printf("Leak of %d blocks found in xmlReaderNewFile",
30313 xmlMemBlocks() - mem_base);
30315 printf(" %d", n_reader);
30316 printf(" %d", n_filename);
30317 printf(" %d", n_encoding);
30318 printf(" %d", n_options);
30333 test_xmlReaderNewMemory(void) {
30336 #if defined(LIBXML_READER_ENABLED)
30339 xmlTextReaderPtr reader; /* an XML reader */
30341 char * buffer; /* a pointer to a char array */
30343 int size; /* the size of the array */
30345 const char * URL; /* the base URL to use for the document */
30347 char * encoding; /* the document encoding, or NULL */
30349 int options; /* a combination of xmlParserOption */
30352 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30353 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30354 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30355 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30356 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30357 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30358 mem_base = xmlMemBlocks();
30359 reader = gen_xmlTextReaderPtr(n_reader, 0);
30360 buffer = gen_const_char_ptr(n_buffer, 1);
30361 size = gen_int(n_size, 2);
30362 URL = gen_filepath(n_URL, 3);
30363 encoding = gen_const_char_ptr(n_encoding, 4);
30364 options = gen_parseroptions(n_options, 5);
30366 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30367 desret_int(ret_val);
30369 des_xmlTextReaderPtr(n_reader, reader, 0);
30370 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30371 des_int(n_size, size, 2);
30372 des_filepath(n_URL, URL, 3);
30373 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30374 des_parseroptions(n_options, options, 5);
30375 xmlResetLastError();
30376 if (mem_base != xmlMemBlocks()) {
30377 printf("Leak of %d blocks found in xmlReaderNewMemory",
30378 xmlMemBlocks() - mem_base);
30380 printf(" %d", n_reader);
30381 printf(" %d", n_buffer);
30382 printf(" %d", n_size);
30383 printf(" %d", n_URL);
30384 printf(" %d", n_encoding);
30385 printf(" %d", n_options);
30402 test_xmlReaderNewWalker(void) {
30405 #if defined(LIBXML_READER_ENABLED)
30408 xmlTextReaderPtr reader; /* an XML reader */
30410 xmlDocPtr doc; /* a preparsed document */
30413 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30414 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30415 mem_base = xmlMemBlocks();
30416 reader = gen_xmlTextReaderPtr(n_reader, 0);
30417 doc = gen_xmlDocPtr(n_doc, 1);
30419 ret_val = xmlReaderNewWalker(reader, doc);
30420 desret_int(ret_val);
30422 des_xmlTextReaderPtr(n_reader, reader, 0);
30423 des_xmlDocPtr(n_doc, doc, 1);
30424 xmlResetLastError();
30425 if (mem_base != xmlMemBlocks()) {
30426 printf("Leak of %d blocks found in xmlReaderNewWalker",
30427 xmlMemBlocks() - mem_base);
30429 printf(" %d", n_reader);
30430 printf(" %d", n_doc);
30443 test_xmlReaderWalker(void) {
30446 #if defined(LIBXML_READER_ENABLED)
30448 xmlTextReaderPtr ret_val;
30449 xmlDocPtr doc; /* a preparsed document */
30452 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30453 mem_base = xmlMemBlocks();
30454 doc = gen_xmlDocPtr(n_doc, 0);
30456 ret_val = xmlReaderWalker(doc);
30457 desret_xmlTextReaderPtr(ret_val);
30459 des_xmlDocPtr(n_doc, doc, 0);
30460 xmlResetLastError();
30461 if (mem_base != xmlMemBlocks()) {
30462 printf("Leak of %d blocks found in xmlReaderWalker",
30463 xmlMemBlocks() - mem_base);
30465 printf(" %d", n_doc);
30477 test_xmlTextReaderAttributeCount(void) {
30480 #if defined(LIBXML_READER_ENABLED)
30483 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30486 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30487 mem_base = xmlMemBlocks();
30488 reader = gen_xmlTextReaderPtr(n_reader, 0);
30490 ret_val = xmlTextReaderAttributeCount(reader);
30491 desret_int(ret_val);
30493 des_xmlTextReaderPtr(n_reader, reader, 0);
30494 xmlResetLastError();
30495 if (mem_base != xmlMemBlocks()) {
30496 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30497 xmlMemBlocks() - mem_base);
30499 printf(" %d", n_reader);
30511 test_xmlTextReaderBaseUri(void) {
30514 #if defined(LIBXML_READER_ENABLED)
30517 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30520 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30521 mem_base = xmlMemBlocks();
30522 reader = gen_xmlTextReaderPtr(n_reader, 0);
30524 ret_val = xmlTextReaderBaseUri(reader);
30525 desret_xmlChar_ptr(ret_val);
30527 des_xmlTextReaderPtr(n_reader, reader, 0);
30528 xmlResetLastError();
30529 if (mem_base != xmlMemBlocks()) {
30530 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30531 xmlMemBlocks() - mem_base);
30533 printf(" %d", n_reader);
30545 test_xmlTextReaderByteConsumed(void) {
30548 #if defined(LIBXML_READER_ENABLED)
30551 xmlTextReaderPtr reader; /* an XML reader */
30554 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30555 mem_base = xmlMemBlocks();
30556 reader = gen_xmlTextReaderPtr(n_reader, 0);
30558 ret_val = xmlTextReaderByteConsumed(reader);
30559 desret_long(ret_val);
30561 des_xmlTextReaderPtr(n_reader, reader, 0);
30562 xmlResetLastError();
30563 if (mem_base != xmlMemBlocks()) {
30564 printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30565 xmlMemBlocks() - mem_base);
30567 printf(" %d", n_reader);
30579 test_xmlTextReaderClose(void) {
30582 #if defined(LIBXML_READER_ENABLED)
30585 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30588 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30589 mem_base = xmlMemBlocks();
30590 reader = gen_xmlTextReaderPtr(n_reader, 0);
30592 ret_val = xmlTextReaderClose(reader);
30593 desret_int(ret_val);
30595 des_xmlTextReaderPtr(n_reader, reader, 0);
30596 xmlResetLastError();
30597 if (mem_base != xmlMemBlocks()) {
30598 printf("Leak of %d blocks found in xmlTextReaderClose",
30599 xmlMemBlocks() - mem_base);
30601 printf(" %d", n_reader);
30613 test_xmlTextReaderConstBaseUri(void) {
30616 #if defined(LIBXML_READER_ENABLED)
30618 const xmlChar * ret_val;
30619 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30622 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30623 mem_base = xmlMemBlocks();
30624 reader = gen_xmlTextReaderPtr(n_reader, 0);
30626 ret_val = xmlTextReaderConstBaseUri(reader);
30627 desret_const_xmlChar_ptr(ret_val);
30629 des_xmlTextReaderPtr(n_reader, reader, 0);
30630 xmlResetLastError();
30631 if (mem_base != xmlMemBlocks()) {
30632 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30633 xmlMemBlocks() - mem_base);
30635 printf(" %d", n_reader);
30647 test_xmlTextReaderConstEncoding(void) {
30650 #if defined(LIBXML_READER_ENABLED)
30652 const xmlChar * ret_val;
30653 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30656 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30657 mem_base = xmlMemBlocks();
30658 reader = gen_xmlTextReaderPtr(n_reader, 0);
30660 ret_val = xmlTextReaderConstEncoding(reader);
30661 desret_const_xmlChar_ptr(ret_val);
30663 des_xmlTextReaderPtr(n_reader, reader, 0);
30664 xmlResetLastError();
30665 if (mem_base != xmlMemBlocks()) {
30666 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30667 xmlMemBlocks() - mem_base);
30669 printf(" %d", n_reader);
30681 test_xmlTextReaderConstLocalName(void) {
30684 #if defined(LIBXML_READER_ENABLED)
30686 const xmlChar * ret_val;
30687 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30690 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30691 mem_base = xmlMemBlocks();
30692 reader = gen_xmlTextReaderPtr(n_reader, 0);
30694 ret_val = xmlTextReaderConstLocalName(reader);
30695 desret_const_xmlChar_ptr(ret_val);
30697 des_xmlTextReaderPtr(n_reader, reader, 0);
30698 xmlResetLastError();
30699 if (mem_base != xmlMemBlocks()) {
30700 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30701 xmlMemBlocks() - mem_base);
30703 printf(" %d", n_reader);
30715 test_xmlTextReaderConstName(void) {
30718 #if defined(LIBXML_READER_ENABLED)
30720 const xmlChar * ret_val;
30721 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30724 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30725 mem_base = xmlMemBlocks();
30726 reader = gen_xmlTextReaderPtr(n_reader, 0);
30728 ret_val = xmlTextReaderConstName(reader);
30729 desret_const_xmlChar_ptr(ret_val);
30731 des_xmlTextReaderPtr(n_reader, reader, 0);
30732 xmlResetLastError();
30733 if (mem_base != xmlMemBlocks()) {
30734 printf("Leak of %d blocks found in xmlTextReaderConstName",
30735 xmlMemBlocks() - mem_base);
30737 printf(" %d", n_reader);
30749 test_xmlTextReaderConstNamespaceUri(void) {
30752 #if defined(LIBXML_READER_ENABLED)
30754 const xmlChar * ret_val;
30755 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30758 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30759 mem_base = xmlMemBlocks();
30760 reader = gen_xmlTextReaderPtr(n_reader, 0);
30762 ret_val = xmlTextReaderConstNamespaceUri(reader);
30763 desret_const_xmlChar_ptr(ret_val);
30765 des_xmlTextReaderPtr(n_reader, reader, 0);
30766 xmlResetLastError();
30767 if (mem_base != xmlMemBlocks()) {
30768 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30769 xmlMemBlocks() - mem_base);
30771 printf(" %d", n_reader);
30783 test_xmlTextReaderConstPrefix(void) {
30786 #if defined(LIBXML_READER_ENABLED)
30788 const xmlChar * ret_val;
30789 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30792 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30793 mem_base = xmlMemBlocks();
30794 reader = gen_xmlTextReaderPtr(n_reader, 0);
30796 ret_val = xmlTextReaderConstPrefix(reader);
30797 desret_const_xmlChar_ptr(ret_val);
30799 des_xmlTextReaderPtr(n_reader, reader, 0);
30800 xmlResetLastError();
30801 if (mem_base != xmlMemBlocks()) {
30802 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30803 xmlMemBlocks() - mem_base);
30805 printf(" %d", n_reader);
30817 test_xmlTextReaderConstString(void) {
30820 #if defined(LIBXML_READER_ENABLED)
30822 const xmlChar * ret_val;
30823 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30825 xmlChar * str; /* the string to intern. */
30828 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30829 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30830 mem_base = xmlMemBlocks();
30831 reader = gen_xmlTextReaderPtr(n_reader, 0);
30832 str = gen_const_xmlChar_ptr(n_str, 1);
30834 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30835 desret_const_xmlChar_ptr(ret_val);
30837 des_xmlTextReaderPtr(n_reader, reader, 0);
30838 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30839 xmlResetLastError();
30840 if (mem_base != xmlMemBlocks()) {
30841 printf("Leak of %d blocks found in xmlTextReaderConstString",
30842 xmlMemBlocks() - mem_base);
30844 printf(" %d", n_reader);
30845 printf(" %d", n_str);
30858 test_xmlTextReaderConstValue(void) {
30861 #if defined(LIBXML_READER_ENABLED)
30863 const xmlChar * ret_val;
30864 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30867 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30868 mem_base = xmlMemBlocks();
30869 reader = gen_xmlTextReaderPtr(n_reader, 0);
30871 ret_val = xmlTextReaderConstValue(reader);
30872 desret_const_xmlChar_ptr(ret_val);
30874 des_xmlTextReaderPtr(n_reader, reader, 0);
30875 xmlResetLastError();
30876 if (mem_base != xmlMemBlocks()) {
30877 printf("Leak of %d blocks found in xmlTextReaderConstValue",
30878 xmlMemBlocks() - mem_base);
30880 printf(" %d", n_reader);
30892 test_xmlTextReaderConstXmlLang(void) {
30895 #if defined(LIBXML_READER_ENABLED)
30897 const xmlChar * ret_val;
30898 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30901 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30902 mem_base = xmlMemBlocks();
30903 reader = gen_xmlTextReaderPtr(n_reader, 0);
30905 ret_val = xmlTextReaderConstXmlLang(reader);
30906 desret_const_xmlChar_ptr(ret_val);
30908 des_xmlTextReaderPtr(n_reader, reader, 0);
30909 xmlResetLastError();
30910 if (mem_base != xmlMemBlocks()) {
30911 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30912 xmlMemBlocks() - mem_base);
30914 printf(" %d", n_reader);
30926 test_xmlTextReaderConstXmlVersion(void) {
30929 #if defined(LIBXML_READER_ENABLED)
30931 const xmlChar * ret_val;
30932 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30935 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30936 mem_base = xmlMemBlocks();
30937 reader = gen_xmlTextReaderPtr(n_reader, 0);
30939 ret_val = xmlTextReaderConstXmlVersion(reader);
30940 desret_const_xmlChar_ptr(ret_val);
30942 des_xmlTextReaderPtr(n_reader, reader, 0);
30943 xmlResetLastError();
30944 if (mem_base != xmlMemBlocks()) {
30945 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30946 xmlMemBlocks() - mem_base);
30948 printf(" %d", n_reader);
30960 test_xmlTextReaderCurrentDoc(void) {
30963 #if defined(LIBXML_READER_ENABLED)
30966 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30969 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30970 mem_base = xmlMemBlocks();
30971 reader = gen_xmlTextReaderPtr(n_reader, 0);
30973 ret_val = xmlTextReaderCurrentDoc(reader);
30974 desret_xmlDocPtr(ret_val);
30976 des_xmlTextReaderPtr(n_reader, reader, 0);
30977 xmlResetLastError();
30978 if (mem_base != xmlMemBlocks()) {
30979 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30980 xmlMemBlocks() - mem_base);
30982 printf(" %d", n_reader);
30994 test_xmlTextReaderCurrentNode(void) {
30997 #if defined(LIBXML_READER_ENABLED)
30999 xmlNodePtr ret_val;
31000 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31003 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31004 mem_base = xmlMemBlocks();
31005 reader = gen_xmlTextReaderPtr(n_reader, 0);
31007 ret_val = xmlTextReaderCurrentNode(reader);
31008 desret_xmlNodePtr(ret_val);
31010 des_xmlTextReaderPtr(n_reader, reader, 0);
31011 xmlResetLastError();
31012 if (mem_base != xmlMemBlocks()) {
31013 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31014 xmlMemBlocks() - mem_base);
31016 printf(" %d", n_reader);
31028 test_xmlTextReaderDepth(void) {
31031 #if defined(LIBXML_READER_ENABLED)
31034 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31037 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31038 mem_base = xmlMemBlocks();
31039 reader = gen_xmlTextReaderPtr(n_reader, 0);
31041 ret_val = xmlTextReaderDepth(reader);
31042 desret_int(ret_val);
31044 des_xmlTextReaderPtr(n_reader, reader, 0);
31045 xmlResetLastError();
31046 if (mem_base != xmlMemBlocks()) {
31047 printf("Leak of %d blocks found in xmlTextReaderDepth",
31048 xmlMemBlocks() - mem_base);
31050 printf(" %d", n_reader);
31062 test_xmlTextReaderExpand(void) {
31065 #if defined(LIBXML_READER_ENABLED)
31067 xmlNodePtr ret_val;
31068 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31071 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31072 mem_base = xmlMemBlocks();
31073 reader = gen_xmlTextReaderPtr(n_reader, 0);
31075 ret_val = xmlTextReaderExpand(reader);
31076 desret_xmlNodePtr(ret_val);
31078 des_xmlTextReaderPtr(n_reader, reader, 0);
31079 xmlResetLastError();
31080 if (mem_base != xmlMemBlocks()) {
31081 printf("Leak of %d blocks found in xmlTextReaderExpand",
31082 xmlMemBlocks() - mem_base);
31084 printf(" %d", n_reader);
31096 test_xmlTextReaderGetAttribute(void) {
31099 #if defined(LIBXML_READER_ENABLED)
31102 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31104 xmlChar * name; /* the qualified name of the attribute. */
31107 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31108 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31109 mem_base = xmlMemBlocks();
31110 reader = gen_xmlTextReaderPtr(n_reader, 0);
31111 name = gen_const_xmlChar_ptr(n_name, 1);
31113 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31114 desret_xmlChar_ptr(ret_val);
31116 des_xmlTextReaderPtr(n_reader, reader, 0);
31117 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31118 xmlResetLastError();
31119 if (mem_base != xmlMemBlocks()) {
31120 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31121 xmlMemBlocks() - mem_base);
31123 printf(" %d", n_reader);
31124 printf(" %d", n_name);
31137 test_xmlTextReaderGetAttributeNo(void) {
31140 #if defined(LIBXML_READER_ENABLED)
31143 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31145 int no; /* the zero-based index of the attribute relative to the containing element */
31148 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31149 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31150 mem_base = xmlMemBlocks();
31151 reader = gen_xmlTextReaderPtr(n_reader, 0);
31152 no = gen_int(n_no, 1);
31154 ret_val = xmlTextReaderGetAttributeNo(reader, no);
31155 desret_xmlChar_ptr(ret_val);
31157 des_xmlTextReaderPtr(n_reader, reader, 0);
31158 des_int(n_no, no, 1);
31159 xmlResetLastError();
31160 if (mem_base != xmlMemBlocks()) {
31161 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31162 xmlMemBlocks() - mem_base);
31164 printf(" %d", n_reader);
31165 printf(" %d", n_no);
31178 test_xmlTextReaderGetAttributeNs(void) {
31181 #if defined(LIBXML_READER_ENABLED)
31184 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31186 xmlChar * localName; /* the local name of the attribute. */
31188 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31189 int n_namespaceURI;
31191 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31192 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31193 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31194 mem_base = xmlMemBlocks();
31195 reader = gen_xmlTextReaderPtr(n_reader, 0);
31196 localName = gen_const_xmlChar_ptr(n_localName, 1);
31197 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31199 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31200 desret_xmlChar_ptr(ret_val);
31202 des_xmlTextReaderPtr(n_reader, reader, 0);
31203 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31204 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31205 xmlResetLastError();
31206 if (mem_base != xmlMemBlocks()) {
31207 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31208 xmlMemBlocks() - mem_base);
31210 printf(" %d", n_reader);
31211 printf(" %d", n_localName);
31212 printf(" %d", n_namespaceURI);
31224 #ifdef LIBXML_READER_ENABLED
31226 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31227 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31230 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31236 test_xmlTextReaderGetErrorHandler(void) {
31239 #if defined(LIBXML_READER_ENABLED)
31241 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31243 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31245 void ** arg; /* a user argument */
31248 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31249 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31250 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31251 mem_base = xmlMemBlocks();
31252 reader = gen_xmlTextReaderPtr(n_reader, 0);
31253 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31254 arg = gen_void_ptr_ptr(n_arg, 2);
31256 xmlTextReaderGetErrorHandler(reader, f, arg);
31258 des_xmlTextReaderPtr(n_reader, reader, 0);
31259 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31260 des_void_ptr_ptr(n_arg, arg, 2);
31261 xmlResetLastError();
31262 if (mem_base != xmlMemBlocks()) {
31263 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31264 xmlMemBlocks() - mem_base);
31266 printf(" %d", n_reader);
31267 printf(" %d", n_f);
31268 printf(" %d", n_arg);
31282 test_xmlTextReaderGetParserColumnNumber(void) {
31285 #if defined(LIBXML_READER_ENABLED)
31288 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31291 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31292 mem_base = xmlMemBlocks();
31293 reader = gen_xmlTextReaderPtr(n_reader, 0);
31295 ret_val = xmlTextReaderGetParserColumnNumber(reader);
31296 desret_int(ret_val);
31298 des_xmlTextReaderPtr(n_reader, reader, 0);
31299 xmlResetLastError();
31300 if (mem_base != xmlMemBlocks()) {
31301 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31302 xmlMemBlocks() - mem_base);
31304 printf(" %d", n_reader);
31316 test_xmlTextReaderGetParserLineNumber(void) {
31319 #if defined(LIBXML_READER_ENABLED)
31322 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31325 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31326 mem_base = xmlMemBlocks();
31327 reader = gen_xmlTextReaderPtr(n_reader, 0);
31329 ret_val = xmlTextReaderGetParserLineNumber(reader);
31330 desret_int(ret_val);
31332 des_xmlTextReaderPtr(n_reader, reader, 0);
31333 xmlResetLastError();
31334 if (mem_base != xmlMemBlocks()) {
31335 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31336 xmlMemBlocks() - mem_base);
31338 printf(" %d", n_reader);
31350 test_xmlTextReaderGetParserProp(void) {
31353 #if defined(LIBXML_READER_ENABLED)
31356 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31358 int prop; /* the xmlParserProperties to get */
31361 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31362 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31363 mem_base = xmlMemBlocks();
31364 reader = gen_xmlTextReaderPtr(n_reader, 0);
31365 prop = gen_int(n_prop, 1);
31367 ret_val = xmlTextReaderGetParserProp(reader, prop);
31368 desret_int(ret_val);
31370 des_xmlTextReaderPtr(n_reader, reader, 0);
31371 des_int(n_prop, prop, 1);
31372 xmlResetLastError();
31373 if (mem_base != xmlMemBlocks()) {
31374 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31375 xmlMemBlocks() - mem_base);
31377 printf(" %d", n_reader);
31378 printf(" %d", n_prop);
31391 test_xmlTextReaderGetRemainder(void) {
31394 #if defined(LIBXML_READER_ENABLED)
31396 xmlParserInputBufferPtr ret_val;
31397 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31400 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31401 mem_base = xmlMemBlocks();
31402 reader = gen_xmlTextReaderPtr(n_reader, 0);
31404 ret_val = xmlTextReaderGetRemainder(reader);
31405 desret_xmlParserInputBufferPtr(ret_val);
31407 des_xmlTextReaderPtr(n_reader, reader, 0);
31408 xmlResetLastError();
31409 if (mem_base != xmlMemBlocks()) {
31410 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31411 xmlMemBlocks() - mem_base);
31413 printf(" %d", n_reader);
31425 test_xmlTextReaderHasAttributes(void) {
31428 #if defined(LIBXML_READER_ENABLED)
31431 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31435 mem_base = xmlMemBlocks();
31436 reader = gen_xmlTextReaderPtr(n_reader, 0);
31438 ret_val = xmlTextReaderHasAttributes(reader);
31439 desret_int(ret_val);
31441 des_xmlTextReaderPtr(n_reader, reader, 0);
31442 xmlResetLastError();
31443 if (mem_base != xmlMemBlocks()) {
31444 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31445 xmlMemBlocks() - mem_base);
31447 printf(" %d", n_reader);
31459 test_xmlTextReaderHasValue(void) {
31462 #if defined(LIBXML_READER_ENABLED)
31465 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31468 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31469 mem_base = xmlMemBlocks();
31470 reader = gen_xmlTextReaderPtr(n_reader, 0);
31472 ret_val = xmlTextReaderHasValue(reader);
31473 desret_int(ret_val);
31475 des_xmlTextReaderPtr(n_reader, reader, 0);
31476 xmlResetLastError();
31477 if (mem_base != xmlMemBlocks()) {
31478 printf("Leak of %d blocks found in xmlTextReaderHasValue",
31479 xmlMemBlocks() - mem_base);
31481 printf(" %d", n_reader);
31493 test_xmlTextReaderIsDefault(void) {
31496 #if defined(LIBXML_READER_ENABLED)
31499 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31502 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31503 mem_base = xmlMemBlocks();
31504 reader = gen_xmlTextReaderPtr(n_reader, 0);
31506 ret_val = xmlTextReaderIsDefault(reader);
31507 desret_int(ret_val);
31509 des_xmlTextReaderPtr(n_reader, reader, 0);
31510 xmlResetLastError();
31511 if (mem_base != xmlMemBlocks()) {
31512 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31513 xmlMemBlocks() - mem_base);
31515 printf(" %d", n_reader);
31527 test_xmlTextReaderIsEmptyElement(void) {
31530 #if defined(LIBXML_READER_ENABLED)
31533 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31536 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31537 mem_base = xmlMemBlocks();
31538 reader = gen_xmlTextReaderPtr(n_reader, 0);
31540 ret_val = xmlTextReaderIsEmptyElement(reader);
31541 desret_int(ret_val);
31543 des_xmlTextReaderPtr(n_reader, reader, 0);
31544 xmlResetLastError();
31545 if (mem_base != xmlMemBlocks()) {
31546 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31547 xmlMemBlocks() - mem_base);
31549 printf(" %d", n_reader);
31561 test_xmlTextReaderIsNamespaceDecl(void) {
31564 #if defined(LIBXML_READER_ENABLED)
31567 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31570 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31571 mem_base = xmlMemBlocks();
31572 reader = gen_xmlTextReaderPtr(n_reader, 0);
31574 ret_val = xmlTextReaderIsNamespaceDecl(reader);
31575 desret_int(ret_val);
31577 des_xmlTextReaderPtr(n_reader, reader, 0);
31578 xmlResetLastError();
31579 if (mem_base != xmlMemBlocks()) {
31580 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31581 xmlMemBlocks() - mem_base);
31583 printf(" %d", n_reader);
31595 test_xmlTextReaderIsValid(void) {
31598 #if defined(LIBXML_READER_ENABLED)
31601 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31604 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31605 mem_base = xmlMemBlocks();
31606 reader = gen_xmlTextReaderPtr(n_reader, 0);
31608 ret_val = xmlTextReaderIsValid(reader);
31609 desret_int(ret_val);
31611 des_xmlTextReaderPtr(n_reader, reader, 0);
31612 xmlResetLastError();
31613 if (mem_base != xmlMemBlocks()) {
31614 printf("Leak of %d blocks found in xmlTextReaderIsValid",
31615 xmlMemBlocks() - mem_base);
31617 printf(" %d", n_reader);
31629 test_xmlTextReaderLocalName(void) {
31632 #if defined(LIBXML_READER_ENABLED)
31635 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31638 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31639 mem_base = xmlMemBlocks();
31640 reader = gen_xmlTextReaderPtr(n_reader, 0);
31642 ret_val = xmlTextReaderLocalName(reader);
31643 desret_xmlChar_ptr(ret_val);
31645 des_xmlTextReaderPtr(n_reader, reader, 0);
31646 xmlResetLastError();
31647 if (mem_base != xmlMemBlocks()) {
31648 printf("Leak of %d blocks found in xmlTextReaderLocalName",
31649 xmlMemBlocks() - mem_base);
31651 printf(" %d", n_reader);
31661 #ifdef LIBXML_READER_ENABLED
31663 #define gen_nb_xmlTextReaderLocatorPtr 1
31664 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31667 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31673 test_xmlTextReaderLocatorBaseURI(void) {
31676 #if defined(LIBXML_READER_ENABLED)
31679 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31682 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31683 mem_base = xmlMemBlocks();
31684 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31686 ret_val = xmlTextReaderLocatorBaseURI(locator);
31687 desret_xmlChar_ptr(ret_val);
31689 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31690 xmlResetLastError();
31691 if (mem_base != xmlMemBlocks()) {
31692 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31693 xmlMemBlocks() - mem_base);
31695 printf(" %d", n_locator);
31707 test_xmlTextReaderLocatorLineNumber(void) {
31710 #if defined(LIBXML_READER_ENABLED)
31713 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31716 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31717 mem_base = xmlMemBlocks();
31718 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31720 ret_val = xmlTextReaderLocatorLineNumber(locator);
31721 desret_int(ret_val);
31723 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31724 xmlResetLastError();
31725 if (mem_base != xmlMemBlocks()) {
31726 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31727 xmlMemBlocks() - mem_base);
31729 printf(" %d", n_locator);
31741 test_xmlTextReaderLookupNamespace(void) {
31744 #if defined(LIBXML_READER_ENABLED)
31747 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31749 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31752 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31753 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31754 mem_base = xmlMemBlocks();
31755 reader = gen_xmlTextReaderPtr(n_reader, 0);
31756 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31758 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31759 desret_xmlChar_ptr(ret_val);
31761 des_xmlTextReaderPtr(n_reader, reader, 0);
31762 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31763 xmlResetLastError();
31764 if (mem_base != xmlMemBlocks()) {
31765 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31766 xmlMemBlocks() - mem_base);
31768 printf(" %d", n_reader);
31769 printf(" %d", n_prefix);
31782 test_xmlTextReaderMoveToAttribute(void) {
31785 #if defined(LIBXML_READER_ENABLED)
31788 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31790 xmlChar * name; /* the qualified name of the attribute. */
31793 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31794 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31795 mem_base = xmlMemBlocks();
31796 reader = gen_xmlTextReaderPtr(n_reader, 0);
31797 name = gen_const_xmlChar_ptr(n_name, 1);
31799 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31800 desret_int(ret_val);
31802 des_xmlTextReaderPtr(n_reader, reader, 0);
31803 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31804 xmlResetLastError();
31805 if (mem_base != xmlMemBlocks()) {
31806 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31807 xmlMemBlocks() - mem_base);
31809 printf(" %d", n_reader);
31810 printf(" %d", n_name);
31823 test_xmlTextReaderMoveToAttributeNo(void) {
31826 #if defined(LIBXML_READER_ENABLED)
31829 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31831 int no; /* the zero-based index of the attribute relative to the containing element. */
31834 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31835 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31836 mem_base = xmlMemBlocks();
31837 reader = gen_xmlTextReaderPtr(n_reader, 0);
31838 no = gen_int(n_no, 1);
31840 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31841 desret_int(ret_val);
31843 des_xmlTextReaderPtr(n_reader, reader, 0);
31844 des_int(n_no, no, 1);
31845 xmlResetLastError();
31846 if (mem_base != xmlMemBlocks()) {
31847 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31848 xmlMemBlocks() - mem_base);
31850 printf(" %d", n_reader);
31851 printf(" %d", n_no);
31864 test_xmlTextReaderMoveToAttributeNs(void) {
31867 #if defined(LIBXML_READER_ENABLED)
31870 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31872 xmlChar * localName; /* the local name of the attribute. */
31874 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31875 int n_namespaceURI;
31877 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31878 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31879 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31880 mem_base = xmlMemBlocks();
31881 reader = gen_xmlTextReaderPtr(n_reader, 0);
31882 localName = gen_const_xmlChar_ptr(n_localName, 1);
31883 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31885 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31886 desret_int(ret_val);
31888 des_xmlTextReaderPtr(n_reader, reader, 0);
31889 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31890 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31891 xmlResetLastError();
31892 if (mem_base != xmlMemBlocks()) {
31893 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31894 xmlMemBlocks() - mem_base);
31896 printf(" %d", n_reader);
31897 printf(" %d", n_localName);
31898 printf(" %d", n_namespaceURI);
31912 test_xmlTextReaderMoveToElement(void) {
31915 #if defined(LIBXML_READER_ENABLED)
31918 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31921 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31922 mem_base = xmlMemBlocks();
31923 reader = gen_xmlTextReaderPtr(n_reader, 0);
31925 ret_val = xmlTextReaderMoveToElement(reader);
31926 desret_int(ret_val);
31928 des_xmlTextReaderPtr(n_reader, reader, 0);
31929 xmlResetLastError();
31930 if (mem_base != xmlMemBlocks()) {
31931 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31932 xmlMemBlocks() - mem_base);
31934 printf(" %d", n_reader);
31946 test_xmlTextReaderMoveToFirstAttribute(void) {
31949 #if defined(LIBXML_READER_ENABLED)
31952 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31955 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31956 mem_base = xmlMemBlocks();
31957 reader = gen_xmlTextReaderPtr(n_reader, 0);
31959 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31960 desret_int(ret_val);
31962 des_xmlTextReaderPtr(n_reader, reader, 0);
31963 xmlResetLastError();
31964 if (mem_base != xmlMemBlocks()) {
31965 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31966 xmlMemBlocks() - mem_base);
31968 printf(" %d", n_reader);
31980 test_xmlTextReaderMoveToNextAttribute(void) {
31983 #if defined(LIBXML_READER_ENABLED)
31986 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31989 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31990 mem_base = xmlMemBlocks();
31991 reader = gen_xmlTextReaderPtr(n_reader, 0);
31993 ret_val = xmlTextReaderMoveToNextAttribute(reader);
31994 desret_int(ret_val);
31996 des_xmlTextReaderPtr(n_reader, reader, 0);
31997 xmlResetLastError();
31998 if (mem_base != xmlMemBlocks()) {
31999 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32000 xmlMemBlocks() - mem_base);
32002 printf(" %d", n_reader);
32014 test_xmlTextReaderName(void) {
32017 #if defined(LIBXML_READER_ENABLED)
32020 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32023 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32024 mem_base = xmlMemBlocks();
32025 reader = gen_xmlTextReaderPtr(n_reader, 0);
32027 ret_val = xmlTextReaderName(reader);
32028 desret_xmlChar_ptr(ret_val);
32030 des_xmlTextReaderPtr(n_reader, reader, 0);
32031 xmlResetLastError();
32032 if (mem_base != xmlMemBlocks()) {
32033 printf("Leak of %d blocks found in xmlTextReaderName",
32034 xmlMemBlocks() - mem_base);
32036 printf(" %d", n_reader);
32048 test_xmlTextReaderNamespaceUri(void) {
32051 #if defined(LIBXML_READER_ENABLED)
32054 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32057 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32058 mem_base = xmlMemBlocks();
32059 reader = gen_xmlTextReaderPtr(n_reader, 0);
32061 ret_val = xmlTextReaderNamespaceUri(reader);
32062 desret_xmlChar_ptr(ret_val);
32064 des_xmlTextReaderPtr(n_reader, reader, 0);
32065 xmlResetLastError();
32066 if (mem_base != xmlMemBlocks()) {
32067 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32068 xmlMemBlocks() - mem_base);
32070 printf(" %d", n_reader);
32082 test_xmlTextReaderNext(void) {
32085 #if defined(LIBXML_READER_ENABLED)
32088 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32091 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32092 mem_base = xmlMemBlocks();
32093 reader = gen_xmlTextReaderPtr(n_reader, 0);
32095 ret_val = xmlTextReaderNext(reader);
32096 desret_int(ret_val);
32098 des_xmlTextReaderPtr(n_reader, reader, 0);
32099 xmlResetLastError();
32100 if (mem_base != xmlMemBlocks()) {
32101 printf("Leak of %d blocks found in xmlTextReaderNext",
32102 xmlMemBlocks() - mem_base);
32104 printf(" %d", n_reader);
32116 test_xmlTextReaderNextSibling(void) {
32119 #if defined(LIBXML_READER_ENABLED)
32122 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32125 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32126 mem_base = xmlMemBlocks();
32127 reader = gen_xmlTextReaderPtr(n_reader, 0);
32129 ret_val = xmlTextReaderNextSibling(reader);
32130 desret_int(ret_val);
32132 des_xmlTextReaderPtr(n_reader, reader, 0);
32133 xmlResetLastError();
32134 if (mem_base != xmlMemBlocks()) {
32135 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32136 xmlMemBlocks() - mem_base);
32138 printf(" %d", n_reader);
32150 test_xmlTextReaderNodeType(void) {
32153 #if defined(LIBXML_READER_ENABLED)
32156 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32159 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32160 mem_base = xmlMemBlocks();
32161 reader = gen_xmlTextReaderPtr(n_reader, 0);
32163 ret_val = xmlTextReaderNodeType(reader);
32164 desret_int(ret_val);
32166 des_xmlTextReaderPtr(n_reader, reader, 0);
32167 xmlResetLastError();
32168 if (mem_base != xmlMemBlocks()) {
32169 printf("Leak of %d blocks found in xmlTextReaderNodeType",
32170 xmlMemBlocks() - mem_base);
32172 printf(" %d", n_reader);
32184 test_xmlTextReaderNormalization(void) {
32187 #if defined(LIBXML_READER_ENABLED)
32190 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32193 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32194 mem_base = xmlMemBlocks();
32195 reader = gen_xmlTextReaderPtr(n_reader, 0);
32197 ret_val = xmlTextReaderNormalization(reader);
32198 desret_int(ret_val);
32200 des_xmlTextReaderPtr(n_reader, reader, 0);
32201 xmlResetLastError();
32202 if (mem_base != xmlMemBlocks()) {
32203 printf("Leak of %d blocks found in xmlTextReaderNormalization",
32204 xmlMemBlocks() - mem_base);
32206 printf(" %d", n_reader);
32218 test_xmlTextReaderPrefix(void) {
32221 #if defined(LIBXML_READER_ENABLED)
32224 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32227 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32228 mem_base = xmlMemBlocks();
32229 reader = gen_xmlTextReaderPtr(n_reader, 0);
32231 ret_val = xmlTextReaderPrefix(reader);
32232 desret_xmlChar_ptr(ret_val);
32234 des_xmlTextReaderPtr(n_reader, reader, 0);
32235 xmlResetLastError();
32236 if (mem_base != xmlMemBlocks()) {
32237 printf("Leak of %d blocks found in xmlTextReaderPrefix",
32238 xmlMemBlocks() - mem_base);
32240 printf(" %d", n_reader);
32252 test_xmlTextReaderPreserve(void) {
32255 #if defined(LIBXML_READER_ENABLED)
32257 xmlNodePtr ret_val;
32258 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32261 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32262 mem_base = xmlMemBlocks();
32263 reader = gen_xmlTextReaderPtr(n_reader, 0);
32265 ret_val = xmlTextReaderPreserve(reader);
32266 desret_xmlNodePtr(ret_val);
32268 des_xmlTextReaderPtr(n_reader, reader, 0);
32269 xmlResetLastError();
32270 if (mem_base != xmlMemBlocks()) {
32271 printf("Leak of %d blocks found in xmlTextReaderPreserve",
32272 xmlMemBlocks() - mem_base);
32274 printf(" %d", n_reader);
32286 test_xmlTextReaderPreservePattern(void) {
32289 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32290 #ifdef LIBXML_PATTERN_ENABLED
32293 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32295 xmlChar * pattern; /* an XPath subset pattern */
32297 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32300 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32301 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32302 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32303 mem_base = xmlMemBlocks();
32304 reader = gen_xmlTextReaderPtr(n_reader, 0);
32305 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32306 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32308 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32309 desret_int(ret_val);
32311 des_xmlTextReaderPtr(n_reader, reader, 0);
32312 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32313 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32314 xmlResetLastError();
32315 if (mem_base != xmlMemBlocks()) {
32316 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32317 xmlMemBlocks() - mem_base);
32319 printf(" %d", n_reader);
32320 printf(" %d", n_pattern);
32321 printf(" %d", n_namespaces);
32336 test_xmlTextReaderQuoteChar(void) {
32339 #if defined(LIBXML_READER_ENABLED)
32342 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32345 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32346 mem_base = xmlMemBlocks();
32347 reader = gen_xmlTextReaderPtr(n_reader, 0);
32349 ret_val = xmlTextReaderQuoteChar(reader);
32350 desret_int(ret_val);
32352 des_xmlTextReaderPtr(n_reader, reader, 0);
32353 xmlResetLastError();
32354 if (mem_base != xmlMemBlocks()) {
32355 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32356 xmlMemBlocks() - mem_base);
32358 printf(" %d", n_reader);
32370 test_xmlTextReaderRead(void) {
32373 #if defined(LIBXML_READER_ENABLED)
32376 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32379 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32380 mem_base = xmlMemBlocks();
32381 reader = gen_xmlTextReaderPtr(n_reader, 0);
32383 ret_val = xmlTextReaderRead(reader);
32384 desret_int(ret_val);
32386 des_xmlTextReaderPtr(n_reader, reader, 0);
32387 xmlResetLastError();
32388 if (mem_base != xmlMemBlocks()) {
32389 printf("Leak of %d blocks found in xmlTextReaderRead",
32390 xmlMemBlocks() - mem_base);
32392 printf(" %d", n_reader);
32404 test_xmlTextReaderReadAttributeValue(void) {
32407 #if defined(LIBXML_READER_ENABLED)
32410 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32413 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32414 mem_base = xmlMemBlocks();
32415 reader = gen_xmlTextReaderPtr(n_reader, 0);
32417 ret_val = xmlTextReaderReadAttributeValue(reader);
32418 desret_int(ret_val);
32420 des_xmlTextReaderPtr(n_reader, reader, 0);
32421 xmlResetLastError();
32422 if (mem_base != xmlMemBlocks()) {
32423 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32424 xmlMemBlocks() - mem_base);
32426 printf(" %d", n_reader);
32438 test_xmlTextReaderReadState(void) {
32441 #if defined(LIBXML_READER_ENABLED)
32444 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32447 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32448 mem_base = xmlMemBlocks();
32449 reader = gen_xmlTextReaderPtr(n_reader, 0);
32451 ret_val = xmlTextReaderReadState(reader);
32452 desret_int(ret_val);
32454 des_xmlTextReaderPtr(n_reader, reader, 0);
32455 xmlResetLastError();
32456 if (mem_base != xmlMemBlocks()) {
32457 printf("Leak of %d blocks found in xmlTextReaderReadState",
32458 xmlMemBlocks() - mem_base);
32460 printf(" %d", n_reader);
32472 test_xmlTextReaderRelaxNGSetSchema(void) {
32475 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32478 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32480 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32483 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32484 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32485 mem_base = xmlMemBlocks();
32486 reader = gen_xmlTextReaderPtr(n_reader, 0);
32487 schema = gen_xmlRelaxNGPtr(n_schema, 1);
32489 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32490 desret_int(ret_val);
32492 des_xmlTextReaderPtr(n_reader, reader, 0);
32493 des_xmlRelaxNGPtr(n_schema, schema, 1);
32494 xmlResetLastError();
32495 if (mem_base != xmlMemBlocks()) {
32496 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32497 xmlMemBlocks() - mem_base);
32499 printf(" %d", n_reader);
32500 printf(" %d", n_schema);
32513 test_xmlTextReaderRelaxNGValidate(void) {
32516 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32519 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32521 char * rng; /* the path to a RelaxNG schema or NULL */
32524 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32525 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32526 mem_base = xmlMemBlocks();
32527 reader = gen_xmlTextReaderPtr(n_reader, 0);
32528 rng = gen_const_char_ptr(n_rng, 1);
32530 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32531 desret_int(ret_val);
32533 des_xmlTextReaderPtr(n_reader, reader, 0);
32534 des_const_char_ptr(n_rng, (const char *)rng, 1);
32535 xmlResetLastError();
32536 if (mem_base != xmlMemBlocks()) {
32537 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32538 xmlMemBlocks() - mem_base);
32540 printf(" %d", n_reader);
32541 printf(" %d", n_rng);
32554 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32557 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32560 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32562 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32564 int options; /* options (not used yet) */
32567 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32568 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32569 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32570 mem_base = xmlMemBlocks();
32571 reader = gen_xmlTextReaderPtr(n_reader, 0);
32572 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32573 options = gen_parseroptions(n_options, 2);
32575 ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32576 desret_int(ret_val);
32578 des_xmlTextReaderPtr(n_reader, reader, 0);
32579 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32580 des_parseroptions(n_options, options, 2);
32581 xmlResetLastError();
32582 if (mem_base != xmlMemBlocks()) {
32583 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32584 xmlMemBlocks() - mem_base);
32586 printf(" %d", n_reader);
32587 printf(" %d", n_ctxt);
32588 printf(" %d", n_options);
32602 test_xmlTextReaderSchemaValidate(void) {
32605 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32607 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32609 char * xsd; /* the path to a W3C XSD schema or NULL */
32612 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32613 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32614 reader = gen_xmlTextReaderPtr(n_reader, 0);
32615 xsd = gen_const_char_ptr(n_xsd, 1);
32617 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32618 desret_int(ret_val);
32620 des_xmlTextReaderPtr(n_reader, reader, 0);
32621 des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32622 xmlResetLastError();
32633 test_xmlTextReaderSchemaValidateCtxt(void) {
32636 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32639 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32641 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32643 int options; /* options (not used yet) */
32646 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32647 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32648 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32649 mem_base = xmlMemBlocks();
32650 reader = gen_xmlTextReaderPtr(n_reader, 0);
32651 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32652 options = gen_parseroptions(n_options, 2);
32654 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32655 desret_int(ret_val);
32657 des_xmlTextReaderPtr(n_reader, reader, 0);
32658 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32659 des_parseroptions(n_options, options, 2);
32660 xmlResetLastError();
32661 if (mem_base != xmlMemBlocks()) {
32662 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32663 xmlMemBlocks() - mem_base);
32665 printf(" %d", n_reader);
32666 printf(" %d", n_ctxt);
32667 printf(" %d", n_options);
32681 test_xmlTextReaderSetErrorHandler(void) {
32685 /* missing type support */
32691 test_xmlTextReaderSetParserProp(void) {
32694 #if defined(LIBXML_READER_ENABLED)
32697 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32699 int prop; /* the xmlParserProperties to set */
32701 int value; /* usually 0 or 1 to (de)activate it */
32704 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32705 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32706 for (n_value = 0;n_value < gen_nb_int;n_value++) {
32707 mem_base = xmlMemBlocks();
32708 reader = gen_xmlTextReaderPtr(n_reader, 0);
32709 prop = gen_int(n_prop, 1);
32710 value = gen_int(n_value, 2);
32712 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32713 desret_int(ret_val);
32715 des_xmlTextReaderPtr(n_reader, reader, 0);
32716 des_int(n_prop, prop, 1);
32717 des_int(n_value, value, 2);
32718 xmlResetLastError();
32719 if (mem_base != xmlMemBlocks()) {
32720 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32721 xmlMemBlocks() - mem_base);
32723 printf(" %d", n_reader);
32724 printf(" %d", n_prop);
32725 printf(" %d", n_value);
32739 test_xmlTextReaderSetSchema(void) {
32742 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32745 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32747 xmlSchemaPtr schema; /* a precompiled Schema schema */
32750 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32751 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32752 mem_base = xmlMemBlocks();
32753 reader = gen_xmlTextReaderPtr(n_reader, 0);
32754 schema = gen_xmlSchemaPtr(n_schema, 1);
32756 ret_val = xmlTextReaderSetSchema(reader, schema);
32757 desret_int(ret_val);
32759 des_xmlTextReaderPtr(n_reader, reader, 0);
32760 des_xmlSchemaPtr(n_schema, schema, 1);
32761 xmlResetLastError();
32762 if (mem_base != xmlMemBlocks()) {
32763 printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32764 xmlMemBlocks() - mem_base);
32766 printf(" %d", n_reader);
32767 printf(" %d", n_schema);
32780 test_xmlTextReaderSetStructuredErrorHandler(void) {
32784 /* missing type support */
32790 test_xmlTextReaderSetup(void) {
32793 #if defined(LIBXML_READER_ENABLED)
32796 xmlTextReaderPtr reader; /* an XML reader */
32798 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32800 const char * URL; /* the base URL to use for the document */
32802 char * encoding; /* the document encoding, or NULL */
32804 int options; /* a combination of xmlParserOption */
32807 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32808 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32809 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32810 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32811 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32812 mem_base = xmlMemBlocks();
32813 reader = gen_xmlTextReaderPtr(n_reader, 0);
32814 input = gen_xmlParserInputBufferPtr(n_input, 1);
32815 URL = gen_filepath(n_URL, 2);
32816 encoding = gen_const_char_ptr(n_encoding, 3);
32817 options = gen_parseroptions(n_options, 4);
32819 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32820 desret_int(ret_val);
32822 des_xmlTextReaderPtr(n_reader, reader, 0);
32823 des_filepath(n_URL, URL, 2);
32824 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32825 des_parseroptions(n_options, options, 4);
32826 xmlResetLastError();
32827 if (mem_base != xmlMemBlocks()) {
32828 printf("Leak of %d blocks found in xmlTextReaderSetup",
32829 xmlMemBlocks() - mem_base);
32831 printf(" %d", n_reader);
32832 printf(" %d", n_input);
32833 printf(" %d", n_URL);
32834 printf(" %d", n_encoding);
32835 printf(" %d", n_options);
32851 test_xmlTextReaderStandalone(void) {
32854 #if defined(LIBXML_READER_ENABLED)
32857 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32860 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32861 mem_base = xmlMemBlocks();
32862 reader = gen_xmlTextReaderPtr(n_reader, 0);
32864 ret_val = xmlTextReaderStandalone(reader);
32865 desret_int(ret_val);
32867 des_xmlTextReaderPtr(n_reader, reader, 0);
32868 xmlResetLastError();
32869 if (mem_base != xmlMemBlocks()) {
32870 printf("Leak of %d blocks found in xmlTextReaderStandalone",
32871 xmlMemBlocks() - mem_base);
32873 printf(" %d", n_reader);
32885 test_xmlTextReaderValue(void) {
32888 #if defined(LIBXML_READER_ENABLED)
32891 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32894 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32895 mem_base = xmlMemBlocks();
32896 reader = gen_xmlTextReaderPtr(n_reader, 0);
32898 ret_val = xmlTextReaderValue(reader);
32899 desret_xmlChar_ptr(ret_val);
32901 des_xmlTextReaderPtr(n_reader, reader, 0);
32902 xmlResetLastError();
32903 if (mem_base != xmlMemBlocks()) {
32904 printf("Leak of %d blocks found in xmlTextReaderValue",
32905 xmlMemBlocks() - mem_base);
32907 printf(" %d", n_reader);
32919 test_xmlTextReaderXmlLang(void) {
32922 #if defined(LIBXML_READER_ENABLED)
32925 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32928 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32929 mem_base = xmlMemBlocks();
32930 reader = gen_xmlTextReaderPtr(n_reader, 0);
32932 ret_val = xmlTextReaderXmlLang(reader);
32933 desret_xmlChar_ptr(ret_val);
32935 des_xmlTextReaderPtr(n_reader, reader, 0);
32936 xmlResetLastError();
32937 if (mem_base != xmlMemBlocks()) {
32938 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32939 xmlMemBlocks() - mem_base);
32941 printf(" %d", n_reader);
32952 test_xmlreader(void) {
32955 if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
32956 test_ret += test_xmlNewTextReader();
32957 test_ret += test_xmlNewTextReaderFilename();
32958 test_ret += test_xmlReaderForDoc();
32959 test_ret += test_xmlReaderForFile();
32960 test_ret += test_xmlReaderForMemory();
32961 test_ret += test_xmlReaderNewDoc();
32962 test_ret += test_xmlReaderNewFile();
32963 test_ret += test_xmlReaderNewMemory();
32964 test_ret += test_xmlReaderNewWalker();
32965 test_ret += test_xmlReaderWalker();
32966 test_ret += test_xmlTextReaderAttributeCount();
32967 test_ret += test_xmlTextReaderBaseUri();
32968 test_ret += test_xmlTextReaderByteConsumed();
32969 test_ret += test_xmlTextReaderClose();
32970 test_ret += test_xmlTextReaderConstBaseUri();
32971 test_ret += test_xmlTextReaderConstEncoding();
32972 test_ret += test_xmlTextReaderConstLocalName();
32973 test_ret += test_xmlTextReaderConstName();
32974 test_ret += test_xmlTextReaderConstNamespaceUri();
32975 test_ret += test_xmlTextReaderConstPrefix();
32976 test_ret += test_xmlTextReaderConstString();
32977 test_ret += test_xmlTextReaderConstValue();
32978 test_ret += test_xmlTextReaderConstXmlLang();
32979 test_ret += test_xmlTextReaderConstXmlVersion();
32980 test_ret += test_xmlTextReaderCurrentDoc();
32981 test_ret += test_xmlTextReaderCurrentNode();
32982 test_ret += test_xmlTextReaderDepth();
32983 test_ret += test_xmlTextReaderExpand();
32984 test_ret += test_xmlTextReaderGetAttribute();
32985 test_ret += test_xmlTextReaderGetAttributeNo();
32986 test_ret += test_xmlTextReaderGetAttributeNs();
32987 test_ret += test_xmlTextReaderGetErrorHandler();
32988 test_ret += test_xmlTextReaderGetParserColumnNumber();
32989 test_ret += test_xmlTextReaderGetParserLineNumber();
32990 test_ret += test_xmlTextReaderGetParserProp();
32991 test_ret += test_xmlTextReaderGetRemainder();
32992 test_ret += test_xmlTextReaderHasAttributes();
32993 test_ret += test_xmlTextReaderHasValue();
32994 test_ret += test_xmlTextReaderIsDefault();
32995 test_ret += test_xmlTextReaderIsEmptyElement();
32996 test_ret += test_xmlTextReaderIsNamespaceDecl();
32997 test_ret += test_xmlTextReaderIsValid();
32998 test_ret += test_xmlTextReaderLocalName();
32999 test_ret += test_xmlTextReaderLocatorBaseURI();
33000 test_ret += test_xmlTextReaderLocatorLineNumber();
33001 test_ret += test_xmlTextReaderLookupNamespace();
33002 test_ret += test_xmlTextReaderMoveToAttribute();
33003 test_ret += test_xmlTextReaderMoveToAttributeNo();
33004 test_ret += test_xmlTextReaderMoveToAttributeNs();
33005 test_ret += test_xmlTextReaderMoveToElement();
33006 test_ret += test_xmlTextReaderMoveToFirstAttribute();
33007 test_ret += test_xmlTextReaderMoveToNextAttribute();
33008 test_ret += test_xmlTextReaderName();
33009 test_ret += test_xmlTextReaderNamespaceUri();
33010 test_ret += test_xmlTextReaderNext();
33011 test_ret += test_xmlTextReaderNextSibling();
33012 test_ret += test_xmlTextReaderNodeType();
33013 test_ret += test_xmlTextReaderNormalization();
33014 test_ret += test_xmlTextReaderPrefix();
33015 test_ret += test_xmlTextReaderPreserve();
33016 test_ret += test_xmlTextReaderPreservePattern();
33017 test_ret += test_xmlTextReaderQuoteChar();
33018 test_ret += test_xmlTextReaderRead();
33019 test_ret += test_xmlTextReaderReadAttributeValue();
33020 test_ret += test_xmlTextReaderReadState();
33021 test_ret += test_xmlTextReaderRelaxNGSetSchema();
33022 test_ret += test_xmlTextReaderRelaxNGValidate();
33023 test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33024 test_ret += test_xmlTextReaderSchemaValidate();
33025 test_ret += test_xmlTextReaderSchemaValidateCtxt();
33026 test_ret += test_xmlTextReaderSetErrorHandler();
33027 test_ret += test_xmlTextReaderSetParserProp();
33028 test_ret += test_xmlTextReaderSetSchema();
33029 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33030 test_ret += test_xmlTextReaderSetup();
33031 test_ret += test_xmlTextReaderStandalone();
33032 test_ret += test_xmlTextReaderValue();
33033 test_ret += test_xmlTextReaderXmlLang();
33036 printf("Module xmlreader: %d errors\n", test_ret);
33041 test_xmlExpCtxtNbCons(void) {
33044 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33047 xmlExpCtxtPtr ctxt; /* an expression context */
33050 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33051 mem_base = xmlMemBlocks();
33052 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33054 ret_val = xmlExpCtxtNbCons(ctxt);
33055 desret_int(ret_val);
33057 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33058 xmlResetLastError();
33059 if (mem_base != xmlMemBlocks()) {
33060 printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33061 xmlMemBlocks() - mem_base);
33063 printf(" %d", n_ctxt);
33075 test_xmlExpCtxtNbNodes(void) {
33078 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33081 xmlExpCtxtPtr ctxt; /* an expression context */
33084 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33085 mem_base = xmlMemBlocks();
33086 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33088 ret_val = xmlExpCtxtNbNodes(ctxt);
33089 desret_int(ret_val);
33091 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33092 xmlResetLastError();
33093 if (mem_base != xmlMemBlocks()) {
33094 printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33095 xmlMemBlocks() - mem_base);
33097 printf(" %d", n_ctxt);
33109 test_xmlExpDump(void) {
33112 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33114 xmlBufferPtr buf; /* a buffer to receive the output */
33116 xmlExpNodePtr expr; /* the compiled expression */
33119 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33120 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33121 mem_base = xmlMemBlocks();
33122 buf = gen_xmlBufferPtr(n_buf, 0);
33123 expr = gen_xmlExpNodePtr(n_expr, 1);
33125 xmlExpDump(buf, expr);
33127 des_xmlBufferPtr(n_buf, buf, 0);
33128 des_xmlExpNodePtr(n_expr, expr, 1);
33129 xmlResetLastError();
33130 if (mem_base != xmlMemBlocks()) {
33131 printf("Leak of %d blocks found in xmlExpDump",
33132 xmlMemBlocks() - mem_base);
33134 printf(" %d", n_buf);
33135 printf(" %d", n_expr);
33148 test_xmlExpExpDerive(void) {
33152 /* missing type support */
33158 test_xmlExpGetLanguage(void) {
33161 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33164 xmlExpCtxtPtr ctxt; /* the expression context */
33166 xmlExpNodePtr exp; /* the expression */
33168 xmlChar ** langList; /* where to store the tokens */
33170 int len; /* the allocated length of @list */
33173 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33174 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33175 for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33176 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33177 mem_base = xmlMemBlocks();
33178 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33179 exp = gen_xmlExpNodePtr(n_exp, 1);
33180 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33181 len = gen_int(n_len, 3);
33183 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33184 desret_int(ret_val);
33186 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33187 des_xmlExpNodePtr(n_exp, exp, 1);
33188 des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33189 des_int(n_len, len, 3);
33190 xmlResetLastError();
33191 if (mem_base != xmlMemBlocks()) {
33192 printf("Leak of %d blocks found in xmlExpGetLanguage",
33193 xmlMemBlocks() - mem_base);
33195 printf(" %d", n_ctxt);
33196 printf(" %d", n_exp);
33197 printf(" %d", n_langList);
33198 printf(" %d", n_len);
33213 test_xmlExpGetStart(void) {
33216 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33219 xmlExpCtxtPtr ctxt; /* the expression context */
33221 xmlExpNodePtr exp; /* the expression */
33223 xmlChar ** tokList; /* where to store the tokens */
33225 int len; /* the allocated length of @list */
33228 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33229 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33230 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33231 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33232 mem_base = xmlMemBlocks();
33233 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33234 exp = gen_xmlExpNodePtr(n_exp, 1);
33235 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33236 len = gen_int(n_len, 3);
33238 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33239 desret_int(ret_val);
33241 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33242 des_xmlExpNodePtr(n_exp, exp, 1);
33243 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33244 des_int(n_len, len, 3);
33245 xmlResetLastError();
33246 if (mem_base != xmlMemBlocks()) {
33247 printf("Leak of %d blocks found in xmlExpGetStart",
33248 xmlMemBlocks() - mem_base);
33250 printf(" %d", n_ctxt);
33251 printf(" %d", n_exp);
33252 printf(" %d", n_tokList);
33253 printf(" %d", n_len);
33268 test_xmlExpIsNillable(void) {
33271 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33274 xmlExpNodePtr exp; /* the expression */
33277 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33278 mem_base = xmlMemBlocks();
33279 exp = gen_xmlExpNodePtr(n_exp, 0);
33281 ret_val = xmlExpIsNillable(exp);
33282 desret_int(ret_val);
33284 des_xmlExpNodePtr(n_exp, exp, 0);
33285 xmlResetLastError();
33286 if (mem_base != xmlMemBlocks()) {
33287 printf("Leak of %d blocks found in xmlExpIsNillable",
33288 xmlMemBlocks() - mem_base);
33290 printf(" %d", n_exp);
33302 test_xmlExpMaxToken(void) {
33305 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33308 xmlExpNodePtr expr; /* a compiled expression */
33311 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33312 mem_base = xmlMemBlocks();
33313 expr = gen_xmlExpNodePtr(n_expr, 0);
33315 ret_val = xmlExpMaxToken(expr);
33316 desret_int(ret_val);
33318 des_xmlExpNodePtr(n_expr, expr, 0);
33319 xmlResetLastError();
33320 if (mem_base != xmlMemBlocks()) {
33321 printf("Leak of %d blocks found in xmlExpMaxToken",
33322 xmlMemBlocks() - mem_base);
33324 printf(" %d", n_expr);
33336 test_xmlExpNewAtom(void) {
33340 /* missing type support */
33346 test_xmlExpNewCtxt(void) {
33350 /* missing type support */
33356 test_xmlExpNewOr(void) {
33360 /* missing type support */
33366 test_xmlExpNewRange(void) {
33370 /* missing type support */
33376 test_xmlExpNewSeq(void) {
33380 /* missing type support */
33386 test_xmlExpParse(void) {
33390 /* missing type support */
33396 test_xmlExpRef(void) {
33399 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33401 xmlExpNodePtr exp; /* the expression */
33404 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33405 mem_base = xmlMemBlocks();
33406 exp = gen_xmlExpNodePtr(n_exp, 0);
33410 des_xmlExpNodePtr(n_exp, exp, 0);
33411 xmlResetLastError();
33412 if (mem_base != xmlMemBlocks()) {
33413 printf("Leak of %d blocks found in xmlExpRef",
33414 xmlMemBlocks() - mem_base);
33416 printf(" %d", n_exp);
33428 test_xmlExpStringDerive(void) {
33432 /* missing type support */
33438 test_xmlExpSubsume(void) {
33441 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33444 xmlExpCtxtPtr ctxt; /* the expressions context */
33446 xmlExpNodePtr exp; /* the englobing expression */
33448 xmlExpNodePtr sub; /* the subexpression */
33451 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33452 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33453 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33454 mem_base = xmlMemBlocks();
33455 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33456 exp = gen_xmlExpNodePtr(n_exp, 1);
33457 sub = gen_xmlExpNodePtr(n_sub, 2);
33459 ret_val = xmlExpSubsume(ctxt, exp, sub);
33460 desret_int(ret_val);
33462 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33463 des_xmlExpNodePtr(n_exp, exp, 1);
33464 des_xmlExpNodePtr(n_sub, sub, 2);
33465 xmlResetLastError();
33466 if (mem_base != xmlMemBlocks()) {
33467 printf("Leak of %d blocks found in xmlExpSubsume",
33468 xmlMemBlocks() - mem_base);
33470 printf(" %d", n_ctxt);
33471 printf(" %d", n_exp);
33472 printf(" %d", n_sub);
33484 #ifdef LIBXML_REGEXP_ENABLED
33486 #define gen_nb_xmlRegExecCtxtPtr 1
33487 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33490 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33496 test_xmlRegExecErrInfo(void) {
33499 #if defined(LIBXML_REGEXP_ENABLED)
33502 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33504 xmlChar ** string; /* return value for the error string */
33506 int * nbval; /* pointer to the number of accepted values IN/OUT */
33508 int * nbneg; /* return number of negative transitions */
33510 xmlChar ** values; /* pointer to the array of acceptable values */
33512 int * terminal; /* return value if this was a terminal state */
33515 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33516 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33517 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33518 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33519 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33520 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33521 mem_base = xmlMemBlocks();
33522 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33523 string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33524 nbval = gen_int_ptr(n_nbval, 2);
33525 nbneg = gen_int_ptr(n_nbneg, 3);
33526 values = gen_xmlChar_ptr_ptr(n_values, 4);
33527 terminal = gen_int_ptr(n_terminal, 5);
33529 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33530 desret_int(ret_val);
33532 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33533 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33534 des_int_ptr(n_nbval, nbval, 2);
33535 des_int_ptr(n_nbneg, nbneg, 3);
33536 des_xmlChar_ptr_ptr(n_values, values, 4);
33537 des_int_ptr(n_terminal, terminal, 5);
33538 xmlResetLastError();
33539 if (mem_base != xmlMemBlocks()) {
33540 printf("Leak of %d blocks found in xmlRegExecErrInfo",
33541 xmlMemBlocks() - mem_base);
33543 printf(" %d", n_exec);
33544 printf(" %d", n_string);
33545 printf(" %d", n_nbval);
33546 printf(" %d", n_nbneg);
33547 printf(" %d", n_values);
33548 printf(" %d", n_terminal);
33565 test_xmlRegExecNextValues(void) {
33568 #if defined(LIBXML_REGEXP_ENABLED)
33571 xmlRegExecCtxtPtr exec; /* a regexp execution context */
33573 int * nbval; /* pointer to the number of accepted values IN/OUT */
33575 int * nbneg; /* return number of negative transitions */
33577 xmlChar ** values; /* pointer to the array of acceptable values */
33579 int * terminal; /* return value if this was a terminal state */
33582 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33583 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33584 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33585 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33586 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33587 mem_base = xmlMemBlocks();
33588 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33589 nbval = gen_int_ptr(n_nbval, 1);
33590 nbneg = gen_int_ptr(n_nbneg, 2);
33591 values = gen_xmlChar_ptr_ptr(n_values, 3);
33592 terminal = gen_int_ptr(n_terminal, 4);
33594 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33595 desret_int(ret_val);
33597 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33598 des_int_ptr(n_nbval, nbval, 1);
33599 des_int_ptr(n_nbneg, nbneg, 2);
33600 des_xmlChar_ptr_ptr(n_values, values, 3);
33601 des_int_ptr(n_terminal, terminal, 4);
33602 xmlResetLastError();
33603 if (mem_base != xmlMemBlocks()) {
33604 printf("Leak of %d blocks found in xmlRegExecNextValues",
33605 xmlMemBlocks() - mem_base);
33607 printf(" %d", n_exec);
33608 printf(" %d", n_nbval);
33609 printf(" %d", n_nbneg);
33610 printf(" %d", n_values);
33611 printf(" %d", n_terminal);
33627 test_xmlRegExecPushString(void) {
33630 #if defined(LIBXML_REGEXP_ENABLED)
33633 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33635 xmlChar * value; /* a string token input */
33637 void * data; /* data associated to the token to reuse in callbacks */
33640 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33641 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33642 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33643 mem_base = xmlMemBlocks();
33644 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33645 value = gen_const_xmlChar_ptr(n_value, 1);
33646 data = gen_userdata(n_data, 2);
33648 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33649 desret_int(ret_val);
33651 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33652 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33653 des_userdata(n_data, data, 2);
33654 xmlResetLastError();
33655 if (mem_base != xmlMemBlocks()) {
33656 printf("Leak of %d blocks found in xmlRegExecPushString",
33657 xmlMemBlocks() - mem_base);
33659 printf(" %d", n_exec);
33660 printf(" %d", n_value);
33661 printf(" %d", n_data);
33675 test_xmlRegExecPushString2(void) {
33678 #if defined(LIBXML_REGEXP_ENABLED)
33681 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33683 xmlChar * value; /* the first string token input */
33685 xmlChar * value2; /* the second string token input */
33687 void * data; /* data associated to the token to reuse in callbacks */
33690 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33691 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33692 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33693 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33694 mem_base = xmlMemBlocks();
33695 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33696 value = gen_const_xmlChar_ptr(n_value, 1);
33697 value2 = gen_const_xmlChar_ptr(n_value2, 2);
33698 data = gen_userdata(n_data, 3);
33700 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33701 desret_int(ret_val);
33703 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33704 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33705 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33706 des_userdata(n_data, data, 3);
33707 xmlResetLastError();
33708 if (mem_base != xmlMemBlocks()) {
33709 printf("Leak of %d blocks found in xmlRegExecPushString2",
33710 xmlMemBlocks() - mem_base);
33712 printf(" %d", n_exec);
33713 printf(" %d", n_value);
33714 printf(" %d", n_value2);
33715 printf(" %d", n_data);
33728 #ifdef LIBXML_REGEXP_ENABLED
33730 #define gen_nb_xmlRegexpPtr 1
33731 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33734 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33740 test_xmlRegNewExecCtxt(void) {
33744 /* missing type support */
33750 test_xmlRegexpCompile(void) {
33754 /* missing type support */
33760 test_xmlRegexpExec(void) {
33763 #if defined(LIBXML_REGEXP_ENABLED)
33766 xmlRegexpPtr comp; /* the compiled regular expression */
33768 xmlChar * content; /* the value to check against the regular expression */
33771 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33772 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33773 mem_base = xmlMemBlocks();
33774 comp = gen_xmlRegexpPtr(n_comp, 0);
33775 content = gen_const_xmlChar_ptr(n_content, 1);
33777 ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33778 desret_int(ret_val);
33780 des_xmlRegexpPtr(n_comp, comp, 0);
33781 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33782 xmlResetLastError();
33783 if (mem_base != xmlMemBlocks()) {
33784 printf("Leak of %d blocks found in xmlRegexpExec",
33785 xmlMemBlocks() - mem_base);
33787 printf(" %d", n_comp);
33788 printf(" %d", n_content);
33801 test_xmlRegexpIsDeterminist(void) {
33804 #if defined(LIBXML_REGEXP_ENABLED)
33807 xmlRegexpPtr comp; /* the compiled regular expression */
33810 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33811 mem_base = xmlMemBlocks();
33812 comp = gen_xmlRegexpPtr(n_comp, 0);
33814 ret_val = xmlRegexpIsDeterminist(comp);
33815 desret_int(ret_val);
33817 des_xmlRegexpPtr(n_comp, comp, 0);
33818 xmlResetLastError();
33819 if (mem_base != xmlMemBlocks()) {
33820 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33821 xmlMemBlocks() - mem_base);
33823 printf(" %d", n_comp);
33835 test_xmlRegexpPrint(void) {
33838 #if defined(LIBXML_REGEXP_ENABLED)
33840 FILE * output; /* the file for the output debug */
33842 xmlRegexpPtr regexp; /* the compiled regexp */
33845 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33846 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33847 mem_base = xmlMemBlocks();
33848 output = gen_FILE_ptr(n_output, 0);
33849 regexp = gen_xmlRegexpPtr(n_regexp, 1);
33851 xmlRegexpPrint(output, regexp);
33853 des_FILE_ptr(n_output, output, 0);
33854 des_xmlRegexpPtr(n_regexp, regexp, 1);
33855 xmlResetLastError();
33856 if (mem_base != xmlMemBlocks()) {
33857 printf("Leak of %d blocks found in xmlRegexpPrint",
33858 xmlMemBlocks() - mem_base);
33860 printf(" %d", n_output);
33861 printf(" %d", n_regexp);
33873 test_xmlregexp(void) {
33876 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33877 test_ret += test_xmlExpCtxtNbCons();
33878 test_ret += test_xmlExpCtxtNbNodes();
33879 test_ret += test_xmlExpDump();
33880 test_ret += test_xmlExpExpDerive();
33881 test_ret += test_xmlExpGetLanguage();
33882 test_ret += test_xmlExpGetStart();
33883 test_ret += test_xmlExpIsNillable();
33884 test_ret += test_xmlExpMaxToken();
33885 test_ret += test_xmlExpNewAtom();
33886 test_ret += test_xmlExpNewCtxt();
33887 test_ret += test_xmlExpNewOr();
33888 test_ret += test_xmlExpNewRange();
33889 test_ret += test_xmlExpNewSeq();
33890 test_ret += test_xmlExpParse();
33891 test_ret += test_xmlExpRef();
33892 test_ret += test_xmlExpStringDerive();
33893 test_ret += test_xmlExpSubsume();
33894 test_ret += test_xmlRegExecErrInfo();
33895 test_ret += test_xmlRegExecNextValues();
33896 test_ret += test_xmlRegExecPushString();
33897 test_ret += test_xmlRegExecPushString2();
33898 test_ret += test_xmlRegNewExecCtxt();
33899 test_ret += test_xmlRegexpCompile();
33900 test_ret += test_xmlRegexpExec();
33901 test_ret += test_xmlRegexpIsDeterminist();
33902 test_ret += test_xmlRegexpPrint();
33905 printf("Module xmlregexp: %d errors\n", test_ret);
33908 #ifdef LIBXML_OUTPUT_ENABLED
33910 #define gen_nb_xmlSaveCtxtPtr 1
33911 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33914 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33920 test_xmlSaveClose(void) {
33923 #if defined(LIBXML_OUTPUT_ENABLED)
33926 xmlSaveCtxtPtr ctxt; /* a document saving context */
33929 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33930 mem_base = xmlMemBlocks();
33931 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33933 ret_val = xmlSaveClose(ctxt);
33934 desret_int(ret_val);
33936 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33937 xmlResetLastError();
33938 if (mem_base != xmlMemBlocks()) {
33939 printf("Leak of %d blocks found in xmlSaveClose",
33940 xmlMemBlocks() - mem_base);
33942 printf(" %d", n_ctxt);
33954 test_xmlSaveDoc(void) {
33957 #if defined(LIBXML_OUTPUT_ENABLED)
33960 xmlSaveCtxtPtr ctxt; /* a document saving context */
33962 xmlDocPtr doc; /* a document */
33965 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33966 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33967 mem_base = xmlMemBlocks();
33968 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33969 doc = gen_xmlDocPtr(n_doc, 1);
33971 ret_val = xmlSaveDoc(ctxt, doc);
33972 desret_long(ret_val);
33974 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33975 des_xmlDocPtr(n_doc, doc, 1);
33976 xmlResetLastError();
33977 if (mem_base != xmlMemBlocks()) {
33978 printf("Leak of %d blocks found in xmlSaveDoc",
33979 xmlMemBlocks() - mem_base);
33981 printf(" %d", n_ctxt);
33982 printf(" %d", n_doc);
33995 test_xmlSaveFlush(void) {
33998 #if defined(LIBXML_OUTPUT_ENABLED)
34001 xmlSaveCtxtPtr ctxt; /* a document saving context */
34004 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34005 mem_base = xmlMemBlocks();
34006 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34008 ret_val = xmlSaveFlush(ctxt);
34009 desret_int(ret_val);
34011 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34012 xmlResetLastError();
34013 if (mem_base != xmlMemBlocks()) {
34014 printf("Leak of %d blocks found in xmlSaveFlush",
34015 xmlMemBlocks() - mem_base);
34017 printf(" %d", n_ctxt);
34029 test_xmlSaveSetAttrEscape(void) {
34033 /* missing type support */
34039 test_xmlSaveSetEscape(void) {
34043 /* missing type support */
34049 test_xmlSaveToBuffer(void) {
34053 /* missing type support */
34059 test_xmlSaveToFd(void) {
34063 /* missing type support */
34069 test_xmlSaveToFilename(void) {
34073 /* missing type support */
34079 test_xmlSaveTree(void) {
34082 #if defined(LIBXML_OUTPUT_ENABLED)
34085 xmlSaveCtxtPtr ctxt; /* a document saving context */
34087 xmlNodePtr node; /* the top node of the subtree to save */
34090 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34091 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34092 mem_base = xmlMemBlocks();
34093 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34094 node = gen_xmlNodePtr(n_node, 1);
34096 ret_val = xmlSaveTree(ctxt, node);
34097 desret_long(ret_val);
34099 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34100 des_xmlNodePtr(n_node, node, 1);
34101 xmlResetLastError();
34102 if (mem_base != xmlMemBlocks()) {
34103 printf("Leak of %d blocks found in xmlSaveTree",
34104 xmlMemBlocks() - mem_base);
34106 printf(" %d", n_ctxt);
34107 printf(" %d", n_node);
34119 test_xmlsave(void) {
34122 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34123 test_ret += test_xmlSaveClose();
34124 test_ret += test_xmlSaveDoc();
34125 test_ret += test_xmlSaveFlush();
34126 test_ret += test_xmlSaveSetAttrEscape();
34127 test_ret += test_xmlSaveSetEscape();
34128 test_ret += test_xmlSaveToBuffer();
34129 test_ret += test_xmlSaveToFd();
34130 test_ret += test_xmlSaveToFilename();
34131 test_ret += test_xmlSaveTree();
34134 printf("Module xmlsave: %d errors\n", test_ret);
34139 test_xmlSchemaDump(void) {
34142 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34144 FILE * output; /* the file output */
34146 xmlSchemaPtr schema; /* a schema structure */
34149 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34150 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34151 mem_base = xmlMemBlocks();
34152 output = gen_FILE_ptr(n_output, 0);
34153 schema = gen_xmlSchemaPtr(n_schema, 1);
34155 xmlSchemaDump(output, schema);
34157 des_FILE_ptr(n_output, output, 0);
34158 des_xmlSchemaPtr(n_schema, schema, 1);
34159 xmlResetLastError();
34160 if (mem_base != xmlMemBlocks()) {
34161 printf("Leak of %d blocks found in xmlSchemaDump",
34162 xmlMemBlocks() - mem_base);
34164 printf(" %d", n_output);
34165 printf(" %d", n_schema);
34176 #ifdef LIBXML_SCHEMAS_ENABLED
34178 #define gen_nb_xmlSchemaParserCtxtPtr 1
34179 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34182 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34186 #ifdef LIBXML_SCHEMAS_ENABLED
34188 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
34189 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34192 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34196 #ifdef LIBXML_SCHEMAS_ENABLED
34198 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
34199 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34202 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34208 test_xmlSchemaGetParserErrors(void) {
34211 #if defined(LIBXML_SCHEMAS_ENABLED)
34214 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34216 xmlSchemaValidityErrorFunc * err; /* the error callback result */
34218 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34220 void ** ctx; /* contextual data for the callbacks result */
34223 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34224 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34225 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34226 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34227 mem_base = xmlMemBlocks();
34228 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34229 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34230 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34231 ctx = gen_void_ptr_ptr(n_ctx, 3);
34233 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34234 desret_int(ret_val);
34236 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34237 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34238 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34239 des_void_ptr_ptr(n_ctx, ctx, 3);
34240 xmlResetLastError();
34241 if (mem_base != xmlMemBlocks()) {
34242 printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34243 xmlMemBlocks() - mem_base);
34245 printf(" %d", n_ctxt);
34246 printf(" %d", n_err);
34247 printf(" %d", n_warn);
34248 printf(" %d", n_ctx);
34263 test_xmlSchemaGetValidErrors(void) {
34266 #if defined(LIBXML_SCHEMAS_ENABLED)
34269 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34271 xmlSchemaValidityErrorFunc * err; /* the error function result */
34273 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34275 void ** ctx; /* the functions context result */
34278 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34279 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34280 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34281 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34282 mem_base = xmlMemBlocks();
34283 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34284 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34285 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34286 ctx = gen_void_ptr_ptr(n_ctx, 3);
34288 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34289 desret_int(ret_val);
34291 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34292 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34293 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34294 des_void_ptr_ptr(n_ctx, ctx, 3);
34295 xmlResetLastError();
34296 if (mem_base != xmlMemBlocks()) {
34297 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34298 xmlMemBlocks() - mem_base);
34300 printf(" %d", n_ctxt);
34301 printf(" %d", n_err);
34302 printf(" %d", n_warn);
34303 printf(" %d", n_ctx);
34318 test_xmlSchemaIsValid(void) {
34321 #if defined(LIBXML_SCHEMAS_ENABLED)
34324 xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34327 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34328 mem_base = xmlMemBlocks();
34329 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34331 ret_val = xmlSchemaIsValid(ctxt);
34332 desret_int(ret_val);
34334 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34335 xmlResetLastError();
34336 if (mem_base != xmlMemBlocks()) {
34337 printf("Leak of %d blocks found in xmlSchemaIsValid",
34338 xmlMemBlocks() - mem_base);
34340 printf(" %d", n_ctxt);
34352 test_xmlSchemaNewDocParserCtxt(void) {
34355 #if defined(LIBXML_SCHEMAS_ENABLED)
34357 xmlSchemaParserCtxtPtr ret_val;
34358 xmlDocPtr doc; /* a preparsed document tree */
34361 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34362 mem_base = xmlMemBlocks();
34363 doc = gen_xmlDocPtr(n_doc, 0);
34365 ret_val = xmlSchemaNewDocParserCtxt(doc);
34366 desret_xmlSchemaParserCtxtPtr(ret_val);
34368 des_xmlDocPtr(n_doc, doc, 0);
34369 xmlResetLastError();
34370 if (mem_base != xmlMemBlocks()) {
34371 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34372 xmlMemBlocks() - mem_base);
34374 printf(" %d", n_doc);
34386 test_xmlSchemaNewMemParserCtxt(void) {
34389 #if defined(LIBXML_SCHEMAS_ENABLED)
34391 xmlSchemaParserCtxtPtr ret_val;
34392 char * buffer; /* a pointer to a char array containing the schemas */
34394 int size; /* the size of the array */
34397 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34398 for (n_size = 0;n_size < gen_nb_int;n_size++) {
34399 mem_base = xmlMemBlocks();
34400 buffer = gen_const_char_ptr(n_buffer, 0);
34401 size = gen_int(n_size, 1);
34403 ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34404 desret_xmlSchemaParserCtxtPtr(ret_val);
34406 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34407 des_int(n_size, size, 1);
34408 xmlResetLastError();
34409 if (mem_base != xmlMemBlocks()) {
34410 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34411 xmlMemBlocks() - mem_base);
34413 printf(" %d", n_buffer);
34414 printf(" %d", n_size);
34427 test_xmlSchemaNewParserCtxt(void) {
34430 #if defined(LIBXML_SCHEMAS_ENABLED)
34432 xmlSchemaParserCtxtPtr ret_val;
34433 char * URL; /* the location of the schema */
34436 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34437 mem_base = xmlMemBlocks();
34438 URL = gen_const_char_ptr(n_URL, 0);
34440 ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34441 desret_xmlSchemaParserCtxtPtr(ret_val);
34443 des_const_char_ptr(n_URL, (const char *)URL, 0);
34444 xmlResetLastError();
34445 if (mem_base != xmlMemBlocks()) {
34446 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34447 xmlMemBlocks() - mem_base);
34449 printf(" %d", n_URL);
34461 test_xmlSchemaNewValidCtxt(void) {
34465 /* missing type support */
34471 test_xmlSchemaParse(void) {
34475 /* missing type support */
34479 #ifdef LIBXML_SCHEMAS_ENABLED
34481 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34482 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34485 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34491 test_xmlSchemaSAXPlug(void) {
34495 /* missing type support */
34499 #ifdef LIBXML_SCHEMAS_ENABLED
34501 #define gen_nb_xmlSchemaSAXPlugPtr 1
34502 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34505 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34511 test_xmlSchemaSAXUnplug(void) {
34514 #if defined(LIBXML_SCHEMAS_ENABLED)
34517 xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34520 for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34521 mem_base = xmlMemBlocks();
34522 plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34524 ret_val = xmlSchemaSAXUnplug(plug);
34525 desret_int(ret_val);
34527 des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34528 xmlResetLastError();
34529 if (mem_base != xmlMemBlocks()) {
34530 printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34531 xmlMemBlocks() - mem_base);
34533 printf(" %d", n_plug);
34545 test_xmlSchemaSetParserErrors(void) {
34549 /* missing type support */
34555 test_xmlSchemaSetParserStructuredErrors(void) {
34559 /* missing type support */
34565 test_xmlSchemaSetValidErrors(void) {
34569 /* missing type support */
34575 test_xmlSchemaSetValidOptions(void) {
34578 #if defined(LIBXML_SCHEMAS_ENABLED)
34581 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34583 int options; /* a combination of xmlSchemaValidOption */
34586 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34587 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34588 mem_base = xmlMemBlocks();
34589 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34590 options = gen_int(n_options, 1);
34592 ret_val = xmlSchemaSetValidOptions(ctxt, options);
34593 desret_int(ret_val);
34595 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34596 des_int(n_options, options, 1);
34597 xmlResetLastError();
34598 if (mem_base != xmlMemBlocks()) {
34599 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34600 xmlMemBlocks() - mem_base);
34602 printf(" %d", n_ctxt);
34603 printf(" %d", n_options);
34616 test_xmlSchemaSetValidStructuredErrors(void) {
34620 /* missing type support */
34626 test_xmlSchemaValidCtxtGetOptions(void) {
34629 #if defined(LIBXML_SCHEMAS_ENABLED)
34632 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34635 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34636 mem_base = xmlMemBlocks();
34637 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34639 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34640 desret_int(ret_val);
34642 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34643 xmlResetLastError();
34644 if (mem_base != xmlMemBlocks()) {
34645 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34646 xmlMemBlocks() - mem_base);
34648 printf(" %d", n_ctxt);
34660 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34663 #if defined(LIBXML_SCHEMAS_ENABLED)
34665 xmlParserCtxtPtr ret_val;
34666 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34669 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34670 mem_base = xmlMemBlocks();
34671 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34673 ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34674 desret_xmlParserCtxtPtr(ret_val);
34676 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34677 xmlResetLastError();
34678 if (mem_base != xmlMemBlocks()) {
34679 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34680 xmlMemBlocks() - mem_base);
34682 printf(" %d", n_ctxt);
34694 test_xmlSchemaValidateDoc(void) {
34697 #if defined(LIBXML_SCHEMAS_ENABLED)
34700 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34702 xmlDocPtr doc; /* a parsed document tree */
34705 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34706 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34707 mem_base = xmlMemBlocks();
34708 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34709 doc = gen_xmlDocPtr(n_doc, 1);
34711 ret_val = xmlSchemaValidateDoc(ctxt, doc);
34712 desret_int(ret_val);
34714 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34715 des_xmlDocPtr(n_doc, doc, 1);
34716 xmlResetLastError();
34717 if (mem_base != xmlMemBlocks()) {
34718 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34719 xmlMemBlocks() - mem_base);
34721 printf(" %d", n_ctxt);
34722 printf(" %d", n_doc);
34735 test_xmlSchemaValidateFile(void) {
34738 #if defined(LIBXML_SCHEMAS_ENABLED)
34741 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34743 const char * filename; /* the URI of the instance */
34745 int options; /* a future set of options, currently unused */
34748 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34749 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34750 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34751 mem_base = xmlMemBlocks();
34752 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34753 filename = gen_filepath(n_filename, 1);
34754 options = gen_int(n_options, 2);
34756 ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34757 desret_int(ret_val);
34759 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34760 des_filepath(n_filename, filename, 1);
34761 des_int(n_options, options, 2);
34762 xmlResetLastError();
34763 if (mem_base != xmlMemBlocks()) {
34764 printf("Leak of %d blocks found in xmlSchemaValidateFile",
34765 xmlMemBlocks() - mem_base);
34767 printf(" %d", n_ctxt);
34768 printf(" %d", n_filename);
34769 printf(" %d", n_options);
34783 test_xmlSchemaValidateOneElement(void) {
34786 #if defined(LIBXML_SCHEMAS_ENABLED)
34789 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34791 xmlNodePtr elem; /* an element node */
34794 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34795 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34796 mem_base = xmlMemBlocks();
34797 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34798 elem = gen_xmlNodePtr(n_elem, 1);
34800 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34801 desret_int(ret_val);
34803 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34804 des_xmlNodePtr(n_elem, elem, 1);
34805 xmlResetLastError();
34806 if (mem_base != xmlMemBlocks()) {
34807 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34808 xmlMemBlocks() - mem_base);
34810 printf(" %d", n_ctxt);
34811 printf(" %d", n_elem);
34824 test_xmlSchemaValidateSetFilename(void) {
34827 #if defined(LIBXML_SCHEMAS_ENABLED)
34829 xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34831 const char * filename; /* the file name */
34834 for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34835 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34836 mem_base = xmlMemBlocks();
34837 vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34838 filename = gen_filepath(n_filename, 1);
34840 xmlSchemaValidateSetFilename(vctxt, filename);
34842 des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34843 des_filepath(n_filename, filename, 1);
34844 xmlResetLastError();
34845 if (mem_base != xmlMemBlocks()) {
34846 printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34847 xmlMemBlocks() - mem_base);
34849 printf(" %d", n_vctxt);
34850 printf(" %d", n_filename);
34863 test_xmlSchemaValidateSetLocator(void) {
34867 /* missing type support */
34873 test_xmlSchemaValidateStream(void) {
34876 #if defined(LIBXML_SCHEMAS_ENABLED)
34879 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34881 xmlParserInputBufferPtr input; /* the input to use for reading the data */
34883 xmlCharEncoding enc; /* an optional encoding information */
34885 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34887 void * user_data; /* the context to provide to the SAX handler. */
34890 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34891 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34892 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34893 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34894 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34895 mem_base = xmlMemBlocks();
34896 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34897 input = gen_xmlParserInputBufferPtr(n_input, 1);
34898 enc = gen_xmlCharEncoding(n_enc, 2);
34899 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34900 user_data = gen_userdata(n_user_data, 4);
34902 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34903 desret_int(ret_val);
34905 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34906 des_xmlParserInputBufferPtr(n_input, input, 1);
34907 des_xmlCharEncoding(n_enc, enc, 2);
34908 des_xmlSAXHandlerPtr(n_sax, sax, 3);
34909 des_userdata(n_user_data, user_data, 4);
34910 xmlResetLastError();
34911 if (mem_base != xmlMemBlocks()) {
34912 printf("Leak of %d blocks found in xmlSchemaValidateStream",
34913 xmlMemBlocks() - mem_base);
34915 printf(" %d", n_ctxt);
34916 printf(" %d", n_input);
34917 printf(" %d", n_enc);
34918 printf(" %d", n_sax);
34919 printf(" %d", n_user_data);
34934 test_xmlschemas(void) {
34937 if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
34938 test_ret += test_xmlSchemaDump();
34939 test_ret += test_xmlSchemaGetParserErrors();
34940 test_ret += test_xmlSchemaGetValidErrors();
34941 test_ret += test_xmlSchemaIsValid();
34942 test_ret += test_xmlSchemaNewDocParserCtxt();
34943 test_ret += test_xmlSchemaNewMemParserCtxt();
34944 test_ret += test_xmlSchemaNewParserCtxt();
34945 test_ret += test_xmlSchemaNewValidCtxt();
34946 test_ret += test_xmlSchemaParse();
34947 test_ret += test_xmlSchemaSAXPlug();
34948 test_ret += test_xmlSchemaSAXUnplug();
34949 test_ret += test_xmlSchemaSetParserErrors();
34950 test_ret += test_xmlSchemaSetParserStructuredErrors();
34951 test_ret += test_xmlSchemaSetValidErrors();
34952 test_ret += test_xmlSchemaSetValidOptions();
34953 test_ret += test_xmlSchemaSetValidStructuredErrors();
34954 test_ret += test_xmlSchemaValidCtxtGetOptions();
34955 test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34956 test_ret += test_xmlSchemaValidateDoc();
34957 test_ret += test_xmlSchemaValidateFile();
34958 test_ret += test_xmlSchemaValidateOneElement();
34959 test_ret += test_xmlSchemaValidateSetFilename();
34960 test_ret += test_xmlSchemaValidateSetLocator();
34961 test_ret += test_xmlSchemaValidateStream();
34964 printf("Module xmlschemas: %d errors\n", test_ret);
34967 #ifdef LIBXML_SCHEMAS_ENABLED
34969 #define gen_nb_xmlSchemaFacetPtr 1
34970 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34973 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34977 #ifdef LIBXML_SCHEMAS_ENABLED
34979 #define gen_nb_xmlSchemaTypePtr 1
34980 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34983 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34989 test_xmlSchemaCheckFacet(void) {
34992 #if defined(LIBXML_SCHEMAS_ENABLED)
34995 xmlSchemaFacetPtr facet; /* the facet */
34997 xmlSchemaTypePtr typeDecl; /* the schema type definition */
34999 xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35001 xmlChar * name; /* the optional name of the type */
35004 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35005 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35006 for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35007 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35008 mem_base = xmlMemBlocks();
35009 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35010 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35011 pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35012 name = gen_const_xmlChar_ptr(n_name, 3);
35014 ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35015 desret_int(ret_val);
35017 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35018 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35019 des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35020 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35021 xmlResetLastError();
35022 if (mem_base != xmlMemBlocks()) {
35023 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35024 xmlMemBlocks() - mem_base);
35026 printf(" %d", n_facet);
35027 printf(" %d", n_typeDecl);
35028 printf(" %d", n_pctxt);
35029 printf(" %d", n_name);
35044 test_xmlSchemaCleanupTypes(void) {
35047 #if defined(LIBXML_SCHEMAS_ENABLED)
35050 xmlSchemaCleanupTypes();
35052 xmlResetLastError();
35061 test_xmlSchemaCollapseString(void) {
35064 #if defined(LIBXML_SCHEMAS_ENABLED)
35067 xmlChar * value; /* a value */
35070 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35071 mem_base = xmlMemBlocks();
35072 value = gen_const_xmlChar_ptr(n_value, 0);
35074 ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35075 desret_xmlChar_ptr(ret_val);
35077 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35078 xmlResetLastError();
35079 if (mem_base != xmlMemBlocks()) {
35080 printf("Leak of %d blocks found in xmlSchemaCollapseString",
35081 xmlMemBlocks() - mem_base);
35083 printf(" %d", n_value);
35093 #ifdef LIBXML_SCHEMAS_ENABLED
35095 #define gen_nb_xmlSchemaValPtr 1
35096 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35099 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35105 test_xmlSchemaCompareValues(void) {
35108 #if defined(LIBXML_SCHEMAS_ENABLED)
35111 xmlSchemaValPtr x; /* a first value */
35113 xmlSchemaValPtr y; /* a second value */
35116 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35117 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35118 mem_base = xmlMemBlocks();
35119 x = gen_xmlSchemaValPtr(n_x, 0);
35120 y = gen_xmlSchemaValPtr(n_y, 1);
35122 ret_val = xmlSchemaCompareValues(x, y);
35123 desret_int(ret_val);
35125 des_xmlSchemaValPtr(n_x, x, 0);
35126 des_xmlSchemaValPtr(n_y, y, 1);
35127 xmlResetLastError();
35128 if (mem_base != xmlMemBlocks()) {
35129 printf("Leak of %d blocks found in xmlSchemaCompareValues",
35130 xmlMemBlocks() - mem_base);
35132 printf(" %d", n_x);
35133 printf(" %d", n_y);
35146 test_xmlSchemaCompareValuesWhtsp(void) {
35149 #if defined(LIBXML_SCHEMAS_ENABLED)
35152 xmlSchemaValPtr x; /* a first value */
35154 xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35156 xmlSchemaValPtr y; /* a second value */
35158 xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35161 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35162 for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35163 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35164 for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35165 mem_base = xmlMemBlocks();
35166 x = gen_xmlSchemaValPtr(n_x, 0);
35167 xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35168 y = gen_xmlSchemaValPtr(n_y, 2);
35169 yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35171 ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35172 desret_int(ret_val);
35174 des_xmlSchemaValPtr(n_x, x, 0);
35175 des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35176 des_xmlSchemaValPtr(n_y, y, 2);
35177 des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35178 xmlResetLastError();
35179 if (mem_base != xmlMemBlocks()) {
35180 printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35181 xmlMemBlocks() - mem_base);
35183 printf(" %d", n_x);
35184 printf(" %d", n_xws);
35185 printf(" %d", n_y);
35186 printf(" %d", n_yws);
35201 test_xmlSchemaCopyValue(void) {
35205 /* missing type support */
35211 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35214 #if defined(LIBXML_SCHEMAS_ENABLED)
35216 xmlSchemaTypePtr ret_val;
35217 xmlSchemaTypePtr type; /* the built-in simple type. */
35220 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35221 mem_base = xmlMemBlocks();
35222 type = gen_xmlSchemaTypePtr(n_type, 0);
35224 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35225 desret_xmlSchemaTypePtr(ret_val);
35227 des_xmlSchemaTypePtr(n_type, type, 0);
35228 xmlResetLastError();
35229 if (mem_base != xmlMemBlocks()) {
35230 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35231 xmlMemBlocks() - mem_base);
35233 printf(" %d", n_type);
35245 test_xmlSchemaGetBuiltInType(void) {
35248 #if defined(LIBXML_SCHEMAS_ENABLED)
35249 xmlSchemaTypePtr ret_val;
35250 xmlSchemaValType type; /* the type of the built in type */
35253 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35254 type = gen_xmlSchemaValType(n_type, 0);
35256 ret_val = xmlSchemaGetBuiltInType(type);
35257 desret_xmlSchemaTypePtr(ret_val);
35259 des_xmlSchemaValType(n_type, type, 0);
35260 xmlResetLastError();
35270 test_xmlSchemaGetCanonValue(void) {
35273 #if defined(LIBXML_SCHEMAS_ENABLED)
35276 xmlSchemaValPtr val; /* the precomputed value */
35278 xmlChar ** retValue; /* the returned value */
35281 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35282 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35283 mem_base = xmlMemBlocks();
35284 val = gen_xmlSchemaValPtr(n_val, 0);
35285 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35287 ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35288 desret_int(ret_val);
35290 des_xmlSchemaValPtr(n_val, val, 0);
35291 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35292 xmlResetLastError();
35293 if (mem_base != xmlMemBlocks()) {
35294 printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35295 xmlMemBlocks() - mem_base);
35297 printf(" %d", n_val);
35298 printf(" %d", n_retValue);
35311 test_xmlSchemaGetCanonValueWhtsp(void) {
35314 #if defined(LIBXML_SCHEMAS_ENABLED)
35317 xmlSchemaValPtr val; /* the precomputed value */
35319 xmlChar ** retValue; /* the returned value */
35321 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35324 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35325 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35326 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35327 mem_base = xmlMemBlocks();
35328 val = gen_xmlSchemaValPtr(n_val, 0);
35329 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35330 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35332 ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35333 desret_int(ret_val);
35335 des_xmlSchemaValPtr(n_val, val, 0);
35336 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35337 des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35338 xmlResetLastError();
35339 if (mem_base != xmlMemBlocks()) {
35340 printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35341 xmlMemBlocks() - mem_base);
35343 printf(" %d", n_val);
35344 printf(" %d", n_retValue);
35345 printf(" %d", n_ws);
35359 test_xmlSchemaGetFacetValueAsULong(void) {
35362 #if defined(LIBXML_SCHEMAS_ENABLED)
35364 unsigned long ret_val;
35365 xmlSchemaFacetPtr facet; /* an schemas type facet */
35368 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35369 mem_base = xmlMemBlocks();
35370 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35372 ret_val = xmlSchemaGetFacetValueAsULong(facet);
35373 desret_unsigned_long(ret_val);
35375 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35376 xmlResetLastError();
35377 if (mem_base != xmlMemBlocks()) {
35378 printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35379 xmlMemBlocks() - mem_base);
35381 printf(" %d", n_facet);
35393 test_xmlSchemaGetPredefinedType(void) {
35396 #if defined(LIBXML_SCHEMAS_ENABLED)
35398 xmlSchemaTypePtr ret_val;
35399 xmlChar * name; /* the type name */
35401 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35404 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35405 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35406 mem_base = xmlMemBlocks();
35407 name = gen_const_xmlChar_ptr(n_name, 0);
35408 ns = gen_const_xmlChar_ptr(n_ns, 1);
35410 ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35411 desret_xmlSchemaTypePtr(ret_val);
35413 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35414 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35415 xmlResetLastError();
35416 if (mem_base != xmlMemBlocks()) {
35417 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35418 xmlMemBlocks() - mem_base);
35420 printf(" %d", n_name);
35421 printf(" %d", n_ns);
35434 test_xmlSchemaGetValType(void) {
35437 #if defined(LIBXML_SCHEMAS_ENABLED)
35439 xmlSchemaValType ret_val;
35440 xmlSchemaValPtr val; /* a schemas value */
35443 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35444 mem_base = xmlMemBlocks();
35445 val = gen_xmlSchemaValPtr(n_val, 0);
35447 ret_val = xmlSchemaGetValType(val);
35448 desret_xmlSchemaValType(ret_val);
35450 des_xmlSchemaValPtr(n_val, val, 0);
35451 xmlResetLastError();
35452 if (mem_base != xmlMemBlocks()) {
35453 printf("Leak of %d blocks found in xmlSchemaGetValType",
35454 xmlMemBlocks() - mem_base);
35456 printf(" %d", n_val);
35468 test_xmlSchemaInitTypes(void) {
35471 #if defined(LIBXML_SCHEMAS_ENABLED)
35474 xmlSchemaInitTypes();
35476 xmlResetLastError();
35485 test_xmlSchemaIsBuiltInTypeFacet(void) {
35488 #if defined(LIBXML_SCHEMAS_ENABLED)
35491 xmlSchemaTypePtr type; /* the built-in type */
35493 int facetType; /* the facet type */
35496 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35497 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35498 mem_base = xmlMemBlocks();
35499 type = gen_xmlSchemaTypePtr(n_type, 0);
35500 facetType = gen_int(n_facetType, 1);
35502 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35503 desret_int(ret_val);
35505 des_xmlSchemaTypePtr(n_type, type, 0);
35506 des_int(n_facetType, facetType, 1);
35507 xmlResetLastError();
35508 if (mem_base != xmlMemBlocks()) {
35509 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35510 xmlMemBlocks() - mem_base);
35512 printf(" %d", n_type);
35513 printf(" %d", n_facetType);
35526 test_xmlSchemaNewFacet(void) {
35530 /* missing type support */
35536 test_xmlSchemaNewNOTATIONValue(void) {
35540 /* missing type support */
35546 test_xmlSchemaNewQNameValue(void) {
35550 /* missing type support */
35556 test_xmlSchemaNewStringValue(void) {
35560 /* missing type support */
35564 #ifdef LIBXML_SCHEMAS_ENABLED
35566 #define gen_nb_xmlSchemaValPtr_ptr 1
35567 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35570 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35576 test_xmlSchemaValPredefTypeNode(void) {
35579 #if defined(LIBXML_SCHEMAS_ENABLED)
35582 xmlSchemaTypePtr type; /* the predefined type */
35584 xmlChar * value; /* the value to check */
35586 xmlSchemaValPtr * val; /* the return computed value */
35588 xmlNodePtr node; /* the node containing the value */
35591 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35592 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35593 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35594 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35595 mem_base = xmlMemBlocks();
35596 type = gen_xmlSchemaTypePtr(n_type, 0);
35597 value = gen_const_xmlChar_ptr(n_value, 1);
35598 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35599 node = gen_xmlNodePtr(n_node, 3);
35601 ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35602 desret_int(ret_val);
35604 des_xmlSchemaTypePtr(n_type, type, 0);
35605 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35606 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35607 des_xmlNodePtr(n_node, node, 3);
35608 xmlResetLastError();
35609 if (mem_base != xmlMemBlocks()) {
35610 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35611 xmlMemBlocks() - mem_base);
35613 printf(" %d", n_type);
35614 printf(" %d", n_value);
35615 printf(" %d", n_val);
35616 printf(" %d", n_node);
35631 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35634 #if defined(LIBXML_SCHEMAS_ENABLED)
35637 xmlSchemaTypePtr type; /* the predefined type */
35639 xmlChar * value; /* the value to check */
35641 xmlSchemaValPtr * val; /* the return computed value */
35643 xmlNodePtr node; /* the node containing the value */
35646 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35647 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35648 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35649 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35650 mem_base = xmlMemBlocks();
35651 type = gen_xmlSchemaTypePtr(n_type, 0);
35652 value = gen_const_xmlChar_ptr(n_value, 1);
35653 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35654 node = gen_xmlNodePtr(n_node, 3);
35656 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35657 desret_int(ret_val);
35659 des_xmlSchemaTypePtr(n_type, type, 0);
35660 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35661 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35662 des_xmlNodePtr(n_node, node, 3);
35663 xmlResetLastError();
35664 if (mem_base != xmlMemBlocks()) {
35665 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35666 xmlMemBlocks() - mem_base);
35668 printf(" %d", n_type);
35669 printf(" %d", n_value);
35670 printf(" %d", n_val);
35671 printf(" %d", n_node);
35686 test_xmlSchemaValidateFacet(void) {
35689 #if defined(LIBXML_SCHEMAS_ENABLED)
35692 xmlSchemaTypePtr base; /* the base type */
35694 xmlSchemaFacetPtr facet; /* the facet to check */
35696 xmlChar * value; /* the lexical repr of the value to validate */
35698 xmlSchemaValPtr val; /* the precomputed value */
35701 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35702 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35703 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35704 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35705 mem_base = xmlMemBlocks();
35706 base = gen_xmlSchemaTypePtr(n_base, 0);
35707 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35708 value = gen_const_xmlChar_ptr(n_value, 2);
35709 val = gen_xmlSchemaValPtr(n_val, 3);
35711 ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35712 desret_int(ret_val);
35714 des_xmlSchemaTypePtr(n_base, base, 0);
35715 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35716 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35717 des_xmlSchemaValPtr(n_val, val, 3);
35718 xmlResetLastError();
35719 if (mem_base != xmlMemBlocks()) {
35720 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35721 xmlMemBlocks() - mem_base);
35723 printf(" %d", n_base);
35724 printf(" %d", n_facet);
35725 printf(" %d", n_value);
35726 printf(" %d", n_val);
35741 test_xmlSchemaValidateFacetWhtsp(void) {
35744 #if defined(LIBXML_SCHEMAS_ENABLED)
35747 xmlSchemaFacetPtr facet; /* the facet to check */
35749 xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35751 xmlSchemaValType valType; /* the built-in type of the value */
35753 xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35755 xmlSchemaValPtr val; /* the precomputed value */
35757 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35760 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35761 for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35762 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35763 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35764 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35765 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35766 mem_base = xmlMemBlocks();
35767 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35768 fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35769 valType = gen_xmlSchemaValType(n_valType, 2);
35770 value = gen_const_xmlChar_ptr(n_value, 3);
35771 val = gen_xmlSchemaValPtr(n_val, 4);
35772 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35774 ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35775 desret_int(ret_val);
35777 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35778 des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35779 des_xmlSchemaValType(n_valType, valType, 2);
35780 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35781 des_xmlSchemaValPtr(n_val, val, 4);
35782 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35783 xmlResetLastError();
35784 if (mem_base != xmlMemBlocks()) {
35785 printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35786 xmlMemBlocks() - mem_base);
35788 printf(" %d", n_facet);
35789 printf(" %d", n_fws);
35790 printf(" %d", n_valType);
35791 printf(" %d", n_value);
35792 printf(" %d", n_val);
35793 printf(" %d", n_ws);
35810 test_xmlSchemaValidateLengthFacet(void) {
35813 #if defined(LIBXML_SCHEMAS_ENABLED)
35816 xmlSchemaTypePtr type; /* the built-in type */
35818 xmlSchemaFacetPtr facet; /* the facet to check */
35820 xmlChar * value; /* the lexical repr. of the value to be validated */
35822 xmlSchemaValPtr val; /* the precomputed value */
35824 unsigned long * length; /* the actual length of the value */
35827 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35828 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35829 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35830 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35831 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35832 mem_base = xmlMemBlocks();
35833 type = gen_xmlSchemaTypePtr(n_type, 0);
35834 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35835 value = gen_const_xmlChar_ptr(n_value, 2);
35836 val = gen_xmlSchemaValPtr(n_val, 3);
35837 length = gen_unsigned_long_ptr(n_length, 4);
35839 ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35840 desret_int(ret_val);
35842 des_xmlSchemaTypePtr(n_type, type, 0);
35843 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35844 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35845 des_xmlSchemaValPtr(n_val, val, 3);
35846 des_unsigned_long_ptr(n_length, length, 4);
35847 xmlResetLastError();
35848 if (mem_base != xmlMemBlocks()) {
35849 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35850 xmlMemBlocks() - mem_base);
35852 printf(" %d", n_type);
35853 printf(" %d", n_facet);
35854 printf(" %d", n_value);
35855 printf(" %d", n_val);
35856 printf(" %d", n_length);
35872 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35875 #if defined(LIBXML_SCHEMAS_ENABLED)
35878 xmlSchemaFacetPtr facet; /* the facet to check */
35880 xmlSchemaValType valType; /* the built-in type */
35882 xmlChar * value; /* the lexical repr. of the value to be validated */
35884 xmlSchemaValPtr val; /* the precomputed value */
35886 unsigned long * length; /* the actual length of the value */
35888 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35891 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35892 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35893 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35894 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35895 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35896 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35897 mem_base = xmlMemBlocks();
35898 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35899 valType = gen_xmlSchemaValType(n_valType, 1);
35900 value = gen_const_xmlChar_ptr(n_value, 2);
35901 val = gen_xmlSchemaValPtr(n_val, 3);
35902 length = gen_unsigned_long_ptr(n_length, 4);
35903 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35905 ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35906 desret_int(ret_val);
35908 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35909 des_xmlSchemaValType(n_valType, valType, 1);
35910 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35911 des_xmlSchemaValPtr(n_val, val, 3);
35912 des_unsigned_long_ptr(n_length, length, 4);
35913 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35914 xmlResetLastError();
35915 if (mem_base != xmlMemBlocks()) {
35916 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35917 xmlMemBlocks() - mem_base);
35919 printf(" %d", n_facet);
35920 printf(" %d", n_valType);
35921 printf(" %d", n_value);
35922 printf(" %d", n_val);
35923 printf(" %d", n_length);
35924 printf(" %d", n_ws);
35941 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35944 #if defined(LIBXML_SCHEMAS_ENABLED)
35947 xmlSchemaFacetPtr facet; /* the facet to check */
35949 xmlChar * value; /* the lexical repr of the value to validate */
35951 unsigned long actualLen; /* the number of list items */
35953 unsigned long * expectedLen; /* the resulting expected number of list items */
35956 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35957 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35958 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35959 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35960 mem_base = xmlMemBlocks();
35961 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35962 value = gen_const_xmlChar_ptr(n_value, 1);
35963 actualLen = gen_unsigned_long(n_actualLen, 2);
35964 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35966 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35967 desret_int(ret_val);
35969 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35970 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35971 des_unsigned_long(n_actualLen, actualLen, 2);
35972 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35973 xmlResetLastError();
35974 if (mem_base != xmlMemBlocks()) {
35975 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35976 xmlMemBlocks() - mem_base);
35978 printf(" %d", n_facet);
35979 printf(" %d", n_value);
35980 printf(" %d", n_actualLen);
35981 printf(" %d", n_expectedLen);
35996 test_xmlSchemaValidatePredefinedType(void) {
35999 #if defined(LIBXML_SCHEMAS_ENABLED)
36002 xmlSchemaTypePtr type; /* the predefined type */
36004 xmlChar * value; /* the value to check */
36006 xmlSchemaValPtr * val; /* the return computed value */
36009 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36010 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36011 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36012 mem_base = xmlMemBlocks();
36013 type = gen_xmlSchemaTypePtr(n_type, 0);
36014 value = gen_const_xmlChar_ptr(n_value, 1);
36015 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36017 ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36018 desret_int(ret_val);
36020 des_xmlSchemaTypePtr(n_type, type, 0);
36021 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36022 des_xmlSchemaValPtr_ptr(n_val, val, 2);
36023 xmlResetLastError();
36024 if (mem_base != xmlMemBlocks()) {
36025 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36026 xmlMemBlocks() - mem_base);
36028 printf(" %d", n_type);
36029 printf(" %d", n_value);
36030 printf(" %d", n_val);
36044 test_xmlSchemaValueAppend(void) {
36047 #if defined(LIBXML_SCHEMAS_ENABLED)
36050 xmlSchemaValPtr prev; /* the value */
36052 xmlSchemaValPtr cur; /* the value to be appended */
36055 for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36056 for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36057 mem_base = xmlMemBlocks();
36058 prev = gen_xmlSchemaValPtr(n_prev, 0);
36059 cur = gen_xmlSchemaValPtr(n_cur, 1);
36061 ret_val = xmlSchemaValueAppend(prev, cur);
36062 desret_int(ret_val);
36064 des_xmlSchemaValPtr(n_prev, prev, 0);
36065 des_xmlSchemaValPtr(n_cur, cur, 1);
36066 xmlResetLastError();
36067 if (mem_base != xmlMemBlocks()) {
36068 printf("Leak of %d blocks found in xmlSchemaValueAppend",
36069 xmlMemBlocks() - mem_base);
36071 printf(" %d", n_prev);
36072 printf(" %d", n_cur);
36085 test_xmlSchemaValueGetAsBoolean(void) {
36088 #if defined(LIBXML_SCHEMAS_ENABLED)
36091 xmlSchemaValPtr val; /* the value */
36094 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36095 mem_base = xmlMemBlocks();
36096 val = gen_xmlSchemaValPtr(n_val, 0);
36098 ret_val = xmlSchemaValueGetAsBoolean(val);
36099 desret_int(ret_val);
36101 des_xmlSchemaValPtr(n_val, val, 0);
36102 xmlResetLastError();
36103 if (mem_base != xmlMemBlocks()) {
36104 printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36105 xmlMemBlocks() - mem_base);
36107 printf(" %d", n_val);
36119 test_xmlSchemaValueGetAsString(void) {
36122 #if defined(LIBXML_SCHEMAS_ENABLED)
36124 const xmlChar * ret_val;
36125 xmlSchemaValPtr val; /* the value */
36128 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36129 mem_base = xmlMemBlocks();
36130 val = gen_xmlSchemaValPtr(n_val, 0);
36132 ret_val = xmlSchemaValueGetAsString(val);
36133 desret_const_xmlChar_ptr(ret_val);
36135 des_xmlSchemaValPtr(n_val, val, 0);
36136 xmlResetLastError();
36137 if (mem_base != xmlMemBlocks()) {
36138 printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36139 xmlMemBlocks() - mem_base);
36141 printf(" %d", n_val);
36153 test_xmlSchemaValueGetNext(void) {
36157 /* missing type support */
36163 test_xmlSchemaWhiteSpaceReplace(void) {
36166 #if defined(LIBXML_SCHEMAS_ENABLED)
36169 xmlChar * value; /* a value */
36172 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36173 mem_base = xmlMemBlocks();
36174 value = gen_const_xmlChar_ptr(n_value, 0);
36176 ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36177 desret_xmlChar_ptr(ret_val);
36179 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36180 xmlResetLastError();
36181 if (mem_base != xmlMemBlocks()) {
36182 printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36183 xmlMemBlocks() - mem_base);
36185 printf(" %d", n_value);
36196 test_xmlschemastypes(void) {
36199 if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36200 test_ret += test_xmlSchemaCheckFacet();
36201 test_ret += test_xmlSchemaCleanupTypes();
36202 test_ret += test_xmlSchemaCollapseString();
36203 test_ret += test_xmlSchemaCompareValues();
36204 test_ret += test_xmlSchemaCompareValuesWhtsp();
36205 test_ret += test_xmlSchemaCopyValue();
36206 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36207 test_ret += test_xmlSchemaGetBuiltInType();
36208 test_ret += test_xmlSchemaGetCanonValue();
36209 test_ret += test_xmlSchemaGetCanonValueWhtsp();
36210 test_ret += test_xmlSchemaGetFacetValueAsULong();
36211 test_ret += test_xmlSchemaGetPredefinedType();
36212 test_ret += test_xmlSchemaGetValType();
36213 test_ret += test_xmlSchemaInitTypes();
36214 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36215 test_ret += test_xmlSchemaNewFacet();
36216 test_ret += test_xmlSchemaNewNOTATIONValue();
36217 test_ret += test_xmlSchemaNewQNameValue();
36218 test_ret += test_xmlSchemaNewStringValue();
36219 test_ret += test_xmlSchemaValPredefTypeNode();
36220 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36221 test_ret += test_xmlSchemaValidateFacet();
36222 test_ret += test_xmlSchemaValidateFacetWhtsp();
36223 test_ret += test_xmlSchemaValidateLengthFacet();
36224 test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36225 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36226 test_ret += test_xmlSchemaValidatePredefinedType();
36227 test_ret += test_xmlSchemaValueAppend();
36228 test_ret += test_xmlSchemaValueGetAsBoolean();
36229 test_ret += test_xmlSchemaValueGetAsString();
36230 test_ret += test_xmlSchemaValueGetNext();
36231 test_ret += test_xmlSchemaWhiteSpaceReplace();
36234 printf("Module xmlschemastypes: %d errors\n", test_ret);
36239 test_xmlCharStrdup(void) {
36244 char * cur; /* the input char * */
36247 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36248 mem_base = xmlMemBlocks();
36249 cur = gen_const_char_ptr(n_cur, 0);
36251 ret_val = xmlCharStrdup((const char *)cur);
36252 desret_xmlChar_ptr(ret_val);
36254 des_const_char_ptr(n_cur, (const char *)cur, 0);
36255 xmlResetLastError();
36256 if (mem_base != xmlMemBlocks()) {
36257 printf("Leak of %d blocks found in xmlCharStrdup",
36258 xmlMemBlocks() - mem_base);
36260 printf(" %d", n_cur);
36271 test_xmlCharStrndup(void) {
36276 char * cur; /* the input char * */
36278 int len; /* the len of @cur */
36281 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36282 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36283 mem_base = xmlMemBlocks();
36284 cur = gen_const_char_ptr(n_cur, 0);
36285 len = gen_int(n_len, 1);
36287 ret_val = xmlCharStrndup((const char *)cur, len);
36288 desret_xmlChar_ptr(ret_val);
36290 des_const_char_ptr(n_cur, (const char *)cur, 0);
36291 des_int(n_len, len, 1);
36292 xmlResetLastError();
36293 if (mem_base != xmlMemBlocks()) {
36294 printf("Leak of %d blocks found in xmlCharStrndup",
36295 xmlMemBlocks() - mem_base);
36297 printf(" %d", n_cur);
36298 printf(" %d", n_len);
36310 test_xmlCheckUTF8(void) {
36315 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36318 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36319 mem_base = xmlMemBlocks();
36320 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36322 ret_val = xmlCheckUTF8((const unsigned char *)utf);
36323 desret_int(ret_val);
36325 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36326 xmlResetLastError();
36327 if (mem_base != xmlMemBlocks()) {
36328 printf("Leak of %d blocks found in xmlCheckUTF8",
36329 xmlMemBlocks() - mem_base);
36331 printf(" %d", n_utf);
36342 test_xmlGetUTF8Char(void) {
36347 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36349 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. */
36352 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36353 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36354 mem_base = xmlMemBlocks();
36355 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36356 len = gen_int_ptr(n_len, 1);
36358 ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36359 desret_int(ret_val);
36361 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36362 des_int_ptr(n_len, len, 1);
36363 xmlResetLastError();
36364 if (mem_base != xmlMemBlocks()) {
36365 printf("Leak of %d blocks found in xmlGetUTF8Char",
36366 xmlMemBlocks() - mem_base);
36368 printf(" %d", n_utf);
36369 printf(" %d", n_len);
36381 test_xmlStrEqual(void) {
36386 xmlChar * str1; /* the first xmlChar * */
36388 xmlChar * str2; /* the second xmlChar * */
36391 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36392 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36393 mem_base = xmlMemBlocks();
36394 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36395 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36397 ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36398 desret_int(ret_val);
36400 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36401 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36402 xmlResetLastError();
36403 if (mem_base != xmlMemBlocks()) {
36404 printf("Leak of %d blocks found in xmlStrEqual",
36405 xmlMemBlocks() - mem_base);
36407 printf(" %d", n_str1);
36408 printf(" %d", n_str2);
36420 test_xmlStrPrintf(void) {
36424 /* missing type support */
36430 test_xmlStrQEqual(void) {
36435 xmlChar * pref; /* the prefix of the QName */
36437 xmlChar * name; /* the localname of the QName */
36439 xmlChar * str; /* the second xmlChar * */
36442 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36443 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36444 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36445 mem_base = xmlMemBlocks();
36446 pref = gen_const_xmlChar_ptr(n_pref, 0);
36447 name = gen_const_xmlChar_ptr(n_name, 1);
36448 str = gen_const_xmlChar_ptr(n_str, 2);
36450 ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36451 desret_int(ret_val);
36453 des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36454 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36455 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36456 xmlResetLastError();
36457 if (mem_base != xmlMemBlocks()) {
36458 printf("Leak of %d blocks found in xmlStrQEqual",
36459 xmlMemBlocks() - mem_base);
36461 printf(" %d", n_pref);
36462 printf(" %d", n_name);
36463 printf(" %d", n_str);
36476 test_xmlStrVPrintf(void) {
36480 /* missing type support */
36486 test_xmlStrcasecmp(void) {
36491 xmlChar * str1; /* the first xmlChar * */
36493 xmlChar * str2; /* the second xmlChar * */
36496 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36497 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36498 mem_base = xmlMemBlocks();
36499 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36500 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36502 ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36503 desret_int(ret_val);
36505 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36506 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36507 xmlResetLastError();
36508 if (mem_base != xmlMemBlocks()) {
36509 printf("Leak of %d blocks found in xmlStrcasecmp",
36510 xmlMemBlocks() - mem_base);
36512 printf(" %d", n_str1);
36513 printf(" %d", n_str2);
36525 test_xmlStrcasestr(void) {
36529 const xmlChar * ret_val;
36530 xmlChar * str; /* the xmlChar * array (haystack) */
36532 xmlChar * val; /* the xmlChar to search (needle) */
36535 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36536 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36537 mem_base = xmlMemBlocks();
36538 str = gen_const_xmlChar_ptr(n_str, 0);
36539 val = gen_const_xmlChar_ptr(n_val, 1);
36541 ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36542 desret_const_xmlChar_ptr(ret_val);
36544 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36545 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36546 xmlResetLastError();
36547 if (mem_base != xmlMemBlocks()) {
36548 printf("Leak of %d blocks found in xmlStrcasestr",
36549 xmlMemBlocks() - mem_base);
36551 printf(" %d", n_str);
36552 printf(" %d", n_val);
36564 test_xmlStrchr(void) {
36568 const xmlChar * ret_val;
36569 xmlChar * str; /* the xmlChar * array */
36571 xmlChar val; /* the xmlChar to search */
36574 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36575 for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36576 mem_base = xmlMemBlocks();
36577 str = gen_const_xmlChar_ptr(n_str, 0);
36578 val = gen_xmlChar(n_val, 1);
36580 ret_val = xmlStrchr((const xmlChar *)str, val);
36581 desret_const_xmlChar_ptr(ret_val);
36583 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36584 des_xmlChar(n_val, val, 1);
36585 xmlResetLastError();
36586 if (mem_base != xmlMemBlocks()) {
36587 printf("Leak of %d blocks found in xmlStrchr",
36588 xmlMemBlocks() - mem_base);
36590 printf(" %d", n_str);
36591 printf(" %d", n_val);
36603 test_xmlStrcmp(void) {
36608 xmlChar * str1; /* the first xmlChar * */
36610 xmlChar * str2; /* the second xmlChar * */
36613 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36614 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36615 mem_base = xmlMemBlocks();
36616 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36617 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36619 ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36620 desret_int(ret_val);
36622 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36623 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36624 xmlResetLastError();
36625 if (mem_base != xmlMemBlocks()) {
36626 printf("Leak of %d blocks found in xmlStrcmp",
36627 xmlMemBlocks() - mem_base);
36629 printf(" %d", n_str1);
36630 printf(" %d", n_str2);
36642 test_xmlStrdup(void) {
36647 xmlChar * cur; /* the input xmlChar * */
36650 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36651 mem_base = xmlMemBlocks();
36652 cur = gen_const_xmlChar_ptr(n_cur, 0);
36654 ret_val = xmlStrdup((const xmlChar *)cur);
36655 desret_xmlChar_ptr(ret_val);
36657 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36658 xmlResetLastError();
36659 if (mem_base != xmlMemBlocks()) {
36660 printf("Leak of %d blocks found in xmlStrdup",
36661 xmlMemBlocks() - mem_base);
36663 printf(" %d", n_cur);
36674 test_xmlStrlen(void) {
36679 xmlChar * str; /* the xmlChar * array */
36682 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36683 mem_base = xmlMemBlocks();
36684 str = gen_const_xmlChar_ptr(n_str, 0);
36686 ret_val = xmlStrlen((const xmlChar *)str);
36687 desret_int(ret_val);
36689 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36690 xmlResetLastError();
36691 if (mem_base != xmlMemBlocks()) {
36692 printf("Leak of %d blocks found in xmlStrlen",
36693 xmlMemBlocks() - mem_base);
36695 printf(" %d", n_str);
36706 test_xmlStrncasecmp(void) {
36711 xmlChar * str1; /* the first xmlChar * */
36713 xmlChar * str2; /* the second xmlChar * */
36715 int len; /* the max comparison length */
36718 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36719 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36720 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36721 mem_base = xmlMemBlocks();
36722 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36723 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36724 len = gen_int(n_len, 2);
36726 ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36727 desret_int(ret_val);
36729 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36730 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36731 des_int(n_len, len, 2);
36732 xmlResetLastError();
36733 if (mem_base != xmlMemBlocks()) {
36734 printf("Leak of %d blocks found in xmlStrncasecmp",
36735 xmlMemBlocks() - mem_base);
36737 printf(" %d", n_str1);
36738 printf(" %d", n_str2);
36739 printf(" %d", n_len);
36752 test_xmlStrncatNew(void) {
36757 xmlChar * str1; /* first xmlChar string */
36759 xmlChar * str2; /* second xmlChar string */
36761 int len; /* the len of @str2 or < 0 */
36764 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36765 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36766 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36767 mem_base = xmlMemBlocks();
36768 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36769 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36770 len = gen_int(n_len, 2);
36772 ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36773 desret_xmlChar_ptr(ret_val);
36775 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36776 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36777 des_int(n_len, len, 2);
36778 xmlResetLastError();
36779 if (mem_base != xmlMemBlocks()) {
36780 printf("Leak of %d blocks found in xmlStrncatNew",
36781 xmlMemBlocks() - mem_base);
36783 printf(" %d", n_str1);
36784 printf(" %d", n_str2);
36785 printf(" %d", n_len);
36798 test_xmlStrncmp(void) {
36803 xmlChar * str1; /* the first xmlChar * */
36805 xmlChar * str2; /* the second xmlChar * */
36807 int len; /* the max comparison length */
36810 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36811 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36812 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36813 mem_base = xmlMemBlocks();
36814 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36815 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36816 len = gen_int(n_len, 2);
36818 ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36819 desret_int(ret_val);
36821 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36822 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36823 des_int(n_len, len, 2);
36824 xmlResetLastError();
36825 if (mem_base != xmlMemBlocks()) {
36826 printf("Leak of %d blocks found in xmlStrncmp",
36827 xmlMemBlocks() - mem_base);
36829 printf(" %d", n_str1);
36830 printf(" %d", n_str2);
36831 printf(" %d", n_len);
36844 test_xmlStrndup(void) {
36849 xmlChar * cur; /* the input xmlChar * */
36851 int len; /* the len of @cur */
36854 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36855 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36856 mem_base = xmlMemBlocks();
36857 cur = gen_const_xmlChar_ptr(n_cur, 0);
36858 len = gen_int(n_len, 1);
36860 ret_val = xmlStrndup((const xmlChar *)cur, len);
36861 desret_xmlChar_ptr(ret_val);
36863 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36864 des_int(n_len, len, 1);
36865 xmlResetLastError();
36866 if (mem_base != xmlMemBlocks()) {
36867 printf("Leak of %d blocks found in xmlStrndup",
36868 xmlMemBlocks() - mem_base);
36870 printf(" %d", n_cur);
36871 printf(" %d", n_len);
36883 test_xmlStrstr(void) {
36887 const xmlChar * ret_val;
36888 xmlChar * str; /* the xmlChar * array (haystack) */
36890 xmlChar * val; /* the xmlChar to search (needle) */
36893 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36894 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36895 mem_base = xmlMemBlocks();
36896 str = gen_const_xmlChar_ptr(n_str, 0);
36897 val = gen_const_xmlChar_ptr(n_val, 1);
36899 ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36900 desret_const_xmlChar_ptr(ret_val);
36902 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36903 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36904 xmlResetLastError();
36905 if (mem_base != xmlMemBlocks()) {
36906 printf("Leak of %d blocks found in xmlStrstr",
36907 xmlMemBlocks() - mem_base);
36909 printf(" %d", n_str);
36910 printf(" %d", n_val);
36922 test_xmlStrsub(void) {
36927 xmlChar * str; /* the xmlChar * array (haystack) */
36929 int start; /* the index of the first char (zero based) */
36931 int len; /* the length of the substring */
36934 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36935 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36936 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36937 mem_base = xmlMemBlocks();
36938 str = gen_const_xmlChar_ptr(n_str, 0);
36939 start = gen_int(n_start, 1);
36940 len = gen_int(n_len, 2);
36942 ret_val = xmlStrsub((const xmlChar *)str, start, len);
36943 desret_xmlChar_ptr(ret_val);
36945 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36946 des_int(n_start, start, 1);
36947 des_int(n_len, len, 2);
36948 xmlResetLastError();
36949 if (mem_base != xmlMemBlocks()) {
36950 printf("Leak of %d blocks found in xmlStrsub",
36951 xmlMemBlocks() - mem_base);
36953 printf(" %d", n_str);
36954 printf(" %d", n_start);
36955 printf(" %d", n_len);
36968 test_xmlUTF8Charcmp(void) {
36973 xmlChar * utf1; /* pointer to first UTF8 char */
36975 xmlChar * utf2; /* pointer to second UTF8 char */
36978 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36979 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36980 mem_base = xmlMemBlocks();
36981 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36982 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36984 ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36985 desret_int(ret_val);
36987 des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36988 des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36989 xmlResetLastError();
36990 if (mem_base != xmlMemBlocks()) {
36991 printf("Leak of %d blocks found in xmlUTF8Charcmp",
36992 xmlMemBlocks() - mem_base);
36994 printf(" %d", n_utf1);
36995 printf(" %d", n_utf2);
37007 test_xmlUTF8Size(void) {
37012 xmlChar * utf; /* pointer to the UTF8 character */
37015 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37016 mem_base = xmlMemBlocks();
37017 utf = gen_const_xmlChar_ptr(n_utf, 0);
37019 ret_val = xmlUTF8Size((const xmlChar *)utf);
37020 desret_int(ret_val);
37022 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37023 xmlResetLastError();
37024 if (mem_base != xmlMemBlocks()) {
37025 printf("Leak of %d blocks found in xmlUTF8Size",
37026 xmlMemBlocks() - mem_base);
37028 printf(" %d", n_utf);
37039 test_xmlUTF8Strlen(void) {
37044 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37047 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37048 mem_base = xmlMemBlocks();
37049 utf = gen_const_xmlChar_ptr(n_utf, 0);
37051 ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37052 desret_int(ret_val);
37054 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37055 xmlResetLastError();
37056 if (mem_base != xmlMemBlocks()) {
37057 printf("Leak of %d blocks found in xmlUTF8Strlen",
37058 xmlMemBlocks() - mem_base);
37060 printf(" %d", n_utf);
37071 test_xmlUTF8Strloc(void) {
37076 xmlChar * utf; /* the input UTF8 * */
37078 xmlChar * utfchar; /* the UTF8 character to be found */
37081 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37082 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37083 mem_base = xmlMemBlocks();
37084 utf = gen_const_xmlChar_ptr(n_utf, 0);
37085 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37087 ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37088 desret_int(ret_val);
37090 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37091 des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37092 xmlResetLastError();
37093 if (mem_base != xmlMemBlocks()) {
37094 printf("Leak of %d blocks found in xmlUTF8Strloc",
37095 xmlMemBlocks() - mem_base);
37097 printf(" %d", n_utf);
37098 printf(" %d", n_utfchar);
37110 test_xmlUTF8Strndup(void) {
37115 xmlChar * utf; /* the input UTF8 * */
37117 int len; /* the len of @utf (in chars) */
37120 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37121 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37122 mem_base = xmlMemBlocks();
37123 utf = gen_const_xmlChar_ptr(n_utf, 0);
37124 len = gen_int(n_len, 1);
37126 ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37127 desret_xmlChar_ptr(ret_val);
37129 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37130 des_int(n_len, len, 1);
37131 xmlResetLastError();
37132 if (mem_base != xmlMemBlocks()) {
37133 printf("Leak of %d blocks found in xmlUTF8Strndup",
37134 xmlMemBlocks() - mem_base);
37136 printf(" %d", n_utf);
37137 printf(" %d", n_len);
37149 test_xmlUTF8Strpos(void) {
37153 const xmlChar * ret_val;
37154 xmlChar * utf; /* the input UTF8 * */
37156 int pos; /* the position of the desired UTF8 char (in chars) */
37159 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37160 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37161 mem_base = xmlMemBlocks();
37162 utf = gen_const_xmlChar_ptr(n_utf, 0);
37163 pos = gen_int(n_pos, 1);
37165 ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37166 desret_const_xmlChar_ptr(ret_val);
37168 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37169 des_int(n_pos, pos, 1);
37170 xmlResetLastError();
37171 if (mem_base != xmlMemBlocks()) {
37172 printf("Leak of %d blocks found in xmlUTF8Strpos",
37173 xmlMemBlocks() - mem_base);
37175 printf(" %d", n_utf);
37176 printf(" %d", n_pos);
37188 test_xmlUTF8Strsize(void) {
37193 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37195 int len; /* the number of characters in the array */
37198 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37199 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37200 mem_base = xmlMemBlocks();
37201 utf = gen_const_xmlChar_ptr(n_utf, 0);
37202 len = gen_int(n_len, 1);
37204 ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37205 desret_int(ret_val);
37207 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37208 des_int(n_len, len, 1);
37209 xmlResetLastError();
37210 if (mem_base != xmlMemBlocks()) {
37211 printf("Leak of %d blocks found in xmlUTF8Strsize",
37212 xmlMemBlocks() - mem_base);
37214 printf(" %d", n_utf);
37215 printf(" %d", n_len);
37227 test_xmlUTF8Strsub(void) {
37232 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37234 int start; /* relative pos of first char */
37236 int len; /* total number to copy */
37239 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37240 for (n_start = 0;n_start < gen_nb_int;n_start++) {
37241 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37242 mem_base = xmlMemBlocks();
37243 utf = gen_const_xmlChar_ptr(n_utf, 0);
37244 start = gen_int(n_start, 1);
37245 len = gen_int(n_len, 2);
37247 ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37248 desret_xmlChar_ptr(ret_val);
37250 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37251 des_int(n_start, start, 1);
37252 des_int(n_len, len, 2);
37253 xmlResetLastError();
37254 if (mem_base != xmlMemBlocks()) {
37255 printf("Leak of %d blocks found in xmlUTF8Strsub",
37256 xmlMemBlocks() - mem_base);
37258 printf(" %d", n_utf);
37259 printf(" %d", n_start);
37260 printf(" %d", n_len);
37272 test_xmlstring(void) {
37275 if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37276 test_ret += test_xmlCharStrdup();
37277 test_ret += test_xmlCharStrndup();
37278 test_ret += test_xmlCheckUTF8();
37279 test_ret += test_xmlGetUTF8Char();
37280 test_ret += test_xmlStrEqual();
37281 test_ret += test_xmlStrPrintf();
37282 test_ret += test_xmlStrQEqual();
37283 test_ret += test_xmlStrVPrintf();
37284 test_ret += test_xmlStrcasecmp();
37285 test_ret += test_xmlStrcasestr();
37286 test_ret += test_xmlStrchr();
37287 test_ret += test_xmlStrcmp();
37288 test_ret += test_xmlStrdup();
37289 test_ret += test_xmlStrlen();
37290 test_ret += test_xmlStrncasecmp();
37291 test_ret += test_xmlStrncatNew();
37292 test_ret += test_xmlStrncmp();
37293 test_ret += test_xmlStrndup();
37294 test_ret += test_xmlStrstr();
37295 test_ret += test_xmlStrsub();
37296 test_ret += test_xmlUTF8Charcmp();
37297 test_ret += test_xmlUTF8Size();
37298 test_ret += test_xmlUTF8Strlen();
37299 test_ret += test_xmlUTF8Strloc();
37300 test_ret += test_xmlUTF8Strndup();
37301 test_ret += test_xmlUTF8Strpos();
37302 test_ret += test_xmlUTF8Strsize();
37303 test_ret += test_xmlUTF8Strsub();
37306 printf("Module xmlstring: %d errors\n", test_ret);
37311 test_xmlUCSIsAegeanNumbers(void) {
37314 #if defined(LIBXML_UNICODE_ENABLED)
37317 int code; /* UCS code point */
37320 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37321 mem_base = xmlMemBlocks();
37322 code = gen_int(n_code, 0);
37324 ret_val = xmlUCSIsAegeanNumbers(code);
37325 desret_int(ret_val);
37327 des_int(n_code, code, 0);
37328 xmlResetLastError();
37329 if (mem_base != xmlMemBlocks()) {
37330 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37331 xmlMemBlocks() - mem_base);
37333 printf(" %d", n_code);
37345 test_xmlUCSIsAlphabeticPresentationForms(void) {
37348 #if defined(LIBXML_UNICODE_ENABLED)
37351 int code; /* UCS code point */
37354 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37355 mem_base = xmlMemBlocks();
37356 code = gen_int(n_code, 0);
37358 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37359 desret_int(ret_val);
37361 des_int(n_code, code, 0);
37362 xmlResetLastError();
37363 if (mem_base != xmlMemBlocks()) {
37364 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37365 xmlMemBlocks() - mem_base);
37367 printf(" %d", n_code);
37379 test_xmlUCSIsArabic(void) {
37382 #if defined(LIBXML_UNICODE_ENABLED)
37385 int code; /* UCS code point */
37388 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37389 mem_base = xmlMemBlocks();
37390 code = gen_int(n_code, 0);
37392 ret_val = xmlUCSIsArabic(code);
37393 desret_int(ret_val);
37395 des_int(n_code, code, 0);
37396 xmlResetLastError();
37397 if (mem_base != xmlMemBlocks()) {
37398 printf("Leak of %d blocks found in xmlUCSIsArabic",
37399 xmlMemBlocks() - mem_base);
37401 printf(" %d", n_code);
37413 test_xmlUCSIsArabicPresentationFormsA(void) {
37416 #if defined(LIBXML_UNICODE_ENABLED)
37419 int code; /* UCS code point */
37422 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37423 mem_base = xmlMemBlocks();
37424 code = gen_int(n_code, 0);
37426 ret_val = xmlUCSIsArabicPresentationFormsA(code);
37427 desret_int(ret_val);
37429 des_int(n_code, code, 0);
37430 xmlResetLastError();
37431 if (mem_base != xmlMemBlocks()) {
37432 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37433 xmlMemBlocks() - mem_base);
37435 printf(" %d", n_code);
37447 test_xmlUCSIsArabicPresentationFormsB(void) {
37450 #if defined(LIBXML_UNICODE_ENABLED)
37453 int code; /* UCS code point */
37456 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37457 mem_base = xmlMemBlocks();
37458 code = gen_int(n_code, 0);
37460 ret_val = xmlUCSIsArabicPresentationFormsB(code);
37461 desret_int(ret_val);
37463 des_int(n_code, code, 0);
37464 xmlResetLastError();
37465 if (mem_base != xmlMemBlocks()) {
37466 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37467 xmlMemBlocks() - mem_base);
37469 printf(" %d", n_code);
37481 test_xmlUCSIsArmenian(void) {
37484 #if defined(LIBXML_UNICODE_ENABLED)
37487 int code; /* UCS code point */
37490 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37491 mem_base = xmlMemBlocks();
37492 code = gen_int(n_code, 0);
37494 ret_val = xmlUCSIsArmenian(code);
37495 desret_int(ret_val);
37497 des_int(n_code, code, 0);
37498 xmlResetLastError();
37499 if (mem_base != xmlMemBlocks()) {
37500 printf("Leak of %d blocks found in xmlUCSIsArmenian",
37501 xmlMemBlocks() - mem_base);
37503 printf(" %d", n_code);
37515 test_xmlUCSIsArrows(void) {
37518 #if defined(LIBXML_UNICODE_ENABLED)
37521 int code; /* UCS code point */
37524 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37525 mem_base = xmlMemBlocks();
37526 code = gen_int(n_code, 0);
37528 ret_val = xmlUCSIsArrows(code);
37529 desret_int(ret_val);
37531 des_int(n_code, code, 0);
37532 xmlResetLastError();
37533 if (mem_base != xmlMemBlocks()) {
37534 printf("Leak of %d blocks found in xmlUCSIsArrows",
37535 xmlMemBlocks() - mem_base);
37537 printf(" %d", n_code);
37549 test_xmlUCSIsBasicLatin(void) {
37552 #if defined(LIBXML_UNICODE_ENABLED)
37555 int code; /* UCS code point */
37558 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37559 mem_base = xmlMemBlocks();
37560 code = gen_int(n_code, 0);
37562 ret_val = xmlUCSIsBasicLatin(code);
37563 desret_int(ret_val);
37565 des_int(n_code, code, 0);
37566 xmlResetLastError();
37567 if (mem_base != xmlMemBlocks()) {
37568 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37569 xmlMemBlocks() - mem_base);
37571 printf(" %d", n_code);
37583 test_xmlUCSIsBengali(void) {
37586 #if defined(LIBXML_UNICODE_ENABLED)
37589 int code; /* UCS code point */
37592 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37593 mem_base = xmlMemBlocks();
37594 code = gen_int(n_code, 0);
37596 ret_val = xmlUCSIsBengali(code);
37597 desret_int(ret_val);
37599 des_int(n_code, code, 0);
37600 xmlResetLastError();
37601 if (mem_base != xmlMemBlocks()) {
37602 printf("Leak of %d blocks found in xmlUCSIsBengali",
37603 xmlMemBlocks() - mem_base);
37605 printf(" %d", n_code);
37617 test_xmlUCSIsBlock(void) {
37620 #if defined(LIBXML_UNICODE_ENABLED)
37623 int code; /* UCS code point */
37625 char * block; /* UCS block name */
37628 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37629 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37630 mem_base = xmlMemBlocks();
37631 code = gen_int(n_code, 0);
37632 block = gen_const_char_ptr(n_block, 1);
37634 ret_val = xmlUCSIsBlock(code, (const char *)block);
37635 desret_int(ret_val);
37637 des_int(n_code, code, 0);
37638 des_const_char_ptr(n_block, (const char *)block, 1);
37639 xmlResetLastError();
37640 if (mem_base != xmlMemBlocks()) {
37641 printf("Leak of %d blocks found in xmlUCSIsBlock",
37642 xmlMemBlocks() - mem_base);
37644 printf(" %d", n_code);
37645 printf(" %d", n_block);
37658 test_xmlUCSIsBlockElements(void) {
37661 #if defined(LIBXML_UNICODE_ENABLED)
37664 int code; /* UCS code point */
37667 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37668 mem_base = xmlMemBlocks();
37669 code = gen_int(n_code, 0);
37671 ret_val = xmlUCSIsBlockElements(code);
37672 desret_int(ret_val);
37674 des_int(n_code, code, 0);
37675 xmlResetLastError();
37676 if (mem_base != xmlMemBlocks()) {
37677 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37678 xmlMemBlocks() - mem_base);
37680 printf(" %d", n_code);
37692 test_xmlUCSIsBopomofo(void) {
37695 #if defined(LIBXML_UNICODE_ENABLED)
37698 int code; /* UCS code point */
37701 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37702 mem_base = xmlMemBlocks();
37703 code = gen_int(n_code, 0);
37705 ret_val = xmlUCSIsBopomofo(code);
37706 desret_int(ret_val);
37708 des_int(n_code, code, 0);
37709 xmlResetLastError();
37710 if (mem_base != xmlMemBlocks()) {
37711 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37712 xmlMemBlocks() - mem_base);
37714 printf(" %d", n_code);
37726 test_xmlUCSIsBopomofoExtended(void) {
37729 #if defined(LIBXML_UNICODE_ENABLED)
37732 int code; /* UCS code point */
37735 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37736 mem_base = xmlMemBlocks();
37737 code = gen_int(n_code, 0);
37739 ret_val = xmlUCSIsBopomofoExtended(code);
37740 desret_int(ret_val);
37742 des_int(n_code, code, 0);
37743 xmlResetLastError();
37744 if (mem_base != xmlMemBlocks()) {
37745 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37746 xmlMemBlocks() - mem_base);
37748 printf(" %d", n_code);
37760 test_xmlUCSIsBoxDrawing(void) {
37763 #if defined(LIBXML_UNICODE_ENABLED)
37766 int code; /* UCS code point */
37769 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37770 mem_base = xmlMemBlocks();
37771 code = gen_int(n_code, 0);
37773 ret_val = xmlUCSIsBoxDrawing(code);
37774 desret_int(ret_val);
37776 des_int(n_code, code, 0);
37777 xmlResetLastError();
37778 if (mem_base != xmlMemBlocks()) {
37779 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37780 xmlMemBlocks() - mem_base);
37782 printf(" %d", n_code);
37794 test_xmlUCSIsBraillePatterns(void) {
37797 #if defined(LIBXML_UNICODE_ENABLED)
37800 int code; /* UCS code point */
37803 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37804 mem_base = xmlMemBlocks();
37805 code = gen_int(n_code, 0);
37807 ret_val = xmlUCSIsBraillePatterns(code);
37808 desret_int(ret_val);
37810 des_int(n_code, code, 0);
37811 xmlResetLastError();
37812 if (mem_base != xmlMemBlocks()) {
37813 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37814 xmlMemBlocks() - mem_base);
37816 printf(" %d", n_code);
37828 test_xmlUCSIsBuhid(void) {
37831 #if defined(LIBXML_UNICODE_ENABLED)
37834 int code; /* UCS code point */
37837 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37838 mem_base = xmlMemBlocks();
37839 code = gen_int(n_code, 0);
37841 ret_val = xmlUCSIsBuhid(code);
37842 desret_int(ret_val);
37844 des_int(n_code, code, 0);
37845 xmlResetLastError();
37846 if (mem_base != xmlMemBlocks()) {
37847 printf("Leak of %d blocks found in xmlUCSIsBuhid",
37848 xmlMemBlocks() - mem_base);
37850 printf(" %d", n_code);
37862 test_xmlUCSIsByzantineMusicalSymbols(void) {
37865 #if defined(LIBXML_UNICODE_ENABLED)
37868 int code; /* UCS code point */
37871 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37872 mem_base = xmlMemBlocks();
37873 code = gen_int(n_code, 0);
37875 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37876 desret_int(ret_val);
37878 des_int(n_code, code, 0);
37879 xmlResetLastError();
37880 if (mem_base != xmlMemBlocks()) {
37881 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37882 xmlMemBlocks() - mem_base);
37884 printf(" %d", n_code);
37896 test_xmlUCSIsCJKCompatibility(void) {
37899 #if defined(LIBXML_UNICODE_ENABLED)
37902 int code; /* UCS code point */
37905 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37906 mem_base = xmlMemBlocks();
37907 code = gen_int(n_code, 0);
37909 ret_val = xmlUCSIsCJKCompatibility(code);
37910 desret_int(ret_val);
37912 des_int(n_code, code, 0);
37913 xmlResetLastError();
37914 if (mem_base != xmlMemBlocks()) {
37915 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37916 xmlMemBlocks() - mem_base);
37918 printf(" %d", n_code);
37930 test_xmlUCSIsCJKCompatibilityForms(void) {
37933 #if defined(LIBXML_UNICODE_ENABLED)
37936 int code; /* UCS code point */
37939 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37940 mem_base = xmlMemBlocks();
37941 code = gen_int(n_code, 0);
37943 ret_val = xmlUCSIsCJKCompatibilityForms(code);
37944 desret_int(ret_val);
37946 des_int(n_code, code, 0);
37947 xmlResetLastError();
37948 if (mem_base != xmlMemBlocks()) {
37949 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37950 xmlMemBlocks() - mem_base);
37952 printf(" %d", n_code);
37964 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37967 #if defined(LIBXML_UNICODE_ENABLED)
37970 int code; /* UCS code point */
37973 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37974 mem_base = xmlMemBlocks();
37975 code = gen_int(n_code, 0);
37977 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37978 desret_int(ret_val);
37980 des_int(n_code, code, 0);
37981 xmlResetLastError();
37982 if (mem_base != xmlMemBlocks()) {
37983 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37984 xmlMemBlocks() - mem_base);
37986 printf(" %d", n_code);
37998 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38001 #if defined(LIBXML_UNICODE_ENABLED)
38004 int code; /* UCS code point */
38007 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38008 mem_base = xmlMemBlocks();
38009 code = gen_int(n_code, 0);
38011 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38012 desret_int(ret_val);
38014 des_int(n_code, code, 0);
38015 xmlResetLastError();
38016 if (mem_base != xmlMemBlocks()) {
38017 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38018 xmlMemBlocks() - mem_base);
38020 printf(" %d", n_code);
38032 test_xmlUCSIsCJKRadicalsSupplement(void) {
38035 #if defined(LIBXML_UNICODE_ENABLED)
38038 int code; /* UCS code point */
38041 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38042 mem_base = xmlMemBlocks();
38043 code = gen_int(n_code, 0);
38045 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38046 desret_int(ret_val);
38048 des_int(n_code, code, 0);
38049 xmlResetLastError();
38050 if (mem_base != xmlMemBlocks()) {
38051 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38052 xmlMemBlocks() - mem_base);
38054 printf(" %d", n_code);
38066 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38069 #if defined(LIBXML_UNICODE_ENABLED)
38072 int code; /* UCS code point */
38075 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38076 mem_base = xmlMemBlocks();
38077 code = gen_int(n_code, 0);
38079 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38080 desret_int(ret_val);
38082 des_int(n_code, code, 0);
38083 xmlResetLastError();
38084 if (mem_base != xmlMemBlocks()) {
38085 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38086 xmlMemBlocks() - mem_base);
38088 printf(" %d", n_code);
38100 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38103 #if defined(LIBXML_UNICODE_ENABLED)
38106 int code; /* UCS code point */
38109 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38110 mem_base = xmlMemBlocks();
38111 code = gen_int(n_code, 0);
38113 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38114 desret_int(ret_val);
38116 des_int(n_code, code, 0);
38117 xmlResetLastError();
38118 if (mem_base != xmlMemBlocks()) {
38119 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38120 xmlMemBlocks() - mem_base);
38122 printf(" %d", n_code);
38134 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38137 #if defined(LIBXML_UNICODE_ENABLED)
38140 int code; /* UCS code point */
38143 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38144 mem_base = xmlMemBlocks();
38145 code = gen_int(n_code, 0);
38147 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38148 desret_int(ret_val);
38150 des_int(n_code, code, 0);
38151 xmlResetLastError();
38152 if (mem_base != xmlMemBlocks()) {
38153 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38154 xmlMemBlocks() - mem_base);
38156 printf(" %d", n_code);
38168 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38171 #if defined(LIBXML_UNICODE_ENABLED)
38174 int code; /* UCS code point */
38177 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38178 mem_base = xmlMemBlocks();
38179 code = gen_int(n_code, 0);
38181 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38182 desret_int(ret_val);
38184 des_int(n_code, code, 0);
38185 xmlResetLastError();
38186 if (mem_base != xmlMemBlocks()) {
38187 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38188 xmlMemBlocks() - mem_base);
38190 printf(" %d", n_code);
38202 test_xmlUCSIsCat(void) {
38205 #if defined(LIBXML_UNICODE_ENABLED)
38208 int code; /* UCS code point */
38210 char * cat; /* UCS Category name */
38213 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38214 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38215 mem_base = xmlMemBlocks();
38216 code = gen_int(n_code, 0);
38217 cat = gen_const_char_ptr(n_cat, 1);
38219 ret_val = xmlUCSIsCat(code, (const char *)cat);
38220 desret_int(ret_val);
38222 des_int(n_code, code, 0);
38223 des_const_char_ptr(n_cat, (const char *)cat, 1);
38224 xmlResetLastError();
38225 if (mem_base != xmlMemBlocks()) {
38226 printf("Leak of %d blocks found in xmlUCSIsCat",
38227 xmlMemBlocks() - mem_base);
38229 printf(" %d", n_code);
38230 printf(" %d", n_cat);
38243 test_xmlUCSIsCatC(void) {
38246 #if defined(LIBXML_UNICODE_ENABLED)
38249 int code; /* UCS code point */
38252 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38253 mem_base = xmlMemBlocks();
38254 code = gen_int(n_code, 0);
38256 ret_val = xmlUCSIsCatC(code);
38257 desret_int(ret_val);
38259 des_int(n_code, code, 0);
38260 xmlResetLastError();
38261 if (mem_base != xmlMemBlocks()) {
38262 printf("Leak of %d blocks found in xmlUCSIsCatC",
38263 xmlMemBlocks() - mem_base);
38265 printf(" %d", n_code);
38277 test_xmlUCSIsCatCc(void) {
38280 #if defined(LIBXML_UNICODE_ENABLED)
38283 int code; /* UCS code point */
38286 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38287 mem_base = xmlMemBlocks();
38288 code = gen_int(n_code, 0);
38290 ret_val = xmlUCSIsCatCc(code);
38291 desret_int(ret_val);
38293 des_int(n_code, code, 0);
38294 xmlResetLastError();
38295 if (mem_base != xmlMemBlocks()) {
38296 printf("Leak of %d blocks found in xmlUCSIsCatCc",
38297 xmlMemBlocks() - mem_base);
38299 printf(" %d", n_code);
38311 test_xmlUCSIsCatCf(void) {
38314 #if defined(LIBXML_UNICODE_ENABLED)
38317 int code; /* UCS code point */
38320 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38321 mem_base = xmlMemBlocks();
38322 code = gen_int(n_code, 0);
38324 ret_val = xmlUCSIsCatCf(code);
38325 desret_int(ret_val);
38327 des_int(n_code, code, 0);
38328 xmlResetLastError();
38329 if (mem_base != xmlMemBlocks()) {
38330 printf("Leak of %d blocks found in xmlUCSIsCatCf",
38331 xmlMemBlocks() - mem_base);
38333 printf(" %d", n_code);
38345 test_xmlUCSIsCatCo(void) {
38348 #if defined(LIBXML_UNICODE_ENABLED)
38351 int code; /* UCS code point */
38354 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38355 mem_base = xmlMemBlocks();
38356 code = gen_int(n_code, 0);
38358 ret_val = xmlUCSIsCatCo(code);
38359 desret_int(ret_val);
38361 des_int(n_code, code, 0);
38362 xmlResetLastError();
38363 if (mem_base != xmlMemBlocks()) {
38364 printf("Leak of %d blocks found in xmlUCSIsCatCo",
38365 xmlMemBlocks() - mem_base);
38367 printf(" %d", n_code);
38379 test_xmlUCSIsCatCs(void) {
38382 #if defined(LIBXML_UNICODE_ENABLED)
38385 int code; /* UCS code point */
38388 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38389 mem_base = xmlMemBlocks();
38390 code = gen_int(n_code, 0);
38392 ret_val = xmlUCSIsCatCs(code);
38393 desret_int(ret_val);
38395 des_int(n_code, code, 0);
38396 xmlResetLastError();
38397 if (mem_base != xmlMemBlocks()) {
38398 printf("Leak of %d blocks found in xmlUCSIsCatCs",
38399 xmlMemBlocks() - mem_base);
38401 printf(" %d", n_code);
38413 test_xmlUCSIsCatL(void) {
38416 #if defined(LIBXML_UNICODE_ENABLED)
38419 int code; /* UCS code point */
38422 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38423 mem_base = xmlMemBlocks();
38424 code = gen_int(n_code, 0);
38426 ret_val = xmlUCSIsCatL(code);
38427 desret_int(ret_val);
38429 des_int(n_code, code, 0);
38430 xmlResetLastError();
38431 if (mem_base != xmlMemBlocks()) {
38432 printf("Leak of %d blocks found in xmlUCSIsCatL",
38433 xmlMemBlocks() - mem_base);
38435 printf(" %d", n_code);
38447 test_xmlUCSIsCatLl(void) {
38450 #if defined(LIBXML_UNICODE_ENABLED)
38453 int code; /* UCS code point */
38456 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38457 mem_base = xmlMemBlocks();
38458 code = gen_int(n_code, 0);
38460 ret_val = xmlUCSIsCatLl(code);
38461 desret_int(ret_val);
38463 des_int(n_code, code, 0);
38464 xmlResetLastError();
38465 if (mem_base != xmlMemBlocks()) {
38466 printf("Leak of %d blocks found in xmlUCSIsCatLl",
38467 xmlMemBlocks() - mem_base);
38469 printf(" %d", n_code);
38481 test_xmlUCSIsCatLm(void) {
38484 #if defined(LIBXML_UNICODE_ENABLED)
38487 int code; /* UCS code point */
38490 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38491 mem_base = xmlMemBlocks();
38492 code = gen_int(n_code, 0);
38494 ret_val = xmlUCSIsCatLm(code);
38495 desret_int(ret_val);
38497 des_int(n_code, code, 0);
38498 xmlResetLastError();
38499 if (mem_base != xmlMemBlocks()) {
38500 printf("Leak of %d blocks found in xmlUCSIsCatLm",
38501 xmlMemBlocks() - mem_base);
38503 printf(" %d", n_code);
38515 test_xmlUCSIsCatLo(void) {
38518 #if defined(LIBXML_UNICODE_ENABLED)
38521 int code; /* UCS code point */
38524 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38525 mem_base = xmlMemBlocks();
38526 code = gen_int(n_code, 0);
38528 ret_val = xmlUCSIsCatLo(code);
38529 desret_int(ret_val);
38531 des_int(n_code, code, 0);
38532 xmlResetLastError();
38533 if (mem_base != xmlMemBlocks()) {
38534 printf("Leak of %d blocks found in xmlUCSIsCatLo",
38535 xmlMemBlocks() - mem_base);
38537 printf(" %d", n_code);
38549 test_xmlUCSIsCatLt(void) {
38552 #if defined(LIBXML_UNICODE_ENABLED)
38555 int code; /* UCS code point */
38558 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38559 mem_base = xmlMemBlocks();
38560 code = gen_int(n_code, 0);
38562 ret_val = xmlUCSIsCatLt(code);
38563 desret_int(ret_val);
38565 des_int(n_code, code, 0);
38566 xmlResetLastError();
38567 if (mem_base != xmlMemBlocks()) {
38568 printf("Leak of %d blocks found in xmlUCSIsCatLt",
38569 xmlMemBlocks() - mem_base);
38571 printf(" %d", n_code);
38583 test_xmlUCSIsCatLu(void) {
38586 #if defined(LIBXML_UNICODE_ENABLED)
38589 int code; /* UCS code point */
38592 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38593 mem_base = xmlMemBlocks();
38594 code = gen_int(n_code, 0);
38596 ret_val = xmlUCSIsCatLu(code);
38597 desret_int(ret_val);
38599 des_int(n_code, code, 0);
38600 xmlResetLastError();
38601 if (mem_base != xmlMemBlocks()) {
38602 printf("Leak of %d blocks found in xmlUCSIsCatLu",
38603 xmlMemBlocks() - mem_base);
38605 printf(" %d", n_code);
38617 test_xmlUCSIsCatM(void) {
38620 #if defined(LIBXML_UNICODE_ENABLED)
38623 int code; /* UCS code point */
38626 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38627 mem_base = xmlMemBlocks();
38628 code = gen_int(n_code, 0);
38630 ret_val = xmlUCSIsCatM(code);
38631 desret_int(ret_val);
38633 des_int(n_code, code, 0);
38634 xmlResetLastError();
38635 if (mem_base != xmlMemBlocks()) {
38636 printf("Leak of %d blocks found in xmlUCSIsCatM",
38637 xmlMemBlocks() - mem_base);
38639 printf(" %d", n_code);
38651 test_xmlUCSIsCatMc(void) {
38654 #if defined(LIBXML_UNICODE_ENABLED)
38657 int code; /* UCS code point */
38660 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38661 mem_base = xmlMemBlocks();
38662 code = gen_int(n_code, 0);
38664 ret_val = xmlUCSIsCatMc(code);
38665 desret_int(ret_val);
38667 des_int(n_code, code, 0);
38668 xmlResetLastError();
38669 if (mem_base != xmlMemBlocks()) {
38670 printf("Leak of %d blocks found in xmlUCSIsCatMc",
38671 xmlMemBlocks() - mem_base);
38673 printf(" %d", n_code);
38685 test_xmlUCSIsCatMe(void) {
38688 #if defined(LIBXML_UNICODE_ENABLED)
38691 int code; /* UCS code point */
38694 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38695 mem_base = xmlMemBlocks();
38696 code = gen_int(n_code, 0);
38698 ret_val = xmlUCSIsCatMe(code);
38699 desret_int(ret_val);
38701 des_int(n_code, code, 0);
38702 xmlResetLastError();
38703 if (mem_base != xmlMemBlocks()) {
38704 printf("Leak of %d blocks found in xmlUCSIsCatMe",
38705 xmlMemBlocks() - mem_base);
38707 printf(" %d", n_code);
38719 test_xmlUCSIsCatMn(void) {
38722 #if defined(LIBXML_UNICODE_ENABLED)
38725 int code; /* UCS code point */
38728 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38729 mem_base = xmlMemBlocks();
38730 code = gen_int(n_code, 0);
38732 ret_val = xmlUCSIsCatMn(code);
38733 desret_int(ret_val);
38735 des_int(n_code, code, 0);
38736 xmlResetLastError();
38737 if (mem_base != xmlMemBlocks()) {
38738 printf("Leak of %d blocks found in xmlUCSIsCatMn",
38739 xmlMemBlocks() - mem_base);
38741 printf(" %d", n_code);
38753 test_xmlUCSIsCatN(void) {
38756 #if defined(LIBXML_UNICODE_ENABLED)
38759 int code; /* UCS code point */
38762 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38763 mem_base = xmlMemBlocks();
38764 code = gen_int(n_code, 0);
38766 ret_val = xmlUCSIsCatN(code);
38767 desret_int(ret_val);
38769 des_int(n_code, code, 0);
38770 xmlResetLastError();
38771 if (mem_base != xmlMemBlocks()) {
38772 printf("Leak of %d blocks found in xmlUCSIsCatN",
38773 xmlMemBlocks() - mem_base);
38775 printf(" %d", n_code);
38787 test_xmlUCSIsCatNd(void) {
38790 #if defined(LIBXML_UNICODE_ENABLED)
38793 int code; /* UCS code point */
38796 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38797 mem_base = xmlMemBlocks();
38798 code = gen_int(n_code, 0);
38800 ret_val = xmlUCSIsCatNd(code);
38801 desret_int(ret_val);
38803 des_int(n_code, code, 0);
38804 xmlResetLastError();
38805 if (mem_base != xmlMemBlocks()) {
38806 printf("Leak of %d blocks found in xmlUCSIsCatNd",
38807 xmlMemBlocks() - mem_base);
38809 printf(" %d", n_code);
38821 test_xmlUCSIsCatNl(void) {
38824 #if defined(LIBXML_UNICODE_ENABLED)
38827 int code; /* UCS code point */
38830 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38831 mem_base = xmlMemBlocks();
38832 code = gen_int(n_code, 0);
38834 ret_val = xmlUCSIsCatNl(code);
38835 desret_int(ret_val);
38837 des_int(n_code, code, 0);
38838 xmlResetLastError();
38839 if (mem_base != xmlMemBlocks()) {
38840 printf("Leak of %d blocks found in xmlUCSIsCatNl",
38841 xmlMemBlocks() - mem_base);
38843 printf(" %d", n_code);
38855 test_xmlUCSIsCatNo(void) {
38858 #if defined(LIBXML_UNICODE_ENABLED)
38861 int code; /* UCS code point */
38864 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38865 mem_base = xmlMemBlocks();
38866 code = gen_int(n_code, 0);
38868 ret_val = xmlUCSIsCatNo(code);
38869 desret_int(ret_val);
38871 des_int(n_code, code, 0);
38872 xmlResetLastError();
38873 if (mem_base != xmlMemBlocks()) {
38874 printf("Leak of %d blocks found in xmlUCSIsCatNo",
38875 xmlMemBlocks() - mem_base);
38877 printf(" %d", n_code);
38889 test_xmlUCSIsCatP(void) {
38892 #if defined(LIBXML_UNICODE_ENABLED)
38895 int code; /* UCS code point */
38898 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38899 mem_base = xmlMemBlocks();
38900 code = gen_int(n_code, 0);
38902 ret_val = xmlUCSIsCatP(code);
38903 desret_int(ret_val);
38905 des_int(n_code, code, 0);
38906 xmlResetLastError();
38907 if (mem_base != xmlMemBlocks()) {
38908 printf("Leak of %d blocks found in xmlUCSIsCatP",
38909 xmlMemBlocks() - mem_base);
38911 printf(" %d", n_code);
38923 test_xmlUCSIsCatPc(void) {
38926 #if defined(LIBXML_UNICODE_ENABLED)
38929 int code; /* UCS code point */
38932 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38933 mem_base = xmlMemBlocks();
38934 code = gen_int(n_code, 0);
38936 ret_val = xmlUCSIsCatPc(code);
38937 desret_int(ret_val);
38939 des_int(n_code, code, 0);
38940 xmlResetLastError();
38941 if (mem_base != xmlMemBlocks()) {
38942 printf("Leak of %d blocks found in xmlUCSIsCatPc",
38943 xmlMemBlocks() - mem_base);
38945 printf(" %d", n_code);
38957 test_xmlUCSIsCatPd(void) {
38960 #if defined(LIBXML_UNICODE_ENABLED)
38963 int code; /* UCS code point */
38966 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38967 mem_base = xmlMemBlocks();
38968 code = gen_int(n_code, 0);
38970 ret_val = xmlUCSIsCatPd(code);
38971 desret_int(ret_val);
38973 des_int(n_code, code, 0);
38974 xmlResetLastError();
38975 if (mem_base != xmlMemBlocks()) {
38976 printf("Leak of %d blocks found in xmlUCSIsCatPd",
38977 xmlMemBlocks() - mem_base);
38979 printf(" %d", n_code);
38991 test_xmlUCSIsCatPe(void) {
38994 #if defined(LIBXML_UNICODE_ENABLED)
38997 int code; /* UCS code point */
39000 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39001 mem_base = xmlMemBlocks();
39002 code = gen_int(n_code, 0);
39004 ret_val = xmlUCSIsCatPe(code);
39005 desret_int(ret_val);
39007 des_int(n_code, code, 0);
39008 xmlResetLastError();
39009 if (mem_base != xmlMemBlocks()) {
39010 printf("Leak of %d blocks found in xmlUCSIsCatPe",
39011 xmlMemBlocks() - mem_base);
39013 printf(" %d", n_code);
39025 test_xmlUCSIsCatPf(void) {
39028 #if defined(LIBXML_UNICODE_ENABLED)
39031 int code; /* UCS code point */
39034 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39035 mem_base = xmlMemBlocks();
39036 code = gen_int(n_code, 0);
39038 ret_val = xmlUCSIsCatPf(code);
39039 desret_int(ret_val);
39041 des_int(n_code, code, 0);
39042 xmlResetLastError();
39043 if (mem_base != xmlMemBlocks()) {
39044 printf("Leak of %d blocks found in xmlUCSIsCatPf",
39045 xmlMemBlocks() - mem_base);
39047 printf(" %d", n_code);
39059 test_xmlUCSIsCatPi(void) {
39062 #if defined(LIBXML_UNICODE_ENABLED)
39065 int code; /* UCS code point */
39068 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39069 mem_base = xmlMemBlocks();
39070 code = gen_int(n_code, 0);
39072 ret_val = xmlUCSIsCatPi(code);
39073 desret_int(ret_val);
39075 des_int(n_code, code, 0);
39076 xmlResetLastError();
39077 if (mem_base != xmlMemBlocks()) {
39078 printf("Leak of %d blocks found in xmlUCSIsCatPi",
39079 xmlMemBlocks() - mem_base);
39081 printf(" %d", n_code);
39093 test_xmlUCSIsCatPo(void) {
39096 #if defined(LIBXML_UNICODE_ENABLED)
39099 int code; /* UCS code point */
39102 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39103 mem_base = xmlMemBlocks();
39104 code = gen_int(n_code, 0);
39106 ret_val = xmlUCSIsCatPo(code);
39107 desret_int(ret_val);
39109 des_int(n_code, code, 0);
39110 xmlResetLastError();
39111 if (mem_base != xmlMemBlocks()) {
39112 printf("Leak of %d blocks found in xmlUCSIsCatPo",
39113 xmlMemBlocks() - mem_base);
39115 printf(" %d", n_code);
39127 test_xmlUCSIsCatPs(void) {
39130 #if defined(LIBXML_UNICODE_ENABLED)
39133 int code; /* UCS code point */
39136 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39137 mem_base = xmlMemBlocks();
39138 code = gen_int(n_code, 0);
39140 ret_val = xmlUCSIsCatPs(code);
39141 desret_int(ret_val);
39143 des_int(n_code, code, 0);
39144 xmlResetLastError();
39145 if (mem_base != xmlMemBlocks()) {
39146 printf("Leak of %d blocks found in xmlUCSIsCatPs",
39147 xmlMemBlocks() - mem_base);
39149 printf(" %d", n_code);
39161 test_xmlUCSIsCatS(void) {
39164 #if defined(LIBXML_UNICODE_ENABLED)
39167 int code; /* UCS code point */
39170 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39171 mem_base = xmlMemBlocks();
39172 code = gen_int(n_code, 0);
39174 ret_val = xmlUCSIsCatS(code);
39175 desret_int(ret_val);
39177 des_int(n_code, code, 0);
39178 xmlResetLastError();
39179 if (mem_base != xmlMemBlocks()) {
39180 printf("Leak of %d blocks found in xmlUCSIsCatS",
39181 xmlMemBlocks() - mem_base);
39183 printf(" %d", n_code);
39195 test_xmlUCSIsCatSc(void) {
39198 #if defined(LIBXML_UNICODE_ENABLED)
39201 int code; /* UCS code point */
39204 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39205 mem_base = xmlMemBlocks();
39206 code = gen_int(n_code, 0);
39208 ret_val = xmlUCSIsCatSc(code);
39209 desret_int(ret_val);
39211 des_int(n_code, code, 0);
39212 xmlResetLastError();
39213 if (mem_base != xmlMemBlocks()) {
39214 printf("Leak of %d blocks found in xmlUCSIsCatSc",
39215 xmlMemBlocks() - mem_base);
39217 printf(" %d", n_code);
39229 test_xmlUCSIsCatSk(void) {
39232 #if defined(LIBXML_UNICODE_ENABLED)
39235 int code; /* UCS code point */
39238 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39239 mem_base = xmlMemBlocks();
39240 code = gen_int(n_code, 0);
39242 ret_val = xmlUCSIsCatSk(code);
39243 desret_int(ret_val);
39245 des_int(n_code, code, 0);
39246 xmlResetLastError();
39247 if (mem_base != xmlMemBlocks()) {
39248 printf("Leak of %d blocks found in xmlUCSIsCatSk",
39249 xmlMemBlocks() - mem_base);
39251 printf(" %d", n_code);
39263 test_xmlUCSIsCatSm(void) {
39266 #if defined(LIBXML_UNICODE_ENABLED)
39269 int code; /* UCS code point */
39272 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39273 mem_base = xmlMemBlocks();
39274 code = gen_int(n_code, 0);
39276 ret_val = xmlUCSIsCatSm(code);
39277 desret_int(ret_val);
39279 des_int(n_code, code, 0);
39280 xmlResetLastError();
39281 if (mem_base != xmlMemBlocks()) {
39282 printf("Leak of %d blocks found in xmlUCSIsCatSm",
39283 xmlMemBlocks() - mem_base);
39285 printf(" %d", n_code);
39297 test_xmlUCSIsCatSo(void) {
39300 #if defined(LIBXML_UNICODE_ENABLED)
39303 int code; /* UCS code point */
39306 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39307 mem_base = xmlMemBlocks();
39308 code = gen_int(n_code, 0);
39310 ret_val = xmlUCSIsCatSo(code);
39311 desret_int(ret_val);
39313 des_int(n_code, code, 0);
39314 xmlResetLastError();
39315 if (mem_base != xmlMemBlocks()) {
39316 printf("Leak of %d blocks found in xmlUCSIsCatSo",
39317 xmlMemBlocks() - mem_base);
39319 printf(" %d", n_code);
39331 test_xmlUCSIsCatZ(void) {
39334 #if defined(LIBXML_UNICODE_ENABLED)
39337 int code; /* UCS code point */
39340 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39341 mem_base = xmlMemBlocks();
39342 code = gen_int(n_code, 0);
39344 ret_val = xmlUCSIsCatZ(code);
39345 desret_int(ret_val);
39347 des_int(n_code, code, 0);
39348 xmlResetLastError();
39349 if (mem_base != xmlMemBlocks()) {
39350 printf("Leak of %d blocks found in xmlUCSIsCatZ",
39351 xmlMemBlocks() - mem_base);
39353 printf(" %d", n_code);
39365 test_xmlUCSIsCatZl(void) {
39368 #if defined(LIBXML_UNICODE_ENABLED)
39371 int code; /* UCS code point */
39374 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39375 mem_base = xmlMemBlocks();
39376 code = gen_int(n_code, 0);
39378 ret_val = xmlUCSIsCatZl(code);
39379 desret_int(ret_val);
39381 des_int(n_code, code, 0);
39382 xmlResetLastError();
39383 if (mem_base != xmlMemBlocks()) {
39384 printf("Leak of %d blocks found in xmlUCSIsCatZl",
39385 xmlMemBlocks() - mem_base);
39387 printf(" %d", n_code);
39399 test_xmlUCSIsCatZp(void) {
39402 #if defined(LIBXML_UNICODE_ENABLED)
39405 int code; /* UCS code point */
39408 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39409 mem_base = xmlMemBlocks();
39410 code = gen_int(n_code, 0);
39412 ret_val = xmlUCSIsCatZp(code);
39413 desret_int(ret_val);
39415 des_int(n_code, code, 0);
39416 xmlResetLastError();
39417 if (mem_base != xmlMemBlocks()) {
39418 printf("Leak of %d blocks found in xmlUCSIsCatZp",
39419 xmlMemBlocks() - mem_base);
39421 printf(" %d", n_code);
39433 test_xmlUCSIsCatZs(void) {
39436 #if defined(LIBXML_UNICODE_ENABLED)
39439 int code; /* UCS code point */
39442 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39443 mem_base = xmlMemBlocks();
39444 code = gen_int(n_code, 0);
39446 ret_val = xmlUCSIsCatZs(code);
39447 desret_int(ret_val);
39449 des_int(n_code, code, 0);
39450 xmlResetLastError();
39451 if (mem_base != xmlMemBlocks()) {
39452 printf("Leak of %d blocks found in xmlUCSIsCatZs",
39453 xmlMemBlocks() - mem_base);
39455 printf(" %d", n_code);
39467 test_xmlUCSIsCherokee(void) {
39470 #if defined(LIBXML_UNICODE_ENABLED)
39473 int code; /* UCS code point */
39476 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39477 mem_base = xmlMemBlocks();
39478 code = gen_int(n_code, 0);
39480 ret_val = xmlUCSIsCherokee(code);
39481 desret_int(ret_val);
39483 des_int(n_code, code, 0);
39484 xmlResetLastError();
39485 if (mem_base != xmlMemBlocks()) {
39486 printf("Leak of %d blocks found in xmlUCSIsCherokee",
39487 xmlMemBlocks() - mem_base);
39489 printf(" %d", n_code);
39501 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39504 #if defined(LIBXML_UNICODE_ENABLED)
39507 int code; /* UCS code point */
39510 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39511 mem_base = xmlMemBlocks();
39512 code = gen_int(n_code, 0);
39514 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39515 desret_int(ret_val);
39517 des_int(n_code, code, 0);
39518 xmlResetLastError();
39519 if (mem_base != xmlMemBlocks()) {
39520 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39521 xmlMemBlocks() - mem_base);
39523 printf(" %d", n_code);
39535 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39538 #if defined(LIBXML_UNICODE_ENABLED)
39541 int code; /* UCS code point */
39544 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39545 mem_base = xmlMemBlocks();
39546 code = gen_int(n_code, 0);
39548 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39549 desret_int(ret_val);
39551 des_int(n_code, code, 0);
39552 xmlResetLastError();
39553 if (mem_base != xmlMemBlocks()) {
39554 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39555 xmlMemBlocks() - mem_base);
39557 printf(" %d", n_code);
39569 test_xmlUCSIsCombiningHalfMarks(void) {
39572 #if defined(LIBXML_UNICODE_ENABLED)
39575 int code; /* UCS code point */
39578 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39579 mem_base = xmlMemBlocks();
39580 code = gen_int(n_code, 0);
39582 ret_val = xmlUCSIsCombiningHalfMarks(code);
39583 desret_int(ret_val);
39585 des_int(n_code, code, 0);
39586 xmlResetLastError();
39587 if (mem_base != xmlMemBlocks()) {
39588 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39589 xmlMemBlocks() - mem_base);
39591 printf(" %d", n_code);
39603 test_xmlUCSIsCombiningMarksforSymbols(void) {
39606 #if defined(LIBXML_UNICODE_ENABLED)
39609 int code; /* UCS code point */
39612 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39613 mem_base = xmlMemBlocks();
39614 code = gen_int(n_code, 0);
39616 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39617 desret_int(ret_val);
39619 des_int(n_code, code, 0);
39620 xmlResetLastError();
39621 if (mem_base != xmlMemBlocks()) {
39622 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39623 xmlMemBlocks() - mem_base);
39625 printf(" %d", n_code);
39637 test_xmlUCSIsControlPictures(void) {
39640 #if defined(LIBXML_UNICODE_ENABLED)
39643 int code; /* UCS code point */
39646 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39647 mem_base = xmlMemBlocks();
39648 code = gen_int(n_code, 0);
39650 ret_val = xmlUCSIsControlPictures(code);
39651 desret_int(ret_val);
39653 des_int(n_code, code, 0);
39654 xmlResetLastError();
39655 if (mem_base != xmlMemBlocks()) {
39656 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39657 xmlMemBlocks() - mem_base);
39659 printf(" %d", n_code);
39671 test_xmlUCSIsCurrencySymbols(void) {
39674 #if defined(LIBXML_UNICODE_ENABLED)
39677 int code; /* UCS code point */
39680 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39681 mem_base = xmlMemBlocks();
39682 code = gen_int(n_code, 0);
39684 ret_val = xmlUCSIsCurrencySymbols(code);
39685 desret_int(ret_val);
39687 des_int(n_code, code, 0);
39688 xmlResetLastError();
39689 if (mem_base != xmlMemBlocks()) {
39690 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39691 xmlMemBlocks() - mem_base);
39693 printf(" %d", n_code);
39705 test_xmlUCSIsCypriotSyllabary(void) {
39708 #if defined(LIBXML_UNICODE_ENABLED)
39711 int code; /* UCS code point */
39714 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39715 mem_base = xmlMemBlocks();
39716 code = gen_int(n_code, 0);
39718 ret_val = xmlUCSIsCypriotSyllabary(code);
39719 desret_int(ret_val);
39721 des_int(n_code, code, 0);
39722 xmlResetLastError();
39723 if (mem_base != xmlMemBlocks()) {
39724 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39725 xmlMemBlocks() - mem_base);
39727 printf(" %d", n_code);
39739 test_xmlUCSIsCyrillic(void) {
39742 #if defined(LIBXML_UNICODE_ENABLED)
39745 int code; /* UCS code point */
39748 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39749 mem_base = xmlMemBlocks();
39750 code = gen_int(n_code, 0);
39752 ret_val = xmlUCSIsCyrillic(code);
39753 desret_int(ret_val);
39755 des_int(n_code, code, 0);
39756 xmlResetLastError();
39757 if (mem_base != xmlMemBlocks()) {
39758 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39759 xmlMemBlocks() - mem_base);
39761 printf(" %d", n_code);
39773 test_xmlUCSIsCyrillicSupplement(void) {
39776 #if defined(LIBXML_UNICODE_ENABLED)
39779 int code; /* UCS code point */
39782 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39783 mem_base = xmlMemBlocks();
39784 code = gen_int(n_code, 0);
39786 ret_val = xmlUCSIsCyrillicSupplement(code);
39787 desret_int(ret_val);
39789 des_int(n_code, code, 0);
39790 xmlResetLastError();
39791 if (mem_base != xmlMemBlocks()) {
39792 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39793 xmlMemBlocks() - mem_base);
39795 printf(" %d", n_code);
39807 test_xmlUCSIsDeseret(void) {
39810 #if defined(LIBXML_UNICODE_ENABLED)
39813 int code; /* UCS code point */
39816 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39817 mem_base = xmlMemBlocks();
39818 code = gen_int(n_code, 0);
39820 ret_val = xmlUCSIsDeseret(code);
39821 desret_int(ret_val);
39823 des_int(n_code, code, 0);
39824 xmlResetLastError();
39825 if (mem_base != xmlMemBlocks()) {
39826 printf("Leak of %d blocks found in xmlUCSIsDeseret",
39827 xmlMemBlocks() - mem_base);
39829 printf(" %d", n_code);
39841 test_xmlUCSIsDevanagari(void) {
39844 #if defined(LIBXML_UNICODE_ENABLED)
39847 int code; /* UCS code point */
39850 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39851 mem_base = xmlMemBlocks();
39852 code = gen_int(n_code, 0);
39854 ret_val = xmlUCSIsDevanagari(code);
39855 desret_int(ret_val);
39857 des_int(n_code, code, 0);
39858 xmlResetLastError();
39859 if (mem_base != xmlMemBlocks()) {
39860 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39861 xmlMemBlocks() - mem_base);
39863 printf(" %d", n_code);
39875 test_xmlUCSIsDingbats(void) {
39878 #if defined(LIBXML_UNICODE_ENABLED)
39881 int code; /* UCS code point */
39884 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39885 mem_base = xmlMemBlocks();
39886 code = gen_int(n_code, 0);
39888 ret_val = xmlUCSIsDingbats(code);
39889 desret_int(ret_val);
39891 des_int(n_code, code, 0);
39892 xmlResetLastError();
39893 if (mem_base != xmlMemBlocks()) {
39894 printf("Leak of %d blocks found in xmlUCSIsDingbats",
39895 xmlMemBlocks() - mem_base);
39897 printf(" %d", n_code);
39909 test_xmlUCSIsEnclosedAlphanumerics(void) {
39912 #if defined(LIBXML_UNICODE_ENABLED)
39915 int code; /* UCS code point */
39918 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39919 mem_base = xmlMemBlocks();
39920 code = gen_int(n_code, 0);
39922 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39923 desret_int(ret_val);
39925 des_int(n_code, code, 0);
39926 xmlResetLastError();
39927 if (mem_base != xmlMemBlocks()) {
39928 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39929 xmlMemBlocks() - mem_base);
39931 printf(" %d", n_code);
39943 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39946 #if defined(LIBXML_UNICODE_ENABLED)
39949 int code; /* UCS code point */
39952 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39953 mem_base = xmlMemBlocks();
39954 code = gen_int(n_code, 0);
39956 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39957 desret_int(ret_val);
39959 des_int(n_code, code, 0);
39960 xmlResetLastError();
39961 if (mem_base != xmlMemBlocks()) {
39962 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39963 xmlMemBlocks() - mem_base);
39965 printf(" %d", n_code);
39977 test_xmlUCSIsEthiopic(void) {
39980 #if defined(LIBXML_UNICODE_ENABLED)
39983 int code; /* UCS code point */
39986 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39987 mem_base = xmlMemBlocks();
39988 code = gen_int(n_code, 0);
39990 ret_val = xmlUCSIsEthiopic(code);
39991 desret_int(ret_val);
39993 des_int(n_code, code, 0);
39994 xmlResetLastError();
39995 if (mem_base != xmlMemBlocks()) {
39996 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39997 xmlMemBlocks() - mem_base);
39999 printf(" %d", n_code);
40011 test_xmlUCSIsGeneralPunctuation(void) {
40014 #if defined(LIBXML_UNICODE_ENABLED)
40017 int code; /* UCS code point */
40020 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40021 mem_base = xmlMemBlocks();
40022 code = gen_int(n_code, 0);
40024 ret_val = xmlUCSIsGeneralPunctuation(code);
40025 desret_int(ret_val);
40027 des_int(n_code, code, 0);
40028 xmlResetLastError();
40029 if (mem_base != xmlMemBlocks()) {
40030 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40031 xmlMemBlocks() - mem_base);
40033 printf(" %d", n_code);
40045 test_xmlUCSIsGeometricShapes(void) {
40048 #if defined(LIBXML_UNICODE_ENABLED)
40051 int code; /* UCS code point */
40054 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40055 mem_base = xmlMemBlocks();
40056 code = gen_int(n_code, 0);
40058 ret_val = xmlUCSIsGeometricShapes(code);
40059 desret_int(ret_val);
40061 des_int(n_code, code, 0);
40062 xmlResetLastError();
40063 if (mem_base != xmlMemBlocks()) {
40064 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40065 xmlMemBlocks() - mem_base);
40067 printf(" %d", n_code);
40079 test_xmlUCSIsGeorgian(void) {
40082 #if defined(LIBXML_UNICODE_ENABLED)
40085 int code; /* UCS code point */
40088 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40089 mem_base = xmlMemBlocks();
40090 code = gen_int(n_code, 0);
40092 ret_val = xmlUCSIsGeorgian(code);
40093 desret_int(ret_val);
40095 des_int(n_code, code, 0);
40096 xmlResetLastError();
40097 if (mem_base != xmlMemBlocks()) {
40098 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40099 xmlMemBlocks() - mem_base);
40101 printf(" %d", n_code);
40113 test_xmlUCSIsGothic(void) {
40116 #if defined(LIBXML_UNICODE_ENABLED)
40119 int code; /* UCS code point */
40122 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40123 mem_base = xmlMemBlocks();
40124 code = gen_int(n_code, 0);
40126 ret_val = xmlUCSIsGothic(code);
40127 desret_int(ret_val);
40129 des_int(n_code, code, 0);
40130 xmlResetLastError();
40131 if (mem_base != xmlMemBlocks()) {
40132 printf("Leak of %d blocks found in xmlUCSIsGothic",
40133 xmlMemBlocks() - mem_base);
40135 printf(" %d", n_code);
40147 test_xmlUCSIsGreek(void) {
40150 #if defined(LIBXML_UNICODE_ENABLED)
40153 int code; /* UCS code point */
40156 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40157 mem_base = xmlMemBlocks();
40158 code = gen_int(n_code, 0);
40160 ret_val = xmlUCSIsGreek(code);
40161 desret_int(ret_val);
40163 des_int(n_code, code, 0);
40164 xmlResetLastError();
40165 if (mem_base != xmlMemBlocks()) {
40166 printf("Leak of %d blocks found in xmlUCSIsGreek",
40167 xmlMemBlocks() - mem_base);
40169 printf(" %d", n_code);
40181 test_xmlUCSIsGreekExtended(void) {
40184 #if defined(LIBXML_UNICODE_ENABLED)
40187 int code; /* UCS code point */
40190 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40191 mem_base = xmlMemBlocks();
40192 code = gen_int(n_code, 0);
40194 ret_val = xmlUCSIsGreekExtended(code);
40195 desret_int(ret_val);
40197 des_int(n_code, code, 0);
40198 xmlResetLastError();
40199 if (mem_base != xmlMemBlocks()) {
40200 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40201 xmlMemBlocks() - mem_base);
40203 printf(" %d", n_code);
40215 test_xmlUCSIsGreekandCoptic(void) {
40218 #if defined(LIBXML_UNICODE_ENABLED)
40221 int code; /* UCS code point */
40224 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40225 mem_base = xmlMemBlocks();
40226 code = gen_int(n_code, 0);
40228 ret_val = xmlUCSIsGreekandCoptic(code);
40229 desret_int(ret_val);
40231 des_int(n_code, code, 0);
40232 xmlResetLastError();
40233 if (mem_base != xmlMemBlocks()) {
40234 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40235 xmlMemBlocks() - mem_base);
40237 printf(" %d", n_code);
40249 test_xmlUCSIsGujarati(void) {
40252 #if defined(LIBXML_UNICODE_ENABLED)
40255 int code; /* UCS code point */
40258 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40259 mem_base = xmlMemBlocks();
40260 code = gen_int(n_code, 0);
40262 ret_val = xmlUCSIsGujarati(code);
40263 desret_int(ret_val);
40265 des_int(n_code, code, 0);
40266 xmlResetLastError();
40267 if (mem_base != xmlMemBlocks()) {
40268 printf("Leak of %d blocks found in xmlUCSIsGujarati",
40269 xmlMemBlocks() - mem_base);
40271 printf(" %d", n_code);
40283 test_xmlUCSIsGurmukhi(void) {
40286 #if defined(LIBXML_UNICODE_ENABLED)
40289 int code; /* UCS code point */
40292 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40293 mem_base = xmlMemBlocks();
40294 code = gen_int(n_code, 0);
40296 ret_val = xmlUCSIsGurmukhi(code);
40297 desret_int(ret_val);
40299 des_int(n_code, code, 0);
40300 xmlResetLastError();
40301 if (mem_base != xmlMemBlocks()) {
40302 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40303 xmlMemBlocks() - mem_base);
40305 printf(" %d", n_code);
40317 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40320 #if defined(LIBXML_UNICODE_ENABLED)
40323 int code; /* UCS code point */
40326 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40327 mem_base = xmlMemBlocks();
40328 code = gen_int(n_code, 0);
40330 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40331 desret_int(ret_val);
40333 des_int(n_code, code, 0);
40334 xmlResetLastError();
40335 if (mem_base != xmlMemBlocks()) {
40336 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40337 xmlMemBlocks() - mem_base);
40339 printf(" %d", n_code);
40351 test_xmlUCSIsHangulCompatibilityJamo(void) {
40354 #if defined(LIBXML_UNICODE_ENABLED)
40357 int code; /* UCS code point */
40360 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40361 mem_base = xmlMemBlocks();
40362 code = gen_int(n_code, 0);
40364 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40365 desret_int(ret_val);
40367 des_int(n_code, code, 0);
40368 xmlResetLastError();
40369 if (mem_base != xmlMemBlocks()) {
40370 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40371 xmlMemBlocks() - mem_base);
40373 printf(" %d", n_code);
40385 test_xmlUCSIsHangulJamo(void) {
40388 #if defined(LIBXML_UNICODE_ENABLED)
40391 int code; /* UCS code point */
40394 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40395 mem_base = xmlMemBlocks();
40396 code = gen_int(n_code, 0);
40398 ret_val = xmlUCSIsHangulJamo(code);
40399 desret_int(ret_val);
40401 des_int(n_code, code, 0);
40402 xmlResetLastError();
40403 if (mem_base != xmlMemBlocks()) {
40404 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40405 xmlMemBlocks() - mem_base);
40407 printf(" %d", n_code);
40419 test_xmlUCSIsHangulSyllables(void) {
40422 #if defined(LIBXML_UNICODE_ENABLED)
40425 int code; /* UCS code point */
40428 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40429 mem_base = xmlMemBlocks();
40430 code = gen_int(n_code, 0);
40432 ret_val = xmlUCSIsHangulSyllables(code);
40433 desret_int(ret_val);
40435 des_int(n_code, code, 0);
40436 xmlResetLastError();
40437 if (mem_base != xmlMemBlocks()) {
40438 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40439 xmlMemBlocks() - mem_base);
40441 printf(" %d", n_code);
40453 test_xmlUCSIsHanunoo(void) {
40456 #if defined(LIBXML_UNICODE_ENABLED)
40459 int code; /* UCS code point */
40462 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40463 mem_base = xmlMemBlocks();
40464 code = gen_int(n_code, 0);
40466 ret_val = xmlUCSIsHanunoo(code);
40467 desret_int(ret_val);
40469 des_int(n_code, code, 0);
40470 xmlResetLastError();
40471 if (mem_base != xmlMemBlocks()) {
40472 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40473 xmlMemBlocks() - mem_base);
40475 printf(" %d", n_code);
40487 test_xmlUCSIsHebrew(void) {
40490 #if defined(LIBXML_UNICODE_ENABLED)
40493 int code; /* UCS code point */
40496 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40497 mem_base = xmlMemBlocks();
40498 code = gen_int(n_code, 0);
40500 ret_val = xmlUCSIsHebrew(code);
40501 desret_int(ret_val);
40503 des_int(n_code, code, 0);
40504 xmlResetLastError();
40505 if (mem_base != xmlMemBlocks()) {
40506 printf("Leak of %d blocks found in xmlUCSIsHebrew",
40507 xmlMemBlocks() - mem_base);
40509 printf(" %d", n_code);
40521 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40524 #if defined(LIBXML_UNICODE_ENABLED)
40527 int code; /* UCS code point */
40530 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40531 mem_base = xmlMemBlocks();
40532 code = gen_int(n_code, 0);
40534 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40535 desret_int(ret_val);
40537 des_int(n_code, code, 0);
40538 xmlResetLastError();
40539 if (mem_base != xmlMemBlocks()) {
40540 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40541 xmlMemBlocks() - mem_base);
40543 printf(" %d", n_code);
40555 test_xmlUCSIsHighSurrogates(void) {
40558 #if defined(LIBXML_UNICODE_ENABLED)
40561 int code; /* UCS code point */
40564 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40565 mem_base = xmlMemBlocks();
40566 code = gen_int(n_code, 0);
40568 ret_val = xmlUCSIsHighSurrogates(code);
40569 desret_int(ret_val);
40571 des_int(n_code, code, 0);
40572 xmlResetLastError();
40573 if (mem_base != xmlMemBlocks()) {
40574 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40575 xmlMemBlocks() - mem_base);
40577 printf(" %d", n_code);
40589 test_xmlUCSIsHiragana(void) {
40592 #if defined(LIBXML_UNICODE_ENABLED)
40595 int code; /* UCS code point */
40598 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40599 mem_base = xmlMemBlocks();
40600 code = gen_int(n_code, 0);
40602 ret_val = xmlUCSIsHiragana(code);
40603 desret_int(ret_val);
40605 des_int(n_code, code, 0);
40606 xmlResetLastError();
40607 if (mem_base != xmlMemBlocks()) {
40608 printf("Leak of %d blocks found in xmlUCSIsHiragana",
40609 xmlMemBlocks() - mem_base);
40611 printf(" %d", n_code);
40623 test_xmlUCSIsIPAExtensions(void) {
40626 #if defined(LIBXML_UNICODE_ENABLED)
40629 int code; /* UCS code point */
40632 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40633 mem_base = xmlMemBlocks();
40634 code = gen_int(n_code, 0);
40636 ret_val = xmlUCSIsIPAExtensions(code);
40637 desret_int(ret_val);
40639 des_int(n_code, code, 0);
40640 xmlResetLastError();
40641 if (mem_base != xmlMemBlocks()) {
40642 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40643 xmlMemBlocks() - mem_base);
40645 printf(" %d", n_code);
40657 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40660 #if defined(LIBXML_UNICODE_ENABLED)
40663 int code; /* UCS code point */
40666 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40667 mem_base = xmlMemBlocks();
40668 code = gen_int(n_code, 0);
40670 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40671 desret_int(ret_val);
40673 des_int(n_code, code, 0);
40674 xmlResetLastError();
40675 if (mem_base != xmlMemBlocks()) {
40676 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40677 xmlMemBlocks() - mem_base);
40679 printf(" %d", n_code);
40691 test_xmlUCSIsKanbun(void) {
40694 #if defined(LIBXML_UNICODE_ENABLED)
40697 int code; /* UCS code point */
40700 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40701 mem_base = xmlMemBlocks();
40702 code = gen_int(n_code, 0);
40704 ret_val = xmlUCSIsKanbun(code);
40705 desret_int(ret_val);
40707 des_int(n_code, code, 0);
40708 xmlResetLastError();
40709 if (mem_base != xmlMemBlocks()) {
40710 printf("Leak of %d blocks found in xmlUCSIsKanbun",
40711 xmlMemBlocks() - mem_base);
40713 printf(" %d", n_code);
40725 test_xmlUCSIsKangxiRadicals(void) {
40728 #if defined(LIBXML_UNICODE_ENABLED)
40731 int code; /* UCS code point */
40734 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40735 mem_base = xmlMemBlocks();
40736 code = gen_int(n_code, 0);
40738 ret_val = xmlUCSIsKangxiRadicals(code);
40739 desret_int(ret_val);
40741 des_int(n_code, code, 0);
40742 xmlResetLastError();
40743 if (mem_base != xmlMemBlocks()) {
40744 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40745 xmlMemBlocks() - mem_base);
40747 printf(" %d", n_code);
40759 test_xmlUCSIsKannada(void) {
40762 #if defined(LIBXML_UNICODE_ENABLED)
40765 int code; /* UCS code point */
40768 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40769 mem_base = xmlMemBlocks();
40770 code = gen_int(n_code, 0);
40772 ret_val = xmlUCSIsKannada(code);
40773 desret_int(ret_val);
40775 des_int(n_code, code, 0);
40776 xmlResetLastError();
40777 if (mem_base != xmlMemBlocks()) {
40778 printf("Leak of %d blocks found in xmlUCSIsKannada",
40779 xmlMemBlocks() - mem_base);
40781 printf(" %d", n_code);
40793 test_xmlUCSIsKatakana(void) {
40796 #if defined(LIBXML_UNICODE_ENABLED)
40799 int code; /* UCS code point */
40802 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40803 mem_base = xmlMemBlocks();
40804 code = gen_int(n_code, 0);
40806 ret_val = xmlUCSIsKatakana(code);
40807 desret_int(ret_val);
40809 des_int(n_code, code, 0);
40810 xmlResetLastError();
40811 if (mem_base != xmlMemBlocks()) {
40812 printf("Leak of %d blocks found in xmlUCSIsKatakana",
40813 xmlMemBlocks() - mem_base);
40815 printf(" %d", n_code);
40827 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40830 #if defined(LIBXML_UNICODE_ENABLED)
40833 int code; /* UCS code point */
40836 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40837 mem_base = xmlMemBlocks();
40838 code = gen_int(n_code, 0);
40840 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40841 desret_int(ret_val);
40843 des_int(n_code, code, 0);
40844 xmlResetLastError();
40845 if (mem_base != xmlMemBlocks()) {
40846 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40847 xmlMemBlocks() - mem_base);
40849 printf(" %d", n_code);
40861 test_xmlUCSIsKhmer(void) {
40864 #if defined(LIBXML_UNICODE_ENABLED)
40867 int code; /* UCS code point */
40870 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40871 mem_base = xmlMemBlocks();
40872 code = gen_int(n_code, 0);
40874 ret_val = xmlUCSIsKhmer(code);
40875 desret_int(ret_val);
40877 des_int(n_code, code, 0);
40878 xmlResetLastError();
40879 if (mem_base != xmlMemBlocks()) {
40880 printf("Leak of %d blocks found in xmlUCSIsKhmer",
40881 xmlMemBlocks() - mem_base);
40883 printf(" %d", n_code);
40895 test_xmlUCSIsKhmerSymbols(void) {
40898 #if defined(LIBXML_UNICODE_ENABLED)
40901 int code; /* UCS code point */
40904 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40905 mem_base = xmlMemBlocks();
40906 code = gen_int(n_code, 0);
40908 ret_val = xmlUCSIsKhmerSymbols(code);
40909 desret_int(ret_val);
40911 des_int(n_code, code, 0);
40912 xmlResetLastError();
40913 if (mem_base != xmlMemBlocks()) {
40914 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40915 xmlMemBlocks() - mem_base);
40917 printf(" %d", n_code);
40929 test_xmlUCSIsLao(void) {
40932 #if defined(LIBXML_UNICODE_ENABLED)
40935 int code; /* UCS code point */
40938 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40939 mem_base = xmlMemBlocks();
40940 code = gen_int(n_code, 0);
40942 ret_val = xmlUCSIsLao(code);
40943 desret_int(ret_val);
40945 des_int(n_code, code, 0);
40946 xmlResetLastError();
40947 if (mem_base != xmlMemBlocks()) {
40948 printf("Leak of %d blocks found in xmlUCSIsLao",
40949 xmlMemBlocks() - mem_base);
40951 printf(" %d", n_code);
40963 test_xmlUCSIsLatin1Supplement(void) {
40966 #if defined(LIBXML_UNICODE_ENABLED)
40969 int code; /* UCS code point */
40972 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40973 mem_base = xmlMemBlocks();
40974 code = gen_int(n_code, 0);
40976 ret_val = xmlUCSIsLatin1Supplement(code);
40977 desret_int(ret_val);
40979 des_int(n_code, code, 0);
40980 xmlResetLastError();
40981 if (mem_base != xmlMemBlocks()) {
40982 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40983 xmlMemBlocks() - mem_base);
40985 printf(" %d", n_code);
40997 test_xmlUCSIsLatinExtendedA(void) {
41000 #if defined(LIBXML_UNICODE_ENABLED)
41003 int code; /* UCS code point */
41006 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41007 mem_base = xmlMemBlocks();
41008 code = gen_int(n_code, 0);
41010 ret_val = xmlUCSIsLatinExtendedA(code);
41011 desret_int(ret_val);
41013 des_int(n_code, code, 0);
41014 xmlResetLastError();
41015 if (mem_base != xmlMemBlocks()) {
41016 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41017 xmlMemBlocks() - mem_base);
41019 printf(" %d", n_code);
41031 test_xmlUCSIsLatinExtendedAdditional(void) {
41034 #if defined(LIBXML_UNICODE_ENABLED)
41037 int code; /* UCS code point */
41040 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41041 mem_base = xmlMemBlocks();
41042 code = gen_int(n_code, 0);
41044 ret_val = xmlUCSIsLatinExtendedAdditional(code);
41045 desret_int(ret_val);
41047 des_int(n_code, code, 0);
41048 xmlResetLastError();
41049 if (mem_base != xmlMemBlocks()) {
41050 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41051 xmlMemBlocks() - mem_base);
41053 printf(" %d", n_code);
41065 test_xmlUCSIsLatinExtendedB(void) {
41068 #if defined(LIBXML_UNICODE_ENABLED)
41071 int code; /* UCS code point */
41074 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41075 mem_base = xmlMemBlocks();
41076 code = gen_int(n_code, 0);
41078 ret_val = xmlUCSIsLatinExtendedB(code);
41079 desret_int(ret_val);
41081 des_int(n_code, code, 0);
41082 xmlResetLastError();
41083 if (mem_base != xmlMemBlocks()) {
41084 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41085 xmlMemBlocks() - mem_base);
41087 printf(" %d", n_code);
41099 test_xmlUCSIsLetterlikeSymbols(void) {
41102 #if defined(LIBXML_UNICODE_ENABLED)
41105 int code; /* UCS code point */
41108 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41109 mem_base = xmlMemBlocks();
41110 code = gen_int(n_code, 0);
41112 ret_val = xmlUCSIsLetterlikeSymbols(code);
41113 desret_int(ret_val);
41115 des_int(n_code, code, 0);
41116 xmlResetLastError();
41117 if (mem_base != xmlMemBlocks()) {
41118 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41119 xmlMemBlocks() - mem_base);
41121 printf(" %d", n_code);
41133 test_xmlUCSIsLimbu(void) {
41136 #if defined(LIBXML_UNICODE_ENABLED)
41139 int code; /* UCS code point */
41142 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41143 mem_base = xmlMemBlocks();
41144 code = gen_int(n_code, 0);
41146 ret_val = xmlUCSIsLimbu(code);
41147 desret_int(ret_val);
41149 des_int(n_code, code, 0);
41150 xmlResetLastError();
41151 if (mem_base != xmlMemBlocks()) {
41152 printf("Leak of %d blocks found in xmlUCSIsLimbu",
41153 xmlMemBlocks() - mem_base);
41155 printf(" %d", n_code);
41167 test_xmlUCSIsLinearBIdeograms(void) {
41170 #if defined(LIBXML_UNICODE_ENABLED)
41173 int code; /* UCS code point */
41176 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41177 mem_base = xmlMemBlocks();
41178 code = gen_int(n_code, 0);
41180 ret_val = xmlUCSIsLinearBIdeograms(code);
41181 desret_int(ret_val);
41183 des_int(n_code, code, 0);
41184 xmlResetLastError();
41185 if (mem_base != xmlMemBlocks()) {
41186 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41187 xmlMemBlocks() - mem_base);
41189 printf(" %d", n_code);
41201 test_xmlUCSIsLinearBSyllabary(void) {
41204 #if defined(LIBXML_UNICODE_ENABLED)
41207 int code; /* UCS code point */
41210 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41211 mem_base = xmlMemBlocks();
41212 code = gen_int(n_code, 0);
41214 ret_val = xmlUCSIsLinearBSyllabary(code);
41215 desret_int(ret_val);
41217 des_int(n_code, code, 0);
41218 xmlResetLastError();
41219 if (mem_base != xmlMemBlocks()) {
41220 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41221 xmlMemBlocks() - mem_base);
41223 printf(" %d", n_code);
41235 test_xmlUCSIsLowSurrogates(void) {
41238 #if defined(LIBXML_UNICODE_ENABLED)
41241 int code; /* UCS code point */
41244 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41245 mem_base = xmlMemBlocks();
41246 code = gen_int(n_code, 0);
41248 ret_val = xmlUCSIsLowSurrogates(code);
41249 desret_int(ret_val);
41251 des_int(n_code, code, 0);
41252 xmlResetLastError();
41253 if (mem_base != xmlMemBlocks()) {
41254 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41255 xmlMemBlocks() - mem_base);
41257 printf(" %d", n_code);
41269 test_xmlUCSIsMalayalam(void) {
41272 #if defined(LIBXML_UNICODE_ENABLED)
41275 int code; /* UCS code point */
41278 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41279 mem_base = xmlMemBlocks();
41280 code = gen_int(n_code, 0);
41282 ret_val = xmlUCSIsMalayalam(code);
41283 desret_int(ret_val);
41285 des_int(n_code, code, 0);
41286 xmlResetLastError();
41287 if (mem_base != xmlMemBlocks()) {
41288 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41289 xmlMemBlocks() - mem_base);
41291 printf(" %d", n_code);
41303 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41306 #if defined(LIBXML_UNICODE_ENABLED)
41309 int code; /* UCS code point */
41312 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41313 mem_base = xmlMemBlocks();
41314 code = gen_int(n_code, 0);
41316 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41317 desret_int(ret_val);
41319 des_int(n_code, code, 0);
41320 xmlResetLastError();
41321 if (mem_base != xmlMemBlocks()) {
41322 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41323 xmlMemBlocks() - mem_base);
41325 printf(" %d", n_code);
41337 test_xmlUCSIsMathematicalOperators(void) {
41340 #if defined(LIBXML_UNICODE_ENABLED)
41343 int code; /* UCS code point */
41346 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41347 mem_base = xmlMemBlocks();
41348 code = gen_int(n_code, 0);
41350 ret_val = xmlUCSIsMathematicalOperators(code);
41351 desret_int(ret_val);
41353 des_int(n_code, code, 0);
41354 xmlResetLastError();
41355 if (mem_base != xmlMemBlocks()) {
41356 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41357 xmlMemBlocks() - mem_base);
41359 printf(" %d", n_code);
41371 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41374 #if defined(LIBXML_UNICODE_ENABLED)
41377 int code; /* UCS code point */
41380 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41381 mem_base = xmlMemBlocks();
41382 code = gen_int(n_code, 0);
41384 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41385 desret_int(ret_val);
41387 des_int(n_code, code, 0);
41388 xmlResetLastError();
41389 if (mem_base != xmlMemBlocks()) {
41390 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41391 xmlMemBlocks() - mem_base);
41393 printf(" %d", n_code);
41405 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41408 #if defined(LIBXML_UNICODE_ENABLED)
41411 int code; /* UCS code point */
41414 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41415 mem_base = xmlMemBlocks();
41416 code = gen_int(n_code, 0);
41418 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41419 desret_int(ret_val);
41421 des_int(n_code, code, 0);
41422 xmlResetLastError();
41423 if (mem_base != xmlMemBlocks()) {
41424 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41425 xmlMemBlocks() - mem_base);
41427 printf(" %d", n_code);
41439 test_xmlUCSIsMiscellaneousSymbols(void) {
41442 #if defined(LIBXML_UNICODE_ENABLED)
41445 int code; /* UCS code point */
41448 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41449 mem_base = xmlMemBlocks();
41450 code = gen_int(n_code, 0);
41452 ret_val = xmlUCSIsMiscellaneousSymbols(code);
41453 desret_int(ret_val);
41455 des_int(n_code, code, 0);
41456 xmlResetLastError();
41457 if (mem_base != xmlMemBlocks()) {
41458 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41459 xmlMemBlocks() - mem_base);
41461 printf(" %d", n_code);
41473 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41476 #if defined(LIBXML_UNICODE_ENABLED)
41479 int code; /* UCS code point */
41482 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41483 mem_base = xmlMemBlocks();
41484 code = gen_int(n_code, 0);
41486 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41487 desret_int(ret_val);
41489 des_int(n_code, code, 0);
41490 xmlResetLastError();
41491 if (mem_base != xmlMemBlocks()) {
41492 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41493 xmlMemBlocks() - mem_base);
41495 printf(" %d", n_code);
41507 test_xmlUCSIsMiscellaneousTechnical(void) {
41510 #if defined(LIBXML_UNICODE_ENABLED)
41513 int code; /* UCS code point */
41516 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41517 mem_base = xmlMemBlocks();
41518 code = gen_int(n_code, 0);
41520 ret_val = xmlUCSIsMiscellaneousTechnical(code);
41521 desret_int(ret_val);
41523 des_int(n_code, code, 0);
41524 xmlResetLastError();
41525 if (mem_base != xmlMemBlocks()) {
41526 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41527 xmlMemBlocks() - mem_base);
41529 printf(" %d", n_code);
41541 test_xmlUCSIsMongolian(void) {
41544 #if defined(LIBXML_UNICODE_ENABLED)
41547 int code; /* UCS code point */
41550 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41551 mem_base = xmlMemBlocks();
41552 code = gen_int(n_code, 0);
41554 ret_val = xmlUCSIsMongolian(code);
41555 desret_int(ret_val);
41557 des_int(n_code, code, 0);
41558 xmlResetLastError();
41559 if (mem_base != xmlMemBlocks()) {
41560 printf("Leak of %d blocks found in xmlUCSIsMongolian",
41561 xmlMemBlocks() - mem_base);
41563 printf(" %d", n_code);
41575 test_xmlUCSIsMusicalSymbols(void) {
41578 #if defined(LIBXML_UNICODE_ENABLED)
41581 int code; /* UCS code point */
41584 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41585 mem_base = xmlMemBlocks();
41586 code = gen_int(n_code, 0);
41588 ret_val = xmlUCSIsMusicalSymbols(code);
41589 desret_int(ret_val);
41591 des_int(n_code, code, 0);
41592 xmlResetLastError();
41593 if (mem_base != xmlMemBlocks()) {
41594 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41595 xmlMemBlocks() - mem_base);
41597 printf(" %d", n_code);
41609 test_xmlUCSIsMyanmar(void) {
41612 #if defined(LIBXML_UNICODE_ENABLED)
41615 int code; /* UCS code point */
41618 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41619 mem_base = xmlMemBlocks();
41620 code = gen_int(n_code, 0);
41622 ret_val = xmlUCSIsMyanmar(code);
41623 desret_int(ret_val);
41625 des_int(n_code, code, 0);
41626 xmlResetLastError();
41627 if (mem_base != xmlMemBlocks()) {
41628 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41629 xmlMemBlocks() - mem_base);
41631 printf(" %d", n_code);
41643 test_xmlUCSIsNumberForms(void) {
41646 #if defined(LIBXML_UNICODE_ENABLED)
41649 int code; /* UCS code point */
41652 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41653 mem_base = xmlMemBlocks();
41654 code = gen_int(n_code, 0);
41656 ret_val = xmlUCSIsNumberForms(code);
41657 desret_int(ret_val);
41659 des_int(n_code, code, 0);
41660 xmlResetLastError();
41661 if (mem_base != xmlMemBlocks()) {
41662 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41663 xmlMemBlocks() - mem_base);
41665 printf(" %d", n_code);
41677 test_xmlUCSIsOgham(void) {
41680 #if defined(LIBXML_UNICODE_ENABLED)
41683 int code; /* UCS code point */
41686 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41687 mem_base = xmlMemBlocks();
41688 code = gen_int(n_code, 0);
41690 ret_val = xmlUCSIsOgham(code);
41691 desret_int(ret_val);
41693 des_int(n_code, code, 0);
41694 xmlResetLastError();
41695 if (mem_base != xmlMemBlocks()) {
41696 printf("Leak of %d blocks found in xmlUCSIsOgham",
41697 xmlMemBlocks() - mem_base);
41699 printf(" %d", n_code);
41711 test_xmlUCSIsOldItalic(void) {
41714 #if defined(LIBXML_UNICODE_ENABLED)
41717 int code; /* UCS code point */
41720 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41721 mem_base = xmlMemBlocks();
41722 code = gen_int(n_code, 0);
41724 ret_val = xmlUCSIsOldItalic(code);
41725 desret_int(ret_val);
41727 des_int(n_code, code, 0);
41728 xmlResetLastError();
41729 if (mem_base != xmlMemBlocks()) {
41730 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41731 xmlMemBlocks() - mem_base);
41733 printf(" %d", n_code);
41745 test_xmlUCSIsOpticalCharacterRecognition(void) {
41748 #if defined(LIBXML_UNICODE_ENABLED)
41751 int code; /* UCS code point */
41754 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41755 mem_base = xmlMemBlocks();
41756 code = gen_int(n_code, 0);
41758 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41759 desret_int(ret_val);
41761 des_int(n_code, code, 0);
41762 xmlResetLastError();
41763 if (mem_base != xmlMemBlocks()) {
41764 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41765 xmlMemBlocks() - mem_base);
41767 printf(" %d", n_code);
41779 test_xmlUCSIsOriya(void) {
41782 #if defined(LIBXML_UNICODE_ENABLED)
41785 int code; /* UCS code point */
41788 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41789 mem_base = xmlMemBlocks();
41790 code = gen_int(n_code, 0);
41792 ret_val = xmlUCSIsOriya(code);
41793 desret_int(ret_val);
41795 des_int(n_code, code, 0);
41796 xmlResetLastError();
41797 if (mem_base != xmlMemBlocks()) {
41798 printf("Leak of %d blocks found in xmlUCSIsOriya",
41799 xmlMemBlocks() - mem_base);
41801 printf(" %d", n_code);
41813 test_xmlUCSIsOsmanya(void) {
41816 #if defined(LIBXML_UNICODE_ENABLED)
41819 int code; /* UCS code point */
41822 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41823 mem_base = xmlMemBlocks();
41824 code = gen_int(n_code, 0);
41826 ret_val = xmlUCSIsOsmanya(code);
41827 desret_int(ret_val);
41829 des_int(n_code, code, 0);
41830 xmlResetLastError();
41831 if (mem_base != xmlMemBlocks()) {
41832 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41833 xmlMemBlocks() - mem_base);
41835 printf(" %d", n_code);
41847 test_xmlUCSIsPhoneticExtensions(void) {
41850 #if defined(LIBXML_UNICODE_ENABLED)
41853 int code; /* UCS code point */
41856 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41857 mem_base = xmlMemBlocks();
41858 code = gen_int(n_code, 0);
41860 ret_val = xmlUCSIsPhoneticExtensions(code);
41861 desret_int(ret_val);
41863 des_int(n_code, code, 0);
41864 xmlResetLastError();
41865 if (mem_base != xmlMemBlocks()) {
41866 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41867 xmlMemBlocks() - mem_base);
41869 printf(" %d", n_code);
41881 test_xmlUCSIsPrivateUse(void) {
41884 #if defined(LIBXML_UNICODE_ENABLED)
41887 int code; /* UCS code point */
41890 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41891 mem_base = xmlMemBlocks();
41892 code = gen_int(n_code, 0);
41894 ret_val = xmlUCSIsPrivateUse(code);
41895 desret_int(ret_val);
41897 des_int(n_code, code, 0);
41898 xmlResetLastError();
41899 if (mem_base != xmlMemBlocks()) {
41900 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41901 xmlMemBlocks() - mem_base);
41903 printf(" %d", n_code);
41915 test_xmlUCSIsPrivateUseArea(void) {
41918 #if defined(LIBXML_UNICODE_ENABLED)
41921 int code; /* UCS code point */
41924 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41925 mem_base = xmlMemBlocks();
41926 code = gen_int(n_code, 0);
41928 ret_val = xmlUCSIsPrivateUseArea(code);
41929 desret_int(ret_val);
41931 des_int(n_code, code, 0);
41932 xmlResetLastError();
41933 if (mem_base != xmlMemBlocks()) {
41934 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41935 xmlMemBlocks() - mem_base);
41937 printf(" %d", n_code);
41949 test_xmlUCSIsRunic(void) {
41952 #if defined(LIBXML_UNICODE_ENABLED)
41955 int code; /* UCS code point */
41958 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41959 mem_base = xmlMemBlocks();
41960 code = gen_int(n_code, 0);
41962 ret_val = xmlUCSIsRunic(code);
41963 desret_int(ret_val);
41965 des_int(n_code, code, 0);
41966 xmlResetLastError();
41967 if (mem_base != xmlMemBlocks()) {
41968 printf("Leak of %d blocks found in xmlUCSIsRunic",
41969 xmlMemBlocks() - mem_base);
41971 printf(" %d", n_code);
41983 test_xmlUCSIsShavian(void) {
41986 #if defined(LIBXML_UNICODE_ENABLED)
41989 int code; /* UCS code point */
41992 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41993 mem_base = xmlMemBlocks();
41994 code = gen_int(n_code, 0);
41996 ret_val = xmlUCSIsShavian(code);
41997 desret_int(ret_val);
41999 des_int(n_code, code, 0);
42000 xmlResetLastError();
42001 if (mem_base != xmlMemBlocks()) {
42002 printf("Leak of %d blocks found in xmlUCSIsShavian",
42003 xmlMemBlocks() - mem_base);
42005 printf(" %d", n_code);
42017 test_xmlUCSIsSinhala(void) {
42020 #if defined(LIBXML_UNICODE_ENABLED)
42023 int code; /* UCS code point */
42026 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42027 mem_base = xmlMemBlocks();
42028 code = gen_int(n_code, 0);
42030 ret_val = xmlUCSIsSinhala(code);
42031 desret_int(ret_val);
42033 des_int(n_code, code, 0);
42034 xmlResetLastError();
42035 if (mem_base != xmlMemBlocks()) {
42036 printf("Leak of %d blocks found in xmlUCSIsSinhala",
42037 xmlMemBlocks() - mem_base);
42039 printf(" %d", n_code);
42051 test_xmlUCSIsSmallFormVariants(void) {
42054 #if defined(LIBXML_UNICODE_ENABLED)
42057 int code; /* UCS code point */
42060 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42061 mem_base = xmlMemBlocks();
42062 code = gen_int(n_code, 0);
42064 ret_val = xmlUCSIsSmallFormVariants(code);
42065 desret_int(ret_val);
42067 des_int(n_code, code, 0);
42068 xmlResetLastError();
42069 if (mem_base != xmlMemBlocks()) {
42070 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42071 xmlMemBlocks() - mem_base);
42073 printf(" %d", n_code);
42085 test_xmlUCSIsSpacingModifierLetters(void) {
42088 #if defined(LIBXML_UNICODE_ENABLED)
42091 int code; /* UCS code point */
42094 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42095 mem_base = xmlMemBlocks();
42096 code = gen_int(n_code, 0);
42098 ret_val = xmlUCSIsSpacingModifierLetters(code);
42099 desret_int(ret_val);
42101 des_int(n_code, code, 0);
42102 xmlResetLastError();
42103 if (mem_base != xmlMemBlocks()) {
42104 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42105 xmlMemBlocks() - mem_base);
42107 printf(" %d", n_code);
42119 test_xmlUCSIsSpecials(void) {
42122 #if defined(LIBXML_UNICODE_ENABLED)
42125 int code; /* UCS code point */
42128 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42129 mem_base = xmlMemBlocks();
42130 code = gen_int(n_code, 0);
42132 ret_val = xmlUCSIsSpecials(code);
42133 desret_int(ret_val);
42135 des_int(n_code, code, 0);
42136 xmlResetLastError();
42137 if (mem_base != xmlMemBlocks()) {
42138 printf("Leak of %d blocks found in xmlUCSIsSpecials",
42139 xmlMemBlocks() - mem_base);
42141 printf(" %d", n_code);
42153 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42156 #if defined(LIBXML_UNICODE_ENABLED)
42159 int code; /* UCS code point */
42162 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42163 mem_base = xmlMemBlocks();
42164 code = gen_int(n_code, 0);
42166 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42167 desret_int(ret_val);
42169 des_int(n_code, code, 0);
42170 xmlResetLastError();
42171 if (mem_base != xmlMemBlocks()) {
42172 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42173 xmlMemBlocks() - mem_base);
42175 printf(" %d", n_code);
42187 test_xmlUCSIsSupplementalArrowsA(void) {
42190 #if defined(LIBXML_UNICODE_ENABLED)
42193 int code; /* UCS code point */
42196 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42197 mem_base = xmlMemBlocks();
42198 code = gen_int(n_code, 0);
42200 ret_val = xmlUCSIsSupplementalArrowsA(code);
42201 desret_int(ret_val);
42203 des_int(n_code, code, 0);
42204 xmlResetLastError();
42205 if (mem_base != xmlMemBlocks()) {
42206 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42207 xmlMemBlocks() - mem_base);
42209 printf(" %d", n_code);
42221 test_xmlUCSIsSupplementalArrowsB(void) {
42224 #if defined(LIBXML_UNICODE_ENABLED)
42227 int code; /* UCS code point */
42230 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42231 mem_base = xmlMemBlocks();
42232 code = gen_int(n_code, 0);
42234 ret_val = xmlUCSIsSupplementalArrowsB(code);
42235 desret_int(ret_val);
42237 des_int(n_code, code, 0);
42238 xmlResetLastError();
42239 if (mem_base != xmlMemBlocks()) {
42240 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42241 xmlMemBlocks() - mem_base);
42243 printf(" %d", n_code);
42255 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42258 #if defined(LIBXML_UNICODE_ENABLED)
42261 int code; /* UCS code point */
42264 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42265 mem_base = xmlMemBlocks();
42266 code = gen_int(n_code, 0);
42268 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42269 desret_int(ret_val);
42271 des_int(n_code, code, 0);
42272 xmlResetLastError();
42273 if (mem_base != xmlMemBlocks()) {
42274 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42275 xmlMemBlocks() - mem_base);
42277 printf(" %d", n_code);
42289 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42292 #if defined(LIBXML_UNICODE_ENABLED)
42295 int code; /* UCS code point */
42298 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42299 mem_base = xmlMemBlocks();
42300 code = gen_int(n_code, 0);
42302 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42303 desret_int(ret_val);
42305 des_int(n_code, code, 0);
42306 xmlResetLastError();
42307 if (mem_base != xmlMemBlocks()) {
42308 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42309 xmlMemBlocks() - mem_base);
42311 printf(" %d", n_code);
42323 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42326 #if defined(LIBXML_UNICODE_ENABLED)
42329 int code; /* UCS code point */
42332 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42333 mem_base = xmlMemBlocks();
42334 code = gen_int(n_code, 0);
42336 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42337 desret_int(ret_val);
42339 des_int(n_code, code, 0);
42340 xmlResetLastError();
42341 if (mem_base != xmlMemBlocks()) {
42342 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42343 xmlMemBlocks() - mem_base);
42345 printf(" %d", n_code);
42357 test_xmlUCSIsSyriac(void) {
42360 #if defined(LIBXML_UNICODE_ENABLED)
42363 int code; /* UCS code point */
42366 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42367 mem_base = xmlMemBlocks();
42368 code = gen_int(n_code, 0);
42370 ret_val = xmlUCSIsSyriac(code);
42371 desret_int(ret_val);
42373 des_int(n_code, code, 0);
42374 xmlResetLastError();
42375 if (mem_base != xmlMemBlocks()) {
42376 printf("Leak of %d blocks found in xmlUCSIsSyriac",
42377 xmlMemBlocks() - mem_base);
42379 printf(" %d", n_code);
42391 test_xmlUCSIsTagalog(void) {
42394 #if defined(LIBXML_UNICODE_ENABLED)
42397 int code; /* UCS code point */
42400 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42401 mem_base = xmlMemBlocks();
42402 code = gen_int(n_code, 0);
42404 ret_val = xmlUCSIsTagalog(code);
42405 desret_int(ret_val);
42407 des_int(n_code, code, 0);
42408 xmlResetLastError();
42409 if (mem_base != xmlMemBlocks()) {
42410 printf("Leak of %d blocks found in xmlUCSIsTagalog",
42411 xmlMemBlocks() - mem_base);
42413 printf(" %d", n_code);
42425 test_xmlUCSIsTagbanwa(void) {
42428 #if defined(LIBXML_UNICODE_ENABLED)
42431 int code; /* UCS code point */
42434 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42435 mem_base = xmlMemBlocks();
42436 code = gen_int(n_code, 0);
42438 ret_val = xmlUCSIsTagbanwa(code);
42439 desret_int(ret_val);
42441 des_int(n_code, code, 0);
42442 xmlResetLastError();
42443 if (mem_base != xmlMemBlocks()) {
42444 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42445 xmlMemBlocks() - mem_base);
42447 printf(" %d", n_code);
42459 test_xmlUCSIsTags(void) {
42462 #if defined(LIBXML_UNICODE_ENABLED)
42465 int code; /* UCS code point */
42468 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42469 mem_base = xmlMemBlocks();
42470 code = gen_int(n_code, 0);
42472 ret_val = xmlUCSIsTags(code);
42473 desret_int(ret_val);
42475 des_int(n_code, code, 0);
42476 xmlResetLastError();
42477 if (mem_base != xmlMemBlocks()) {
42478 printf("Leak of %d blocks found in xmlUCSIsTags",
42479 xmlMemBlocks() - mem_base);
42481 printf(" %d", n_code);
42493 test_xmlUCSIsTaiLe(void) {
42496 #if defined(LIBXML_UNICODE_ENABLED)
42499 int code; /* UCS code point */
42502 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42503 mem_base = xmlMemBlocks();
42504 code = gen_int(n_code, 0);
42506 ret_val = xmlUCSIsTaiLe(code);
42507 desret_int(ret_val);
42509 des_int(n_code, code, 0);
42510 xmlResetLastError();
42511 if (mem_base != xmlMemBlocks()) {
42512 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42513 xmlMemBlocks() - mem_base);
42515 printf(" %d", n_code);
42527 test_xmlUCSIsTaiXuanJingSymbols(void) {
42530 #if defined(LIBXML_UNICODE_ENABLED)
42533 int code; /* UCS code point */
42536 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42537 mem_base = xmlMemBlocks();
42538 code = gen_int(n_code, 0);
42540 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42541 desret_int(ret_val);
42543 des_int(n_code, code, 0);
42544 xmlResetLastError();
42545 if (mem_base != xmlMemBlocks()) {
42546 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42547 xmlMemBlocks() - mem_base);
42549 printf(" %d", n_code);
42561 test_xmlUCSIsTamil(void) {
42564 #if defined(LIBXML_UNICODE_ENABLED)
42567 int code; /* UCS code point */
42570 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42571 mem_base = xmlMemBlocks();
42572 code = gen_int(n_code, 0);
42574 ret_val = xmlUCSIsTamil(code);
42575 desret_int(ret_val);
42577 des_int(n_code, code, 0);
42578 xmlResetLastError();
42579 if (mem_base != xmlMemBlocks()) {
42580 printf("Leak of %d blocks found in xmlUCSIsTamil",
42581 xmlMemBlocks() - mem_base);
42583 printf(" %d", n_code);
42595 test_xmlUCSIsTelugu(void) {
42598 #if defined(LIBXML_UNICODE_ENABLED)
42601 int code; /* UCS code point */
42604 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42605 mem_base = xmlMemBlocks();
42606 code = gen_int(n_code, 0);
42608 ret_val = xmlUCSIsTelugu(code);
42609 desret_int(ret_val);
42611 des_int(n_code, code, 0);
42612 xmlResetLastError();
42613 if (mem_base != xmlMemBlocks()) {
42614 printf("Leak of %d blocks found in xmlUCSIsTelugu",
42615 xmlMemBlocks() - mem_base);
42617 printf(" %d", n_code);
42629 test_xmlUCSIsThaana(void) {
42632 #if defined(LIBXML_UNICODE_ENABLED)
42635 int code; /* UCS code point */
42638 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42639 mem_base = xmlMemBlocks();
42640 code = gen_int(n_code, 0);
42642 ret_val = xmlUCSIsThaana(code);
42643 desret_int(ret_val);
42645 des_int(n_code, code, 0);
42646 xmlResetLastError();
42647 if (mem_base != xmlMemBlocks()) {
42648 printf("Leak of %d blocks found in xmlUCSIsThaana",
42649 xmlMemBlocks() - mem_base);
42651 printf(" %d", n_code);
42663 test_xmlUCSIsThai(void) {
42666 #if defined(LIBXML_UNICODE_ENABLED)
42669 int code; /* UCS code point */
42672 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42673 mem_base = xmlMemBlocks();
42674 code = gen_int(n_code, 0);
42676 ret_val = xmlUCSIsThai(code);
42677 desret_int(ret_val);
42679 des_int(n_code, code, 0);
42680 xmlResetLastError();
42681 if (mem_base != xmlMemBlocks()) {
42682 printf("Leak of %d blocks found in xmlUCSIsThai",
42683 xmlMemBlocks() - mem_base);
42685 printf(" %d", n_code);
42697 test_xmlUCSIsTibetan(void) {
42700 #if defined(LIBXML_UNICODE_ENABLED)
42703 int code; /* UCS code point */
42706 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42707 mem_base = xmlMemBlocks();
42708 code = gen_int(n_code, 0);
42710 ret_val = xmlUCSIsTibetan(code);
42711 desret_int(ret_val);
42713 des_int(n_code, code, 0);
42714 xmlResetLastError();
42715 if (mem_base != xmlMemBlocks()) {
42716 printf("Leak of %d blocks found in xmlUCSIsTibetan",
42717 xmlMemBlocks() - mem_base);
42719 printf(" %d", n_code);
42731 test_xmlUCSIsUgaritic(void) {
42734 #if defined(LIBXML_UNICODE_ENABLED)
42737 int code; /* UCS code point */
42740 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42741 mem_base = xmlMemBlocks();
42742 code = gen_int(n_code, 0);
42744 ret_val = xmlUCSIsUgaritic(code);
42745 desret_int(ret_val);
42747 des_int(n_code, code, 0);
42748 xmlResetLastError();
42749 if (mem_base != xmlMemBlocks()) {
42750 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42751 xmlMemBlocks() - mem_base);
42753 printf(" %d", n_code);
42765 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42768 #if defined(LIBXML_UNICODE_ENABLED)
42771 int code; /* UCS code point */
42774 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42775 mem_base = xmlMemBlocks();
42776 code = gen_int(n_code, 0);
42778 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42779 desret_int(ret_val);
42781 des_int(n_code, code, 0);
42782 xmlResetLastError();
42783 if (mem_base != xmlMemBlocks()) {
42784 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42785 xmlMemBlocks() - mem_base);
42787 printf(" %d", n_code);
42799 test_xmlUCSIsVariationSelectors(void) {
42802 #if defined(LIBXML_UNICODE_ENABLED)
42805 int code; /* UCS code point */
42808 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42809 mem_base = xmlMemBlocks();
42810 code = gen_int(n_code, 0);
42812 ret_val = xmlUCSIsVariationSelectors(code);
42813 desret_int(ret_val);
42815 des_int(n_code, code, 0);
42816 xmlResetLastError();
42817 if (mem_base != xmlMemBlocks()) {
42818 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42819 xmlMemBlocks() - mem_base);
42821 printf(" %d", n_code);
42833 test_xmlUCSIsVariationSelectorsSupplement(void) {
42836 #if defined(LIBXML_UNICODE_ENABLED)
42839 int code; /* UCS code point */
42842 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42843 mem_base = xmlMemBlocks();
42844 code = gen_int(n_code, 0);
42846 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42847 desret_int(ret_val);
42849 des_int(n_code, code, 0);
42850 xmlResetLastError();
42851 if (mem_base != xmlMemBlocks()) {
42852 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42853 xmlMemBlocks() - mem_base);
42855 printf(" %d", n_code);
42867 test_xmlUCSIsYiRadicals(void) {
42870 #if defined(LIBXML_UNICODE_ENABLED)
42873 int code; /* UCS code point */
42876 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42877 mem_base = xmlMemBlocks();
42878 code = gen_int(n_code, 0);
42880 ret_val = xmlUCSIsYiRadicals(code);
42881 desret_int(ret_val);
42883 des_int(n_code, code, 0);
42884 xmlResetLastError();
42885 if (mem_base != xmlMemBlocks()) {
42886 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42887 xmlMemBlocks() - mem_base);
42889 printf(" %d", n_code);
42901 test_xmlUCSIsYiSyllables(void) {
42904 #if defined(LIBXML_UNICODE_ENABLED)
42907 int code; /* UCS code point */
42910 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42911 mem_base = xmlMemBlocks();
42912 code = gen_int(n_code, 0);
42914 ret_val = xmlUCSIsYiSyllables(code);
42915 desret_int(ret_val);
42917 des_int(n_code, code, 0);
42918 xmlResetLastError();
42919 if (mem_base != xmlMemBlocks()) {
42920 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42921 xmlMemBlocks() - mem_base);
42923 printf(" %d", n_code);
42935 test_xmlUCSIsYijingHexagramSymbols(void) {
42938 #if defined(LIBXML_UNICODE_ENABLED)
42941 int code; /* UCS code point */
42944 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42945 mem_base = xmlMemBlocks();
42946 code = gen_int(n_code, 0);
42948 ret_val = xmlUCSIsYijingHexagramSymbols(code);
42949 desret_int(ret_val);
42951 des_int(n_code, code, 0);
42952 xmlResetLastError();
42953 if (mem_base != xmlMemBlocks()) {
42954 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42955 xmlMemBlocks() - mem_base);
42957 printf(" %d", n_code);
42968 test_xmlunicode(void) {
42971 if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42972 test_ret += test_xmlUCSIsAegeanNumbers();
42973 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42974 test_ret += test_xmlUCSIsArabic();
42975 test_ret += test_xmlUCSIsArabicPresentationFormsA();
42976 test_ret += test_xmlUCSIsArabicPresentationFormsB();
42977 test_ret += test_xmlUCSIsArmenian();
42978 test_ret += test_xmlUCSIsArrows();
42979 test_ret += test_xmlUCSIsBasicLatin();
42980 test_ret += test_xmlUCSIsBengali();
42981 test_ret += test_xmlUCSIsBlock();
42982 test_ret += test_xmlUCSIsBlockElements();
42983 test_ret += test_xmlUCSIsBopomofo();
42984 test_ret += test_xmlUCSIsBopomofoExtended();
42985 test_ret += test_xmlUCSIsBoxDrawing();
42986 test_ret += test_xmlUCSIsBraillePatterns();
42987 test_ret += test_xmlUCSIsBuhid();
42988 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42989 test_ret += test_xmlUCSIsCJKCompatibility();
42990 test_ret += test_xmlUCSIsCJKCompatibilityForms();
42991 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42992 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42993 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42994 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42995 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42996 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42997 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42998 test_ret += test_xmlUCSIsCat();
42999 test_ret += test_xmlUCSIsCatC();
43000 test_ret += test_xmlUCSIsCatCc();
43001 test_ret += test_xmlUCSIsCatCf();
43002 test_ret += test_xmlUCSIsCatCo();
43003 test_ret += test_xmlUCSIsCatCs();
43004 test_ret += test_xmlUCSIsCatL();
43005 test_ret += test_xmlUCSIsCatLl();
43006 test_ret += test_xmlUCSIsCatLm();
43007 test_ret += test_xmlUCSIsCatLo();
43008 test_ret += test_xmlUCSIsCatLt();
43009 test_ret += test_xmlUCSIsCatLu();
43010 test_ret += test_xmlUCSIsCatM();
43011 test_ret += test_xmlUCSIsCatMc();
43012 test_ret += test_xmlUCSIsCatMe();
43013 test_ret += test_xmlUCSIsCatMn();
43014 test_ret += test_xmlUCSIsCatN();
43015 test_ret += test_xmlUCSIsCatNd();
43016 test_ret += test_xmlUCSIsCatNl();
43017 test_ret += test_xmlUCSIsCatNo();
43018 test_ret += test_xmlUCSIsCatP();
43019 test_ret += test_xmlUCSIsCatPc();
43020 test_ret += test_xmlUCSIsCatPd();
43021 test_ret += test_xmlUCSIsCatPe();
43022 test_ret += test_xmlUCSIsCatPf();
43023 test_ret += test_xmlUCSIsCatPi();
43024 test_ret += test_xmlUCSIsCatPo();
43025 test_ret += test_xmlUCSIsCatPs();
43026 test_ret += test_xmlUCSIsCatS();
43027 test_ret += test_xmlUCSIsCatSc();
43028 test_ret += test_xmlUCSIsCatSk();
43029 test_ret += test_xmlUCSIsCatSm();
43030 test_ret += test_xmlUCSIsCatSo();
43031 test_ret += test_xmlUCSIsCatZ();
43032 test_ret += test_xmlUCSIsCatZl();
43033 test_ret += test_xmlUCSIsCatZp();
43034 test_ret += test_xmlUCSIsCatZs();
43035 test_ret += test_xmlUCSIsCherokee();
43036 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43037 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43038 test_ret += test_xmlUCSIsCombiningHalfMarks();
43039 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43040 test_ret += test_xmlUCSIsControlPictures();
43041 test_ret += test_xmlUCSIsCurrencySymbols();
43042 test_ret += test_xmlUCSIsCypriotSyllabary();
43043 test_ret += test_xmlUCSIsCyrillic();
43044 test_ret += test_xmlUCSIsCyrillicSupplement();
43045 test_ret += test_xmlUCSIsDeseret();
43046 test_ret += test_xmlUCSIsDevanagari();
43047 test_ret += test_xmlUCSIsDingbats();
43048 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43049 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43050 test_ret += test_xmlUCSIsEthiopic();
43051 test_ret += test_xmlUCSIsGeneralPunctuation();
43052 test_ret += test_xmlUCSIsGeometricShapes();
43053 test_ret += test_xmlUCSIsGeorgian();
43054 test_ret += test_xmlUCSIsGothic();
43055 test_ret += test_xmlUCSIsGreek();
43056 test_ret += test_xmlUCSIsGreekExtended();
43057 test_ret += test_xmlUCSIsGreekandCoptic();
43058 test_ret += test_xmlUCSIsGujarati();
43059 test_ret += test_xmlUCSIsGurmukhi();
43060 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43061 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43062 test_ret += test_xmlUCSIsHangulJamo();
43063 test_ret += test_xmlUCSIsHangulSyllables();
43064 test_ret += test_xmlUCSIsHanunoo();
43065 test_ret += test_xmlUCSIsHebrew();
43066 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43067 test_ret += test_xmlUCSIsHighSurrogates();
43068 test_ret += test_xmlUCSIsHiragana();
43069 test_ret += test_xmlUCSIsIPAExtensions();
43070 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43071 test_ret += test_xmlUCSIsKanbun();
43072 test_ret += test_xmlUCSIsKangxiRadicals();
43073 test_ret += test_xmlUCSIsKannada();
43074 test_ret += test_xmlUCSIsKatakana();
43075 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43076 test_ret += test_xmlUCSIsKhmer();
43077 test_ret += test_xmlUCSIsKhmerSymbols();
43078 test_ret += test_xmlUCSIsLao();
43079 test_ret += test_xmlUCSIsLatin1Supplement();
43080 test_ret += test_xmlUCSIsLatinExtendedA();
43081 test_ret += test_xmlUCSIsLatinExtendedAdditional();
43082 test_ret += test_xmlUCSIsLatinExtendedB();
43083 test_ret += test_xmlUCSIsLetterlikeSymbols();
43084 test_ret += test_xmlUCSIsLimbu();
43085 test_ret += test_xmlUCSIsLinearBIdeograms();
43086 test_ret += test_xmlUCSIsLinearBSyllabary();
43087 test_ret += test_xmlUCSIsLowSurrogates();
43088 test_ret += test_xmlUCSIsMalayalam();
43089 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43090 test_ret += test_xmlUCSIsMathematicalOperators();
43091 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43092 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43093 test_ret += test_xmlUCSIsMiscellaneousSymbols();
43094 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43095 test_ret += test_xmlUCSIsMiscellaneousTechnical();
43096 test_ret += test_xmlUCSIsMongolian();
43097 test_ret += test_xmlUCSIsMusicalSymbols();
43098 test_ret += test_xmlUCSIsMyanmar();
43099 test_ret += test_xmlUCSIsNumberForms();
43100 test_ret += test_xmlUCSIsOgham();
43101 test_ret += test_xmlUCSIsOldItalic();
43102 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43103 test_ret += test_xmlUCSIsOriya();
43104 test_ret += test_xmlUCSIsOsmanya();
43105 test_ret += test_xmlUCSIsPhoneticExtensions();
43106 test_ret += test_xmlUCSIsPrivateUse();
43107 test_ret += test_xmlUCSIsPrivateUseArea();
43108 test_ret += test_xmlUCSIsRunic();
43109 test_ret += test_xmlUCSIsShavian();
43110 test_ret += test_xmlUCSIsSinhala();
43111 test_ret += test_xmlUCSIsSmallFormVariants();
43112 test_ret += test_xmlUCSIsSpacingModifierLetters();
43113 test_ret += test_xmlUCSIsSpecials();
43114 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43115 test_ret += test_xmlUCSIsSupplementalArrowsA();
43116 test_ret += test_xmlUCSIsSupplementalArrowsB();
43117 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43118 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43119 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43120 test_ret += test_xmlUCSIsSyriac();
43121 test_ret += test_xmlUCSIsTagalog();
43122 test_ret += test_xmlUCSIsTagbanwa();
43123 test_ret += test_xmlUCSIsTags();
43124 test_ret += test_xmlUCSIsTaiLe();
43125 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43126 test_ret += test_xmlUCSIsTamil();
43127 test_ret += test_xmlUCSIsTelugu();
43128 test_ret += test_xmlUCSIsThaana();
43129 test_ret += test_xmlUCSIsThai();
43130 test_ret += test_xmlUCSIsTibetan();
43131 test_ret += test_xmlUCSIsUgaritic();
43132 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43133 test_ret += test_xmlUCSIsVariationSelectors();
43134 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43135 test_ret += test_xmlUCSIsYiRadicals();
43136 test_ret += test_xmlUCSIsYiSyllables();
43137 test_ret += test_xmlUCSIsYijingHexagramSymbols();
43140 printf("Module xmlunicode: %d errors\n", test_ret);
43145 test_xmlNewTextWriter(void) {
43148 #if defined(LIBXML_WRITER_ENABLED)
43150 xmlTextWriterPtr ret_val;
43151 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43154 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43155 mem_base = xmlMemBlocks();
43156 out = gen_xmlOutputBufferPtr(n_out, 0);
43158 ret_val = xmlNewTextWriter(out);
43159 if (ret_val != NULL) out = NULL;
43160 desret_xmlTextWriterPtr(ret_val);
43162 des_xmlOutputBufferPtr(n_out, out, 0);
43163 xmlResetLastError();
43164 if (mem_base != xmlMemBlocks()) {
43165 printf("Leak of %d blocks found in xmlNewTextWriter",
43166 xmlMemBlocks() - mem_base);
43168 printf(" %d", n_out);
43180 test_xmlNewTextWriterFilename(void) {
43183 #if defined(LIBXML_WRITER_ENABLED)
43185 xmlTextWriterPtr ret_val;
43186 const char * uri; /* the URI of the resource for the output */
43188 int compression; /* compress the output? */
43191 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43192 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43193 mem_base = xmlMemBlocks();
43194 uri = gen_fileoutput(n_uri, 0);
43195 compression = gen_int(n_compression, 1);
43197 ret_val = xmlNewTextWriterFilename(uri, compression);
43198 desret_xmlTextWriterPtr(ret_val);
43200 des_fileoutput(n_uri, uri, 0);
43201 des_int(n_compression, compression, 1);
43202 xmlResetLastError();
43203 if (mem_base != xmlMemBlocks()) {
43204 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43205 xmlMemBlocks() - mem_base);
43207 printf(" %d", n_uri);
43208 printf(" %d", n_compression);
43221 test_xmlNewTextWriterMemory(void) {
43224 #if defined(LIBXML_WRITER_ENABLED)
43226 xmlTextWriterPtr ret_val;
43227 xmlBufferPtr buf; /* xmlBufferPtr */
43229 int compression; /* compress the output? */
43232 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43233 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43234 mem_base = xmlMemBlocks();
43235 buf = gen_xmlBufferPtr(n_buf, 0);
43236 compression = gen_int(n_compression, 1);
43238 ret_val = xmlNewTextWriterMemory(buf, compression);
43239 desret_xmlTextWriterPtr(ret_val);
43241 des_xmlBufferPtr(n_buf, buf, 0);
43242 des_int(n_compression, compression, 1);
43243 xmlResetLastError();
43244 if (mem_base != xmlMemBlocks()) {
43245 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43246 xmlMemBlocks() - mem_base);
43248 printf(" %d", n_buf);
43249 printf(" %d", n_compression);
43262 test_xmlNewTextWriterPushParser(void) {
43265 #if defined(LIBXML_WRITER_ENABLED)
43267 xmlTextWriterPtr ret_val;
43268 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43270 int compression; /* compress the output? */
43273 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43274 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43275 mem_base = xmlMemBlocks();
43276 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43277 compression = gen_int(n_compression, 1);
43279 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43280 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43281 desret_xmlTextWriterPtr(ret_val);
43283 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43284 des_int(n_compression, compression, 1);
43285 xmlResetLastError();
43286 if (mem_base != xmlMemBlocks()) {
43287 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43288 xmlMemBlocks() - mem_base);
43290 printf(" %d", n_ctxt);
43291 printf(" %d", n_compression);
43304 test_xmlNewTextWriterTree(void) {
43307 #if defined(LIBXML_WRITER_ENABLED)
43309 xmlTextWriterPtr ret_val;
43310 xmlDocPtr doc; /* xmlDocPtr */
43312 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43314 int compression; /* compress the output? */
43317 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43318 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43319 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43320 mem_base = xmlMemBlocks();
43321 doc = gen_xmlDocPtr(n_doc, 0);
43322 node = gen_xmlNodePtr(n_node, 1);
43323 compression = gen_int(n_compression, 2);
43325 ret_val = xmlNewTextWriterTree(doc, node, compression);
43326 desret_xmlTextWriterPtr(ret_val);
43328 des_xmlDocPtr(n_doc, doc, 0);
43329 des_xmlNodePtr(n_node, node, 1);
43330 des_int(n_compression, compression, 2);
43331 xmlResetLastError();
43332 if (mem_base != xmlMemBlocks()) {
43333 printf("Leak of %d blocks found in xmlNewTextWriterTree",
43334 xmlMemBlocks() - mem_base);
43336 printf(" %d", n_doc);
43337 printf(" %d", n_node);
43338 printf(" %d", n_compression);
43352 test_xmlTextWriterEndAttribute(void) {
43355 #if defined(LIBXML_WRITER_ENABLED)
43358 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43361 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43362 mem_base = xmlMemBlocks();
43363 writer = gen_xmlTextWriterPtr(n_writer, 0);
43365 ret_val = xmlTextWriterEndAttribute(writer);
43366 desret_int(ret_val);
43368 des_xmlTextWriterPtr(n_writer, writer, 0);
43369 xmlResetLastError();
43370 if (mem_base != xmlMemBlocks()) {
43371 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43372 xmlMemBlocks() - mem_base);
43374 printf(" %d", n_writer);
43386 test_xmlTextWriterEndCDATA(void) {
43389 #if defined(LIBXML_WRITER_ENABLED)
43392 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43395 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43396 mem_base = xmlMemBlocks();
43397 writer = gen_xmlTextWriterPtr(n_writer, 0);
43399 ret_val = xmlTextWriterEndCDATA(writer);
43400 desret_int(ret_val);
43402 des_xmlTextWriterPtr(n_writer, writer, 0);
43403 xmlResetLastError();
43404 if (mem_base != xmlMemBlocks()) {
43405 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43406 xmlMemBlocks() - mem_base);
43408 printf(" %d", n_writer);
43420 test_xmlTextWriterEndComment(void) {
43423 #if defined(LIBXML_WRITER_ENABLED)
43426 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43429 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43430 mem_base = xmlMemBlocks();
43431 writer = gen_xmlTextWriterPtr(n_writer, 0);
43433 ret_val = xmlTextWriterEndComment(writer);
43434 desret_int(ret_val);
43436 des_xmlTextWriterPtr(n_writer, writer, 0);
43437 xmlResetLastError();
43438 if (mem_base != xmlMemBlocks()) {
43439 printf("Leak of %d blocks found in xmlTextWriterEndComment",
43440 xmlMemBlocks() - mem_base);
43442 printf(" %d", n_writer);
43454 test_xmlTextWriterEndDTD(void) {
43457 #if defined(LIBXML_WRITER_ENABLED)
43460 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43463 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43464 mem_base = xmlMemBlocks();
43465 writer = gen_xmlTextWriterPtr(n_writer, 0);
43467 ret_val = xmlTextWriterEndDTD(writer);
43468 desret_int(ret_val);
43470 des_xmlTextWriterPtr(n_writer, writer, 0);
43471 xmlResetLastError();
43472 if (mem_base != xmlMemBlocks()) {
43473 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43474 xmlMemBlocks() - mem_base);
43476 printf(" %d", n_writer);
43488 test_xmlTextWriterEndDTDAttlist(void) {
43491 #if defined(LIBXML_WRITER_ENABLED)
43494 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43497 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43498 mem_base = xmlMemBlocks();
43499 writer = gen_xmlTextWriterPtr(n_writer, 0);
43501 ret_val = xmlTextWriterEndDTDAttlist(writer);
43502 desret_int(ret_val);
43504 des_xmlTextWriterPtr(n_writer, writer, 0);
43505 xmlResetLastError();
43506 if (mem_base != xmlMemBlocks()) {
43507 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43508 xmlMemBlocks() - mem_base);
43510 printf(" %d", n_writer);
43522 test_xmlTextWriterEndDTDElement(void) {
43525 #if defined(LIBXML_WRITER_ENABLED)
43528 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43531 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43532 mem_base = xmlMemBlocks();
43533 writer = gen_xmlTextWriterPtr(n_writer, 0);
43535 ret_val = xmlTextWriterEndDTDElement(writer);
43536 desret_int(ret_val);
43538 des_xmlTextWriterPtr(n_writer, writer, 0);
43539 xmlResetLastError();
43540 if (mem_base != xmlMemBlocks()) {
43541 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43542 xmlMemBlocks() - mem_base);
43544 printf(" %d", n_writer);
43556 test_xmlTextWriterEndDTDEntity(void) {
43559 #if defined(LIBXML_WRITER_ENABLED)
43562 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43565 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43566 mem_base = xmlMemBlocks();
43567 writer = gen_xmlTextWriterPtr(n_writer, 0);
43569 ret_val = xmlTextWriterEndDTDEntity(writer);
43570 desret_int(ret_val);
43572 des_xmlTextWriterPtr(n_writer, writer, 0);
43573 xmlResetLastError();
43574 if (mem_base != xmlMemBlocks()) {
43575 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43576 xmlMemBlocks() - mem_base);
43578 printf(" %d", n_writer);
43590 test_xmlTextWriterEndDocument(void) {
43593 #if defined(LIBXML_WRITER_ENABLED)
43596 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43599 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43600 mem_base = xmlMemBlocks();
43601 writer = gen_xmlTextWriterPtr(n_writer, 0);
43603 ret_val = xmlTextWriterEndDocument(writer);
43604 desret_int(ret_val);
43606 des_xmlTextWriterPtr(n_writer, writer, 0);
43607 xmlResetLastError();
43608 if (mem_base != xmlMemBlocks()) {
43609 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43610 xmlMemBlocks() - mem_base);
43612 printf(" %d", n_writer);
43624 test_xmlTextWriterEndElement(void) {
43627 #if defined(LIBXML_WRITER_ENABLED)
43630 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43633 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43634 mem_base = xmlMemBlocks();
43635 writer = gen_xmlTextWriterPtr(n_writer, 0);
43637 ret_val = xmlTextWriterEndElement(writer);
43638 desret_int(ret_val);
43640 des_xmlTextWriterPtr(n_writer, writer, 0);
43641 xmlResetLastError();
43642 if (mem_base != xmlMemBlocks()) {
43643 printf("Leak of %d blocks found in xmlTextWriterEndElement",
43644 xmlMemBlocks() - mem_base);
43646 printf(" %d", n_writer);
43658 test_xmlTextWriterEndPI(void) {
43661 #if defined(LIBXML_WRITER_ENABLED)
43664 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43667 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43668 mem_base = xmlMemBlocks();
43669 writer = gen_xmlTextWriterPtr(n_writer, 0);
43671 ret_val = xmlTextWriterEndPI(writer);
43672 desret_int(ret_val);
43674 des_xmlTextWriterPtr(n_writer, writer, 0);
43675 xmlResetLastError();
43676 if (mem_base != xmlMemBlocks()) {
43677 printf("Leak of %d blocks found in xmlTextWriterEndPI",
43678 xmlMemBlocks() - mem_base);
43680 printf(" %d", n_writer);
43692 test_xmlTextWriterFlush(void) {
43695 #if defined(LIBXML_WRITER_ENABLED)
43698 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43701 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43702 mem_base = xmlMemBlocks();
43703 writer = gen_xmlTextWriterPtr(n_writer, 0);
43705 ret_val = xmlTextWriterFlush(writer);
43706 desret_int(ret_val);
43708 des_xmlTextWriterPtr(n_writer, writer, 0);
43709 xmlResetLastError();
43710 if (mem_base != xmlMemBlocks()) {
43711 printf("Leak of %d blocks found in xmlTextWriterFlush",
43712 xmlMemBlocks() - mem_base);
43714 printf(" %d", n_writer);
43726 test_xmlTextWriterFullEndElement(void) {
43729 #if defined(LIBXML_WRITER_ENABLED)
43732 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43735 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43736 mem_base = xmlMemBlocks();
43737 writer = gen_xmlTextWriterPtr(n_writer, 0);
43739 ret_val = xmlTextWriterFullEndElement(writer);
43740 desret_int(ret_val);
43742 des_xmlTextWriterPtr(n_writer, writer, 0);
43743 xmlResetLastError();
43744 if (mem_base != xmlMemBlocks()) {
43745 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43746 xmlMemBlocks() - mem_base);
43748 printf(" %d", n_writer);
43760 test_xmlTextWriterSetIndent(void) {
43763 #if defined(LIBXML_WRITER_ENABLED)
43766 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43768 int indent; /* do indentation? */
43771 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43772 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43773 mem_base = xmlMemBlocks();
43774 writer = gen_xmlTextWriterPtr(n_writer, 0);
43775 indent = gen_int(n_indent, 1);
43777 ret_val = xmlTextWriterSetIndent(writer, indent);
43778 desret_int(ret_val);
43780 des_xmlTextWriterPtr(n_writer, writer, 0);
43781 des_int(n_indent, indent, 1);
43782 xmlResetLastError();
43783 if (mem_base != xmlMemBlocks()) {
43784 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43785 xmlMemBlocks() - mem_base);
43787 printf(" %d", n_writer);
43788 printf(" %d", n_indent);
43801 test_xmlTextWriterSetIndentString(void) {
43804 #if defined(LIBXML_WRITER_ENABLED)
43807 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43809 xmlChar * str; /* the xmlChar string */
43812 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43813 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43814 mem_base = xmlMemBlocks();
43815 writer = gen_xmlTextWriterPtr(n_writer, 0);
43816 str = gen_const_xmlChar_ptr(n_str, 1);
43818 ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43819 desret_int(ret_val);
43821 des_xmlTextWriterPtr(n_writer, writer, 0);
43822 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43823 xmlResetLastError();
43824 if (mem_base != xmlMemBlocks()) {
43825 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43826 xmlMemBlocks() - mem_base);
43828 printf(" %d", n_writer);
43829 printf(" %d", n_str);
43842 test_xmlTextWriterSetQuoteChar(void) {
43845 #if defined(LIBXML_WRITER_ENABLED)
43848 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43850 xmlChar quotechar; /* the quote character */
43853 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43854 for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
43855 mem_base = xmlMemBlocks();
43856 writer = gen_xmlTextWriterPtr(n_writer, 0);
43857 quotechar = gen_xmlChar(n_quotechar, 1);
43859 ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
43860 desret_int(ret_val);
43862 des_xmlTextWriterPtr(n_writer, writer, 0);
43863 des_xmlChar(n_quotechar, quotechar, 1);
43864 xmlResetLastError();
43865 if (mem_base != xmlMemBlocks()) {
43866 printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
43867 xmlMemBlocks() - mem_base);
43869 printf(" %d", n_writer);
43870 printf(" %d", n_quotechar);
43883 test_xmlTextWriterStartAttribute(void) {
43886 #if defined(LIBXML_WRITER_ENABLED)
43889 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43891 xmlChar * name; /* element name */
43894 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43895 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43896 mem_base = xmlMemBlocks();
43897 writer = gen_xmlTextWriterPtr(n_writer, 0);
43898 name = gen_const_xmlChar_ptr(n_name, 1);
43900 ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43901 desret_int(ret_val);
43903 des_xmlTextWriterPtr(n_writer, writer, 0);
43904 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43905 xmlResetLastError();
43906 if (mem_base != xmlMemBlocks()) {
43907 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43908 xmlMemBlocks() - mem_base);
43910 printf(" %d", n_writer);
43911 printf(" %d", n_name);
43924 test_xmlTextWriterStartAttributeNS(void) {
43927 #if defined(LIBXML_WRITER_ENABLED)
43930 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43932 xmlChar * prefix; /* namespace prefix or NULL */
43934 xmlChar * name; /* element local name */
43936 xmlChar * namespaceURI; /* namespace URI or NULL */
43937 int n_namespaceURI;
43939 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43940 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43941 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43942 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43943 mem_base = xmlMemBlocks();
43944 writer = gen_xmlTextWriterPtr(n_writer, 0);
43945 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43946 name = gen_const_xmlChar_ptr(n_name, 2);
43947 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43949 ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43950 desret_int(ret_val);
43952 des_xmlTextWriterPtr(n_writer, writer, 0);
43953 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43954 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43955 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43956 xmlResetLastError();
43957 if (mem_base != xmlMemBlocks()) {
43958 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43959 xmlMemBlocks() - mem_base);
43961 printf(" %d", n_writer);
43962 printf(" %d", n_prefix);
43963 printf(" %d", n_name);
43964 printf(" %d", n_namespaceURI);
43979 test_xmlTextWriterStartCDATA(void) {
43982 #if defined(LIBXML_WRITER_ENABLED)
43985 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43988 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43989 mem_base = xmlMemBlocks();
43990 writer = gen_xmlTextWriterPtr(n_writer, 0);
43992 ret_val = xmlTextWriterStartCDATA(writer);
43993 desret_int(ret_val);
43995 des_xmlTextWriterPtr(n_writer, writer, 0);
43996 xmlResetLastError();
43997 if (mem_base != xmlMemBlocks()) {
43998 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43999 xmlMemBlocks() - mem_base);
44001 printf(" %d", n_writer);
44013 test_xmlTextWriterStartComment(void) {
44016 #if defined(LIBXML_WRITER_ENABLED)
44019 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44022 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44023 mem_base = xmlMemBlocks();
44024 writer = gen_xmlTextWriterPtr(n_writer, 0);
44026 ret_val = xmlTextWriterStartComment(writer);
44027 desret_int(ret_val);
44029 des_xmlTextWriterPtr(n_writer, writer, 0);
44030 xmlResetLastError();
44031 if (mem_base != xmlMemBlocks()) {
44032 printf("Leak of %d blocks found in xmlTextWriterStartComment",
44033 xmlMemBlocks() - mem_base);
44035 printf(" %d", n_writer);
44047 test_xmlTextWriterStartDTD(void) {
44050 #if defined(LIBXML_WRITER_ENABLED)
44053 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44055 xmlChar * name; /* the name of the DTD */
44057 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44059 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44062 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44063 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44064 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44065 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44066 mem_base = xmlMemBlocks();
44067 writer = gen_xmlTextWriterPtr(n_writer, 0);
44068 name = gen_const_xmlChar_ptr(n_name, 1);
44069 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44070 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44072 ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44073 desret_int(ret_val);
44075 des_xmlTextWriterPtr(n_writer, writer, 0);
44076 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44077 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44078 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44079 xmlResetLastError();
44080 if (mem_base != xmlMemBlocks()) {
44081 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44082 xmlMemBlocks() - mem_base);
44084 printf(" %d", n_writer);
44085 printf(" %d", n_name);
44086 printf(" %d", n_pubid);
44087 printf(" %d", n_sysid);
44102 test_xmlTextWriterStartDTDAttlist(void) {
44105 #if defined(LIBXML_WRITER_ENABLED)
44108 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44110 xmlChar * name; /* the name of the DTD ATTLIST */
44113 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44114 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44115 mem_base = xmlMemBlocks();
44116 writer = gen_xmlTextWriterPtr(n_writer, 0);
44117 name = gen_const_xmlChar_ptr(n_name, 1);
44119 ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44120 desret_int(ret_val);
44122 des_xmlTextWriterPtr(n_writer, writer, 0);
44123 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44124 xmlResetLastError();
44125 if (mem_base != xmlMemBlocks()) {
44126 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44127 xmlMemBlocks() - mem_base);
44129 printf(" %d", n_writer);
44130 printf(" %d", n_name);
44143 test_xmlTextWriterStartDTDElement(void) {
44146 #if defined(LIBXML_WRITER_ENABLED)
44149 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44151 xmlChar * name; /* the name of the DTD element */
44154 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44155 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44156 mem_base = xmlMemBlocks();
44157 writer = gen_xmlTextWriterPtr(n_writer, 0);
44158 name = gen_const_xmlChar_ptr(n_name, 1);
44160 ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44161 desret_int(ret_val);
44163 des_xmlTextWriterPtr(n_writer, writer, 0);
44164 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44165 xmlResetLastError();
44166 if (mem_base != xmlMemBlocks()) {
44167 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44168 xmlMemBlocks() - mem_base);
44170 printf(" %d", n_writer);
44171 printf(" %d", n_name);
44184 test_xmlTextWriterStartDTDEntity(void) {
44187 #if defined(LIBXML_WRITER_ENABLED)
44190 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44192 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44194 xmlChar * name; /* the name of the DTD ATTLIST */
44197 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44198 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44199 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44200 mem_base = xmlMemBlocks();
44201 writer = gen_xmlTextWriterPtr(n_writer, 0);
44202 pe = gen_int(n_pe, 1);
44203 name = gen_const_xmlChar_ptr(n_name, 2);
44205 ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44206 desret_int(ret_val);
44208 des_xmlTextWriterPtr(n_writer, writer, 0);
44209 des_int(n_pe, pe, 1);
44210 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44211 xmlResetLastError();
44212 if (mem_base != xmlMemBlocks()) {
44213 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44214 xmlMemBlocks() - mem_base);
44216 printf(" %d", n_writer);
44217 printf(" %d", n_pe);
44218 printf(" %d", n_name);
44232 test_xmlTextWriterStartDocument(void) {
44235 #if defined(LIBXML_WRITER_ENABLED)
44238 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44240 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44242 char * encoding; /* the encoding or NULL for default */
44244 char * standalone; /* "yes" or "no" or NULL for default */
44247 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44248 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44249 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44250 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44251 mem_base = xmlMemBlocks();
44252 writer = gen_xmlTextWriterPtr(n_writer, 0);
44253 version = gen_const_char_ptr(n_version, 1);
44254 encoding = gen_const_char_ptr(n_encoding, 2);
44255 standalone = gen_const_char_ptr(n_standalone, 3);
44257 ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44258 desret_int(ret_val);
44260 des_xmlTextWriterPtr(n_writer, writer, 0);
44261 des_const_char_ptr(n_version, (const char *)version, 1);
44262 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44263 des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44264 xmlResetLastError();
44265 if (mem_base != xmlMemBlocks()) {
44266 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44267 xmlMemBlocks() - mem_base);
44269 printf(" %d", n_writer);
44270 printf(" %d", n_version);
44271 printf(" %d", n_encoding);
44272 printf(" %d", n_standalone);
44287 test_xmlTextWriterStartElement(void) {
44290 #if defined(LIBXML_WRITER_ENABLED)
44293 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44295 xmlChar * name; /* element name */
44298 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44299 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44300 mem_base = xmlMemBlocks();
44301 writer = gen_xmlTextWriterPtr(n_writer, 0);
44302 name = gen_const_xmlChar_ptr(n_name, 1);
44304 ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44305 desret_int(ret_val);
44307 des_xmlTextWriterPtr(n_writer, writer, 0);
44308 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44309 xmlResetLastError();
44310 if (mem_base != xmlMemBlocks()) {
44311 printf("Leak of %d blocks found in xmlTextWriterStartElement",
44312 xmlMemBlocks() - mem_base);
44314 printf(" %d", n_writer);
44315 printf(" %d", n_name);
44328 test_xmlTextWriterStartElementNS(void) {
44331 #if defined(LIBXML_WRITER_ENABLED)
44334 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44336 xmlChar * prefix; /* namespace prefix or NULL */
44338 xmlChar * name; /* element local name */
44340 xmlChar * namespaceURI; /* namespace URI or NULL */
44341 int n_namespaceURI;
44343 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44344 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44345 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44346 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44347 mem_base = xmlMemBlocks();
44348 writer = gen_xmlTextWriterPtr(n_writer, 0);
44349 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44350 name = gen_const_xmlChar_ptr(n_name, 2);
44351 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44353 ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44354 desret_int(ret_val);
44356 des_xmlTextWriterPtr(n_writer, writer, 0);
44357 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44358 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44359 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44360 xmlResetLastError();
44361 if (mem_base != xmlMemBlocks()) {
44362 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44363 xmlMemBlocks() - mem_base);
44365 printf(" %d", n_writer);
44366 printf(" %d", n_prefix);
44367 printf(" %d", n_name);
44368 printf(" %d", n_namespaceURI);
44383 test_xmlTextWriterStartPI(void) {
44386 #if defined(LIBXML_WRITER_ENABLED)
44389 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44391 xmlChar * target; /* PI target */
44394 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44395 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44396 mem_base = xmlMemBlocks();
44397 writer = gen_xmlTextWriterPtr(n_writer, 0);
44398 target = gen_const_xmlChar_ptr(n_target, 1);
44400 ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44401 desret_int(ret_val);
44403 des_xmlTextWriterPtr(n_writer, writer, 0);
44404 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44405 xmlResetLastError();
44406 if (mem_base != xmlMemBlocks()) {
44407 printf("Leak of %d blocks found in xmlTextWriterStartPI",
44408 xmlMemBlocks() - mem_base);
44410 printf(" %d", n_writer);
44411 printf(" %d", n_target);
44424 test_xmlTextWriterWriteAttribute(void) {
44427 #if defined(LIBXML_WRITER_ENABLED)
44430 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44432 xmlChar * name; /* attribute name */
44434 xmlChar * content; /* attribute content */
44437 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44438 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44439 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44440 mem_base = xmlMemBlocks();
44441 writer = gen_xmlTextWriterPtr(n_writer, 0);
44442 name = gen_const_xmlChar_ptr(n_name, 1);
44443 content = gen_const_xmlChar_ptr(n_content, 2);
44445 ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44446 desret_int(ret_val);
44448 des_xmlTextWriterPtr(n_writer, writer, 0);
44449 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44450 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44451 xmlResetLastError();
44452 if (mem_base != xmlMemBlocks()) {
44453 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44454 xmlMemBlocks() - mem_base);
44456 printf(" %d", n_writer);
44457 printf(" %d", n_name);
44458 printf(" %d", n_content);
44472 test_xmlTextWriterWriteAttributeNS(void) {
44475 #if defined(LIBXML_WRITER_ENABLED)
44478 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44480 xmlChar * prefix; /* namespace prefix */
44482 xmlChar * name; /* attribute local name */
44484 xmlChar * namespaceURI; /* namespace URI */
44485 int n_namespaceURI;
44486 xmlChar * content; /* attribute content */
44489 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44490 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44491 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44492 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44493 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44494 mem_base = xmlMemBlocks();
44495 writer = gen_xmlTextWriterPtr(n_writer, 0);
44496 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44497 name = gen_const_xmlChar_ptr(n_name, 2);
44498 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44499 content = gen_const_xmlChar_ptr(n_content, 4);
44501 ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44502 desret_int(ret_val);
44504 des_xmlTextWriterPtr(n_writer, writer, 0);
44505 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44506 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44507 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44508 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44509 xmlResetLastError();
44510 if (mem_base != xmlMemBlocks()) {
44511 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44512 xmlMemBlocks() - mem_base);
44514 printf(" %d", n_writer);
44515 printf(" %d", n_prefix);
44516 printf(" %d", n_name);
44517 printf(" %d", n_namespaceURI);
44518 printf(" %d", n_content);
44534 test_xmlTextWriterWriteBase64(void) {
44537 #if defined(LIBXML_WRITER_ENABLED)
44540 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44542 char * data; /* binary data */
44544 int start; /* the position within the data of the first byte to encode */
44546 int len; /* the number of bytes to encode */
44549 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44550 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44551 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44552 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44553 mem_base = xmlMemBlocks();
44554 writer = gen_xmlTextWriterPtr(n_writer, 0);
44555 data = gen_const_char_ptr(n_data, 1);
44556 start = gen_int(n_start, 2);
44557 len = gen_int(n_len, 3);
44559 ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44560 desret_int(ret_val);
44562 des_xmlTextWriterPtr(n_writer, writer, 0);
44563 des_const_char_ptr(n_data, (const char *)data, 1);
44564 des_int(n_start, start, 2);
44565 des_int(n_len, len, 3);
44566 xmlResetLastError();
44567 if (mem_base != xmlMemBlocks()) {
44568 printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44569 xmlMemBlocks() - mem_base);
44571 printf(" %d", n_writer);
44572 printf(" %d", n_data);
44573 printf(" %d", n_start);
44574 printf(" %d", n_len);
44589 test_xmlTextWriterWriteBinHex(void) {
44592 #if defined(LIBXML_WRITER_ENABLED)
44595 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44597 char * data; /* binary data */
44599 int start; /* the position within the data of the first byte to encode */
44601 int len; /* the number of bytes to encode */
44604 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44605 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44606 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44607 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44608 mem_base = xmlMemBlocks();
44609 writer = gen_xmlTextWriterPtr(n_writer, 0);
44610 data = gen_const_char_ptr(n_data, 1);
44611 start = gen_int(n_start, 2);
44612 len = gen_int(n_len, 3);
44614 ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44615 desret_int(ret_val);
44617 des_xmlTextWriterPtr(n_writer, writer, 0);
44618 des_const_char_ptr(n_data, (const char *)data, 1);
44619 des_int(n_start, start, 2);
44620 des_int(n_len, len, 3);
44621 xmlResetLastError();
44622 if (mem_base != xmlMemBlocks()) {
44623 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44624 xmlMemBlocks() - mem_base);
44626 printf(" %d", n_writer);
44627 printf(" %d", n_data);
44628 printf(" %d", n_start);
44629 printf(" %d", n_len);
44644 test_xmlTextWriterWriteCDATA(void) {
44647 #if defined(LIBXML_WRITER_ENABLED)
44650 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44652 xmlChar * content; /* CDATA content */
44655 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44656 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44657 mem_base = xmlMemBlocks();
44658 writer = gen_xmlTextWriterPtr(n_writer, 0);
44659 content = gen_const_xmlChar_ptr(n_content, 1);
44661 ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44662 desret_int(ret_val);
44664 des_xmlTextWriterPtr(n_writer, writer, 0);
44665 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44666 xmlResetLastError();
44667 if (mem_base != xmlMemBlocks()) {
44668 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44669 xmlMemBlocks() - mem_base);
44671 printf(" %d", n_writer);
44672 printf(" %d", n_content);
44685 test_xmlTextWriterWriteComment(void) {
44688 #if defined(LIBXML_WRITER_ENABLED)
44691 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44693 xmlChar * content; /* comment string */
44696 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44697 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44698 mem_base = xmlMemBlocks();
44699 writer = gen_xmlTextWriterPtr(n_writer, 0);
44700 content = gen_const_xmlChar_ptr(n_content, 1);
44702 ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44703 desret_int(ret_val);
44705 des_xmlTextWriterPtr(n_writer, writer, 0);
44706 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44707 xmlResetLastError();
44708 if (mem_base != xmlMemBlocks()) {
44709 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44710 xmlMemBlocks() - mem_base);
44712 printf(" %d", n_writer);
44713 printf(" %d", n_content);
44726 test_xmlTextWriterWriteDTD(void) {
44729 #if defined(LIBXML_WRITER_ENABLED)
44732 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44734 xmlChar * name; /* the name of the DTD */
44736 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44738 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44740 xmlChar * subset; /* string content of the DTD */
44743 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44744 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44745 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44746 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44747 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44748 mem_base = xmlMemBlocks();
44749 writer = gen_xmlTextWriterPtr(n_writer, 0);
44750 name = gen_const_xmlChar_ptr(n_name, 1);
44751 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44752 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44753 subset = gen_const_xmlChar_ptr(n_subset, 4);
44755 ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44756 desret_int(ret_val);
44758 des_xmlTextWriterPtr(n_writer, writer, 0);
44759 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44760 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44761 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44762 des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44763 xmlResetLastError();
44764 if (mem_base != xmlMemBlocks()) {
44765 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44766 xmlMemBlocks() - mem_base);
44768 printf(" %d", n_writer);
44769 printf(" %d", n_name);
44770 printf(" %d", n_pubid);
44771 printf(" %d", n_sysid);
44772 printf(" %d", n_subset);
44788 test_xmlTextWriterWriteDTDAttlist(void) {
44791 #if defined(LIBXML_WRITER_ENABLED)
44794 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44796 xmlChar * name; /* the name of the DTD ATTLIST */
44798 xmlChar * content; /* content of the ATTLIST */
44801 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44802 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44803 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44804 mem_base = xmlMemBlocks();
44805 writer = gen_xmlTextWriterPtr(n_writer, 0);
44806 name = gen_const_xmlChar_ptr(n_name, 1);
44807 content = gen_const_xmlChar_ptr(n_content, 2);
44809 ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44810 desret_int(ret_val);
44812 des_xmlTextWriterPtr(n_writer, writer, 0);
44813 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44814 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44815 xmlResetLastError();
44816 if (mem_base != xmlMemBlocks()) {
44817 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44818 xmlMemBlocks() - mem_base);
44820 printf(" %d", n_writer);
44821 printf(" %d", n_name);
44822 printf(" %d", n_content);
44836 test_xmlTextWriterWriteDTDElement(void) {
44839 #if defined(LIBXML_WRITER_ENABLED)
44842 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44844 xmlChar * name; /* the name of the DTD element */
44846 xmlChar * content; /* content of the element */
44849 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44850 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44851 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44852 mem_base = xmlMemBlocks();
44853 writer = gen_xmlTextWriterPtr(n_writer, 0);
44854 name = gen_const_xmlChar_ptr(n_name, 1);
44855 content = gen_const_xmlChar_ptr(n_content, 2);
44857 ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44858 desret_int(ret_val);
44860 des_xmlTextWriterPtr(n_writer, writer, 0);
44861 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44862 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44863 xmlResetLastError();
44864 if (mem_base != xmlMemBlocks()) {
44865 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44866 xmlMemBlocks() - mem_base);
44868 printf(" %d", n_writer);
44869 printf(" %d", n_name);
44870 printf(" %d", n_content);
44884 test_xmlTextWriterWriteDTDEntity(void) {
44887 #if defined(LIBXML_WRITER_ENABLED)
44890 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44892 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44894 xmlChar * name; /* the name of the DTD entity */
44896 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44898 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44900 xmlChar * ndataid; /* the xml notation name. */
44902 xmlChar * content; /* content of the entity */
44905 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44906 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44907 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44908 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44909 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44910 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44911 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44912 mem_base = xmlMemBlocks();
44913 writer = gen_xmlTextWriterPtr(n_writer, 0);
44914 pe = gen_int(n_pe, 1);
44915 name = gen_const_xmlChar_ptr(n_name, 2);
44916 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44917 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44918 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44919 content = gen_const_xmlChar_ptr(n_content, 6);
44921 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44922 desret_int(ret_val);
44924 des_xmlTextWriterPtr(n_writer, writer, 0);
44925 des_int(n_pe, pe, 1);
44926 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44927 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44928 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44929 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44930 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44931 xmlResetLastError();
44932 if (mem_base != xmlMemBlocks()) {
44933 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44934 xmlMemBlocks() - mem_base);
44936 printf(" %d", n_writer);
44937 printf(" %d", n_pe);
44938 printf(" %d", n_name);
44939 printf(" %d", n_pubid);
44940 printf(" %d", n_sysid);
44941 printf(" %d", n_ndataid);
44942 printf(" %d", n_content);
44960 test_xmlTextWriterWriteDTDExternalEntity(void) {
44963 #if defined(LIBXML_WRITER_ENABLED)
44966 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44968 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44970 xmlChar * name; /* the name of the DTD entity */
44972 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44974 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44976 xmlChar * ndataid; /* the xml notation name. */
44979 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44980 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44981 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44982 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44983 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44984 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44985 mem_base = xmlMemBlocks();
44986 writer = gen_xmlTextWriterPtr(n_writer, 0);
44987 pe = gen_int(n_pe, 1);
44988 name = gen_const_xmlChar_ptr(n_name, 2);
44989 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44990 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44991 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44993 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44994 desret_int(ret_val);
44996 des_xmlTextWriterPtr(n_writer, writer, 0);
44997 des_int(n_pe, pe, 1);
44998 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44999 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45000 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45001 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45002 xmlResetLastError();
45003 if (mem_base != xmlMemBlocks()) {
45004 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45005 xmlMemBlocks() - mem_base);
45007 printf(" %d", n_writer);
45008 printf(" %d", n_pe);
45009 printf(" %d", n_name);
45010 printf(" %d", n_pubid);
45011 printf(" %d", n_sysid);
45012 printf(" %d", n_ndataid);
45029 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45032 #if defined(LIBXML_WRITER_ENABLED)
45035 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45037 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45039 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45041 xmlChar * ndataid; /* the xml notation name. */
45044 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45045 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45046 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45047 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45048 mem_base = xmlMemBlocks();
45049 writer = gen_xmlTextWriterPtr(n_writer, 0);
45050 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45051 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45052 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45054 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45055 desret_int(ret_val);
45057 des_xmlTextWriterPtr(n_writer, writer, 0);
45058 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45059 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45060 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45061 xmlResetLastError();
45062 if (mem_base != xmlMemBlocks()) {
45063 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45064 xmlMemBlocks() - mem_base);
45066 printf(" %d", n_writer);
45067 printf(" %d", n_pubid);
45068 printf(" %d", n_sysid);
45069 printf(" %d", n_ndataid);
45084 test_xmlTextWriterWriteDTDInternalEntity(void) {
45087 #if defined(LIBXML_WRITER_ENABLED)
45090 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45092 int pe; /* TRUE if this is a parameter entity, FALSE if not */
45094 xmlChar * name; /* the name of the DTD entity */
45096 xmlChar * content; /* content of the entity */
45099 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45100 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45101 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45102 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45103 mem_base = xmlMemBlocks();
45104 writer = gen_xmlTextWriterPtr(n_writer, 0);
45105 pe = gen_int(n_pe, 1);
45106 name = gen_const_xmlChar_ptr(n_name, 2);
45107 content = gen_const_xmlChar_ptr(n_content, 3);
45109 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45110 desret_int(ret_val);
45112 des_xmlTextWriterPtr(n_writer, writer, 0);
45113 des_int(n_pe, pe, 1);
45114 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45115 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45116 xmlResetLastError();
45117 if (mem_base != xmlMemBlocks()) {
45118 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45119 xmlMemBlocks() - mem_base);
45121 printf(" %d", n_writer);
45122 printf(" %d", n_pe);
45123 printf(" %d", n_name);
45124 printf(" %d", n_content);
45139 test_xmlTextWriterWriteDTDNotation(void) {
45142 #if defined(LIBXML_WRITER_ENABLED)
45145 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45147 xmlChar * name; /* the name of the xml notation */
45149 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45151 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45154 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45155 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45156 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45157 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45158 mem_base = xmlMemBlocks();
45159 writer = gen_xmlTextWriterPtr(n_writer, 0);
45160 name = gen_const_xmlChar_ptr(n_name, 1);
45161 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45162 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45164 ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45165 desret_int(ret_val);
45167 des_xmlTextWriterPtr(n_writer, writer, 0);
45168 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45169 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45170 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45171 xmlResetLastError();
45172 if (mem_base != xmlMemBlocks()) {
45173 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45174 xmlMemBlocks() - mem_base);
45176 printf(" %d", n_writer);
45177 printf(" %d", n_name);
45178 printf(" %d", n_pubid);
45179 printf(" %d", n_sysid);
45194 test_xmlTextWriterWriteElement(void) {
45197 #if defined(LIBXML_WRITER_ENABLED)
45200 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45202 xmlChar * name; /* element name */
45204 xmlChar * content; /* element content */
45207 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45208 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45209 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45210 mem_base = xmlMemBlocks();
45211 writer = gen_xmlTextWriterPtr(n_writer, 0);
45212 name = gen_const_xmlChar_ptr(n_name, 1);
45213 content = gen_const_xmlChar_ptr(n_content, 2);
45215 ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45216 desret_int(ret_val);
45218 des_xmlTextWriterPtr(n_writer, writer, 0);
45219 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45220 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45221 xmlResetLastError();
45222 if (mem_base != xmlMemBlocks()) {
45223 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45224 xmlMemBlocks() - mem_base);
45226 printf(" %d", n_writer);
45227 printf(" %d", n_name);
45228 printf(" %d", n_content);
45242 test_xmlTextWriterWriteElementNS(void) {
45245 #if defined(LIBXML_WRITER_ENABLED)
45248 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45250 xmlChar * prefix; /* namespace prefix */
45252 xmlChar * name; /* element local name */
45254 xmlChar * namespaceURI; /* namespace URI */
45255 int n_namespaceURI;
45256 xmlChar * content; /* element content */
45259 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45260 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45261 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45262 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45263 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45264 mem_base = xmlMemBlocks();
45265 writer = gen_xmlTextWriterPtr(n_writer, 0);
45266 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45267 name = gen_const_xmlChar_ptr(n_name, 2);
45268 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45269 content = gen_const_xmlChar_ptr(n_content, 4);
45271 ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45272 desret_int(ret_val);
45274 des_xmlTextWriterPtr(n_writer, writer, 0);
45275 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45276 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45277 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45278 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45279 xmlResetLastError();
45280 if (mem_base != xmlMemBlocks()) {
45281 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45282 xmlMemBlocks() - mem_base);
45284 printf(" %d", n_writer);
45285 printf(" %d", n_prefix);
45286 printf(" %d", n_name);
45287 printf(" %d", n_namespaceURI);
45288 printf(" %d", n_content);
45304 test_xmlTextWriterWriteFormatAttribute(void) {
45308 /* missing type support */
45314 test_xmlTextWriterWriteFormatAttributeNS(void) {
45318 /* missing type support */
45324 test_xmlTextWriterWriteFormatCDATA(void) {
45328 /* missing type support */
45334 test_xmlTextWriterWriteFormatComment(void) {
45338 /* missing type support */
45344 test_xmlTextWriterWriteFormatDTD(void) {
45348 /* missing type support */
45354 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45358 /* missing type support */
45364 test_xmlTextWriterWriteFormatDTDElement(void) {
45368 /* missing type support */
45374 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45378 /* missing type support */
45384 test_xmlTextWriterWriteFormatElement(void) {
45388 /* missing type support */
45394 test_xmlTextWriterWriteFormatElementNS(void) {
45398 /* missing type support */
45404 test_xmlTextWriterWriteFormatPI(void) {
45408 /* missing type support */
45414 test_xmlTextWriterWriteFormatRaw(void) {
45418 /* missing type support */
45424 test_xmlTextWriterWriteFormatString(void) {
45428 /* missing type support */
45434 test_xmlTextWriterWritePI(void) {
45437 #if defined(LIBXML_WRITER_ENABLED)
45440 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45442 xmlChar * target; /* PI target */
45444 xmlChar * content; /* PI content */
45447 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45448 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45449 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45450 mem_base = xmlMemBlocks();
45451 writer = gen_xmlTextWriterPtr(n_writer, 0);
45452 target = gen_const_xmlChar_ptr(n_target, 1);
45453 content = gen_const_xmlChar_ptr(n_content, 2);
45455 ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45456 desret_int(ret_val);
45458 des_xmlTextWriterPtr(n_writer, writer, 0);
45459 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45460 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45461 xmlResetLastError();
45462 if (mem_base != xmlMemBlocks()) {
45463 printf("Leak of %d blocks found in xmlTextWriterWritePI",
45464 xmlMemBlocks() - mem_base);
45466 printf(" %d", n_writer);
45467 printf(" %d", n_target);
45468 printf(" %d", n_content);
45482 test_xmlTextWriterWriteRaw(void) {
45485 #if defined(LIBXML_WRITER_ENABLED)
45488 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45490 xmlChar * content; /* text string */
45493 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45494 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45495 mem_base = xmlMemBlocks();
45496 writer = gen_xmlTextWriterPtr(n_writer, 0);
45497 content = gen_const_xmlChar_ptr(n_content, 1);
45499 ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45500 desret_int(ret_val);
45502 des_xmlTextWriterPtr(n_writer, writer, 0);
45503 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45504 xmlResetLastError();
45505 if (mem_base != xmlMemBlocks()) {
45506 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45507 xmlMemBlocks() - mem_base);
45509 printf(" %d", n_writer);
45510 printf(" %d", n_content);
45523 test_xmlTextWriterWriteRawLen(void) {
45526 #if defined(LIBXML_WRITER_ENABLED)
45529 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45531 xmlChar * content; /* text string */
45533 int len; /* length of the text string */
45536 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45537 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45538 for (n_len = 0;n_len < gen_nb_int;n_len++) {
45539 mem_base = xmlMemBlocks();
45540 writer = gen_xmlTextWriterPtr(n_writer, 0);
45541 content = gen_const_xmlChar_ptr(n_content, 1);
45542 len = gen_int(n_len, 2);
45544 ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45545 desret_int(ret_val);
45547 des_xmlTextWriterPtr(n_writer, writer, 0);
45548 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45549 des_int(n_len, len, 2);
45550 xmlResetLastError();
45551 if (mem_base != xmlMemBlocks()) {
45552 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45553 xmlMemBlocks() - mem_base);
45555 printf(" %d", n_writer);
45556 printf(" %d", n_content);
45557 printf(" %d", n_len);
45571 test_xmlTextWriterWriteString(void) {
45574 #if defined(LIBXML_WRITER_ENABLED)
45577 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45579 xmlChar * content; /* text string */
45582 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45583 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45584 mem_base = xmlMemBlocks();
45585 writer = gen_xmlTextWriterPtr(n_writer, 0);
45586 content = gen_const_xmlChar_ptr(n_content, 1);
45588 ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45589 desret_int(ret_val);
45591 des_xmlTextWriterPtr(n_writer, writer, 0);
45592 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45593 xmlResetLastError();
45594 if (mem_base != xmlMemBlocks()) {
45595 printf("Leak of %d blocks found in xmlTextWriterWriteString",
45596 xmlMemBlocks() - mem_base);
45598 printf(" %d", n_writer);
45599 printf(" %d", n_content);
45612 test_xmlTextWriterWriteVFormatAttribute(void) {
45616 /* missing type support */
45622 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45626 /* missing type support */
45632 test_xmlTextWriterWriteVFormatCDATA(void) {
45636 /* missing type support */
45642 test_xmlTextWriterWriteVFormatComment(void) {
45646 /* missing type support */
45652 test_xmlTextWriterWriteVFormatDTD(void) {
45656 /* missing type support */
45662 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45666 /* missing type support */
45672 test_xmlTextWriterWriteVFormatDTDElement(void) {
45676 /* missing type support */
45682 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45686 /* missing type support */
45692 test_xmlTextWriterWriteVFormatElement(void) {
45696 /* missing type support */
45702 test_xmlTextWriterWriteVFormatElementNS(void) {
45706 /* missing type support */
45712 test_xmlTextWriterWriteVFormatPI(void) {
45716 /* missing type support */
45722 test_xmlTextWriterWriteVFormatRaw(void) {
45726 /* missing type support */
45732 test_xmlTextWriterWriteVFormatString(void) {
45736 /* missing type support */
45741 test_xmlwriter(void) {
45744 if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45745 test_ret += test_xmlNewTextWriter();
45746 test_ret += test_xmlNewTextWriterFilename();
45747 test_ret += test_xmlNewTextWriterMemory();
45748 test_ret += test_xmlNewTextWriterPushParser();
45749 test_ret += test_xmlNewTextWriterTree();
45750 test_ret += test_xmlTextWriterEndAttribute();
45751 test_ret += test_xmlTextWriterEndCDATA();
45752 test_ret += test_xmlTextWriterEndComment();
45753 test_ret += test_xmlTextWriterEndDTD();
45754 test_ret += test_xmlTextWriterEndDTDAttlist();
45755 test_ret += test_xmlTextWriterEndDTDElement();
45756 test_ret += test_xmlTextWriterEndDTDEntity();
45757 test_ret += test_xmlTextWriterEndDocument();
45758 test_ret += test_xmlTextWriterEndElement();
45759 test_ret += test_xmlTextWriterEndPI();
45760 test_ret += test_xmlTextWriterFlush();
45761 test_ret += test_xmlTextWriterFullEndElement();
45762 test_ret += test_xmlTextWriterSetIndent();
45763 test_ret += test_xmlTextWriterSetIndentString();
45764 test_ret += test_xmlTextWriterSetQuoteChar();
45765 test_ret += test_xmlTextWriterStartAttribute();
45766 test_ret += test_xmlTextWriterStartAttributeNS();
45767 test_ret += test_xmlTextWriterStartCDATA();
45768 test_ret += test_xmlTextWriterStartComment();
45769 test_ret += test_xmlTextWriterStartDTD();
45770 test_ret += test_xmlTextWriterStartDTDAttlist();
45771 test_ret += test_xmlTextWriterStartDTDElement();
45772 test_ret += test_xmlTextWriterStartDTDEntity();
45773 test_ret += test_xmlTextWriterStartDocument();
45774 test_ret += test_xmlTextWriterStartElement();
45775 test_ret += test_xmlTextWriterStartElementNS();
45776 test_ret += test_xmlTextWriterStartPI();
45777 test_ret += test_xmlTextWriterWriteAttribute();
45778 test_ret += test_xmlTextWriterWriteAttributeNS();
45779 test_ret += test_xmlTextWriterWriteBase64();
45780 test_ret += test_xmlTextWriterWriteBinHex();
45781 test_ret += test_xmlTextWriterWriteCDATA();
45782 test_ret += test_xmlTextWriterWriteComment();
45783 test_ret += test_xmlTextWriterWriteDTD();
45784 test_ret += test_xmlTextWriterWriteDTDAttlist();
45785 test_ret += test_xmlTextWriterWriteDTDElement();
45786 test_ret += test_xmlTextWriterWriteDTDEntity();
45787 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45788 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45789 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45790 test_ret += test_xmlTextWriterWriteDTDNotation();
45791 test_ret += test_xmlTextWriterWriteElement();
45792 test_ret += test_xmlTextWriterWriteElementNS();
45793 test_ret += test_xmlTextWriterWriteFormatAttribute();
45794 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45795 test_ret += test_xmlTextWriterWriteFormatCDATA();
45796 test_ret += test_xmlTextWriterWriteFormatComment();
45797 test_ret += test_xmlTextWriterWriteFormatDTD();
45798 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45799 test_ret += test_xmlTextWriterWriteFormatDTDElement();
45800 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45801 test_ret += test_xmlTextWriterWriteFormatElement();
45802 test_ret += test_xmlTextWriterWriteFormatElementNS();
45803 test_ret += test_xmlTextWriterWriteFormatPI();
45804 test_ret += test_xmlTextWriterWriteFormatRaw();
45805 test_ret += test_xmlTextWriterWriteFormatString();
45806 test_ret += test_xmlTextWriterWritePI();
45807 test_ret += test_xmlTextWriterWriteRaw();
45808 test_ret += test_xmlTextWriterWriteRawLen();
45809 test_ret += test_xmlTextWriterWriteString();
45810 test_ret += test_xmlTextWriterWriteVFormatAttribute();
45811 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45812 test_ret += test_xmlTextWriterWriteVFormatCDATA();
45813 test_ret += test_xmlTextWriterWriteVFormatComment();
45814 test_ret += test_xmlTextWriterWriteVFormatDTD();
45815 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45816 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45817 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45818 test_ret += test_xmlTextWriterWriteVFormatElement();
45819 test_ret += test_xmlTextWriterWriteVFormatElementNS();
45820 test_ret += test_xmlTextWriterWriteVFormatPI();
45821 test_ret += test_xmlTextWriterWriteVFormatRaw();
45822 test_ret += test_xmlTextWriterWriteVFormatString();
45825 printf("Module xmlwriter: %d errors\n", test_ret);
45830 test_xmlXPathCastBooleanToNumber(void) {
45833 #if defined(LIBXML_XPATH_ENABLED)
45836 int val; /* a boolean */
45839 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45840 mem_base = xmlMemBlocks();
45841 val = gen_int(n_val, 0);
45843 ret_val = xmlXPathCastBooleanToNumber(val);
45844 desret_double(ret_val);
45846 des_int(n_val, val, 0);
45847 xmlResetLastError();
45848 if (mem_base != xmlMemBlocks()) {
45849 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45850 xmlMemBlocks() - mem_base);
45852 printf(" %d", n_val);
45864 test_xmlXPathCastBooleanToString(void) {
45867 #if defined(LIBXML_XPATH_ENABLED)
45870 int val; /* a boolean */
45873 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45874 mem_base = xmlMemBlocks();
45875 val = gen_int(n_val, 0);
45877 ret_val = xmlXPathCastBooleanToString(val);
45878 desret_xmlChar_ptr(ret_val);
45880 des_int(n_val, val, 0);
45881 xmlResetLastError();
45882 if (mem_base != xmlMemBlocks()) {
45883 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45884 xmlMemBlocks() - mem_base);
45886 printf(" %d", n_val);
45898 test_xmlXPathCastNodeSetToBoolean(void) {
45901 #if defined(LIBXML_XPATH_ENABLED)
45904 xmlNodeSetPtr ns; /* a node-set */
45907 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45908 mem_base = xmlMemBlocks();
45909 ns = gen_xmlNodeSetPtr(n_ns, 0);
45911 ret_val = xmlXPathCastNodeSetToBoolean(ns);
45912 desret_int(ret_val);
45914 des_xmlNodeSetPtr(n_ns, ns, 0);
45915 xmlResetLastError();
45916 if (mem_base != xmlMemBlocks()) {
45917 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45918 xmlMemBlocks() - mem_base);
45920 printf(" %d", n_ns);
45932 test_xmlXPathCastNodeSetToNumber(void) {
45935 #if defined(LIBXML_XPATH_ENABLED)
45938 xmlNodeSetPtr ns; /* a node-set */
45941 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45942 mem_base = xmlMemBlocks();
45943 ns = gen_xmlNodeSetPtr(n_ns, 0);
45945 ret_val = xmlXPathCastNodeSetToNumber(ns);
45946 desret_double(ret_val);
45948 des_xmlNodeSetPtr(n_ns, ns, 0);
45949 xmlResetLastError();
45950 if (mem_base != xmlMemBlocks()) {
45951 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45952 xmlMemBlocks() - mem_base);
45954 printf(" %d", n_ns);
45966 test_xmlXPathCastNodeSetToString(void) {
45969 #if defined(LIBXML_XPATH_ENABLED)
45972 xmlNodeSetPtr ns; /* a node-set */
45975 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45976 mem_base = xmlMemBlocks();
45977 ns = gen_xmlNodeSetPtr(n_ns, 0);
45979 ret_val = xmlXPathCastNodeSetToString(ns);
45980 desret_xmlChar_ptr(ret_val);
45982 des_xmlNodeSetPtr(n_ns, ns, 0);
45983 xmlResetLastError();
45984 if (mem_base != xmlMemBlocks()) {
45985 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45986 xmlMemBlocks() - mem_base);
45988 printf(" %d", n_ns);
46000 test_xmlXPathCastNodeToNumber(void) {
46003 #if defined(LIBXML_XPATH_ENABLED)
46006 xmlNodePtr node; /* a node */
46009 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46010 mem_base = xmlMemBlocks();
46011 node = gen_xmlNodePtr(n_node, 0);
46013 ret_val = xmlXPathCastNodeToNumber(node);
46014 desret_double(ret_val);
46016 des_xmlNodePtr(n_node, node, 0);
46017 xmlResetLastError();
46018 if (mem_base != xmlMemBlocks()) {
46019 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46020 xmlMemBlocks() - mem_base);
46022 printf(" %d", n_node);
46034 test_xmlXPathCastNodeToString(void) {
46037 #if defined(LIBXML_XPATH_ENABLED)
46040 xmlNodePtr node; /* a node */
46043 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46044 mem_base = xmlMemBlocks();
46045 node = gen_xmlNodePtr(n_node, 0);
46047 ret_val = xmlXPathCastNodeToString(node);
46048 desret_xmlChar_ptr(ret_val);
46050 des_xmlNodePtr(n_node, node, 0);
46051 xmlResetLastError();
46052 if (mem_base != xmlMemBlocks()) {
46053 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46054 xmlMemBlocks() - mem_base);
46056 printf(" %d", n_node);
46068 test_xmlXPathCastNumberToBoolean(void) {
46071 #if defined(LIBXML_XPATH_ENABLED)
46074 double val; /* a number */
46077 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46078 mem_base = xmlMemBlocks();
46079 val = gen_double(n_val, 0);
46081 ret_val = xmlXPathCastNumberToBoolean(val);
46082 desret_int(ret_val);
46084 des_double(n_val, val, 0);
46085 xmlResetLastError();
46086 if (mem_base != xmlMemBlocks()) {
46087 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46088 xmlMemBlocks() - mem_base);
46090 printf(" %d", n_val);
46102 test_xmlXPathCastNumberToString(void) {
46105 #if defined(LIBXML_XPATH_ENABLED)
46108 double val; /* a number */
46111 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46112 mem_base = xmlMemBlocks();
46113 val = gen_double(n_val, 0);
46115 ret_val = xmlXPathCastNumberToString(val);
46116 desret_xmlChar_ptr(ret_val);
46118 des_double(n_val, val, 0);
46119 xmlResetLastError();
46120 if (mem_base != xmlMemBlocks()) {
46121 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46122 xmlMemBlocks() - mem_base);
46124 printf(" %d", n_val);
46136 test_xmlXPathCastStringToBoolean(void) {
46139 #if defined(LIBXML_XPATH_ENABLED)
46142 xmlChar * val; /* a string */
46145 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46146 mem_base = xmlMemBlocks();
46147 val = gen_const_xmlChar_ptr(n_val, 0);
46149 ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46150 desret_int(ret_val);
46152 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46153 xmlResetLastError();
46154 if (mem_base != xmlMemBlocks()) {
46155 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46156 xmlMemBlocks() - mem_base);
46158 printf(" %d", n_val);
46170 test_xmlXPathCastStringToNumber(void) {
46173 #if defined(LIBXML_XPATH_ENABLED)
46176 xmlChar * val; /* a string */
46179 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46180 mem_base = xmlMemBlocks();
46181 val = gen_const_xmlChar_ptr(n_val, 0);
46183 ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46184 desret_double(ret_val);
46186 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46187 xmlResetLastError();
46188 if (mem_base != xmlMemBlocks()) {
46189 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46190 xmlMemBlocks() - mem_base);
46192 printf(" %d", n_val);
46204 test_xmlXPathCastToBoolean(void) {
46207 #if defined(LIBXML_XPATH_ENABLED)
46210 xmlXPathObjectPtr val; /* an XPath object */
46213 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46214 mem_base = xmlMemBlocks();
46215 val = gen_xmlXPathObjectPtr(n_val, 0);
46217 ret_val = xmlXPathCastToBoolean(val);
46218 desret_int(ret_val);
46220 des_xmlXPathObjectPtr(n_val, val, 0);
46221 xmlResetLastError();
46222 if (mem_base != xmlMemBlocks()) {
46223 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46224 xmlMemBlocks() - mem_base);
46226 printf(" %d", n_val);
46238 test_xmlXPathCastToNumber(void) {
46241 #if defined(LIBXML_XPATH_ENABLED)
46244 xmlXPathObjectPtr val; /* an XPath object */
46247 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46248 mem_base = xmlMemBlocks();
46249 val = gen_xmlXPathObjectPtr(n_val, 0);
46251 ret_val = xmlXPathCastToNumber(val);
46252 desret_double(ret_val);
46254 des_xmlXPathObjectPtr(n_val, val, 0);
46255 xmlResetLastError();
46256 if (mem_base != xmlMemBlocks()) {
46257 printf("Leak of %d blocks found in xmlXPathCastToNumber",
46258 xmlMemBlocks() - mem_base);
46260 printf(" %d", n_val);
46272 test_xmlXPathCastToString(void) {
46275 #if defined(LIBXML_XPATH_ENABLED)
46278 xmlXPathObjectPtr val; /* an XPath object */
46281 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46282 mem_base = xmlMemBlocks();
46283 val = gen_xmlXPathObjectPtr(n_val, 0);
46285 ret_val = xmlXPathCastToString(val);
46286 desret_xmlChar_ptr(ret_val);
46288 des_xmlXPathObjectPtr(n_val, val, 0);
46289 xmlResetLastError();
46290 if (mem_base != xmlMemBlocks()) {
46291 printf("Leak of %d blocks found in xmlXPathCastToString",
46292 xmlMemBlocks() - mem_base);
46294 printf(" %d", n_val);
46306 test_xmlXPathCmpNodes(void) {
46309 #if defined(LIBXML_XPATH_ENABLED)
46312 xmlNodePtr node1; /* the first node */
46314 xmlNodePtr node2; /* the second node */
46317 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46318 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46319 mem_base = xmlMemBlocks();
46320 node1 = gen_xmlNodePtr(n_node1, 0);
46321 node2 = gen_xmlNodePtr(n_node2, 1);
46323 ret_val = xmlXPathCmpNodes(node1, node2);
46324 desret_int(ret_val);
46326 des_xmlNodePtr(n_node1, node1, 0);
46327 des_xmlNodePtr(n_node2, node2, 1);
46328 xmlResetLastError();
46329 if (mem_base != xmlMemBlocks()) {
46330 printf("Leak of %d blocks found in xmlXPathCmpNodes",
46331 xmlMemBlocks() - mem_base);
46333 printf(" %d", n_node1);
46334 printf(" %d", n_node2);
46347 test_xmlXPathCompile(void) {
46351 /* missing type support */
46355 #ifdef LIBXML_XPATH_ENABLED
46357 #define gen_nb_xmlXPathCompExprPtr 1
46358 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46361 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46365 #ifdef LIBXML_XPATH_ENABLED
46367 #define gen_nb_xmlXPathContextPtr 1
46368 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46371 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46377 test_xmlXPathCompiledEval(void) {
46380 #if defined(LIBXML_XPATH_ENABLED)
46382 xmlXPathObjectPtr ret_val;
46383 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46385 xmlXPathContextPtr ctx; /* the XPath context */
46388 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46389 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46390 mem_base = xmlMemBlocks();
46391 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46392 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46394 ret_val = xmlXPathCompiledEval(comp, ctx);
46395 desret_xmlXPathObjectPtr(ret_val);
46397 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46398 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46399 xmlResetLastError();
46400 if (mem_base != xmlMemBlocks()) {
46401 printf("Leak of %d blocks found in xmlXPathCompiledEval",
46402 xmlMemBlocks() - mem_base);
46404 printf(" %d", n_comp);
46405 printf(" %d", n_ctx);
46418 test_xmlXPathCompiledEvalToBoolean(void) {
46421 #if defined(LIBXML_XPATH_ENABLED)
46424 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46426 xmlXPathContextPtr ctxt; /* the XPath context */
46429 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46430 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46431 mem_base = xmlMemBlocks();
46432 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46433 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46435 ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46436 desret_int(ret_val);
46438 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46439 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46440 xmlResetLastError();
46441 if (mem_base != xmlMemBlocks()) {
46442 printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46443 xmlMemBlocks() - mem_base);
46445 printf(" %d", n_comp);
46446 printf(" %d", n_ctxt);
46459 test_xmlXPathContextSetCache(void) {
46462 #if defined(LIBXML_XPATH_ENABLED)
46465 xmlXPathContextPtr ctxt; /* the XPath context */
46467 int active; /* enables/disables (creates/frees) the cache */
46469 int value; /* a value with semantics dependant on @options */
46471 int options; /* options (currently only the value 0 is used) */
46474 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46475 for (n_active = 0;n_active < gen_nb_int;n_active++) {
46476 for (n_value = 0;n_value < gen_nb_int;n_value++) {
46477 for (n_options = 0;n_options < gen_nb_int;n_options++) {
46478 mem_base = xmlMemBlocks();
46479 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46480 active = gen_int(n_active, 1);
46481 value = gen_int(n_value, 2);
46482 options = gen_int(n_options, 3);
46484 ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46485 desret_int(ret_val);
46487 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46488 des_int(n_active, active, 1);
46489 des_int(n_value, value, 2);
46490 des_int(n_options, options, 3);
46491 xmlResetLastError();
46492 if (mem_base != xmlMemBlocks()) {
46493 printf("Leak of %d blocks found in xmlXPathContextSetCache",
46494 xmlMemBlocks() - mem_base);
46496 printf(" %d", n_ctxt);
46497 printf(" %d", n_active);
46498 printf(" %d", n_value);
46499 printf(" %d", n_options);
46514 test_xmlXPathConvertBoolean(void) {
46517 #if defined(LIBXML_XPATH_ENABLED)
46519 xmlXPathObjectPtr ret_val;
46520 xmlXPathObjectPtr val; /* an XPath object */
46523 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46524 mem_base = xmlMemBlocks();
46525 val = gen_xmlXPathObjectPtr(n_val, 0);
46527 ret_val = xmlXPathConvertBoolean(val);
46529 desret_xmlXPathObjectPtr(ret_val);
46531 des_xmlXPathObjectPtr(n_val, val, 0);
46532 xmlResetLastError();
46533 if (mem_base != xmlMemBlocks()) {
46534 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46535 xmlMemBlocks() - mem_base);
46537 printf(" %d", n_val);
46549 test_xmlXPathConvertNumber(void) {
46552 #if defined(LIBXML_XPATH_ENABLED)
46554 xmlXPathObjectPtr ret_val;
46555 xmlXPathObjectPtr val; /* an XPath object */
46558 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46559 mem_base = xmlMemBlocks();
46560 val = gen_xmlXPathObjectPtr(n_val, 0);
46562 ret_val = xmlXPathConvertNumber(val);
46564 desret_xmlXPathObjectPtr(ret_val);
46566 des_xmlXPathObjectPtr(n_val, val, 0);
46567 xmlResetLastError();
46568 if (mem_base != xmlMemBlocks()) {
46569 printf("Leak of %d blocks found in xmlXPathConvertNumber",
46570 xmlMemBlocks() - mem_base);
46572 printf(" %d", n_val);
46584 test_xmlXPathConvertString(void) {
46587 #if defined(LIBXML_XPATH_ENABLED)
46589 xmlXPathObjectPtr ret_val;
46590 xmlXPathObjectPtr val; /* an XPath object */
46593 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46594 mem_base = xmlMemBlocks();
46595 val = gen_xmlXPathObjectPtr(n_val, 0);
46597 ret_val = xmlXPathConvertString(val);
46599 desret_xmlXPathObjectPtr(ret_val);
46601 des_xmlXPathObjectPtr(n_val, val, 0);
46602 xmlResetLastError();
46603 if (mem_base != xmlMemBlocks()) {
46604 printf("Leak of %d blocks found in xmlXPathConvertString",
46605 xmlMemBlocks() - mem_base);
46607 printf(" %d", n_val);
46619 test_xmlXPathCtxtCompile(void) {
46623 /* missing type support */
46629 test_xmlXPathEval(void) {
46632 #if defined(LIBXML_XPATH_ENABLED)
46634 xmlXPathObjectPtr ret_val;
46635 xmlChar * str; /* the XPath expression */
46637 xmlXPathContextPtr ctx; /* the XPath context */
46640 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46641 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46642 mem_base = xmlMemBlocks();
46643 str = gen_const_xmlChar_ptr(n_str, 0);
46644 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46646 ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46647 desret_xmlXPathObjectPtr(ret_val);
46649 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46650 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46651 xmlResetLastError();
46652 if (mem_base != xmlMemBlocks()) {
46653 printf("Leak of %d blocks found in xmlXPathEval",
46654 xmlMemBlocks() - mem_base);
46656 printf(" %d", n_str);
46657 printf(" %d", n_ctx);
46670 test_xmlXPathEvalExpression(void) {
46673 #if defined(LIBXML_XPATH_ENABLED)
46675 xmlXPathObjectPtr ret_val;
46676 xmlChar * str; /* the XPath expression */
46678 xmlXPathContextPtr ctxt; /* the XPath context */
46681 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46682 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46683 mem_base = xmlMemBlocks();
46684 str = gen_const_xmlChar_ptr(n_str, 0);
46685 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46687 ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46688 desret_xmlXPathObjectPtr(ret_val);
46690 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46691 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46692 xmlResetLastError();
46693 if (mem_base != xmlMemBlocks()) {
46694 printf("Leak of %d blocks found in xmlXPathEvalExpression",
46695 xmlMemBlocks() - mem_base);
46697 printf(" %d", n_str);
46698 printf(" %d", n_ctxt);
46711 test_xmlXPathEvalPredicate(void) {
46714 #if defined(LIBXML_XPATH_ENABLED)
46717 xmlXPathContextPtr ctxt; /* the XPath context */
46719 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46722 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46723 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46724 mem_base = xmlMemBlocks();
46725 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46726 res = gen_xmlXPathObjectPtr(n_res, 1);
46728 ret_val = xmlXPathEvalPredicate(ctxt, res);
46729 desret_int(ret_val);
46731 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46732 des_xmlXPathObjectPtr(n_res, res, 1);
46733 xmlResetLastError();
46734 if (mem_base != xmlMemBlocks()) {
46735 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46736 xmlMemBlocks() - mem_base);
46738 printf(" %d", n_ctxt);
46739 printf(" %d", n_res);
46752 test_xmlXPathInit(void) {
46755 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46758 mem_base = xmlMemBlocks();
46762 xmlResetLastError();
46763 if (mem_base != xmlMemBlocks()) {
46764 printf("Leak of %d blocks found in xmlXPathInit",
46765 xmlMemBlocks() - mem_base);
46777 test_xmlXPathIsInf(void) {
46780 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46783 double val; /* a double value */
46786 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46787 mem_base = xmlMemBlocks();
46788 val = gen_double(n_val, 0);
46790 ret_val = xmlXPathIsInf(val);
46791 desret_int(ret_val);
46793 des_double(n_val, val, 0);
46794 xmlResetLastError();
46795 if (mem_base != xmlMemBlocks()) {
46796 printf("Leak of %d blocks found in xmlXPathIsInf",
46797 xmlMemBlocks() - mem_base);
46799 printf(" %d", n_val);
46811 test_xmlXPathIsNaN(void) {
46814 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46817 double val; /* a double value */
46820 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46821 mem_base = xmlMemBlocks();
46822 val = gen_double(n_val, 0);
46824 ret_val = xmlXPathIsNaN(val);
46825 desret_int(ret_val);
46827 des_double(n_val, val, 0);
46828 xmlResetLastError();
46829 if (mem_base != xmlMemBlocks()) {
46830 printf("Leak of %d blocks found in xmlXPathIsNaN",
46831 xmlMemBlocks() - mem_base);
46833 printf(" %d", n_val);
46845 test_xmlXPathNewContext(void) {
46849 /* missing type support */
46855 test_xmlXPathNodeEval(void) {
46858 #if defined(LIBXML_XPATH_ENABLED)
46860 xmlXPathObjectPtr ret_val;
46861 xmlNodePtr node; /* the node to to use as the context node */
46863 xmlChar * str; /* the XPath expression */
46865 xmlXPathContextPtr ctx; /* the XPath context */
46868 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46869 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46870 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46871 mem_base = xmlMemBlocks();
46872 node = gen_xmlNodePtr(n_node, 0);
46873 str = gen_const_xmlChar_ptr(n_str, 1);
46874 ctx = gen_xmlXPathContextPtr(n_ctx, 2);
46876 ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
46877 desret_xmlXPathObjectPtr(ret_val);
46879 des_xmlNodePtr(n_node, node, 0);
46880 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
46881 des_xmlXPathContextPtr(n_ctx, ctx, 2);
46882 xmlResetLastError();
46883 if (mem_base != xmlMemBlocks()) {
46884 printf("Leak of %d blocks found in xmlXPathNodeEval",
46885 xmlMemBlocks() - mem_base);
46887 printf(" %d", n_node);
46888 printf(" %d", n_str);
46889 printf(" %d", n_ctx);
46903 test_xmlXPathNodeSetCreate(void) {
46906 #if defined(LIBXML_XPATH_ENABLED)
46908 xmlNodeSetPtr ret_val;
46909 xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46912 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46913 mem_base = xmlMemBlocks();
46914 val = gen_xmlNodePtr(n_val, 0);
46916 ret_val = xmlXPathNodeSetCreate(val);
46917 desret_xmlNodeSetPtr(ret_val);
46919 des_xmlNodePtr(n_val, val, 0);
46920 xmlResetLastError();
46921 if (mem_base != xmlMemBlocks()) {
46922 printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46923 xmlMemBlocks() - mem_base);
46925 printf(" %d", n_val);
46937 test_xmlXPathObjectCopy(void) {
46940 #if defined(LIBXML_XPATH_ENABLED)
46942 xmlXPathObjectPtr ret_val;
46943 xmlXPathObjectPtr val; /* the original object */
46946 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46947 mem_base = xmlMemBlocks();
46948 val = gen_xmlXPathObjectPtr(n_val, 0);
46950 ret_val = xmlXPathObjectCopy(val);
46951 desret_xmlXPathObjectPtr(ret_val);
46953 des_xmlXPathObjectPtr(n_val, val, 0);
46954 xmlResetLastError();
46955 if (mem_base != xmlMemBlocks()) {
46956 printf("Leak of %d blocks found in xmlXPathObjectCopy",
46957 xmlMemBlocks() - mem_base);
46959 printf(" %d", n_val);
46971 test_xmlXPathOrderDocElems(void) {
46974 #if defined(LIBXML_XPATH_ENABLED)
46977 xmlDocPtr doc; /* an input document */
46980 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46981 mem_base = xmlMemBlocks();
46982 doc = gen_xmlDocPtr(n_doc, 0);
46984 ret_val = xmlXPathOrderDocElems(doc);
46985 desret_long(ret_val);
46987 des_xmlDocPtr(n_doc, doc, 0);
46988 xmlResetLastError();
46989 if (mem_base != xmlMemBlocks()) {
46990 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46991 xmlMemBlocks() - mem_base);
46993 printf(" %d", n_doc);
47005 test_xmlXPathSetContextNode(void) {
47008 #if defined(LIBXML_XPATH_ENABLED)
47011 xmlNodePtr node; /* the node to to use as the context node */
47013 xmlXPathContextPtr ctx; /* the XPath context */
47016 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47017 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47018 mem_base = xmlMemBlocks();
47019 node = gen_xmlNodePtr(n_node, 0);
47020 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47022 ret_val = xmlXPathSetContextNode(node, ctx);
47023 desret_int(ret_val);
47025 des_xmlNodePtr(n_node, node, 0);
47026 des_xmlXPathContextPtr(n_ctx, ctx, 1);
47027 xmlResetLastError();
47028 if (mem_base != xmlMemBlocks()) {
47029 printf("Leak of %d blocks found in xmlXPathSetContextNode",
47030 xmlMemBlocks() - mem_base);
47032 printf(" %d", n_node);
47033 printf(" %d", n_ctx);
47048 if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47049 test_ret += test_xmlXPathCastBooleanToNumber();
47050 test_ret += test_xmlXPathCastBooleanToString();
47051 test_ret += test_xmlXPathCastNodeSetToBoolean();
47052 test_ret += test_xmlXPathCastNodeSetToNumber();
47053 test_ret += test_xmlXPathCastNodeSetToString();
47054 test_ret += test_xmlXPathCastNodeToNumber();
47055 test_ret += test_xmlXPathCastNodeToString();
47056 test_ret += test_xmlXPathCastNumberToBoolean();
47057 test_ret += test_xmlXPathCastNumberToString();
47058 test_ret += test_xmlXPathCastStringToBoolean();
47059 test_ret += test_xmlXPathCastStringToNumber();
47060 test_ret += test_xmlXPathCastToBoolean();
47061 test_ret += test_xmlXPathCastToNumber();
47062 test_ret += test_xmlXPathCastToString();
47063 test_ret += test_xmlXPathCmpNodes();
47064 test_ret += test_xmlXPathCompile();
47065 test_ret += test_xmlXPathCompiledEval();
47066 test_ret += test_xmlXPathCompiledEvalToBoolean();
47067 test_ret += test_xmlXPathContextSetCache();
47068 test_ret += test_xmlXPathConvertBoolean();
47069 test_ret += test_xmlXPathConvertNumber();
47070 test_ret += test_xmlXPathConvertString();
47071 test_ret += test_xmlXPathCtxtCompile();
47072 test_ret += test_xmlXPathEval();
47073 test_ret += test_xmlXPathEvalExpression();
47074 test_ret += test_xmlXPathEvalPredicate();
47075 test_ret += test_xmlXPathInit();
47076 test_ret += test_xmlXPathIsInf();
47077 test_ret += test_xmlXPathIsNaN();
47078 test_ret += test_xmlXPathNewContext();
47079 test_ret += test_xmlXPathNodeEval();
47080 test_ret += test_xmlXPathNodeSetCreate();
47081 test_ret += test_xmlXPathObjectCopy();
47082 test_ret += test_xmlXPathOrderDocElems();
47083 test_ret += test_xmlXPathSetContextNode();
47086 printf("Module xpath: %d errors\n", test_ret);
47089 #ifdef LIBXML_XPATH_ENABLED
47091 #define gen_nb_xmlXPathParserContextPtr 1
47092 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47095 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47101 test_valuePop(void) {
47104 #if defined(LIBXML_XPATH_ENABLED)
47106 xmlXPathObjectPtr ret_val;
47107 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47110 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47111 mem_base = xmlMemBlocks();
47112 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47114 ret_val = valuePop(ctxt);
47115 desret_xmlXPathObjectPtr(ret_val);
47117 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47118 xmlResetLastError();
47119 if (mem_base != xmlMemBlocks()) {
47120 printf("Leak of %d blocks found in valuePop",
47121 xmlMemBlocks() - mem_base);
47123 printf(" %d", n_ctxt);
47135 test_valuePush(void) {
47138 #if defined(LIBXML_XPATH_ENABLED)
47141 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47143 xmlXPathObjectPtr value; /* the XPath object */
47146 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47147 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47148 mem_base = xmlMemBlocks();
47149 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47150 value = gen_xmlXPathObjectPtr(n_value, 1);
47152 ret_val = valuePush(ctxt, value);
47153 desret_int(ret_val);
47155 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47156 des_xmlXPathObjectPtr(n_value, value, 1);
47157 xmlResetLastError();
47158 if (mem_base != xmlMemBlocks()) {
47159 printf("Leak of %d blocks found in valuePush",
47160 xmlMemBlocks() - mem_base);
47162 printf(" %d", n_ctxt);
47163 printf(" %d", n_value);
47176 test_xmlXPathAddValues(void) {
47179 #if defined(LIBXML_XPATH_ENABLED)
47181 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47184 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47185 mem_base = xmlMemBlocks();
47186 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47188 xmlXPathAddValues(ctxt);
47190 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47191 xmlResetLastError();
47192 if (mem_base != xmlMemBlocks()) {
47193 printf("Leak of %d blocks found in xmlXPathAddValues",
47194 xmlMemBlocks() - mem_base);
47196 printf(" %d", n_ctxt);
47208 test_xmlXPathBooleanFunction(void) {
47211 #if defined(LIBXML_XPATH_ENABLED)
47213 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47215 int nargs; /* the number of arguments */
47218 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47219 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47220 mem_base = xmlMemBlocks();
47221 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47222 nargs = gen_int(n_nargs, 1);
47224 xmlXPathBooleanFunction(ctxt, nargs);
47226 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47227 des_int(n_nargs, nargs, 1);
47228 xmlResetLastError();
47229 if (mem_base != xmlMemBlocks()) {
47230 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47231 xmlMemBlocks() - mem_base);
47233 printf(" %d", n_ctxt);
47234 printf(" %d", n_nargs);
47247 test_xmlXPathCeilingFunction(void) {
47250 #if defined(LIBXML_XPATH_ENABLED)
47252 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47254 int nargs; /* the number of arguments */
47257 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47258 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47259 mem_base = xmlMemBlocks();
47260 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47261 nargs = gen_int(n_nargs, 1);
47263 xmlXPathCeilingFunction(ctxt, nargs);
47265 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47266 des_int(n_nargs, nargs, 1);
47267 xmlResetLastError();
47268 if (mem_base != xmlMemBlocks()) {
47269 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47270 xmlMemBlocks() - mem_base);
47272 printf(" %d", n_ctxt);
47273 printf(" %d", n_nargs);
47286 test_xmlXPathCompareValues(void) {
47289 #if defined(LIBXML_XPATH_ENABLED)
47292 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47294 int inf; /* less than (1) or greater than (0) */
47296 int strict; /* is the comparison strict */
47299 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47300 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47301 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47302 mem_base = xmlMemBlocks();
47303 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47304 inf = gen_int(n_inf, 1);
47305 strict = gen_int(n_strict, 2);
47307 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47308 desret_int(ret_val);
47310 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47311 des_int(n_inf, inf, 1);
47312 des_int(n_strict, strict, 2);
47313 xmlResetLastError();
47314 if (mem_base != xmlMemBlocks()) {
47315 printf("Leak of %d blocks found in xmlXPathCompareValues",
47316 xmlMemBlocks() - mem_base);
47318 printf(" %d", n_ctxt);
47319 printf(" %d", n_inf);
47320 printf(" %d", n_strict);
47334 test_xmlXPathConcatFunction(void) {
47337 #if defined(LIBXML_XPATH_ENABLED)
47339 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47341 int nargs; /* the number of arguments */
47344 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47345 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47346 mem_base = xmlMemBlocks();
47347 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47348 nargs = gen_int(n_nargs, 1);
47350 xmlXPathConcatFunction(ctxt, nargs);
47352 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47353 des_int(n_nargs, nargs, 1);
47354 xmlResetLastError();
47355 if (mem_base != xmlMemBlocks()) {
47356 printf("Leak of %d blocks found in xmlXPathConcatFunction",
47357 xmlMemBlocks() - mem_base);
47359 printf(" %d", n_ctxt);
47360 printf(" %d", n_nargs);
47373 test_xmlXPathContainsFunction(void) {
47376 #if defined(LIBXML_XPATH_ENABLED)
47378 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47380 int nargs; /* the number of arguments */
47383 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47384 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47385 mem_base = xmlMemBlocks();
47386 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47387 nargs = gen_int(n_nargs, 1);
47389 xmlXPathContainsFunction(ctxt, nargs);
47391 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47392 des_int(n_nargs, nargs, 1);
47393 xmlResetLastError();
47394 if (mem_base != xmlMemBlocks()) {
47395 printf("Leak of %d blocks found in xmlXPathContainsFunction",
47396 xmlMemBlocks() - mem_base);
47398 printf(" %d", n_ctxt);
47399 printf(" %d", n_nargs);
47412 test_xmlXPathCountFunction(void) {
47415 #if defined(LIBXML_XPATH_ENABLED)
47417 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47419 int nargs; /* the number of arguments */
47422 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47423 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47424 mem_base = xmlMemBlocks();
47425 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47426 nargs = gen_int(n_nargs, 1);
47428 xmlXPathCountFunction(ctxt, nargs);
47430 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47431 des_int(n_nargs, nargs, 1);
47432 xmlResetLastError();
47433 if (mem_base != xmlMemBlocks()) {
47434 printf("Leak of %d blocks found in xmlXPathCountFunction",
47435 xmlMemBlocks() - mem_base);
47437 printf(" %d", n_ctxt);
47438 printf(" %d", n_nargs);
47451 test_xmlXPathDebugDumpCompExpr(void) {
47454 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47456 FILE * output; /* the FILE * for the output */
47458 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47460 int depth; /* the indentation level. */
47463 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47464 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47465 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47466 mem_base = xmlMemBlocks();
47467 output = gen_FILE_ptr(n_output, 0);
47468 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47469 depth = gen_int(n_depth, 2);
47471 xmlXPathDebugDumpCompExpr(output, comp, depth);
47473 des_FILE_ptr(n_output, output, 0);
47474 des_xmlXPathCompExprPtr(n_comp, comp, 1);
47475 des_int(n_depth, depth, 2);
47476 xmlResetLastError();
47477 if (mem_base != xmlMemBlocks()) {
47478 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47479 xmlMemBlocks() - mem_base);
47481 printf(" %d", n_output);
47482 printf(" %d", n_comp);
47483 printf(" %d", n_depth);
47497 test_xmlXPathDebugDumpObject(void) {
47500 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47502 FILE * output; /* the FILE * to dump the output */
47504 xmlXPathObjectPtr cur; /* the object to inspect */
47506 int depth; /* indentation level */
47509 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47510 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47511 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47512 mem_base = xmlMemBlocks();
47513 output = gen_FILE_ptr(n_output, 0);
47514 cur = gen_xmlXPathObjectPtr(n_cur, 1);
47515 depth = gen_int(n_depth, 2);
47517 xmlXPathDebugDumpObject(output, cur, depth);
47519 des_FILE_ptr(n_output, output, 0);
47520 des_xmlXPathObjectPtr(n_cur, cur, 1);
47521 des_int(n_depth, depth, 2);
47522 xmlResetLastError();
47523 if (mem_base != xmlMemBlocks()) {
47524 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47525 xmlMemBlocks() - mem_base);
47527 printf(" %d", n_output);
47528 printf(" %d", n_cur);
47529 printf(" %d", n_depth);
47543 test_xmlXPathDifference(void) {
47546 #if defined(LIBXML_XPATH_ENABLED)
47548 xmlNodeSetPtr ret_val;
47549 xmlNodeSetPtr nodes1; /* a node-set */
47551 xmlNodeSetPtr nodes2; /* a node-set */
47554 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47555 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47556 mem_base = xmlMemBlocks();
47557 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47558 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47560 ret_val = xmlXPathDifference(nodes1, nodes2);
47561 desret_xmlNodeSetPtr(ret_val);
47563 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47564 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47565 xmlResetLastError();
47566 if (mem_base != xmlMemBlocks()) {
47567 printf("Leak of %d blocks found in xmlXPathDifference",
47568 xmlMemBlocks() - mem_base);
47570 printf(" %d", n_nodes1);
47571 printf(" %d", n_nodes2);
47584 test_xmlXPathDistinct(void) {
47587 #if defined(LIBXML_XPATH_ENABLED)
47589 xmlNodeSetPtr ret_val;
47590 xmlNodeSetPtr nodes; /* a node-set */
47593 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47594 mem_base = xmlMemBlocks();
47595 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47597 ret_val = xmlXPathDistinct(nodes);
47598 desret_xmlNodeSetPtr(ret_val);
47600 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47601 xmlResetLastError();
47602 if (mem_base != xmlMemBlocks()) {
47603 printf("Leak of %d blocks found in xmlXPathDistinct",
47604 xmlMemBlocks() - mem_base);
47606 printf(" %d", n_nodes);
47618 test_xmlXPathDistinctSorted(void) {
47621 #if defined(LIBXML_XPATH_ENABLED)
47623 xmlNodeSetPtr ret_val;
47624 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47627 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47628 mem_base = xmlMemBlocks();
47629 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47631 ret_val = xmlXPathDistinctSorted(nodes);
47632 desret_xmlNodeSetPtr(ret_val);
47634 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47635 xmlResetLastError();
47636 if (mem_base != xmlMemBlocks()) {
47637 printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47638 xmlMemBlocks() - mem_base);
47640 printf(" %d", n_nodes);
47652 test_xmlXPathDivValues(void) {
47655 #if defined(LIBXML_XPATH_ENABLED)
47657 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47660 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47661 mem_base = xmlMemBlocks();
47662 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47664 xmlXPathDivValues(ctxt);
47666 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47667 xmlResetLastError();
47668 if (mem_base != xmlMemBlocks()) {
47669 printf("Leak of %d blocks found in xmlXPathDivValues",
47670 xmlMemBlocks() - mem_base);
47672 printf(" %d", n_ctxt);
47684 test_xmlXPathEqualValues(void) {
47687 #if defined(LIBXML_XPATH_ENABLED)
47690 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47693 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47694 mem_base = xmlMemBlocks();
47695 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47697 ret_val = xmlXPathEqualValues(ctxt);
47698 desret_int(ret_val);
47700 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47701 xmlResetLastError();
47702 if (mem_base != xmlMemBlocks()) {
47703 printf("Leak of %d blocks found in xmlXPathEqualValues",
47704 xmlMemBlocks() - mem_base);
47706 printf(" %d", n_ctxt);
47718 test_xmlXPathErr(void) {
47721 #if defined(LIBXML_XPATH_ENABLED)
47723 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47725 int error; /* the error code */
47728 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47729 for (n_error = 0;n_error < gen_nb_int;n_error++) {
47730 mem_base = xmlMemBlocks();
47731 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47732 error = gen_int(n_error, 1);
47734 xmlXPathErr(ctxt, error);
47736 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47737 des_int(n_error, error, 1);
47738 xmlResetLastError();
47739 if (mem_base != xmlMemBlocks()) {
47740 printf("Leak of %d blocks found in xmlXPathErr",
47741 xmlMemBlocks() - mem_base);
47743 printf(" %d", n_ctxt);
47744 printf(" %d", n_error);
47757 test_xmlXPathEvalExpr(void) {
47760 #if defined(LIBXML_XPATH_ENABLED)
47762 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47765 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47766 mem_base = xmlMemBlocks();
47767 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47769 xmlXPathEvalExpr(ctxt);
47771 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47772 xmlResetLastError();
47773 if (mem_base != xmlMemBlocks()) {
47774 printf("Leak of %d blocks found in xmlXPathEvalExpr",
47775 xmlMemBlocks() - mem_base);
47777 printf(" %d", n_ctxt);
47789 test_xmlXPathEvaluatePredicateResult(void) {
47792 #if defined(LIBXML_XPATH_ENABLED)
47795 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47797 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47800 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47801 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47802 mem_base = xmlMemBlocks();
47803 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47804 res = gen_xmlXPathObjectPtr(n_res, 1);
47806 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47807 desret_int(ret_val);
47809 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47810 des_xmlXPathObjectPtr(n_res, res, 1);
47811 xmlResetLastError();
47812 if (mem_base != xmlMemBlocks()) {
47813 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47814 xmlMemBlocks() - mem_base);
47816 printf(" %d", n_ctxt);
47817 printf(" %d", n_res);
47830 test_xmlXPathFalseFunction(void) {
47833 #if defined(LIBXML_XPATH_ENABLED)
47835 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47837 int nargs; /* the number of arguments */
47840 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47841 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47842 mem_base = xmlMemBlocks();
47843 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47844 nargs = gen_int(n_nargs, 1);
47846 xmlXPathFalseFunction(ctxt, nargs);
47848 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47849 des_int(n_nargs, nargs, 1);
47850 xmlResetLastError();
47851 if (mem_base != xmlMemBlocks()) {
47852 printf("Leak of %d blocks found in xmlXPathFalseFunction",
47853 xmlMemBlocks() - mem_base);
47855 printf(" %d", n_ctxt);
47856 printf(" %d", n_nargs);
47869 test_xmlXPathFloorFunction(void) {
47872 #if defined(LIBXML_XPATH_ENABLED)
47874 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47876 int nargs; /* the number of arguments */
47879 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47880 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47881 mem_base = xmlMemBlocks();
47882 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47883 nargs = gen_int(n_nargs, 1);
47885 xmlXPathFloorFunction(ctxt, nargs);
47887 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47888 des_int(n_nargs, nargs, 1);
47889 xmlResetLastError();
47890 if (mem_base != xmlMemBlocks()) {
47891 printf("Leak of %d blocks found in xmlXPathFloorFunction",
47892 xmlMemBlocks() - mem_base);
47894 printf(" %d", n_ctxt);
47895 printf(" %d", n_nargs);
47908 test_xmlXPathFunctionLookup(void) {
47912 /* missing type support */
47918 test_xmlXPathFunctionLookupNS(void) {
47922 /* missing type support */
47928 test_xmlXPathHasSameNodes(void) {
47931 #if defined(LIBXML_XPATH_ENABLED)
47934 xmlNodeSetPtr nodes1; /* a node-set */
47936 xmlNodeSetPtr nodes2; /* a node-set */
47939 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47940 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47941 mem_base = xmlMemBlocks();
47942 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47943 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47945 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47946 desret_int(ret_val);
47948 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47949 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47950 xmlResetLastError();
47951 if (mem_base != xmlMemBlocks()) {
47952 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47953 xmlMemBlocks() - mem_base);
47955 printf(" %d", n_nodes1);
47956 printf(" %d", n_nodes2);
47969 test_xmlXPathIdFunction(void) {
47972 #if defined(LIBXML_XPATH_ENABLED)
47974 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47976 int nargs; /* the number of arguments */
47979 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47980 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47981 mem_base = xmlMemBlocks();
47982 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47983 nargs = gen_int(n_nargs, 1);
47985 xmlXPathIdFunction(ctxt, nargs);
47987 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47988 des_int(n_nargs, nargs, 1);
47989 xmlResetLastError();
47990 if (mem_base != xmlMemBlocks()) {
47991 printf("Leak of %d blocks found in xmlXPathIdFunction",
47992 xmlMemBlocks() - mem_base);
47994 printf(" %d", n_ctxt);
47995 printf(" %d", n_nargs);
48008 test_xmlXPathIntersection(void) {
48011 #if defined(LIBXML_XPATH_ENABLED)
48013 xmlNodeSetPtr ret_val;
48014 xmlNodeSetPtr nodes1; /* a node-set */
48016 xmlNodeSetPtr nodes2; /* a node-set */
48019 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48020 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48021 mem_base = xmlMemBlocks();
48022 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48023 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48025 ret_val = xmlXPathIntersection(nodes1, nodes2);
48026 desret_xmlNodeSetPtr(ret_val);
48028 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48029 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48030 xmlResetLastError();
48031 if (mem_base != xmlMemBlocks()) {
48032 printf("Leak of %d blocks found in xmlXPathIntersection",
48033 xmlMemBlocks() - mem_base);
48035 printf(" %d", n_nodes1);
48036 printf(" %d", n_nodes2);
48049 test_xmlXPathIsNodeType(void) {
48052 #if defined(LIBXML_XPATH_ENABLED)
48055 xmlChar * name; /* a name string */
48058 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48059 mem_base = xmlMemBlocks();
48060 name = gen_const_xmlChar_ptr(n_name, 0);
48062 ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48063 desret_int(ret_val);
48065 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48066 xmlResetLastError();
48067 if (mem_base != xmlMemBlocks()) {
48068 printf("Leak of %d blocks found in xmlXPathIsNodeType",
48069 xmlMemBlocks() - mem_base);
48071 printf(" %d", n_name);
48083 test_xmlXPathLangFunction(void) {
48086 #if defined(LIBXML_XPATH_ENABLED)
48088 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48090 int nargs; /* the number of arguments */
48093 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48094 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48095 mem_base = xmlMemBlocks();
48096 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48097 nargs = gen_int(n_nargs, 1);
48099 xmlXPathLangFunction(ctxt, nargs);
48101 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48102 des_int(n_nargs, nargs, 1);
48103 xmlResetLastError();
48104 if (mem_base != xmlMemBlocks()) {
48105 printf("Leak of %d blocks found in xmlXPathLangFunction",
48106 xmlMemBlocks() - mem_base);
48108 printf(" %d", n_ctxt);
48109 printf(" %d", n_nargs);
48122 test_xmlXPathLastFunction(void) {
48125 #if defined(LIBXML_XPATH_ENABLED)
48127 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48129 int nargs; /* the number of arguments */
48132 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48133 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48134 mem_base = xmlMemBlocks();
48135 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48136 nargs = gen_int(n_nargs, 1);
48138 xmlXPathLastFunction(ctxt, nargs);
48140 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48141 des_int(n_nargs, nargs, 1);
48142 xmlResetLastError();
48143 if (mem_base != xmlMemBlocks()) {
48144 printf("Leak of %d blocks found in xmlXPathLastFunction",
48145 xmlMemBlocks() - mem_base);
48147 printf(" %d", n_ctxt);
48148 printf(" %d", n_nargs);
48161 test_xmlXPathLeading(void) {
48164 #if defined(LIBXML_XPATH_ENABLED)
48166 xmlNodeSetPtr ret_val;
48167 xmlNodeSetPtr nodes1; /* a node-set */
48169 xmlNodeSetPtr nodes2; /* a node-set */
48172 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48173 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48174 mem_base = xmlMemBlocks();
48175 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48176 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48178 ret_val = xmlXPathLeading(nodes1, nodes2);
48179 desret_xmlNodeSetPtr(ret_val);
48181 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48182 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48183 xmlResetLastError();
48184 if (mem_base != xmlMemBlocks()) {
48185 printf("Leak of %d blocks found in xmlXPathLeading",
48186 xmlMemBlocks() - mem_base);
48188 printf(" %d", n_nodes1);
48189 printf(" %d", n_nodes2);
48202 test_xmlXPathLeadingSorted(void) {
48205 #if defined(LIBXML_XPATH_ENABLED)
48207 xmlNodeSetPtr ret_val;
48208 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48210 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48213 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48214 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48215 mem_base = xmlMemBlocks();
48216 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48217 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48219 ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48220 desret_xmlNodeSetPtr(ret_val);
48222 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48223 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48224 xmlResetLastError();
48225 if (mem_base != xmlMemBlocks()) {
48226 printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48227 xmlMemBlocks() - mem_base);
48229 printf(" %d", n_nodes1);
48230 printf(" %d", n_nodes2);
48243 test_xmlXPathLocalNameFunction(void) {
48246 #if defined(LIBXML_XPATH_ENABLED)
48248 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48250 int nargs; /* the number of arguments */
48253 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48254 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48255 mem_base = xmlMemBlocks();
48256 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48257 nargs = gen_int(n_nargs, 1);
48259 xmlXPathLocalNameFunction(ctxt, nargs);
48261 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48262 des_int(n_nargs, nargs, 1);
48263 xmlResetLastError();
48264 if (mem_base != xmlMemBlocks()) {
48265 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48266 xmlMemBlocks() - mem_base);
48268 printf(" %d", n_ctxt);
48269 printf(" %d", n_nargs);
48282 test_xmlXPathModValues(void) {
48285 #if defined(LIBXML_XPATH_ENABLED)
48287 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48290 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48291 mem_base = xmlMemBlocks();
48292 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48294 xmlXPathModValues(ctxt);
48296 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48297 xmlResetLastError();
48298 if (mem_base != xmlMemBlocks()) {
48299 printf("Leak of %d blocks found in xmlXPathModValues",
48300 xmlMemBlocks() - mem_base);
48302 printf(" %d", n_ctxt);
48314 test_xmlXPathMultValues(void) {
48317 #if defined(LIBXML_XPATH_ENABLED)
48319 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48322 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48323 mem_base = xmlMemBlocks();
48324 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48326 xmlXPathMultValues(ctxt);
48328 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48329 xmlResetLastError();
48330 if (mem_base != xmlMemBlocks()) {
48331 printf("Leak of %d blocks found in xmlXPathMultValues",
48332 xmlMemBlocks() - mem_base);
48334 printf(" %d", n_ctxt);
48346 test_xmlXPathNamespaceURIFunction(void) {
48349 #if defined(LIBXML_XPATH_ENABLED)
48351 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48353 int nargs; /* the number of arguments */
48356 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48357 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48358 mem_base = xmlMemBlocks();
48359 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48360 nargs = gen_int(n_nargs, 1);
48362 xmlXPathNamespaceURIFunction(ctxt, nargs);
48364 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48365 des_int(n_nargs, nargs, 1);
48366 xmlResetLastError();
48367 if (mem_base != xmlMemBlocks()) {
48368 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48369 xmlMemBlocks() - mem_base);
48371 printf(" %d", n_ctxt);
48372 printf(" %d", n_nargs);
48385 test_xmlXPathNewBoolean(void) {
48388 #if defined(LIBXML_XPATH_ENABLED)
48390 xmlXPathObjectPtr ret_val;
48391 int val; /* the boolean value */
48394 for (n_val = 0;n_val < gen_nb_int;n_val++) {
48395 mem_base = xmlMemBlocks();
48396 val = gen_int(n_val, 0);
48398 ret_val = xmlXPathNewBoolean(val);
48399 desret_xmlXPathObjectPtr(ret_val);
48401 des_int(n_val, val, 0);
48402 xmlResetLastError();
48403 if (mem_base != xmlMemBlocks()) {
48404 printf("Leak of %d blocks found in xmlXPathNewBoolean",
48405 xmlMemBlocks() - mem_base);
48407 printf(" %d", n_val);
48419 test_xmlXPathNewCString(void) {
48422 #if defined(LIBXML_XPATH_ENABLED)
48424 xmlXPathObjectPtr ret_val;
48425 char * val; /* the char * value */
48428 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48429 mem_base = xmlMemBlocks();
48430 val = gen_const_char_ptr(n_val, 0);
48432 ret_val = xmlXPathNewCString((const char *)val);
48433 desret_xmlXPathObjectPtr(ret_val);
48435 des_const_char_ptr(n_val, (const char *)val, 0);
48436 xmlResetLastError();
48437 if (mem_base != xmlMemBlocks()) {
48438 printf("Leak of %d blocks found in xmlXPathNewCString",
48439 xmlMemBlocks() - mem_base);
48441 printf(" %d", n_val);
48453 test_xmlXPathNewFloat(void) {
48456 #if defined(LIBXML_XPATH_ENABLED)
48458 xmlXPathObjectPtr ret_val;
48459 double val; /* the double value */
48462 for (n_val = 0;n_val < gen_nb_double;n_val++) {
48463 mem_base = xmlMemBlocks();
48464 val = gen_double(n_val, 0);
48466 ret_val = xmlXPathNewFloat(val);
48467 desret_xmlXPathObjectPtr(ret_val);
48469 des_double(n_val, val, 0);
48470 xmlResetLastError();
48471 if (mem_base != xmlMemBlocks()) {
48472 printf("Leak of %d blocks found in xmlXPathNewFloat",
48473 xmlMemBlocks() - mem_base);
48475 printf(" %d", n_val);
48487 test_xmlXPathNewNodeSet(void) {
48490 #if defined(LIBXML_XPATH_ENABLED)
48492 xmlXPathObjectPtr ret_val;
48493 xmlNodePtr val; /* the NodePtr value */
48496 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48497 mem_base = xmlMemBlocks();
48498 val = gen_xmlNodePtr(n_val, 0);
48500 ret_val = xmlXPathNewNodeSet(val);
48501 desret_xmlXPathObjectPtr(ret_val);
48503 des_xmlNodePtr(n_val, val, 0);
48504 xmlResetLastError();
48505 if (mem_base != xmlMemBlocks()) {
48506 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48507 xmlMemBlocks() - mem_base);
48509 printf(" %d", n_val);
48521 test_xmlXPathNewNodeSetList(void) {
48524 #if defined(LIBXML_XPATH_ENABLED)
48526 xmlXPathObjectPtr ret_val;
48527 xmlNodeSetPtr val; /* an existing NodeSet */
48530 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48531 mem_base = xmlMemBlocks();
48532 val = gen_xmlNodeSetPtr(n_val, 0);
48534 ret_val = xmlXPathNewNodeSetList(val);
48535 desret_xmlXPathObjectPtr(ret_val);
48537 des_xmlNodeSetPtr(n_val, val, 0);
48538 xmlResetLastError();
48539 if (mem_base != xmlMemBlocks()) {
48540 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48541 xmlMemBlocks() - mem_base);
48543 printf(" %d", n_val);
48555 test_xmlXPathNewParserContext(void) {
48559 /* missing type support */
48565 test_xmlXPathNewString(void) {
48568 #if defined(LIBXML_XPATH_ENABLED)
48570 xmlXPathObjectPtr ret_val;
48571 xmlChar * val; /* the xmlChar * value */
48574 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48575 mem_base = xmlMemBlocks();
48576 val = gen_const_xmlChar_ptr(n_val, 0);
48578 ret_val = xmlXPathNewString((const xmlChar *)val);
48579 desret_xmlXPathObjectPtr(ret_val);
48581 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48582 xmlResetLastError();
48583 if (mem_base != xmlMemBlocks()) {
48584 printf("Leak of %d blocks found in xmlXPathNewString",
48585 xmlMemBlocks() - mem_base);
48587 printf(" %d", n_val);
48599 test_xmlXPathNextAncestor(void) {
48602 #if defined(LIBXML_XPATH_ENABLED)
48604 xmlNodePtr ret_val;
48605 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48607 xmlNodePtr cur; /* the current node in the traversal */
48610 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48611 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48612 mem_base = xmlMemBlocks();
48613 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48614 cur = gen_xmlNodePtr(n_cur, 1);
48616 ret_val = xmlXPathNextAncestor(ctxt, cur);
48617 desret_xmlNodePtr(ret_val);
48619 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48620 des_xmlNodePtr(n_cur, cur, 1);
48621 xmlResetLastError();
48622 if (mem_base != xmlMemBlocks()) {
48623 printf("Leak of %d blocks found in xmlXPathNextAncestor",
48624 xmlMemBlocks() - mem_base);
48626 printf(" %d", n_ctxt);
48627 printf(" %d", n_cur);
48640 test_xmlXPathNextAncestorOrSelf(void) {
48643 #if defined(LIBXML_XPATH_ENABLED)
48645 xmlNodePtr ret_val;
48646 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48648 xmlNodePtr cur; /* the current node in the traversal */
48651 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48652 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48653 mem_base = xmlMemBlocks();
48654 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48655 cur = gen_xmlNodePtr(n_cur, 1);
48657 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48658 desret_xmlNodePtr(ret_val);
48660 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48661 des_xmlNodePtr(n_cur, cur, 1);
48662 xmlResetLastError();
48663 if (mem_base != xmlMemBlocks()) {
48664 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48665 xmlMemBlocks() - mem_base);
48667 printf(" %d", n_ctxt);
48668 printf(" %d", n_cur);
48681 test_xmlXPathNextAttribute(void) {
48684 #if defined(LIBXML_XPATH_ENABLED)
48686 xmlNodePtr ret_val;
48687 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48689 xmlNodePtr cur; /* the current attribute in the traversal */
48692 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48693 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48694 mem_base = xmlMemBlocks();
48695 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48696 cur = gen_xmlNodePtr(n_cur, 1);
48698 ret_val = xmlXPathNextAttribute(ctxt, cur);
48699 desret_xmlNodePtr(ret_val);
48701 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48702 des_xmlNodePtr(n_cur, cur, 1);
48703 xmlResetLastError();
48704 if (mem_base != xmlMemBlocks()) {
48705 printf("Leak of %d blocks found in xmlXPathNextAttribute",
48706 xmlMemBlocks() - mem_base);
48708 printf(" %d", n_ctxt);
48709 printf(" %d", n_cur);
48722 test_xmlXPathNextChild(void) {
48725 #if defined(LIBXML_XPATH_ENABLED)
48727 xmlNodePtr ret_val;
48728 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48730 xmlNodePtr cur; /* the current node in the traversal */
48733 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48734 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48735 mem_base = xmlMemBlocks();
48736 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48737 cur = gen_xmlNodePtr(n_cur, 1);
48739 ret_val = xmlXPathNextChild(ctxt, cur);
48740 desret_xmlNodePtr(ret_val);
48742 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48743 des_xmlNodePtr(n_cur, cur, 1);
48744 xmlResetLastError();
48745 if (mem_base != xmlMemBlocks()) {
48746 printf("Leak of %d blocks found in xmlXPathNextChild",
48747 xmlMemBlocks() - mem_base);
48749 printf(" %d", n_ctxt);
48750 printf(" %d", n_cur);
48763 test_xmlXPathNextDescendant(void) {
48766 #if defined(LIBXML_XPATH_ENABLED)
48768 xmlNodePtr ret_val;
48769 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48771 xmlNodePtr cur; /* the current node in the traversal */
48774 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48775 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48776 mem_base = xmlMemBlocks();
48777 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48778 cur = gen_xmlNodePtr(n_cur, 1);
48780 ret_val = xmlXPathNextDescendant(ctxt, cur);
48781 desret_xmlNodePtr(ret_val);
48783 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48784 des_xmlNodePtr(n_cur, cur, 1);
48785 xmlResetLastError();
48786 if (mem_base != xmlMemBlocks()) {
48787 printf("Leak of %d blocks found in xmlXPathNextDescendant",
48788 xmlMemBlocks() - mem_base);
48790 printf(" %d", n_ctxt);
48791 printf(" %d", n_cur);
48804 test_xmlXPathNextDescendantOrSelf(void) {
48807 #if defined(LIBXML_XPATH_ENABLED)
48809 xmlNodePtr ret_val;
48810 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48812 xmlNodePtr cur; /* the current node in the traversal */
48815 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48816 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48817 mem_base = xmlMemBlocks();
48818 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48819 cur = gen_xmlNodePtr(n_cur, 1);
48821 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48822 desret_xmlNodePtr(ret_val);
48824 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48825 des_xmlNodePtr(n_cur, cur, 1);
48826 xmlResetLastError();
48827 if (mem_base != xmlMemBlocks()) {
48828 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48829 xmlMemBlocks() - mem_base);
48831 printf(" %d", n_ctxt);
48832 printf(" %d", n_cur);
48845 test_xmlXPathNextFollowing(void) {
48848 #if defined(LIBXML_XPATH_ENABLED)
48850 xmlNodePtr ret_val;
48851 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48853 xmlNodePtr cur; /* the current node in the traversal */
48856 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48857 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48858 mem_base = xmlMemBlocks();
48859 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48860 cur = gen_xmlNodePtr(n_cur, 1);
48862 ret_val = xmlXPathNextFollowing(ctxt, cur);
48863 desret_xmlNodePtr(ret_val);
48865 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48866 des_xmlNodePtr(n_cur, cur, 1);
48867 xmlResetLastError();
48868 if (mem_base != xmlMemBlocks()) {
48869 printf("Leak of %d blocks found in xmlXPathNextFollowing",
48870 xmlMemBlocks() - mem_base);
48872 printf(" %d", n_ctxt);
48873 printf(" %d", n_cur);
48886 test_xmlXPathNextFollowingSibling(void) {
48889 #if defined(LIBXML_XPATH_ENABLED)
48891 xmlNodePtr ret_val;
48892 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48894 xmlNodePtr cur; /* the current node in the traversal */
48897 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48898 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48899 mem_base = xmlMemBlocks();
48900 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48901 cur = gen_xmlNodePtr(n_cur, 1);
48903 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48904 desret_xmlNodePtr(ret_val);
48906 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48907 des_xmlNodePtr(n_cur, cur, 1);
48908 xmlResetLastError();
48909 if (mem_base != xmlMemBlocks()) {
48910 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48911 xmlMemBlocks() - mem_base);
48913 printf(" %d", n_ctxt);
48914 printf(" %d", n_cur);
48927 test_xmlXPathNextNamespace(void) {
48930 #if defined(LIBXML_XPATH_ENABLED)
48932 xmlNodePtr ret_val;
48933 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48935 xmlNodePtr cur; /* the current attribute in the traversal */
48938 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48939 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48940 mem_base = xmlMemBlocks();
48941 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48942 cur = gen_xmlNodePtr(n_cur, 1);
48944 ret_val = xmlXPathNextNamespace(ctxt, cur);
48945 desret_xmlNodePtr(ret_val);
48947 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48948 des_xmlNodePtr(n_cur, cur, 1);
48949 xmlResetLastError();
48950 if (mem_base != xmlMemBlocks()) {
48951 printf("Leak of %d blocks found in xmlXPathNextNamespace",
48952 xmlMemBlocks() - mem_base);
48954 printf(" %d", n_ctxt);
48955 printf(" %d", n_cur);
48968 test_xmlXPathNextParent(void) {
48971 #if defined(LIBXML_XPATH_ENABLED)
48973 xmlNodePtr ret_val;
48974 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48976 xmlNodePtr cur; /* the current node in the traversal */
48979 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48980 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48981 mem_base = xmlMemBlocks();
48982 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48983 cur = gen_xmlNodePtr(n_cur, 1);
48985 ret_val = xmlXPathNextParent(ctxt, cur);
48986 desret_xmlNodePtr(ret_val);
48988 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48989 des_xmlNodePtr(n_cur, cur, 1);
48990 xmlResetLastError();
48991 if (mem_base != xmlMemBlocks()) {
48992 printf("Leak of %d blocks found in xmlXPathNextParent",
48993 xmlMemBlocks() - mem_base);
48995 printf(" %d", n_ctxt);
48996 printf(" %d", n_cur);
49009 test_xmlXPathNextPreceding(void) {
49012 #if defined(LIBXML_XPATH_ENABLED)
49014 xmlNodePtr ret_val;
49015 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49017 xmlNodePtr cur; /* the current node in the traversal */
49020 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49021 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49022 mem_base = xmlMemBlocks();
49023 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49024 cur = gen_xmlNodePtr(n_cur, 1);
49026 ret_val = xmlXPathNextPreceding(ctxt, cur);
49027 desret_xmlNodePtr(ret_val);
49029 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49030 des_xmlNodePtr(n_cur, cur, 1);
49031 xmlResetLastError();
49032 if (mem_base != xmlMemBlocks()) {
49033 printf("Leak of %d blocks found in xmlXPathNextPreceding",
49034 xmlMemBlocks() - mem_base);
49036 printf(" %d", n_ctxt);
49037 printf(" %d", n_cur);
49050 test_xmlXPathNextPrecedingSibling(void) {
49053 #if defined(LIBXML_XPATH_ENABLED)
49055 xmlNodePtr ret_val;
49056 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49058 xmlNodePtr cur; /* the current node in the traversal */
49061 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49062 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49063 mem_base = xmlMemBlocks();
49064 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49065 cur = gen_xmlNodePtr(n_cur, 1);
49067 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49068 desret_xmlNodePtr(ret_val);
49070 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49071 des_xmlNodePtr(n_cur, cur, 1);
49072 xmlResetLastError();
49073 if (mem_base != xmlMemBlocks()) {
49074 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49075 xmlMemBlocks() - mem_base);
49077 printf(" %d", n_ctxt);
49078 printf(" %d", n_cur);
49091 test_xmlXPathNextSelf(void) {
49094 #if defined(LIBXML_XPATH_ENABLED)
49096 xmlNodePtr ret_val;
49097 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49099 xmlNodePtr cur; /* the current node in the traversal */
49102 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49103 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49104 mem_base = xmlMemBlocks();
49105 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49106 cur = gen_xmlNodePtr(n_cur, 1);
49108 ret_val = xmlXPathNextSelf(ctxt, cur);
49109 desret_xmlNodePtr(ret_val);
49111 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49112 des_xmlNodePtr(n_cur, cur, 1);
49113 xmlResetLastError();
49114 if (mem_base != xmlMemBlocks()) {
49115 printf("Leak of %d blocks found in xmlXPathNextSelf",
49116 xmlMemBlocks() - mem_base);
49118 printf(" %d", n_ctxt);
49119 printf(" %d", n_cur);
49132 test_xmlXPathNodeLeading(void) {
49135 #if defined(LIBXML_XPATH_ENABLED)
49137 xmlNodeSetPtr ret_val;
49138 xmlNodeSetPtr nodes; /* a node-set */
49140 xmlNodePtr node; /* a node */
49143 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49144 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49145 mem_base = xmlMemBlocks();
49146 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49147 node = gen_xmlNodePtr(n_node, 1);
49149 ret_val = xmlXPathNodeLeading(nodes, node);
49150 desret_xmlNodeSetPtr(ret_val);
49152 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49153 des_xmlNodePtr(n_node, node, 1);
49154 xmlResetLastError();
49155 if (mem_base != xmlMemBlocks()) {
49156 printf("Leak of %d blocks found in xmlXPathNodeLeading",
49157 xmlMemBlocks() - mem_base);
49159 printf(" %d", n_nodes);
49160 printf(" %d", n_node);
49173 test_xmlXPathNodeLeadingSorted(void) {
49176 #if defined(LIBXML_XPATH_ENABLED)
49178 xmlNodeSetPtr ret_val;
49179 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49181 xmlNodePtr node; /* a node */
49184 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49185 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49186 mem_base = xmlMemBlocks();
49187 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49188 node = gen_xmlNodePtr(n_node, 1);
49190 ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49191 desret_xmlNodeSetPtr(ret_val);
49193 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49194 des_xmlNodePtr(n_node, node, 1);
49195 xmlResetLastError();
49196 if (mem_base != xmlMemBlocks()) {
49197 printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49198 xmlMemBlocks() - mem_base);
49200 printf(" %d", n_nodes);
49201 printf(" %d", n_node);
49214 test_xmlXPathNodeSetAdd(void) {
49217 #if defined(LIBXML_XPATH_ENABLED)
49220 xmlNodeSetPtr cur; /* the initial node set */
49222 xmlNodePtr val; /* a new xmlNodePtr */
49225 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49226 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49227 mem_base = xmlMemBlocks();
49228 cur = gen_xmlNodeSetPtr(n_cur, 0);
49229 val = gen_xmlNodePtr(n_val, 1);
49231 ret_val = xmlXPathNodeSetAdd(cur, val);
49232 desret_int(ret_val);
49234 des_xmlNodeSetPtr(n_cur, cur, 0);
49235 des_xmlNodePtr(n_val, val, 1);
49236 xmlResetLastError();
49237 if (mem_base != xmlMemBlocks()) {
49238 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49239 xmlMemBlocks() - mem_base);
49241 printf(" %d", n_cur);
49242 printf(" %d", n_val);
49255 test_xmlXPathNodeSetAddNs(void) {
49258 #if defined(LIBXML_XPATH_ENABLED)
49261 xmlNodeSetPtr cur; /* the initial node set */
49263 xmlNodePtr node; /* the hosting node */
49265 xmlNsPtr ns; /* a the namespace node */
49268 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49269 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49270 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49271 mem_base = xmlMemBlocks();
49272 cur = gen_xmlNodeSetPtr(n_cur, 0);
49273 node = gen_xmlNodePtr(n_node, 1);
49274 ns = gen_xmlNsPtr(n_ns, 2);
49276 ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49277 desret_int(ret_val);
49279 des_xmlNodeSetPtr(n_cur, cur, 0);
49280 des_xmlNodePtr(n_node, node, 1);
49281 des_xmlNsPtr(n_ns, ns, 2);
49282 xmlResetLastError();
49283 if (mem_base != xmlMemBlocks()) {
49284 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49285 xmlMemBlocks() - mem_base);
49287 printf(" %d", n_cur);
49288 printf(" %d", n_node);
49289 printf(" %d", n_ns);
49303 test_xmlXPathNodeSetAddUnique(void) {
49306 #if defined(LIBXML_XPATH_ENABLED)
49309 xmlNodeSetPtr cur; /* the initial node set */
49311 xmlNodePtr val; /* a new xmlNodePtr */
49314 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49315 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49316 mem_base = xmlMemBlocks();
49317 cur = gen_xmlNodeSetPtr(n_cur, 0);
49318 val = gen_xmlNodePtr(n_val, 1);
49320 ret_val = xmlXPathNodeSetAddUnique(cur, val);
49321 desret_int(ret_val);
49323 des_xmlNodeSetPtr(n_cur, cur, 0);
49324 des_xmlNodePtr(n_val, val, 1);
49325 xmlResetLastError();
49326 if (mem_base != xmlMemBlocks()) {
49327 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49328 xmlMemBlocks() - mem_base);
49330 printf(" %d", n_cur);
49331 printf(" %d", n_val);
49344 test_xmlXPathNodeSetContains(void) {
49347 #if defined(LIBXML_XPATH_ENABLED)
49350 xmlNodeSetPtr cur; /* the node-set */
49352 xmlNodePtr val; /* the node */
49355 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49356 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49357 mem_base = xmlMemBlocks();
49358 cur = gen_xmlNodeSetPtr(n_cur, 0);
49359 val = gen_xmlNodePtr(n_val, 1);
49361 ret_val = xmlXPathNodeSetContains(cur, val);
49362 desret_int(ret_val);
49364 des_xmlNodeSetPtr(n_cur, cur, 0);
49365 des_xmlNodePtr(n_val, val, 1);
49366 xmlResetLastError();
49367 if (mem_base != xmlMemBlocks()) {
49368 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49369 xmlMemBlocks() - mem_base);
49371 printf(" %d", n_cur);
49372 printf(" %d", n_val);
49385 test_xmlXPathNodeSetDel(void) {
49388 #if defined(LIBXML_XPATH_ENABLED)
49390 xmlNodeSetPtr cur; /* the initial node set */
49392 xmlNodePtr val; /* an xmlNodePtr */
49395 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49396 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49397 mem_base = xmlMemBlocks();
49398 cur = gen_xmlNodeSetPtr(n_cur, 0);
49399 val = gen_xmlNodePtr(n_val, 1);
49401 xmlXPathNodeSetDel(cur, val);
49403 des_xmlNodeSetPtr(n_cur, cur, 0);
49404 des_xmlNodePtr(n_val, val, 1);
49405 xmlResetLastError();
49406 if (mem_base != xmlMemBlocks()) {
49407 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49408 xmlMemBlocks() - mem_base);
49410 printf(" %d", n_cur);
49411 printf(" %d", n_val);
49424 test_xmlXPathNodeSetMerge(void) {
49427 #if defined(LIBXML_XPATH_ENABLED)
49429 xmlNodeSetPtr ret_val;
49430 xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49432 xmlNodeSetPtr val2; /* the second NodeSet */
49435 for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49436 for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49437 mem_base = xmlMemBlocks();
49438 val1 = gen_xmlNodeSetPtr(n_val1, 0);
49439 val2 = gen_xmlNodeSetPtr(n_val2, 1);
49441 ret_val = xmlXPathNodeSetMerge(val1, val2);
49442 desret_xmlNodeSetPtr(ret_val);
49444 des_xmlNodeSetPtr(n_val1, val1, 0);
49445 des_xmlNodeSetPtr(n_val2, val2, 1);
49446 xmlResetLastError();
49447 if (mem_base != xmlMemBlocks()) {
49448 printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49449 xmlMemBlocks() - mem_base);
49451 printf(" %d", n_val1);
49452 printf(" %d", n_val2);
49465 test_xmlXPathNodeSetRemove(void) {
49468 #if defined(LIBXML_XPATH_ENABLED)
49470 xmlNodeSetPtr cur; /* the initial node set */
49472 int val; /* the index to remove */
49475 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49476 for (n_val = 0;n_val < gen_nb_int;n_val++) {
49477 mem_base = xmlMemBlocks();
49478 cur = gen_xmlNodeSetPtr(n_cur, 0);
49479 val = gen_int(n_val, 1);
49481 xmlXPathNodeSetRemove(cur, val);
49483 des_xmlNodeSetPtr(n_cur, cur, 0);
49484 des_int(n_val, val, 1);
49485 xmlResetLastError();
49486 if (mem_base != xmlMemBlocks()) {
49487 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49488 xmlMemBlocks() - mem_base);
49490 printf(" %d", n_cur);
49491 printf(" %d", n_val);
49504 test_xmlXPathNodeSetSort(void) {
49507 #if defined(LIBXML_XPATH_ENABLED)
49509 xmlNodeSetPtr set; /* the node set */
49512 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49513 mem_base = xmlMemBlocks();
49514 set = gen_xmlNodeSetPtr(n_set, 0);
49516 xmlXPathNodeSetSort(set);
49518 des_xmlNodeSetPtr(n_set, set, 0);
49519 xmlResetLastError();
49520 if (mem_base != xmlMemBlocks()) {
49521 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49522 xmlMemBlocks() - mem_base);
49524 printf(" %d", n_set);
49536 test_xmlXPathNodeTrailing(void) {
49539 #if defined(LIBXML_XPATH_ENABLED)
49541 xmlNodeSetPtr ret_val;
49542 xmlNodeSetPtr nodes; /* a node-set */
49544 xmlNodePtr node; /* a node */
49547 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49548 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49549 mem_base = xmlMemBlocks();
49550 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49551 node = gen_xmlNodePtr(n_node, 1);
49553 ret_val = xmlXPathNodeTrailing(nodes, node);
49554 desret_xmlNodeSetPtr(ret_val);
49556 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49557 des_xmlNodePtr(n_node, node, 1);
49558 xmlResetLastError();
49559 if (mem_base != xmlMemBlocks()) {
49560 printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49561 xmlMemBlocks() - mem_base);
49563 printf(" %d", n_nodes);
49564 printf(" %d", n_node);
49577 test_xmlXPathNodeTrailingSorted(void) {
49580 #if defined(LIBXML_XPATH_ENABLED)
49582 xmlNodeSetPtr ret_val;
49583 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49585 xmlNodePtr node; /* a node */
49588 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49589 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49590 mem_base = xmlMemBlocks();
49591 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49592 node = gen_xmlNodePtr(n_node, 1);
49594 ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49595 desret_xmlNodeSetPtr(ret_val);
49597 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49598 des_xmlNodePtr(n_node, node, 1);
49599 xmlResetLastError();
49600 if (mem_base != xmlMemBlocks()) {
49601 printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49602 xmlMemBlocks() - mem_base);
49604 printf(" %d", n_nodes);
49605 printf(" %d", n_node);
49618 test_xmlXPathNormalizeFunction(void) {
49621 #if defined(LIBXML_XPATH_ENABLED)
49623 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49625 int nargs; /* the number of arguments */
49628 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49629 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49630 mem_base = xmlMemBlocks();
49631 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49632 nargs = gen_int(n_nargs, 1);
49634 xmlXPathNormalizeFunction(ctxt, nargs);
49636 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49637 des_int(n_nargs, nargs, 1);
49638 xmlResetLastError();
49639 if (mem_base != xmlMemBlocks()) {
49640 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49641 xmlMemBlocks() - mem_base);
49643 printf(" %d", n_ctxt);
49644 printf(" %d", n_nargs);
49657 test_xmlXPathNotEqualValues(void) {
49660 #if defined(LIBXML_XPATH_ENABLED)
49663 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49666 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49667 mem_base = xmlMemBlocks();
49668 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49670 ret_val = xmlXPathNotEqualValues(ctxt);
49671 desret_int(ret_val);
49673 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49674 xmlResetLastError();
49675 if (mem_base != xmlMemBlocks()) {
49676 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49677 xmlMemBlocks() - mem_base);
49679 printf(" %d", n_ctxt);
49691 test_xmlXPathNotFunction(void) {
49694 #if defined(LIBXML_XPATH_ENABLED)
49696 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49698 int nargs; /* the number of arguments */
49701 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49702 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49703 mem_base = xmlMemBlocks();
49704 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49705 nargs = gen_int(n_nargs, 1);
49707 xmlXPathNotFunction(ctxt, nargs);
49709 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49710 des_int(n_nargs, nargs, 1);
49711 xmlResetLastError();
49712 if (mem_base != xmlMemBlocks()) {
49713 printf("Leak of %d blocks found in xmlXPathNotFunction",
49714 xmlMemBlocks() - mem_base);
49716 printf(" %d", n_ctxt);
49717 printf(" %d", n_nargs);
49730 test_xmlXPathNsLookup(void) {
49733 #if defined(LIBXML_XPATH_ENABLED)
49735 const xmlChar * ret_val;
49736 xmlXPathContextPtr ctxt; /* the XPath context */
49738 xmlChar * prefix; /* the namespace prefix value */
49741 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49742 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49743 mem_base = xmlMemBlocks();
49744 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49745 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49747 ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49748 desret_const_xmlChar_ptr(ret_val);
49750 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49751 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49752 xmlResetLastError();
49753 if (mem_base != xmlMemBlocks()) {
49754 printf("Leak of %d blocks found in xmlXPathNsLookup",
49755 xmlMemBlocks() - mem_base);
49757 printf(" %d", n_ctxt);
49758 printf(" %d", n_prefix);
49771 test_xmlXPathNumberFunction(void) {
49774 #if defined(LIBXML_XPATH_ENABLED)
49776 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49778 int nargs; /* the number of arguments */
49781 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49782 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49783 mem_base = xmlMemBlocks();
49784 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49785 nargs = gen_int(n_nargs, 1);
49787 xmlXPathNumberFunction(ctxt, nargs);
49789 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49790 des_int(n_nargs, nargs, 1);
49791 xmlResetLastError();
49792 if (mem_base != xmlMemBlocks()) {
49793 printf("Leak of %d blocks found in xmlXPathNumberFunction",
49794 xmlMemBlocks() - mem_base);
49796 printf(" %d", n_ctxt);
49797 printf(" %d", n_nargs);
49810 test_xmlXPathParseNCName(void) {
49813 #if defined(LIBXML_XPATH_ENABLED)
49816 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49819 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49820 mem_base = xmlMemBlocks();
49821 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49823 ret_val = xmlXPathParseNCName(ctxt);
49824 desret_xmlChar_ptr(ret_val);
49826 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49827 xmlResetLastError();
49828 if (mem_base != xmlMemBlocks()) {
49829 printf("Leak of %d blocks found in xmlXPathParseNCName",
49830 xmlMemBlocks() - mem_base);
49832 printf(" %d", n_ctxt);
49844 test_xmlXPathParseName(void) {
49847 #if defined(LIBXML_XPATH_ENABLED)
49850 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49853 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49854 mem_base = xmlMemBlocks();
49855 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49857 ret_val = xmlXPathParseName(ctxt);
49858 desret_xmlChar_ptr(ret_val);
49860 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49861 xmlResetLastError();
49862 if (mem_base != xmlMemBlocks()) {
49863 printf("Leak of %d blocks found in xmlXPathParseName",
49864 xmlMemBlocks() - mem_base);
49866 printf(" %d", n_ctxt);
49878 test_xmlXPathPopBoolean(void) {
49881 #if defined(LIBXML_XPATH_ENABLED)
49884 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49887 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49888 mem_base = xmlMemBlocks();
49889 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49891 ret_val = xmlXPathPopBoolean(ctxt);
49892 desret_int(ret_val);
49894 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49895 xmlResetLastError();
49896 if (mem_base != xmlMemBlocks()) {
49897 printf("Leak of %d blocks found in xmlXPathPopBoolean",
49898 xmlMemBlocks() - mem_base);
49900 printf(" %d", n_ctxt);
49912 test_xmlXPathPopExternal(void) {
49915 #if defined(LIBXML_XPATH_ENABLED)
49918 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49921 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49922 mem_base = xmlMemBlocks();
49923 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49925 ret_val = xmlXPathPopExternal(ctxt);
49926 desret_void_ptr(ret_val);
49928 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49929 xmlResetLastError();
49930 if (mem_base != xmlMemBlocks()) {
49931 printf("Leak of %d blocks found in xmlXPathPopExternal",
49932 xmlMemBlocks() - mem_base);
49934 printf(" %d", n_ctxt);
49946 test_xmlXPathPopNodeSet(void) {
49949 #if defined(LIBXML_XPATH_ENABLED)
49951 xmlNodeSetPtr ret_val;
49952 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49955 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49956 mem_base = xmlMemBlocks();
49957 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49959 ret_val = xmlXPathPopNodeSet(ctxt);
49960 desret_xmlNodeSetPtr(ret_val);
49962 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49963 xmlResetLastError();
49964 if (mem_base != xmlMemBlocks()) {
49965 printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49966 xmlMemBlocks() - mem_base);
49968 printf(" %d", n_ctxt);
49980 test_xmlXPathPopNumber(void) {
49983 #if defined(LIBXML_XPATH_ENABLED)
49986 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49989 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49990 mem_base = xmlMemBlocks();
49991 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49993 ret_val = xmlXPathPopNumber(ctxt);
49994 desret_double(ret_val);
49996 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49997 xmlResetLastError();
49998 if (mem_base != xmlMemBlocks()) {
49999 printf("Leak of %d blocks found in xmlXPathPopNumber",
50000 xmlMemBlocks() - mem_base);
50002 printf(" %d", n_ctxt);
50014 test_xmlXPathPopString(void) {
50017 #if defined(LIBXML_XPATH_ENABLED)
50020 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50023 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50024 mem_base = xmlMemBlocks();
50025 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50027 ret_val = xmlXPathPopString(ctxt);
50028 desret_xmlChar_ptr(ret_val);
50030 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50031 xmlResetLastError();
50032 if (mem_base != xmlMemBlocks()) {
50033 printf("Leak of %d blocks found in xmlXPathPopString",
50034 xmlMemBlocks() - mem_base);
50036 printf(" %d", n_ctxt);
50048 test_xmlXPathPositionFunction(void) {
50051 #if defined(LIBXML_XPATH_ENABLED)
50053 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50055 int nargs; /* the number of arguments */
50058 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50059 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50060 mem_base = xmlMemBlocks();
50061 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50062 nargs = gen_int(n_nargs, 1);
50064 xmlXPathPositionFunction(ctxt, nargs);
50066 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50067 des_int(n_nargs, nargs, 1);
50068 xmlResetLastError();
50069 if (mem_base != xmlMemBlocks()) {
50070 printf("Leak of %d blocks found in xmlXPathPositionFunction",
50071 xmlMemBlocks() - mem_base);
50073 printf(" %d", n_ctxt);
50074 printf(" %d", n_nargs);
50087 test_xmlXPathRegisterAllFunctions(void) {
50090 #if defined(LIBXML_XPATH_ENABLED)
50092 xmlXPathContextPtr ctxt; /* the XPath context */
50095 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50096 mem_base = xmlMemBlocks();
50097 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50099 xmlXPathRegisterAllFunctions(ctxt);
50101 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50102 xmlResetLastError();
50103 if (mem_base != xmlMemBlocks()) {
50104 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50105 xmlMemBlocks() - mem_base);
50107 printf(" %d", n_ctxt);
50119 test_xmlXPathRegisterFunc(void) {
50123 /* missing type support */
50129 test_xmlXPathRegisterFuncLookup(void) {
50133 /* missing type support */
50139 test_xmlXPathRegisterFuncNS(void) {
50143 /* missing type support */
50149 test_xmlXPathRegisterNs(void) {
50152 #if defined(LIBXML_XPATH_ENABLED)
50155 xmlXPathContextPtr ctxt; /* the XPath context */
50157 xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50159 xmlChar * ns_uri; /* the namespace name */
50162 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50163 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50164 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50165 mem_base = xmlMemBlocks();
50166 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50167 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50168 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50170 ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50171 desret_int(ret_val);
50173 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50174 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50175 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50176 xmlResetLastError();
50177 if (mem_base != xmlMemBlocks()) {
50178 printf("Leak of %d blocks found in xmlXPathRegisterNs",
50179 xmlMemBlocks() - mem_base);
50181 printf(" %d", n_ctxt);
50182 printf(" %d", n_prefix);
50183 printf(" %d", n_ns_uri);
50197 test_xmlXPathRegisterVariable(void) {
50200 #if defined(LIBXML_XPATH_ENABLED)
50203 xmlXPathContextPtr ctxt; /* the XPath context */
50205 xmlChar * name; /* the variable name */
50207 xmlXPathObjectPtr value; /* the variable value or NULL */
50210 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50211 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50212 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50213 mem_base = xmlMemBlocks();
50214 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50215 name = gen_const_xmlChar_ptr(n_name, 1);
50216 value = gen_xmlXPathObjectPtr(n_value, 2);
50218 ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50219 desret_int(ret_val);
50221 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50222 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50223 des_xmlXPathObjectPtr(n_value, value, 2);
50224 xmlResetLastError();
50225 if (mem_base != xmlMemBlocks()) {
50226 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50227 xmlMemBlocks() - mem_base);
50229 printf(" %d", n_ctxt);
50230 printf(" %d", n_name);
50231 printf(" %d", n_value);
50245 test_xmlXPathRegisterVariableLookup(void) {
50249 /* missing type support */
50255 test_xmlXPathRegisterVariableNS(void) {
50258 #if defined(LIBXML_XPATH_ENABLED)
50261 xmlXPathContextPtr ctxt; /* the XPath context */
50263 xmlChar * name; /* the variable name */
50265 xmlChar * ns_uri; /* the variable namespace URI */
50267 xmlXPathObjectPtr value; /* the variable value or NULL */
50270 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50271 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50272 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50273 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50274 mem_base = xmlMemBlocks();
50275 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50276 name = gen_const_xmlChar_ptr(n_name, 1);
50277 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50278 value = gen_xmlXPathObjectPtr(n_value, 3);
50280 ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50281 desret_int(ret_val);
50283 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50284 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50285 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50286 des_xmlXPathObjectPtr(n_value, value, 3);
50287 xmlResetLastError();
50288 if (mem_base != xmlMemBlocks()) {
50289 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50290 xmlMemBlocks() - mem_base);
50292 printf(" %d", n_ctxt);
50293 printf(" %d", n_name);
50294 printf(" %d", n_ns_uri);
50295 printf(" %d", n_value);
50310 test_xmlXPathRegisteredFuncsCleanup(void) {
50313 #if defined(LIBXML_XPATH_ENABLED)
50315 xmlXPathContextPtr ctxt; /* the XPath context */
50318 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50319 mem_base = xmlMemBlocks();
50320 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50322 xmlXPathRegisteredFuncsCleanup(ctxt);
50324 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50325 xmlResetLastError();
50326 if (mem_base != xmlMemBlocks()) {
50327 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50328 xmlMemBlocks() - mem_base);
50330 printf(" %d", n_ctxt);
50342 test_xmlXPathRegisteredNsCleanup(void) {
50345 #if defined(LIBXML_XPATH_ENABLED)
50347 xmlXPathContextPtr ctxt; /* the XPath context */
50350 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50351 mem_base = xmlMemBlocks();
50352 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50354 xmlXPathRegisteredNsCleanup(ctxt);
50356 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50357 xmlResetLastError();
50358 if (mem_base != xmlMemBlocks()) {
50359 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50360 xmlMemBlocks() - mem_base);
50362 printf(" %d", n_ctxt);
50374 test_xmlXPathRegisteredVariablesCleanup(void) {
50377 #if defined(LIBXML_XPATH_ENABLED)
50379 xmlXPathContextPtr ctxt; /* the XPath context */
50382 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50383 mem_base = xmlMemBlocks();
50384 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50386 xmlXPathRegisteredVariablesCleanup(ctxt);
50388 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50389 xmlResetLastError();
50390 if (mem_base != xmlMemBlocks()) {
50391 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50392 xmlMemBlocks() - mem_base);
50394 printf(" %d", n_ctxt);
50406 test_xmlXPathRoot(void) {
50409 #if defined(LIBXML_XPATH_ENABLED)
50411 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50414 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50415 mem_base = xmlMemBlocks();
50416 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50418 xmlXPathRoot(ctxt);
50420 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50421 xmlResetLastError();
50422 if (mem_base != xmlMemBlocks()) {
50423 printf("Leak of %d blocks found in xmlXPathRoot",
50424 xmlMemBlocks() - mem_base);
50426 printf(" %d", n_ctxt);
50438 test_xmlXPathRoundFunction(void) {
50441 #if defined(LIBXML_XPATH_ENABLED)
50443 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50445 int nargs; /* the number of arguments */
50448 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50449 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50450 mem_base = xmlMemBlocks();
50451 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50452 nargs = gen_int(n_nargs, 1);
50454 xmlXPathRoundFunction(ctxt, nargs);
50456 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50457 des_int(n_nargs, nargs, 1);
50458 xmlResetLastError();
50459 if (mem_base != xmlMemBlocks()) {
50460 printf("Leak of %d blocks found in xmlXPathRoundFunction",
50461 xmlMemBlocks() - mem_base);
50463 printf(" %d", n_ctxt);
50464 printf(" %d", n_nargs);
50477 test_xmlXPathStartsWithFunction(void) {
50480 #if defined(LIBXML_XPATH_ENABLED)
50482 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50484 int nargs; /* the number of arguments */
50487 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50488 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50489 mem_base = xmlMemBlocks();
50490 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50491 nargs = gen_int(n_nargs, 1);
50493 xmlXPathStartsWithFunction(ctxt, nargs);
50495 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50496 des_int(n_nargs, nargs, 1);
50497 xmlResetLastError();
50498 if (mem_base != xmlMemBlocks()) {
50499 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50500 xmlMemBlocks() - mem_base);
50502 printf(" %d", n_ctxt);
50503 printf(" %d", n_nargs);
50516 test_xmlXPathStringEvalNumber(void) {
50519 #if defined(LIBXML_XPATH_ENABLED)
50522 xmlChar * str; /* A string to scan */
50525 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50526 mem_base = xmlMemBlocks();
50527 str = gen_const_xmlChar_ptr(n_str, 0);
50529 ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50530 desret_double(ret_val);
50532 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50533 xmlResetLastError();
50534 if (mem_base != xmlMemBlocks()) {
50535 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50536 xmlMemBlocks() - mem_base);
50538 printf(" %d", n_str);
50550 test_xmlXPathStringFunction(void) {
50553 #if defined(LIBXML_XPATH_ENABLED)
50555 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50557 int nargs; /* the number of arguments */
50560 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50561 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50562 mem_base = xmlMemBlocks();
50563 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50564 nargs = gen_int(n_nargs, 1);
50566 xmlXPathStringFunction(ctxt, nargs);
50568 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50569 des_int(n_nargs, nargs, 1);
50570 xmlResetLastError();
50571 if (mem_base != xmlMemBlocks()) {
50572 printf("Leak of %d blocks found in xmlXPathStringFunction",
50573 xmlMemBlocks() - mem_base);
50575 printf(" %d", n_ctxt);
50576 printf(" %d", n_nargs);
50589 test_xmlXPathStringLengthFunction(void) {
50592 #if defined(LIBXML_XPATH_ENABLED)
50594 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50596 int nargs; /* the number of arguments */
50599 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50600 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50601 mem_base = xmlMemBlocks();
50602 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50603 nargs = gen_int(n_nargs, 1);
50605 xmlXPathStringLengthFunction(ctxt, nargs);
50607 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50608 des_int(n_nargs, nargs, 1);
50609 xmlResetLastError();
50610 if (mem_base != xmlMemBlocks()) {
50611 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50612 xmlMemBlocks() - mem_base);
50614 printf(" %d", n_ctxt);
50615 printf(" %d", n_nargs);
50628 test_xmlXPathSubValues(void) {
50631 #if defined(LIBXML_XPATH_ENABLED)
50633 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50636 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50637 mem_base = xmlMemBlocks();
50638 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50640 xmlXPathSubValues(ctxt);
50642 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50643 xmlResetLastError();
50644 if (mem_base != xmlMemBlocks()) {
50645 printf("Leak of %d blocks found in xmlXPathSubValues",
50646 xmlMemBlocks() - mem_base);
50648 printf(" %d", n_ctxt);
50660 test_xmlXPathSubstringAfterFunction(void) {
50663 #if defined(LIBXML_XPATH_ENABLED)
50665 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50667 int nargs; /* the number of arguments */
50670 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50671 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50672 mem_base = xmlMemBlocks();
50673 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50674 nargs = gen_int(n_nargs, 1);
50676 xmlXPathSubstringAfterFunction(ctxt, nargs);
50678 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50679 des_int(n_nargs, nargs, 1);
50680 xmlResetLastError();
50681 if (mem_base != xmlMemBlocks()) {
50682 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50683 xmlMemBlocks() - mem_base);
50685 printf(" %d", n_ctxt);
50686 printf(" %d", n_nargs);
50699 test_xmlXPathSubstringBeforeFunction(void) {
50702 #if defined(LIBXML_XPATH_ENABLED)
50704 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50706 int nargs; /* the number of arguments */
50709 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50710 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50711 mem_base = xmlMemBlocks();
50712 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50713 nargs = gen_int(n_nargs, 1);
50715 xmlXPathSubstringBeforeFunction(ctxt, nargs);
50717 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50718 des_int(n_nargs, nargs, 1);
50719 xmlResetLastError();
50720 if (mem_base != xmlMemBlocks()) {
50721 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50722 xmlMemBlocks() - mem_base);
50724 printf(" %d", n_ctxt);
50725 printf(" %d", n_nargs);
50738 test_xmlXPathSubstringFunction(void) {
50741 #if defined(LIBXML_XPATH_ENABLED)
50743 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50745 int nargs; /* the number of arguments */
50748 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50749 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50750 mem_base = xmlMemBlocks();
50751 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50752 nargs = gen_int(n_nargs, 1);
50754 xmlXPathSubstringFunction(ctxt, nargs);
50756 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50757 des_int(n_nargs, nargs, 1);
50758 xmlResetLastError();
50759 if (mem_base != xmlMemBlocks()) {
50760 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50761 xmlMemBlocks() - mem_base);
50763 printf(" %d", n_ctxt);
50764 printf(" %d", n_nargs);
50777 test_xmlXPathSumFunction(void) {
50780 #if defined(LIBXML_XPATH_ENABLED)
50782 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50784 int nargs; /* the number of arguments */
50787 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50788 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50789 mem_base = xmlMemBlocks();
50790 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50791 nargs = gen_int(n_nargs, 1);
50793 xmlXPathSumFunction(ctxt, nargs);
50795 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50796 des_int(n_nargs, nargs, 1);
50797 xmlResetLastError();
50798 if (mem_base != xmlMemBlocks()) {
50799 printf("Leak of %d blocks found in xmlXPathSumFunction",
50800 xmlMemBlocks() - mem_base);
50802 printf(" %d", n_ctxt);
50803 printf(" %d", n_nargs);
50816 test_xmlXPathTrailing(void) {
50819 #if defined(LIBXML_XPATH_ENABLED)
50821 xmlNodeSetPtr ret_val;
50822 xmlNodeSetPtr nodes1; /* a node-set */
50824 xmlNodeSetPtr nodes2; /* a node-set */
50827 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50828 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50829 mem_base = xmlMemBlocks();
50830 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50831 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50833 ret_val = xmlXPathTrailing(nodes1, nodes2);
50834 desret_xmlNodeSetPtr(ret_val);
50836 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50837 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50838 xmlResetLastError();
50839 if (mem_base != xmlMemBlocks()) {
50840 printf("Leak of %d blocks found in xmlXPathTrailing",
50841 xmlMemBlocks() - mem_base);
50843 printf(" %d", n_nodes1);
50844 printf(" %d", n_nodes2);
50857 test_xmlXPathTrailingSorted(void) {
50860 #if defined(LIBXML_XPATH_ENABLED)
50862 xmlNodeSetPtr ret_val;
50863 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50865 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50868 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50869 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50870 mem_base = xmlMemBlocks();
50871 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50872 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50874 ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50875 desret_xmlNodeSetPtr(ret_val);
50877 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50878 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50879 xmlResetLastError();
50880 if (mem_base != xmlMemBlocks()) {
50881 printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50882 xmlMemBlocks() - mem_base);
50884 printf(" %d", n_nodes1);
50885 printf(" %d", n_nodes2);
50898 test_xmlXPathTranslateFunction(void) {
50901 #if defined(LIBXML_XPATH_ENABLED)
50903 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50905 int nargs; /* the number of arguments */
50908 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50909 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50910 mem_base = xmlMemBlocks();
50911 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50912 nargs = gen_int(n_nargs, 1);
50914 xmlXPathTranslateFunction(ctxt, nargs);
50916 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50917 des_int(n_nargs, nargs, 1);
50918 xmlResetLastError();
50919 if (mem_base != xmlMemBlocks()) {
50920 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50921 xmlMemBlocks() - mem_base);
50923 printf(" %d", n_ctxt);
50924 printf(" %d", n_nargs);
50937 test_xmlXPathTrueFunction(void) {
50940 #if defined(LIBXML_XPATH_ENABLED)
50942 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50944 int nargs; /* the number of arguments */
50947 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50948 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50949 mem_base = xmlMemBlocks();
50950 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50951 nargs = gen_int(n_nargs, 1);
50953 xmlXPathTrueFunction(ctxt, nargs);
50955 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50956 des_int(n_nargs, nargs, 1);
50957 xmlResetLastError();
50958 if (mem_base != xmlMemBlocks()) {
50959 printf("Leak of %d blocks found in xmlXPathTrueFunction",
50960 xmlMemBlocks() - mem_base);
50962 printf(" %d", n_ctxt);
50963 printf(" %d", n_nargs);
50976 test_xmlXPathValueFlipSign(void) {
50979 #if defined(LIBXML_XPATH_ENABLED)
50981 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50984 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50985 mem_base = xmlMemBlocks();
50986 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50988 xmlXPathValueFlipSign(ctxt);
50990 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50991 xmlResetLastError();
50992 if (mem_base != xmlMemBlocks()) {
50993 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50994 xmlMemBlocks() - mem_base);
50996 printf(" %d", n_ctxt);
51008 test_xmlXPathVariableLookup(void) {
51011 #if defined(LIBXML_XPATH_ENABLED)
51013 xmlXPathObjectPtr ret_val;
51014 xmlXPathContextPtr ctxt; /* the XPath context */
51016 xmlChar * name; /* the variable name */
51019 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51020 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51021 mem_base = xmlMemBlocks();
51022 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51023 name = gen_const_xmlChar_ptr(n_name, 1);
51025 ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51026 desret_xmlXPathObjectPtr(ret_val);
51028 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51029 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51030 xmlResetLastError();
51031 if (mem_base != xmlMemBlocks()) {
51032 printf("Leak of %d blocks found in xmlXPathVariableLookup",
51033 xmlMemBlocks() - mem_base);
51035 printf(" %d", n_ctxt);
51036 printf(" %d", n_name);
51049 test_xmlXPathVariableLookupNS(void) {
51052 #if defined(LIBXML_XPATH_ENABLED)
51054 xmlXPathObjectPtr ret_val;
51055 xmlXPathContextPtr ctxt; /* the XPath context */
51057 xmlChar * name; /* the variable name */
51059 xmlChar * ns_uri; /* the variable namespace URI */
51062 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51063 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51064 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51065 mem_base = xmlMemBlocks();
51066 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51067 name = gen_const_xmlChar_ptr(n_name, 1);
51068 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51070 ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51071 desret_xmlXPathObjectPtr(ret_val);
51073 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51074 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51075 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51076 xmlResetLastError();
51077 if (mem_base != xmlMemBlocks()) {
51078 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51079 xmlMemBlocks() - mem_base);
51081 printf(" %d", n_ctxt);
51082 printf(" %d", n_name);
51083 printf(" %d", n_ns_uri);
51097 test_xmlXPathWrapCString(void) {
51100 #if defined(LIBXML_XPATH_ENABLED)
51102 xmlXPathObjectPtr ret_val;
51103 char * val; /* the char * value */
51106 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51107 mem_base = xmlMemBlocks();
51108 val = gen_char_ptr(n_val, 0);
51110 ret_val = xmlXPathWrapCString(val);
51111 desret_xmlXPathObjectPtr(ret_val);
51113 des_char_ptr(n_val, val, 0);
51114 xmlResetLastError();
51115 if (mem_base != xmlMemBlocks()) {
51116 printf("Leak of %d blocks found in xmlXPathWrapCString",
51117 xmlMemBlocks() - mem_base);
51119 printf(" %d", n_val);
51131 test_xmlXPathWrapExternal(void) {
51134 #if defined(LIBXML_XPATH_ENABLED)
51136 xmlXPathObjectPtr ret_val;
51137 void * val; /* the user data */
51140 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51141 mem_base = xmlMemBlocks();
51142 val = gen_void_ptr(n_val, 0);
51144 ret_val = xmlXPathWrapExternal(val);
51145 desret_xmlXPathObjectPtr(ret_val);
51147 des_void_ptr(n_val, val, 0);
51148 xmlResetLastError();
51149 if (mem_base != xmlMemBlocks()) {
51150 printf("Leak of %d blocks found in xmlXPathWrapExternal",
51151 xmlMemBlocks() - mem_base);
51153 printf(" %d", n_val);
51165 test_xmlXPathWrapNodeSet(void) {
51168 #if defined(LIBXML_XPATH_ENABLED)
51170 xmlXPathObjectPtr ret_val;
51171 xmlNodeSetPtr val; /* the NodePtr value */
51174 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51175 mem_base = xmlMemBlocks();
51176 val = gen_xmlNodeSetPtr(n_val, 0);
51178 ret_val = xmlXPathWrapNodeSet(val);
51179 desret_xmlXPathObjectPtr(ret_val);
51181 des_xmlNodeSetPtr(n_val, val, 0);
51182 xmlResetLastError();
51183 if (mem_base != xmlMemBlocks()) {
51184 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51185 xmlMemBlocks() - mem_base);
51187 printf(" %d", n_val);
51199 test_xmlXPatherror(void) {
51202 #if defined(LIBXML_XPATH_ENABLED)
51204 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51206 const char * file; /* the file name */
51208 int line; /* the line number */
51210 int no; /* the error number */
51213 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51214 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51215 for (n_line = 0;n_line < gen_nb_int;n_line++) {
51216 for (n_no = 0;n_no < gen_nb_int;n_no++) {
51217 mem_base = xmlMemBlocks();
51218 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51219 file = gen_filepath(n_file, 1);
51220 line = gen_int(n_line, 2);
51221 no = gen_int(n_no, 3);
51223 xmlXPatherror(ctxt, file, line, no);
51225 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51226 des_filepath(n_file, file, 1);
51227 des_int(n_line, line, 2);
51228 des_int(n_no, no, 3);
51229 xmlResetLastError();
51230 if (mem_base != xmlMemBlocks()) {
51231 printf("Leak of %d blocks found in xmlXPatherror",
51232 xmlMemBlocks() - mem_base);
51234 printf(" %d", n_ctxt);
51235 printf(" %d", n_file);
51236 printf(" %d", n_line);
51237 printf(" %d", n_no);
51251 test_xpathInternals(void) {
51254 if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51255 test_ret += test_valuePop();
51256 test_ret += test_valuePush();
51257 test_ret += test_xmlXPathAddValues();
51258 test_ret += test_xmlXPathBooleanFunction();
51259 test_ret += test_xmlXPathCeilingFunction();
51260 test_ret += test_xmlXPathCompareValues();
51261 test_ret += test_xmlXPathConcatFunction();
51262 test_ret += test_xmlXPathContainsFunction();
51263 test_ret += test_xmlXPathCountFunction();
51264 test_ret += test_xmlXPathDebugDumpCompExpr();
51265 test_ret += test_xmlXPathDebugDumpObject();
51266 test_ret += test_xmlXPathDifference();
51267 test_ret += test_xmlXPathDistinct();
51268 test_ret += test_xmlXPathDistinctSorted();
51269 test_ret += test_xmlXPathDivValues();
51270 test_ret += test_xmlXPathEqualValues();
51271 test_ret += test_xmlXPathErr();
51272 test_ret += test_xmlXPathEvalExpr();
51273 test_ret += test_xmlXPathEvaluatePredicateResult();
51274 test_ret += test_xmlXPathFalseFunction();
51275 test_ret += test_xmlXPathFloorFunction();
51276 test_ret += test_xmlXPathFunctionLookup();
51277 test_ret += test_xmlXPathFunctionLookupNS();
51278 test_ret += test_xmlXPathHasSameNodes();
51279 test_ret += test_xmlXPathIdFunction();
51280 test_ret += test_xmlXPathIntersection();
51281 test_ret += test_xmlXPathIsNodeType();
51282 test_ret += test_xmlXPathLangFunction();
51283 test_ret += test_xmlXPathLastFunction();
51284 test_ret += test_xmlXPathLeading();
51285 test_ret += test_xmlXPathLeadingSorted();
51286 test_ret += test_xmlXPathLocalNameFunction();
51287 test_ret += test_xmlXPathModValues();
51288 test_ret += test_xmlXPathMultValues();
51289 test_ret += test_xmlXPathNamespaceURIFunction();
51290 test_ret += test_xmlXPathNewBoolean();
51291 test_ret += test_xmlXPathNewCString();
51292 test_ret += test_xmlXPathNewFloat();
51293 test_ret += test_xmlXPathNewNodeSet();
51294 test_ret += test_xmlXPathNewNodeSetList();
51295 test_ret += test_xmlXPathNewParserContext();
51296 test_ret += test_xmlXPathNewString();
51297 test_ret += test_xmlXPathNextAncestor();
51298 test_ret += test_xmlXPathNextAncestorOrSelf();
51299 test_ret += test_xmlXPathNextAttribute();
51300 test_ret += test_xmlXPathNextChild();
51301 test_ret += test_xmlXPathNextDescendant();
51302 test_ret += test_xmlXPathNextDescendantOrSelf();
51303 test_ret += test_xmlXPathNextFollowing();
51304 test_ret += test_xmlXPathNextFollowingSibling();
51305 test_ret += test_xmlXPathNextNamespace();
51306 test_ret += test_xmlXPathNextParent();
51307 test_ret += test_xmlXPathNextPreceding();
51308 test_ret += test_xmlXPathNextPrecedingSibling();
51309 test_ret += test_xmlXPathNextSelf();
51310 test_ret += test_xmlXPathNodeLeading();
51311 test_ret += test_xmlXPathNodeLeadingSorted();
51312 test_ret += test_xmlXPathNodeSetAdd();
51313 test_ret += test_xmlXPathNodeSetAddNs();
51314 test_ret += test_xmlXPathNodeSetAddUnique();
51315 test_ret += test_xmlXPathNodeSetContains();
51316 test_ret += test_xmlXPathNodeSetDel();
51317 test_ret += test_xmlXPathNodeSetMerge();
51318 test_ret += test_xmlXPathNodeSetRemove();
51319 test_ret += test_xmlXPathNodeSetSort();
51320 test_ret += test_xmlXPathNodeTrailing();
51321 test_ret += test_xmlXPathNodeTrailingSorted();
51322 test_ret += test_xmlXPathNormalizeFunction();
51323 test_ret += test_xmlXPathNotEqualValues();
51324 test_ret += test_xmlXPathNotFunction();
51325 test_ret += test_xmlXPathNsLookup();
51326 test_ret += test_xmlXPathNumberFunction();
51327 test_ret += test_xmlXPathParseNCName();
51328 test_ret += test_xmlXPathParseName();
51329 test_ret += test_xmlXPathPopBoolean();
51330 test_ret += test_xmlXPathPopExternal();
51331 test_ret += test_xmlXPathPopNodeSet();
51332 test_ret += test_xmlXPathPopNumber();
51333 test_ret += test_xmlXPathPopString();
51334 test_ret += test_xmlXPathPositionFunction();
51335 test_ret += test_xmlXPathRegisterAllFunctions();
51336 test_ret += test_xmlXPathRegisterFunc();
51337 test_ret += test_xmlXPathRegisterFuncLookup();
51338 test_ret += test_xmlXPathRegisterFuncNS();
51339 test_ret += test_xmlXPathRegisterNs();
51340 test_ret += test_xmlXPathRegisterVariable();
51341 test_ret += test_xmlXPathRegisterVariableLookup();
51342 test_ret += test_xmlXPathRegisterVariableNS();
51343 test_ret += test_xmlXPathRegisteredFuncsCleanup();
51344 test_ret += test_xmlXPathRegisteredNsCleanup();
51345 test_ret += test_xmlXPathRegisteredVariablesCleanup();
51346 test_ret += test_xmlXPathRoot();
51347 test_ret += test_xmlXPathRoundFunction();
51348 test_ret += test_xmlXPathStartsWithFunction();
51349 test_ret += test_xmlXPathStringEvalNumber();
51350 test_ret += test_xmlXPathStringFunction();
51351 test_ret += test_xmlXPathStringLengthFunction();
51352 test_ret += test_xmlXPathSubValues();
51353 test_ret += test_xmlXPathSubstringAfterFunction();
51354 test_ret += test_xmlXPathSubstringBeforeFunction();
51355 test_ret += test_xmlXPathSubstringFunction();
51356 test_ret += test_xmlXPathSumFunction();
51357 test_ret += test_xmlXPathTrailing();
51358 test_ret += test_xmlXPathTrailingSorted();
51359 test_ret += test_xmlXPathTranslateFunction();
51360 test_ret += test_xmlXPathTrueFunction();
51361 test_ret += test_xmlXPathValueFlipSign();
51362 test_ret += test_xmlXPathVariableLookup();
51363 test_ret += test_xmlXPathVariableLookupNS();
51364 test_ret += test_xmlXPathWrapCString();
51365 test_ret += test_xmlXPathWrapExternal();
51366 test_ret += test_xmlXPathWrapNodeSet();
51367 test_ret += test_xmlXPatherror();
51370 printf("Module xpathInternals: %d errors\n", test_ret);
51375 test_xmlXPtrBuildNodeList(void) {
51378 #if defined(LIBXML_XPTR_ENABLED)
51380 xmlNodePtr ret_val;
51381 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51384 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51385 mem_base = xmlMemBlocks();
51386 obj = gen_xmlXPathObjectPtr(n_obj, 0);
51388 ret_val = xmlXPtrBuildNodeList(obj);
51389 desret_xmlNodePtr(ret_val);
51391 des_xmlXPathObjectPtr(n_obj, obj, 0);
51392 xmlResetLastError();
51393 if (mem_base != xmlMemBlocks()) {
51394 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51395 xmlMemBlocks() - mem_base);
51397 printf(" %d", n_obj);
51409 test_xmlXPtrEval(void) {
51412 #if defined(LIBXML_XPTR_ENABLED)
51414 xmlXPathObjectPtr ret_val;
51415 xmlChar * str; /* the XPointer expression */
51417 xmlXPathContextPtr ctx; /* the XPointer context */
51420 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51421 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51422 mem_base = xmlMemBlocks();
51423 str = gen_const_xmlChar_ptr(n_str, 0);
51424 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51426 ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51427 desret_xmlXPathObjectPtr(ret_val);
51429 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51430 des_xmlXPathContextPtr(n_ctx, ctx, 1);
51431 xmlResetLastError();
51432 if (mem_base != xmlMemBlocks()) {
51433 printf("Leak of %d blocks found in xmlXPtrEval",
51434 xmlMemBlocks() - mem_base);
51436 printf(" %d", n_str);
51437 printf(" %d", n_ctx);
51450 test_xmlXPtrEvalRangePredicate(void) {
51453 #if defined(LIBXML_XPTR_ENABLED)
51455 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51458 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51459 mem_base = xmlMemBlocks();
51460 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51462 xmlXPtrEvalRangePredicate(ctxt);
51464 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51465 xmlResetLastError();
51466 if (mem_base != xmlMemBlocks()) {
51467 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51468 xmlMemBlocks() - mem_base);
51470 printf(" %d", n_ctxt);
51480 #ifdef LIBXML_XPTR_ENABLED
51482 #define gen_nb_xmlLocationSetPtr 1
51483 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51486 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51492 test_xmlXPtrLocationSetAdd(void) {
51495 #if defined(LIBXML_XPTR_ENABLED)
51497 xmlLocationSetPtr cur; /* the initial range set */
51499 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51502 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51503 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51504 mem_base = xmlMemBlocks();
51505 cur = gen_xmlLocationSetPtr(n_cur, 0);
51506 val = gen_xmlXPathObjectPtr(n_val, 1);
51508 xmlXPtrLocationSetAdd(cur, val);
51510 des_xmlLocationSetPtr(n_cur, cur, 0);
51511 des_xmlXPathObjectPtr(n_val, val, 1);
51512 xmlResetLastError();
51513 if (mem_base != xmlMemBlocks()) {
51514 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51515 xmlMemBlocks() - mem_base);
51517 printf(" %d", n_cur);
51518 printf(" %d", n_val);
51531 test_xmlXPtrLocationSetCreate(void) {
51535 /* missing type support */
51541 test_xmlXPtrLocationSetDel(void) {
51544 #if defined(LIBXML_XPTR_ENABLED)
51546 xmlLocationSetPtr cur; /* the initial range set */
51548 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51551 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51552 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51553 mem_base = xmlMemBlocks();
51554 cur = gen_xmlLocationSetPtr(n_cur, 0);
51555 val = gen_xmlXPathObjectPtr(n_val, 1);
51557 xmlXPtrLocationSetDel(cur, val);
51559 des_xmlLocationSetPtr(n_cur, cur, 0);
51560 des_xmlXPathObjectPtr(n_val, val, 1);
51561 xmlResetLastError();
51562 if (mem_base != xmlMemBlocks()) {
51563 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51564 xmlMemBlocks() - mem_base);
51566 printf(" %d", n_cur);
51567 printf(" %d", n_val);
51580 test_xmlXPtrLocationSetMerge(void) {
51584 /* missing type support */
51590 test_xmlXPtrLocationSetRemove(void) {
51593 #if defined(LIBXML_XPTR_ENABLED)
51595 xmlLocationSetPtr cur; /* the initial range set */
51597 int val; /* the index to remove */
51600 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51601 for (n_val = 0;n_val < gen_nb_int;n_val++) {
51602 mem_base = xmlMemBlocks();
51603 cur = gen_xmlLocationSetPtr(n_cur, 0);
51604 val = gen_int(n_val, 1);
51606 xmlXPtrLocationSetRemove(cur, val);
51608 des_xmlLocationSetPtr(n_cur, cur, 0);
51609 des_int(n_val, val, 1);
51610 xmlResetLastError();
51611 if (mem_base != xmlMemBlocks()) {
51612 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51613 xmlMemBlocks() - mem_base);
51615 printf(" %d", n_cur);
51616 printf(" %d", n_val);
51629 test_xmlXPtrNewCollapsedRange(void) {
51632 #if defined(LIBXML_XPTR_ENABLED)
51634 xmlXPathObjectPtr ret_val;
51635 xmlNodePtr start; /* the starting and ending node */
51638 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51639 mem_base = xmlMemBlocks();
51640 start = gen_xmlNodePtr(n_start, 0);
51642 ret_val = xmlXPtrNewCollapsedRange(start);
51643 desret_xmlXPathObjectPtr(ret_val);
51645 des_xmlNodePtr(n_start, start, 0);
51646 xmlResetLastError();
51647 if (mem_base != xmlMemBlocks()) {
51648 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51649 xmlMemBlocks() - mem_base);
51651 printf(" %d", n_start);
51663 test_xmlXPtrNewContext(void) {
51667 /* missing type support */
51673 test_xmlXPtrNewLocationSetNodeSet(void) {
51676 #if defined(LIBXML_XPTR_ENABLED)
51678 xmlXPathObjectPtr ret_val;
51679 xmlNodeSetPtr set; /* a node set */
51682 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51683 mem_base = xmlMemBlocks();
51684 set = gen_xmlNodeSetPtr(n_set, 0);
51686 ret_val = xmlXPtrNewLocationSetNodeSet(set);
51687 desret_xmlXPathObjectPtr(ret_val);
51689 des_xmlNodeSetPtr(n_set, set, 0);
51690 xmlResetLastError();
51691 if (mem_base != xmlMemBlocks()) {
51692 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51693 xmlMemBlocks() - mem_base);
51695 printf(" %d", n_set);
51707 test_xmlXPtrNewLocationSetNodes(void) {
51710 #if defined(LIBXML_XPTR_ENABLED)
51712 xmlXPathObjectPtr ret_val;
51713 xmlNodePtr start; /* the start NodePtr value */
51715 xmlNodePtr end; /* the end NodePtr value or NULL */
51718 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51719 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51720 mem_base = xmlMemBlocks();
51721 start = gen_xmlNodePtr(n_start, 0);
51722 end = gen_xmlNodePtr(n_end, 1);
51724 ret_val = xmlXPtrNewLocationSetNodes(start, end);
51725 desret_xmlXPathObjectPtr(ret_val);
51727 des_xmlNodePtr(n_start, start, 0);
51728 des_xmlNodePtr(n_end, end, 1);
51729 xmlResetLastError();
51730 if (mem_base != xmlMemBlocks()) {
51731 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51732 xmlMemBlocks() - mem_base);
51734 printf(" %d", n_start);
51735 printf(" %d", n_end);
51748 test_xmlXPtrNewRange(void) {
51751 #if defined(LIBXML_XPTR_ENABLED)
51753 xmlXPathObjectPtr ret_val;
51754 xmlNodePtr start; /* the starting node */
51756 int startindex; /* the start index */
51758 xmlNodePtr end; /* the ending point */
51760 int endindex; /* the ending index */
51763 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51764 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51765 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51766 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51767 mem_base = xmlMemBlocks();
51768 start = gen_xmlNodePtr(n_start, 0);
51769 startindex = gen_int(n_startindex, 1);
51770 end = gen_xmlNodePtr(n_end, 2);
51771 endindex = gen_int(n_endindex, 3);
51773 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51774 desret_xmlXPathObjectPtr(ret_val);
51776 des_xmlNodePtr(n_start, start, 0);
51777 des_int(n_startindex, startindex, 1);
51778 des_xmlNodePtr(n_end, end, 2);
51779 des_int(n_endindex, endindex, 3);
51780 xmlResetLastError();
51781 if (mem_base != xmlMemBlocks()) {
51782 printf("Leak of %d blocks found in xmlXPtrNewRange",
51783 xmlMemBlocks() - mem_base);
51785 printf(" %d", n_start);
51786 printf(" %d", n_startindex);
51787 printf(" %d", n_end);
51788 printf(" %d", n_endindex);
51803 test_xmlXPtrNewRangeNodeObject(void) {
51806 #if defined(LIBXML_XPTR_ENABLED)
51808 xmlXPathObjectPtr ret_val;
51809 xmlNodePtr start; /* the starting node */
51811 xmlXPathObjectPtr end; /* the ending object */
51814 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51815 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51816 mem_base = xmlMemBlocks();
51817 start = gen_xmlNodePtr(n_start, 0);
51818 end = gen_xmlXPathObjectPtr(n_end, 1);
51820 ret_val = xmlXPtrNewRangeNodeObject(start, end);
51821 desret_xmlXPathObjectPtr(ret_val);
51823 des_xmlNodePtr(n_start, start, 0);
51824 des_xmlXPathObjectPtr(n_end, end, 1);
51825 xmlResetLastError();
51826 if (mem_base != xmlMemBlocks()) {
51827 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51828 xmlMemBlocks() - mem_base);
51830 printf(" %d", n_start);
51831 printf(" %d", n_end);
51844 test_xmlXPtrNewRangeNodePoint(void) {
51847 #if defined(LIBXML_XPTR_ENABLED)
51849 xmlXPathObjectPtr ret_val;
51850 xmlNodePtr start; /* the starting node */
51852 xmlXPathObjectPtr end; /* the ending point */
51855 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51856 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51857 mem_base = xmlMemBlocks();
51858 start = gen_xmlNodePtr(n_start, 0);
51859 end = gen_xmlXPathObjectPtr(n_end, 1);
51861 ret_val = xmlXPtrNewRangeNodePoint(start, end);
51862 desret_xmlXPathObjectPtr(ret_val);
51864 des_xmlNodePtr(n_start, start, 0);
51865 des_xmlXPathObjectPtr(n_end, end, 1);
51866 xmlResetLastError();
51867 if (mem_base != xmlMemBlocks()) {
51868 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51869 xmlMemBlocks() - mem_base);
51871 printf(" %d", n_start);
51872 printf(" %d", n_end);
51885 test_xmlXPtrNewRangeNodes(void) {
51888 #if defined(LIBXML_XPTR_ENABLED)
51890 xmlXPathObjectPtr ret_val;
51891 xmlNodePtr start; /* the starting node */
51893 xmlNodePtr end; /* the ending node */
51896 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51897 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51898 mem_base = xmlMemBlocks();
51899 start = gen_xmlNodePtr(n_start, 0);
51900 end = gen_xmlNodePtr(n_end, 1);
51902 ret_val = xmlXPtrNewRangeNodes(start, end);
51903 desret_xmlXPathObjectPtr(ret_val);
51905 des_xmlNodePtr(n_start, start, 0);
51906 des_xmlNodePtr(n_end, end, 1);
51907 xmlResetLastError();
51908 if (mem_base != xmlMemBlocks()) {
51909 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51910 xmlMemBlocks() - mem_base);
51912 printf(" %d", n_start);
51913 printf(" %d", n_end);
51926 test_xmlXPtrNewRangePointNode(void) {
51929 #if defined(LIBXML_XPTR_ENABLED)
51931 xmlXPathObjectPtr ret_val;
51932 xmlXPathObjectPtr start; /* the starting point */
51934 xmlNodePtr end; /* the ending node */
51937 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51938 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51939 mem_base = xmlMemBlocks();
51940 start = gen_xmlXPathObjectPtr(n_start, 0);
51941 end = gen_xmlNodePtr(n_end, 1);
51943 ret_val = xmlXPtrNewRangePointNode(start, end);
51944 desret_xmlXPathObjectPtr(ret_val);
51946 des_xmlXPathObjectPtr(n_start, start, 0);
51947 des_xmlNodePtr(n_end, end, 1);
51948 xmlResetLastError();
51949 if (mem_base != xmlMemBlocks()) {
51950 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51951 xmlMemBlocks() - mem_base);
51953 printf(" %d", n_start);
51954 printf(" %d", n_end);
51967 test_xmlXPtrNewRangePoints(void) {
51970 #if defined(LIBXML_XPTR_ENABLED)
51972 xmlXPathObjectPtr ret_val;
51973 xmlXPathObjectPtr start; /* the starting point */
51975 xmlXPathObjectPtr end; /* the ending point */
51978 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51979 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51980 mem_base = xmlMemBlocks();
51981 start = gen_xmlXPathObjectPtr(n_start, 0);
51982 end = gen_xmlXPathObjectPtr(n_end, 1);
51984 ret_val = xmlXPtrNewRangePoints(start, end);
51985 desret_xmlXPathObjectPtr(ret_val);
51987 des_xmlXPathObjectPtr(n_start, start, 0);
51988 des_xmlXPathObjectPtr(n_end, end, 1);
51989 xmlResetLastError();
51990 if (mem_base != xmlMemBlocks()) {
51991 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51992 xmlMemBlocks() - mem_base);
51994 printf(" %d", n_start);
51995 printf(" %d", n_end);
52008 test_xmlXPtrRangeToFunction(void) {
52011 #if defined(LIBXML_XPTR_ENABLED)
52013 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52015 int nargs; /* the number of args */
52018 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52019 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52020 mem_base = xmlMemBlocks();
52021 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52022 nargs = gen_int(n_nargs, 1);
52024 xmlXPtrRangeToFunction(ctxt, nargs);
52026 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52027 des_int(n_nargs, nargs, 1);
52028 xmlResetLastError();
52029 if (mem_base != xmlMemBlocks()) {
52030 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52031 xmlMemBlocks() - mem_base);
52033 printf(" %d", n_ctxt);
52034 printf(" %d", n_nargs);
52047 test_xmlXPtrWrapLocationSet(void) {
52050 #if defined(LIBXML_XPTR_ENABLED)
52052 xmlXPathObjectPtr ret_val;
52053 xmlLocationSetPtr val; /* the LocationSet value */
52056 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52057 mem_base = xmlMemBlocks();
52058 val = gen_xmlLocationSetPtr(n_val, 0);
52060 ret_val = xmlXPtrWrapLocationSet(val);
52061 desret_xmlXPathObjectPtr(ret_val);
52063 des_xmlLocationSetPtr(n_val, val, 0);
52064 xmlResetLastError();
52065 if (mem_base != xmlMemBlocks()) {
52066 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52067 xmlMemBlocks() - mem_base);
52069 printf(" %d", n_val);
52080 test_xpointer(void) {
52083 if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52084 test_ret += test_xmlXPtrBuildNodeList();
52085 test_ret += test_xmlXPtrEval();
52086 test_ret += test_xmlXPtrEvalRangePredicate();
52087 test_ret += test_xmlXPtrLocationSetAdd();
52088 test_ret += test_xmlXPtrLocationSetCreate();
52089 test_ret += test_xmlXPtrLocationSetDel();
52090 test_ret += test_xmlXPtrLocationSetMerge();
52091 test_ret += test_xmlXPtrLocationSetRemove();
52092 test_ret += test_xmlXPtrNewCollapsedRange();
52093 test_ret += test_xmlXPtrNewContext();
52094 test_ret += test_xmlXPtrNewLocationSetNodeSet();
52095 test_ret += test_xmlXPtrNewLocationSetNodes();
52096 test_ret += test_xmlXPtrNewRange();
52097 test_ret += test_xmlXPtrNewRangeNodeObject();
52098 test_ret += test_xmlXPtrNewRangeNodePoint();
52099 test_ret += test_xmlXPtrNewRangeNodes();
52100 test_ret += test_xmlXPtrNewRangePointNode();
52101 test_ret += test_xmlXPtrNewRangePoints();
52102 test_ret += test_xmlXPtrRangeToFunction();
52103 test_ret += test_xmlXPtrWrapLocationSet();
52106 printf("Module xpointer: %d errors\n", test_ret);
52110 test_module(const char *module) {
52111 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52112 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52113 if (!strcmp(module, "SAX2")) return(test_SAX2());
52114 if (!strcmp(module, "c14n")) return(test_c14n());
52115 if (!strcmp(module, "catalog")) return(test_catalog());
52116 if (!strcmp(module, "chvalid")) return(test_chvalid());
52117 if (!strcmp(module, "debugXML")) return(test_debugXML());
52118 if (!strcmp(module, "dict")) return(test_dict());
52119 if (!strcmp(module, "encoding")) return(test_encoding());
52120 if (!strcmp(module, "entities")) return(test_entities());
52121 if (!strcmp(module, "hash")) return(test_hash());
52122 if (!strcmp(module, "list")) return(test_list());
52123 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52124 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52125 if (!strcmp(module, "parser")) return(test_parser());
52126 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52127 if (!strcmp(module, "pattern")) return(test_pattern());
52128 if (!strcmp(module, "relaxng")) return(test_relaxng());
52129 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52130 if (!strcmp(module, "schematron")) return(test_schematron());
52131 if (!strcmp(module, "tree")) return(test_tree());
52132 if (!strcmp(module, "uri")) return(test_uri());
52133 if (!strcmp(module, "valid")) return(test_valid());
52134 if (!strcmp(module, "xinclude")) return(test_xinclude());
52135 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52136 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52137 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52138 if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52139 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52140 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52141 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52142 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52143 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52144 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52145 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52146 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52147 if (!strcmp(module, "xpath")) return(test_xpath());
52148 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52149 if (!strcmp(module, "xpointer")) return(test_xpointer());