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_BOUNDED);
1038 if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
1039 if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
1040 if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
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);
1483 if ((buffer != NULL) &&
1484 (size > (int) strlen((const char *) buffer) + 1))
1487 ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1488 desret_htmlParserCtxtPtr(ret_val);
1490 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1491 des_int(n_size, size, 1);
1492 xmlResetLastError();
1493 if (mem_base != xmlMemBlocks()) {
1494 printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1495 xmlMemBlocks() - mem_base);
1497 printf(" %d", n_buffer);
1498 printf(" %d", n_size);
1509 #ifdef LIBXML_HTML_ENABLED
1511 #define gen_nb_htmlSAXHandlerPtr 1
1512 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1515 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1521 test_htmlCreatePushParserCtxt(void) {
1524 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1526 htmlParserCtxtPtr ret_val;
1527 htmlSAXHandlerPtr sax; /* a SAX handler */
1529 void * user_data; /* The user data returned on SAX callbacks */
1531 char * chunk; /* a pointer to an array of chars */
1533 int size; /* number of chars in the array */
1535 const char * filename; /* an optional file name or URI */
1537 xmlCharEncoding enc; /* an optional encoding */
1540 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1541 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1542 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1543 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1544 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1545 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1546 mem_base = xmlMemBlocks();
1547 sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1548 user_data = gen_userdata(n_user_data, 1);
1549 chunk = gen_const_char_ptr(n_chunk, 2);
1550 size = gen_int(n_size, 3);
1551 filename = gen_fileoutput(n_filename, 4);
1552 enc = gen_xmlCharEncoding(n_enc, 5);
1553 if ((chunk != NULL) &&
1554 (size > (int) strlen((const char *) chunk) + 1))
1557 ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1558 desret_htmlParserCtxtPtr(ret_val);
1560 des_htmlSAXHandlerPtr(n_sax, sax, 0);
1561 des_userdata(n_user_data, user_data, 1);
1562 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1563 des_int(n_size, size, 3);
1564 des_fileoutput(n_filename, filename, 4);
1565 des_xmlCharEncoding(n_enc, enc, 5);
1566 xmlResetLastError();
1567 if (mem_base != xmlMemBlocks()) {
1568 printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1569 xmlMemBlocks() - mem_base);
1571 printf(" %d", n_sax);
1572 printf(" %d", n_user_data);
1573 printf(" %d", n_chunk);
1574 printf(" %d", n_size);
1575 printf(" %d", n_filename);
1576 printf(" %d", n_enc);
1593 test_htmlCtxtReadDoc(void) {
1596 #if defined(LIBXML_HTML_ENABLED)
1599 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1601 xmlChar * cur; /* a pointer to a zero terminated string */
1603 const char * URL; /* the base URL to use for the document */
1605 char * encoding; /* the document encoding, or NULL */
1607 int options; /* a combination of htmlParserOption(s) */
1610 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1611 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1612 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1613 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1614 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1615 mem_base = xmlMemBlocks();
1616 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1617 cur = gen_const_xmlChar_ptr(n_cur, 1);
1618 URL = gen_filepath(n_URL, 2);
1619 encoding = gen_const_char_ptr(n_encoding, 3);
1620 options = gen_int(n_options, 4);
1622 ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1623 desret_htmlDocPtr(ret_val);
1625 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1626 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1627 des_filepath(n_URL, URL, 2);
1628 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1629 des_int(n_options, options, 4);
1630 xmlResetLastError();
1631 if (mem_base != xmlMemBlocks()) {
1632 printf("Leak of %d blocks found in htmlCtxtReadDoc",
1633 xmlMemBlocks() - mem_base);
1635 printf(" %d", n_ctxt);
1636 printf(" %d", n_cur);
1637 printf(" %d", n_URL);
1638 printf(" %d", n_encoding);
1639 printf(" %d", n_options);
1655 test_htmlCtxtReadFile(void) {
1658 #if defined(LIBXML_HTML_ENABLED)
1660 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1662 const char * filename; /* a file or URL */
1664 char * encoding; /* the document encoding, or NULL */
1666 int options; /* a combination of htmlParserOption(s) */
1669 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1670 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1671 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1672 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1673 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1674 filename = gen_filepath(n_filename, 1);
1675 encoding = gen_const_char_ptr(n_encoding, 2);
1676 options = gen_int(n_options, 3);
1678 ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1679 desret_htmlDocPtr(ret_val);
1681 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1682 des_filepath(n_filename, filename, 1);
1683 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1684 des_int(n_options, options, 3);
1685 xmlResetLastError();
1698 test_htmlCtxtReadMemory(void) {
1701 #if defined(LIBXML_HTML_ENABLED)
1704 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1706 char * buffer; /* a pointer to a char array */
1708 int size; /* the size of the array */
1710 const char * URL; /* the base URL to use for the document */
1712 char * encoding; /* the document encoding, or NULL */
1714 int options; /* a combination of htmlParserOption(s) */
1717 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1718 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1719 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1720 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1721 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1722 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1723 mem_base = xmlMemBlocks();
1724 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1725 buffer = gen_const_char_ptr(n_buffer, 1);
1726 size = gen_int(n_size, 2);
1727 URL = gen_filepath(n_URL, 3);
1728 encoding = gen_const_char_ptr(n_encoding, 4);
1729 options = gen_int(n_options, 5);
1730 if ((buffer != NULL) &&
1731 (size > (int) strlen((const char *) buffer) + 1))
1734 ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1735 desret_htmlDocPtr(ret_val);
1737 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1738 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1739 des_int(n_size, size, 2);
1740 des_filepath(n_URL, URL, 3);
1741 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1742 des_int(n_options, options, 5);
1743 xmlResetLastError();
1744 if (mem_base != xmlMemBlocks()) {
1745 printf("Leak of %d blocks found in htmlCtxtReadMemory",
1746 xmlMemBlocks() - mem_base);
1748 printf(" %d", n_ctxt);
1749 printf(" %d", n_buffer);
1750 printf(" %d", n_size);
1751 printf(" %d", n_URL);
1752 printf(" %d", n_encoding);
1753 printf(" %d", n_options);
1770 test_htmlCtxtReset(void) {
1773 #if defined(LIBXML_HTML_ENABLED)
1775 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1778 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1779 mem_base = xmlMemBlocks();
1780 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1782 htmlCtxtReset(ctxt);
1784 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1785 xmlResetLastError();
1786 if (mem_base != xmlMemBlocks()) {
1787 printf("Leak of %d blocks found in htmlCtxtReset",
1788 xmlMemBlocks() - mem_base);
1790 printf(" %d", n_ctxt);
1802 test_htmlCtxtUseOptions(void) {
1805 #if defined(LIBXML_HTML_ENABLED)
1808 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1810 int options; /* a combination of htmlParserOption(s) */
1813 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1814 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1815 mem_base = xmlMemBlocks();
1816 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1817 options = gen_int(n_options, 1);
1819 ret_val = htmlCtxtUseOptions(ctxt, options);
1820 desret_int(ret_val);
1822 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1823 des_int(n_options, options, 1);
1824 xmlResetLastError();
1825 if (mem_base != xmlMemBlocks()) {
1826 printf("Leak of %d blocks found in htmlCtxtUseOptions",
1827 xmlMemBlocks() - mem_base);
1829 printf(" %d", n_ctxt);
1830 printf(" %d", n_options);
1843 test_htmlElementAllowedHere(void) {
1846 #if defined(LIBXML_HTML_ENABLED)
1849 htmlElemDesc * parent; /* HTML parent element */
1851 xmlChar * elt; /* HTML element */
1854 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1855 for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1856 mem_base = xmlMemBlocks();
1857 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1858 elt = gen_const_xmlChar_ptr(n_elt, 1);
1860 ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1861 desret_int(ret_val);
1863 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1864 des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1865 xmlResetLastError();
1866 if (mem_base != xmlMemBlocks()) {
1867 printf("Leak of %d blocks found in htmlElementAllowedHere",
1868 xmlMemBlocks() - mem_base);
1870 printf(" %d", n_parent);
1871 printf(" %d", n_elt);
1884 test_htmlElementStatusHere(void) {
1887 #if defined(LIBXML_HTML_ENABLED)
1890 htmlElemDesc * parent; /* HTML parent element */
1892 htmlElemDesc * elt; /* HTML element */
1895 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1896 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1897 mem_base = xmlMemBlocks();
1898 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1899 elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1901 ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1902 desret_htmlStatus(ret_val);
1904 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1905 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1906 xmlResetLastError();
1907 if (mem_base != xmlMemBlocks()) {
1908 printf("Leak of %d blocks found in htmlElementStatusHere",
1909 xmlMemBlocks() - mem_base);
1911 printf(" %d", n_parent);
1912 printf(" %d", n_elt);
1925 test_htmlEncodeEntities(void) {
1928 #if defined(LIBXML_HTML_ENABLED)
1931 unsigned char * out; /* a pointer to an array of bytes to store the result */
1933 int * outlen; /* the length of @out */
1935 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1937 int * inlen; /* the length of @in */
1939 int quoteChar; /* the quote character to escape (' or ") or zero. */
1942 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1943 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1944 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1945 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1946 for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1947 mem_base = xmlMemBlocks();
1948 out = gen_unsigned_char_ptr(n_out, 0);
1949 outlen = gen_int_ptr(n_outlen, 1);
1950 in = gen_const_unsigned_char_ptr(n_in, 2);
1951 inlen = gen_int_ptr(n_inlen, 3);
1952 quoteChar = gen_int(n_quoteChar, 4);
1954 ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1955 desret_int(ret_val);
1957 des_unsigned_char_ptr(n_out, out, 0);
1958 des_int_ptr(n_outlen, outlen, 1);
1959 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1960 des_int_ptr(n_inlen, inlen, 3);
1961 des_int(n_quoteChar, quoteChar, 4);
1962 xmlResetLastError();
1963 if (mem_base != xmlMemBlocks()) {
1964 printf("Leak of %d blocks found in htmlEncodeEntities",
1965 xmlMemBlocks() - mem_base);
1967 printf(" %d", n_out);
1968 printf(" %d", n_outlen);
1969 printf(" %d", n_in);
1970 printf(" %d", n_inlen);
1971 printf(" %d", n_quoteChar);
1987 test_htmlEntityLookup(void) {
1990 #if defined(LIBXML_HTML_ENABLED)
1992 const htmlEntityDesc * ret_val;
1993 xmlChar * name; /* the entity name */
1996 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1997 mem_base = xmlMemBlocks();
1998 name = gen_const_xmlChar_ptr(n_name, 0);
2000 ret_val = htmlEntityLookup((const xmlChar *)name);
2001 desret_const_htmlEntityDesc_ptr(ret_val);
2003 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2004 xmlResetLastError();
2005 if (mem_base != xmlMemBlocks()) {
2006 printf("Leak of %d blocks found in htmlEntityLookup",
2007 xmlMemBlocks() - mem_base);
2009 printf(" %d", n_name);
2021 test_htmlEntityValueLookup(void) {
2024 #if defined(LIBXML_HTML_ENABLED)
2026 const htmlEntityDesc * ret_val;
2027 unsigned int value; /* the entity's unicode value */
2030 for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2031 mem_base = xmlMemBlocks();
2032 value = gen_unsigned_int(n_value, 0);
2034 ret_val = htmlEntityValueLookup(value);
2035 desret_const_htmlEntityDesc_ptr(ret_val);
2037 des_unsigned_int(n_value, value, 0);
2038 xmlResetLastError();
2039 if (mem_base != xmlMemBlocks()) {
2040 printf("Leak of %d blocks found in htmlEntityValueLookup",
2041 xmlMemBlocks() - mem_base);
2043 printf(" %d", n_value);
2055 test_htmlHandleOmittedElem(void) {
2058 #if defined(LIBXML_HTML_ENABLED)
2061 int val; /* int 0 or 1 */
2064 for (n_val = 0;n_val < gen_nb_int;n_val++) {
2065 mem_base = xmlMemBlocks();
2066 val = gen_int(n_val, 0);
2068 ret_val = htmlHandleOmittedElem(val);
2069 desret_int(ret_val);
2071 des_int(n_val, val, 0);
2072 xmlResetLastError();
2073 if (mem_base != xmlMemBlocks()) {
2074 printf("Leak of %d blocks found in htmlHandleOmittedElem",
2075 xmlMemBlocks() - mem_base);
2077 printf(" %d", n_val);
2089 test_htmlIsAutoClosed(void) {
2092 #if defined(LIBXML_HTML_ENABLED)
2095 htmlDocPtr doc; /* the HTML document */
2097 htmlNodePtr elem; /* the HTML element */
2100 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2101 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2102 mem_base = xmlMemBlocks();
2103 doc = gen_htmlDocPtr(n_doc, 0);
2104 elem = gen_htmlNodePtr(n_elem, 1);
2106 ret_val = htmlIsAutoClosed(doc, elem);
2107 desret_int(ret_val);
2109 des_htmlDocPtr(n_doc, doc, 0);
2110 des_htmlNodePtr(n_elem, elem, 1);
2111 xmlResetLastError();
2112 if (mem_base != xmlMemBlocks()) {
2113 printf("Leak of %d blocks found in htmlIsAutoClosed",
2114 xmlMemBlocks() - mem_base);
2116 printf(" %d", n_doc);
2117 printf(" %d", n_elem);
2130 test_htmlIsScriptAttribute(void) {
2133 #if defined(LIBXML_HTML_ENABLED)
2136 xmlChar * name; /* an attribute name */
2139 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2140 mem_base = xmlMemBlocks();
2141 name = gen_const_xmlChar_ptr(n_name, 0);
2143 ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2144 desret_int(ret_val);
2146 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2147 xmlResetLastError();
2148 if (mem_base != xmlMemBlocks()) {
2149 printf("Leak of %d blocks found in htmlIsScriptAttribute",
2150 xmlMemBlocks() - mem_base);
2152 printf(" %d", n_name);
2164 test_htmlNewParserCtxt(void) {
2167 #if defined(LIBXML_HTML_ENABLED)
2169 htmlParserCtxtPtr ret_val;
2171 mem_base = xmlMemBlocks();
2173 ret_val = htmlNewParserCtxt();
2174 desret_htmlParserCtxtPtr(ret_val);
2176 xmlResetLastError();
2177 if (mem_base != xmlMemBlocks()) {
2178 printf("Leak of %d blocks found in htmlNewParserCtxt",
2179 xmlMemBlocks() - mem_base);
2191 test_htmlNodeStatus(void) {
2194 #if defined(LIBXML_HTML_ENABLED)
2197 htmlNodePtr node; /* an htmlNodePtr in a tree */
2199 int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2202 for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2203 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2204 mem_base = xmlMemBlocks();
2205 node = gen_const_htmlNodePtr(n_node, 0);
2206 legacy = gen_int(n_legacy, 1);
2208 ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2209 desret_htmlStatus(ret_val);
2211 des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2212 des_int(n_legacy, legacy, 1);
2213 xmlResetLastError();
2214 if (mem_base != xmlMemBlocks()) {
2215 printf("Leak of %d blocks found in htmlNodeStatus",
2216 xmlMemBlocks() - mem_base);
2218 printf(" %d", n_node);
2219 printf(" %d", n_legacy);
2232 test_htmlParseCharRef(void) {
2235 #if defined(LIBXML_HTML_ENABLED)
2238 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2241 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2242 mem_base = xmlMemBlocks();
2243 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2245 ret_val = htmlParseCharRef(ctxt);
2246 desret_int(ret_val);
2248 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2249 xmlResetLastError();
2250 if (mem_base != xmlMemBlocks()) {
2251 printf("Leak of %d blocks found in htmlParseCharRef",
2252 xmlMemBlocks() - mem_base);
2254 printf(" %d", n_ctxt);
2266 test_htmlParseChunk(void) {
2269 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2272 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2274 char * chunk; /* an char array */
2276 int size; /* the size in byte of the chunk */
2278 int terminate; /* last chunk indicator */
2281 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2282 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2283 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2284 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2285 mem_base = xmlMemBlocks();
2286 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2287 chunk = gen_const_char_ptr(n_chunk, 1);
2288 size = gen_int(n_size, 2);
2289 terminate = gen_int(n_terminate, 3);
2290 if ((chunk != NULL) &&
2291 (size > (int) strlen((const char *) chunk) + 1))
2294 ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2295 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2296 desret_int(ret_val);
2298 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2299 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2300 des_int(n_size, size, 2);
2301 des_int(n_terminate, terminate, 3);
2302 xmlResetLastError();
2303 if (mem_base != xmlMemBlocks()) {
2304 printf("Leak of %d blocks found in htmlParseChunk",
2305 xmlMemBlocks() - mem_base);
2307 printf(" %d", n_ctxt);
2308 printf(" %d", n_chunk);
2309 printf(" %d", n_size);
2310 printf(" %d", n_terminate);
2325 test_htmlParseDoc(void) {
2328 #if defined(LIBXML_HTML_ENABLED)
2331 xmlChar * cur; /* a pointer to an array of xmlChar */
2333 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2336 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2337 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2338 mem_base = xmlMemBlocks();
2339 cur = gen_const_xmlChar_ptr(n_cur, 0);
2340 encoding = gen_const_char_ptr(n_encoding, 1);
2342 ret_val = htmlParseDoc((const xmlChar *)cur, (const char *)encoding);
2343 desret_htmlDocPtr(ret_val);
2345 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2346 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2347 xmlResetLastError();
2348 if (mem_base != xmlMemBlocks()) {
2349 printf("Leak of %d blocks found in htmlParseDoc",
2350 xmlMemBlocks() - mem_base);
2352 printf(" %d", n_cur);
2353 printf(" %d", n_encoding);
2366 test_htmlParseDocument(void) {
2369 #if defined(LIBXML_HTML_ENABLED)
2372 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2375 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2376 mem_base = xmlMemBlocks();
2377 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2379 ret_val = htmlParseDocument(ctxt);
2380 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2381 desret_int(ret_val);
2383 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2384 xmlResetLastError();
2385 if (mem_base != xmlMemBlocks()) {
2386 printf("Leak of %d blocks found in htmlParseDocument",
2387 xmlMemBlocks() - mem_base);
2389 printf(" %d", n_ctxt);
2401 test_htmlParseElement(void) {
2404 #if defined(LIBXML_HTML_ENABLED)
2406 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2409 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2410 mem_base = xmlMemBlocks();
2411 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2413 htmlParseElement(ctxt);
2415 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2416 xmlResetLastError();
2417 if (mem_base != xmlMemBlocks()) {
2418 printf("Leak of %d blocks found in htmlParseElement",
2419 xmlMemBlocks() - mem_base);
2421 printf(" %d", n_ctxt);
2433 test_htmlParseEntityRef(void) {
2436 #if defined(LIBXML_HTML_ENABLED)
2438 const htmlEntityDesc * ret_val;
2439 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2441 xmlChar ** str; /* location to store the entity name */
2444 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2445 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2446 mem_base = xmlMemBlocks();
2447 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2448 str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2450 ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2451 desret_const_htmlEntityDesc_ptr(ret_val);
2453 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2454 des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2455 xmlResetLastError();
2456 if (mem_base != xmlMemBlocks()) {
2457 printf("Leak of %d blocks found in htmlParseEntityRef",
2458 xmlMemBlocks() - mem_base);
2460 printf(" %d", n_ctxt);
2461 printf(" %d", n_str);
2474 test_htmlParseFile(void) {
2477 #if defined(LIBXML_HTML_ENABLED)
2479 const char * filename; /* the filename */
2481 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2484 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2485 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2486 filename = gen_filepath(n_filename, 0);
2487 encoding = gen_const_char_ptr(n_encoding, 1);
2489 ret_val = htmlParseFile(filename, (const char *)encoding);
2490 desret_htmlDocPtr(ret_val);
2492 des_filepath(n_filename, filename, 0);
2493 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2494 xmlResetLastError();
2505 test_htmlReadDoc(void) {
2508 #if defined(LIBXML_HTML_ENABLED)
2511 xmlChar * cur; /* a pointer to a zero terminated string */
2513 const char * URL; /* the base URL to use for the document */
2515 char * encoding; /* the document encoding, or NULL */
2517 int options; /* a combination of htmlParserOption(s) */
2520 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2521 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2522 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2523 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2524 mem_base = xmlMemBlocks();
2525 cur = gen_const_xmlChar_ptr(n_cur, 0);
2526 URL = gen_filepath(n_URL, 1);
2527 encoding = gen_const_char_ptr(n_encoding, 2);
2528 options = gen_int(n_options, 3);
2530 ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2531 desret_htmlDocPtr(ret_val);
2533 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2534 des_filepath(n_URL, URL, 1);
2535 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2536 des_int(n_options, options, 3);
2537 xmlResetLastError();
2538 if (mem_base != xmlMemBlocks()) {
2539 printf("Leak of %d blocks found in htmlReadDoc",
2540 xmlMemBlocks() - mem_base);
2542 printf(" %d", n_cur);
2543 printf(" %d", n_URL);
2544 printf(" %d", n_encoding);
2545 printf(" %d", n_options);
2560 test_htmlReadFile(void) {
2563 #if defined(LIBXML_HTML_ENABLED)
2566 const char * filename; /* a file or URL */
2568 char * encoding; /* the document encoding, or NULL */
2570 int options; /* a combination of htmlParserOption(s) */
2573 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2574 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2575 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2576 mem_base = xmlMemBlocks();
2577 filename = gen_filepath(n_filename, 0);
2578 encoding = gen_const_char_ptr(n_encoding, 1);
2579 options = gen_int(n_options, 2);
2581 ret_val = htmlReadFile(filename, (const char *)encoding, options);
2582 desret_htmlDocPtr(ret_val);
2584 des_filepath(n_filename, filename, 0);
2585 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2586 des_int(n_options, options, 2);
2587 xmlResetLastError();
2588 if (mem_base != xmlMemBlocks()) {
2589 printf("Leak of %d blocks found in htmlReadFile",
2590 xmlMemBlocks() - mem_base);
2592 printf(" %d", n_filename);
2593 printf(" %d", n_encoding);
2594 printf(" %d", n_options);
2608 test_htmlReadMemory(void) {
2611 #if defined(LIBXML_HTML_ENABLED)
2614 char * buffer; /* a pointer to a char array */
2616 int size; /* the size of the array */
2618 const char * URL; /* the base URL to use for the document */
2620 char * encoding; /* the document encoding, or NULL */
2622 int options; /* a combination of htmlParserOption(s) */
2625 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2626 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2627 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2628 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2629 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2630 mem_base = xmlMemBlocks();
2631 buffer = gen_const_char_ptr(n_buffer, 0);
2632 size = gen_int(n_size, 1);
2633 URL = gen_filepath(n_URL, 2);
2634 encoding = gen_const_char_ptr(n_encoding, 3);
2635 options = gen_int(n_options, 4);
2636 if ((buffer != NULL) &&
2637 (size > (int) strlen((const char *) buffer) + 1))
2640 ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2641 desret_htmlDocPtr(ret_val);
2643 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2644 des_int(n_size, size, 1);
2645 des_filepath(n_URL, URL, 2);
2646 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2647 des_int(n_options, options, 4);
2648 xmlResetLastError();
2649 if (mem_base != xmlMemBlocks()) {
2650 printf("Leak of %d blocks found in htmlReadMemory",
2651 xmlMemBlocks() - mem_base);
2653 printf(" %d", n_buffer);
2654 printf(" %d", n_size);
2655 printf(" %d", n_URL);
2656 printf(" %d", n_encoding);
2657 printf(" %d", n_options);
2673 test_htmlSAXParseDoc(void) {
2676 #if defined(LIBXML_HTML_ENABLED)
2679 xmlChar * cur; /* a pointer to an array of xmlChar */
2681 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2683 htmlSAXHandlerPtr sax; /* the SAX handler block */
2685 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2688 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2689 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2690 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2691 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2692 mem_base = xmlMemBlocks();
2693 cur = gen_const_xmlChar_ptr(n_cur, 0);
2694 encoding = gen_const_char_ptr(n_encoding, 1);
2695 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2696 userData = gen_userdata(n_userData, 3);
2698 ret_val = htmlSAXParseDoc((const xmlChar *)cur, (const char *)encoding, sax, userData);
2699 desret_htmlDocPtr(ret_val);
2701 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2702 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2703 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2704 des_userdata(n_userData, userData, 3);
2705 xmlResetLastError();
2706 if (mem_base != xmlMemBlocks()) {
2707 printf("Leak of %d blocks found in htmlSAXParseDoc",
2708 xmlMemBlocks() - mem_base);
2710 printf(" %d", n_cur);
2711 printf(" %d", n_encoding);
2712 printf(" %d", n_sax);
2713 printf(" %d", n_userData);
2728 test_htmlSAXParseFile(void) {
2731 #if defined(LIBXML_HTML_ENABLED)
2734 const char * filename; /* the filename */
2736 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2738 htmlSAXHandlerPtr sax; /* the SAX handler block */
2740 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2743 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2744 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2745 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2746 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2747 mem_base = xmlMemBlocks();
2748 filename = gen_filepath(n_filename, 0);
2749 encoding = gen_const_char_ptr(n_encoding, 1);
2750 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2751 userData = gen_userdata(n_userData, 3);
2753 ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2754 desret_htmlDocPtr(ret_val);
2756 des_filepath(n_filename, filename, 0);
2757 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2758 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2759 des_userdata(n_userData, userData, 3);
2760 xmlResetLastError();
2761 if (mem_base != xmlMemBlocks()) {
2762 printf("Leak of %d blocks found in htmlSAXParseFile",
2763 xmlMemBlocks() - mem_base);
2765 printf(" %d", n_filename);
2766 printf(" %d", n_encoding);
2767 printf(" %d", n_sax);
2768 printf(" %d", n_userData);
2783 test_htmlTagLookup(void) {
2787 /* missing type support */
2792 test_HTMLparser(void) {
2795 if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2796 test_ret += test_UTF8ToHtml();
2797 test_ret += test_htmlAttrAllowed();
2798 test_ret += test_htmlAutoCloseTag();
2799 test_ret += test_htmlCreateMemoryParserCtxt();
2800 test_ret += test_htmlCreatePushParserCtxt();
2801 test_ret += test_htmlCtxtReadDoc();
2802 test_ret += test_htmlCtxtReadFile();
2803 test_ret += test_htmlCtxtReadMemory();
2804 test_ret += test_htmlCtxtReset();
2805 test_ret += test_htmlCtxtUseOptions();
2806 test_ret += test_htmlElementAllowedHere();
2807 test_ret += test_htmlElementStatusHere();
2808 test_ret += test_htmlEncodeEntities();
2809 test_ret += test_htmlEntityLookup();
2810 test_ret += test_htmlEntityValueLookup();
2811 test_ret += test_htmlHandleOmittedElem();
2812 test_ret += test_htmlIsAutoClosed();
2813 test_ret += test_htmlIsScriptAttribute();
2814 test_ret += test_htmlNewParserCtxt();
2815 test_ret += test_htmlNodeStatus();
2816 test_ret += test_htmlParseCharRef();
2817 test_ret += test_htmlParseChunk();
2818 test_ret += test_htmlParseDoc();
2819 test_ret += test_htmlParseDocument();
2820 test_ret += test_htmlParseElement();
2821 test_ret += test_htmlParseEntityRef();
2822 test_ret += test_htmlParseFile();
2823 test_ret += test_htmlReadDoc();
2824 test_ret += test_htmlReadFile();
2825 test_ret += test_htmlReadMemory();
2826 test_ret += test_htmlSAXParseDoc();
2827 test_ret += test_htmlSAXParseFile();
2828 test_ret += test_htmlTagLookup();
2831 printf("Module HTMLparser: %d errors\n", test_ret);
2836 test_htmlDocContentDumpFormatOutput(void) {
2839 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2841 xmlOutputBufferPtr buf; /* the HTML buffer output */
2843 xmlDocPtr cur; /* the document */
2845 char * encoding; /* the encoding string */
2847 int format; /* should formatting spaces been added */
2850 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2851 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2852 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2853 for (n_format = 0;n_format < gen_nb_int;n_format++) {
2854 mem_base = xmlMemBlocks();
2855 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2856 cur = gen_xmlDocPtr(n_cur, 1);
2857 encoding = gen_const_char_ptr(n_encoding, 2);
2858 format = gen_int(n_format, 3);
2860 htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2862 des_xmlOutputBufferPtr(n_buf, buf, 0);
2863 des_xmlDocPtr(n_cur, cur, 1);
2864 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2865 des_int(n_format, format, 3);
2866 xmlResetLastError();
2867 if (mem_base != xmlMemBlocks()) {
2868 printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2869 xmlMemBlocks() - mem_base);
2871 printf(" %d", n_buf);
2872 printf(" %d", n_cur);
2873 printf(" %d", n_encoding);
2874 printf(" %d", n_format);
2889 test_htmlDocContentDumpOutput(void) {
2892 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2894 xmlOutputBufferPtr buf; /* the HTML buffer output */
2896 xmlDocPtr cur; /* the document */
2898 char * encoding; /* the encoding string */
2901 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2902 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2903 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2904 mem_base = xmlMemBlocks();
2905 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2906 cur = gen_xmlDocPtr(n_cur, 1);
2907 encoding = gen_const_char_ptr(n_encoding, 2);
2909 htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2911 des_xmlOutputBufferPtr(n_buf, buf, 0);
2912 des_xmlDocPtr(n_cur, cur, 1);
2913 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2914 xmlResetLastError();
2915 if (mem_base != xmlMemBlocks()) {
2916 printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2917 xmlMemBlocks() - mem_base);
2919 printf(" %d", n_buf);
2920 printf(" %d", n_cur);
2921 printf(" %d", n_encoding);
2935 test_htmlDocDump(void) {
2938 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2941 FILE * f; /* the FILE* */
2943 xmlDocPtr cur; /* the document */
2946 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2947 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2948 mem_base = xmlMemBlocks();
2949 f = gen_FILE_ptr(n_f, 0);
2950 cur = gen_xmlDocPtr(n_cur, 1);
2952 ret_val = htmlDocDump(f, cur);
2953 desret_int(ret_val);
2955 des_FILE_ptr(n_f, f, 0);
2956 des_xmlDocPtr(n_cur, cur, 1);
2957 xmlResetLastError();
2958 if (mem_base != xmlMemBlocks()) {
2959 printf("Leak of %d blocks found in htmlDocDump",
2960 xmlMemBlocks() - mem_base);
2963 printf(" %d", n_cur);
2975 #define gen_nb_xmlChar_ptr_ptr 1
2976 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2979 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2983 test_htmlDocDumpMemory(void) {
2986 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2988 xmlDocPtr cur; /* the document */
2990 xmlChar ** mem; /* OUT: the memory pointer */
2992 int * size; /* OUT: the memory length */
2995 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2996 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2997 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2998 mem_base = xmlMemBlocks();
2999 cur = gen_xmlDocPtr(n_cur, 0);
3000 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3001 size = gen_int_ptr(n_size, 2);
3003 htmlDocDumpMemory(cur, mem, size);
3005 des_xmlDocPtr(n_cur, cur, 0);
3006 des_xmlChar_ptr_ptr(n_mem, mem, 1);
3007 des_int_ptr(n_size, size, 2);
3008 xmlResetLastError();
3009 if (mem_base != xmlMemBlocks()) {
3010 printf("Leak of %d blocks found in htmlDocDumpMemory",
3011 xmlMemBlocks() - mem_base);
3013 printf(" %d", n_cur);
3014 printf(" %d", n_mem);
3015 printf(" %d", n_size);
3029 test_htmlDocDumpMemoryFormat(void) {
3032 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3034 xmlDocPtr cur; /* the document */
3036 xmlChar ** mem; /* OUT: the memory pointer */
3038 int * size; /* OUT: the memory length */
3040 int format; /* should formatting spaces been added */
3043 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3044 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3045 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3046 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3047 mem_base = xmlMemBlocks();
3048 cur = gen_xmlDocPtr(n_cur, 0);
3049 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3050 size = gen_int_ptr(n_size, 2);
3051 format = gen_int(n_format, 3);
3053 htmlDocDumpMemoryFormat(cur, mem, size, format);
3055 des_xmlDocPtr(n_cur, cur, 0);
3056 des_xmlChar_ptr_ptr(n_mem, mem, 1);
3057 des_int_ptr(n_size, size, 2);
3058 des_int(n_format, format, 3);
3059 xmlResetLastError();
3060 if (mem_base != xmlMemBlocks()) {
3061 printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3062 xmlMemBlocks() - mem_base);
3064 printf(" %d", n_cur);
3065 printf(" %d", n_mem);
3066 printf(" %d", n_size);
3067 printf(" %d", n_format);
3082 test_htmlGetMetaEncoding(void) {
3085 #if defined(LIBXML_HTML_ENABLED)
3087 const xmlChar * ret_val;
3088 htmlDocPtr doc; /* the document */
3091 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3092 mem_base = xmlMemBlocks();
3093 doc = gen_htmlDocPtr(n_doc, 0);
3095 ret_val = htmlGetMetaEncoding(doc);
3096 desret_const_xmlChar_ptr(ret_val);
3098 des_htmlDocPtr(n_doc, doc, 0);
3099 xmlResetLastError();
3100 if (mem_base != xmlMemBlocks()) {
3101 printf("Leak of %d blocks found in htmlGetMetaEncoding",
3102 xmlMemBlocks() - mem_base);
3104 printf(" %d", n_doc);
3116 test_htmlIsBooleanAttr(void) {
3119 #if defined(LIBXML_HTML_ENABLED)
3122 xmlChar * name; /* the name of the attribute to check */
3125 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3126 mem_base = xmlMemBlocks();
3127 name = gen_const_xmlChar_ptr(n_name, 0);
3129 ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3130 desret_int(ret_val);
3132 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3133 xmlResetLastError();
3134 if (mem_base != xmlMemBlocks()) {
3135 printf("Leak of %d blocks found in htmlIsBooleanAttr",
3136 xmlMemBlocks() - mem_base);
3138 printf(" %d", n_name);
3150 test_htmlNewDoc(void) {
3153 #if defined(LIBXML_HTML_ENABLED)
3156 xmlChar * URI; /* URI for the dtd, or NULL */
3158 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3161 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3162 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3163 mem_base = xmlMemBlocks();
3164 URI = gen_const_xmlChar_ptr(n_URI, 0);
3165 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3167 ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3168 desret_htmlDocPtr(ret_val);
3170 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3171 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3172 xmlResetLastError();
3173 if (mem_base != xmlMemBlocks()) {
3174 printf("Leak of %d blocks found in htmlNewDoc",
3175 xmlMemBlocks() - mem_base);
3177 printf(" %d", n_URI);
3178 printf(" %d", n_ExternalID);
3191 test_htmlNewDocNoDtD(void) {
3194 #if defined(LIBXML_HTML_ENABLED)
3197 xmlChar * URI; /* URI for the dtd, or NULL */
3199 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3202 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3203 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3204 mem_base = xmlMemBlocks();
3205 URI = gen_const_xmlChar_ptr(n_URI, 0);
3206 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3208 ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3209 desret_htmlDocPtr(ret_val);
3211 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3212 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3213 xmlResetLastError();
3214 if (mem_base != xmlMemBlocks()) {
3215 printf("Leak of %d blocks found in htmlNewDocNoDtD",
3216 xmlMemBlocks() - mem_base);
3218 printf(" %d", n_URI);
3219 printf(" %d", n_ExternalID);
3232 test_htmlNodeDump(void) {
3235 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3238 xmlBufferPtr buf; /* the HTML buffer output */
3240 xmlDocPtr doc; /* the document */
3242 xmlNodePtr cur; /* the current node */
3245 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3246 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3247 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3248 mem_base = xmlMemBlocks();
3249 buf = gen_xmlBufferPtr(n_buf, 0);
3250 doc = gen_xmlDocPtr(n_doc, 1);
3251 cur = gen_xmlNodePtr(n_cur, 2);
3253 ret_val = htmlNodeDump(buf, doc, cur);
3254 desret_int(ret_val);
3256 des_xmlBufferPtr(n_buf, buf, 0);
3257 des_xmlDocPtr(n_doc, doc, 1);
3258 des_xmlNodePtr(n_cur, cur, 2);
3259 xmlResetLastError();
3260 if (mem_base != xmlMemBlocks()) {
3261 printf("Leak of %d blocks found in htmlNodeDump",
3262 xmlMemBlocks() - mem_base);
3264 printf(" %d", n_buf);
3265 printf(" %d", n_doc);
3266 printf(" %d", n_cur);
3280 test_htmlNodeDumpFile(void) {
3283 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3285 FILE * out; /* the FILE pointer */
3287 xmlDocPtr doc; /* the document */
3289 xmlNodePtr cur; /* the current node */
3292 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3293 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3294 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3295 mem_base = xmlMemBlocks();
3296 out = gen_FILE_ptr(n_out, 0);
3297 doc = gen_xmlDocPtr(n_doc, 1);
3298 cur = gen_xmlNodePtr(n_cur, 2);
3300 htmlNodeDumpFile(out, doc, cur);
3302 des_FILE_ptr(n_out, out, 0);
3303 des_xmlDocPtr(n_doc, doc, 1);
3304 des_xmlNodePtr(n_cur, cur, 2);
3305 xmlResetLastError();
3306 if (mem_base != xmlMemBlocks()) {
3307 printf("Leak of %d blocks found in htmlNodeDumpFile",
3308 xmlMemBlocks() - mem_base);
3310 printf(" %d", n_out);
3311 printf(" %d", n_doc);
3312 printf(" %d", n_cur);
3326 test_htmlNodeDumpFileFormat(void) {
3329 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3332 FILE * out; /* the FILE pointer */
3334 xmlDocPtr doc; /* the document */
3336 xmlNodePtr cur; /* the current node */
3338 char * encoding; /* the document encoding */
3340 int format; /* should formatting spaces been added */
3343 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3344 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3345 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3346 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3347 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3348 mem_base = xmlMemBlocks();
3349 out = gen_FILE_ptr(n_out, 0);
3350 doc = gen_xmlDocPtr(n_doc, 1);
3351 cur = gen_xmlNodePtr(n_cur, 2);
3352 encoding = gen_const_char_ptr(n_encoding, 3);
3353 format = gen_int(n_format, 4);
3355 ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3356 desret_int(ret_val);
3358 des_FILE_ptr(n_out, out, 0);
3359 des_xmlDocPtr(n_doc, doc, 1);
3360 des_xmlNodePtr(n_cur, cur, 2);
3361 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3362 des_int(n_format, format, 4);
3363 xmlResetLastError();
3364 if (mem_base != xmlMemBlocks()) {
3365 printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3366 xmlMemBlocks() - mem_base);
3368 printf(" %d", n_out);
3369 printf(" %d", n_doc);
3370 printf(" %d", n_cur);
3371 printf(" %d", n_encoding);
3372 printf(" %d", n_format);
3388 test_htmlNodeDumpFormatOutput(void) {
3391 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3393 xmlOutputBufferPtr buf; /* the HTML buffer output */
3395 xmlDocPtr doc; /* the document */
3397 xmlNodePtr cur; /* the current node */
3399 char * encoding; /* the encoding string */
3401 int format; /* should formatting spaces been added */
3404 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3405 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3406 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3407 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3408 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3409 mem_base = xmlMemBlocks();
3410 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3411 doc = gen_xmlDocPtr(n_doc, 1);
3412 cur = gen_xmlNodePtr(n_cur, 2);
3413 encoding = gen_const_char_ptr(n_encoding, 3);
3414 format = gen_int(n_format, 4);
3416 htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3418 des_xmlOutputBufferPtr(n_buf, buf, 0);
3419 des_xmlDocPtr(n_doc, doc, 1);
3420 des_xmlNodePtr(n_cur, cur, 2);
3421 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3422 des_int(n_format, format, 4);
3423 xmlResetLastError();
3424 if (mem_base != xmlMemBlocks()) {
3425 printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3426 xmlMemBlocks() - mem_base);
3428 printf(" %d", n_buf);
3429 printf(" %d", n_doc);
3430 printf(" %d", n_cur);
3431 printf(" %d", n_encoding);
3432 printf(" %d", n_format);
3448 test_htmlNodeDumpOutput(void) {
3451 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3453 xmlOutputBufferPtr buf; /* the HTML buffer output */
3455 xmlDocPtr doc; /* the document */
3457 xmlNodePtr cur; /* the current node */
3459 char * encoding; /* the encoding string */
3462 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3463 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3464 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3465 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3466 mem_base = xmlMemBlocks();
3467 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3468 doc = gen_xmlDocPtr(n_doc, 1);
3469 cur = gen_xmlNodePtr(n_cur, 2);
3470 encoding = gen_const_char_ptr(n_encoding, 3);
3472 htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3474 des_xmlOutputBufferPtr(n_buf, buf, 0);
3475 des_xmlDocPtr(n_doc, doc, 1);
3476 des_xmlNodePtr(n_cur, cur, 2);
3477 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3478 xmlResetLastError();
3479 if (mem_base != xmlMemBlocks()) {
3480 printf("Leak of %d blocks found in htmlNodeDumpOutput",
3481 xmlMemBlocks() - mem_base);
3483 printf(" %d", n_buf);
3484 printf(" %d", n_doc);
3485 printf(" %d", n_cur);
3486 printf(" %d", n_encoding);
3501 test_htmlSaveFile(void) {
3504 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3507 const char * filename; /* the filename (or URL) */
3509 xmlDocPtr cur; /* the document */
3512 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3513 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3514 mem_base = xmlMemBlocks();
3515 filename = gen_fileoutput(n_filename, 0);
3516 cur = gen_xmlDocPtr(n_cur, 1);
3518 ret_val = htmlSaveFile(filename, cur);
3519 desret_int(ret_val);
3521 des_fileoutput(n_filename, filename, 0);
3522 des_xmlDocPtr(n_cur, cur, 1);
3523 xmlResetLastError();
3524 if (mem_base != xmlMemBlocks()) {
3525 printf("Leak of %d blocks found in htmlSaveFile",
3526 xmlMemBlocks() - mem_base);
3528 printf(" %d", n_filename);
3529 printf(" %d", n_cur);
3542 test_htmlSaveFileEnc(void) {
3545 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3548 const char * filename; /* the filename */
3550 xmlDocPtr cur; /* the document */
3552 char * encoding; /* the document encoding */
3555 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3556 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3557 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3558 mem_base = xmlMemBlocks();
3559 filename = gen_fileoutput(n_filename, 0);
3560 cur = gen_xmlDocPtr(n_cur, 1);
3561 encoding = gen_const_char_ptr(n_encoding, 2);
3563 ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3564 desret_int(ret_val);
3566 des_fileoutput(n_filename, filename, 0);
3567 des_xmlDocPtr(n_cur, cur, 1);
3568 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3569 xmlResetLastError();
3570 if (mem_base != xmlMemBlocks()) {
3571 printf("Leak of %d blocks found in htmlSaveFileEnc",
3572 xmlMemBlocks() - mem_base);
3574 printf(" %d", n_filename);
3575 printf(" %d", n_cur);
3576 printf(" %d", n_encoding);
3590 test_htmlSaveFileFormat(void) {
3593 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3596 const char * filename; /* the filename */
3598 xmlDocPtr cur; /* the document */
3600 char * encoding; /* the document encoding */
3602 int format; /* should formatting spaces been added */
3605 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3606 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3607 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3608 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3609 mem_base = xmlMemBlocks();
3610 filename = gen_fileoutput(n_filename, 0);
3611 cur = gen_xmlDocPtr(n_cur, 1);
3612 encoding = gen_const_char_ptr(n_encoding, 2);
3613 format = gen_int(n_format, 3);
3615 ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3616 desret_int(ret_val);
3618 des_fileoutput(n_filename, filename, 0);
3619 des_xmlDocPtr(n_cur, cur, 1);
3620 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3621 des_int(n_format, format, 3);
3622 xmlResetLastError();
3623 if (mem_base != xmlMemBlocks()) {
3624 printf("Leak of %d blocks found in htmlSaveFileFormat",
3625 xmlMemBlocks() - mem_base);
3627 printf(" %d", n_filename);
3628 printf(" %d", n_cur);
3629 printf(" %d", n_encoding);
3630 printf(" %d", n_format);
3645 test_htmlSetMetaEncoding(void) {
3648 #if defined(LIBXML_HTML_ENABLED)
3651 htmlDocPtr doc; /* the document */
3653 xmlChar * encoding; /* the encoding string */
3656 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3657 for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3658 mem_base = xmlMemBlocks();
3659 doc = gen_htmlDocPtr(n_doc, 0);
3660 encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3662 ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3663 desret_int(ret_val);
3665 des_htmlDocPtr(n_doc, doc, 0);
3666 des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3667 xmlResetLastError();
3668 if (mem_base != xmlMemBlocks()) {
3669 printf("Leak of %d blocks found in htmlSetMetaEncoding",
3670 xmlMemBlocks() - mem_base);
3672 printf(" %d", n_doc);
3673 printf(" %d", n_encoding);
3685 test_HTMLtree(void) {
3688 if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3689 test_ret += test_htmlDocContentDumpFormatOutput();
3690 test_ret += test_htmlDocContentDumpOutput();
3691 test_ret += test_htmlDocDump();
3692 test_ret += test_htmlDocDumpMemory();
3693 test_ret += test_htmlDocDumpMemoryFormat();
3694 test_ret += test_htmlGetMetaEncoding();
3695 test_ret += test_htmlIsBooleanAttr();
3696 test_ret += test_htmlNewDoc();
3697 test_ret += test_htmlNewDocNoDtD();
3698 test_ret += test_htmlNodeDump();
3699 test_ret += test_htmlNodeDumpFile();
3700 test_ret += test_htmlNodeDumpFileFormat();
3701 test_ret += test_htmlNodeDumpFormatOutput();
3702 test_ret += test_htmlNodeDumpOutput();
3703 test_ret += test_htmlSaveFile();
3704 test_ret += test_htmlSaveFileEnc();
3705 test_ret += test_htmlSaveFileFormat();
3706 test_ret += test_htmlSetMetaEncoding();
3709 printf("Module HTMLtree: %d errors\n", test_ret);
3714 test_docbDefaultSAXHandlerInit(void) {
3717 #if defined(LIBXML_DOCB_ENABLED)
3718 #ifdef LIBXML_DOCB_ENABLED
3721 mem_base = xmlMemBlocks();
3723 docbDefaultSAXHandlerInit();
3725 xmlResetLastError();
3726 if (mem_base != xmlMemBlocks()) {
3727 printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3728 xmlMemBlocks() - mem_base);
3741 test_htmlDefaultSAXHandlerInit(void) {
3744 #if defined(LIBXML_HTML_ENABLED)
3745 #ifdef LIBXML_HTML_ENABLED
3748 mem_base = xmlMemBlocks();
3750 htmlDefaultSAXHandlerInit();
3752 xmlResetLastError();
3753 if (mem_base != xmlMemBlocks()) {
3754 printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3755 xmlMemBlocks() - mem_base);
3768 test_xmlDefaultSAXHandlerInit(void) {
3773 mem_base = xmlMemBlocks();
3775 xmlDefaultSAXHandlerInit();
3777 xmlResetLastError();
3778 if (mem_base != xmlMemBlocks()) {
3779 printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3780 xmlMemBlocks() - mem_base);
3790 #define gen_nb_xmlEnumerationPtr 1
3791 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3794 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3798 test_xmlSAX2AttributeDecl(void) {
3802 void * ctx; /* the user data (XML parser context) */
3804 xmlChar * elem; /* the name of the element */
3806 xmlChar * fullname; /* the attribute name */
3808 int type; /* the attribute type */
3810 int def; /* the type of default value */
3812 xmlChar * defaultValue; /* the attribute default value */
3814 xmlEnumerationPtr tree; /* the tree of enumerated value set */
3817 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3818 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3819 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3820 for (n_type = 0;n_type < gen_nb_int;n_type++) {
3821 for (n_def = 0;n_def < gen_nb_int;n_def++) {
3822 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3823 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3824 mem_base = xmlMemBlocks();
3825 ctx = gen_void_ptr(n_ctx, 0);
3826 elem = gen_const_xmlChar_ptr(n_elem, 1);
3827 fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3828 type = gen_int(n_type, 3);
3829 def = gen_int(n_def, 4);
3830 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3831 tree = gen_xmlEnumerationPtr(n_tree, 6);
3833 xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3835 des_void_ptr(n_ctx, ctx, 0);
3836 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3837 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3838 des_int(n_type, type, 3);
3839 des_int(n_def, def, 4);
3840 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3841 des_xmlEnumerationPtr(n_tree, tree, 6);
3842 xmlResetLastError();
3843 if (mem_base != xmlMemBlocks()) {
3844 printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3845 xmlMemBlocks() - mem_base);
3847 printf(" %d", n_ctx);
3848 printf(" %d", n_elem);
3849 printf(" %d", n_fullname);
3850 printf(" %d", n_type);
3851 printf(" %d", n_def);
3852 printf(" %d", n_defaultValue);
3853 printf(" %d", n_tree);
3870 test_xmlSAX2CDataBlock(void) {
3874 void * ctx; /* the user data (XML parser context) */
3876 xmlChar * value; /* The pcdata content */
3878 int len; /* the block length */
3881 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3882 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3883 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3884 mem_base = xmlMemBlocks();
3885 ctx = gen_void_ptr(n_ctx, 0);
3886 value = gen_const_xmlChar_ptr(n_value, 1);
3887 len = gen_int(n_len, 2);
3888 if ((value != NULL) &&
3889 (len > (int) strlen((const char *) value) + 1))
3892 xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3894 des_void_ptr(n_ctx, ctx, 0);
3895 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3896 des_int(n_len, len, 2);
3897 xmlResetLastError();
3898 if (mem_base != xmlMemBlocks()) {
3899 printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3900 xmlMemBlocks() - mem_base);
3902 printf(" %d", n_ctx);
3903 printf(" %d", n_value);
3904 printf(" %d", n_len);
3917 test_xmlSAX2Characters(void) {
3921 void * ctx; /* the user data (XML parser context) */
3923 xmlChar * ch; /* a xmlChar string */
3925 int len; /* the number of xmlChar */
3928 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3929 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3930 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3931 mem_base = xmlMemBlocks();
3932 ctx = gen_void_ptr(n_ctx, 0);
3933 ch = gen_const_xmlChar_ptr(n_ch, 1);
3934 len = gen_int(n_len, 2);
3936 (len > (int) strlen((const char *) ch) + 1))
3939 xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3941 des_void_ptr(n_ctx, ctx, 0);
3942 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3943 des_int(n_len, len, 2);
3944 xmlResetLastError();
3945 if (mem_base != xmlMemBlocks()) {
3946 printf("Leak of %d blocks found in xmlSAX2Characters",
3947 xmlMemBlocks() - mem_base);
3949 printf(" %d", n_ctx);
3950 printf(" %d", n_ch);
3951 printf(" %d", n_len);
3964 test_xmlSAX2Comment(void) {
3968 void * ctx; /* the user data (XML parser context) */
3970 xmlChar * value; /* the xmlSAX2Comment content */
3973 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3974 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3975 mem_base = xmlMemBlocks();
3976 ctx = gen_void_ptr(n_ctx, 0);
3977 value = gen_const_xmlChar_ptr(n_value, 1);
3979 xmlSAX2Comment(ctx, (const xmlChar *)value);
3981 des_void_ptr(n_ctx, ctx, 0);
3982 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3983 xmlResetLastError();
3984 if (mem_base != xmlMemBlocks()) {
3985 printf("Leak of %d blocks found in xmlSAX2Comment",
3986 xmlMemBlocks() - mem_base);
3988 printf(" %d", n_ctx);
3989 printf(" %d", n_value);
4001 test_xmlSAX2ElementDecl(void) {
4005 void * ctx; /* the user data (XML parser context) */
4007 xmlChar * name; /* the element name */
4009 int type; /* the element type */
4011 xmlElementContentPtr content; /* the element value tree */
4014 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4015 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4016 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4017 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4018 mem_base = xmlMemBlocks();
4019 ctx = gen_void_ptr(n_ctx, 0);
4020 name = gen_const_xmlChar_ptr(n_name, 1);
4021 type = gen_int(n_type, 2);
4022 content = gen_xmlElementContentPtr(n_content, 3);
4024 xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4026 des_void_ptr(n_ctx, ctx, 0);
4027 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4028 des_int(n_type, type, 2);
4029 des_xmlElementContentPtr(n_content, content, 3);
4030 xmlResetLastError();
4031 if (mem_base != xmlMemBlocks()) {
4032 printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4033 xmlMemBlocks() - mem_base);
4035 printf(" %d", n_ctx);
4036 printf(" %d", n_name);
4037 printf(" %d", n_type);
4038 printf(" %d", n_content);
4052 test_xmlSAX2EndDocument(void) {
4056 void * ctx; /* the user data (XML parser context) */
4059 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4060 mem_base = xmlMemBlocks();
4061 ctx = gen_void_ptr(n_ctx, 0);
4063 xmlSAX2EndDocument(ctx);
4065 des_void_ptr(n_ctx, ctx, 0);
4066 xmlResetLastError();
4067 if (mem_base != xmlMemBlocks()) {
4068 printf("Leak of %d blocks found in xmlSAX2EndDocument",
4069 xmlMemBlocks() - mem_base);
4071 printf(" %d", n_ctx);
4082 test_xmlSAX2EndElement(void) {
4085 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4086 #ifdef LIBXML_SAX1_ENABLED
4088 void * ctx; /* the user data (XML parser context) */
4090 xmlChar * name; /* The element name */
4093 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4094 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4095 mem_base = xmlMemBlocks();
4096 ctx = gen_void_ptr(n_ctx, 0);
4097 name = gen_const_xmlChar_ptr(n_name, 1);
4099 xmlSAX2EndElement(ctx, (const xmlChar *)name);
4101 des_void_ptr(n_ctx, ctx, 0);
4102 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4103 xmlResetLastError();
4104 if (mem_base != xmlMemBlocks()) {
4105 printf("Leak of %d blocks found in xmlSAX2EndElement",
4106 xmlMemBlocks() - mem_base);
4108 printf(" %d", n_ctx);
4109 printf(" %d", n_name);
4123 test_xmlSAX2EndElementNs(void) {
4127 void * ctx; /* the user data (XML parser context) */
4129 xmlChar * localname; /* the local name of the element */
4131 xmlChar * prefix; /* the element namespace prefix if available */
4133 xmlChar * URI; /* the element namespace name if available */
4136 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4137 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4138 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4139 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4140 mem_base = xmlMemBlocks();
4141 ctx = gen_void_ptr(n_ctx, 0);
4142 localname = gen_const_xmlChar_ptr(n_localname, 1);
4143 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4144 URI = gen_const_xmlChar_ptr(n_URI, 3);
4146 xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4148 des_void_ptr(n_ctx, ctx, 0);
4149 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4150 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4151 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4152 xmlResetLastError();
4153 if (mem_base != xmlMemBlocks()) {
4154 printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4155 xmlMemBlocks() - mem_base);
4157 printf(" %d", n_ctx);
4158 printf(" %d", n_localname);
4159 printf(" %d", n_prefix);
4160 printf(" %d", n_URI);
4174 test_xmlSAX2EntityDecl(void) {
4178 void * ctx; /* the user data (XML parser context) */
4180 xmlChar * name; /* the entity name */
4182 int type; /* the entity type */
4184 xmlChar * publicId; /* The public ID of the entity */
4186 xmlChar * systemId; /* The system ID of the entity */
4188 xmlChar * content; /* the entity value (without processing). */
4191 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4192 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4193 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4194 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4195 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4196 for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4197 mem_base = xmlMemBlocks();
4198 ctx = gen_void_ptr(n_ctx, 0);
4199 name = gen_const_xmlChar_ptr(n_name, 1);
4200 type = gen_int(n_type, 2);
4201 publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4202 systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4203 content = gen_xmlChar_ptr(n_content, 5);
4205 xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4207 des_void_ptr(n_ctx, ctx, 0);
4208 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4209 des_int(n_type, type, 2);
4210 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4211 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4212 des_xmlChar_ptr(n_content, content, 5);
4213 xmlResetLastError();
4214 if (mem_base != xmlMemBlocks()) {
4215 printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4216 xmlMemBlocks() - mem_base);
4218 printf(" %d", n_ctx);
4219 printf(" %d", n_name);
4220 printf(" %d", n_type);
4221 printf(" %d", n_publicId);
4222 printf(" %d", n_systemId);
4223 printf(" %d", n_content);
4239 test_xmlSAX2ExternalSubset(void) {
4243 void * ctx; /* the user data (XML parser context) */
4245 xmlChar * name; /* the root element name */
4247 xmlChar * ExternalID; /* the external ID */
4249 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4252 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4253 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4254 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4255 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4256 mem_base = xmlMemBlocks();
4257 ctx = gen_void_ptr(n_ctx, 0);
4258 name = gen_const_xmlChar_ptr(n_name, 1);
4259 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4260 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4262 xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4264 des_void_ptr(n_ctx, ctx, 0);
4265 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4266 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4267 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4268 xmlResetLastError();
4269 if (mem_base != xmlMemBlocks()) {
4270 printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4271 xmlMemBlocks() - mem_base);
4273 printf(" %d", n_ctx);
4274 printf(" %d", n_name);
4275 printf(" %d", n_ExternalID);
4276 printf(" %d", n_SystemID);
4290 test_xmlSAX2GetColumnNumber(void) {
4295 void * ctx; /* the user data (XML parser context) */
4298 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4299 mem_base = xmlMemBlocks();
4300 ctx = gen_void_ptr(n_ctx, 0);
4302 ret_val = xmlSAX2GetColumnNumber(ctx);
4303 desret_int(ret_val);
4305 des_void_ptr(n_ctx, ctx, 0);
4306 xmlResetLastError();
4307 if (mem_base != xmlMemBlocks()) {
4308 printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4309 xmlMemBlocks() - mem_base);
4311 printf(" %d", n_ctx);
4322 test_xmlSAX2GetEntity(void) {
4326 xmlEntityPtr ret_val;
4327 void * ctx; /* the user data (XML parser context) */
4329 xmlChar * name; /* The entity name */
4332 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4333 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4334 mem_base = xmlMemBlocks();
4335 ctx = gen_void_ptr(n_ctx, 0);
4336 name = gen_const_xmlChar_ptr(n_name, 1);
4338 ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4339 desret_xmlEntityPtr(ret_val);
4341 des_void_ptr(n_ctx, ctx, 0);
4342 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4343 xmlResetLastError();
4344 if (mem_base != xmlMemBlocks()) {
4345 printf("Leak of %d blocks found in xmlSAX2GetEntity",
4346 xmlMemBlocks() - mem_base);
4348 printf(" %d", n_ctx);
4349 printf(" %d", n_name);
4361 test_xmlSAX2GetLineNumber(void) {
4366 void * ctx; /* the user data (XML parser context) */
4369 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4370 mem_base = xmlMemBlocks();
4371 ctx = gen_void_ptr(n_ctx, 0);
4373 ret_val = xmlSAX2GetLineNumber(ctx);
4374 desret_int(ret_val);
4376 des_void_ptr(n_ctx, ctx, 0);
4377 xmlResetLastError();
4378 if (mem_base != xmlMemBlocks()) {
4379 printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4380 xmlMemBlocks() - mem_base);
4382 printf(" %d", n_ctx);
4393 test_xmlSAX2GetParameterEntity(void) {
4397 xmlEntityPtr ret_val;
4398 void * ctx; /* the user data (XML parser context) */
4400 xmlChar * name; /* The entity name */
4403 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4404 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4405 mem_base = xmlMemBlocks();
4406 ctx = gen_void_ptr(n_ctx, 0);
4407 name = gen_const_xmlChar_ptr(n_name, 1);
4409 ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4410 desret_xmlEntityPtr(ret_val);
4412 des_void_ptr(n_ctx, ctx, 0);
4413 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4414 xmlResetLastError();
4415 if (mem_base != xmlMemBlocks()) {
4416 printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4417 xmlMemBlocks() - mem_base);
4419 printf(" %d", n_ctx);
4420 printf(" %d", n_name);
4432 test_xmlSAX2GetPublicId(void) {
4436 const xmlChar * ret_val;
4437 void * ctx; /* the user data (XML parser context) */
4440 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4441 mem_base = xmlMemBlocks();
4442 ctx = gen_void_ptr(n_ctx, 0);
4444 ret_val = xmlSAX2GetPublicId(ctx);
4445 desret_const_xmlChar_ptr(ret_val);
4447 des_void_ptr(n_ctx, ctx, 0);
4448 xmlResetLastError();
4449 if (mem_base != xmlMemBlocks()) {
4450 printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4451 xmlMemBlocks() - mem_base);
4453 printf(" %d", n_ctx);
4464 test_xmlSAX2GetSystemId(void) {
4468 const xmlChar * ret_val;
4469 void * ctx; /* the user data (XML parser context) */
4472 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4473 mem_base = xmlMemBlocks();
4474 ctx = gen_void_ptr(n_ctx, 0);
4476 ret_val = xmlSAX2GetSystemId(ctx);
4477 desret_const_xmlChar_ptr(ret_val);
4479 des_void_ptr(n_ctx, ctx, 0);
4480 xmlResetLastError();
4481 if (mem_base != xmlMemBlocks()) {
4482 printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4483 xmlMemBlocks() - mem_base);
4485 printf(" %d", n_ctx);
4496 test_xmlSAX2HasExternalSubset(void) {
4501 void * ctx; /* the user data (XML parser context) */
4504 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4505 mem_base = xmlMemBlocks();
4506 ctx = gen_void_ptr(n_ctx, 0);
4508 ret_val = xmlSAX2HasExternalSubset(ctx);
4509 desret_int(ret_val);
4511 des_void_ptr(n_ctx, ctx, 0);
4512 xmlResetLastError();
4513 if (mem_base != xmlMemBlocks()) {
4514 printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4515 xmlMemBlocks() - mem_base);
4517 printf(" %d", n_ctx);
4528 test_xmlSAX2HasInternalSubset(void) {
4533 void * ctx; /* the user data (XML parser context) */
4536 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4537 mem_base = xmlMemBlocks();
4538 ctx = gen_void_ptr(n_ctx, 0);
4540 ret_val = xmlSAX2HasInternalSubset(ctx);
4541 desret_int(ret_val);
4543 des_void_ptr(n_ctx, ctx, 0);
4544 xmlResetLastError();
4545 if (mem_base != xmlMemBlocks()) {
4546 printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4547 xmlMemBlocks() - mem_base);
4549 printf(" %d", n_ctx);
4560 test_xmlSAX2IgnorableWhitespace(void) {
4564 void * ctx; /* the user data (XML parser context) */
4566 xmlChar * ch; /* a xmlChar string */
4568 int len; /* the number of xmlChar */
4571 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4572 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4573 for (n_len = 0;n_len < gen_nb_int;n_len++) {
4574 mem_base = xmlMemBlocks();
4575 ctx = gen_void_ptr(n_ctx, 0);
4576 ch = gen_const_xmlChar_ptr(n_ch, 1);
4577 len = gen_int(n_len, 2);
4579 (len > (int) strlen((const char *) ch) + 1))
4582 xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4584 des_void_ptr(n_ctx, ctx, 0);
4585 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4586 des_int(n_len, len, 2);
4587 xmlResetLastError();
4588 if (mem_base != xmlMemBlocks()) {
4589 printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4590 xmlMemBlocks() - mem_base);
4592 printf(" %d", n_ctx);
4593 printf(" %d", n_ch);
4594 printf(" %d", n_len);
4606 #define gen_nb_xmlSAXHandler_ptr 1
4607 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4610 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4614 test_xmlSAX2InitDefaultSAXHandler(void) {
4618 xmlSAXHandler * hdlr; /* the SAX handler */
4620 int warning; /* flag if non-zero sets the handler warning procedure */
4623 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4624 for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4625 mem_base = xmlMemBlocks();
4626 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4627 warning = gen_int(n_warning, 1);
4629 xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4631 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4632 des_int(n_warning, warning, 1);
4633 xmlResetLastError();
4634 if (mem_base != xmlMemBlocks()) {
4635 printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4636 xmlMemBlocks() - mem_base);
4638 printf(" %d", n_hdlr);
4639 printf(" %d", n_warning);
4651 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4654 #if defined(LIBXML_DOCB_ENABLED)
4656 xmlSAXHandler * hdlr; /* the SAX handler */
4659 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4660 mem_base = xmlMemBlocks();
4661 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4663 xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4665 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4666 xmlResetLastError();
4667 if (mem_base != xmlMemBlocks()) {
4668 printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4669 xmlMemBlocks() - mem_base);
4671 printf(" %d", n_hdlr);
4683 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4686 #if defined(LIBXML_HTML_ENABLED)
4688 xmlSAXHandler * hdlr; /* the SAX handler */
4691 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4692 mem_base = xmlMemBlocks();
4693 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4695 xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4697 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4698 xmlResetLastError();
4699 if (mem_base != xmlMemBlocks()) {
4700 printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4701 xmlMemBlocks() - mem_base);
4703 printf(" %d", n_hdlr);
4715 test_xmlSAX2InternalSubset(void) {
4719 void * ctx; /* the user data (XML parser context) */
4721 xmlChar * name; /* the root element name */
4723 xmlChar * ExternalID; /* the external ID */
4725 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4728 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4729 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4730 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4731 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4732 mem_base = xmlMemBlocks();
4733 ctx = gen_void_ptr(n_ctx, 0);
4734 name = gen_const_xmlChar_ptr(n_name, 1);
4735 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4736 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4738 xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4740 des_void_ptr(n_ctx, ctx, 0);
4741 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4742 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4743 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4744 xmlResetLastError();
4745 if (mem_base != xmlMemBlocks()) {
4746 printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4747 xmlMemBlocks() - mem_base);
4749 printf(" %d", n_ctx);
4750 printf(" %d", n_name);
4751 printf(" %d", n_ExternalID);
4752 printf(" %d", n_SystemID);
4766 test_xmlSAX2IsStandalone(void) {
4771 void * ctx; /* the user data (XML parser context) */
4774 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4775 mem_base = xmlMemBlocks();
4776 ctx = gen_void_ptr(n_ctx, 0);
4778 ret_val = xmlSAX2IsStandalone(ctx);
4779 desret_int(ret_val);
4781 des_void_ptr(n_ctx, ctx, 0);
4782 xmlResetLastError();
4783 if (mem_base != xmlMemBlocks()) {
4784 printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4785 xmlMemBlocks() - mem_base);
4787 printf(" %d", n_ctx);
4798 test_xmlSAX2NotationDecl(void) {
4802 void * ctx; /* the user data (XML parser context) */
4804 xmlChar * name; /* The name of the notation */
4806 xmlChar * publicId; /* The public ID of the entity */
4808 xmlChar * systemId; /* The system ID of the entity */
4811 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4812 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4813 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4814 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4815 mem_base = xmlMemBlocks();
4816 ctx = gen_void_ptr(n_ctx, 0);
4817 name = gen_const_xmlChar_ptr(n_name, 1);
4818 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4819 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4821 xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4823 des_void_ptr(n_ctx, ctx, 0);
4824 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4825 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4826 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4827 xmlResetLastError();
4828 if (mem_base != xmlMemBlocks()) {
4829 printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4830 xmlMemBlocks() - mem_base);
4832 printf(" %d", n_ctx);
4833 printf(" %d", n_name);
4834 printf(" %d", n_publicId);
4835 printf(" %d", n_systemId);
4849 test_xmlSAX2ProcessingInstruction(void) {
4853 void * ctx; /* the user data (XML parser context) */
4855 xmlChar * target; /* the target name */
4857 xmlChar * data; /* the PI data's */
4860 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4861 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4862 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4863 mem_base = xmlMemBlocks();
4864 ctx = gen_void_ptr(n_ctx, 0);
4865 target = gen_const_xmlChar_ptr(n_target, 1);
4866 data = gen_const_xmlChar_ptr(n_data, 2);
4868 xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4870 des_void_ptr(n_ctx, ctx, 0);
4871 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4872 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4873 xmlResetLastError();
4874 if (mem_base != xmlMemBlocks()) {
4875 printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4876 xmlMemBlocks() - mem_base);
4878 printf(" %d", n_ctx);
4879 printf(" %d", n_target);
4880 printf(" %d", n_data);
4893 test_xmlSAX2Reference(void) {
4897 void * ctx; /* the user data (XML parser context) */
4899 xmlChar * name; /* The entity name */
4902 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4903 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4904 mem_base = xmlMemBlocks();
4905 ctx = gen_void_ptr(n_ctx, 0);
4906 name = gen_const_xmlChar_ptr(n_name, 1);
4908 xmlSAX2Reference(ctx, (const xmlChar *)name);
4910 des_void_ptr(n_ctx, ctx, 0);
4911 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4912 xmlResetLastError();
4913 if (mem_base != xmlMemBlocks()) {
4914 printf("Leak of %d blocks found in xmlSAX2Reference",
4915 xmlMemBlocks() - mem_base);
4917 printf(" %d", n_ctx);
4918 printf(" %d", n_name);
4930 test_xmlSAX2ResolveEntity(void) {
4934 xmlParserInputPtr ret_val;
4935 void * ctx; /* the user data (XML parser context) */
4937 xmlChar * publicId; /* The public ID of the entity */
4939 xmlChar * systemId; /* The system ID of the entity */
4942 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4943 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4944 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4945 mem_base = xmlMemBlocks();
4946 ctx = gen_void_ptr(n_ctx, 0);
4947 publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4948 systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4950 ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4951 desret_xmlParserInputPtr(ret_val);
4953 des_void_ptr(n_ctx, ctx, 0);
4954 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4955 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4956 xmlResetLastError();
4957 if (mem_base != xmlMemBlocks()) {
4958 printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4959 xmlMemBlocks() - mem_base);
4961 printf(" %d", n_ctx);
4962 printf(" %d", n_publicId);
4963 printf(" %d", n_systemId);
4975 #define gen_nb_xmlSAXLocatorPtr 1
4976 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4979 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4983 test_xmlSAX2SetDocumentLocator(void) {
4987 void * ctx; /* the user data (XML parser context) */
4989 xmlSAXLocatorPtr loc; /* A SAX Locator */
4992 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4993 for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4994 mem_base = xmlMemBlocks();
4995 ctx = gen_void_ptr(n_ctx, 0);
4996 loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4998 xmlSAX2SetDocumentLocator(ctx, loc);
5000 des_void_ptr(n_ctx, ctx, 0);
5001 des_xmlSAXLocatorPtr(n_loc, loc, 1);
5002 xmlResetLastError();
5003 if (mem_base != xmlMemBlocks()) {
5004 printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
5005 xmlMemBlocks() - mem_base);
5007 printf(" %d", n_ctx);
5008 printf(" %d", n_loc);
5020 test_xmlSAX2StartDocument(void) {
5024 void * ctx; /* the user data (XML parser context) */
5027 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5028 mem_base = xmlMemBlocks();
5029 ctx = gen_void_ptr(n_ctx, 0);
5031 xmlSAX2StartDocument(ctx);
5033 des_void_ptr(n_ctx, ctx, 0);
5034 xmlResetLastError();
5035 if (mem_base != xmlMemBlocks()) {
5036 printf("Leak of %d blocks found in xmlSAX2StartDocument",
5037 xmlMemBlocks() - mem_base);
5039 printf(" %d", n_ctx);
5050 test_xmlSAX2StartElement(void) {
5053 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5054 #ifdef LIBXML_SAX1_ENABLED
5056 void * ctx; /* the user data (XML parser context) */
5058 xmlChar * fullname; /* The element name, including namespace prefix */
5060 xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5063 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5064 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5065 for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5066 mem_base = xmlMemBlocks();
5067 ctx = gen_void_ptr(n_ctx, 0);
5068 fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5069 atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5071 xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5073 des_void_ptr(n_ctx, ctx, 0);
5074 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5075 des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5076 xmlResetLastError();
5077 if (mem_base != xmlMemBlocks()) {
5078 printf("Leak of %d blocks found in xmlSAX2StartElement",
5079 xmlMemBlocks() - mem_base);
5081 printf(" %d", n_ctx);
5082 printf(" %d", n_fullname);
5083 printf(" %d", n_atts);
5098 test_xmlSAX2StartElementNs(void) {
5102 void * ctx; /* the user data (XML parser context) */
5104 xmlChar * localname; /* the local name of the element */
5106 xmlChar * prefix; /* the element namespace prefix if available */
5108 xmlChar * URI; /* the element namespace name if available */
5110 int nb_namespaces; /* number of namespace definitions on that node */
5111 int n_nb_namespaces;
5112 xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5114 int nb_attributes; /* the number of attributes on that node */
5115 int n_nb_attributes;
5116 int nb_defaulted; /* the number of defaulted attributes. */
5118 xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5121 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5122 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5123 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5124 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5125 for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5126 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5127 for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5128 for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5129 for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5130 mem_base = xmlMemBlocks();
5131 ctx = gen_void_ptr(n_ctx, 0);
5132 localname = gen_const_xmlChar_ptr(n_localname, 1);
5133 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5134 URI = gen_const_xmlChar_ptr(n_URI, 3);
5135 nb_namespaces = gen_int(n_nb_namespaces, 4);
5136 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5137 nb_attributes = gen_int(n_nb_attributes, 6);
5138 nb_defaulted = gen_int(n_nb_defaulted, 7);
5139 attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5141 xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5143 des_void_ptr(n_ctx, ctx, 0);
5144 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5145 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5146 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5147 des_int(n_nb_namespaces, nb_namespaces, 4);
5148 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5149 des_int(n_nb_attributes, nb_attributes, 6);
5150 des_int(n_nb_defaulted, nb_defaulted, 7);
5151 des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5152 xmlResetLastError();
5153 if (mem_base != xmlMemBlocks()) {
5154 printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5155 xmlMemBlocks() - mem_base);
5157 printf(" %d", n_ctx);
5158 printf(" %d", n_localname);
5159 printf(" %d", n_prefix);
5160 printf(" %d", n_URI);
5161 printf(" %d", n_nb_namespaces);
5162 printf(" %d", n_namespaces);
5163 printf(" %d", n_nb_attributes);
5164 printf(" %d", n_nb_defaulted);
5165 printf(" %d", n_attributes);
5184 test_xmlSAX2UnparsedEntityDecl(void) {
5188 void * ctx; /* the user data (XML parser context) */
5190 xmlChar * name; /* The name of the entity */
5192 xmlChar * publicId; /* The public ID of the entity */
5194 xmlChar * systemId; /* The system ID of the entity */
5196 xmlChar * notationName; /* the name of the notation */
5199 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5200 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5201 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5202 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5203 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5204 mem_base = xmlMemBlocks();
5205 ctx = gen_void_ptr(n_ctx, 0);
5206 name = gen_const_xmlChar_ptr(n_name, 1);
5207 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5208 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5209 notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5211 xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5213 des_void_ptr(n_ctx, ctx, 0);
5214 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5215 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5216 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5217 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5218 xmlResetLastError();
5219 if (mem_base != xmlMemBlocks()) {
5220 printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5221 xmlMemBlocks() - mem_base);
5223 printf(" %d", n_ctx);
5224 printf(" %d", n_name);
5225 printf(" %d", n_publicId);
5226 printf(" %d", n_systemId);
5227 printf(" %d", n_notationName);
5242 test_xmlSAXDefaultVersion(void) {
5245 #if defined(LIBXML_SAX1_ENABLED)
5246 #ifdef LIBXML_SAX1_ENABLED
5249 int version; /* the version, 1 or 2 */
5252 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5253 mem_base = xmlMemBlocks();
5254 version = gen_int(n_version, 0);
5256 ret_val = xmlSAXDefaultVersion(version);
5257 desret_int(ret_val);
5259 des_int(n_version, version, 0);
5260 xmlResetLastError();
5261 if (mem_base != xmlMemBlocks()) {
5262 printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5263 xmlMemBlocks() - mem_base);
5265 printf(" %d", n_version);
5278 test_xmlSAXVersion(void) {
5283 xmlSAXHandler * hdlr; /* the SAX handler */
5285 int version; /* the version, 1 or 2 */
5288 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5289 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5290 mem_base = xmlMemBlocks();
5291 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5292 version = gen_int(n_version, 1);
5294 ret_val = xmlSAXVersion(hdlr, version);
5295 desret_int(ret_val);
5297 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5298 des_int(n_version, version, 1);
5299 xmlResetLastError();
5300 if (mem_base != xmlMemBlocks()) {
5301 printf("Leak of %d blocks found in xmlSAXVersion",
5302 xmlMemBlocks() - mem_base);
5304 printf(" %d", n_hdlr);
5305 printf(" %d", n_version);
5319 if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5320 test_ret += test_docbDefaultSAXHandlerInit();
5321 test_ret += test_htmlDefaultSAXHandlerInit();
5322 test_ret += test_xmlDefaultSAXHandlerInit();
5323 test_ret += test_xmlSAX2AttributeDecl();
5324 test_ret += test_xmlSAX2CDataBlock();
5325 test_ret += test_xmlSAX2Characters();
5326 test_ret += test_xmlSAX2Comment();
5327 test_ret += test_xmlSAX2ElementDecl();
5328 test_ret += test_xmlSAX2EndDocument();
5329 test_ret += test_xmlSAX2EndElement();
5330 test_ret += test_xmlSAX2EndElementNs();
5331 test_ret += test_xmlSAX2EntityDecl();
5332 test_ret += test_xmlSAX2ExternalSubset();
5333 test_ret += test_xmlSAX2GetColumnNumber();
5334 test_ret += test_xmlSAX2GetEntity();
5335 test_ret += test_xmlSAX2GetLineNumber();
5336 test_ret += test_xmlSAX2GetParameterEntity();
5337 test_ret += test_xmlSAX2GetPublicId();
5338 test_ret += test_xmlSAX2GetSystemId();
5339 test_ret += test_xmlSAX2HasExternalSubset();
5340 test_ret += test_xmlSAX2HasInternalSubset();
5341 test_ret += test_xmlSAX2IgnorableWhitespace();
5342 test_ret += test_xmlSAX2InitDefaultSAXHandler();
5343 test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5344 test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5345 test_ret += test_xmlSAX2InternalSubset();
5346 test_ret += test_xmlSAX2IsStandalone();
5347 test_ret += test_xmlSAX2NotationDecl();
5348 test_ret += test_xmlSAX2ProcessingInstruction();
5349 test_ret += test_xmlSAX2Reference();
5350 test_ret += test_xmlSAX2ResolveEntity();
5351 test_ret += test_xmlSAX2SetDocumentLocator();
5352 test_ret += test_xmlSAX2StartDocument();
5353 test_ret += test_xmlSAX2StartElement();
5354 test_ret += test_xmlSAX2StartElementNs();
5355 test_ret += test_xmlSAX2UnparsedEntityDecl();
5356 test_ret += test_xmlSAXDefaultVersion();
5357 test_ret += test_xmlSAXVersion();
5360 printf("Module SAX2: %d errors\n", test_ret);
5365 test_xmlC14NDocDumpMemory(void) {
5368 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5371 xmlDocPtr doc; /* the XML document for canonization */
5373 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5375 int mode; /* the c14n mode (see @xmlC14NMode) */
5377 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) */
5378 int n_inclusive_ns_prefixes;
5379 int with_comments; /* include comments in the result (!=0) or not (==0) */
5380 int n_with_comments;
5381 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 */
5384 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5385 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5386 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5387 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5388 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5389 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5390 mem_base = xmlMemBlocks();
5391 doc = gen_xmlDocPtr(n_doc, 0);
5392 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5393 mode = gen_int(n_mode, 2);
5394 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5395 with_comments = gen_int(n_with_comments, 4);
5396 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5398 ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5399 desret_int(ret_val);
5401 des_xmlDocPtr(n_doc, doc, 0);
5402 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5403 des_int(n_mode, mode, 2);
5404 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5405 des_int(n_with_comments, with_comments, 4);
5406 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5407 xmlResetLastError();
5408 if (mem_base != xmlMemBlocks()) {
5409 printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5410 xmlMemBlocks() - mem_base);
5412 printf(" %d", n_doc);
5413 printf(" %d", n_nodes);
5414 printf(" %d", n_mode);
5415 printf(" %d", n_inclusive_ns_prefixes);
5416 printf(" %d", n_with_comments);
5417 printf(" %d", n_doc_txt_ptr);
5434 test_xmlC14NDocSave(void) {
5437 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5440 xmlDocPtr doc; /* the XML document for canonization */
5442 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5444 int mode; /* the c14n mode (see @xmlC14NMode) */
5446 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) */
5447 int n_inclusive_ns_prefixes;
5448 int with_comments; /* include comments in the result (!=0) or not (==0) */
5449 int n_with_comments;
5450 const char * filename; /* the filename to store canonical XML image */
5452 int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5455 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5456 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5457 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5458 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5459 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5460 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5461 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5462 mem_base = xmlMemBlocks();
5463 doc = gen_xmlDocPtr(n_doc, 0);
5464 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5465 mode = gen_int(n_mode, 2);
5466 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5467 with_comments = gen_int(n_with_comments, 4);
5468 filename = gen_fileoutput(n_filename, 5);
5469 compression = gen_int(n_compression, 6);
5471 ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5472 desret_int(ret_val);
5474 des_xmlDocPtr(n_doc, doc, 0);
5475 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5476 des_int(n_mode, mode, 2);
5477 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5478 des_int(n_with_comments, with_comments, 4);
5479 des_fileoutput(n_filename, filename, 5);
5480 des_int(n_compression, compression, 6);
5481 xmlResetLastError();
5482 if (mem_base != xmlMemBlocks()) {
5483 printf("Leak of %d blocks found in xmlC14NDocSave",
5484 xmlMemBlocks() - mem_base);
5486 printf(" %d", n_doc);
5487 printf(" %d", n_nodes);
5488 printf(" %d", n_mode);
5489 printf(" %d", n_inclusive_ns_prefixes);
5490 printf(" %d", n_with_comments);
5491 printf(" %d", n_filename);
5492 printf(" %d", n_compression);
5510 test_xmlC14NDocSaveTo(void) {
5513 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5516 xmlDocPtr doc; /* the XML document for canonization */
5518 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5520 int mode; /* the c14n mode (see @xmlC14NMode) */
5522 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) */
5523 int n_inclusive_ns_prefixes;
5524 int with_comments; /* include comments in the result (!=0) or not (==0) */
5525 int n_with_comments;
5526 xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5529 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5530 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5531 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5532 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5533 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5534 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5535 mem_base = xmlMemBlocks();
5536 doc = gen_xmlDocPtr(n_doc, 0);
5537 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5538 mode = gen_int(n_mode, 2);
5539 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5540 with_comments = gen_int(n_with_comments, 4);
5541 buf = gen_xmlOutputBufferPtr(n_buf, 5);
5543 ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5544 desret_int(ret_val);
5546 des_xmlDocPtr(n_doc, doc, 0);
5547 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5548 des_int(n_mode, mode, 2);
5549 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5550 des_int(n_with_comments, with_comments, 4);
5551 des_xmlOutputBufferPtr(n_buf, buf, 5);
5552 xmlResetLastError();
5553 if (mem_base != xmlMemBlocks()) {
5554 printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5555 xmlMemBlocks() - mem_base);
5557 printf(" %d", n_doc);
5558 printf(" %d", n_nodes);
5559 printf(" %d", n_mode);
5560 printf(" %d", n_inclusive_ns_prefixes);
5561 printf(" %d", n_with_comments);
5562 printf(" %d", n_buf);
5579 test_xmlC14NExecute(void) {
5583 /* missing type support */
5591 if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5592 test_ret += test_xmlC14NDocDumpMemory();
5593 test_ret += test_xmlC14NDocSave();
5594 test_ret += test_xmlC14NDocSaveTo();
5595 test_ret += test_xmlC14NExecute();
5598 printf("Module c14n: %d errors\n", test_ret);
5601 #ifdef LIBXML_CATALOG_ENABLED
5603 #define gen_nb_xmlCatalogPtr 1
5604 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5607 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5613 test_xmlACatalogAdd(void) {
5616 #if defined(LIBXML_CATALOG_ENABLED)
5619 xmlCatalogPtr catal; /* a Catalog */
5621 xmlChar * type; /* the type of record to add to the catalog */
5623 xmlChar * orig; /* the system, public or prefix to match */
5625 xmlChar * replace; /* the replacement value for the match */
5628 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5629 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5630 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5631 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5632 mem_base = xmlMemBlocks();
5633 catal = gen_xmlCatalogPtr(n_catal, 0);
5634 type = gen_const_xmlChar_ptr(n_type, 1);
5635 orig = gen_const_xmlChar_ptr(n_orig, 2);
5636 replace = gen_const_xmlChar_ptr(n_replace, 3);
5638 ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5639 desret_int(ret_val);
5641 des_xmlCatalogPtr(n_catal, catal, 0);
5642 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5643 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5644 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5645 xmlResetLastError();
5646 if (mem_base != xmlMemBlocks()) {
5647 printf("Leak of %d blocks found in xmlACatalogAdd",
5648 xmlMemBlocks() - mem_base);
5650 printf(" %d", n_catal);
5651 printf(" %d", n_type);
5652 printf(" %d", n_orig);
5653 printf(" %d", n_replace);
5668 test_xmlACatalogDump(void) {
5671 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5673 xmlCatalogPtr catal; /* a Catalog */
5675 FILE * out; /* the file. */
5678 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5679 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5680 mem_base = xmlMemBlocks();
5681 catal = gen_xmlCatalogPtr(n_catal, 0);
5682 out = gen_FILE_ptr(n_out, 1);
5684 xmlACatalogDump(catal, out);
5686 des_xmlCatalogPtr(n_catal, catal, 0);
5687 des_FILE_ptr(n_out, out, 1);
5688 xmlResetLastError();
5689 if (mem_base != xmlMemBlocks()) {
5690 printf("Leak of %d blocks found in xmlACatalogDump",
5691 xmlMemBlocks() - mem_base);
5693 printf(" %d", n_catal);
5694 printf(" %d", n_out);
5707 test_xmlACatalogRemove(void) {
5710 #if defined(LIBXML_CATALOG_ENABLED)
5713 xmlCatalogPtr catal; /* a Catalog */
5715 xmlChar * value; /* the value to remove */
5718 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5719 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5720 mem_base = xmlMemBlocks();
5721 catal = gen_xmlCatalogPtr(n_catal, 0);
5722 value = gen_const_xmlChar_ptr(n_value, 1);
5724 ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5725 desret_int(ret_val);
5727 des_xmlCatalogPtr(n_catal, catal, 0);
5728 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5729 xmlResetLastError();
5730 if (mem_base != xmlMemBlocks()) {
5731 printf("Leak of %d blocks found in xmlACatalogRemove",
5732 xmlMemBlocks() - mem_base);
5734 printf(" %d", n_catal);
5735 printf(" %d", n_value);
5748 test_xmlACatalogResolve(void) {
5751 #if defined(LIBXML_CATALOG_ENABLED)
5754 xmlCatalogPtr catal; /* a Catalog */
5756 xmlChar * pubID; /* the public ID string */
5758 xmlChar * sysID; /* the system ID string */
5761 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5762 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5763 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5764 mem_base = xmlMemBlocks();
5765 catal = gen_xmlCatalogPtr(n_catal, 0);
5766 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5767 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5769 ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5770 desret_xmlChar_ptr(ret_val);
5772 des_xmlCatalogPtr(n_catal, catal, 0);
5773 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5774 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5775 xmlResetLastError();
5776 if (mem_base != xmlMemBlocks()) {
5777 printf("Leak of %d blocks found in xmlACatalogResolve",
5778 xmlMemBlocks() - mem_base);
5780 printf(" %d", n_catal);
5781 printf(" %d", n_pubID);
5782 printf(" %d", n_sysID);
5796 test_xmlACatalogResolvePublic(void) {
5799 #if defined(LIBXML_CATALOG_ENABLED)
5802 xmlCatalogPtr catal; /* a Catalog */
5804 xmlChar * pubID; /* the public ID string */
5807 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5808 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5809 mem_base = xmlMemBlocks();
5810 catal = gen_xmlCatalogPtr(n_catal, 0);
5811 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5813 ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5814 desret_xmlChar_ptr(ret_val);
5816 des_xmlCatalogPtr(n_catal, catal, 0);
5817 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5818 xmlResetLastError();
5819 if (mem_base != xmlMemBlocks()) {
5820 printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5821 xmlMemBlocks() - mem_base);
5823 printf(" %d", n_catal);
5824 printf(" %d", n_pubID);
5837 test_xmlACatalogResolveSystem(void) {
5840 #if defined(LIBXML_CATALOG_ENABLED)
5843 xmlCatalogPtr catal; /* a Catalog */
5845 xmlChar * sysID; /* the system ID string */
5848 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5849 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5850 mem_base = xmlMemBlocks();
5851 catal = gen_xmlCatalogPtr(n_catal, 0);
5852 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5854 ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5855 desret_xmlChar_ptr(ret_val);
5857 des_xmlCatalogPtr(n_catal, catal, 0);
5858 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5859 xmlResetLastError();
5860 if (mem_base != xmlMemBlocks()) {
5861 printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5862 xmlMemBlocks() - mem_base);
5864 printf(" %d", n_catal);
5865 printf(" %d", n_sysID);
5878 test_xmlACatalogResolveURI(void) {
5881 #if defined(LIBXML_CATALOG_ENABLED)
5884 xmlCatalogPtr catal; /* a Catalog */
5886 xmlChar * URI; /* the URI */
5889 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5890 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5891 mem_base = xmlMemBlocks();
5892 catal = gen_xmlCatalogPtr(n_catal, 0);
5893 URI = gen_const_xmlChar_ptr(n_URI, 1);
5895 ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5896 desret_xmlChar_ptr(ret_val);
5898 des_xmlCatalogPtr(n_catal, catal, 0);
5899 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5900 xmlResetLastError();
5901 if (mem_base != xmlMemBlocks()) {
5902 printf("Leak of %d blocks found in xmlACatalogResolveURI",
5903 xmlMemBlocks() - mem_base);
5905 printf(" %d", n_catal);
5906 printf(" %d", n_URI);
5919 test_xmlCatalogAdd(void) {
5922 #if defined(LIBXML_CATALOG_ENABLED)
5925 xmlChar * type; /* the type of record to add to the catalog */
5927 xmlChar * orig; /* the system, public or prefix to match */
5929 xmlChar * replace; /* the replacement value for the match */
5932 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5933 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5934 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5935 mem_base = xmlMemBlocks();
5936 type = gen_const_xmlChar_ptr(n_type, 0);
5937 orig = gen_const_xmlChar_ptr(n_orig, 1);
5938 replace = gen_const_xmlChar_ptr(n_replace, 2);
5940 ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5941 desret_int(ret_val);
5943 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5944 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5945 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5946 xmlResetLastError();
5947 if (mem_base != xmlMemBlocks()) {
5948 printf("Leak of %d blocks found in xmlCatalogAdd",
5949 xmlMemBlocks() - mem_base);
5951 printf(" %d", n_type);
5952 printf(" %d", n_orig);
5953 printf(" %d", n_replace);
5967 test_xmlCatalogCleanup(void) {
5970 #if defined(LIBXML_CATALOG_ENABLED)
5973 xmlCatalogCleanup();
5975 xmlResetLastError();
5984 test_xmlCatalogConvert(void) {
5987 #if defined(LIBXML_CATALOG_ENABLED)
5991 ret_val = xmlCatalogConvert();
5992 desret_int(ret_val);
5994 xmlResetLastError();
6003 test_xmlCatalogDump(void) {
6006 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
6008 FILE * out; /* the file. */
6011 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
6012 mem_base = xmlMemBlocks();
6013 out = gen_FILE_ptr(n_out, 0);
6015 xmlCatalogDump(out);
6017 des_FILE_ptr(n_out, out, 0);
6018 xmlResetLastError();
6019 if (mem_base != xmlMemBlocks()) {
6020 printf("Leak of %d blocks found in xmlCatalogDump",
6021 xmlMemBlocks() - mem_base);
6023 printf(" %d", n_out);
6035 test_xmlCatalogGetDefaults(void) {
6038 #if defined(LIBXML_CATALOG_ENABLED)
6040 xmlCatalogAllow ret_val;
6042 mem_base = xmlMemBlocks();
6044 ret_val = xmlCatalogGetDefaults();
6045 desret_xmlCatalogAllow(ret_val);
6047 xmlResetLastError();
6048 if (mem_base != xmlMemBlocks()) {
6049 printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6050 xmlMemBlocks() - mem_base);
6062 test_xmlCatalogIsEmpty(void) {
6065 #if defined(LIBXML_CATALOG_ENABLED)
6068 xmlCatalogPtr catal; /* should this create an SGML catalog */
6071 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6072 mem_base = xmlMemBlocks();
6073 catal = gen_xmlCatalogPtr(n_catal, 0);
6075 ret_val = xmlCatalogIsEmpty(catal);
6076 desret_int(ret_val);
6078 des_xmlCatalogPtr(n_catal, catal, 0);
6079 xmlResetLastError();
6080 if (mem_base != xmlMemBlocks()) {
6081 printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6082 xmlMemBlocks() - mem_base);
6084 printf(" %d", n_catal);
6096 test_xmlCatalogLocalResolve(void) {
6099 #if defined(LIBXML_CATALOG_ENABLED)
6102 void * catalogs; /* a document's list of catalogs */
6104 xmlChar * pubID; /* the public ID string */
6106 xmlChar * sysID; /* the system ID string */
6109 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6110 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6111 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6112 mem_base = xmlMemBlocks();
6113 catalogs = gen_void_ptr(n_catalogs, 0);
6114 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6115 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6117 ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6118 desret_xmlChar_ptr(ret_val);
6120 des_void_ptr(n_catalogs, catalogs, 0);
6121 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6122 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6123 xmlResetLastError();
6124 if (mem_base != xmlMemBlocks()) {
6125 printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6126 xmlMemBlocks() - mem_base);
6128 printf(" %d", n_catalogs);
6129 printf(" %d", n_pubID);
6130 printf(" %d", n_sysID);
6144 test_xmlCatalogLocalResolveURI(void) {
6147 #if defined(LIBXML_CATALOG_ENABLED)
6150 void * catalogs; /* a document's list of catalogs */
6152 xmlChar * URI; /* the URI */
6155 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6156 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6157 mem_base = xmlMemBlocks();
6158 catalogs = gen_void_ptr(n_catalogs, 0);
6159 URI = gen_const_xmlChar_ptr(n_URI, 1);
6161 ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6162 desret_xmlChar_ptr(ret_val);
6164 des_void_ptr(n_catalogs, catalogs, 0);
6165 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6166 xmlResetLastError();
6167 if (mem_base != xmlMemBlocks()) {
6168 printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6169 xmlMemBlocks() - mem_base);
6171 printf(" %d", n_catalogs);
6172 printf(" %d", n_URI);
6185 test_xmlCatalogRemove(void) {
6188 #if defined(LIBXML_CATALOG_ENABLED)
6190 xmlChar * value; /* the value to remove */
6193 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6194 value = gen_const_xmlChar_ptr(n_value, 0);
6196 ret_val = xmlCatalogRemove((const xmlChar *)value);
6197 desret_int(ret_val);
6199 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6200 xmlResetLastError();
6210 test_xmlCatalogResolve(void) {
6213 #if defined(LIBXML_CATALOG_ENABLED)
6215 xmlChar * pubID; /* the public ID string */
6217 xmlChar * sysID; /* the system ID string */
6220 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6221 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6222 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6223 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6225 ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6226 desret_xmlChar_ptr(ret_val);
6228 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6229 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6230 xmlResetLastError();
6241 test_xmlCatalogResolvePublic(void) {
6244 #if defined(LIBXML_CATALOG_ENABLED)
6247 xmlChar * pubID; /* the public ID string */
6250 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6251 mem_base = xmlMemBlocks();
6252 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6254 ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6255 desret_xmlChar_ptr(ret_val);
6257 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6258 xmlResetLastError();
6259 if (mem_base != xmlMemBlocks()) {
6260 printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6261 xmlMemBlocks() - mem_base);
6263 printf(" %d", n_pubID);
6275 test_xmlCatalogResolveSystem(void) {
6278 #if defined(LIBXML_CATALOG_ENABLED)
6281 xmlChar * sysID; /* the system ID string */
6284 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6285 mem_base = xmlMemBlocks();
6286 sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6288 ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6289 desret_xmlChar_ptr(ret_val);
6291 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6292 xmlResetLastError();
6293 if (mem_base != xmlMemBlocks()) {
6294 printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6295 xmlMemBlocks() - mem_base);
6297 printf(" %d", n_sysID);
6309 test_xmlCatalogResolveURI(void) {
6312 #if defined(LIBXML_CATALOG_ENABLED)
6315 xmlChar * URI; /* the URI */
6318 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6319 mem_base = xmlMemBlocks();
6320 URI = gen_const_xmlChar_ptr(n_URI, 0);
6322 ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6323 desret_xmlChar_ptr(ret_val);
6325 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6326 xmlResetLastError();
6327 if (mem_base != xmlMemBlocks()) {
6328 printf("Leak of %d blocks found in xmlCatalogResolveURI",
6329 xmlMemBlocks() - mem_base);
6331 printf(" %d", n_URI);
6343 test_xmlCatalogSetDefaultPrefer(void) {
6346 #if defined(LIBXML_CATALOG_ENABLED)
6348 xmlCatalogPrefer ret_val;
6349 xmlCatalogPrefer prefer; /* the default preference for delegation */
6352 for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6353 mem_base = xmlMemBlocks();
6354 prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6356 ret_val = xmlCatalogSetDefaultPrefer(prefer);
6357 desret_xmlCatalogPrefer(ret_val);
6359 des_xmlCatalogPrefer(n_prefer, prefer, 0);
6360 xmlResetLastError();
6361 if (mem_base != xmlMemBlocks()) {
6362 printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6363 xmlMemBlocks() - mem_base);
6365 printf(" %d", n_prefer);
6377 test_xmlCatalogSetDefaults(void) {
6380 #if defined(LIBXML_CATALOG_ENABLED)
6382 xmlCatalogAllow allow; /* what catalogs should be accepted */
6385 for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6386 mem_base = xmlMemBlocks();
6387 allow = gen_xmlCatalogAllow(n_allow, 0);
6389 xmlCatalogSetDefaults(allow);
6391 des_xmlCatalogAllow(n_allow, allow, 0);
6392 xmlResetLastError();
6393 if (mem_base != xmlMemBlocks()) {
6394 printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6395 xmlMemBlocks() - mem_base);
6397 printf(" %d", n_allow);
6409 test_xmlConvertSGMLCatalog(void) {
6412 #if defined(LIBXML_CATALOG_ENABLED)
6415 xmlCatalogPtr catal; /* the catalog */
6418 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6419 mem_base = xmlMemBlocks();
6420 catal = gen_xmlCatalogPtr(n_catal, 0);
6422 ret_val = xmlConvertSGMLCatalog(catal);
6423 desret_int(ret_val);
6425 des_xmlCatalogPtr(n_catal, catal, 0);
6426 xmlResetLastError();
6427 if (mem_base != xmlMemBlocks()) {
6428 printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6429 xmlMemBlocks() - mem_base);
6431 printf(" %d", n_catal);
6443 test_xmlInitializeCatalog(void) {
6446 #if defined(LIBXML_CATALOG_ENABLED)
6449 mem_base = xmlMemBlocks();
6451 xmlInitializeCatalog();
6453 xmlResetLastError();
6454 if (mem_base != xmlMemBlocks()) {
6455 printf("Leak of %d blocks found in xmlInitializeCatalog",
6456 xmlMemBlocks() - mem_base);
6468 test_xmlLoadACatalog(void) {
6472 /* missing type support */
6478 test_xmlLoadCatalog(void) {
6481 #if defined(LIBXML_CATALOG_ENABLED)
6483 const char * filename; /* a file path */
6486 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6487 filename = gen_filepath(n_filename, 0);
6489 ret_val = xmlLoadCatalog(filename);
6490 desret_int(ret_val);
6492 des_filepath(n_filename, filename, 0);
6493 xmlResetLastError();
6503 test_xmlLoadCatalogs(void) {
6506 #if defined(LIBXML_CATALOG_ENABLED)
6507 char * pathss; /* a list of directories separated by a colon or a space. */
6510 for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6511 pathss = gen_const_char_ptr(n_pathss, 0);
6513 xmlLoadCatalogs((const char *)pathss);
6515 des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6516 xmlResetLastError();
6526 test_xmlLoadSGMLSuperCatalog(void) {
6530 /* missing type support */
6536 test_xmlNewCatalog(void) {
6540 /* missing type support */
6546 test_xmlParseCatalogFile(void) {
6549 #if defined(LIBXML_CATALOG_ENABLED)
6552 const char * filename; /* the filename */
6555 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6556 mem_base = xmlMemBlocks();
6557 filename = gen_filepath(n_filename, 0);
6559 ret_val = xmlParseCatalogFile(filename);
6560 desret_xmlDocPtr(ret_val);
6562 des_filepath(n_filename, filename, 0);
6563 xmlResetLastError();
6564 if (mem_base != xmlMemBlocks()) {
6565 printf("Leak of %d blocks found in xmlParseCatalogFile",
6566 xmlMemBlocks() - mem_base);
6568 printf(" %d", n_filename);
6579 test_catalog(void) {
6582 if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6583 test_ret += test_xmlACatalogAdd();
6584 test_ret += test_xmlACatalogDump();
6585 test_ret += test_xmlACatalogRemove();
6586 test_ret += test_xmlACatalogResolve();
6587 test_ret += test_xmlACatalogResolvePublic();
6588 test_ret += test_xmlACatalogResolveSystem();
6589 test_ret += test_xmlACatalogResolveURI();
6590 test_ret += test_xmlCatalogAdd();
6591 test_ret += test_xmlCatalogCleanup();
6592 test_ret += test_xmlCatalogConvert();
6593 test_ret += test_xmlCatalogDump();
6594 test_ret += test_xmlCatalogGetDefaults();
6595 test_ret += test_xmlCatalogIsEmpty();
6596 test_ret += test_xmlCatalogLocalResolve();
6597 test_ret += test_xmlCatalogLocalResolveURI();
6598 test_ret += test_xmlCatalogRemove();
6599 test_ret += test_xmlCatalogResolve();
6600 test_ret += test_xmlCatalogResolvePublic();
6601 test_ret += test_xmlCatalogResolveSystem();
6602 test_ret += test_xmlCatalogResolveURI();
6603 test_ret += test_xmlCatalogSetDefaultPrefer();
6604 test_ret += test_xmlCatalogSetDefaults();
6605 test_ret += test_xmlConvertSGMLCatalog();
6606 test_ret += test_xmlInitializeCatalog();
6607 test_ret += test_xmlLoadACatalog();
6608 test_ret += test_xmlLoadCatalog();
6609 test_ret += test_xmlLoadCatalogs();
6610 test_ret += test_xmlLoadSGMLSuperCatalog();
6611 test_ret += test_xmlNewCatalog();
6612 test_ret += test_xmlParseCatalogFile();
6615 printf("Module catalog: %d errors\n", test_ret);
6619 #define gen_nb_const_xmlChRangeGroup_ptr 1
6620 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6623 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6627 test_xmlCharInRange(void) {
6632 unsigned int val; /* character to be validated */
6634 xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6637 for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6638 for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6639 mem_base = xmlMemBlocks();
6640 val = gen_unsigned_int(n_val, 0);
6641 rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6643 ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6644 desret_int(ret_val);
6646 des_unsigned_int(n_val, val, 0);
6647 des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6648 xmlResetLastError();
6649 if (mem_base != xmlMemBlocks()) {
6650 printf("Leak of %d blocks found in xmlCharInRange",
6651 xmlMemBlocks() - mem_base);
6653 printf(" %d", n_val);
6654 printf(" %d", n_rptr);
6666 test_xmlIsBaseChar(void) {
6671 unsigned int ch; /* character to validate */
6674 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6675 mem_base = xmlMemBlocks();
6676 ch = gen_unsigned_int(n_ch, 0);
6678 ret_val = xmlIsBaseChar(ch);
6679 desret_int(ret_val);
6681 des_unsigned_int(n_ch, ch, 0);
6682 xmlResetLastError();
6683 if (mem_base != xmlMemBlocks()) {
6684 printf("Leak of %d blocks found in xmlIsBaseChar",
6685 xmlMemBlocks() - mem_base);
6687 printf(" %d", n_ch);
6698 test_xmlIsBlank(void) {
6703 unsigned int ch; /* character to validate */
6706 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6707 mem_base = xmlMemBlocks();
6708 ch = gen_unsigned_int(n_ch, 0);
6710 ret_val = xmlIsBlank(ch);
6711 desret_int(ret_val);
6713 des_unsigned_int(n_ch, ch, 0);
6714 xmlResetLastError();
6715 if (mem_base != xmlMemBlocks()) {
6716 printf("Leak of %d blocks found in xmlIsBlank",
6717 xmlMemBlocks() - mem_base);
6719 printf(" %d", n_ch);
6730 test_xmlIsChar(void) {
6735 unsigned int ch; /* character to validate */
6738 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6739 mem_base = xmlMemBlocks();
6740 ch = gen_unsigned_int(n_ch, 0);
6742 ret_val = xmlIsChar(ch);
6743 desret_int(ret_val);
6745 des_unsigned_int(n_ch, ch, 0);
6746 xmlResetLastError();
6747 if (mem_base != xmlMemBlocks()) {
6748 printf("Leak of %d blocks found in xmlIsChar",
6749 xmlMemBlocks() - mem_base);
6751 printf(" %d", n_ch);
6762 test_xmlIsCombining(void) {
6767 unsigned int ch; /* character to validate */
6770 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6771 mem_base = xmlMemBlocks();
6772 ch = gen_unsigned_int(n_ch, 0);
6774 ret_val = xmlIsCombining(ch);
6775 desret_int(ret_val);
6777 des_unsigned_int(n_ch, ch, 0);
6778 xmlResetLastError();
6779 if (mem_base != xmlMemBlocks()) {
6780 printf("Leak of %d blocks found in xmlIsCombining",
6781 xmlMemBlocks() - mem_base);
6783 printf(" %d", n_ch);
6794 test_xmlIsDigit(void) {
6799 unsigned int ch; /* character to validate */
6802 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6803 mem_base = xmlMemBlocks();
6804 ch = gen_unsigned_int(n_ch, 0);
6806 ret_val = xmlIsDigit(ch);
6807 desret_int(ret_val);
6809 des_unsigned_int(n_ch, ch, 0);
6810 xmlResetLastError();
6811 if (mem_base != xmlMemBlocks()) {
6812 printf("Leak of %d blocks found in xmlIsDigit",
6813 xmlMemBlocks() - mem_base);
6815 printf(" %d", n_ch);
6826 test_xmlIsExtender(void) {
6831 unsigned int ch; /* character to validate */
6834 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6835 mem_base = xmlMemBlocks();
6836 ch = gen_unsigned_int(n_ch, 0);
6838 ret_val = xmlIsExtender(ch);
6839 desret_int(ret_val);
6841 des_unsigned_int(n_ch, ch, 0);
6842 xmlResetLastError();
6843 if (mem_base != xmlMemBlocks()) {
6844 printf("Leak of %d blocks found in xmlIsExtender",
6845 xmlMemBlocks() - mem_base);
6847 printf(" %d", n_ch);
6858 test_xmlIsIdeographic(void) {
6863 unsigned int ch; /* character to validate */
6866 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6867 mem_base = xmlMemBlocks();
6868 ch = gen_unsigned_int(n_ch, 0);
6870 ret_val = xmlIsIdeographic(ch);
6871 desret_int(ret_val);
6873 des_unsigned_int(n_ch, ch, 0);
6874 xmlResetLastError();
6875 if (mem_base != xmlMemBlocks()) {
6876 printf("Leak of %d blocks found in xmlIsIdeographic",
6877 xmlMemBlocks() - mem_base);
6879 printf(" %d", n_ch);
6890 test_xmlIsPubidChar(void) {
6895 unsigned int ch; /* character to validate */
6898 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6899 mem_base = xmlMemBlocks();
6900 ch = gen_unsigned_int(n_ch, 0);
6902 ret_val = xmlIsPubidChar(ch);
6903 desret_int(ret_val);
6905 des_unsigned_int(n_ch, ch, 0);
6906 xmlResetLastError();
6907 if (mem_base != xmlMemBlocks()) {
6908 printf("Leak of %d blocks found in xmlIsPubidChar",
6909 xmlMemBlocks() - mem_base);
6911 printf(" %d", n_ch);
6921 test_chvalid(void) {
6924 if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6925 test_ret += test_xmlCharInRange();
6926 test_ret += test_xmlIsBaseChar();
6927 test_ret += test_xmlIsBlank();
6928 test_ret += test_xmlIsChar();
6929 test_ret += test_xmlIsCombining();
6930 test_ret += test_xmlIsDigit();
6931 test_ret += test_xmlIsExtender();
6932 test_ret += test_xmlIsIdeographic();
6933 test_ret += test_xmlIsPubidChar();
6936 printf("Module chvalid: %d errors\n", test_ret);
6941 test_xmlBoolToText(void) {
6944 #if defined(LIBXML_DEBUG_ENABLED)
6946 const char * ret_val;
6947 int boolval; /* a bool to turn into text */
6950 for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6951 mem_base = xmlMemBlocks();
6952 boolval = gen_int(n_boolval, 0);
6954 ret_val = xmlBoolToText(boolval);
6955 desret_const_char_ptr(ret_val);
6957 des_int(n_boolval, boolval, 0);
6958 xmlResetLastError();
6959 if (mem_base != xmlMemBlocks()) {
6960 printf("Leak of %d blocks found in xmlBoolToText",
6961 xmlMemBlocks() - mem_base);
6963 printf(" %d", n_boolval);
6975 test_xmlDebugCheckDocument(void) {
6978 #if defined(LIBXML_DEBUG_ENABLED)
6981 FILE * output; /* the FILE * for the output */
6983 xmlDocPtr doc; /* the document */
6986 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6987 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6988 mem_base = xmlMemBlocks();
6989 output = gen_debug_FILE_ptr(n_output, 0);
6990 doc = gen_xmlDocPtr(n_doc, 1);
6992 ret_val = xmlDebugCheckDocument(output, doc);
6993 desret_int(ret_val);
6995 des_debug_FILE_ptr(n_output, output, 0);
6996 des_xmlDocPtr(n_doc, doc, 1);
6997 xmlResetLastError();
6998 if (mem_base != xmlMemBlocks()) {
6999 printf("Leak of %d blocks found in xmlDebugCheckDocument",
7000 xmlMemBlocks() - mem_base);
7002 printf(" %d", n_output);
7003 printf(" %d", n_doc);
7016 test_xmlDebugDumpAttr(void) {
7019 #if defined(LIBXML_DEBUG_ENABLED)
7021 FILE * output; /* the FILE * for the output */
7023 xmlAttrPtr attr; /* the attribute */
7025 int depth; /* the indentation level. */
7028 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7029 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7030 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7031 mem_base = xmlMemBlocks();
7032 output = gen_debug_FILE_ptr(n_output, 0);
7033 attr = gen_xmlAttrPtr(n_attr, 1);
7034 depth = gen_int(n_depth, 2);
7036 xmlDebugDumpAttr(output, attr, depth);
7038 des_debug_FILE_ptr(n_output, output, 0);
7039 des_xmlAttrPtr(n_attr, attr, 1);
7040 des_int(n_depth, depth, 2);
7041 xmlResetLastError();
7042 if (mem_base != xmlMemBlocks()) {
7043 printf("Leak of %d blocks found in xmlDebugDumpAttr",
7044 xmlMemBlocks() - mem_base);
7046 printf(" %d", n_output);
7047 printf(" %d", n_attr);
7048 printf(" %d", n_depth);
7062 test_xmlDebugDumpAttrList(void) {
7065 #if defined(LIBXML_DEBUG_ENABLED)
7067 FILE * output; /* the FILE * for the output */
7069 xmlAttrPtr attr; /* the attribute list */
7071 int depth; /* the indentation level. */
7074 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7075 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7076 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7077 mem_base = xmlMemBlocks();
7078 output = gen_debug_FILE_ptr(n_output, 0);
7079 attr = gen_xmlAttrPtr(n_attr, 1);
7080 depth = gen_int(n_depth, 2);
7082 xmlDebugDumpAttrList(output, attr, depth);
7084 des_debug_FILE_ptr(n_output, output, 0);
7085 des_xmlAttrPtr(n_attr, attr, 1);
7086 des_int(n_depth, depth, 2);
7087 xmlResetLastError();
7088 if (mem_base != xmlMemBlocks()) {
7089 printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7090 xmlMemBlocks() - mem_base);
7092 printf(" %d", n_output);
7093 printf(" %d", n_attr);
7094 printf(" %d", n_depth);
7108 test_xmlDebugDumpDTD(void) {
7111 #if defined(LIBXML_DEBUG_ENABLED)
7113 FILE * output; /* the FILE * for the output */
7115 xmlDtdPtr dtd; /* the DTD */
7118 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7119 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7120 mem_base = xmlMemBlocks();
7121 output = gen_debug_FILE_ptr(n_output, 0);
7122 dtd = gen_xmlDtdPtr(n_dtd, 1);
7124 xmlDebugDumpDTD(output, dtd);
7126 des_debug_FILE_ptr(n_output, output, 0);
7127 des_xmlDtdPtr(n_dtd, dtd, 1);
7128 xmlResetLastError();
7129 if (mem_base != xmlMemBlocks()) {
7130 printf("Leak of %d blocks found in xmlDebugDumpDTD",
7131 xmlMemBlocks() - mem_base);
7133 printf(" %d", n_output);
7134 printf(" %d", n_dtd);
7147 test_xmlDebugDumpDocument(void) {
7150 #if defined(LIBXML_DEBUG_ENABLED)
7152 FILE * output; /* the FILE * for the output */
7154 xmlDocPtr doc; /* the document */
7157 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7158 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7159 mem_base = xmlMemBlocks();
7160 output = gen_debug_FILE_ptr(n_output, 0);
7161 doc = gen_xmlDocPtr(n_doc, 1);
7163 xmlDebugDumpDocument(output, doc);
7165 des_debug_FILE_ptr(n_output, output, 0);
7166 des_xmlDocPtr(n_doc, doc, 1);
7167 xmlResetLastError();
7168 if (mem_base != xmlMemBlocks()) {
7169 printf("Leak of %d blocks found in xmlDebugDumpDocument",
7170 xmlMemBlocks() - mem_base);
7172 printf(" %d", n_output);
7173 printf(" %d", n_doc);
7186 test_xmlDebugDumpDocumentHead(void) {
7189 #if defined(LIBXML_DEBUG_ENABLED)
7191 FILE * output; /* the FILE * for the output */
7193 xmlDocPtr doc; /* the document */
7196 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7197 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7198 mem_base = xmlMemBlocks();
7199 output = gen_debug_FILE_ptr(n_output, 0);
7200 doc = gen_xmlDocPtr(n_doc, 1);
7202 xmlDebugDumpDocumentHead(output, doc);
7204 des_debug_FILE_ptr(n_output, output, 0);
7205 des_xmlDocPtr(n_doc, doc, 1);
7206 xmlResetLastError();
7207 if (mem_base != xmlMemBlocks()) {
7208 printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7209 xmlMemBlocks() - mem_base);
7211 printf(" %d", n_output);
7212 printf(" %d", n_doc);
7225 test_xmlDebugDumpEntities(void) {
7228 #if defined(LIBXML_DEBUG_ENABLED)
7230 FILE * output; /* the FILE * for the output */
7232 xmlDocPtr doc; /* the document */
7235 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7236 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7237 mem_base = xmlMemBlocks();
7238 output = gen_debug_FILE_ptr(n_output, 0);
7239 doc = gen_xmlDocPtr(n_doc, 1);
7241 xmlDebugDumpEntities(output, doc);
7243 des_debug_FILE_ptr(n_output, output, 0);
7244 des_xmlDocPtr(n_doc, doc, 1);
7245 xmlResetLastError();
7246 if (mem_base != xmlMemBlocks()) {
7247 printf("Leak of %d blocks found in xmlDebugDumpEntities",
7248 xmlMemBlocks() - mem_base);
7250 printf(" %d", n_output);
7251 printf(" %d", n_doc);
7264 test_xmlDebugDumpNode(void) {
7267 #if defined(LIBXML_DEBUG_ENABLED)
7269 FILE * output; /* the FILE * for the output */
7271 xmlNodePtr node; /* the node */
7273 int depth; /* the indentation level. */
7276 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7277 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7278 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7279 mem_base = xmlMemBlocks();
7280 output = gen_debug_FILE_ptr(n_output, 0);
7281 node = gen_xmlNodePtr(n_node, 1);
7282 depth = gen_int(n_depth, 2);
7284 xmlDebugDumpNode(output, node, depth);
7286 des_debug_FILE_ptr(n_output, output, 0);
7287 des_xmlNodePtr(n_node, node, 1);
7288 des_int(n_depth, depth, 2);
7289 xmlResetLastError();
7290 if (mem_base != xmlMemBlocks()) {
7291 printf("Leak of %d blocks found in xmlDebugDumpNode",
7292 xmlMemBlocks() - mem_base);
7294 printf(" %d", n_output);
7295 printf(" %d", n_node);
7296 printf(" %d", n_depth);
7310 test_xmlDebugDumpNodeList(void) {
7313 #if defined(LIBXML_DEBUG_ENABLED)
7315 FILE * output; /* the FILE * for the output */
7317 xmlNodePtr node; /* the node list */
7319 int depth; /* the indentation level. */
7322 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7323 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7324 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7325 mem_base = xmlMemBlocks();
7326 output = gen_debug_FILE_ptr(n_output, 0);
7327 node = gen_xmlNodePtr(n_node, 1);
7328 depth = gen_int(n_depth, 2);
7330 xmlDebugDumpNodeList(output, node, depth);
7332 des_debug_FILE_ptr(n_output, output, 0);
7333 des_xmlNodePtr(n_node, node, 1);
7334 des_int(n_depth, depth, 2);
7335 xmlResetLastError();
7336 if (mem_base != xmlMemBlocks()) {
7337 printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7338 xmlMemBlocks() - mem_base);
7340 printf(" %d", n_output);
7341 printf(" %d", n_node);
7342 printf(" %d", n_depth);
7356 test_xmlDebugDumpOneNode(void) {
7359 #if defined(LIBXML_DEBUG_ENABLED)
7361 FILE * output; /* the FILE * for the output */
7363 xmlNodePtr node; /* the node */
7365 int depth; /* the indentation level. */
7368 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7369 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7370 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7371 mem_base = xmlMemBlocks();
7372 output = gen_debug_FILE_ptr(n_output, 0);
7373 node = gen_xmlNodePtr(n_node, 1);
7374 depth = gen_int(n_depth, 2);
7376 xmlDebugDumpOneNode(output, node, depth);
7378 des_debug_FILE_ptr(n_output, output, 0);
7379 des_xmlNodePtr(n_node, node, 1);
7380 des_int(n_depth, depth, 2);
7381 xmlResetLastError();
7382 if (mem_base != xmlMemBlocks()) {
7383 printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7384 xmlMemBlocks() - mem_base);
7386 printf(" %d", n_output);
7387 printf(" %d", n_node);
7388 printf(" %d", n_depth);
7402 test_xmlDebugDumpString(void) {
7405 #if defined(LIBXML_DEBUG_ENABLED)
7407 FILE * output; /* the FILE * for the output */
7409 xmlChar * str; /* the string */
7412 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7413 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7414 mem_base = xmlMemBlocks();
7415 output = gen_debug_FILE_ptr(n_output, 0);
7416 str = gen_const_xmlChar_ptr(n_str, 1);
7418 xmlDebugDumpString(output, (const xmlChar *)str);
7420 des_debug_FILE_ptr(n_output, output, 0);
7421 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7422 xmlResetLastError();
7423 if (mem_base != xmlMemBlocks()) {
7424 printf("Leak of %d blocks found in xmlDebugDumpString",
7425 xmlMemBlocks() - mem_base);
7427 printf(" %d", n_output);
7428 printf(" %d", n_str);
7441 test_xmlLsCountNode(void) {
7444 #if defined(LIBXML_DEBUG_ENABLED)
7447 xmlNodePtr node; /* the node to count */
7450 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7451 mem_base = xmlMemBlocks();
7452 node = gen_xmlNodePtr(n_node, 0);
7454 ret_val = xmlLsCountNode(node);
7455 desret_int(ret_val);
7457 des_xmlNodePtr(n_node, node, 0);
7458 xmlResetLastError();
7459 if (mem_base != xmlMemBlocks()) {
7460 printf("Leak of %d blocks found in xmlLsCountNode",
7461 xmlMemBlocks() - mem_base);
7463 printf(" %d", n_node);
7475 test_xmlLsOneNode(void) {
7478 #if defined(LIBXML_DEBUG_ENABLED)
7480 FILE * output; /* the FILE * for the output */
7482 xmlNodePtr node; /* the node to dump */
7485 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7486 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7487 mem_base = xmlMemBlocks();
7488 output = gen_debug_FILE_ptr(n_output, 0);
7489 node = gen_xmlNodePtr(n_node, 1);
7491 xmlLsOneNode(output, node);
7493 des_debug_FILE_ptr(n_output, output, 0);
7494 des_xmlNodePtr(n_node, node, 1);
7495 xmlResetLastError();
7496 if (mem_base != xmlMemBlocks()) {
7497 printf("Leak of %d blocks found in xmlLsOneNode",
7498 xmlMemBlocks() - mem_base);
7500 printf(" %d", n_output);
7501 printf(" %d", n_node);
7513 #define gen_nb_char_ptr 1
7514 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7517 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7521 test_xmlShell(void) {
7525 /* missing type support */
7531 test_xmlShellBase(void) {
7534 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7537 xmlShellCtxtPtr ctxt; /* the shell context */
7539 char * arg; /* unused */
7541 xmlNodePtr node; /* a node */
7543 xmlNodePtr node2; /* unused */
7546 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7547 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7548 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7549 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7550 mem_base = xmlMemBlocks();
7551 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7552 arg = gen_char_ptr(n_arg, 1);
7553 node = gen_xmlNodePtr(n_node, 2);
7554 node2 = gen_xmlNodePtr(n_node2, 3);
7556 ret_val = xmlShellBase(ctxt, arg, node, node2);
7557 desret_int(ret_val);
7559 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7560 des_char_ptr(n_arg, arg, 1);
7561 des_xmlNodePtr(n_node, node, 2);
7562 des_xmlNodePtr(n_node2, node2, 3);
7563 xmlResetLastError();
7564 if (mem_base != xmlMemBlocks()) {
7565 printf("Leak of %d blocks found in xmlShellBase",
7566 xmlMemBlocks() - mem_base);
7568 printf(" %d", n_ctxt);
7569 printf(" %d", n_arg);
7570 printf(" %d", n_node);
7571 printf(" %d", n_node2);
7586 test_xmlShellCat(void) {
7589 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7592 xmlShellCtxtPtr ctxt; /* the shell context */
7594 char * arg; /* unused */
7596 xmlNodePtr node; /* a node */
7598 xmlNodePtr node2; /* unused */
7601 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7602 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7603 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7604 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7605 mem_base = xmlMemBlocks();
7606 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7607 arg = gen_char_ptr(n_arg, 1);
7608 node = gen_xmlNodePtr(n_node, 2);
7609 node2 = gen_xmlNodePtr(n_node2, 3);
7611 ret_val = xmlShellCat(ctxt, arg, node, node2);
7612 desret_int(ret_val);
7614 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7615 des_char_ptr(n_arg, arg, 1);
7616 des_xmlNodePtr(n_node, node, 2);
7617 des_xmlNodePtr(n_node2, node2, 3);
7618 xmlResetLastError();
7619 if (mem_base != xmlMemBlocks()) {
7620 printf("Leak of %d blocks found in xmlShellCat",
7621 xmlMemBlocks() - mem_base);
7623 printf(" %d", n_ctxt);
7624 printf(" %d", n_arg);
7625 printf(" %d", n_node);
7626 printf(" %d", n_node2);
7641 test_xmlShellDir(void) {
7644 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7647 xmlShellCtxtPtr ctxt; /* the shell context */
7649 char * arg; /* unused */
7651 xmlNodePtr node; /* a node */
7653 xmlNodePtr node2; /* unused */
7656 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7657 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7658 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7659 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7660 mem_base = xmlMemBlocks();
7661 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7662 arg = gen_char_ptr(n_arg, 1);
7663 node = gen_xmlNodePtr(n_node, 2);
7664 node2 = gen_xmlNodePtr(n_node2, 3);
7666 ret_val = xmlShellDir(ctxt, arg, node, node2);
7667 desret_int(ret_val);
7669 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7670 des_char_ptr(n_arg, arg, 1);
7671 des_xmlNodePtr(n_node, node, 2);
7672 des_xmlNodePtr(n_node2, node2, 3);
7673 xmlResetLastError();
7674 if (mem_base != xmlMemBlocks()) {
7675 printf("Leak of %d blocks found in xmlShellDir",
7676 xmlMemBlocks() - mem_base);
7678 printf(" %d", n_ctxt);
7679 printf(" %d", n_arg);
7680 printf(" %d", n_node);
7681 printf(" %d", n_node2);
7696 test_xmlShellDu(void) {
7699 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7702 xmlShellCtxtPtr ctxt; /* the shell context */
7704 char * arg; /* unused */
7706 xmlNodePtr tree; /* a node defining a subtree */
7708 xmlNodePtr node2; /* unused */
7711 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7712 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7713 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7714 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7715 mem_base = xmlMemBlocks();
7716 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7717 arg = gen_char_ptr(n_arg, 1);
7718 tree = gen_xmlNodePtr(n_tree, 2);
7719 node2 = gen_xmlNodePtr(n_node2, 3);
7721 ret_val = xmlShellDu(ctxt, arg, tree, node2);
7722 desret_int(ret_val);
7724 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7725 des_char_ptr(n_arg, arg, 1);
7726 des_xmlNodePtr(n_tree, tree, 2);
7727 des_xmlNodePtr(n_node2, node2, 3);
7728 xmlResetLastError();
7729 if (mem_base != xmlMemBlocks()) {
7730 printf("Leak of %d blocks found in xmlShellDu",
7731 xmlMemBlocks() - mem_base);
7733 printf(" %d", n_ctxt);
7734 printf(" %d", n_arg);
7735 printf(" %d", n_tree);
7736 printf(" %d", n_node2);
7751 test_xmlShellList(void) {
7754 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7757 xmlShellCtxtPtr ctxt; /* the shell context */
7759 char * arg; /* unused */
7761 xmlNodePtr node; /* a node */
7763 xmlNodePtr node2; /* unused */
7766 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7767 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7768 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7769 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7770 mem_base = xmlMemBlocks();
7771 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7772 arg = gen_char_ptr(n_arg, 1);
7773 node = gen_xmlNodePtr(n_node, 2);
7774 node2 = gen_xmlNodePtr(n_node2, 3);
7776 ret_val = xmlShellList(ctxt, arg, node, node2);
7777 desret_int(ret_val);
7779 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7780 des_char_ptr(n_arg, arg, 1);
7781 des_xmlNodePtr(n_node, node, 2);
7782 des_xmlNodePtr(n_node2, node2, 3);
7783 xmlResetLastError();
7784 if (mem_base != xmlMemBlocks()) {
7785 printf("Leak of %d blocks found in xmlShellList",
7786 xmlMemBlocks() - mem_base);
7788 printf(" %d", n_ctxt);
7789 printf(" %d", n_arg);
7790 printf(" %d", n_node);
7791 printf(" %d", n_node2);
7806 test_xmlShellLoad(void) {
7809 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7812 xmlShellCtxtPtr ctxt; /* the shell context */
7814 char * filename; /* the file name */
7816 xmlNodePtr node; /* unused */
7818 xmlNodePtr node2; /* unused */
7821 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7822 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7823 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7824 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7825 mem_base = xmlMemBlocks();
7826 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7827 filename = gen_char_ptr(n_filename, 1);
7828 node = gen_xmlNodePtr(n_node, 2);
7829 node2 = gen_xmlNodePtr(n_node2, 3);
7831 ret_val = xmlShellLoad(ctxt, filename, node, node2);
7832 desret_int(ret_val);
7834 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7835 des_char_ptr(n_filename, filename, 1);
7836 des_xmlNodePtr(n_node, node, 2);
7837 des_xmlNodePtr(n_node2, node2, 3);
7838 xmlResetLastError();
7839 if (mem_base != xmlMemBlocks()) {
7840 printf("Leak of %d blocks found in xmlShellLoad",
7841 xmlMemBlocks() - mem_base);
7843 printf(" %d", n_ctxt);
7844 printf(" %d", n_filename);
7845 printf(" %d", n_node);
7846 printf(" %d", n_node2);
7861 test_xmlShellPrintXPathResult(void) {
7864 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7866 xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7869 for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7870 mem_base = xmlMemBlocks();
7871 list = gen_xmlXPathObjectPtr(n_list, 0);
7873 xmlShellPrintXPathResult(list);
7875 des_xmlXPathObjectPtr(n_list, list, 0);
7876 xmlResetLastError();
7877 if (mem_base != xmlMemBlocks()) {
7878 printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7879 xmlMemBlocks() - mem_base);
7881 printf(" %d", n_list);
7893 test_xmlShellPwd(void) {
7896 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7899 xmlShellCtxtPtr ctxt; /* the shell context */
7901 char * buffer; /* the output buffer */
7903 xmlNodePtr node; /* a node */
7905 xmlNodePtr node2; /* unused */
7908 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7909 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7910 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7911 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7912 mem_base = xmlMemBlocks();
7913 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7914 buffer = gen_char_ptr(n_buffer, 1);
7915 node = gen_xmlNodePtr(n_node, 2);
7916 node2 = gen_xmlNodePtr(n_node2, 3);
7918 ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7919 desret_int(ret_val);
7921 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7922 des_char_ptr(n_buffer, buffer, 1);
7923 des_xmlNodePtr(n_node, node, 2);
7924 des_xmlNodePtr(n_node2, node2, 3);
7925 xmlResetLastError();
7926 if (mem_base != xmlMemBlocks()) {
7927 printf("Leak of %d blocks found in xmlShellPwd",
7928 xmlMemBlocks() - mem_base);
7930 printf(" %d", n_ctxt);
7931 printf(" %d", n_buffer);
7932 printf(" %d", n_node);
7933 printf(" %d", n_node2);
7948 test_xmlShellSave(void) {
7951 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7954 xmlShellCtxtPtr ctxt; /* the shell context */
7956 char * filename; /* the file name (optional) */
7958 xmlNodePtr node; /* unused */
7960 xmlNodePtr node2; /* unused */
7963 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7964 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7965 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7966 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7967 mem_base = xmlMemBlocks();
7968 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7969 filename = gen_char_ptr(n_filename, 1);
7970 node = gen_xmlNodePtr(n_node, 2);
7971 node2 = gen_xmlNodePtr(n_node2, 3);
7973 ret_val = xmlShellSave(ctxt, filename, node, node2);
7974 desret_int(ret_val);
7976 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7977 des_char_ptr(n_filename, filename, 1);
7978 des_xmlNodePtr(n_node, node, 2);
7979 des_xmlNodePtr(n_node2, node2, 3);
7980 xmlResetLastError();
7981 if (mem_base != xmlMemBlocks()) {
7982 printf("Leak of %d blocks found in xmlShellSave",
7983 xmlMemBlocks() - mem_base);
7985 printf(" %d", n_ctxt);
7986 printf(" %d", n_filename);
7987 printf(" %d", n_node);
7988 printf(" %d", n_node2);
8003 test_xmlShellValidate(void) {
8006 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
8009 xmlShellCtxtPtr ctxt; /* the shell context */
8011 char * dtd; /* the DTD URI (optional) */
8013 xmlNodePtr node; /* unused */
8015 xmlNodePtr node2; /* unused */
8018 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8019 for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8020 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8021 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8022 mem_base = xmlMemBlocks();
8023 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8024 dtd = gen_char_ptr(n_dtd, 1);
8025 node = gen_xmlNodePtr(n_node, 2);
8026 node2 = gen_xmlNodePtr(n_node2, 3);
8028 ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8029 desret_int(ret_val);
8031 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8032 des_char_ptr(n_dtd, dtd, 1);
8033 des_xmlNodePtr(n_node, node, 2);
8034 des_xmlNodePtr(n_node2, node2, 3);
8035 xmlResetLastError();
8036 if (mem_base != xmlMemBlocks()) {
8037 printf("Leak of %d blocks found in xmlShellValidate",
8038 xmlMemBlocks() - mem_base);
8040 printf(" %d", n_ctxt);
8041 printf(" %d", n_dtd);
8042 printf(" %d", n_node);
8043 printf(" %d", n_node2);
8058 test_xmlShellWrite(void) {
8061 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8064 xmlShellCtxtPtr ctxt; /* the shell context */
8066 char * filename; /* the file name */
8068 xmlNodePtr node; /* a node in the tree */
8070 xmlNodePtr node2; /* unused */
8073 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8074 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8075 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8076 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8077 mem_base = xmlMemBlocks();
8078 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8079 filename = gen_char_ptr(n_filename, 1);
8080 node = gen_xmlNodePtr(n_node, 2);
8081 node2 = gen_xmlNodePtr(n_node2, 3);
8083 ret_val = xmlShellWrite(ctxt, filename, node, node2);
8084 desret_int(ret_val);
8086 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8087 des_char_ptr(n_filename, filename, 1);
8088 des_xmlNodePtr(n_node, node, 2);
8089 des_xmlNodePtr(n_node2, node2, 3);
8090 xmlResetLastError();
8091 if (mem_base != xmlMemBlocks()) {
8092 printf("Leak of %d blocks found in xmlShellWrite",
8093 xmlMemBlocks() - mem_base);
8095 printf(" %d", n_ctxt);
8096 printf(" %d", n_filename);
8097 printf(" %d", n_node);
8098 printf(" %d", n_node2);
8112 test_debugXML(void) {
8115 if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8116 test_ret += test_xmlBoolToText();
8117 test_ret += test_xmlDebugCheckDocument();
8118 test_ret += test_xmlDebugDumpAttr();
8119 test_ret += test_xmlDebugDumpAttrList();
8120 test_ret += test_xmlDebugDumpDTD();
8121 test_ret += test_xmlDebugDumpDocument();
8122 test_ret += test_xmlDebugDumpDocumentHead();
8123 test_ret += test_xmlDebugDumpEntities();
8124 test_ret += test_xmlDebugDumpNode();
8125 test_ret += test_xmlDebugDumpNodeList();
8126 test_ret += test_xmlDebugDumpOneNode();
8127 test_ret += test_xmlDebugDumpString();
8128 test_ret += test_xmlLsCountNode();
8129 test_ret += test_xmlLsOneNode();
8130 test_ret += test_xmlShell();
8131 test_ret += test_xmlShellBase();
8132 test_ret += test_xmlShellCat();
8133 test_ret += test_xmlShellDir();
8134 test_ret += test_xmlShellDu();
8135 test_ret += test_xmlShellList();
8136 test_ret += test_xmlShellLoad();
8137 test_ret += test_xmlShellPrintXPathResult();
8138 test_ret += test_xmlShellPwd();
8139 test_ret += test_xmlShellSave();
8140 test_ret += test_xmlShellValidate();
8141 test_ret += test_xmlShellWrite();
8144 printf("Module debugXML: %d errors\n", test_ret);
8149 test_xmlDictCleanup(void) {
8154 mem_base = xmlMemBlocks();
8158 xmlResetLastError();
8159 if (mem_base != xmlMemBlocks()) {
8160 printf("Leak of %d blocks found in xmlDictCleanup",
8161 xmlMemBlocks() - mem_base);
8172 test_xmlDictCreate(void) {
8178 mem_base = xmlMemBlocks();
8180 ret_val = xmlDictCreate();
8181 desret_xmlDictPtr(ret_val);
8183 xmlResetLastError();
8184 if (mem_base != xmlMemBlocks()) {
8185 printf("Leak of %d blocks found in xmlDictCreate",
8186 xmlMemBlocks() - mem_base);
8197 test_xmlDictCreateSub(void) {
8202 xmlDictPtr sub; /* an existing dictionary */
8205 for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8206 mem_base = xmlMemBlocks();
8207 sub = gen_xmlDictPtr(n_sub, 0);
8209 ret_val = xmlDictCreateSub(sub);
8210 desret_xmlDictPtr(ret_val);
8212 des_xmlDictPtr(n_sub, sub, 0);
8213 xmlResetLastError();
8214 if (mem_base != xmlMemBlocks()) {
8215 printf("Leak of %d blocks found in xmlDictCreateSub",
8216 xmlMemBlocks() - mem_base);
8218 printf(" %d", n_sub);
8229 test_xmlDictExists(void) {
8233 const xmlChar * ret_val;
8234 xmlDictPtr dict; /* the dictionary */
8236 xmlChar * name; /* the name of the userdata */
8238 int len; /* the length of the name, if -1 it is recomputed */
8241 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8242 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8243 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8244 mem_base = xmlMemBlocks();
8245 dict = gen_xmlDictPtr(n_dict, 0);
8246 name = gen_const_xmlChar_ptr(n_name, 1);
8247 len = gen_int(n_len, 2);
8248 if ((name != NULL) &&
8249 (len > (int) strlen((const char *) name) + 1))
8252 ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8253 desret_const_xmlChar_ptr(ret_val);
8255 des_xmlDictPtr(n_dict, dict, 0);
8256 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8257 des_int(n_len, len, 2);
8258 xmlResetLastError();
8259 if (mem_base != xmlMemBlocks()) {
8260 printf("Leak of %d blocks found in xmlDictExists",
8261 xmlMemBlocks() - mem_base);
8263 printf(" %d", n_dict);
8264 printf(" %d", n_name);
8265 printf(" %d", n_len);
8278 test_xmlDictGetUsage(void) {
8282 /* missing type support */
8288 test_xmlDictLookup(void) {
8292 const xmlChar * ret_val;
8293 xmlDictPtr dict; /* the dictionary */
8295 xmlChar * name; /* the name of the userdata */
8297 int len; /* the length of the name, if -1 it is recomputed */
8300 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8301 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8302 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8303 mem_base = xmlMemBlocks();
8304 dict = gen_xmlDictPtr(n_dict, 0);
8305 name = gen_const_xmlChar_ptr(n_name, 1);
8306 len = gen_int(n_len, 2);
8307 if ((name != NULL) &&
8308 (len > (int) strlen((const char *) name) + 1))
8311 ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8312 desret_const_xmlChar_ptr(ret_val);
8314 des_xmlDictPtr(n_dict, dict, 0);
8315 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8316 des_int(n_len, len, 2);
8317 xmlResetLastError();
8318 if (mem_base != xmlMemBlocks()) {
8319 printf("Leak of %d blocks found in xmlDictLookup",
8320 xmlMemBlocks() - mem_base);
8322 printf(" %d", n_dict);
8323 printf(" %d", n_name);
8324 printf(" %d", n_len);
8337 test_xmlDictOwns(void) {
8342 xmlDictPtr dict; /* the dictionary */
8344 xmlChar * str; /* the string */
8347 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8348 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8349 mem_base = xmlMemBlocks();
8350 dict = gen_xmlDictPtr(n_dict, 0);
8351 str = gen_const_xmlChar_ptr(n_str, 1);
8353 ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8354 desret_int(ret_val);
8356 des_xmlDictPtr(n_dict, dict, 0);
8357 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8358 xmlResetLastError();
8359 if (mem_base != xmlMemBlocks()) {
8360 printf("Leak of %d blocks found in xmlDictOwns",
8361 xmlMemBlocks() - mem_base);
8363 printf(" %d", n_dict);
8364 printf(" %d", n_str);
8376 test_xmlDictQLookup(void) {
8380 const xmlChar * ret_val;
8381 xmlDictPtr dict; /* the dictionary */
8383 xmlChar * prefix; /* the prefix */
8385 xmlChar * name; /* the name */
8388 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8389 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8390 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8391 mem_base = xmlMemBlocks();
8392 dict = gen_xmlDictPtr(n_dict, 0);
8393 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8394 name = gen_const_xmlChar_ptr(n_name, 2);
8396 ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8397 desret_const_xmlChar_ptr(ret_val);
8399 des_xmlDictPtr(n_dict, dict, 0);
8400 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8401 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8402 xmlResetLastError();
8403 if (mem_base != xmlMemBlocks()) {
8404 printf("Leak of %d blocks found in xmlDictQLookup",
8405 xmlMemBlocks() - mem_base);
8407 printf(" %d", n_dict);
8408 printf(" %d", n_prefix);
8409 printf(" %d", n_name);
8422 test_xmlDictReference(void) {
8427 xmlDictPtr dict; /* the dictionary */
8430 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8431 mem_base = xmlMemBlocks();
8432 dict = gen_xmlDictPtr(n_dict, 0);
8434 ret_val = xmlDictReference(dict);
8436 desret_int(ret_val);
8438 des_xmlDictPtr(n_dict, dict, 0);
8439 xmlResetLastError();
8440 if (mem_base != xmlMemBlocks()) {
8441 printf("Leak of %d blocks found in xmlDictReference",
8442 xmlMemBlocks() - mem_base);
8444 printf(" %d", n_dict);
8455 test_xmlDictSetLimit(void) {
8459 /* missing type support */
8465 test_xmlDictSize(void) {
8470 xmlDictPtr dict; /* the dictionary */
8473 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8474 mem_base = xmlMemBlocks();
8475 dict = gen_xmlDictPtr(n_dict, 0);
8477 ret_val = xmlDictSize(dict);
8478 desret_int(ret_val);
8480 des_xmlDictPtr(n_dict, dict, 0);
8481 xmlResetLastError();
8482 if (mem_base != xmlMemBlocks()) {
8483 printf("Leak of %d blocks found in xmlDictSize",
8484 xmlMemBlocks() - mem_base);
8486 printf(" %d", n_dict);
8497 test_xmlInitializeDict(void) {
8503 mem_base = xmlMemBlocks();
8505 ret_val = xmlInitializeDict();
8506 desret_int(ret_val);
8508 xmlResetLastError();
8509 if (mem_base != xmlMemBlocks()) {
8510 printf("Leak of %d blocks found in xmlInitializeDict",
8511 xmlMemBlocks() - mem_base);
8524 if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8525 test_ret += test_xmlDictCleanup();
8526 test_ret += test_xmlDictCreate();
8527 test_ret += test_xmlDictCreateSub();
8528 test_ret += test_xmlDictExists();
8529 test_ret += test_xmlDictGetUsage();
8530 test_ret += test_xmlDictLookup();
8531 test_ret += test_xmlDictOwns();
8532 test_ret += test_xmlDictQLookup();
8533 test_ret += test_xmlDictReference();
8534 test_ret += test_xmlDictSetLimit();
8535 test_ret += test_xmlDictSize();
8536 test_ret += test_xmlInitializeDict();
8539 printf("Module dict: %d errors\n", test_ret);
8544 test_UTF8Toisolat1(void) {
8547 #if defined(LIBXML_OUTPUT_ENABLED)
8548 #ifdef LIBXML_OUTPUT_ENABLED
8551 unsigned char * out; /* a pointer to an array of bytes to store the result */
8553 int * outlen; /* the length of @out */
8555 unsigned char * in; /* a pointer to an array of UTF-8 chars */
8557 int * inlen; /* the length of @in */
8560 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8561 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8562 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8563 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8564 mem_base = xmlMemBlocks();
8565 out = gen_unsigned_char_ptr(n_out, 0);
8566 outlen = gen_int_ptr(n_outlen, 1);
8567 in = gen_const_unsigned_char_ptr(n_in, 2);
8568 inlen = gen_int_ptr(n_inlen, 3);
8570 ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8571 desret_int(ret_val);
8573 des_unsigned_char_ptr(n_out, out, 0);
8574 des_int_ptr(n_outlen, outlen, 1);
8575 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8576 des_int_ptr(n_inlen, inlen, 3);
8577 xmlResetLastError();
8578 if (mem_base != xmlMemBlocks()) {
8579 printf("Leak of %d blocks found in UTF8Toisolat1",
8580 xmlMemBlocks() - mem_base);
8582 printf(" %d", n_out);
8583 printf(" %d", n_outlen);
8584 printf(" %d", n_in);
8585 printf(" %d", n_inlen);
8601 test_isolat1ToUTF8(void) {
8606 unsigned char * out; /* a pointer to an array of bytes to store the result */
8608 int * outlen; /* the length of @out */
8610 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8612 int * inlen; /* the length of @in */
8615 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8616 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8617 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8618 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8619 mem_base = xmlMemBlocks();
8620 out = gen_unsigned_char_ptr(n_out, 0);
8621 outlen = gen_int_ptr(n_outlen, 1);
8622 in = gen_const_unsigned_char_ptr(n_in, 2);
8623 inlen = gen_int_ptr(n_inlen, 3);
8625 ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8626 desret_int(ret_val);
8628 des_unsigned_char_ptr(n_out, out, 0);
8629 des_int_ptr(n_outlen, outlen, 1);
8630 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8631 des_int_ptr(n_inlen, inlen, 3);
8632 xmlResetLastError();
8633 if (mem_base != xmlMemBlocks()) {
8634 printf("Leak of %d blocks found in isolat1ToUTF8",
8635 xmlMemBlocks() - mem_base);
8637 printf(" %d", n_out);
8638 printf(" %d", n_outlen);
8639 printf(" %d", n_in);
8640 printf(" %d", n_inlen);
8654 test_xmlAddEncodingAlias(void) {
8658 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8660 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8663 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8664 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8665 name = gen_const_char_ptr(n_name, 0);
8666 alias = gen_const_char_ptr(n_alias, 1);
8668 ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8669 desret_int(ret_val);
8671 des_const_char_ptr(n_name, (const char *)name, 0);
8672 des_const_char_ptr(n_alias, (const char *)alias, 1);
8673 xmlResetLastError();
8682 #define gen_nb_xmlCharEncodingHandler_ptr 1
8683 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8686 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8690 test_xmlCharEncCloseFunc(void) {
8695 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8698 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8699 mem_base = xmlMemBlocks();
8700 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8702 ret_val = xmlCharEncCloseFunc(handler);
8703 desret_int(ret_val);
8705 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8706 xmlResetLastError();
8707 if (mem_base != xmlMemBlocks()) {
8708 printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8709 xmlMemBlocks() - mem_base);
8711 printf(" %d", n_handler);
8722 test_xmlCharEncFirstLine(void) {
8727 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8729 xmlBufferPtr out; /* an xmlBuffer for the output. */
8731 xmlBufferPtr in; /* an xmlBuffer for the input */
8734 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8735 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8736 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8737 mem_base = xmlMemBlocks();
8738 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8739 out = gen_xmlBufferPtr(n_out, 1);
8740 in = gen_xmlBufferPtr(n_in, 2);
8742 ret_val = xmlCharEncFirstLine(handler, out, in);
8743 desret_int(ret_val);
8745 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8746 des_xmlBufferPtr(n_out, out, 1);
8747 des_xmlBufferPtr(n_in, in, 2);
8748 xmlResetLastError();
8749 if (mem_base != xmlMemBlocks()) {
8750 printf("Leak of %d blocks found in xmlCharEncFirstLine",
8751 xmlMemBlocks() - mem_base);
8753 printf(" %d", n_handler);
8754 printf(" %d", n_out);
8755 printf(" %d", n_in);
8768 test_xmlCharEncInFunc(void) {
8773 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8775 xmlBufferPtr out; /* an xmlBuffer for the output. */
8777 xmlBufferPtr in; /* an xmlBuffer for the input */
8780 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8781 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8782 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8783 mem_base = xmlMemBlocks();
8784 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8785 out = gen_xmlBufferPtr(n_out, 1);
8786 in = gen_xmlBufferPtr(n_in, 2);
8788 ret_val = xmlCharEncInFunc(handler, out, in);
8789 desret_int(ret_val);
8791 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8792 des_xmlBufferPtr(n_out, out, 1);
8793 des_xmlBufferPtr(n_in, in, 2);
8794 xmlResetLastError();
8795 if (mem_base != xmlMemBlocks()) {
8796 printf("Leak of %d blocks found in xmlCharEncInFunc",
8797 xmlMemBlocks() - mem_base);
8799 printf(" %d", n_handler);
8800 printf(" %d", n_out);
8801 printf(" %d", n_in);
8814 test_xmlCharEncOutFunc(void) {
8819 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8821 xmlBufferPtr out; /* an xmlBuffer for the output. */
8823 xmlBufferPtr in; /* an xmlBuffer for the input */
8826 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8827 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8828 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8829 mem_base = xmlMemBlocks();
8830 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8831 out = gen_xmlBufferPtr(n_out, 1);
8832 in = gen_xmlBufferPtr(n_in, 2);
8834 ret_val = xmlCharEncOutFunc(handler, out, in);
8835 desret_int(ret_val);
8837 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8838 des_xmlBufferPtr(n_out, out, 1);
8839 des_xmlBufferPtr(n_in, in, 2);
8840 xmlResetLastError();
8841 if (mem_base != xmlMemBlocks()) {
8842 printf("Leak of %d blocks found in xmlCharEncOutFunc",
8843 xmlMemBlocks() - mem_base);
8845 printf(" %d", n_handler);
8846 printf(" %d", n_out);
8847 printf(" %d", n_in);
8860 test_xmlCleanupCharEncodingHandlers(void) {
8865 xmlCleanupCharEncodingHandlers();
8867 xmlResetLastError();
8875 test_xmlCleanupEncodingAliases(void) {
8880 mem_base = xmlMemBlocks();
8882 xmlCleanupEncodingAliases();
8884 xmlResetLastError();
8885 if (mem_base != xmlMemBlocks()) {
8886 printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8887 xmlMemBlocks() - mem_base);
8898 test_xmlDelEncodingAlias(void) {
8903 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8906 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8907 mem_base = xmlMemBlocks();
8908 alias = gen_const_char_ptr(n_alias, 0);
8910 ret_val = xmlDelEncodingAlias((const char *)alias);
8911 desret_int(ret_val);
8913 des_const_char_ptr(n_alias, (const char *)alias, 0);
8914 xmlResetLastError();
8915 if (mem_base != xmlMemBlocks()) {
8916 printf("Leak of %d blocks found in xmlDelEncodingAlias",
8917 xmlMemBlocks() - mem_base);
8919 printf(" %d", n_alias);
8930 test_xmlDetectCharEncoding(void) {
8934 xmlCharEncoding ret_val;
8935 unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
8937 int len; /* pointer to the length of the buffer */
8940 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8941 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8942 mem_base = xmlMemBlocks();
8943 in = gen_const_unsigned_char_ptr(n_in, 0);
8944 len = gen_int(n_len, 1);
8946 ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8947 desret_xmlCharEncoding(ret_val);
8949 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8950 des_int(n_len, len, 1);
8951 xmlResetLastError();
8952 if (mem_base != xmlMemBlocks()) {
8953 printf("Leak of %d blocks found in xmlDetectCharEncoding",
8954 xmlMemBlocks() - mem_base);
8956 printf(" %d", n_in);
8957 printf(" %d", n_len);
8969 test_xmlFindCharEncodingHandler(void) {
8973 /* missing type support */
8979 test_xmlGetCharEncodingHandler(void) {
8983 /* missing type support */
8989 test_xmlGetCharEncodingName(void) {
8993 const char * ret_val;
8994 xmlCharEncoding enc; /* the encoding */
8997 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8998 mem_base = xmlMemBlocks();
8999 enc = gen_xmlCharEncoding(n_enc, 0);
9001 ret_val = xmlGetCharEncodingName(enc);
9002 desret_const_char_ptr(ret_val);
9004 des_xmlCharEncoding(n_enc, enc, 0);
9005 xmlResetLastError();
9006 if (mem_base != xmlMemBlocks()) {
9007 printf("Leak of %d blocks found in xmlGetCharEncodingName",
9008 xmlMemBlocks() - mem_base);
9010 printf(" %d", n_enc);
9021 test_xmlGetEncodingAlias(void) {
9025 const char * ret_val;
9026 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9029 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9030 mem_base = xmlMemBlocks();
9031 alias = gen_const_char_ptr(n_alias, 0);
9033 ret_val = xmlGetEncodingAlias((const char *)alias);
9034 desret_const_char_ptr(ret_val);
9036 des_const_char_ptr(n_alias, (const char *)alias, 0);
9037 xmlResetLastError();
9038 if (mem_base != xmlMemBlocks()) {
9039 printf("Leak of %d blocks found in xmlGetEncodingAlias",
9040 xmlMemBlocks() - mem_base);
9042 printf(" %d", n_alias);
9053 test_xmlInitCharEncodingHandlers(void) {
9058 xmlInitCharEncodingHandlers();
9060 xmlResetLastError();
9068 test_xmlNewCharEncodingHandler(void) {
9072 /* missing type support */
9078 test_xmlParseCharEncoding(void) {
9082 xmlCharEncoding ret_val;
9083 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9086 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9087 mem_base = xmlMemBlocks();
9088 name = gen_const_char_ptr(n_name, 0);
9090 ret_val = xmlParseCharEncoding((const char *)name);
9091 desret_xmlCharEncoding(ret_val);
9093 des_const_char_ptr(n_name, (const char *)name, 0);
9094 xmlResetLastError();
9095 if (mem_base != xmlMemBlocks()) {
9096 printf("Leak of %d blocks found in xmlParseCharEncoding",
9097 xmlMemBlocks() - mem_base);
9099 printf(" %d", n_name);
9109 #define gen_nb_xmlCharEncodingHandlerPtr 1
9110 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9113 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9117 test_xmlRegisterCharEncodingHandler(void) {
9121 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9124 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9125 mem_base = xmlMemBlocks();
9126 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9128 xmlRegisterCharEncodingHandler(handler);
9130 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9131 xmlResetLastError();
9132 if (mem_base != xmlMemBlocks()) {
9133 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9134 xmlMemBlocks() - mem_base);
9136 printf(" %d", n_handler);
9146 test_encoding(void) {
9149 if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9150 test_ret += test_UTF8Toisolat1();
9151 test_ret += test_isolat1ToUTF8();
9152 test_ret += test_xmlAddEncodingAlias();
9153 test_ret += test_xmlCharEncCloseFunc();
9154 test_ret += test_xmlCharEncFirstLine();
9155 test_ret += test_xmlCharEncInFunc();
9156 test_ret += test_xmlCharEncOutFunc();
9157 test_ret += test_xmlCleanupCharEncodingHandlers();
9158 test_ret += test_xmlCleanupEncodingAliases();
9159 test_ret += test_xmlDelEncodingAlias();
9160 test_ret += test_xmlDetectCharEncoding();
9161 test_ret += test_xmlFindCharEncodingHandler();
9162 test_ret += test_xmlGetCharEncodingHandler();
9163 test_ret += test_xmlGetCharEncodingName();
9164 test_ret += test_xmlGetEncodingAlias();
9165 test_ret += test_xmlInitCharEncodingHandlers();
9166 test_ret += test_xmlNewCharEncodingHandler();
9167 test_ret += test_xmlParseCharEncoding();
9168 test_ret += test_xmlRegisterCharEncodingHandler();
9171 printf("Module encoding: %d errors\n", test_ret);
9176 test_xmlAddDocEntity(void) {
9180 xmlEntityPtr ret_val;
9181 xmlDocPtr doc; /* the document */
9183 xmlChar * name; /* the entity name */
9185 int type; /* the entity type XML_xxx_yyy_ENTITY */
9187 xmlChar * ExternalID; /* the entity external ID if available */
9189 xmlChar * SystemID; /* the entity system ID if available */
9191 xmlChar * content; /* the entity content */
9194 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9195 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9196 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9197 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9198 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9199 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9200 mem_base = xmlMemBlocks();
9201 doc = gen_xmlDocPtr(n_doc, 0);
9202 name = gen_const_xmlChar_ptr(n_name, 1);
9203 type = gen_int(n_type, 2);
9204 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9205 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9206 content = gen_const_xmlChar_ptr(n_content, 5);
9208 ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9209 desret_xmlEntityPtr(ret_val);
9211 des_xmlDocPtr(n_doc, doc, 0);
9212 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9213 des_int(n_type, type, 2);
9214 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9215 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9216 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9217 xmlResetLastError();
9218 if (mem_base != xmlMemBlocks()) {
9219 printf("Leak of %d blocks found in xmlAddDocEntity",
9220 xmlMemBlocks() - mem_base);
9222 printf(" %d", n_doc);
9223 printf(" %d", n_name);
9224 printf(" %d", n_type);
9225 printf(" %d", n_ExternalID);
9226 printf(" %d", n_SystemID);
9227 printf(" %d", n_content);
9243 test_xmlAddDtdEntity(void) {
9247 xmlEntityPtr ret_val;
9248 xmlDocPtr doc; /* the document */
9250 xmlChar * name; /* the entity name */
9252 int type; /* the entity type XML_xxx_yyy_ENTITY */
9254 xmlChar * ExternalID; /* the entity external ID if available */
9256 xmlChar * SystemID; /* the entity system ID if available */
9258 xmlChar * content; /* the entity content */
9261 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9262 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9263 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9264 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9265 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9266 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9267 mem_base = xmlMemBlocks();
9268 doc = gen_xmlDocPtr(n_doc, 0);
9269 name = gen_const_xmlChar_ptr(n_name, 1);
9270 type = gen_int(n_type, 2);
9271 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9272 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9273 content = gen_const_xmlChar_ptr(n_content, 5);
9275 ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9276 desret_xmlEntityPtr(ret_val);
9278 des_xmlDocPtr(n_doc, doc, 0);
9279 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9280 des_int(n_type, type, 2);
9281 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9282 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9283 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9284 xmlResetLastError();
9285 if (mem_base != xmlMemBlocks()) {
9286 printf("Leak of %d blocks found in xmlAddDtdEntity",
9287 xmlMemBlocks() - mem_base);
9289 printf(" %d", n_doc);
9290 printf(" %d", n_name);
9291 printf(" %d", n_type);
9292 printf(" %d", n_ExternalID);
9293 printf(" %d", n_SystemID);
9294 printf(" %d", n_content);
9310 test_xmlCleanupPredefinedEntities(void) {
9313 #if defined(LIBXML_LEGACY_ENABLED)
9314 #ifdef LIBXML_LEGACY_ENABLED
9317 mem_base = xmlMemBlocks();
9319 xmlCleanupPredefinedEntities();
9321 xmlResetLastError();
9322 if (mem_base != xmlMemBlocks()) {
9323 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9324 xmlMemBlocks() - mem_base);
9336 #define gen_nb_xmlEntitiesTablePtr 1
9337 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9340 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9344 test_xmlCopyEntitiesTable(void) {
9348 /* missing type support */
9354 test_xmlCreateEntitiesTable(void) {
9358 /* missing type support */
9364 test_xmlDumpEntitiesTable(void) {
9367 #if defined(LIBXML_OUTPUT_ENABLED)
9369 xmlBufferPtr buf; /* An XML buffer. */
9371 xmlEntitiesTablePtr table; /* An entity table */
9374 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9375 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9376 mem_base = xmlMemBlocks();
9377 buf = gen_xmlBufferPtr(n_buf, 0);
9378 table = gen_xmlEntitiesTablePtr(n_table, 1);
9380 xmlDumpEntitiesTable(buf, table);
9382 des_xmlBufferPtr(n_buf, buf, 0);
9383 des_xmlEntitiesTablePtr(n_table, table, 1);
9384 xmlResetLastError();
9385 if (mem_base != xmlMemBlocks()) {
9386 printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9387 xmlMemBlocks() - mem_base);
9389 printf(" %d", n_buf);
9390 printf(" %d", n_table);
9402 #define gen_nb_xmlEntityPtr 1
9403 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9406 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9410 test_xmlDumpEntityDecl(void) {
9413 #if defined(LIBXML_OUTPUT_ENABLED)
9415 xmlBufferPtr buf; /* An XML buffer. */
9417 xmlEntityPtr ent; /* An entity table */
9420 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9421 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9422 mem_base = xmlMemBlocks();
9423 buf = gen_xmlBufferPtr(n_buf, 0);
9424 ent = gen_xmlEntityPtr(n_ent, 1);
9426 xmlDumpEntityDecl(buf, ent);
9428 des_xmlBufferPtr(n_buf, buf, 0);
9429 des_xmlEntityPtr(n_ent, ent, 1);
9430 xmlResetLastError();
9431 if (mem_base != xmlMemBlocks()) {
9432 printf("Leak of %d blocks found in xmlDumpEntityDecl",
9433 xmlMemBlocks() - mem_base);
9435 printf(" %d", n_buf);
9436 printf(" %d", n_ent);
9449 test_xmlEncodeEntitiesReentrant(void) {
9454 xmlDocPtr doc; /* the document containing the string */
9456 xmlChar * input; /* A string to convert to XML. */
9459 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9460 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9461 mem_base = xmlMemBlocks();
9462 doc = gen_xmlDocPtr(n_doc, 0);
9463 input = gen_const_xmlChar_ptr(n_input, 1);
9465 ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9466 desret_xmlChar_ptr(ret_val);
9468 des_xmlDocPtr(n_doc, doc, 0);
9469 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9470 xmlResetLastError();
9471 if (mem_base != xmlMemBlocks()) {
9472 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9473 xmlMemBlocks() - mem_base);
9475 printf(" %d", n_doc);
9476 printf(" %d", n_input);
9487 #define gen_nb_const_xmlDoc_ptr 1
9488 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9491 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9495 test_xmlEncodeSpecialChars(void) {
9500 xmlDoc * doc; /* the document containing the string */
9502 xmlChar * input; /* A string to convert to XML. */
9505 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9506 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9507 mem_base = xmlMemBlocks();
9508 doc = gen_const_xmlDoc_ptr(n_doc, 0);
9509 input = gen_const_xmlChar_ptr(n_input, 1);
9511 ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
9512 desret_xmlChar_ptr(ret_val);
9514 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9515 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9516 xmlResetLastError();
9517 if (mem_base != xmlMemBlocks()) {
9518 printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9519 xmlMemBlocks() - mem_base);
9521 printf(" %d", n_doc);
9522 printf(" %d", n_input);
9534 test_xmlGetDocEntity(void) {
9538 xmlEntityPtr ret_val;
9539 xmlDoc * doc; /* the document referencing the entity */
9541 xmlChar * name; /* the entity name */
9544 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9545 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9546 mem_base = xmlMemBlocks();
9547 doc = gen_const_xmlDoc_ptr(n_doc, 0);
9548 name = gen_const_xmlChar_ptr(n_name, 1);
9550 ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
9551 desret_xmlEntityPtr(ret_val);
9553 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9554 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9555 xmlResetLastError();
9556 if (mem_base != xmlMemBlocks()) {
9557 printf("Leak of %d blocks found in xmlGetDocEntity",
9558 xmlMemBlocks() - mem_base);
9560 printf(" %d", n_doc);
9561 printf(" %d", n_name);
9573 test_xmlGetDtdEntity(void) {
9577 xmlEntityPtr ret_val;
9578 xmlDocPtr doc; /* the document referencing the entity */
9580 xmlChar * name; /* the entity name */
9583 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9584 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9585 mem_base = xmlMemBlocks();
9586 doc = gen_xmlDocPtr(n_doc, 0);
9587 name = gen_const_xmlChar_ptr(n_name, 1);
9589 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9590 desret_xmlEntityPtr(ret_val);
9592 des_xmlDocPtr(n_doc, doc, 0);
9593 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9594 xmlResetLastError();
9595 if (mem_base != xmlMemBlocks()) {
9596 printf("Leak of %d blocks found in xmlGetDtdEntity",
9597 xmlMemBlocks() - mem_base);
9599 printf(" %d", n_doc);
9600 printf(" %d", n_name);
9612 test_xmlGetParameterEntity(void) {
9616 xmlEntityPtr ret_val;
9617 xmlDocPtr doc; /* the document referencing the entity */
9619 xmlChar * name; /* the entity name */
9622 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9623 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9624 mem_base = xmlMemBlocks();
9625 doc = gen_xmlDocPtr(n_doc, 0);
9626 name = gen_const_xmlChar_ptr(n_name, 1);
9628 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9629 desret_xmlEntityPtr(ret_val);
9631 des_xmlDocPtr(n_doc, doc, 0);
9632 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9633 xmlResetLastError();
9634 if (mem_base != xmlMemBlocks()) {
9635 printf("Leak of %d blocks found in xmlGetParameterEntity",
9636 xmlMemBlocks() - mem_base);
9638 printf(" %d", n_doc);
9639 printf(" %d", n_name);
9651 test_xmlGetPredefinedEntity(void) {
9655 xmlEntityPtr ret_val;
9656 xmlChar * name; /* the entity name */
9659 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9660 mem_base = xmlMemBlocks();
9661 name = gen_const_xmlChar_ptr(n_name, 0);
9663 ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9664 desret_xmlEntityPtr(ret_val);
9666 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9667 xmlResetLastError();
9668 if (mem_base != xmlMemBlocks()) {
9669 printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9670 xmlMemBlocks() - mem_base);
9672 printf(" %d", n_name);
9683 test_xmlInitializePredefinedEntities(void) {
9686 #if defined(LIBXML_LEGACY_ENABLED)
9687 #ifdef LIBXML_LEGACY_ENABLED
9690 mem_base = xmlMemBlocks();
9692 xmlInitializePredefinedEntities();
9694 xmlResetLastError();
9695 if (mem_base != xmlMemBlocks()) {
9696 printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9697 xmlMemBlocks() - mem_base);
9710 test_xmlNewEntity(void) {
9714 xmlEntityPtr ret_val;
9715 xmlDocPtr doc; /* the document */
9717 xmlChar * name; /* the entity name */
9719 int type; /* the entity type XML_xxx_yyy_ENTITY */
9721 xmlChar * ExternalID; /* the entity external ID if available */
9723 xmlChar * SystemID; /* the entity system ID if available */
9725 xmlChar * content; /* the entity content */
9728 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9729 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9730 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9731 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9732 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9733 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9734 mem_base = xmlMemBlocks();
9735 doc = gen_xmlDocPtr(n_doc, 0);
9736 name = gen_const_xmlChar_ptr(n_name, 1);
9737 type = gen_int(n_type, 2);
9738 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9739 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9740 content = gen_const_xmlChar_ptr(n_content, 5);
9742 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9743 desret_xmlEntityPtr(ret_val);
9745 des_xmlDocPtr(n_doc, doc, 0);
9746 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9747 des_int(n_type, type, 2);
9748 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9749 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9750 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9751 xmlResetLastError();
9752 if (mem_base != xmlMemBlocks()) {
9753 printf("Leak of %d blocks found in xmlNewEntity",
9754 xmlMemBlocks() - mem_base);
9756 printf(" %d", n_doc);
9757 printf(" %d", n_name);
9758 printf(" %d", n_type);
9759 printf(" %d", n_ExternalID);
9760 printf(" %d", n_SystemID);
9761 printf(" %d", n_content);
9776 test_entities(void) {
9779 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9780 test_ret += test_xmlAddDocEntity();
9781 test_ret += test_xmlAddDtdEntity();
9782 test_ret += test_xmlCleanupPredefinedEntities();
9783 test_ret += test_xmlCopyEntitiesTable();
9784 test_ret += test_xmlCreateEntitiesTable();
9785 test_ret += test_xmlDumpEntitiesTable();
9786 test_ret += test_xmlDumpEntityDecl();
9787 test_ret += test_xmlEncodeEntitiesReentrant();
9788 test_ret += test_xmlEncodeSpecialChars();
9789 test_ret += test_xmlGetDocEntity();
9790 test_ret += test_xmlGetDtdEntity();
9791 test_ret += test_xmlGetParameterEntity();
9792 test_ret += test_xmlGetPredefinedEntity();
9793 test_ret += test_xmlInitializePredefinedEntities();
9794 test_ret += test_xmlNewEntity();
9797 printf("Module entities: %d errors\n", test_ret);
9802 test_xmlHashAddEntry(void) {
9807 xmlHashTablePtr table; /* the hash table */
9809 xmlChar * name; /* the name of the userdata */
9811 void * userdata; /* a pointer to the userdata */
9814 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9815 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9816 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9817 mem_base = xmlMemBlocks();
9818 table = gen_xmlHashTablePtr(n_table, 0);
9819 name = gen_const_xmlChar_ptr(n_name, 1);
9820 userdata = gen_userdata(n_userdata, 2);
9822 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9823 desret_int(ret_val);
9825 des_xmlHashTablePtr(n_table, table, 0);
9826 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9827 des_userdata(n_userdata, userdata, 2);
9828 xmlResetLastError();
9829 if (mem_base != xmlMemBlocks()) {
9830 printf("Leak of %d blocks found in xmlHashAddEntry",
9831 xmlMemBlocks() - mem_base);
9833 printf(" %d", n_table);
9834 printf(" %d", n_name);
9835 printf(" %d", n_userdata);
9848 test_xmlHashAddEntry2(void) {
9853 xmlHashTablePtr table; /* the hash table */
9855 xmlChar * name; /* the name of the userdata */
9857 xmlChar * name2; /* a second name of the userdata */
9859 void * userdata; /* a pointer to the userdata */
9862 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9863 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9864 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9865 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9866 mem_base = xmlMemBlocks();
9867 table = gen_xmlHashTablePtr(n_table, 0);
9868 name = gen_const_xmlChar_ptr(n_name, 1);
9869 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9870 userdata = gen_userdata(n_userdata, 3);
9872 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9873 desret_int(ret_val);
9875 des_xmlHashTablePtr(n_table, table, 0);
9876 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9877 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9878 des_userdata(n_userdata, userdata, 3);
9879 xmlResetLastError();
9880 if (mem_base != xmlMemBlocks()) {
9881 printf("Leak of %d blocks found in xmlHashAddEntry2",
9882 xmlMemBlocks() - mem_base);
9884 printf(" %d", n_table);
9885 printf(" %d", n_name);
9886 printf(" %d", n_name2);
9887 printf(" %d", n_userdata);
9901 test_xmlHashAddEntry3(void) {
9906 xmlHashTablePtr table; /* the hash table */
9908 xmlChar * name; /* the name of the userdata */
9910 xmlChar * name2; /* a second name of the userdata */
9912 xmlChar * name3; /* a third name of the userdata */
9914 void * userdata; /* a pointer to the userdata */
9917 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9918 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9919 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9920 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9921 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9922 mem_base = xmlMemBlocks();
9923 table = gen_xmlHashTablePtr(n_table, 0);
9924 name = gen_const_xmlChar_ptr(n_name, 1);
9925 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9926 name3 = gen_const_xmlChar_ptr(n_name3, 3);
9927 userdata = gen_userdata(n_userdata, 4);
9929 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9930 desret_int(ret_val);
9932 des_xmlHashTablePtr(n_table, table, 0);
9933 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9934 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9935 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9936 des_userdata(n_userdata, userdata, 4);
9937 xmlResetLastError();
9938 if (mem_base != xmlMemBlocks()) {
9939 printf("Leak of %d blocks found in xmlHashAddEntry3",
9940 xmlMemBlocks() - mem_base);
9942 printf(" %d", n_table);
9943 printf(" %d", n_name);
9944 printf(" %d", n_name2);
9945 printf(" %d", n_name3);
9946 printf(" %d", n_userdata);
9961 test_xmlHashCopy(void) {
9965 /* missing type support */
9971 test_xmlHashCreate(void) {
9975 /* missing type support */
9981 test_xmlHashCreateDict(void) {
9985 /* missing type support */
9991 test_xmlHashLookup(void) {
9996 xmlHashTablePtr table; /* the hash table */
9998 xmlChar * name; /* the name of the userdata */
10001 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10002 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10003 mem_base = xmlMemBlocks();
10004 table = gen_xmlHashTablePtr(n_table, 0);
10005 name = gen_const_xmlChar_ptr(n_name, 1);
10007 ret_val = xmlHashLookup(table, (const xmlChar *)name);
10008 desret_void_ptr(ret_val);
10010 des_xmlHashTablePtr(n_table, table, 0);
10011 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10012 xmlResetLastError();
10013 if (mem_base != xmlMemBlocks()) {
10014 printf("Leak of %d blocks found in xmlHashLookup",
10015 xmlMemBlocks() - mem_base);
10017 printf(" %d", n_table);
10018 printf(" %d", n_name);
10030 test_xmlHashLookup2(void) {
10035 xmlHashTablePtr table; /* the hash table */
10037 xmlChar * name; /* the name of the userdata */
10039 xmlChar * name2; /* a second name of the userdata */
10042 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10043 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10044 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10045 mem_base = xmlMemBlocks();
10046 table = gen_xmlHashTablePtr(n_table, 0);
10047 name = gen_const_xmlChar_ptr(n_name, 1);
10048 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10050 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10051 desret_void_ptr(ret_val);
10053 des_xmlHashTablePtr(n_table, table, 0);
10054 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10055 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10056 xmlResetLastError();
10057 if (mem_base != xmlMemBlocks()) {
10058 printf("Leak of %d blocks found in xmlHashLookup2",
10059 xmlMemBlocks() - mem_base);
10061 printf(" %d", n_table);
10062 printf(" %d", n_name);
10063 printf(" %d", n_name2);
10076 test_xmlHashLookup3(void) {
10081 xmlHashTablePtr table; /* the hash table */
10083 xmlChar * name; /* the name of the userdata */
10085 xmlChar * name2; /* a second name of the userdata */
10087 xmlChar * name3; /* a third name of the userdata */
10090 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10091 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10092 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10093 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10094 mem_base = xmlMemBlocks();
10095 table = gen_xmlHashTablePtr(n_table, 0);
10096 name = gen_const_xmlChar_ptr(n_name, 1);
10097 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10098 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10100 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10101 desret_void_ptr(ret_val);
10103 des_xmlHashTablePtr(n_table, table, 0);
10104 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10105 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10106 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10107 xmlResetLastError();
10108 if (mem_base != xmlMemBlocks()) {
10109 printf("Leak of %d blocks found in xmlHashLookup3",
10110 xmlMemBlocks() - mem_base);
10112 printf(" %d", n_table);
10113 printf(" %d", n_name);
10114 printf(" %d", n_name2);
10115 printf(" %d", n_name3);
10129 test_xmlHashQLookup(void) {
10134 xmlHashTablePtr table; /* the hash table */
10136 xmlChar * prefix; /* the prefix of the userdata */
10138 xmlChar * name; /* the name of the userdata */
10141 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10142 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10143 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10144 mem_base = xmlMemBlocks();
10145 table = gen_xmlHashTablePtr(n_table, 0);
10146 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10147 name = gen_const_xmlChar_ptr(n_name, 2);
10149 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10150 desret_void_ptr(ret_val);
10152 des_xmlHashTablePtr(n_table, table, 0);
10153 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10154 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10155 xmlResetLastError();
10156 if (mem_base != xmlMemBlocks()) {
10157 printf("Leak of %d blocks found in xmlHashQLookup",
10158 xmlMemBlocks() - mem_base);
10160 printf(" %d", n_table);
10161 printf(" %d", n_prefix);
10162 printf(" %d", n_name);
10175 test_xmlHashQLookup2(void) {
10180 xmlHashTablePtr table; /* the hash table */
10182 xmlChar * prefix; /* the prefix of the userdata */
10184 xmlChar * name; /* the name of the userdata */
10186 xmlChar * prefix2; /* the second prefix of the userdata */
10188 xmlChar * name2; /* a second name of the userdata */
10191 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10192 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10193 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10194 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10195 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10196 mem_base = xmlMemBlocks();
10197 table = gen_xmlHashTablePtr(n_table, 0);
10198 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10199 name = gen_const_xmlChar_ptr(n_name, 2);
10200 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10201 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10203 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10204 desret_void_ptr(ret_val);
10206 des_xmlHashTablePtr(n_table, table, 0);
10207 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10208 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10209 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10210 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10211 xmlResetLastError();
10212 if (mem_base != xmlMemBlocks()) {
10213 printf("Leak of %d blocks found in xmlHashQLookup2",
10214 xmlMemBlocks() - mem_base);
10216 printf(" %d", n_table);
10217 printf(" %d", n_prefix);
10218 printf(" %d", n_name);
10219 printf(" %d", n_prefix2);
10220 printf(" %d", n_name2);
10235 test_xmlHashQLookup3(void) {
10240 xmlHashTablePtr table; /* the hash table */
10242 xmlChar * prefix; /* the prefix of the userdata */
10244 xmlChar * name; /* the name of the userdata */
10246 xmlChar * prefix2; /* the second prefix of the userdata */
10248 xmlChar * name2; /* a second name of the userdata */
10250 xmlChar * prefix3; /* the third prefix of the userdata */
10252 xmlChar * name3; /* a third name of the userdata */
10255 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10256 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10257 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10258 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10259 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10260 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10261 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10262 mem_base = xmlMemBlocks();
10263 table = gen_xmlHashTablePtr(n_table, 0);
10264 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10265 name = gen_const_xmlChar_ptr(n_name, 2);
10266 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10267 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10268 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10269 name3 = gen_const_xmlChar_ptr(n_name3, 6);
10271 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10272 desret_void_ptr(ret_val);
10274 des_xmlHashTablePtr(n_table, table, 0);
10275 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10276 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10277 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10278 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10279 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10280 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10281 xmlResetLastError();
10282 if (mem_base != xmlMemBlocks()) {
10283 printf("Leak of %d blocks found in xmlHashQLookup3",
10284 xmlMemBlocks() - mem_base);
10286 printf(" %d", n_table);
10287 printf(" %d", n_prefix);
10288 printf(" %d", n_name);
10289 printf(" %d", n_prefix2);
10290 printf(" %d", n_name2);
10291 printf(" %d", n_prefix3);
10292 printf(" %d", n_name3);
10309 test_xmlHashRemoveEntry(void) {
10314 xmlHashTablePtr table; /* the hash table */
10316 xmlChar * name; /* the name of the userdata */
10318 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10321 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10322 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10323 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10324 mem_base = xmlMemBlocks();
10325 table = gen_xmlHashTablePtr(n_table, 0);
10326 name = gen_const_xmlChar_ptr(n_name, 1);
10327 f = gen_xmlHashDeallocator(n_f, 2);
10329 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10330 desret_int(ret_val);
10332 des_xmlHashTablePtr(n_table, table, 0);
10333 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10334 des_xmlHashDeallocator(n_f, f, 2);
10335 xmlResetLastError();
10336 if (mem_base != xmlMemBlocks()) {
10337 printf("Leak of %d blocks found in xmlHashRemoveEntry",
10338 xmlMemBlocks() - mem_base);
10340 printf(" %d", n_table);
10341 printf(" %d", n_name);
10342 printf(" %d", n_f);
10355 test_xmlHashRemoveEntry2(void) {
10360 xmlHashTablePtr table; /* the hash table */
10362 xmlChar * name; /* the name of the userdata */
10364 xmlChar * name2; /* a second name of the userdata */
10366 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10369 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10370 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10371 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10372 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10373 mem_base = xmlMemBlocks();
10374 table = gen_xmlHashTablePtr(n_table, 0);
10375 name = gen_const_xmlChar_ptr(n_name, 1);
10376 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10377 f = gen_xmlHashDeallocator(n_f, 3);
10379 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10380 desret_int(ret_val);
10382 des_xmlHashTablePtr(n_table, table, 0);
10383 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10384 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10385 des_xmlHashDeallocator(n_f, f, 3);
10386 xmlResetLastError();
10387 if (mem_base != xmlMemBlocks()) {
10388 printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10389 xmlMemBlocks() - mem_base);
10391 printf(" %d", n_table);
10392 printf(" %d", n_name);
10393 printf(" %d", n_name2);
10394 printf(" %d", n_f);
10408 test_xmlHashRemoveEntry3(void) {
10413 xmlHashTablePtr table; /* the hash table */
10415 xmlChar * name; /* the name of the userdata */
10417 xmlChar * name2; /* a second name of the userdata */
10419 xmlChar * name3; /* a third name of the userdata */
10421 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10424 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10425 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10426 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10427 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10428 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10429 mem_base = xmlMemBlocks();
10430 table = gen_xmlHashTablePtr(n_table, 0);
10431 name = gen_const_xmlChar_ptr(n_name, 1);
10432 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10433 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10434 f = gen_xmlHashDeallocator(n_f, 4);
10436 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10437 desret_int(ret_val);
10439 des_xmlHashTablePtr(n_table, table, 0);
10440 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10441 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10442 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10443 des_xmlHashDeallocator(n_f, f, 4);
10444 xmlResetLastError();
10445 if (mem_base != xmlMemBlocks()) {
10446 printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10447 xmlMemBlocks() - mem_base);
10449 printf(" %d", n_table);
10450 printf(" %d", n_name);
10451 printf(" %d", n_name2);
10452 printf(" %d", n_name3);
10453 printf(" %d", n_f);
10468 test_xmlHashScan(void) {
10472 /* missing type support */
10478 test_xmlHashScan3(void) {
10482 /* missing type support */
10488 test_xmlHashScanFull(void) {
10492 /* missing type support */
10498 test_xmlHashScanFull3(void) {
10502 /* missing type support */
10508 test_xmlHashSize(void) {
10513 xmlHashTablePtr table; /* the hash table */
10516 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10517 mem_base = xmlMemBlocks();
10518 table = gen_xmlHashTablePtr(n_table, 0);
10520 ret_val = xmlHashSize(table);
10521 desret_int(ret_val);
10523 des_xmlHashTablePtr(n_table, table, 0);
10524 xmlResetLastError();
10525 if (mem_base != xmlMemBlocks()) {
10526 printf("Leak of %d blocks found in xmlHashSize",
10527 xmlMemBlocks() - mem_base);
10529 printf(" %d", n_table);
10540 test_xmlHashUpdateEntry(void) {
10545 xmlHashTablePtr table; /* the hash table */
10547 xmlChar * name; /* the name of the userdata */
10549 void * userdata; /* a pointer to the userdata */
10551 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10554 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10555 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10556 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10557 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10558 mem_base = xmlMemBlocks();
10559 table = gen_xmlHashTablePtr(n_table, 0);
10560 name = gen_const_xmlChar_ptr(n_name, 1);
10561 userdata = gen_userdata(n_userdata, 2);
10562 f = gen_xmlHashDeallocator(n_f, 3);
10564 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10565 desret_int(ret_val);
10567 des_xmlHashTablePtr(n_table, table, 0);
10568 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10569 des_userdata(n_userdata, userdata, 2);
10570 des_xmlHashDeallocator(n_f, f, 3);
10571 xmlResetLastError();
10572 if (mem_base != xmlMemBlocks()) {
10573 printf("Leak of %d blocks found in xmlHashUpdateEntry",
10574 xmlMemBlocks() - mem_base);
10576 printf(" %d", n_table);
10577 printf(" %d", n_name);
10578 printf(" %d", n_userdata);
10579 printf(" %d", n_f);
10593 test_xmlHashUpdateEntry2(void) {
10598 xmlHashTablePtr table; /* the hash table */
10600 xmlChar * name; /* the name of the userdata */
10602 xmlChar * name2; /* a second name of the userdata */
10604 void * userdata; /* a pointer to the userdata */
10606 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10609 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10610 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10611 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10612 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10613 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10614 mem_base = xmlMemBlocks();
10615 table = gen_xmlHashTablePtr(n_table, 0);
10616 name = gen_const_xmlChar_ptr(n_name, 1);
10617 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10618 userdata = gen_userdata(n_userdata, 3);
10619 f = gen_xmlHashDeallocator(n_f, 4);
10621 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10622 desret_int(ret_val);
10624 des_xmlHashTablePtr(n_table, table, 0);
10625 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10626 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10627 des_userdata(n_userdata, userdata, 3);
10628 des_xmlHashDeallocator(n_f, f, 4);
10629 xmlResetLastError();
10630 if (mem_base != xmlMemBlocks()) {
10631 printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10632 xmlMemBlocks() - mem_base);
10634 printf(" %d", n_table);
10635 printf(" %d", n_name);
10636 printf(" %d", n_name2);
10637 printf(" %d", n_userdata);
10638 printf(" %d", n_f);
10653 test_xmlHashUpdateEntry3(void) {
10658 xmlHashTablePtr table; /* the hash table */
10660 xmlChar * name; /* the name of the userdata */
10662 xmlChar * name2; /* a second name of the userdata */
10664 xmlChar * name3; /* a third name of the userdata */
10666 void * userdata; /* a pointer to the userdata */
10668 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10671 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10672 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10673 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10674 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10675 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10676 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10677 mem_base = xmlMemBlocks();
10678 table = gen_xmlHashTablePtr(n_table, 0);
10679 name = gen_const_xmlChar_ptr(n_name, 1);
10680 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10681 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10682 userdata = gen_userdata(n_userdata, 4);
10683 f = gen_xmlHashDeallocator(n_f, 5);
10685 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10686 desret_int(ret_val);
10688 des_xmlHashTablePtr(n_table, table, 0);
10689 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10690 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10691 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10692 des_userdata(n_userdata, userdata, 4);
10693 des_xmlHashDeallocator(n_f, f, 5);
10694 xmlResetLastError();
10695 if (mem_base != xmlMemBlocks()) {
10696 printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10697 xmlMemBlocks() - mem_base);
10699 printf(" %d", n_table);
10700 printf(" %d", n_name);
10701 printf(" %d", n_name2);
10702 printf(" %d", n_name3);
10703 printf(" %d", n_userdata);
10704 printf(" %d", n_f);
10722 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10723 test_ret += test_xmlHashAddEntry();
10724 test_ret += test_xmlHashAddEntry2();
10725 test_ret += test_xmlHashAddEntry3();
10726 test_ret += test_xmlHashCopy();
10727 test_ret += test_xmlHashCreate();
10728 test_ret += test_xmlHashCreateDict();
10729 test_ret += test_xmlHashLookup();
10730 test_ret += test_xmlHashLookup2();
10731 test_ret += test_xmlHashLookup3();
10732 test_ret += test_xmlHashQLookup();
10733 test_ret += test_xmlHashQLookup2();
10734 test_ret += test_xmlHashQLookup3();
10735 test_ret += test_xmlHashRemoveEntry();
10736 test_ret += test_xmlHashRemoveEntry2();
10737 test_ret += test_xmlHashRemoveEntry3();
10738 test_ret += test_xmlHashScan();
10739 test_ret += test_xmlHashScan3();
10740 test_ret += test_xmlHashScanFull();
10741 test_ret += test_xmlHashScanFull3();
10742 test_ret += test_xmlHashSize();
10743 test_ret += test_xmlHashUpdateEntry();
10744 test_ret += test_xmlHashUpdateEntry2();
10745 test_ret += test_xmlHashUpdateEntry3();
10748 printf("Module hash: %d errors\n", test_ret);
10752 #define gen_nb_xmlLinkPtr 1
10753 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10756 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10760 test_xmlLinkGetData(void) {
10765 xmlLinkPtr lk; /* a link */
10768 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10769 mem_base = xmlMemBlocks();
10770 lk = gen_xmlLinkPtr(n_lk, 0);
10772 ret_val = xmlLinkGetData(lk);
10773 desret_void_ptr(ret_val);
10775 des_xmlLinkPtr(n_lk, lk, 0);
10776 xmlResetLastError();
10777 if (mem_base != xmlMemBlocks()) {
10778 printf("Leak of %d blocks found in xmlLinkGetData",
10779 xmlMemBlocks() - mem_base);
10781 printf(" %d", n_lk);
10792 test_xmlListAppend(void) {
10797 xmlListPtr l; /* a list */
10799 void * data; /* the data */
10802 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10803 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10804 mem_base = xmlMemBlocks();
10805 l = gen_xmlListPtr(n_l, 0);
10806 data = gen_userdata(n_data, 1);
10808 ret_val = xmlListAppend(l, data);
10809 desret_int(ret_val);
10811 des_xmlListPtr(n_l, l, 0);
10812 des_userdata(n_data, data, 1);
10813 xmlResetLastError();
10814 if (mem_base != xmlMemBlocks()) {
10815 printf("Leak of %d blocks found in xmlListAppend",
10816 xmlMemBlocks() - mem_base);
10818 printf(" %d", n_l);
10819 printf(" %d", n_data);
10831 test_xmlListClear(void) {
10835 xmlListPtr l; /* a list */
10838 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10839 mem_base = xmlMemBlocks();
10840 l = gen_xmlListPtr(n_l, 0);
10844 des_xmlListPtr(n_l, l, 0);
10845 xmlResetLastError();
10846 if (mem_base != xmlMemBlocks()) {
10847 printf("Leak of %d blocks found in xmlListClear",
10848 xmlMemBlocks() - mem_base);
10850 printf(" %d", n_l);
10860 #define gen_nb_const_xmlListPtr 1
10861 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10864 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10868 test_xmlListCopy(void) {
10873 xmlListPtr cur; /* the new list */
10875 xmlListPtr old; /* the old list */
10878 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10879 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10880 mem_base = xmlMemBlocks();
10881 cur = gen_xmlListPtr(n_cur, 0);
10882 old = gen_const_xmlListPtr(n_old, 1);
10884 ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10885 desret_int(ret_val);
10887 des_xmlListPtr(n_cur, cur, 0);
10888 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10889 xmlResetLastError();
10890 if (mem_base != xmlMemBlocks()) {
10891 printf("Leak of %d blocks found in xmlListCopy",
10892 xmlMemBlocks() - mem_base);
10894 printf(" %d", n_cur);
10895 printf(" %d", n_old);
10907 test_xmlListCreate(void) {
10911 /* missing type support */
10917 test_xmlListDup(void) {
10921 /* missing type support */
10927 test_xmlListEmpty(void) {
10932 xmlListPtr l; /* a list */
10935 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10936 mem_base = xmlMemBlocks();
10937 l = gen_xmlListPtr(n_l, 0);
10939 ret_val = xmlListEmpty(l);
10940 desret_int(ret_val);
10942 des_xmlListPtr(n_l, l, 0);
10943 xmlResetLastError();
10944 if (mem_base != xmlMemBlocks()) {
10945 printf("Leak of %d blocks found in xmlListEmpty",
10946 xmlMemBlocks() - mem_base);
10948 printf(" %d", n_l);
10959 test_xmlListEnd(void) {
10963 /* missing type support */
10969 test_xmlListFront(void) {
10973 /* missing type support */
10979 test_xmlListInsert(void) {
10984 xmlListPtr l; /* a list */
10986 void * data; /* the data */
10989 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10990 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10991 mem_base = xmlMemBlocks();
10992 l = gen_xmlListPtr(n_l, 0);
10993 data = gen_userdata(n_data, 1);
10995 ret_val = xmlListInsert(l, data);
10996 desret_int(ret_val);
10998 des_xmlListPtr(n_l, l, 0);
10999 des_userdata(n_data, data, 1);
11000 xmlResetLastError();
11001 if (mem_base != xmlMemBlocks()) {
11002 printf("Leak of %d blocks found in xmlListInsert",
11003 xmlMemBlocks() - mem_base);
11005 printf(" %d", n_l);
11006 printf(" %d", n_data);
11018 test_xmlListMerge(void) {
11022 xmlListPtr l1; /* the original list */
11024 xmlListPtr l2; /* the new list */
11027 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
11028 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
11029 mem_base = xmlMemBlocks();
11030 l1 = gen_xmlListPtr(n_l1, 0);
11031 l2 = gen_xmlListPtr(n_l2, 1);
11033 xmlListMerge(l1, l2);
11035 des_xmlListPtr(n_l1, l1, 0);
11036 des_xmlListPtr(n_l2, l2, 1);
11037 xmlResetLastError();
11038 if (mem_base != xmlMemBlocks()) {
11039 printf("Leak of %d blocks found in xmlListMerge",
11040 xmlMemBlocks() - mem_base);
11042 printf(" %d", n_l1);
11043 printf(" %d", n_l2);
11055 test_xmlListPopBack(void) {
11059 xmlListPtr l; /* a list */
11062 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11063 mem_base = xmlMemBlocks();
11064 l = gen_xmlListPtr(n_l, 0);
11068 des_xmlListPtr(n_l, l, 0);
11069 xmlResetLastError();
11070 if (mem_base != xmlMemBlocks()) {
11071 printf("Leak of %d blocks found in xmlListPopBack",
11072 xmlMemBlocks() - mem_base);
11074 printf(" %d", n_l);
11085 test_xmlListPopFront(void) {
11089 xmlListPtr l; /* a list */
11092 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11093 mem_base = xmlMemBlocks();
11094 l = gen_xmlListPtr(n_l, 0);
11096 xmlListPopFront(l);
11098 des_xmlListPtr(n_l, l, 0);
11099 xmlResetLastError();
11100 if (mem_base != xmlMemBlocks()) {
11101 printf("Leak of %d blocks found in xmlListPopFront",
11102 xmlMemBlocks() - mem_base);
11104 printf(" %d", n_l);
11115 test_xmlListPushBack(void) {
11120 xmlListPtr l; /* a list */
11122 void * data; /* new data */
11125 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11126 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11127 mem_base = xmlMemBlocks();
11128 l = gen_xmlListPtr(n_l, 0);
11129 data = gen_userdata(n_data, 1);
11131 ret_val = xmlListPushBack(l, data);
11132 desret_int(ret_val);
11134 des_xmlListPtr(n_l, l, 0);
11135 des_userdata(n_data, data, 1);
11136 xmlResetLastError();
11137 if (mem_base != xmlMemBlocks()) {
11138 printf("Leak of %d blocks found in xmlListPushBack",
11139 xmlMemBlocks() - mem_base);
11141 printf(" %d", n_l);
11142 printf(" %d", n_data);
11154 test_xmlListPushFront(void) {
11159 xmlListPtr l; /* a list */
11161 void * data; /* new data */
11164 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11165 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11166 mem_base = xmlMemBlocks();
11167 l = gen_xmlListPtr(n_l, 0);
11168 data = gen_userdata(n_data, 1);
11170 ret_val = xmlListPushFront(l, data);
11171 desret_int(ret_val);
11173 des_xmlListPtr(n_l, l, 0);
11174 des_userdata(n_data, data, 1);
11175 xmlResetLastError();
11176 if (mem_base != xmlMemBlocks()) {
11177 printf("Leak of %d blocks found in xmlListPushFront",
11178 xmlMemBlocks() - mem_base);
11180 printf(" %d", n_l);
11181 printf(" %d", n_data);
11193 test_xmlListRemoveAll(void) {
11198 xmlListPtr l; /* a list */
11200 void * data; /* list data */
11203 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11204 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11205 mem_base = xmlMemBlocks();
11206 l = gen_xmlListPtr(n_l, 0);
11207 data = gen_userdata(n_data, 1);
11209 ret_val = xmlListRemoveAll(l, data);
11210 desret_int(ret_val);
11212 des_xmlListPtr(n_l, l, 0);
11213 des_userdata(n_data, data, 1);
11214 xmlResetLastError();
11215 if (mem_base != xmlMemBlocks()) {
11216 printf("Leak of %d blocks found in xmlListRemoveAll",
11217 xmlMemBlocks() - mem_base);
11219 printf(" %d", n_l);
11220 printf(" %d", n_data);
11232 test_xmlListRemoveFirst(void) {
11237 xmlListPtr l; /* a list */
11239 void * data; /* list data */
11242 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11243 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11244 mem_base = xmlMemBlocks();
11245 l = gen_xmlListPtr(n_l, 0);
11246 data = gen_userdata(n_data, 1);
11248 ret_val = xmlListRemoveFirst(l, data);
11249 desret_int(ret_val);
11251 des_xmlListPtr(n_l, l, 0);
11252 des_userdata(n_data, data, 1);
11253 xmlResetLastError();
11254 if (mem_base != xmlMemBlocks()) {
11255 printf("Leak of %d blocks found in xmlListRemoveFirst",
11256 xmlMemBlocks() - mem_base);
11258 printf(" %d", n_l);
11259 printf(" %d", n_data);
11271 test_xmlListRemoveLast(void) {
11276 xmlListPtr l; /* a list */
11278 void * data; /* list data */
11281 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11282 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11283 mem_base = xmlMemBlocks();
11284 l = gen_xmlListPtr(n_l, 0);
11285 data = gen_userdata(n_data, 1);
11287 ret_val = xmlListRemoveLast(l, data);
11288 desret_int(ret_val);
11290 des_xmlListPtr(n_l, l, 0);
11291 des_userdata(n_data, data, 1);
11292 xmlResetLastError();
11293 if (mem_base != xmlMemBlocks()) {
11294 printf("Leak of %d blocks found in xmlListRemoveLast",
11295 xmlMemBlocks() - mem_base);
11297 printf(" %d", n_l);
11298 printf(" %d", n_data);
11310 test_xmlListReverse(void) {
11314 xmlListPtr l; /* a list */
11317 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11318 mem_base = xmlMemBlocks();
11319 l = gen_xmlListPtr(n_l, 0);
11323 des_xmlListPtr(n_l, l, 0);
11324 xmlResetLastError();
11325 if (mem_base != xmlMemBlocks()) {
11326 printf("Leak of %d blocks found in xmlListReverse",
11327 xmlMemBlocks() - mem_base);
11329 printf(" %d", n_l);
11340 test_xmlListReverseSearch(void) {
11345 xmlListPtr l; /* a list */
11347 void * data; /* a search value */
11350 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11351 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11352 mem_base = xmlMemBlocks();
11353 l = gen_xmlListPtr(n_l, 0);
11354 data = gen_userdata(n_data, 1);
11356 ret_val = xmlListReverseSearch(l, data);
11357 desret_void_ptr(ret_val);
11359 des_xmlListPtr(n_l, l, 0);
11360 des_userdata(n_data, data, 1);
11361 xmlResetLastError();
11362 if (mem_base != xmlMemBlocks()) {
11363 printf("Leak of %d blocks found in xmlListReverseSearch",
11364 xmlMemBlocks() - mem_base);
11366 printf(" %d", n_l);
11367 printf(" %d", n_data);
11379 test_xmlListReverseWalk(void) {
11383 /* missing type support */
11389 test_xmlListSearch(void) {
11394 xmlListPtr l; /* a list */
11396 void * data; /* a search value */
11399 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11400 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11401 mem_base = xmlMemBlocks();
11402 l = gen_xmlListPtr(n_l, 0);
11403 data = gen_userdata(n_data, 1);
11405 ret_val = xmlListSearch(l, data);
11406 desret_void_ptr(ret_val);
11408 des_xmlListPtr(n_l, l, 0);
11409 des_userdata(n_data, data, 1);
11410 xmlResetLastError();
11411 if (mem_base != xmlMemBlocks()) {
11412 printf("Leak of %d blocks found in xmlListSearch",
11413 xmlMemBlocks() - mem_base);
11415 printf(" %d", n_l);
11416 printf(" %d", n_data);
11428 test_xmlListSize(void) {
11433 xmlListPtr l; /* a list */
11436 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11437 mem_base = xmlMemBlocks();
11438 l = gen_xmlListPtr(n_l, 0);
11440 ret_val = xmlListSize(l);
11441 desret_int(ret_val);
11443 des_xmlListPtr(n_l, l, 0);
11444 xmlResetLastError();
11445 if (mem_base != xmlMemBlocks()) {
11446 printf("Leak of %d blocks found in xmlListSize",
11447 xmlMemBlocks() - mem_base);
11449 printf(" %d", n_l);
11460 test_xmlListSort(void) {
11464 xmlListPtr l; /* a list */
11467 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11468 mem_base = xmlMemBlocks();
11469 l = gen_xmlListPtr(n_l, 0);
11473 des_xmlListPtr(n_l, l, 0);
11474 xmlResetLastError();
11475 if (mem_base != xmlMemBlocks()) {
11476 printf("Leak of %d blocks found in xmlListSort",
11477 xmlMemBlocks() - mem_base);
11479 printf(" %d", n_l);
11490 test_xmlListWalk(void) {
11494 /* missing type support */
11502 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11503 test_ret += test_xmlLinkGetData();
11504 test_ret += test_xmlListAppend();
11505 test_ret += test_xmlListClear();
11506 test_ret += test_xmlListCopy();
11507 test_ret += test_xmlListCreate();
11508 test_ret += test_xmlListDup();
11509 test_ret += test_xmlListEmpty();
11510 test_ret += test_xmlListEnd();
11511 test_ret += test_xmlListFront();
11512 test_ret += test_xmlListInsert();
11513 test_ret += test_xmlListMerge();
11514 test_ret += test_xmlListPopBack();
11515 test_ret += test_xmlListPopFront();
11516 test_ret += test_xmlListPushBack();
11517 test_ret += test_xmlListPushFront();
11518 test_ret += test_xmlListRemoveAll();
11519 test_ret += test_xmlListRemoveFirst();
11520 test_ret += test_xmlListRemoveLast();
11521 test_ret += test_xmlListReverse();
11522 test_ret += test_xmlListReverseSearch();
11523 test_ret += test_xmlListReverseWalk();
11524 test_ret += test_xmlListSearch();
11525 test_ret += test_xmlListSize();
11526 test_ret += test_xmlListSort();
11527 test_ret += test_xmlListWalk();
11530 printf("Module list: %d errors\n", test_ret);
11535 test_xmlNanoFTPCheckResponse(void) {
11538 #if defined(LIBXML_FTP_ENABLED)
11541 void * ctx; /* an FTP context */
11544 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11545 mem_base = xmlMemBlocks();
11546 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11548 ret_val = xmlNanoFTPCheckResponse(ctx);
11549 desret_int(ret_val);
11551 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11552 xmlResetLastError();
11553 if (mem_base != xmlMemBlocks()) {
11554 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11555 xmlMemBlocks() - mem_base);
11557 printf(" %d", n_ctx);
11569 test_xmlNanoFTPCleanup(void) {
11572 #if defined(LIBXML_FTP_ENABLED)
11575 mem_base = xmlMemBlocks();
11577 xmlNanoFTPCleanup();
11579 xmlResetLastError();
11580 if (mem_base != xmlMemBlocks()) {
11581 printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11582 xmlMemBlocks() - mem_base);
11594 test_xmlNanoFTPCloseConnection(void) {
11597 #if defined(LIBXML_FTP_ENABLED)
11600 void * ctx; /* an FTP context */
11603 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11604 mem_base = xmlMemBlocks();
11605 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11607 ret_val = xmlNanoFTPCloseConnection(ctx);
11608 desret_int(ret_val);
11610 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11611 xmlResetLastError();
11612 if (mem_base != xmlMemBlocks()) {
11613 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11614 xmlMemBlocks() - mem_base);
11616 printf(" %d", n_ctx);
11628 test_xmlNanoFTPCwd(void) {
11631 #if defined(LIBXML_FTP_ENABLED)
11634 void * ctx; /* an FTP context */
11636 char * directory; /* a directory on the server */
11639 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11640 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11641 mem_base = xmlMemBlocks();
11642 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11643 directory = gen_const_char_ptr(n_directory, 1);
11645 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11646 desret_int(ret_val);
11648 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11649 des_const_char_ptr(n_directory, (const char *)directory, 1);
11650 xmlResetLastError();
11651 if (mem_base != xmlMemBlocks()) {
11652 printf("Leak of %d blocks found in xmlNanoFTPCwd",
11653 xmlMemBlocks() - mem_base);
11655 printf(" %d", n_ctx);
11656 printf(" %d", n_directory);
11669 test_xmlNanoFTPDele(void) {
11672 #if defined(LIBXML_FTP_ENABLED)
11675 void * ctx; /* an FTP context */
11677 const char * file; /* a file or directory on the server */
11680 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11681 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11682 mem_base = xmlMemBlocks();
11683 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11684 file = gen_filepath(n_file, 1);
11686 ret_val = xmlNanoFTPDele(ctx, file);
11687 desret_int(ret_val);
11689 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11690 des_filepath(n_file, file, 1);
11691 xmlResetLastError();
11692 if (mem_base != xmlMemBlocks()) {
11693 printf("Leak of %d blocks found in xmlNanoFTPDele",
11694 xmlMemBlocks() - mem_base);
11696 printf(" %d", n_ctx);
11697 printf(" %d", n_file);
11710 test_xmlNanoFTPGet(void) {
11714 /* missing type support */
11720 test_xmlNanoFTPGetConnection(void) {
11724 /* missing type support */
11730 test_xmlNanoFTPGetResponse(void) {
11733 #if defined(LIBXML_FTP_ENABLED)
11736 void * ctx; /* an FTP context */
11739 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11740 mem_base = xmlMemBlocks();
11741 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11743 ret_val = xmlNanoFTPGetResponse(ctx);
11744 desret_int(ret_val);
11746 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11747 xmlResetLastError();
11748 if (mem_base != xmlMemBlocks()) {
11749 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11750 xmlMemBlocks() - mem_base);
11752 printf(" %d", n_ctx);
11764 test_xmlNanoFTPGetSocket(void) {
11768 /* missing type support */
11774 test_xmlNanoFTPInit(void) {
11777 #if defined(LIBXML_FTP_ENABLED)
11780 mem_base = xmlMemBlocks();
11784 xmlResetLastError();
11785 if (mem_base != xmlMemBlocks()) {
11786 printf("Leak of %d blocks found in xmlNanoFTPInit",
11787 xmlMemBlocks() - mem_base);
11799 test_xmlNanoFTPList(void) {
11803 /* missing type support */
11809 test_xmlNanoFTPNewCtxt(void) {
11812 #if defined(LIBXML_FTP_ENABLED)
11815 const char * URL; /* The URL used to initialize the context */
11818 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11819 mem_base = xmlMemBlocks();
11820 URL = gen_filepath(n_URL, 0);
11822 ret_val = xmlNanoFTPNewCtxt(URL);
11823 desret_xmlNanoFTPCtxtPtr(ret_val);
11825 des_filepath(n_URL, URL, 0);
11826 xmlResetLastError();
11827 if (mem_base != xmlMemBlocks()) {
11828 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11829 xmlMemBlocks() - mem_base);
11831 printf(" %d", n_URL);
11843 test_xmlNanoFTPOpen(void) {
11846 #if defined(LIBXML_FTP_ENABLED)
11849 const char * URL; /* the URL to the resource */
11852 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11853 mem_base = xmlMemBlocks();
11854 URL = gen_filepath(n_URL, 0);
11856 ret_val = xmlNanoFTPOpen(URL);
11857 desret_xmlNanoFTPCtxtPtr(ret_val);
11859 des_filepath(n_URL, URL, 0);
11860 xmlResetLastError();
11861 if (mem_base != xmlMemBlocks()) {
11862 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11863 xmlMemBlocks() - mem_base);
11865 printf(" %d", n_URL);
11877 test_xmlNanoFTPProxy(void) {
11880 #if defined(LIBXML_FTP_ENABLED)
11881 char * host; /* the proxy host name */
11883 int port; /* the proxy port */
11885 char * user; /* the proxy user name */
11887 char * passwd; /* the proxy password */
11889 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11892 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11893 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11894 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11895 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11896 for (n_type = 0;n_type < gen_nb_int;n_type++) {
11897 host = gen_const_char_ptr(n_host, 0);
11898 port = gen_int(n_port, 1);
11899 user = gen_const_char_ptr(n_user, 2);
11900 passwd = gen_const_char_ptr(n_passwd, 3);
11901 type = gen_int(n_type, 4);
11903 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11905 des_const_char_ptr(n_host, (const char *)host, 0);
11906 des_int(n_port, port, 1);
11907 des_const_char_ptr(n_user, (const char *)user, 2);
11908 des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11909 des_int(n_type, type, 4);
11910 xmlResetLastError();
11924 test_xmlNanoFTPQuit(void) {
11927 #if defined(LIBXML_FTP_ENABLED)
11930 void * ctx; /* an FTP context */
11933 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11934 mem_base = xmlMemBlocks();
11935 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11937 ret_val = xmlNanoFTPQuit(ctx);
11938 desret_int(ret_val);
11940 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11941 xmlResetLastError();
11942 if (mem_base != xmlMemBlocks()) {
11943 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11944 xmlMemBlocks() - mem_base);
11946 printf(" %d", n_ctx);
11958 test_xmlNanoFTPRead(void) {
11961 #if defined(LIBXML_FTP_ENABLED)
11964 void * ctx; /* the FTP context */
11966 void * dest; /* a buffer */
11968 int len; /* the buffer length */
11971 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11972 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11973 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11974 mem_base = xmlMemBlocks();
11975 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11976 dest = gen_void_ptr(n_dest, 1);
11977 len = gen_int(n_len, 2);
11979 ret_val = xmlNanoFTPRead(ctx, dest, len);
11980 desret_int(ret_val);
11982 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11983 des_void_ptr(n_dest, dest, 1);
11984 des_int(n_len, len, 2);
11985 xmlResetLastError();
11986 if (mem_base != xmlMemBlocks()) {
11987 printf("Leak of %d blocks found in xmlNanoFTPRead",
11988 xmlMemBlocks() - mem_base);
11990 printf(" %d", n_ctx);
11991 printf(" %d", n_dest);
11992 printf(" %d", n_len);
12006 test_xmlNanoFTPScanProxy(void) {
12009 #if defined(LIBXML_FTP_ENABLED)
12010 const char * URL; /* The proxy URL used to initialize the proxy context */
12013 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12014 URL = gen_filepath(n_URL, 0);
12016 xmlNanoFTPScanProxy(URL);
12018 des_filepath(n_URL, URL, 0);
12019 xmlResetLastError();
12029 test_xmlNanoFTPUpdateURL(void) {
12032 #if defined(LIBXML_FTP_ENABLED)
12035 void * ctx; /* an FTP context */
12037 const char * URL; /* The URL used to update the context */
12040 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12041 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12042 mem_base = xmlMemBlocks();
12043 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12044 URL = gen_filepath(n_URL, 1);
12046 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12047 desret_int(ret_val);
12049 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12050 des_filepath(n_URL, URL, 1);
12051 xmlResetLastError();
12052 if (mem_base != xmlMemBlocks()) {
12053 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12054 xmlMemBlocks() - mem_base);
12056 printf(" %d", n_ctx);
12057 printf(" %d", n_URL);
12069 test_nanoftp(void) {
12072 if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12073 test_ret += test_xmlNanoFTPCheckResponse();
12074 test_ret += test_xmlNanoFTPCleanup();
12075 test_ret += test_xmlNanoFTPCloseConnection();
12076 test_ret += test_xmlNanoFTPCwd();
12077 test_ret += test_xmlNanoFTPDele();
12078 test_ret += test_xmlNanoFTPGet();
12079 test_ret += test_xmlNanoFTPGetConnection();
12080 test_ret += test_xmlNanoFTPGetResponse();
12081 test_ret += test_xmlNanoFTPGetSocket();
12082 test_ret += test_xmlNanoFTPInit();
12083 test_ret += test_xmlNanoFTPList();
12084 test_ret += test_xmlNanoFTPNewCtxt();
12085 test_ret += test_xmlNanoFTPOpen();
12086 test_ret += test_xmlNanoFTPProxy();
12087 test_ret += test_xmlNanoFTPQuit();
12088 test_ret += test_xmlNanoFTPRead();
12089 test_ret += test_xmlNanoFTPScanProxy();
12090 test_ret += test_xmlNanoFTPUpdateURL();
12093 printf("Module nanoftp: %d errors\n", test_ret);
12098 test_xmlNanoHTTPAuthHeader(void) {
12101 #if defined(LIBXML_HTTP_ENABLED)
12103 const char * ret_val;
12104 void * ctx; /* the HTTP context */
12107 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12108 mem_base = xmlMemBlocks();
12109 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12111 ret_val = xmlNanoHTTPAuthHeader(ctx);
12112 desret_const_char_ptr(ret_val);
12114 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12115 xmlResetLastError();
12116 if (mem_base != xmlMemBlocks()) {
12117 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12118 xmlMemBlocks() - mem_base);
12120 printf(" %d", n_ctx);
12132 test_xmlNanoHTTPCleanup(void) {
12135 #if defined(LIBXML_HTTP_ENABLED)
12138 mem_base = xmlMemBlocks();
12140 xmlNanoHTTPCleanup();
12142 xmlResetLastError();
12143 if (mem_base != xmlMemBlocks()) {
12144 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12145 xmlMemBlocks() - mem_base);
12157 test_xmlNanoHTTPContentLength(void) {
12160 #if defined(LIBXML_HTTP_ENABLED)
12163 void * ctx; /* the HTTP context */
12166 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12167 mem_base = xmlMemBlocks();
12168 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12170 ret_val = xmlNanoHTTPContentLength(ctx);
12171 desret_int(ret_val);
12173 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12174 xmlResetLastError();
12175 if (mem_base != xmlMemBlocks()) {
12176 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12177 xmlMemBlocks() - mem_base);
12179 printf(" %d", n_ctx);
12191 test_xmlNanoHTTPEncoding(void) {
12194 #if defined(LIBXML_HTTP_ENABLED)
12196 const char * ret_val;
12197 void * ctx; /* the HTTP context */
12200 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12201 mem_base = xmlMemBlocks();
12202 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12204 ret_val = xmlNanoHTTPEncoding(ctx);
12205 desret_const_char_ptr(ret_val);
12207 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12208 xmlResetLastError();
12209 if (mem_base != xmlMemBlocks()) {
12210 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12211 xmlMemBlocks() - mem_base);
12213 printf(" %d", n_ctx);
12224 #define gen_nb_char_ptr_ptr 1
12225 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12228 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12232 test_xmlNanoHTTPFetch(void) {
12235 #if defined(LIBXML_HTTP_ENABLED)
12238 const char * URL; /* The URL to load */
12240 const char * filename; /* the filename where the content should be saved */
12242 char ** contentType; /* if available the Content-Type information will be returned at that location */
12245 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12246 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12247 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12248 mem_base = xmlMemBlocks();
12249 URL = gen_fileoutput(n_URL, 0);
12250 filename = gen_fileoutput(n_filename, 1);
12251 contentType = gen_char_ptr_ptr(n_contentType, 2);
12253 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12254 desret_int(ret_val);
12256 des_fileoutput(n_URL, URL, 0);
12257 des_fileoutput(n_filename, filename, 1);
12258 des_char_ptr_ptr(n_contentType, contentType, 2);
12259 xmlResetLastError();
12260 if (mem_base != xmlMemBlocks()) {
12261 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12262 xmlMemBlocks() - mem_base);
12264 printf(" %d", n_URL);
12265 printf(" %d", n_filename);
12266 printf(" %d", n_contentType);
12280 test_xmlNanoHTTPInit(void) {
12283 #if defined(LIBXML_HTTP_ENABLED)
12286 mem_base = xmlMemBlocks();
12290 xmlResetLastError();
12291 if (mem_base != xmlMemBlocks()) {
12292 printf("Leak of %d blocks found in xmlNanoHTTPInit",
12293 xmlMemBlocks() - mem_base);
12305 test_xmlNanoHTTPMimeType(void) {
12308 #if defined(LIBXML_HTTP_ENABLED)
12310 const char * ret_val;
12311 void * ctx; /* the HTTP context */
12314 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12315 mem_base = xmlMemBlocks();
12316 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12318 ret_val = xmlNanoHTTPMimeType(ctx);
12319 desret_const_char_ptr(ret_val);
12321 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12322 xmlResetLastError();
12323 if (mem_base != xmlMemBlocks()) {
12324 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12325 xmlMemBlocks() - mem_base);
12327 printf(" %d", n_ctx);
12339 test_xmlNanoHTTPOpen(void) {
12342 #if defined(LIBXML_HTTP_ENABLED)
12345 const char * URL; /* The URL to load */
12347 char ** contentType; /* if available the Content-Type information will be returned at that location */
12350 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12351 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12352 mem_base = xmlMemBlocks();
12353 URL = gen_filepath(n_URL, 0);
12354 contentType = gen_char_ptr_ptr(n_contentType, 1);
12356 ret_val = xmlNanoHTTPOpen(URL, contentType);
12357 desret_xmlNanoHTTPCtxtPtr(ret_val);
12359 des_filepath(n_URL, URL, 0);
12360 des_char_ptr_ptr(n_contentType, contentType, 1);
12361 xmlResetLastError();
12362 if (mem_base != xmlMemBlocks()) {
12363 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12364 xmlMemBlocks() - mem_base);
12366 printf(" %d", n_URL);
12367 printf(" %d", n_contentType);
12380 test_xmlNanoHTTPOpenRedir(void) {
12383 #if defined(LIBXML_HTTP_ENABLED)
12386 const char * URL; /* The URL to load */
12388 char ** contentType; /* if available the Content-Type information will be returned at that location */
12390 char ** redir; /* if available the redirected URL will be returned */
12393 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12394 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12395 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12396 mem_base = xmlMemBlocks();
12397 URL = gen_filepath(n_URL, 0);
12398 contentType = gen_char_ptr_ptr(n_contentType, 1);
12399 redir = gen_char_ptr_ptr(n_redir, 2);
12401 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12402 desret_xmlNanoHTTPCtxtPtr(ret_val);
12404 des_filepath(n_URL, URL, 0);
12405 des_char_ptr_ptr(n_contentType, contentType, 1);
12406 des_char_ptr_ptr(n_redir, redir, 2);
12407 xmlResetLastError();
12408 if (mem_base != xmlMemBlocks()) {
12409 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12410 xmlMemBlocks() - mem_base);
12412 printf(" %d", n_URL);
12413 printf(" %d", n_contentType);
12414 printf(" %d", n_redir);
12428 test_xmlNanoHTTPRead(void) {
12431 #if defined(LIBXML_HTTP_ENABLED)
12434 void * ctx; /* the HTTP context */
12436 void * dest; /* a buffer */
12438 int len; /* the buffer length */
12441 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12442 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12443 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12444 mem_base = xmlMemBlocks();
12445 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12446 dest = gen_void_ptr(n_dest, 1);
12447 len = gen_int(n_len, 2);
12449 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12450 desret_int(ret_val);
12452 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12453 des_void_ptr(n_dest, dest, 1);
12454 des_int(n_len, len, 2);
12455 xmlResetLastError();
12456 if (mem_base != xmlMemBlocks()) {
12457 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12458 xmlMemBlocks() - mem_base);
12460 printf(" %d", n_ctx);
12461 printf(" %d", n_dest);
12462 printf(" %d", n_len);
12476 test_xmlNanoHTTPRedir(void) {
12480 /* missing type support */
12486 test_xmlNanoHTTPReturnCode(void) {
12489 #if defined(LIBXML_HTTP_ENABLED)
12492 void * ctx; /* the HTTP context */
12495 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12496 mem_base = xmlMemBlocks();
12497 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12499 ret_val = xmlNanoHTTPReturnCode(ctx);
12500 desret_int(ret_val);
12502 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12503 xmlResetLastError();
12504 if (mem_base != xmlMemBlocks()) {
12505 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12506 xmlMemBlocks() - mem_base);
12508 printf(" %d", n_ctx);
12520 test_xmlNanoHTTPSave(void) {
12523 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12526 void * ctxt; /* the HTTP context */
12528 const char * filename; /* the filename where the content should be saved */
12531 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12532 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12533 mem_base = xmlMemBlocks();
12534 ctxt = gen_void_ptr(n_ctxt, 0);
12535 filename = gen_fileoutput(n_filename, 1);
12537 ret_val = xmlNanoHTTPSave(ctxt, filename);
12538 desret_int(ret_val);
12540 des_void_ptr(n_ctxt, ctxt, 0);
12541 des_fileoutput(n_filename, filename, 1);
12542 xmlResetLastError();
12543 if (mem_base != xmlMemBlocks()) {
12544 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12545 xmlMemBlocks() - mem_base);
12547 printf(" %d", n_ctxt);
12548 printf(" %d", n_filename);
12561 test_xmlNanoHTTPScanProxy(void) {
12564 #if defined(LIBXML_HTTP_ENABLED)
12565 const char * URL; /* The proxy URL used to initialize the proxy context */
12568 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12569 URL = gen_filepath(n_URL, 0);
12571 xmlNanoHTTPScanProxy(URL);
12573 des_filepath(n_URL, URL, 0);
12574 xmlResetLastError();
12583 test_nanohttp(void) {
12586 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12587 test_ret += test_xmlNanoHTTPAuthHeader();
12588 test_ret += test_xmlNanoHTTPCleanup();
12589 test_ret += test_xmlNanoHTTPContentLength();
12590 test_ret += test_xmlNanoHTTPEncoding();
12591 test_ret += test_xmlNanoHTTPFetch();
12592 test_ret += test_xmlNanoHTTPInit();
12593 test_ret += test_xmlNanoHTTPMimeType();
12594 test_ret += test_xmlNanoHTTPOpen();
12595 test_ret += test_xmlNanoHTTPOpenRedir();
12596 test_ret += test_xmlNanoHTTPRead();
12597 test_ret += test_xmlNanoHTTPRedir();
12598 test_ret += test_xmlNanoHTTPReturnCode();
12599 test_ret += test_xmlNanoHTTPSave();
12600 test_ret += test_xmlNanoHTTPScanProxy();
12603 printf("Module nanohttp: %d errors\n", test_ret);
12608 test_xmlByteConsumed(void) {
12613 xmlParserCtxtPtr ctxt; /* an XML parser context */
12616 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12617 mem_base = xmlMemBlocks();
12618 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12620 ret_val = xmlByteConsumed(ctxt);
12621 desret_long(ret_val);
12623 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12624 xmlResetLastError();
12625 if (mem_base != xmlMemBlocks()) {
12626 printf("Leak of %d blocks found in xmlByteConsumed",
12627 xmlMemBlocks() - mem_base);
12629 printf(" %d", n_ctxt);
12640 test_xmlClearNodeInfoSeq(void) {
12644 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12647 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12648 mem_base = xmlMemBlocks();
12649 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12651 xmlClearNodeInfoSeq(seq);
12653 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12654 xmlResetLastError();
12655 if (mem_base != xmlMemBlocks()) {
12656 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12657 xmlMemBlocks() - mem_base);
12659 printf(" %d", n_seq);
12670 test_xmlClearParserCtxt(void) {
12674 xmlParserCtxtPtr ctxt; /* an XML parser context */
12677 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12678 mem_base = xmlMemBlocks();
12679 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12681 xmlClearParserCtxt(ctxt);
12683 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12684 xmlResetLastError();
12685 if (mem_base != xmlMemBlocks()) {
12686 printf("Leak of %d blocks found in xmlClearParserCtxt",
12687 xmlMemBlocks() - mem_base);
12689 printf(" %d", n_ctxt);
12700 test_xmlCreateDocParserCtxt(void) {
12704 xmlParserCtxtPtr ret_val;
12705 xmlChar * cur; /* a pointer to an array of xmlChar */
12708 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12709 mem_base = xmlMemBlocks();
12710 cur = gen_const_xmlChar_ptr(n_cur, 0);
12712 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12713 desret_xmlParserCtxtPtr(ret_val);
12715 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12716 xmlResetLastError();
12717 if (mem_base != xmlMemBlocks()) {
12718 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12719 xmlMemBlocks() - mem_base);
12721 printf(" %d", n_cur);
12732 test_xmlCreatePushParserCtxt(void) {
12735 #if defined(LIBXML_PUSH_ENABLED)
12737 xmlParserCtxtPtr ret_val;
12738 xmlSAXHandlerPtr sax; /* a SAX handler */
12740 void * user_data; /* The user data returned on SAX callbacks */
12742 char * chunk; /* a pointer to an array of chars */
12744 int size; /* number of chars in the array */
12746 const char * filename; /* an optional file name or URI */
12749 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12750 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12751 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12752 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12753 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12754 mem_base = xmlMemBlocks();
12755 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12756 user_data = gen_userdata(n_user_data, 1);
12757 chunk = gen_const_char_ptr(n_chunk, 2);
12758 size = gen_int(n_size, 3);
12759 filename = gen_fileoutput(n_filename, 4);
12760 if ((chunk != NULL) &&
12761 (size > (int) strlen((const char *) chunk) + 1))
12764 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12765 desret_xmlParserCtxtPtr(ret_val);
12767 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12768 des_userdata(n_user_data, user_data, 1);
12769 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12770 des_int(n_size, size, 3);
12771 des_fileoutput(n_filename, filename, 4);
12772 xmlResetLastError();
12773 if (mem_base != xmlMemBlocks()) {
12774 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12775 xmlMemBlocks() - mem_base);
12777 printf(" %d", n_sax);
12778 printf(" %d", n_user_data);
12779 printf(" %d", n_chunk);
12780 printf(" %d", n_size);
12781 printf(" %d", n_filename);
12797 test_xmlCtxtReadDoc(void) {
12802 xmlParserCtxtPtr ctxt; /* an XML parser context */
12804 xmlChar * cur; /* a pointer to a zero terminated string */
12806 const char * URL; /* the base URL to use for the document */
12808 char * encoding; /* the document encoding, or NULL */
12810 int options; /* a combination of xmlParserOption */
12813 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12814 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12815 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12816 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12817 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12818 mem_base = xmlMemBlocks();
12819 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12820 cur = gen_const_xmlChar_ptr(n_cur, 1);
12821 URL = gen_filepath(n_URL, 2);
12822 encoding = gen_const_char_ptr(n_encoding, 3);
12823 options = gen_parseroptions(n_options, 4);
12825 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12826 desret_xmlDocPtr(ret_val);
12828 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12829 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12830 des_filepath(n_URL, URL, 2);
12831 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12832 des_parseroptions(n_options, options, 4);
12833 xmlResetLastError();
12834 if (mem_base != xmlMemBlocks()) {
12835 printf("Leak of %d blocks found in xmlCtxtReadDoc",
12836 xmlMemBlocks() - mem_base);
12838 printf(" %d", n_ctxt);
12839 printf(" %d", n_cur);
12840 printf(" %d", n_URL);
12841 printf(" %d", n_encoding);
12842 printf(" %d", n_options);
12857 test_xmlCtxtReadFile(void) {
12862 xmlParserCtxtPtr ctxt; /* an XML parser context */
12864 const char * filename; /* a file or URL */
12866 char * encoding; /* the document encoding, or NULL */
12868 int options; /* a combination of xmlParserOption */
12871 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12872 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12873 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12874 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12875 mem_base = xmlMemBlocks();
12876 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12877 filename = gen_filepath(n_filename, 1);
12878 encoding = gen_const_char_ptr(n_encoding, 2);
12879 options = gen_parseroptions(n_options, 3);
12881 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12882 desret_xmlDocPtr(ret_val);
12884 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12885 des_filepath(n_filename, filename, 1);
12886 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12887 des_parseroptions(n_options, options, 3);
12888 xmlResetLastError();
12889 if (mem_base != xmlMemBlocks()) {
12890 printf("Leak of %d blocks found in xmlCtxtReadFile",
12891 xmlMemBlocks() - mem_base);
12893 printf(" %d", n_ctxt);
12894 printf(" %d", n_filename);
12895 printf(" %d", n_encoding);
12896 printf(" %d", n_options);
12910 test_xmlCtxtReadMemory(void) {
12915 xmlParserCtxtPtr ctxt; /* an XML parser context */
12917 char * buffer; /* a pointer to a char array */
12919 int size; /* the size of the array */
12921 const char * URL; /* the base URL to use for the document */
12923 char * encoding; /* the document encoding, or NULL */
12925 int options; /* a combination of xmlParserOption */
12928 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12929 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12930 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12931 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12932 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12933 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12934 mem_base = xmlMemBlocks();
12935 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12936 buffer = gen_const_char_ptr(n_buffer, 1);
12937 size = gen_int(n_size, 2);
12938 URL = gen_filepath(n_URL, 3);
12939 encoding = gen_const_char_ptr(n_encoding, 4);
12940 options = gen_parseroptions(n_options, 5);
12941 if ((buffer != NULL) &&
12942 (size > (int) strlen((const char *) buffer) + 1))
12945 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12946 desret_xmlDocPtr(ret_val);
12948 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12949 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12950 des_int(n_size, size, 2);
12951 des_filepath(n_URL, URL, 3);
12952 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12953 des_parseroptions(n_options, options, 5);
12954 xmlResetLastError();
12955 if (mem_base != xmlMemBlocks()) {
12956 printf("Leak of %d blocks found in xmlCtxtReadMemory",
12957 xmlMemBlocks() - mem_base);
12959 printf(" %d", n_ctxt);
12960 printf(" %d", n_buffer);
12961 printf(" %d", n_size);
12962 printf(" %d", n_URL);
12963 printf(" %d", n_encoding);
12964 printf(" %d", n_options);
12980 test_xmlCtxtReset(void) {
12984 xmlParserCtxtPtr ctxt; /* an XML parser context */
12987 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12988 mem_base = xmlMemBlocks();
12989 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12991 xmlCtxtReset(ctxt);
12993 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12994 xmlResetLastError();
12995 if (mem_base != xmlMemBlocks()) {
12996 printf("Leak of %d blocks found in xmlCtxtReset",
12997 xmlMemBlocks() - mem_base);
12999 printf(" %d", n_ctxt);
13010 test_xmlCtxtResetPush(void) {
13015 xmlParserCtxtPtr ctxt; /* an XML parser context */
13017 char * chunk; /* a pointer to an array of chars */
13019 int size; /* number of chars in the array */
13021 const char * filename; /* an optional file name or URI */
13023 char * encoding; /* the document encoding, or NULL */
13026 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13027 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13028 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13029 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13030 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13031 mem_base = xmlMemBlocks();
13032 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13033 chunk = gen_const_char_ptr(n_chunk, 1);
13034 size = gen_int(n_size, 2);
13035 filename = gen_filepath(n_filename, 3);
13036 encoding = gen_const_char_ptr(n_encoding, 4);
13037 if ((chunk != NULL) &&
13038 (size > (int) strlen((const char *) chunk) + 1))
13041 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13042 desret_int(ret_val);
13044 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13045 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13046 des_int(n_size, size, 2);
13047 des_filepath(n_filename, filename, 3);
13048 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13049 xmlResetLastError();
13050 if (mem_base != xmlMemBlocks()) {
13051 printf("Leak of %d blocks found in xmlCtxtResetPush",
13052 xmlMemBlocks() - mem_base);
13054 printf(" %d", n_ctxt);
13055 printf(" %d", n_chunk);
13056 printf(" %d", n_size);
13057 printf(" %d", n_filename);
13058 printf(" %d", n_encoding);
13073 test_xmlCtxtUseOptions(void) {
13078 xmlParserCtxtPtr ctxt; /* an XML parser context */
13080 int options; /* a combination of xmlParserOption */
13083 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13084 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13085 mem_base = xmlMemBlocks();
13086 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13087 options = gen_parseroptions(n_options, 1);
13089 ret_val = xmlCtxtUseOptions(ctxt, options);
13090 desret_int(ret_val);
13092 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13093 des_parseroptions(n_options, options, 1);
13094 xmlResetLastError();
13095 if (mem_base != xmlMemBlocks()) {
13096 printf("Leak of %d blocks found in xmlCtxtUseOptions",
13097 xmlMemBlocks() - mem_base);
13099 printf(" %d", n_ctxt);
13100 printf(" %d", n_options);
13112 test_xmlGetExternalEntityLoader(void) {
13116 /* missing type support */
13122 test_xmlGetFeature(void) {
13125 #if defined(LIBXML_LEGACY_ENABLED)
13126 #ifdef LIBXML_LEGACY_ENABLED
13129 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13131 char * name; /* the feature name */
13133 void * result; /* location to store the result */
13136 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13137 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13138 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13139 mem_base = xmlMemBlocks();
13140 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13141 name = gen_const_char_ptr(n_name, 1);
13142 result = gen_void_ptr(n_result, 2);
13144 ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13145 desret_int(ret_val);
13147 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13148 des_const_char_ptr(n_name, (const char *)name, 1);
13149 des_void_ptr(n_result, result, 2);
13150 xmlResetLastError();
13151 if (mem_base != xmlMemBlocks()) {
13152 printf("Leak of %d blocks found in xmlGetFeature",
13153 xmlMemBlocks() - mem_base);
13155 printf(" %d", n_ctxt);
13156 printf(" %d", n_name);
13157 printf(" %d", n_result);
13171 #define gen_nb_const_char_ptr_ptr 1
13172 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13175 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13179 test_xmlGetFeaturesList(void) {
13182 #if defined(LIBXML_LEGACY_ENABLED)
13183 #ifdef LIBXML_LEGACY_ENABLED
13186 int * len; /* the length of the features name array (input/output) */
13188 char ** result; /* an array of string to be filled with the features name. */
13191 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13192 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13193 mem_base = xmlMemBlocks();
13194 len = gen_int_ptr(n_len, 0);
13195 result = gen_const_char_ptr_ptr(n_result, 1);
13197 ret_val = xmlGetFeaturesList(len, (const char **)result);
13198 desret_int(ret_val);
13200 des_int_ptr(n_len, len, 0);
13201 des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13202 xmlResetLastError();
13203 if (mem_base != xmlMemBlocks()) {
13204 printf("Leak of %d blocks found in xmlGetFeaturesList",
13205 xmlMemBlocks() - mem_base);
13207 printf(" %d", n_len);
13208 printf(" %d", n_result);
13222 test_xmlHasFeature(void) {
13227 xmlFeature feature; /* the feature to be examined */
13230 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13231 mem_base = xmlMemBlocks();
13232 feature = gen_xmlFeature(n_feature, 0);
13234 ret_val = xmlHasFeature(feature);
13235 desret_int(ret_val);
13237 des_xmlFeature(n_feature, feature, 0);
13238 xmlResetLastError();
13239 if (mem_base != xmlMemBlocks()) {
13240 printf("Leak of %d blocks found in xmlHasFeature",
13241 xmlMemBlocks() - mem_base);
13243 printf(" %d", n_feature);
13254 test_xmlIOParseDTD(void) {
13257 #if defined(LIBXML_VALID_ENABLED)
13258 #ifdef LIBXML_VALID_ENABLED
13260 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13262 xmlParserInputBufferPtr input; /* an Input Buffer */
13264 xmlCharEncoding enc; /* the charset encoding if known */
13267 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13268 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13269 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13270 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13271 input = gen_xmlParserInputBufferPtr(n_input, 1);
13272 enc = gen_xmlCharEncoding(n_enc, 2);
13274 ret_val = xmlIOParseDTD(sax, input, enc);
13276 desret_xmlDtdPtr(ret_val);
13278 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13279 des_xmlParserInputBufferPtr(n_input, input, 1);
13280 des_xmlCharEncoding(n_enc, enc, 2);
13281 xmlResetLastError();
13294 test_xmlInitNodeInfoSeq(void) {
13298 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13301 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13302 mem_base = xmlMemBlocks();
13303 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13305 xmlInitNodeInfoSeq(seq);
13307 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13308 xmlResetLastError();
13309 if (mem_base != xmlMemBlocks()) {
13310 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13311 xmlMemBlocks() - mem_base);
13313 printf(" %d", n_seq);
13324 test_xmlInitParser(void) {
13329 mem_base = xmlMemBlocks();
13333 xmlResetLastError();
13334 if (mem_base != xmlMemBlocks()) {
13335 printf("Leak of %d blocks found in xmlInitParser",
13336 xmlMemBlocks() - mem_base);
13347 test_xmlInitParserCtxt(void) {
13352 xmlParserCtxtPtr ctxt; /* an XML parser context */
13355 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13356 mem_base = xmlMemBlocks();
13357 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13359 ret_val = xmlInitParserCtxt(ctxt);
13360 desret_int(ret_val);
13362 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13363 xmlResetLastError();
13364 if (mem_base != xmlMemBlocks()) {
13365 printf("Leak of %d blocks found in xmlInitParserCtxt",
13366 xmlMemBlocks() - mem_base);
13368 printf(" %d", n_ctxt);
13379 test_xmlKeepBlanksDefault(void) {
13384 int val; /* int 0 or 1 */
13387 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13388 mem_base = xmlMemBlocks();
13389 val = gen_int(n_val, 0);
13391 ret_val = xmlKeepBlanksDefault(val);
13392 desret_int(ret_val);
13394 des_int(n_val, val, 0);
13395 xmlResetLastError();
13396 if (mem_base != xmlMemBlocks()) {
13397 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13398 xmlMemBlocks() - mem_base);
13400 printf(" %d", n_val);
13411 test_xmlLineNumbersDefault(void) {
13416 int val; /* int 0 or 1 */
13419 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13420 mem_base = xmlMemBlocks();
13421 val = gen_int(n_val, 0);
13423 ret_val = xmlLineNumbersDefault(val);
13424 desret_int(ret_val);
13426 des_int(n_val, val, 0);
13427 xmlResetLastError();
13428 if (mem_base != xmlMemBlocks()) {
13429 printf("Leak of %d blocks found in xmlLineNumbersDefault",
13430 xmlMemBlocks() - mem_base);
13432 printf(" %d", n_val);
13443 test_xmlLoadExternalEntity(void) {
13447 xmlParserInputPtr ret_val;
13448 const char * URL; /* the URL for the entity to load */
13450 char * ID; /* the Public ID for the entity to load */
13452 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13455 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13456 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13457 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13458 mem_base = xmlMemBlocks();
13459 URL = gen_filepath(n_URL, 0);
13460 ID = gen_const_char_ptr(n_ID, 1);
13461 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13463 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13464 desret_xmlParserInputPtr(ret_val);
13466 des_filepath(n_URL, URL, 0);
13467 des_const_char_ptr(n_ID, (const char *)ID, 1);
13468 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13469 xmlResetLastError();
13470 if (mem_base != xmlMemBlocks()) {
13471 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13472 xmlMemBlocks() - mem_base);
13474 printf(" %d", n_URL);
13475 printf(" %d", n_ID);
13476 printf(" %d", n_ctxt);
13489 test_xmlNewIOInputStream(void) {
13493 xmlParserInputPtr ret_val;
13494 xmlParserCtxtPtr ctxt; /* an XML parser context */
13496 xmlParserInputBufferPtr input; /* an I/O Input */
13498 xmlCharEncoding enc; /* the charset encoding if known */
13501 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13502 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13503 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13504 mem_base = xmlMemBlocks();
13505 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13506 input = gen_xmlParserInputBufferPtr(n_input, 1);
13507 enc = gen_xmlCharEncoding(n_enc, 2);
13509 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13510 if (ret_val != NULL) input = NULL;
13511 desret_xmlParserInputPtr(ret_val);
13513 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13514 des_xmlParserInputBufferPtr(n_input, input, 1);
13515 des_xmlCharEncoding(n_enc, enc, 2);
13516 xmlResetLastError();
13517 if (mem_base != xmlMemBlocks()) {
13518 printf("Leak of %d blocks found in xmlNewIOInputStream",
13519 xmlMemBlocks() - mem_base);
13521 printf(" %d", n_ctxt);
13522 printf(" %d", n_input);
13523 printf(" %d", n_enc);
13536 test_xmlNewParserCtxt(void) {
13540 xmlParserCtxtPtr ret_val;
13542 mem_base = xmlMemBlocks();
13544 ret_val = xmlNewParserCtxt();
13545 desret_xmlParserCtxtPtr(ret_val);
13547 xmlResetLastError();
13548 if (mem_base != xmlMemBlocks()) {
13549 printf("Leak of %d blocks found in xmlNewParserCtxt",
13550 xmlMemBlocks() - mem_base);
13560 #define gen_nb_xmlNodePtr_ptr 1
13561 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13564 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13568 test_xmlParseBalancedChunkMemory(void) {
13571 #if defined(LIBXML_SAX1_ENABLED)
13572 #ifdef LIBXML_SAX1_ENABLED
13575 xmlDocPtr doc; /* the document the chunk pertains to */
13577 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13579 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13581 int depth; /* Used for loop detection, use 0 */
13583 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13585 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13588 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13589 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13590 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13591 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13592 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13593 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13594 mem_base = xmlMemBlocks();
13595 doc = gen_xmlDocPtr(n_doc, 0);
13596 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13597 user_data = gen_userdata(n_user_data, 2);
13598 depth = gen_int(n_depth, 3);
13599 string = gen_const_xmlChar_ptr(n_string, 4);
13600 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13602 #ifdef LIBXML_SAX1_ENABLED
13603 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13607 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13608 desret_int(ret_val);
13610 des_xmlDocPtr(n_doc, doc, 0);
13611 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13612 des_userdata(n_user_data, user_data, 2);
13613 des_int(n_depth, depth, 3);
13614 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13615 des_xmlNodePtr_ptr(n_lst, lst, 5);
13616 xmlResetLastError();
13617 if (mem_base != xmlMemBlocks()) {
13618 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13619 xmlMemBlocks() - mem_base);
13621 printf(" %d", n_doc);
13622 printf(" %d", n_sax);
13623 printf(" %d", n_user_data);
13624 printf(" %d", n_depth);
13625 printf(" %d", n_string);
13626 printf(" %d", n_lst);
13644 test_xmlParseBalancedChunkMemoryRecover(void) {
13647 #if defined(LIBXML_SAX1_ENABLED)
13648 #ifdef LIBXML_SAX1_ENABLED
13651 xmlDocPtr doc; /* the document the chunk pertains to */
13653 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13655 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13657 int depth; /* Used for loop detection, use 0 */
13659 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13661 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13663 int recover; /* return nodes even if the data is broken (use 0) */
13666 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13667 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13668 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13669 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13670 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13671 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13672 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13673 mem_base = xmlMemBlocks();
13674 doc = gen_xmlDocPtr(n_doc, 0);
13675 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13676 user_data = gen_userdata(n_user_data, 2);
13677 depth = gen_int(n_depth, 3);
13678 string = gen_const_xmlChar_ptr(n_string, 4);
13679 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13680 recover = gen_int(n_recover, 6);
13682 #ifdef LIBXML_SAX1_ENABLED
13683 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13687 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13688 desret_int(ret_val);
13690 des_xmlDocPtr(n_doc, doc, 0);
13691 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13692 des_userdata(n_user_data, user_data, 2);
13693 des_int(n_depth, depth, 3);
13694 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13695 des_xmlNodePtr_ptr(n_lst, lst, 5);
13696 des_int(n_recover, recover, 6);
13697 xmlResetLastError();
13698 if (mem_base != xmlMemBlocks()) {
13699 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13700 xmlMemBlocks() - mem_base);
13702 printf(" %d", n_doc);
13703 printf(" %d", n_sax);
13704 printf(" %d", n_user_data);
13705 printf(" %d", n_depth);
13706 printf(" %d", n_string);
13707 printf(" %d", n_lst);
13708 printf(" %d", n_recover);
13727 test_xmlParseChunk(void) {
13730 #if defined(LIBXML_PUSH_ENABLED)
13733 xmlParserCtxtPtr ctxt; /* an XML parser context */
13735 char * chunk; /* an char array */
13737 int size; /* the size in byte of the chunk */
13739 int terminate; /* last chunk indicator */
13742 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13743 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13744 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13745 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13746 mem_base = xmlMemBlocks();
13747 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13748 chunk = gen_const_char_ptr(n_chunk, 1);
13749 size = gen_int(n_size, 2);
13750 terminate = gen_int(n_terminate, 3);
13751 if ((chunk != NULL) &&
13752 (size > (int) strlen((const char *) chunk) + 1))
13755 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13756 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13757 desret_int(ret_val);
13759 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13760 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13761 des_int(n_size, size, 2);
13762 des_int(n_terminate, terminate, 3);
13763 xmlResetLastError();
13764 if (mem_base != xmlMemBlocks()) {
13765 printf("Leak of %d blocks found in xmlParseChunk",
13766 xmlMemBlocks() - mem_base);
13768 printf(" %d", n_ctxt);
13769 printf(" %d", n_chunk);
13770 printf(" %d", n_size);
13771 printf(" %d", n_terminate);
13786 test_xmlParseCtxtExternalEntity(void) {
13791 xmlParserCtxtPtr ctx; /* the existing parsing context */
13793 xmlChar * URL; /* the URL for the entity to load */
13795 xmlChar * ID; /* the System ID for the entity to load */
13797 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13800 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13801 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13802 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13803 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13804 mem_base = xmlMemBlocks();
13805 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13806 URL = gen_const_xmlChar_ptr(n_URL, 1);
13807 ID = gen_const_xmlChar_ptr(n_ID, 2);
13808 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13810 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13811 desret_int(ret_val);
13813 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13814 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13815 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13816 des_xmlNodePtr_ptr(n_lst, lst, 3);
13817 xmlResetLastError();
13818 if (mem_base != xmlMemBlocks()) {
13819 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13820 xmlMemBlocks() - mem_base);
13822 printf(" %d", n_ctx);
13823 printf(" %d", n_URL);
13824 printf(" %d", n_ID);
13825 printf(" %d", n_lst);
13839 test_xmlParseDTD(void) {
13842 #if defined(LIBXML_VALID_ENABLED)
13843 #ifdef LIBXML_VALID_ENABLED
13846 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13848 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13851 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13852 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13853 mem_base = xmlMemBlocks();
13854 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13855 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13857 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13858 desret_xmlDtdPtr(ret_val);
13860 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13861 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13862 xmlResetLastError();
13863 if (mem_base != xmlMemBlocks()) {
13864 printf("Leak of %d blocks found in xmlParseDTD",
13865 xmlMemBlocks() - mem_base);
13867 printf(" %d", n_ExternalID);
13868 printf(" %d", n_SystemID);
13882 test_xmlParseDoc(void) {
13885 #if defined(LIBXML_SAX1_ENABLED)
13886 #ifdef LIBXML_SAX1_ENABLED
13889 xmlChar * cur; /* a pointer to an array of xmlChar */
13892 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13893 mem_base = xmlMemBlocks();
13894 cur = gen_const_xmlChar_ptr(n_cur, 0);
13896 ret_val = xmlParseDoc((const xmlChar *)cur);
13897 desret_xmlDocPtr(ret_val);
13899 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13900 xmlResetLastError();
13901 if (mem_base != xmlMemBlocks()) {
13902 printf("Leak of %d blocks found in xmlParseDoc",
13903 xmlMemBlocks() - mem_base);
13905 printf(" %d", n_cur);
13918 test_xmlParseDocument(void) {
13923 xmlParserCtxtPtr ctxt; /* an XML parser context */
13926 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13927 mem_base = xmlMemBlocks();
13928 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13930 ret_val = xmlParseDocument(ctxt);
13931 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13932 desret_int(ret_val);
13934 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13935 xmlResetLastError();
13936 if (mem_base != xmlMemBlocks()) {
13937 printf("Leak of %d blocks found in xmlParseDocument",
13938 xmlMemBlocks() - mem_base);
13940 printf(" %d", n_ctxt);
13951 test_xmlParseEntity(void) {
13954 #if defined(LIBXML_SAX1_ENABLED)
13955 #ifdef LIBXML_SAX1_ENABLED
13958 const char * filename; /* the filename */
13961 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13962 mem_base = xmlMemBlocks();
13963 filename = gen_filepath(n_filename, 0);
13965 ret_val = xmlParseEntity(filename);
13966 desret_xmlDocPtr(ret_val);
13968 des_filepath(n_filename, filename, 0);
13969 xmlResetLastError();
13970 if (mem_base != xmlMemBlocks()) {
13971 printf("Leak of %d blocks found in xmlParseEntity",
13972 xmlMemBlocks() - mem_base);
13974 printf(" %d", n_filename);
13987 test_xmlParseExtParsedEnt(void) {
13992 xmlParserCtxtPtr ctxt; /* an XML parser context */
13995 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13996 mem_base = xmlMemBlocks();
13997 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13999 ret_val = xmlParseExtParsedEnt(ctxt);
14000 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14001 desret_int(ret_val);
14003 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14004 xmlResetLastError();
14005 if (mem_base != xmlMemBlocks()) {
14006 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
14007 xmlMemBlocks() - mem_base);
14009 printf(" %d", n_ctxt);
14020 test_xmlParseExternalEntity(void) {
14023 #if defined(LIBXML_SAX1_ENABLED)
14024 #ifdef LIBXML_SAX1_ENABLED
14027 xmlDocPtr doc; /* the document the chunk pertains to */
14029 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
14031 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
14033 int depth; /* Used for loop detection, use 0 */
14035 xmlChar * URL; /* the URL for the entity to load */
14037 xmlChar * ID; /* the System ID for the entity to load */
14039 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14042 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14043 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14044 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14045 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14046 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14047 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14048 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14049 mem_base = xmlMemBlocks();
14050 doc = gen_xmlDocPtr(n_doc, 0);
14051 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14052 user_data = gen_userdata(n_user_data, 2);
14053 depth = gen_int(n_depth, 3);
14054 URL = gen_const_xmlChar_ptr(n_URL, 4);
14055 ID = gen_const_xmlChar_ptr(n_ID, 5);
14056 lst = gen_xmlNodePtr_ptr(n_lst, 6);
14058 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14059 desret_int(ret_val);
14061 des_xmlDocPtr(n_doc, doc, 0);
14062 des_xmlSAXHandlerPtr(n_sax, sax, 1);
14063 des_userdata(n_user_data, user_data, 2);
14064 des_int(n_depth, depth, 3);
14065 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14066 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14067 des_xmlNodePtr_ptr(n_lst, lst, 6);
14068 xmlResetLastError();
14069 if (mem_base != xmlMemBlocks()) {
14070 printf("Leak of %d blocks found in xmlParseExternalEntity",
14071 xmlMemBlocks() - mem_base);
14073 printf(" %d", n_doc);
14074 printf(" %d", n_sax);
14075 printf(" %d", n_user_data);
14076 printf(" %d", n_depth);
14077 printf(" %d", n_URL);
14078 printf(" %d", n_ID);
14079 printf(" %d", n_lst);
14098 test_xmlParseFile(void) {
14101 #if defined(LIBXML_SAX1_ENABLED)
14102 #ifdef LIBXML_SAX1_ENABLED
14105 const char * filename; /* the filename */
14108 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14109 mem_base = xmlMemBlocks();
14110 filename = gen_filepath(n_filename, 0);
14112 ret_val = xmlParseFile(filename);
14113 desret_xmlDocPtr(ret_val);
14115 des_filepath(n_filename, filename, 0);
14116 xmlResetLastError();
14117 if (mem_base != xmlMemBlocks()) {
14118 printf("Leak of %d blocks found in xmlParseFile",
14119 xmlMemBlocks() - mem_base);
14121 printf(" %d", n_filename);
14134 test_xmlParseInNodeContext(void) {
14138 xmlParserErrors ret_val;
14139 xmlNodePtr node; /* the context node */
14141 char * data; /* the input string */
14143 int datalen; /* the input string length in bytes */
14145 int options; /* a combination of xmlParserOption */
14147 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14150 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14151 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14152 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14153 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14154 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14155 mem_base = xmlMemBlocks();
14156 node = gen_xmlNodePtr(n_node, 0);
14157 data = gen_const_char_ptr(n_data, 1);
14158 datalen = gen_int(n_datalen, 2);
14159 options = gen_parseroptions(n_options, 3);
14160 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14162 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14163 desret_xmlParserErrors(ret_val);
14165 des_xmlNodePtr(n_node, node, 0);
14166 des_const_char_ptr(n_data, (const char *)data, 1);
14167 des_int(n_datalen, datalen, 2);
14168 des_parseroptions(n_options, options, 3);
14169 des_xmlNodePtr_ptr(n_lst, lst, 4);
14170 xmlResetLastError();
14171 if (mem_base != xmlMemBlocks()) {
14172 printf("Leak of %d blocks found in xmlParseInNodeContext",
14173 xmlMemBlocks() - mem_base);
14175 printf(" %d", n_node);
14176 printf(" %d", n_data);
14177 printf(" %d", n_datalen);
14178 printf(" %d", n_options);
14179 printf(" %d", n_lst);
14194 test_xmlParseMemory(void) {
14197 #if defined(LIBXML_SAX1_ENABLED)
14198 #ifdef LIBXML_SAX1_ENABLED
14201 char * buffer; /* an pointer to a char array */
14203 int size; /* the size of the array */
14206 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14207 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14208 mem_base = xmlMemBlocks();
14209 buffer = gen_const_char_ptr(n_buffer, 0);
14210 size = gen_int(n_size, 1);
14211 if ((buffer != NULL) &&
14212 (size > (int) strlen((const char *) buffer) + 1))
14215 ret_val = xmlParseMemory((const char *)buffer, size);
14216 desret_xmlDocPtr(ret_val);
14218 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14219 des_int(n_size, size, 1);
14220 xmlResetLastError();
14221 if (mem_base != xmlMemBlocks()) {
14222 printf("Leak of %d blocks found in xmlParseMemory",
14223 xmlMemBlocks() - mem_base);
14225 printf(" %d", n_buffer);
14226 printf(" %d", n_size);
14239 #define gen_nb_const_xmlParserNodeInfoPtr 1
14240 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14243 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14247 test_xmlParserAddNodeInfo(void) {
14251 xmlParserCtxtPtr ctxt; /* an XML parser context */
14253 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14256 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14257 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14258 mem_base = xmlMemBlocks();
14259 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14260 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14262 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14264 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14265 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14266 xmlResetLastError();
14267 if (mem_base != xmlMemBlocks()) {
14268 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14269 xmlMemBlocks() - mem_base);
14271 printf(" %d", n_ctxt);
14272 printf(" %d", n_info);
14283 #define gen_nb_const_xmlParserCtxtPtr 1
14284 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14287 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14290 #define gen_nb_const_xmlNodePtr 1
14291 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14294 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14298 test_xmlParserFindNodeInfo(void) {
14302 const xmlParserNodeInfo * ret_val;
14303 xmlParserCtxtPtr ctx; /* an XML parser context */
14305 xmlNodePtr node; /* an XML node within the tree */
14308 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14309 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14310 mem_base = xmlMemBlocks();
14311 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14312 node = gen_const_xmlNodePtr(n_node, 1);
14314 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14315 desret_const_xmlParserNodeInfo_ptr(ret_val);
14317 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14318 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14319 xmlResetLastError();
14320 if (mem_base != xmlMemBlocks()) {
14321 printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14322 xmlMemBlocks() - mem_base);
14324 printf(" %d", n_ctx);
14325 printf(" %d", n_node);
14336 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14337 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14340 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14344 test_xmlParserFindNodeInfoIndex(void) {
14348 unsigned long ret_val;
14349 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14351 xmlNodePtr node; /* an XML node pointer */
14354 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14355 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14356 mem_base = xmlMemBlocks();
14357 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14358 node = gen_const_xmlNodePtr(n_node, 1);
14360 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14361 desret_unsigned_long(ret_val);
14363 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14364 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14365 xmlResetLastError();
14366 if (mem_base != xmlMemBlocks()) {
14367 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14368 xmlMemBlocks() - mem_base);
14370 printf(" %d", n_seq);
14371 printf(" %d", n_node);
14382 #define gen_nb_xmlParserInputPtr 1
14383 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14386 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14390 test_xmlParserInputGrow(void) {
14395 xmlParserInputPtr in; /* an XML parser input */
14397 int len; /* an indicative size for the lookahead */
14400 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14401 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14402 mem_base = xmlMemBlocks();
14403 in = gen_xmlParserInputPtr(n_in, 0);
14404 len = gen_int(n_len, 1);
14406 ret_val = xmlParserInputGrow(in, len);
14407 desret_int(ret_val);
14409 des_xmlParserInputPtr(n_in, in, 0);
14410 des_int(n_len, len, 1);
14411 xmlResetLastError();
14412 if (mem_base != xmlMemBlocks()) {
14413 printf("Leak of %d blocks found in xmlParserInputGrow",
14414 xmlMemBlocks() - mem_base);
14416 printf(" %d", n_in);
14417 printf(" %d", n_len);
14429 test_xmlParserInputRead(void) {
14434 xmlParserInputPtr in; /* an XML parser input */
14436 int len; /* an indicative size for the lookahead */
14439 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14440 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14441 mem_base = xmlMemBlocks();
14442 in = gen_xmlParserInputPtr(n_in, 0);
14443 len = gen_int(n_len, 1);
14445 ret_val = xmlParserInputRead(in, len);
14446 desret_int(ret_val);
14448 des_xmlParserInputPtr(n_in, in, 0);
14449 des_int(n_len, len, 1);
14450 xmlResetLastError();
14451 if (mem_base != xmlMemBlocks()) {
14452 printf("Leak of %d blocks found in xmlParserInputRead",
14453 xmlMemBlocks() - mem_base);
14455 printf(" %d", n_in);
14456 printf(" %d", n_len);
14468 test_xmlPedanticParserDefault(void) {
14473 int val; /* int 0 or 1 */
14476 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14477 mem_base = xmlMemBlocks();
14478 val = gen_int(n_val, 0);
14480 ret_val = xmlPedanticParserDefault(val);
14481 desret_int(ret_val);
14483 des_int(n_val, val, 0);
14484 xmlResetLastError();
14485 if (mem_base != xmlMemBlocks()) {
14486 printf("Leak of %d blocks found in xmlPedanticParserDefault",
14487 xmlMemBlocks() - mem_base);
14489 printf(" %d", n_val);
14500 test_xmlReadDoc(void) {
14505 xmlChar * cur; /* a pointer to a zero terminated string */
14507 const char * URL; /* the base URL to use for the document */
14509 char * encoding; /* the document encoding, or NULL */
14511 int options; /* a combination of xmlParserOption */
14514 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14515 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14516 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14517 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14518 mem_base = xmlMemBlocks();
14519 cur = gen_const_xmlChar_ptr(n_cur, 0);
14520 URL = gen_filepath(n_URL, 1);
14521 encoding = gen_const_char_ptr(n_encoding, 2);
14522 options = gen_parseroptions(n_options, 3);
14524 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14525 desret_xmlDocPtr(ret_val);
14527 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14528 des_filepath(n_URL, URL, 1);
14529 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14530 des_parseroptions(n_options, options, 3);
14531 xmlResetLastError();
14532 if (mem_base != xmlMemBlocks()) {
14533 printf("Leak of %d blocks found in xmlReadDoc",
14534 xmlMemBlocks() - mem_base);
14536 printf(" %d", n_cur);
14537 printf(" %d", n_URL);
14538 printf(" %d", n_encoding);
14539 printf(" %d", n_options);
14553 test_xmlReadFile(void) {
14558 const char * filename; /* a file or URL */
14560 char * encoding; /* the document encoding, or NULL */
14562 int options; /* a combination of xmlParserOption */
14565 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
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 filename = gen_filepath(n_filename, 0);
14570 encoding = gen_const_char_ptr(n_encoding, 1);
14571 options = gen_parseroptions(n_options, 2);
14573 ret_val = xmlReadFile(filename, (const char *)encoding, options);
14574 desret_xmlDocPtr(ret_val);
14576 des_filepath(n_filename, filename, 0);
14577 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14578 des_parseroptions(n_options, options, 2);
14579 xmlResetLastError();
14580 if (mem_base != xmlMemBlocks()) {
14581 printf("Leak of %d blocks found in xmlReadFile",
14582 xmlMemBlocks() - mem_base);
14584 printf(" %d", n_filename);
14585 printf(" %d", n_encoding);
14586 printf(" %d", n_options);
14599 test_xmlReadMemory(void) {
14604 char * buffer; /* a pointer to a char array */
14606 int size; /* the size of the array */
14608 const char * URL; /* the base URL to use for the document */
14610 char * encoding; /* the document encoding, or NULL */
14612 int options; /* a combination of xmlParserOption */
14615 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14616 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14617 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14618 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14619 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14620 mem_base = xmlMemBlocks();
14621 buffer = gen_const_char_ptr(n_buffer, 0);
14622 size = gen_int(n_size, 1);
14623 URL = gen_filepath(n_URL, 2);
14624 encoding = gen_const_char_ptr(n_encoding, 3);
14625 options = gen_parseroptions(n_options, 4);
14626 if ((buffer != NULL) &&
14627 (size > (int) strlen((const char *) buffer) + 1))
14630 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14631 desret_xmlDocPtr(ret_val);
14633 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14634 des_int(n_size, size, 1);
14635 des_filepath(n_URL, URL, 2);
14636 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14637 des_parseroptions(n_options, options, 4);
14638 xmlResetLastError();
14639 if (mem_base != xmlMemBlocks()) {
14640 printf("Leak of %d blocks found in xmlReadMemory",
14641 xmlMemBlocks() - mem_base);
14643 printf(" %d", n_buffer);
14644 printf(" %d", n_size);
14645 printf(" %d", n_URL);
14646 printf(" %d", n_encoding);
14647 printf(" %d", n_options);
14662 test_xmlRecoverDoc(void) {
14665 #if defined(LIBXML_SAX1_ENABLED)
14666 #ifdef LIBXML_SAX1_ENABLED
14669 xmlChar * cur; /* a pointer to an array of xmlChar */
14672 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14673 mem_base = xmlMemBlocks();
14674 cur = gen_const_xmlChar_ptr(n_cur, 0);
14676 ret_val = xmlRecoverDoc((const xmlChar *)cur);
14677 desret_xmlDocPtr(ret_val);
14679 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14680 xmlResetLastError();
14681 if (mem_base != xmlMemBlocks()) {
14682 printf("Leak of %d blocks found in xmlRecoverDoc",
14683 xmlMemBlocks() - mem_base);
14685 printf(" %d", n_cur);
14698 test_xmlRecoverFile(void) {
14701 #if defined(LIBXML_SAX1_ENABLED)
14702 #ifdef LIBXML_SAX1_ENABLED
14705 const char * filename; /* the filename */
14708 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14709 mem_base = xmlMemBlocks();
14710 filename = gen_filepath(n_filename, 0);
14712 ret_val = xmlRecoverFile(filename);
14713 desret_xmlDocPtr(ret_val);
14715 des_filepath(n_filename, filename, 0);
14716 xmlResetLastError();
14717 if (mem_base != xmlMemBlocks()) {
14718 printf("Leak of %d blocks found in xmlRecoverFile",
14719 xmlMemBlocks() - mem_base);
14721 printf(" %d", n_filename);
14734 test_xmlRecoverMemory(void) {
14737 #if defined(LIBXML_SAX1_ENABLED)
14738 #ifdef LIBXML_SAX1_ENABLED
14741 char * buffer; /* an pointer to a char array */
14743 int size; /* the size of the array */
14746 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14747 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14748 mem_base = xmlMemBlocks();
14749 buffer = gen_const_char_ptr(n_buffer, 0);
14750 size = gen_int(n_size, 1);
14751 if ((buffer != NULL) &&
14752 (size > (int) strlen((const char *) buffer) + 1))
14755 ret_val = xmlRecoverMemory((const char *)buffer, size);
14756 desret_xmlDocPtr(ret_val);
14758 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14759 des_int(n_size, size, 1);
14760 xmlResetLastError();
14761 if (mem_base != xmlMemBlocks()) {
14762 printf("Leak of %d blocks found in xmlRecoverMemory",
14763 xmlMemBlocks() - mem_base);
14765 printf(" %d", n_buffer);
14766 printf(" %d", n_size);
14780 test_xmlSAXParseDTD(void) {
14783 #if defined(LIBXML_VALID_ENABLED)
14784 #ifdef LIBXML_SAX1_ENABLED
14787 xmlSAXHandlerPtr sax; /* the SAX handler block */
14789 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14791 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14794 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14795 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14796 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14797 mem_base = xmlMemBlocks();
14798 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14799 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14800 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14802 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14803 desret_xmlDtdPtr(ret_val);
14805 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14806 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14807 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14808 xmlResetLastError();
14809 if (mem_base != xmlMemBlocks()) {
14810 printf("Leak of %d blocks found in xmlSAXParseDTD",
14811 xmlMemBlocks() - mem_base);
14813 printf(" %d", n_sax);
14814 printf(" %d", n_ExternalID);
14815 printf(" %d", n_SystemID);
14830 test_xmlSAXParseDoc(void) {
14833 #if defined(LIBXML_SAX1_ENABLED)
14834 #ifdef LIBXML_SAX1_ENABLED
14837 xmlSAXHandlerPtr sax; /* the SAX handler block */
14839 xmlChar * cur; /* a pointer to an array of xmlChar */
14841 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14844 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14845 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14846 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14847 mem_base = xmlMemBlocks();
14848 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14849 cur = gen_const_xmlChar_ptr(n_cur, 1);
14850 recovery = gen_int(n_recovery, 2);
14852 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14853 desret_xmlDocPtr(ret_val);
14855 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14856 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14857 des_int(n_recovery, recovery, 2);
14858 xmlResetLastError();
14859 if (mem_base != xmlMemBlocks()) {
14860 printf("Leak of %d blocks found in xmlSAXParseDoc",
14861 xmlMemBlocks() - mem_base);
14863 printf(" %d", n_sax);
14864 printf(" %d", n_cur);
14865 printf(" %d", n_recovery);
14880 test_xmlSAXParseEntity(void) {
14883 #if defined(LIBXML_SAX1_ENABLED)
14884 #ifdef LIBXML_SAX1_ENABLED
14887 xmlSAXHandlerPtr sax; /* the SAX handler block */
14889 const char * filename; /* the filename */
14892 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14893 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14894 mem_base = xmlMemBlocks();
14895 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14896 filename = gen_filepath(n_filename, 1);
14898 ret_val = xmlSAXParseEntity(sax, filename);
14899 desret_xmlDocPtr(ret_val);
14901 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14902 des_filepath(n_filename, filename, 1);
14903 xmlResetLastError();
14904 if (mem_base != xmlMemBlocks()) {
14905 printf("Leak of %d blocks found in xmlSAXParseEntity",
14906 xmlMemBlocks() - mem_base);
14908 printf(" %d", n_sax);
14909 printf(" %d", n_filename);
14923 test_xmlSAXParseFile(void) {
14926 #if defined(LIBXML_SAX1_ENABLED)
14927 #ifdef LIBXML_SAX1_ENABLED
14930 xmlSAXHandlerPtr sax; /* the SAX handler block */
14932 const char * filename; /* the filename */
14934 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14937 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14938 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14939 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14940 mem_base = xmlMemBlocks();
14941 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14942 filename = gen_filepath(n_filename, 1);
14943 recovery = gen_int(n_recovery, 2);
14945 ret_val = xmlSAXParseFile(sax, filename, recovery);
14946 desret_xmlDocPtr(ret_val);
14948 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14949 des_filepath(n_filename, filename, 1);
14950 des_int(n_recovery, recovery, 2);
14951 xmlResetLastError();
14952 if (mem_base != xmlMemBlocks()) {
14953 printf("Leak of %d blocks found in xmlSAXParseFile",
14954 xmlMemBlocks() - mem_base);
14956 printf(" %d", n_sax);
14957 printf(" %d", n_filename);
14958 printf(" %d", n_recovery);
14973 test_xmlSAXParseFileWithData(void) {
14976 #if defined(LIBXML_SAX1_ENABLED)
14977 #ifdef LIBXML_SAX1_ENABLED
14980 xmlSAXHandlerPtr sax; /* the SAX handler block */
14982 const char * filename; /* the filename */
14984 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14986 void * data; /* the userdata */
14989 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14990 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14991 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14992 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14993 mem_base = xmlMemBlocks();
14994 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14995 filename = gen_filepath(n_filename, 1);
14996 recovery = gen_int(n_recovery, 2);
14997 data = gen_userdata(n_data, 3);
14999 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
15000 desret_xmlDocPtr(ret_val);
15002 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15003 des_filepath(n_filename, filename, 1);
15004 des_int(n_recovery, recovery, 2);
15005 des_userdata(n_data, data, 3);
15006 xmlResetLastError();
15007 if (mem_base != xmlMemBlocks()) {
15008 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
15009 xmlMemBlocks() - mem_base);
15011 printf(" %d", n_sax);
15012 printf(" %d", n_filename);
15013 printf(" %d", n_recovery);
15014 printf(" %d", n_data);
15030 test_xmlSAXParseMemory(void) {
15033 #if defined(LIBXML_SAX1_ENABLED)
15034 #ifdef LIBXML_SAX1_ENABLED
15037 xmlSAXHandlerPtr sax; /* the SAX handler block */
15039 char * buffer; /* an pointer to a char array */
15041 int size; /* the size of the array */
15043 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
15046 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15047 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15048 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15049 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15050 mem_base = xmlMemBlocks();
15051 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15052 buffer = gen_const_char_ptr(n_buffer, 1);
15053 size = gen_int(n_size, 2);
15054 recovery = gen_int(n_recovery, 3);
15055 if ((buffer != NULL) &&
15056 (size > (int) strlen((const char *) buffer) + 1))
15059 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
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 xmlResetLastError();
15067 if (mem_base != xmlMemBlocks()) {
15068 printf("Leak of %d blocks found in xmlSAXParseMemory",
15069 xmlMemBlocks() - mem_base);
15071 printf(" %d", n_sax);
15072 printf(" %d", n_buffer);
15073 printf(" %d", n_size);
15074 printf(" %d", n_recovery);
15090 test_xmlSAXParseMemoryWithData(void) {
15093 #if defined(LIBXML_SAX1_ENABLED)
15094 #ifdef LIBXML_SAX1_ENABLED
15097 xmlSAXHandlerPtr sax; /* the SAX handler block */
15099 char * buffer; /* an pointer to a char array */
15101 int size; /* the size of the array */
15103 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15105 void * data; /* the userdata */
15108 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15109 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15110 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15111 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15112 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15113 mem_base = xmlMemBlocks();
15114 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15115 buffer = gen_const_char_ptr(n_buffer, 1);
15116 size = gen_int(n_size, 2);
15117 recovery = gen_int(n_recovery, 3);
15118 data = gen_userdata(n_data, 4);
15119 if ((buffer != NULL) &&
15120 (size > (int) strlen((const char *) buffer) + 1))
15123 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15124 desret_xmlDocPtr(ret_val);
15126 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15127 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15128 des_int(n_size, size, 2);
15129 des_int(n_recovery, recovery, 3);
15130 des_userdata(n_data, data, 4);
15131 xmlResetLastError();
15132 if (mem_base != xmlMemBlocks()) {
15133 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15134 xmlMemBlocks() - mem_base);
15136 printf(" %d", n_sax);
15137 printf(" %d", n_buffer);
15138 printf(" %d", n_size);
15139 printf(" %d", n_recovery);
15140 printf(" %d", n_data);
15157 test_xmlSAXUserParseFile(void) {
15160 #if defined(LIBXML_SAX1_ENABLED)
15161 #ifdef LIBXML_SAX1_ENABLED
15164 xmlSAXHandlerPtr sax; /* a SAX handler */
15166 void * user_data; /* The user data returned on SAX callbacks */
15168 const char * filename; /* a file name */
15171 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15172 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15173 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15174 mem_base = xmlMemBlocks();
15175 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15176 user_data = gen_userdata(n_user_data, 1);
15177 filename = gen_filepath(n_filename, 2);
15179 #ifdef LIBXML_SAX1_ENABLED
15180 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15184 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15185 desret_int(ret_val);
15187 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15188 des_userdata(n_user_data, user_data, 1);
15189 des_filepath(n_filename, filename, 2);
15190 xmlResetLastError();
15191 if (mem_base != xmlMemBlocks()) {
15192 printf("Leak of %d blocks found in xmlSAXUserParseFile",
15193 xmlMemBlocks() - mem_base);
15195 printf(" %d", n_sax);
15196 printf(" %d", n_user_data);
15197 printf(" %d", n_filename);
15212 test_xmlSAXUserParseMemory(void) {
15215 #if defined(LIBXML_SAX1_ENABLED)
15216 #ifdef LIBXML_SAX1_ENABLED
15219 xmlSAXHandlerPtr sax; /* a SAX handler */
15221 void * user_data; /* The user data returned on SAX callbacks */
15223 char * buffer; /* an in-memory XML document input */
15225 int size; /* the length of the XML document in bytes */
15228 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15229 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15230 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15231 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15232 mem_base = xmlMemBlocks();
15233 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15234 user_data = gen_userdata(n_user_data, 1);
15235 buffer = gen_const_char_ptr(n_buffer, 2);
15236 size = gen_int(n_size, 3);
15237 if ((buffer != NULL) &&
15238 (size > (int) strlen((const char *) buffer) + 1))
15241 #ifdef LIBXML_SAX1_ENABLED
15242 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15246 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15247 desret_int(ret_val);
15249 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15250 des_userdata(n_user_data, user_data, 1);
15251 des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15252 des_int(n_size, size, 3);
15253 xmlResetLastError();
15254 if (mem_base != xmlMemBlocks()) {
15255 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15256 xmlMemBlocks() - mem_base);
15258 printf(" %d", n_sax);
15259 printf(" %d", n_user_data);
15260 printf(" %d", n_buffer);
15261 printf(" %d", n_size);
15277 test_xmlSetExternalEntityLoader(void) {
15281 /* missing type support */
15287 test_xmlSetFeature(void) {
15290 #if defined(LIBXML_LEGACY_ENABLED)
15291 #ifdef LIBXML_LEGACY_ENABLED
15294 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15296 char * name; /* the feature name */
15298 void * value; /* pointer to the location of the new value */
15301 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15302 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15303 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15304 mem_base = xmlMemBlocks();
15305 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15306 name = gen_const_char_ptr(n_name, 1);
15307 value = gen_void_ptr(n_value, 2);
15309 ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15310 desret_int(ret_val);
15312 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15313 des_const_char_ptr(n_name, (const char *)name, 1);
15314 des_void_ptr(n_value, value, 2);
15315 xmlResetLastError();
15316 if (mem_base != xmlMemBlocks()) {
15317 printf("Leak of %d blocks found in xmlSetFeature",
15318 xmlMemBlocks() - mem_base);
15320 printf(" %d", n_ctxt);
15321 printf(" %d", n_name);
15322 printf(" %d", n_value);
15337 test_xmlSetupParserForBuffer(void) {
15340 #if defined(LIBXML_SAX1_ENABLED)
15341 #ifdef LIBXML_SAX1_ENABLED
15343 xmlParserCtxtPtr ctxt; /* an XML parser context */
15345 xmlChar * buffer; /* a xmlChar * buffer */
15347 const char * filename; /* a file name */
15350 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15351 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15352 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15353 mem_base = xmlMemBlocks();
15354 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15355 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15356 filename = gen_filepath(n_filename, 2);
15358 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15360 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15361 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15362 des_filepath(n_filename, filename, 2);
15363 xmlResetLastError();
15364 if (mem_base != xmlMemBlocks()) {
15365 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15366 xmlMemBlocks() - mem_base);
15368 printf(" %d", n_ctxt);
15369 printf(" %d", n_buffer);
15370 printf(" %d", n_filename);
15385 test_xmlStopParser(void) {
15388 #ifdef LIBXML_PUSH_ENABLED
15390 xmlParserCtxtPtr ctxt; /* an XML parser context */
15393 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15394 mem_base = xmlMemBlocks();
15395 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15397 xmlStopParser(ctxt);
15399 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15400 xmlResetLastError();
15401 if (mem_base != xmlMemBlocks()) {
15402 printf("Leak of %d blocks found in xmlStopParser",
15403 xmlMemBlocks() - mem_base);
15405 printf(" %d", n_ctxt);
15417 test_xmlSubstituteEntitiesDefault(void) {
15422 int val; /* int 0 or 1 */
15425 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15426 mem_base = xmlMemBlocks();
15427 val = gen_int(n_val, 0);
15429 ret_val = xmlSubstituteEntitiesDefault(val);
15430 desret_int(ret_val);
15432 des_int(n_val, val, 0);
15433 xmlResetLastError();
15434 if (mem_base != xmlMemBlocks()) {
15435 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15436 xmlMemBlocks() - mem_base);
15438 printf(" %d", n_val);
15448 test_parser(void) {
15451 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15452 test_ret += test_xmlByteConsumed();
15453 test_ret += test_xmlClearNodeInfoSeq();
15454 test_ret += test_xmlClearParserCtxt();
15455 test_ret += test_xmlCreateDocParserCtxt();
15456 test_ret += test_xmlCreatePushParserCtxt();
15457 test_ret += test_xmlCtxtReadDoc();
15458 test_ret += test_xmlCtxtReadFile();
15459 test_ret += test_xmlCtxtReadMemory();
15460 test_ret += test_xmlCtxtReset();
15461 test_ret += test_xmlCtxtResetPush();
15462 test_ret += test_xmlCtxtUseOptions();
15463 test_ret += test_xmlGetExternalEntityLoader();
15464 test_ret += test_xmlGetFeature();
15465 test_ret += test_xmlGetFeaturesList();
15466 test_ret += test_xmlHasFeature();
15467 test_ret += test_xmlIOParseDTD();
15468 test_ret += test_xmlInitNodeInfoSeq();
15469 test_ret += test_xmlInitParser();
15470 test_ret += test_xmlInitParserCtxt();
15471 test_ret += test_xmlKeepBlanksDefault();
15472 test_ret += test_xmlLineNumbersDefault();
15473 test_ret += test_xmlLoadExternalEntity();
15474 test_ret += test_xmlNewIOInputStream();
15475 test_ret += test_xmlNewParserCtxt();
15476 test_ret += test_xmlParseBalancedChunkMemory();
15477 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15478 test_ret += test_xmlParseChunk();
15479 test_ret += test_xmlParseCtxtExternalEntity();
15480 test_ret += test_xmlParseDTD();
15481 test_ret += test_xmlParseDoc();
15482 test_ret += test_xmlParseDocument();
15483 test_ret += test_xmlParseEntity();
15484 test_ret += test_xmlParseExtParsedEnt();
15485 test_ret += test_xmlParseExternalEntity();
15486 test_ret += test_xmlParseFile();
15487 test_ret += test_xmlParseInNodeContext();
15488 test_ret += test_xmlParseMemory();
15489 test_ret += test_xmlParserAddNodeInfo();
15490 test_ret += test_xmlParserFindNodeInfo();
15491 test_ret += test_xmlParserFindNodeInfoIndex();
15492 test_ret += test_xmlParserInputGrow();
15493 test_ret += test_xmlParserInputRead();
15494 test_ret += test_xmlPedanticParserDefault();
15495 test_ret += test_xmlReadDoc();
15496 test_ret += test_xmlReadFile();
15497 test_ret += test_xmlReadMemory();
15498 test_ret += test_xmlRecoverDoc();
15499 test_ret += test_xmlRecoverFile();
15500 test_ret += test_xmlRecoverMemory();
15501 test_ret += test_xmlSAXParseDTD();
15502 test_ret += test_xmlSAXParseDoc();
15503 test_ret += test_xmlSAXParseEntity();
15504 test_ret += test_xmlSAXParseFile();
15505 test_ret += test_xmlSAXParseFileWithData();
15506 test_ret += test_xmlSAXParseMemory();
15507 test_ret += test_xmlSAXParseMemoryWithData();
15508 test_ret += test_xmlSAXUserParseFile();
15509 test_ret += test_xmlSAXUserParseMemory();
15510 test_ret += test_xmlSetExternalEntityLoader();
15511 test_ret += test_xmlSetFeature();
15512 test_ret += test_xmlSetupParserForBuffer();
15513 test_ret += test_xmlStopParser();
15514 test_ret += test_xmlSubstituteEntitiesDefault();
15517 printf("Module parser: %d errors\n", test_ret);
15522 test_htmlCreateFileParserCtxt(void) {
15525 #if defined(LIBXML_HTML_ENABLED)
15527 htmlParserCtxtPtr ret_val;
15528 const char * filename; /* the filename */
15530 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15533 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15534 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15535 mem_base = xmlMemBlocks();
15536 filename = gen_fileoutput(n_filename, 0);
15537 encoding = gen_const_char_ptr(n_encoding, 1);
15539 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15540 desret_htmlParserCtxtPtr(ret_val);
15542 des_fileoutput(n_filename, filename, 0);
15543 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15544 xmlResetLastError();
15545 if (mem_base != xmlMemBlocks()) {
15546 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15547 xmlMemBlocks() - mem_base);
15549 printf(" %d", n_filename);
15550 printf(" %d", n_encoding);
15563 test_htmlInitAutoClose(void) {
15566 #if defined(LIBXML_HTML_ENABLED)
15569 mem_base = xmlMemBlocks();
15571 htmlInitAutoClose();
15573 xmlResetLastError();
15574 if (mem_base != xmlMemBlocks()) {
15575 printf("Leak of %d blocks found in htmlInitAutoClose",
15576 xmlMemBlocks() - mem_base);
15588 test_inputPop(void) {
15592 xmlParserInputPtr ret_val;
15593 xmlParserCtxtPtr ctxt; /* an XML parser context */
15596 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15597 mem_base = xmlMemBlocks();
15598 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15600 ret_val = inputPop(ctxt);
15601 desret_xmlParserInputPtr(ret_val);
15603 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15604 xmlResetLastError();
15605 if (mem_base != xmlMemBlocks()) {
15606 printf("Leak of %d blocks found in inputPop",
15607 xmlMemBlocks() - mem_base);
15609 printf(" %d", n_ctxt);
15620 test_inputPush(void) {
15625 xmlParserCtxtPtr ctxt; /* an XML parser context */
15627 xmlParserInputPtr value; /* the parser input */
15630 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15631 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15632 mem_base = xmlMemBlocks();
15633 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15634 value = gen_xmlParserInputPtr(n_value, 1);
15636 ret_val = inputPush(ctxt, value);
15637 desret_int(ret_val);
15639 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15640 des_xmlParserInputPtr(n_value, value, 1);
15641 xmlResetLastError();
15642 if (mem_base != xmlMemBlocks()) {
15643 printf("Leak of %d blocks found in inputPush",
15644 xmlMemBlocks() - mem_base);
15646 printf(" %d", n_ctxt);
15647 printf(" %d", n_value);
15659 test_namePop(void) {
15663 const xmlChar * ret_val;
15664 xmlParserCtxtPtr ctxt; /* an XML parser context */
15667 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15668 mem_base = xmlMemBlocks();
15669 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15671 ret_val = namePop(ctxt);
15672 desret_const_xmlChar_ptr(ret_val);
15674 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15675 xmlResetLastError();
15676 if (mem_base != xmlMemBlocks()) {
15677 printf("Leak of %d blocks found in namePop",
15678 xmlMemBlocks() - mem_base);
15680 printf(" %d", n_ctxt);
15691 test_namePush(void) {
15696 xmlParserCtxtPtr ctxt; /* an XML parser context */
15698 xmlChar * value; /* the element name */
15701 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15702 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15703 mem_base = xmlMemBlocks();
15704 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15705 value = gen_const_xmlChar_ptr(n_value, 1);
15707 ret_val = namePush(ctxt, (const xmlChar *)value);
15708 desret_int(ret_val);
15710 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15711 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15712 xmlResetLastError();
15713 if (mem_base != xmlMemBlocks()) {
15714 printf("Leak of %d blocks found in namePush",
15715 xmlMemBlocks() - mem_base);
15717 printf(" %d", n_ctxt);
15718 printf(" %d", n_value);
15730 test_nodePop(void) {
15734 xmlNodePtr ret_val;
15735 xmlParserCtxtPtr ctxt; /* an XML parser context */
15738 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15739 mem_base = xmlMemBlocks();
15740 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15742 ret_val = nodePop(ctxt);
15743 desret_xmlNodePtr(ret_val);
15745 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15746 xmlResetLastError();
15747 if (mem_base != xmlMemBlocks()) {
15748 printf("Leak of %d blocks found in nodePop",
15749 xmlMemBlocks() - mem_base);
15751 printf(" %d", n_ctxt);
15762 test_nodePush(void) {
15767 xmlParserCtxtPtr ctxt; /* an XML parser context */
15769 xmlNodePtr value; /* the element node */
15772 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15773 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15774 mem_base = xmlMemBlocks();
15775 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15776 value = gen_xmlNodePtr(n_value, 1);
15778 ret_val = nodePush(ctxt, value);
15779 desret_int(ret_val);
15781 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15782 des_xmlNodePtr(n_value, value, 1);
15783 xmlResetLastError();
15784 if (mem_base != xmlMemBlocks()) {
15785 printf("Leak of %d blocks found in nodePush",
15786 xmlMemBlocks() - mem_base);
15788 printf(" %d", n_ctxt);
15789 printf(" %d", n_value);
15801 test_xmlCheckLanguageID(void) {
15806 xmlChar * lang; /* pointer to the string value */
15809 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15810 mem_base = xmlMemBlocks();
15811 lang = gen_const_xmlChar_ptr(n_lang, 0);
15813 ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15814 desret_int(ret_val);
15816 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15817 xmlResetLastError();
15818 if (mem_base != xmlMemBlocks()) {
15819 printf("Leak of %d blocks found in xmlCheckLanguageID",
15820 xmlMemBlocks() - mem_base);
15822 printf(" %d", n_lang);
15833 test_xmlCopyChar(void) {
15838 int len; /* Ignored, compatibility */
15840 xmlChar * out; /* pointer to an array of xmlChar */
15842 int val; /* the char value */
15845 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15846 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15847 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15848 mem_base = xmlMemBlocks();
15849 len = gen_int(n_len, 0);
15850 out = gen_xmlChar_ptr(n_out, 1);
15851 val = gen_int(n_val, 2);
15853 ret_val = xmlCopyChar(len, out, val);
15854 desret_int(ret_val);
15856 des_int(n_len, len, 0);
15857 des_xmlChar_ptr(n_out, out, 1);
15858 des_int(n_val, val, 2);
15859 xmlResetLastError();
15860 if (mem_base != xmlMemBlocks()) {
15861 printf("Leak of %d blocks found in xmlCopyChar",
15862 xmlMemBlocks() - mem_base);
15864 printf(" %d", n_len);
15865 printf(" %d", n_out);
15866 printf(" %d", n_val);
15879 test_xmlCopyCharMultiByte(void) {
15884 xmlChar * out; /* pointer to an array of xmlChar */
15886 int val; /* the char value */
15889 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15890 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15891 mem_base = xmlMemBlocks();
15892 out = gen_xmlChar_ptr(n_out, 0);
15893 val = gen_int(n_val, 1);
15895 ret_val = xmlCopyCharMultiByte(out, val);
15896 desret_int(ret_val);
15898 des_xmlChar_ptr(n_out, out, 0);
15899 des_int(n_val, val, 1);
15900 xmlResetLastError();
15901 if (mem_base != xmlMemBlocks()) {
15902 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15903 xmlMemBlocks() - mem_base);
15905 printf(" %d", n_out);
15906 printf(" %d", n_val);
15918 test_xmlCreateEntityParserCtxt(void) {
15922 xmlParserCtxtPtr ret_val;
15923 xmlChar * URL; /* the entity URL */
15925 xmlChar * ID; /* the entity PUBLIC ID */
15927 xmlChar * base; /* a possible base for the target URI */
15930 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15931 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15932 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15933 mem_base = xmlMemBlocks();
15934 URL = gen_const_xmlChar_ptr(n_URL, 0);
15935 ID = gen_const_xmlChar_ptr(n_ID, 1);
15936 base = gen_const_xmlChar_ptr(n_base, 2);
15938 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15939 desret_xmlParserCtxtPtr(ret_val);
15941 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15942 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15943 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15944 xmlResetLastError();
15945 if (mem_base != xmlMemBlocks()) {
15946 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15947 xmlMemBlocks() - mem_base);
15949 printf(" %d", n_URL);
15950 printf(" %d", n_ID);
15951 printf(" %d", n_base);
15964 test_xmlCreateFileParserCtxt(void) {
15968 xmlParserCtxtPtr ret_val;
15969 const char * filename; /* the filename */
15972 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15973 mem_base = xmlMemBlocks();
15974 filename = gen_fileoutput(n_filename, 0);
15976 ret_val = xmlCreateFileParserCtxt(filename);
15977 desret_xmlParserCtxtPtr(ret_val);
15979 des_fileoutput(n_filename, filename, 0);
15980 xmlResetLastError();
15981 if (mem_base != xmlMemBlocks()) {
15982 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15983 xmlMemBlocks() - mem_base);
15985 printf(" %d", n_filename);
15996 test_xmlCreateMemoryParserCtxt(void) {
16000 xmlParserCtxtPtr ret_val;
16001 char * buffer; /* a pointer to a char array */
16003 int size; /* the size of the array */
16006 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
16007 for (n_size = 0;n_size < gen_nb_int;n_size++) {
16008 mem_base = xmlMemBlocks();
16009 buffer = gen_const_char_ptr(n_buffer, 0);
16010 size = gen_int(n_size, 1);
16011 if ((buffer != NULL) &&
16012 (size > (int) strlen((const char *) buffer) + 1))
16015 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
16016 desret_xmlParserCtxtPtr(ret_val);
16018 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
16019 des_int(n_size, size, 1);
16020 xmlResetLastError();
16021 if (mem_base != xmlMemBlocks()) {
16022 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
16023 xmlMemBlocks() - mem_base);
16025 printf(" %d", n_buffer);
16026 printf(" %d", n_size);
16038 test_xmlCreateURLParserCtxt(void) {
16042 xmlParserCtxtPtr ret_val;
16043 const char * filename; /* the filename or URL */
16045 int options; /* a combination of xmlParserOption */
16048 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16049 for (n_options = 0;n_options < gen_nb_int;n_options++) {
16050 mem_base = xmlMemBlocks();
16051 filename = gen_fileoutput(n_filename, 0);
16052 options = gen_int(n_options, 1);
16054 ret_val = xmlCreateURLParserCtxt(filename, options);
16055 desret_xmlParserCtxtPtr(ret_val);
16057 des_fileoutput(n_filename, filename, 0);
16058 des_int(n_options, options, 1);
16059 xmlResetLastError();
16060 if (mem_base != xmlMemBlocks()) {
16061 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16062 xmlMemBlocks() - mem_base);
16064 printf(" %d", n_filename);
16065 printf(" %d", n_options);
16077 test_xmlCurrentChar(void) {
16082 xmlParserCtxtPtr ctxt; /* the XML parser context */
16084 int * len; /* pointer to the length of the char read */
16087 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16088 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16089 mem_base = xmlMemBlocks();
16090 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16091 len = gen_int_ptr(n_len, 1);
16093 ret_val = xmlCurrentChar(ctxt, len);
16094 desret_int(ret_val);
16096 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16097 des_int_ptr(n_len, len, 1);
16098 xmlResetLastError();
16099 if (mem_base != xmlMemBlocks()) {
16100 printf("Leak of %d blocks found in xmlCurrentChar",
16101 xmlMemBlocks() - mem_base);
16103 printf(" %d", n_ctxt);
16104 printf(" %d", n_len);
16116 test_xmlErrMemory(void) {
16120 xmlParserCtxtPtr ctxt; /* an XML parser context */
16122 char * extra; /* extra informations */
16125 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16126 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16127 mem_base = xmlMemBlocks();
16128 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16129 extra = gen_const_char_ptr(n_extra, 1);
16131 xmlErrMemory(ctxt, (const char *)extra);
16133 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16134 des_const_char_ptr(n_extra, (const char *)extra, 1);
16135 xmlResetLastError();
16136 if (mem_base != xmlMemBlocks()) {
16137 printf("Leak of %d blocks found in xmlErrMemory",
16138 xmlMemBlocks() - mem_base);
16140 printf(" %d", n_ctxt);
16141 printf(" %d", n_extra);
16153 test_xmlIsLetter(void) {
16158 int c; /* an unicode character (int) */
16161 for (n_c = 0;n_c < gen_nb_int;n_c++) {
16162 mem_base = xmlMemBlocks();
16163 c = gen_int(n_c, 0);
16165 ret_val = xmlIsLetter(c);
16166 desret_int(ret_val);
16168 des_int(n_c, c, 0);
16169 xmlResetLastError();
16170 if (mem_base != xmlMemBlocks()) {
16171 printf("Leak of %d blocks found in xmlIsLetter",
16172 xmlMemBlocks() - mem_base);
16174 printf(" %d", n_c);
16185 test_xmlNewEntityInputStream(void) {
16189 xmlParserInputPtr ret_val;
16190 xmlParserCtxtPtr ctxt; /* an XML parser context */
16192 xmlEntityPtr entity; /* an Entity pointer */
16195 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16196 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16197 mem_base = xmlMemBlocks();
16198 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16199 entity = gen_xmlEntityPtr(n_entity, 1);
16201 ret_val = xmlNewEntityInputStream(ctxt, entity);
16202 desret_xmlParserInputPtr(ret_val);
16204 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16205 des_xmlEntityPtr(n_entity, entity, 1);
16206 xmlResetLastError();
16207 if (mem_base != xmlMemBlocks()) {
16208 printf("Leak of %d blocks found in xmlNewEntityInputStream",
16209 xmlMemBlocks() - mem_base);
16211 printf(" %d", n_ctxt);
16212 printf(" %d", n_entity);
16224 test_xmlNewInputFromFile(void) {
16228 xmlParserInputPtr ret_val;
16229 xmlParserCtxtPtr ctxt; /* an XML parser context */
16231 const char * filename; /* the filename to use as entity */
16234 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16235 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16236 mem_base = xmlMemBlocks();
16237 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16238 filename = gen_filepath(n_filename, 1);
16240 ret_val = xmlNewInputFromFile(ctxt, filename);
16241 desret_xmlParserInputPtr(ret_val);
16243 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16244 des_filepath(n_filename, filename, 1);
16245 xmlResetLastError();
16246 if (mem_base != xmlMemBlocks()) {
16247 printf("Leak of %d blocks found in xmlNewInputFromFile",
16248 xmlMemBlocks() - mem_base);
16250 printf(" %d", n_ctxt);
16251 printf(" %d", n_filename);
16263 test_xmlNewInputStream(void) {
16267 xmlParserInputPtr ret_val;
16268 xmlParserCtxtPtr ctxt; /* an 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);
16275 ret_val = xmlNewInputStream(ctxt);
16276 desret_xmlParserInputPtr(ret_val);
16278 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16279 xmlResetLastError();
16280 if (mem_base != xmlMemBlocks()) {
16281 printf("Leak of %d blocks found in xmlNewInputStream",
16282 xmlMemBlocks() - mem_base);
16284 printf(" %d", n_ctxt);
16295 test_xmlNewStringInputStream(void) {
16299 xmlParserInputPtr ret_val;
16300 xmlParserCtxtPtr ctxt; /* an XML parser context */
16302 xmlChar * buffer; /* an memory buffer */
16305 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16306 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16307 mem_base = xmlMemBlocks();
16308 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16309 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16311 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16312 desret_xmlParserInputPtr(ret_val);
16314 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16315 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16316 xmlResetLastError();
16317 if (mem_base != xmlMemBlocks()) {
16318 printf("Leak of %d blocks found in xmlNewStringInputStream",
16319 xmlMemBlocks() - mem_base);
16321 printf(" %d", n_ctxt);
16322 printf(" %d", n_buffer);
16334 test_xmlNextChar(void) {
16338 xmlParserCtxtPtr ctxt; /* the XML parser context */
16341 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16342 mem_base = xmlMemBlocks();
16343 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16347 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16348 xmlResetLastError();
16349 if (mem_base != xmlMemBlocks()) {
16350 printf("Leak of %d blocks found in xmlNextChar",
16351 xmlMemBlocks() - mem_base);
16353 printf(" %d", n_ctxt);
16364 test_xmlParserInputShrink(void) {
16368 xmlParserInputPtr in; /* an XML parser input */
16371 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16372 mem_base = xmlMemBlocks();
16373 in = gen_xmlParserInputPtr(n_in, 0);
16375 xmlParserInputShrink(in);
16377 des_xmlParserInputPtr(n_in, in, 0);
16378 xmlResetLastError();
16379 if (mem_base != xmlMemBlocks()) {
16380 printf("Leak of %d blocks found in xmlParserInputShrink",
16381 xmlMemBlocks() - mem_base);
16383 printf(" %d", n_in);
16394 test_xmlPopInput(void) {
16399 xmlParserCtxtPtr ctxt; /* an XML parser context */
16402 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16403 mem_base = xmlMemBlocks();
16404 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16406 ret_val = xmlPopInput(ctxt);
16407 desret_xmlChar(ret_val);
16409 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16410 xmlResetLastError();
16411 if (mem_base != xmlMemBlocks()) {
16412 printf("Leak of %d blocks found in xmlPopInput",
16413 xmlMemBlocks() - mem_base);
16415 printf(" %d", n_ctxt);
16426 test_xmlPushInput(void) {
16431 xmlParserCtxtPtr ctxt; /* an XML parser context */
16433 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16436 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16437 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16438 mem_base = xmlMemBlocks();
16439 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16440 input = gen_xmlParserInputPtr(n_input, 1);
16442 ret_val = xmlPushInput(ctxt, input);
16443 desret_int(ret_val);
16445 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16446 des_xmlParserInputPtr(n_input, input, 1);
16447 xmlResetLastError();
16448 if (mem_base != xmlMemBlocks()) {
16449 printf("Leak of %d blocks found in xmlPushInput",
16450 xmlMemBlocks() - mem_base);
16452 printf(" %d", n_ctxt);
16453 printf(" %d", n_input);
16465 test_xmlSetEntityReferenceFunc(void) {
16469 /* missing type support */
16475 test_xmlSplitQName(void) {
16480 xmlParserCtxtPtr ctxt; /* an XML parser context */
16482 xmlChar * name; /* an XML parser context */
16484 xmlChar ** prefix; /* a xmlChar ** */
16487 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16488 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16489 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16490 mem_base = xmlMemBlocks();
16491 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16492 name = gen_const_xmlChar_ptr(n_name, 1);
16493 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16495 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16496 desret_xmlChar_ptr(ret_val);
16498 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16499 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16500 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16501 xmlResetLastError();
16502 if (mem_base != xmlMemBlocks()) {
16503 printf("Leak of %d blocks found in xmlSplitQName",
16504 xmlMemBlocks() - mem_base);
16506 printf(" %d", n_ctxt);
16507 printf(" %d", n_name);
16508 printf(" %d", n_prefix);
16521 test_xmlStringCurrentChar(void) {
16526 xmlParserCtxtPtr ctxt; /* the XML parser context */
16528 xmlChar * cur; /* pointer to the beginning of the char */
16530 int * len; /* pointer to the length of the char read */
16533 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16534 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16535 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16536 mem_base = xmlMemBlocks();
16537 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16538 cur = gen_const_xmlChar_ptr(n_cur, 1);
16539 len = gen_int_ptr(n_len, 2);
16541 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16542 desret_int(ret_val);
16544 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16545 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16546 des_int_ptr(n_len, len, 2);
16547 xmlResetLastError();
16548 if (mem_base != xmlMemBlocks()) {
16549 printf("Leak of %d blocks found in xmlStringCurrentChar",
16550 xmlMemBlocks() - mem_base);
16552 printf(" %d", n_ctxt);
16553 printf(" %d", n_cur);
16554 printf(" %d", n_len);
16567 test_xmlStringDecodeEntities(void) {
16572 xmlParserCtxtPtr ctxt; /* the parser context */
16574 xmlChar * str; /* the input string */
16576 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16578 xmlChar end; /* an end marker xmlChar, 0 if none */
16580 xmlChar end2; /* an end marker xmlChar, 0 if none */
16582 xmlChar end3; /* an end marker xmlChar, 0 if none */
16585 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16586 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
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 what = gen_int(n_what, 2);
16595 end = gen_xmlChar(n_end, 3);
16596 end2 = gen_xmlChar(n_end2, 4);
16597 end3 = gen_xmlChar(n_end3, 5);
16599 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16600 desret_xmlChar_ptr(ret_val);
16602 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16603 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16604 des_int(n_what, what, 2);
16605 des_xmlChar(n_end, end, 3);
16606 des_xmlChar(n_end2, end2, 4);
16607 des_xmlChar(n_end3, end3, 5);
16608 xmlResetLastError();
16609 if (mem_base != xmlMemBlocks()) {
16610 printf("Leak of %d blocks found in xmlStringDecodeEntities",
16611 xmlMemBlocks() - mem_base);
16613 printf(" %d", n_ctxt);
16614 printf(" %d", n_str);
16615 printf(" %d", n_what);
16616 printf(" %d", n_end);
16617 printf(" %d", n_end2);
16618 printf(" %d", n_end3);
16634 test_xmlStringLenDecodeEntities(void) {
16639 xmlParserCtxtPtr ctxt; /* the parser context */
16641 xmlChar * str; /* the input string */
16643 int len; /* the string length */
16645 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16647 xmlChar end; /* an end marker xmlChar, 0 if none */
16649 xmlChar end2; /* an end marker xmlChar, 0 if none */
16651 xmlChar end3; /* an end marker xmlChar, 0 if none */
16654 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16655 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16656 for (n_len = 0;n_len < gen_nb_int;n_len++) {
16657 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16658 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16659 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16660 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16661 mem_base = xmlMemBlocks();
16662 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16663 str = gen_const_xmlChar_ptr(n_str, 1);
16664 len = gen_int(n_len, 2);
16665 what = gen_int(n_what, 3);
16666 end = gen_xmlChar(n_end, 4);
16667 end2 = gen_xmlChar(n_end2, 5);
16668 end3 = gen_xmlChar(n_end3, 6);
16669 if ((str != NULL) &&
16670 (len > (int) strlen((const char *) str) + 1))
16673 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16674 desret_xmlChar_ptr(ret_val);
16676 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16677 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16678 des_int(n_len, len, 2);
16679 des_int(n_what, what, 3);
16680 des_xmlChar(n_end, end, 4);
16681 des_xmlChar(n_end2, end2, 5);
16682 des_xmlChar(n_end3, end3, 6);
16683 xmlResetLastError();
16684 if (mem_base != xmlMemBlocks()) {
16685 printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16686 xmlMemBlocks() - mem_base);
16688 printf(" %d", n_ctxt);
16689 printf(" %d", n_str);
16690 printf(" %d", n_len);
16691 printf(" %d", n_what);
16692 printf(" %d", n_end);
16693 printf(" %d", n_end2);
16694 printf(" %d", n_end3);
16711 test_xmlSwitchEncoding(void) {
16716 xmlParserCtxtPtr ctxt; /* the parser context */
16718 xmlCharEncoding enc; /* the encoding value (number) */
16721 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16722 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16723 mem_base = xmlMemBlocks();
16724 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16725 enc = gen_xmlCharEncoding(n_enc, 1);
16727 ret_val = xmlSwitchEncoding(ctxt, enc);
16728 desret_int(ret_val);
16730 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16731 des_xmlCharEncoding(n_enc, enc, 1);
16732 xmlResetLastError();
16733 if (mem_base != xmlMemBlocks()) {
16734 printf("Leak of %d blocks found in xmlSwitchEncoding",
16735 xmlMemBlocks() - mem_base);
16737 printf(" %d", n_ctxt);
16738 printf(" %d", n_enc);
16750 test_xmlSwitchInputEncoding(void) {
16755 xmlParserCtxtPtr ctxt; /* the parser context */
16757 xmlParserInputPtr input; /* the input stream */
16759 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16762 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16763 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16764 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16765 mem_base = xmlMemBlocks();
16766 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16767 input = gen_xmlParserInputPtr(n_input, 1);
16768 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16770 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16771 desret_int(ret_val);
16773 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16774 des_xmlParserInputPtr(n_input, input, 1);
16775 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16776 xmlResetLastError();
16777 if (mem_base != xmlMemBlocks()) {
16778 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16779 xmlMemBlocks() - mem_base);
16781 printf(" %d", n_ctxt);
16782 printf(" %d", n_input);
16783 printf(" %d", n_handler);
16796 test_xmlSwitchToEncoding(void) {
16801 xmlParserCtxtPtr ctxt; /* the parser context */
16803 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16806 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16807 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16808 mem_base = xmlMemBlocks();
16809 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16810 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16812 ret_val = xmlSwitchToEncoding(ctxt, handler);
16813 desret_int(ret_val);
16815 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16816 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16817 xmlResetLastError();
16818 if (mem_base != xmlMemBlocks()) {
16819 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16820 xmlMemBlocks() - mem_base);
16822 printf(" %d", n_ctxt);
16823 printf(" %d", n_handler);
16834 test_parserInternals(void) {
16837 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16838 test_ret += test_htmlCreateFileParserCtxt();
16839 test_ret += test_htmlInitAutoClose();
16840 test_ret += test_inputPop();
16841 test_ret += test_inputPush();
16842 test_ret += test_namePop();
16843 test_ret += test_namePush();
16844 test_ret += test_nodePop();
16845 test_ret += test_nodePush();
16846 test_ret += test_xmlCheckLanguageID();
16847 test_ret += test_xmlCopyChar();
16848 test_ret += test_xmlCopyCharMultiByte();
16849 test_ret += test_xmlCreateEntityParserCtxt();
16850 test_ret += test_xmlCreateFileParserCtxt();
16851 test_ret += test_xmlCreateMemoryParserCtxt();
16852 test_ret += test_xmlCreateURLParserCtxt();
16853 test_ret += test_xmlCurrentChar();
16854 test_ret += test_xmlErrMemory();
16855 test_ret += test_xmlIsLetter();
16856 test_ret += test_xmlNewEntityInputStream();
16857 test_ret += test_xmlNewInputFromFile();
16858 test_ret += test_xmlNewInputStream();
16859 test_ret += test_xmlNewStringInputStream();
16860 test_ret += test_xmlNextChar();
16861 test_ret += test_xmlParserInputShrink();
16862 test_ret += test_xmlPopInput();
16863 test_ret += test_xmlPushInput();
16864 test_ret += test_xmlSetEntityReferenceFunc();
16865 test_ret += test_xmlSplitQName();
16866 test_ret += test_xmlStringCurrentChar();
16867 test_ret += test_xmlStringDecodeEntities();
16868 test_ret += test_xmlStringLenDecodeEntities();
16869 test_ret += test_xmlSwitchEncoding();
16870 test_ret += test_xmlSwitchInputEncoding();
16871 test_ret += test_xmlSwitchToEncoding();
16874 printf("Module parserInternals: %d errors\n", test_ret);
16879 test_xmlPatternFromRoot(void) {
16882 #if defined(LIBXML_PATTERN_ENABLED)
16885 xmlPatternPtr comp; /* the precompiled pattern */
16888 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16889 mem_base = xmlMemBlocks();
16890 comp = gen_xmlPatternPtr(n_comp, 0);
16892 ret_val = xmlPatternFromRoot(comp);
16893 desret_int(ret_val);
16895 des_xmlPatternPtr(n_comp, comp, 0);
16896 xmlResetLastError();
16897 if (mem_base != xmlMemBlocks()) {
16898 printf("Leak of %d blocks found in xmlPatternFromRoot",
16899 xmlMemBlocks() - mem_base);
16901 printf(" %d", n_comp);
16913 test_xmlPatternGetStreamCtxt(void) {
16917 /* missing type support */
16923 test_xmlPatternMatch(void) {
16926 #if defined(LIBXML_PATTERN_ENABLED)
16929 xmlPatternPtr comp; /* the precompiled pattern */
16931 xmlNodePtr node; /* a node */
16934 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16935 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16936 mem_base = xmlMemBlocks();
16937 comp = gen_xmlPatternPtr(n_comp, 0);
16938 node = gen_xmlNodePtr(n_node, 1);
16940 ret_val = xmlPatternMatch(comp, node);
16941 desret_int(ret_val);
16943 des_xmlPatternPtr(n_comp, comp, 0);
16944 des_xmlNodePtr(n_node, node, 1);
16945 xmlResetLastError();
16946 if (mem_base != xmlMemBlocks()) {
16947 printf("Leak of %d blocks found in xmlPatternMatch",
16948 xmlMemBlocks() - mem_base);
16950 printf(" %d", n_comp);
16951 printf(" %d", n_node);
16964 test_xmlPatternMaxDepth(void) {
16967 #if defined(LIBXML_PATTERN_ENABLED)
16970 xmlPatternPtr comp; /* the precompiled pattern */
16973 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16974 mem_base = xmlMemBlocks();
16975 comp = gen_xmlPatternPtr(n_comp, 0);
16977 ret_val = xmlPatternMaxDepth(comp);
16978 desret_int(ret_val);
16980 des_xmlPatternPtr(n_comp, comp, 0);
16981 xmlResetLastError();
16982 if (mem_base != xmlMemBlocks()) {
16983 printf("Leak of %d blocks found in xmlPatternMaxDepth",
16984 xmlMemBlocks() - mem_base);
16986 printf(" %d", n_comp);
16998 test_xmlPatternMinDepth(void) {
17001 #if defined(LIBXML_PATTERN_ENABLED)
17004 xmlPatternPtr comp; /* the precompiled pattern */
17007 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17008 mem_base = xmlMemBlocks();
17009 comp = gen_xmlPatternPtr(n_comp, 0);
17011 ret_val = xmlPatternMinDepth(comp);
17012 desret_int(ret_val);
17014 des_xmlPatternPtr(n_comp, comp, 0);
17015 xmlResetLastError();
17016 if (mem_base != xmlMemBlocks()) {
17017 printf("Leak of %d blocks found in xmlPatternMinDepth",
17018 xmlMemBlocks() - mem_base);
17020 printf(" %d", n_comp);
17032 test_xmlPatternStreamable(void) {
17035 #if defined(LIBXML_PATTERN_ENABLED)
17038 xmlPatternPtr comp; /* the precompiled pattern */
17041 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17042 mem_base = xmlMemBlocks();
17043 comp = gen_xmlPatternPtr(n_comp, 0);
17045 ret_val = xmlPatternStreamable(comp);
17046 desret_int(ret_val);
17048 des_xmlPatternPtr(n_comp, comp, 0);
17049 xmlResetLastError();
17050 if (mem_base != xmlMemBlocks()) {
17051 printf("Leak of %d blocks found in xmlPatternStreamable",
17052 xmlMemBlocks() - mem_base);
17054 printf(" %d", n_comp);
17066 test_xmlPatterncompile(void) {
17070 /* missing type support */
17074 #ifdef LIBXML_PATTERN_ENABLED
17076 #define gen_nb_xmlStreamCtxtPtr 1
17077 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17080 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17086 test_xmlStreamPop(void) {
17089 #if defined(LIBXML_PATTERN_ENABLED)
17092 xmlStreamCtxtPtr stream; /* the stream context */
17095 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17096 mem_base = xmlMemBlocks();
17097 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17099 ret_val = xmlStreamPop(stream);
17100 desret_int(ret_val);
17102 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17103 xmlResetLastError();
17104 if (mem_base != xmlMemBlocks()) {
17105 printf("Leak of %d blocks found in xmlStreamPop",
17106 xmlMemBlocks() - mem_base);
17108 printf(" %d", n_stream);
17120 test_xmlStreamPush(void) {
17123 #if defined(LIBXML_PATTERN_ENABLED)
17126 xmlStreamCtxtPtr stream; /* the stream context */
17128 xmlChar * name; /* the current name */
17130 xmlChar * ns; /* the namespace name */
17133 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17134 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17135 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17136 mem_base = xmlMemBlocks();
17137 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17138 name = gen_const_xmlChar_ptr(n_name, 1);
17139 ns = gen_const_xmlChar_ptr(n_ns, 2);
17141 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17142 desret_int(ret_val);
17144 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17145 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17146 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17147 xmlResetLastError();
17148 if (mem_base != xmlMemBlocks()) {
17149 printf("Leak of %d blocks found in xmlStreamPush",
17150 xmlMemBlocks() - mem_base);
17152 printf(" %d", n_stream);
17153 printf(" %d", n_name);
17154 printf(" %d", n_ns);
17168 test_xmlStreamPushAttr(void) {
17171 #if defined(LIBXML_PATTERN_ENABLED)
17174 xmlStreamCtxtPtr stream; /* the stream context */
17176 xmlChar * name; /* the current name */
17178 xmlChar * ns; /* the namespace name */
17181 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17182 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17183 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17184 mem_base = xmlMemBlocks();
17185 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17186 name = gen_const_xmlChar_ptr(n_name, 1);
17187 ns = gen_const_xmlChar_ptr(n_ns, 2);
17189 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17190 desret_int(ret_val);
17192 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17193 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17194 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17195 xmlResetLastError();
17196 if (mem_base != xmlMemBlocks()) {
17197 printf("Leak of %d blocks found in xmlStreamPushAttr",
17198 xmlMemBlocks() - mem_base);
17200 printf(" %d", n_stream);
17201 printf(" %d", n_name);
17202 printf(" %d", n_ns);
17216 test_xmlStreamPushNode(void) {
17219 #if defined(LIBXML_PATTERN_ENABLED)
17222 xmlStreamCtxtPtr stream; /* the stream context */
17224 xmlChar * name; /* the current name */
17226 xmlChar * ns; /* the namespace name */
17228 int nodeType; /* the type of the node being pushed */
17231 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17232 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17233 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17234 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17235 mem_base = xmlMemBlocks();
17236 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17237 name = gen_const_xmlChar_ptr(n_name, 1);
17238 ns = gen_const_xmlChar_ptr(n_ns, 2);
17239 nodeType = gen_int(n_nodeType, 3);
17241 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17242 desret_int(ret_val);
17244 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17245 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17246 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17247 des_int(n_nodeType, nodeType, 3);
17248 xmlResetLastError();
17249 if (mem_base != xmlMemBlocks()) {
17250 printf("Leak of %d blocks found in xmlStreamPushNode",
17251 xmlMemBlocks() - mem_base);
17253 printf(" %d", n_stream);
17254 printf(" %d", n_name);
17255 printf(" %d", n_ns);
17256 printf(" %d", n_nodeType);
17271 test_xmlStreamWantsAnyNode(void) {
17274 #if defined(LIBXML_PATTERN_ENABLED)
17277 xmlStreamCtxtPtr streamCtxt; /* the stream context */
17280 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17281 mem_base = xmlMemBlocks();
17282 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17284 ret_val = xmlStreamWantsAnyNode(streamCtxt);
17285 desret_int(ret_val);
17287 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17288 xmlResetLastError();
17289 if (mem_base != xmlMemBlocks()) {
17290 printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17291 xmlMemBlocks() - mem_base);
17293 printf(" %d", n_streamCtxt);
17304 test_pattern(void) {
17307 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17308 test_ret += test_xmlPatternFromRoot();
17309 test_ret += test_xmlPatternGetStreamCtxt();
17310 test_ret += test_xmlPatternMatch();
17311 test_ret += test_xmlPatternMaxDepth();
17312 test_ret += test_xmlPatternMinDepth();
17313 test_ret += test_xmlPatternStreamable();
17314 test_ret += test_xmlPatterncompile();
17315 test_ret += test_xmlStreamPop();
17316 test_ret += test_xmlStreamPush();
17317 test_ret += test_xmlStreamPushAttr();
17318 test_ret += test_xmlStreamPushNode();
17319 test_ret += test_xmlStreamWantsAnyNode();
17322 printf("Module pattern: %d errors\n", test_ret);
17325 #ifdef LIBXML_SCHEMAS_ENABLED
17327 #define gen_nb_xmlRelaxNGPtr 1
17328 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17331 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17337 test_xmlRelaxNGDump(void) {
17340 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17342 FILE * output; /* the file output */
17344 xmlRelaxNGPtr schema; /* a schema structure */
17347 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17348 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17349 mem_base = xmlMemBlocks();
17350 output = gen_FILE_ptr(n_output, 0);
17351 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17353 xmlRelaxNGDump(output, schema);
17355 des_FILE_ptr(n_output, output, 0);
17356 des_xmlRelaxNGPtr(n_schema, schema, 1);
17357 xmlResetLastError();
17358 if (mem_base != xmlMemBlocks()) {
17359 printf("Leak of %d blocks found in xmlRelaxNGDump",
17360 xmlMemBlocks() - mem_base);
17362 printf(" %d", n_output);
17363 printf(" %d", n_schema);
17376 test_xmlRelaxNGDumpTree(void) {
17379 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17381 FILE * output; /* the file output */
17383 xmlRelaxNGPtr schema; /* a schema structure */
17386 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17387 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17388 mem_base = xmlMemBlocks();
17389 output = gen_FILE_ptr(n_output, 0);
17390 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17392 xmlRelaxNGDumpTree(output, schema);
17394 des_FILE_ptr(n_output, output, 0);
17395 des_xmlRelaxNGPtr(n_schema, schema, 1);
17396 xmlResetLastError();
17397 if (mem_base != xmlMemBlocks()) {
17398 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17399 xmlMemBlocks() - mem_base);
17401 printf(" %d", n_output);
17402 printf(" %d", n_schema);
17413 #ifdef LIBXML_SCHEMAS_ENABLED
17415 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17416 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17419 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17423 #ifdef LIBXML_SCHEMAS_ENABLED
17425 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17426 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17429 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17433 #ifdef LIBXML_SCHEMAS_ENABLED
17435 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17436 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17439 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17445 test_xmlRelaxNGGetParserErrors(void) {
17448 #if defined(LIBXML_SCHEMAS_ENABLED)
17451 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17453 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17455 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17457 void ** ctx; /* contextual data for the callbacks result */
17460 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17461 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17462 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17463 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17464 mem_base = xmlMemBlocks();
17465 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17466 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17467 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17468 ctx = gen_void_ptr_ptr(n_ctx, 3);
17470 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17471 desret_int(ret_val);
17473 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17474 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17475 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17476 des_void_ptr_ptr(n_ctx, ctx, 3);
17477 xmlResetLastError();
17478 if (mem_base != xmlMemBlocks()) {
17479 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17480 xmlMemBlocks() - mem_base);
17482 printf(" %d", n_ctxt);
17483 printf(" %d", n_err);
17484 printf(" %d", n_warn);
17485 printf(" %d", n_ctx);
17498 #ifdef LIBXML_SCHEMAS_ENABLED
17500 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17501 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17504 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17510 test_xmlRelaxNGGetValidErrors(void) {
17513 #if defined(LIBXML_SCHEMAS_ENABLED)
17516 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17518 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17520 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17522 void ** ctx; /* the functions context result */
17525 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17526 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17527 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17528 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17529 mem_base = xmlMemBlocks();
17530 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17531 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17532 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17533 ctx = gen_void_ptr_ptr(n_ctx, 3);
17535 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17536 desret_int(ret_val);
17538 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17539 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17540 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17541 des_void_ptr_ptr(n_ctx, ctx, 3);
17542 xmlResetLastError();
17543 if (mem_base != xmlMemBlocks()) {
17544 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17545 xmlMemBlocks() - mem_base);
17547 printf(" %d", n_ctxt);
17548 printf(" %d", n_err);
17549 printf(" %d", n_warn);
17550 printf(" %d", n_ctx);
17565 test_xmlRelaxNGInitTypes(void) {
17568 #if defined(LIBXML_SCHEMAS_ENABLED)
17572 mem_base = xmlMemBlocks();
17574 ret_val = xmlRelaxNGInitTypes();
17575 desret_int(ret_val);
17577 xmlResetLastError();
17578 if (mem_base != xmlMemBlocks()) {
17579 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17580 xmlMemBlocks() - mem_base);
17592 test_xmlRelaxNGNewDocParserCtxt(void) {
17595 #if defined(LIBXML_SCHEMAS_ENABLED)
17597 xmlRelaxNGParserCtxtPtr ret_val;
17598 xmlDocPtr doc; /* a preparsed document tree */
17601 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17602 mem_base = xmlMemBlocks();
17603 doc = gen_xmlDocPtr(n_doc, 0);
17605 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17606 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17608 des_xmlDocPtr(n_doc, doc, 0);
17609 xmlResetLastError();
17610 if (mem_base != xmlMemBlocks()) {
17611 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17612 xmlMemBlocks() - mem_base);
17614 printf(" %d", n_doc);
17626 test_xmlRelaxNGNewMemParserCtxt(void) {
17629 #if defined(LIBXML_SCHEMAS_ENABLED)
17631 xmlRelaxNGParserCtxtPtr ret_val;
17632 char * buffer; /* a pointer to a char array containing the schemas */
17634 int size; /* the size of the array */
17637 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17638 for (n_size = 0;n_size < gen_nb_int;n_size++) {
17639 mem_base = xmlMemBlocks();
17640 buffer = gen_const_char_ptr(n_buffer, 0);
17641 size = gen_int(n_size, 1);
17642 if ((buffer != NULL) &&
17643 (size > (int) strlen((const char *) buffer) + 1))
17646 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17647 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17649 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17650 des_int(n_size, size, 1);
17651 xmlResetLastError();
17652 if (mem_base != xmlMemBlocks()) {
17653 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17654 xmlMemBlocks() - mem_base);
17656 printf(" %d", n_buffer);
17657 printf(" %d", n_size);
17670 test_xmlRelaxNGNewParserCtxt(void) {
17673 #if defined(LIBXML_SCHEMAS_ENABLED)
17675 xmlRelaxNGParserCtxtPtr ret_val;
17676 char * URL; /* the location of the schema */
17679 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17680 mem_base = xmlMemBlocks();
17681 URL = gen_const_char_ptr(n_URL, 0);
17683 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17684 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17686 des_const_char_ptr(n_URL, (const char *)URL, 0);
17687 xmlResetLastError();
17688 if (mem_base != xmlMemBlocks()) {
17689 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17690 xmlMemBlocks() - mem_base);
17692 printf(" %d", n_URL);
17704 test_xmlRelaxNGNewValidCtxt(void) {
17708 /* missing type support */
17714 test_xmlRelaxNGParse(void) {
17718 /* missing type support */
17724 test_xmlRelaxNGSetParserErrors(void) {
17728 /* missing type support */
17734 test_xmlRelaxNGSetParserStructuredErrors(void) {
17738 /* missing type support */
17744 test_xmlRelaxNGSetValidErrors(void) {
17748 /* missing type support */
17754 test_xmlRelaxNGSetValidStructuredErrors(void) {
17758 /* missing type support */
17764 test_xmlRelaxNGValidateDoc(void) {
17767 #if defined(LIBXML_SCHEMAS_ENABLED)
17770 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17772 xmlDocPtr doc; /* a parsed document tree */
17775 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17776 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17777 mem_base = xmlMemBlocks();
17778 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17779 doc = gen_xmlDocPtr(n_doc, 1);
17781 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17782 desret_int(ret_val);
17784 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17785 des_xmlDocPtr(n_doc, doc, 1);
17786 xmlResetLastError();
17787 if (mem_base != xmlMemBlocks()) {
17788 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17789 xmlMemBlocks() - mem_base);
17791 printf(" %d", n_ctxt);
17792 printf(" %d", n_doc);
17805 test_xmlRelaxNGValidateFullElement(void) {
17808 #if defined(LIBXML_SCHEMAS_ENABLED)
17811 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17813 xmlDocPtr doc; /* a document instance */
17815 xmlNodePtr elem; /* an element instance */
17818 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17819 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17820 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17821 mem_base = xmlMemBlocks();
17822 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17823 doc = gen_xmlDocPtr(n_doc, 1);
17824 elem = gen_xmlNodePtr(n_elem, 2);
17826 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17827 desret_int(ret_val);
17829 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17830 des_xmlDocPtr(n_doc, doc, 1);
17831 des_xmlNodePtr(n_elem, elem, 2);
17832 xmlResetLastError();
17833 if (mem_base != xmlMemBlocks()) {
17834 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17835 xmlMemBlocks() - mem_base);
17837 printf(" %d", n_ctxt);
17838 printf(" %d", n_doc);
17839 printf(" %d", n_elem);
17853 test_xmlRelaxNGValidatePopElement(void) {
17856 #if defined(LIBXML_SCHEMAS_ENABLED)
17859 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17861 xmlDocPtr doc; /* a document instance */
17863 xmlNodePtr elem; /* an element instance */
17866 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17867 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17868 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17869 mem_base = xmlMemBlocks();
17870 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17871 doc = gen_xmlDocPtr(n_doc, 1);
17872 elem = gen_xmlNodePtr(n_elem, 2);
17874 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17875 desret_int(ret_val);
17877 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17878 des_xmlDocPtr(n_doc, doc, 1);
17879 des_xmlNodePtr(n_elem, elem, 2);
17880 xmlResetLastError();
17881 if (mem_base != xmlMemBlocks()) {
17882 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17883 xmlMemBlocks() - mem_base);
17885 printf(" %d", n_ctxt);
17886 printf(" %d", n_doc);
17887 printf(" %d", n_elem);
17901 test_xmlRelaxNGValidatePushCData(void) {
17904 #if defined(LIBXML_SCHEMAS_ENABLED)
17907 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17909 xmlChar * data; /* some character data read */
17911 int len; /* the length of the data */
17914 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17915 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17916 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17917 mem_base = xmlMemBlocks();
17918 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17919 data = gen_const_xmlChar_ptr(n_data, 1);
17920 len = gen_int(n_len, 2);
17921 if ((data != NULL) &&
17922 (len > (int) strlen((const char *) data) + 1))
17925 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17926 desret_int(ret_val);
17928 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17929 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17930 des_int(n_len, len, 2);
17931 xmlResetLastError();
17932 if (mem_base != xmlMemBlocks()) {
17933 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17934 xmlMemBlocks() - mem_base);
17936 printf(" %d", n_ctxt);
17937 printf(" %d", n_data);
17938 printf(" %d", n_len);
17952 test_xmlRelaxNGValidatePushElement(void) {
17955 #if defined(LIBXML_SCHEMAS_ENABLED)
17958 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17960 xmlDocPtr doc; /* a document instance */
17962 xmlNodePtr elem; /* an element instance */
17965 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17966 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17967 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17968 mem_base = xmlMemBlocks();
17969 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17970 doc = gen_xmlDocPtr(n_doc, 1);
17971 elem = gen_xmlNodePtr(n_elem, 2);
17973 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17974 desret_int(ret_val);
17976 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17977 des_xmlDocPtr(n_doc, doc, 1);
17978 des_xmlNodePtr(n_elem, elem, 2);
17979 xmlResetLastError();
17980 if (mem_base != xmlMemBlocks()) {
17981 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17982 xmlMemBlocks() - mem_base);
17984 printf(" %d", n_ctxt);
17985 printf(" %d", n_doc);
17986 printf(" %d", n_elem);
18000 test_xmlRelaxParserSetFlag(void) {
18003 #if defined(LIBXML_SCHEMAS_ENABLED)
18006 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
18008 int flags; /* a set of flags values */
18011 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
18012 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
18013 mem_base = xmlMemBlocks();
18014 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
18015 flags = gen_int(n_flags, 1);
18017 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
18018 desret_int(ret_val);
18020 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
18021 des_int(n_flags, flags, 1);
18022 xmlResetLastError();
18023 if (mem_base != xmlMemBlocks()) {
18024 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
18025 xmlMemBlocks() - mem_base);
18027 printf(" %d", n_ctxt);
18028 printf(" %d", n_flags);
18040 test_relaxng(void) {
18043 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
18044 test_ret += test_xmlRelaxNGDump();
18045 test_ret += test_xmlRelaxNGDumpTree();
18046 test_ret += test_xmlRelaxNGGetParserErrors();
18047 test_ret += test_xmlRelaxNGGetValidErrors();
18048 test_ret += test_xmlRelaxNGInitTypes();
18049 test_ret += test_xmlRelaxNGNewDocParserCtxt();
18050 test_ret += test_xmlRelaxNGNewMemParserCtxt();
18051 test_ret += test_xmlRelaxNGNewParserCtxt();
18052 test_ret += test_xmlRelaxNGNewValidCtxt();
18053 test_ret += test_xmlRelaxNGParse();
18054 test_ret += test_xmlRelaxNGSetParserErrors();
18055 test_ret += test_xmlRelaxNGSetParserStructuredErrors();
18056 test_ret += test_xmlRelaxNGSetValidErrors();
18057 test_ret += test_xmlRelaxNGSetValidStructuredErrors();
18058 test_ret += test_xmlRelaxNGValidateDoc();
18059 test_ret += test_xmlRelaxNGValidateFullElement();
18060 test_ret += test_xmlRelaxNGValidatePopElement();
18061 test_ret += test_xmlRelaxNGValidatePushCData();
18062 test_ret += test_xmlRelaxNGValidatePushElement();
18063 test_ret += test_xmlRelaxParserSetFlag();
18066 printf("Module relaxng: %d errors\n", test_ret);
18070 test_schemasInternals(void) {
18073 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18076 printf("Module schemasInternals: %d errors\n", test_ret);
18081 test_xmlSchematronNewDocParserCtxt(void) {
18085 /* missing type support */
18091 test_xmlSchematronNewMemParserCtxt(void) {
18095 /* missing type support */
18101 test_xmlSchematronNewParserCtxt(void) {
18105 /* missing type support */
18109 #ifdef LIBXML_SCHEMATRON_ENABLED
18111 #define gen_nb_xmlSchematronPtr 1
18112 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18115 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18121 test_xmlSchematronNewValidCtxt(void) {
18125 /* missing type support */
18129 #ifdef LIBXML_SCHEMATRON_ENABLED
18131 #define gen_nb_xmlSchematronParserCtxtPtr 1
18132 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18135 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18141 test_xmlSchematronParse(void) {
18145 /* missing type support */
18149 #ifdef LIBXML_SCHEMATRON_ENABLED
18151 #define gen_nb_xmlSchematronValidCtxtPtr 1
18152 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18155 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18161 test_xmlSchematronSetValidStructuredErrors(void) {
18165 /* missing type support */
18171 test_xmlSchematronValidateDoc(void) {
18174 #if defined(LIBXML_SCHEMATRON_ENABLED)
18177 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18179 xmlDocPtr instance; /* the document instace tree */
18182 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18183 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18184 mem_base = xmlMemBlocks();
18185 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18186 instance = gen_xmlDocPtr(n_instance, 1);
18188 ret_val = xmlSchematronValidateDoc(ctxt, instance);
18189 desret_int(ret_val);
18191 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18192 des_xmlDocPtr(n_instance, instance, 1);
18193 xmlResetLastError();
18194 if (mem_base != xmlMemBlocks()) {
18195 printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18196 xmlMemBlocks() - mem_base);
18198 printf(" %d", n_ctxt);
18199 printf(" %d", n_instance);
18211 test_schematron(void) {
18214 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18215 test_ret += test_xmlSchematronNewDocParserCtxt();
18216 test_ret += test_xmlSchematronNewMemParserCtxt();
18217 test_ret += test_xmlSchematronNewParserCtxt();
18218 test_ret += test_xmlSchematronNewValidCtxt();
18219 test_ret += test_xmlSchematronParse();
18220 test_ret += test_xmlSchematronSetValidStructuredErrors();
18221 test_ret += test_xmlSchematronValidateDoc();
18224 printf("Module schematron: %d errors\n", test_ret);
18229 test_xmlAddChild(void) {
18233 xmlNodePtr ret_val;
18234 xmlNodePtr parent; /* the parent node */
18236 xmlNodePtr cur; /* the child node */
18239 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18240 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18241 mem_base = xmlMemBlocks();
18242 parent = gen_xmlNodePtr(n_parent, 0);
18243 cur = gen_xmlNodePtr_in(n_cur, 1);
18245 ret_val = xmlAddChild(parent, cur);
18246 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18247 desret_xmlNodePtr(ret_val);
18249 des_xmlNodePtr(n_parent, parent, 0);
18250 des_xmlNodePtr_in(n_cur, cur, 1);
18251 xmlResetLastError();
18252 if (mem_base != xmlMemBlocks()) {
18253 printf("Leak of %d blocks found in xmlAddChild",
18254 xmlMemBlocks() - mem_base);
18256 printf(" %d", n_parent);
18257 printf(" %d", n_cur);
18269 test_xmlAddChildList(void) {
18273 xmlNodePtr ret_val;
18274 xmlNodePtr parent; /* the parent node */
18276 xmlNodePtr cur; /* the first node in the list */
18279 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18280 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18281 mem_base = xmlMemBlocks();
18282 parent = gen_xmlNodePtr(n_parent, 0);
18283 cur = gen_xmlNodePtr_in(n_cur, 1);
18285 ret_val = xmlAddChildList(parent, cur);
18286 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18287 desret_xmlNodePtr(ret_val);
18289 des_xmlNodePtr(n_parent, parent, 0);
18290 des_xmlNodePtr_in(n_cur, cur, 1);
18291 xmlResetLastError();
18292 if (mem_base != xmlMemBlocks()) {
18293 printf("Leak of %d blocks found in xmlAddChildList",
18294 xmlMemBlocks() - mem_base);
18296 printf(" %d", n_parent);
18297 printf(" %d", n_cur);
18309 test_xmlAddNextSibling(void) {
18313 xmlNodePtr ret_val;
18314 xmlNodePtr cur; /* the child node */
18316 xmlNodePtr elem; /* the new node */
18319 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18320 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18321 mem_base = xmlMemBlocks();
18322 cur = gen_xmlNodePtr(n_cur, 0);
18323 elem = gen_xmlNodePtr_in(n_elem, 1);
18325 ret_val = xmlAddNextSibling(cur, elem);
18326 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18327 desret_xmlNodePtr(ret_val);
18329 des_xmlNodePtr(n_cur, cur, 0);
18330 des_xmlNodePtr_in(n_elem, elem, 1);
18331 xmlResetLastError();
18332 if (mem_base != xmlMemBlocks()) {
18333 printf("Leak of %d blocks found in xmlAddNextSibling",
18334 xmlMemBlocks() - mem_base);
18336 printf(" %d", n_cur);
18337 printf(" %d", n_elem);
18349 test_xmlAddPrevSibling(void) {
18352 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
18354 xmlNodePtr ret_val;
18355 xmlNodePtr cur; /* the child node */
18357 xmlNodePtr elem; /* the new node */
18360 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18361 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18362 mem_base = xmlMemBlocks();
18363 cur = gen_xmlNodePtr(n_cur, 0);
18364 elem = gen_xmlNodePtr_in(n_elem, 1);
18366 ret_val = xmlAddPrevSibling(cur, elem);
18367 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18368 desret_xmlNodePtr(ret_val);
18370 des_xmlNodePtr(n_cur, cur, 0);
18371 des_xmlNodePtr_in(n_elem, elem, 1);
18372 xmlResetLastError();
18373 if (mem_base != xmlMemBlocks()) {
18374 printf("Leak of %d blocks found in xmlAddPrevSibling",
18375 xmlMemBlocks() - mem_base);
18377 printf(" %d", n_cur);
18378 printf(" %d", n_elem);
18391 test_xmlAddSibling(void) {
18395 xmlNodePtr ret_val;
18396 xmlNodePtr cur; /* the child node */
18398 xmlNodePtr elem; /* the new node */
18401 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18402 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18403 mem_base = xmlMemBlocks();
18404 cur = gen_xmlNodePtr(n_cur, 0);
18405 elem = gen_xmlNodePtr_in(n_elem, 1);
18407 ret_val = xmlAddSibling(cur, elem);
18408 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18409 desret_xmlNodePtr(ret_val);
18411 des_xmlNodePtr(n_cur, cur, 0);
18412 des_xmlNodePtr_in(n_elem, elem, 1);
18413 xmlResetLastError();
18414 if (mem_base != xmlMemBlocks()) {
18415 printf("Leak of %d blocks found in xmlAddSibling",
18416 xmlMemBlocks() - mem_base);
18418 printf(" %d", n_cur);
18419 printf(" %d", n_elem);
18431 test_xmlAttrSerializeTxtContent(void) {
18434 #if defined(LIBXML_OUTPUT_ENABLED)
18435 #ifdef LIBXML_OUTPUT_ENABLED
18437 xmlBufferPtr buf; /* the XML buffer output */
18439 xmlDocPtr doc; /* the document */
18441 xmlAttrPtr attr; /* the attribute node */
18443 xmlChar * string; /* the text content */
18446 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18447 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18448 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18449 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18450 mem_base = xmlMemBlocks();
18451 buf = gen_xmlBufferPtr(n_buf, 0);
18452 doc = gen_xmlDocPtr(n_doc, 1);
18453 attr = gen_xmlAttrPtr(n_attr, 2);
18454 string = gen_const_xmlChar_ptr(n_string, 3);
18456 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18458 des_xmlBufferPtr(n_buf, buf, 0);
18459 des_xmlDocPtr(n_doc, doc, 1);
18460 des_xmlAttrPtr(n_attr, attr, 2);
18461 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18462 xmlResetLastError();
18463 if (mem_base != xmlMemBlocks()) {
18464 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18465 xmlMemBlocks() - mem_base);
18467 printf(" %d", n_buf);
18468 printf(" %d", n_doc);
18469 printf(" %d", n_attr);
18470 printf(" %d", n_string);
18485 #define gen_nb_const_xmlBuf_ptr 1
18486 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18489 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18493 test_xmlBufContent(void) {
18498 xmlBuf * buf; /* the buffer */
18501 for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
18502 mem_base = xmlMemBlocks();
18503 buf = gen_const_xmlBuf_ptr(n_buf, 0);
18505 ret_val = xmlBufContent((const xmlBuf *)buf);
18506 desret_xmlChar_ptr(ret_val);
18508 des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
18509 xmlResetLastError();
18510 if (mem_base != xmlMemBlocks()) {
18511 printf("Leak of %d blocks found in xmlBufContent",
18512 xmlMemBlocks() - mem_base);
18514 printf(" %d", n_buf);
18524 #define gen_nb_xmlBufPtr 1
18525 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18528 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18532 test_xmlBufEnd(void) {
18537 xmlBufPtr buf; /* the buffer */
18540 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18541 mem_base = xmlMemBlocks();
18542 buf = gen_xmlBufPtr(n_buf, 0);
18544 ret_val = xmlBufEnd(buf);
18545 desret_xmlChar_ptr(ret_val);
18547 des_xmlBufPtr(n_buf, buf, 0);
18548 xmlResetLastError();
18549 if (mem_base != xmlMemBlocks()) {
18550 printf("Leak of %d blocks found in xmlBufEnd",
18551 xmlMemBlocks() - mem_base);
18553 printf(" %d", n_buf);
18563 #define gen_nb_const_xmlNode_ptr 1
18564 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18567 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18571 test_xmlBufGetNodeContent(void) {
18576 xmlBufPtr buf; /* a buffer xmlBufPtr */
18578 xmlNode * cur; /* the node being read */
18581 for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18582 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
18583 mem_base = xmlMemBlocks();
18584 buf = gen_xmlBufPtr(n_buf, 0);
18585 cur = gen_const_xmlNode_ptr(n_cur, 1);
18587 ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
18588 desret_int(ret_val);
18590 des_xmlBufPtr(n_buf, buf, 0);
18591 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
18592 xmlResetLastError();
18593 if (mem_base != xmlMemBlocks()) {
18594 printf("Leak of %d blocks found in xmlBufGetNodeContent",
18595 xmlMemBlocks() - mem_base);
18597 printf(" %d", n_buf);
18598 printf(" %d", n_cur);
18610 test_xmlBufNodeDump(void) {
18614 /* missing type support */
18620 test_xmlBufShrink(void) {
18624 /* missing type support */
18629 #define gen_nb_const_xmlBufPtr 1
18630 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18633 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18637 test_xmlBufUse(void) {
18641 /* missing type support */
18647 test_xmlBufferAdd(void) {
18652 xmlBufferPtr buf; /* the buffer to dump */
18654 xmlChar * str; /* the #xmlChar string */
18656 int len; /* the number of #xmlChar to add */
18659 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18660 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18661 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18662 mem_base = xmlMemBlocks();
18663 buf = gen_xmlBufferPtr(n_buf, 0);
18664 str = gen_const_xmlChar_ptr(n_str, 1);
18665 len = gen_int(n_len, 2);
18666 if ((str != NULL) &&
18667 (len > (int) strlen((const char *) str) + 1))
18670 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18671 desret_int(ret_val);
18673 des_xmlBufferPtr(n_buf, buf, 0);
18674 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18675 des_int(n_len, len, 2);
18676 xmlResetLastError();
18677 if (mem_base != xmlMemBlocks()) {
18678 printf("Leak of %d blocks found in xmlBufferAdd",
18679 xmlMemBlocks() - mem_base);
18681 printf(" %d", n_buf);
18682 printf(" %d", n_str);
18683 printf(" %d", n_len);
18696 test_xmlBufferAddHead(void) {
18701 xmlBufferPtr buf; /* the buffer */
18703 xmlChar * str; /* the #xmlChar string */
18705 int len; /* the number of #xmlChar to add */
18708 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18709 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18710 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18711 mem_base = xmlMemBlocks();
18712 buf = gen_xmlBufferPtr(n_buf, 0);
18713 str = gen_const_xmlChar_ptr(n_str, 1);
18714 len = gen_int(n_len, 2);
18715 if ((str != NULL) &&
18716 (len > (int) strlen((const char *) str) + 1))
18719 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18720 desret_int(ret_val);
18722 des_xmlBufferPtr(n_buf, buf, 0);
18723 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18724 des_int(n_len, len, 2);
18725 xmlResetLastError();
18726 if (mem_base != xmlMemBlocks()) {
18727 printf("Leak of %d blocks found in xmlBufferAddHead",
18728 xmlMemBlocks() - mem_base);
18730 printf(" %d", n_buf);
18731 printf(" %d", n_str);
18732 printf(" %d", n_len);
18745 test_xmlBufferCCat(void) {
18750 xmlBufferPtr buf; /* the buffer to dump */
18752 char * str; /* the C char string */
18755 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18756 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18757 mem_base = xmlMemBlocks();
18758 buf = gen_xmlBufferPtr(n_buf, 0);
18759 str = gen_const_char_ptr(n_str, 1);
18761 ret_val = xmlBufferCCat(buf, (const char *)str);
18762 desret_int(ret_val);
18764 des_xmlBufferPtr(n_buf, buf, 0);
18765 des_const_char_ptr(n_str, (const char *)str, 1);
18766 xmlResetLastError();
18767 if (mem_base != xmlMemBlocks()) {
18768 printf("Leak of %d blocks found in xmlBufferCCat",
18769 xmlMemBlocks() - mem_base);
18771 printf(" %d", n_buf);
18772 printf(" %d", n_str);
18784 test_xmlBufferCat(void) {
18789 xmlBufferPtr buf; /* the buffer to add to */
18791 xmlChar * str; /* the #xmlChar string */
18794 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18795 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18796 mem_base = xmlMemBlocks();
18797 buf = gen_xmlBufferPtr(n_buf, 0);
18798 str = gen_const_xmlChar_ptr(n_str, 1);
18800 ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18801 desret_int(ret_val);
18803 des_xmlBufferPtr(n_buf, buf, 0);
18804 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18805 xmlResetLastError();
18806 if (mem_base != xmlMemBlocks()) {
18807 printf("Leak of %d blocks found in xmlBufferCat",
18808 xmlMemBlocks() - mem_base);
18810 printf(" %d", n_buf);
18811 printf(" %d", n_str);
18822 #define gen_nb_const_xmlBuffer_ptr 1
18823 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18826 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18830 test_xmlBufferContent(void) {
18834 const xmlChar * ret_val;
18835 xmlBuffer * buf; /* the buffer */
18838 for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18839 mem_base = xmlMemBlocks();
18840 buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18842 ret_val = xmlBufferContent((const xmlBuffer *)buf);
18843 desret_const_xmlChar_ptr(ret_val);
18845 des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
18846 xmlResetLastError();
18847 if (mem_base != xmlMemBlocks()) {
18848 printf("Leak of %d blocks found in xmlBufferContent",
18849 xmlMemBlocks() - mem_base);
18851 printf(" %d", n_buf);
18862 test_xmlBufferCreate(void) {
18866 xmlBufferPtr ret_val;
18868 mem_base = xmlMemBlocks();
18870 ret_val = xmlBufferCreate();
18871 desret_xmlBufferPtr(ret_val);
18873 xmlResetLastError();
18874 if (mem_base != xmlMemBlocks()) {
18875 printf("Leak of %d blocks found in xmlBufferCreate",
18876 xmlMemBlocks() - mem_base);
18887 test_xmlBufferCreateSize(void) {
18891 /* missing type support */
18897 test_xmlBufferCreateStatic(void) {
18901 /* missing type support */
18907 test_xmlBufferDetach(void) {
18912 xmlBufferPtr buf; /* the buffer */
18915 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18916 mem_base = xmlMemBlocks();
18917 buf = gen_xmlBufferPtr(n_buf, 0);
18919 ret_val = xmlBufferDetach(buf);
18920 desret_xmlChar_ptr(ret_val);
18922 des_xmlBufferPtr(n_buf, buf, 0);
18923 xmlResetLastError();
18924 if (mem_base != xmlMemBlocks()) {
18925 printf("Leak of %d blocks found in xmlBufferDetach",
18926 xmlMemBlocks() - mem_base);
18928 printf(" %d", n_buf);
18939 test_xmlBufferEmpty(void) {
18943 xmlBufferPtr buf; /* the buffer */
18946 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18947 mem_base = xmlMemBlocks();
18948 buf = gen_xmlBufferPtr(n_buf, 0);
18950 xmlBufferEmpty(buf);
18952 des_xmlBufferPtr(n_buf, buf, 0);
18953 xmlResetLastError();
18954 if (mem_base != xmlMemBlocks()) {
18955 printf("Leak of %d blocks found in xmlBufferEmpty",
18956 xmlMemBlocks() - mem_base);
18958 printf(" %d", n_buf);
18969 test_xmlBufferGrow(void) {
18974 xmlBufferPtr buf; /* the buffer */
18976 unsigned int len; /* the minimum free size to allocate */
18979 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18980 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18981 mem_base = xmlMemBlocks();
18982 buf = gen_xmlBufferPtr(n_buf, 0);
18983 len = gen_unsigned_int(n_len, 1);
18985 ret_val = xmlBufferGrow(buf, len);
18986 desret_int(ret_val);
18988 des_xmlBufferPtr(n_buf, buf, 0);
18989 des_unsigned_int(n_len, len, 1);
18990 xmlResetLastError();
18991 if (mem_base != xmlMemBlocks()) {
18992 printf("Leak of %d blocks found in xmlBufferGrow",
18993 xmlMemBlocks() - mem_base);
18995 printf(" %d", n_buf);
18996 printf(" %d", n_len);
19008 test_xmlBufferLength(void) {
19013 xmlBuffer * buf; /* the buffer */
19016 for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19017 mem_base = xmlMemBlocks();
19018 buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19020 ret_val = xmlBufferLength((const xmlBuffer *)buf);
19021 desret_int(ret_val);
19023 des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19024 xmlResetLastError();
19025 if (mem_base != xmlMemBlocks()) {
19026 printf("Leak of %d blocks found in xmlBufferLength",
19027 xmlMemBlocks() - mem_base);
19029 printf(" %d", n_buf);
19040 test_xmlBufferResize(void) {
19045 xmlBufferPtr buf; /* the buffer to resize */
19047 unsigned int size; /* the desired size */
19050 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19051 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
19052 mem_base = xmlMemBlocks();
19053 buf = gen_xmlBufferPtr(n_buf, 0);
19054 size = gen_unsigned_int(n_size, 1);
19056 ret_val = xmlBufferResize(buf, size);
19057 desret_int(ret_val);
19059 des_xmlBufferPtr(n_buf, buf, 0);
19060 des_unsigned_int(n_size, size, 1);
19061 xmlResetLastError();
19062 if (mem_base != xmlMemBlocks()) {
19063 printf("Leak of %d blocks found in xmlBufferResize",
19064 xmlMemBlocks() - mem_base);
19066 printf(" %d", n_buf);
19067 printf(" %d", n_size);
19079 test_xmlBufferSetAllocationScheme(void) {
19083 xmlBufferPtr buf; /* the buffer to tune */
19085 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
19088 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19089 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
19090 mem_base = xmlMemBlocks();
19091 buf = gen_xmlBufferPtr(n_buf, 0);
19092 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
19094 xmlBufferSetAllocationScheme(buf, scheme);
19095 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
19097 des_xmlBufferPtr(n_buf, buf, 0);
19098 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19099 xmlResetLastError();
19100 if (mem_base != xmlMemBlocks()) {
19101 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19102 xmlMemBlocks() - mem_base);
19104 printf(" %d", n_buf);
19105 printf(" %d", n_scheme);
19117 test_xmlBufferShrink(void) {
19122 xmlBufferPtr buf; /* the buffer to dump */
19124 unsigned int len; /* the number of xmlChar to remove */
19127 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19128 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19129 mem_base = xmlMemBlocks();
19130 buf = gen_xmlBufferPtr(n_buf, 0);
19131 len = gen_unsigned_int(n_len, 1);
19133 ret_val = xmlBufferShrink(buf, len);
19134 desret_int(ret_val);
19136 des_xmlBufferPtr(n_buf, buf, 0);
19137 des_unsigned_int(n_len, len, 1);
19138 xmlResetLastError();
19139 if (mem_base != xmlMemBlocks()) {
19140 printf("Leak of %d blocks found in xmlBufferShrink",
19141 xmlMemBlocks() - mem_base);
19143 printf(" %d", n_buf);
19144 printf(" %d", n_len);
19156 test_xmlBufferWriteCHAR(void) {
19160 xmlBufferPtr buf; /* the XML buffer */
19162 xmlChar * string; /* the string to add */
19165 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19166 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19167 mem_base = xmlMemBlocks();
19168 buf = gen_xmlBufferPtr(n_buf, 0);
19169 string = gen_const_xmlChar_ptr(n_string, 1);
19171 xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19173 des_xmlBufferPtr(n_buf, buf, 0);
19174 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19175 xmlResetLastError();
19176 if (mem_base != xmlMemBlocks()) {
19177 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19178 xmlMemBlocks() - mem_base);
19180 printf(" %d", n_buf);
19181 printf(" %d", n_string);
19193 test_xmlBufferWriteChar(void) {
19197 xmlBufferPtr buf; /* the XML buffer output */
19199 char * string; /* the string to add */
19202 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19203 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19204 mem_base = xmlMemBlocks();
19205 buf = gen_xmlBufferPtr(n_buf, 0);
19206 string = gen_const_char_ptr(n_string, 1);
19208 xmlBufferWriteChar(buf, (const char *)string);
19210 des_xmlBufferPtr(n_buf, buf, 0);
19211 des_const_char_ptr(n_string, (const char *)string, 1);
19212 xmlResetLastError();
19213 if (mem_base != xmlMemBlocks()) {
19214 printf("Leak of %d blocks found in xmlBufferWriteChar",
19215 xmlMemBlocks() - mem_base);
19217 printf(" %d", n_buf);
19218 printf(" %d", n_string);
19230 test_xmlBufferWriteQuotedString(void) {
19234 xmlBufferPtr buf; /* the XML buffer output */
19236 xmlChar * string; /* the string to add */
19239 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19240 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19241 mem_base = xmlMemBlocks();
19242 buf = gen_xmlBufferPtr(n_buf, 0);
19243 string = gen_const_xmlChar_ptr(n_string, 1);
19245 xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19247 des_xmlBufferPtr(n_buf, buf, 0);
19248 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19249 xmlResetLastError();
19250 if (mem_base != xmlMemBlocks()) {
19251 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19252 xmlMemBlocks() - mem_base);
19254 printf(" %d", n_buf);
19255 printf(" %d", n_string);
19267 test_xmlBuildQName(void) {
19272 xmlChar * ncname; /* the Name */
19274 xmlChar * prefix; /* the prefix */
19276 xmlChar * memory; /* preallocated memory */
19278 int len; /* preallocated memory length */
19281 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19282 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19283 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19284 for (n_len = 0;n_len < gen_nb_int;n_len++) {
19285 mem_base = xmlMemBlocks();
19286 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19287 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19288 memory = gen_xmlChar_ptr(n_memory, 2);
19289 len = gen_int(n_len, 3);
19290 if ((prefix != NULL) &&
19291 (len > (int) strlen((const char *) prefix) + 1))
19294 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19295 if ((ret_val != NULL) && (ret_val != ncname) &&
19296 (ret_val != prefix) && (ret_val != memory))
19299 desret_xmlChar_ptr(ret_val);
19301 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19302 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19303 des_xmlChar_ptr(n_memory, memory, 2);
19304 des_int(n_len, len, 3);
19305 xmlResetLastError();
19306 if (mem_base != xmlMemBlocks()) {
19307 printf("Leak of %d blocks found in xmlBuildQName",
19308 xmlMemBlocks() - mem_base);
19310 printf(" %d", n_ncname);
19311 printf(" %d", n_prefix);
19312 printf(" %d", n_memory);
19313 printf(" %d", n_len);
19327 test_xmlChildElementCount(void) {
19330 #if defined(LIBXML_TREE_ENABLED)
19332 unsigned long ret_val;
19333 xmlNodePtr parent; /* the parent node */
19336 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19337 mem_base = xmlMemBlocks();
19338 parent = gen_xmlNodePtr(n_parent, 0);
19340 ret_val = xmlChildElementCount(parent);
19341 desret_unsigned_long(ret_val);
19343 des_xmlNodePtr(n_parent, parent, 0);
19344 xmlResetLastError();
19345 if (mem_base != xmlMemBlocks()) {
19346 printf("Leak of %d blocks found in xmlChildElementCount",
19347 xmlMemBlocks() - mem_base);
19349 printf(" %d", n_parent);
19361 test_xmlCopyDoc(void) {
19364 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19367 xmlDocPtr doc; /* the document */
19369 int recursive; /* if not zero do a recursive copy. */
19372 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19373 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19374 mem_base = xmlMemBlocks();
19375 doc = gen_xmlDocPtr(n_doc, 0);
19376 recursive = gen_int(n_recursive, 1);
19378 ret_val = xmlCopyDoc(doc, recursive);
19379 desret_xmlDocPtr(ret_val);
19381 des_xmlDocPtr(n_doc, doc, 0);
19382 des_int(n_recursive, recursive, 1);
19383 xmlResetLastError();
19384 if (mem_base != xmlMemBlocks()) {
19385 printf("Leak of %d blocks found in xmlCopyDoc",
19386 xmlMemBlocks() - mem_base);
19388 printf(" %d", n_doc);
19389 printf(" %d", n_recursive);
19402 test_xmlCopyDtd(void) {
19405 #if defined(LIBXML_TREE_ENABLED)
19408 xmlDtdPtr dtd; /* the dtd */
19411 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19412 mem_base = xmlMemBlocks();
19413 dtd = gen_xmlDtdPtr(n_dtd, 0);
19415 ret_val = xmlCopyDtd(dtd);
19416 desret_xmlDtdPtr(ret_val);
19418 des_xmlDtdPtr(n_dtd, dtd, 0);
19419 xmlResetLastError();
19420 if (mem_base != xmlMemBlocks()) {
19421 printf("Leak of %d blocks found in xmlCopyDtd",
19422 xmlMemBlocks() - mem_base);
19424 printf(" %d", n_dtd);
19436 test_xmlCopyNamespace(void) {
19441 xmlNsPtr cur; /* the namespace */
19444 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19445 mem_base = xmlMemBlocks();
19446 cur = gen_xmlNsPtr(n_cur, 0);
19448 ret_val = xmlCopyNamespace(cur);
19449 if (ret_val != NULL) xmlFreeNs(ret_val);
19450 desret_xmlNsPtr(ret_val);
19452 des_xmlNsPtr(n_cur, cur, 0);
19453 xmlResetLastError();
19454 if (mem_base != xmlMemBlocks()) {
19455 printf("Leak of %d blocks found in xmlCopyNamespace",
19456 xmlMemBlocks() - mem_base);
19458 printf(" %d", n_cur);
19469 test_xmlCopyNamespaceList(void) {
19474 xmlNsPtr cur; /* the first namespace */
19477 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19478 mem_base = xmlMemBlocks();
19479 cur = gen_xmlNsPtr(n_cur, 0);
19481 ret_val = xmlCopyNamespaceList(cur);
19482 if (ret_val != NULL) xmlFreeNsList(ret_val);
19483 desret_xmlNsPtr(ret_val);
19485 des_xmlNsPtr(n_cur, cur, 0);
19486 xmlResetLastError();
19487 if (mem_base != xmlMemBlocks()) {
19488 printf("Leak of %d blocks found in xmlCopyNamespaceList",
19489 xmlMemBlocks() - mem_base);
19491 printf(" %d", n_cur);
19502 test_xmlCopyNode(void) {
19506 xmlNodePtr ret_val;
19507 xmlNodePtr node; /* the node */
19509 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19512 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19513 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19514 mem_base = xmlMemBlocks();
19515 node = gen_xmlNodePtr(n_node, 0);
19516 extended = gen_int(n_extended, 1);
19518 ret_val = xmlCopyNode(node, extended);
19519 desret_xmlNodePtr(ret_val);
19521 des_xmlNodePtr(n_node, node, 0);
19522 des_int(n_extended, extended, 1);
19523 xmlResetLastError();
19524 if (mem_base != xmlMemBlocks()) {
19525 printf("Leak of %d blocks found in xmlCopyNode",
19526 xmlMemBlocks() - mem_base);
19528 printf(" %d", n_node);
19529 printf(" %d", n_extended);
19541 test_xmlCopyNodeList(void) {
19545 xmlNodePtr ret_val;
19546 xmlNodePtr node; /* the first node in the list. */
19549 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19550 mem_base = xmlMemBlocks();
19551 node = gen_xmlNodePtr(n_node, 0);
19553 ret_val = xmlCopyNodeList(node);
19554 desret_xmlNodePtr(ret_val);
19556 des_xmlNodePtr(n_node, node, 0);
19557 xmlResetLastError();
19558 if (mem_base != xmlMemBlocks()) {
19559 printf("Leak of %d blocks found in xmlCopyNodeList",
19560 xmlMemBlocks() - mem_base);
19562 printf(" %d", n_node);
19573 test_xmlCopyProp(void) {
19577 xmlAttrPtr ret_val;
19578 xmlNodePtr target; /* the element where the attribute will be grafted */
19580 xmlAttrPtr cur; /* the attribute */
19583 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19584 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19585 mem_base = xmlMemBlocks();
19586 target = gen_xmlNodePtr(n_target, 0);
19587 cur = gen_xmlAttrPtr(n_cur, 1);
19589 ret_val = xmlCopyProp(target, cur);
19590 desret_xmlAttrPtr(ret_val);
19592 des_xmlNodePtr(n_target, target, 0);
19593 des_xmlAttrPtr(n_cur, cur, 1);
19594 xmlResetLastError();
19595 if (mem_base != xmlMemBlocks()) {
19596 printf("Leak of %d blocks found in xmlCopyProp",
19597 xmlMemBlocks() - mem_base);
19599 printf(" %d", n_target);
19600 printf(" %d", n_cur);
19612 test_xmlCopyPropList(void) {
19616 xmlAttrPtr ret_val;
19617 xmlNodePtr target; /* the element where the attributes will be grafted */
19619 xmlAttrPtr cur; /* the first attribute */
19622 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19623 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19624 mem_base = xmlMemBlocks();
19625 target = gen_xmlNodePtr(n_target, 0);
19626 cur = gen_xmlAttrPtr(n_cur, 1);
19628 ret_val = xmlCopyPropList(target, cur);
19629 desret_xmlAttrPtr(ret_val);
19631 des_xmlNodePtr(n_target, target, 0);
19632 des_xmlAttrPtr(n_cur, cur, 1);
19633 xmlResetLastError();
19634 if (mem_base != xmlMemBlocks()) {
19635 printf("Leak of %d blocks found in xmlCopyPropList",
19636 xmlMemBlocks() - mem_base);
19638 printf(" %d", n_target);
19639 printf(" %d", n_cur);
19651 test_xmlCreateIntSubset(void) {
19656 xmlDocPtr doc; /* the document pointer */
19658 xmlChar * name; /* the DTD name */
19660 xmlChar * ExternalID; /* the external (PUBLIC) ID */
19662 xmlChar * SystemID; /* the system ID */
19665 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19666 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19667 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19668 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19669 mem_base = xmlMemBlocks();
19670 doc = gen_xmlDocPtr(n_doc, 0);
19671 name = gen_const_xmlChar_ptr(n_name, 1);
19672 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19673 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19675 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19676 desret_xmlDtdPtr(ret_val);
19678 des_xmlDocPtr(n_doc, doc, 0);
19679 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19680 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19681 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19682 xmlResetLastError();
19683 if (mem_base != xmlMemBlocks()) {
19684 printf("Leak of %d blocks found in xmlCreateIntSubset",
19685 xmlMemBlocks() - mem_base);
19687 printf(" %d", n_doc);
19688 printf(" %d", n_name);
19689 printf(" %d", n_ExternalID);
19690 printf(" %d", n_SystemID);
19703 #define gen_nb_xmlDOMWrapCtxtPtr 1
19704 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19707 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19711 test_xmlDOMWrapAdoptNode(void) {
19716 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19718 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19720 xmlNodePtr node; /* the node to start with */
19722 xmlDocPtr destDoc; /* the destination doc */
19724 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19726 int options; /* option flags */
19729 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19730 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19731 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19732 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19733 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19734 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19735 mem_base = xmlMemBlocks();
19736 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19737 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19738 node = gen_xmlNodePtr(n_node, 2);
19739 destDoc = gen_xmlDocPtr(n_destDoc, 3);
19740 destParent = gen_xmlNodePtr(n_destParent, 4);
19741 options = gen_int(n_options, 5);
19743 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19744 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19745 desret_int(ret_val);
19747 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19748 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19749 des_xmlNodePtr(n_node, node, 2);
19750 des_xmlDocPtr(n_destDoc, destDoc, 3);
19751 des_xmlNodePtr(n_destParent, destParent, 4);
19752 des_int(n_options, options, 5);
19753 xmlResetLastError();
19754 if (mem_base != xmlMemBlocks()) {
19755 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19756 xmlMemBlocks() - mem_base);
19758 printf(" %d", n_ctxt);
19759 printf(" %d", n_sourceDoc);
19760 printf(" %d", n_node);
19761 printf(" %d", n_destDoc);
19762 printf(" %d", n_destParent);
19763 printf(" %d", n_options);
19779 test_xmlDOMWrapCloneNode(void) {
19784 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19786 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19788 xmlNodePtr node; /* the node to start with */
19790 xmlNodePtr * resNode; /* the clone of the given @node */
19792 xmlDocPtr destDoc; /* the destination doc */
19794 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19796 int deep; /* descend into child if set */
19798 int options; /* option flags */
19801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19802 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19803 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19804 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19805 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19806 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19807 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19808 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19809 mem_base = xmlMemBlocks();
19810 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19811 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19812 node = gen_xmlNodePtr(n_node, 2);
19813 resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19814 destDoc = gen_xmlDocPtr(n_destDoc, 4);
19815 destParent = gen_xmlNodePtr(n_destParent, 5);
19816 deep = gen_int(n_deep, 6);
19817 options = gen_int(n_options, 7);
19819 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19820 desret_int(ret_val);
19822 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19823 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19824 des_xmlNodePtr(n_node, node, 2);
19825 des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19826 des_xmlDocPtr(n_destDoc, destDoc, 4);
19827 des_xmlNodePtr(n_destParent, destParent, 5);
19828 des_int(n_deep, deep, 6);
19829 des_int(n_options, options, 7);
19830 xmlResetLastError();
19831 if (mem_base != xmlMemBlocks()) {
19832 printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19833 xmlMemBlocks() - mem_base);
19835 printf(" %d", n_ctxt);
19836 printf(" %d", n_sourceDoc);
19837 printf(" %d", n_node);
19838 printf(" %d", n_resNode);
19839 printf(" %d", n_destDoc);
19840 printf(" %d", n_destParent);
19841 printf(" %d", n_deep);
19842 printf(" %d", n_options);
19860 test_xmlDOMWrapNewCtxt(void) {
19864 /* missing type support */
19870 test_xmlDOMWrapReconcileNamespaces(void) {
19875 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19877 xmlNodePtr elem; /* the element-node */
19879 int options; /* option flags */
19882 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19883 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19884 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19885 mem_base = xmlMemBlocks();
19886 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19887 elem = gen_xmlNodePtr(n_elem, 1);
19888 options = gen_int(n_options, 2);
19890 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19891 desret_int(ret_val);
19893 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19894 des_xmlNodePtr(n_elem, elem, 1);
19895 des_int(n_options, options, 2);
19896 xmlResetLastError();
19897 if (mem_base != xmlMemBlocks()) {
19898 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19899 xmlMemBlocks() - mem_base);
19901 printf(" %d", n_ctxt);
19902 printf(" %d", n_elem);
19903 printf(" %d", n_options);
19916 test_xmlDOMWrapRemoveNode(void) {
19921 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19923 xmlDocPtr doc; /* the doc */
19925 xmlNodePtr node; /* the node to be removed. */
19927 int options; /* set of options, unused at the moment */
19930 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19931 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19932 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19933 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19934 mem_base = xmlMemBlocks();
19935 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19936 doc = gen_xmlDocPtr(n_doc, 1);
19937 node = gen_xmlNodePtr(n_node, 2);
19938 options = gen_int(n_options, 3);
19940 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19941 desret_int(ret_val);
19943 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19944 des_xmlDocPtr(n_doc, doc, 1);
19945 des_xmlNodePtr(n_node, node, 2);
19946 des_int(n_options, options, 3);
19947 xmlResetLastError();
19948 if (mem_base != xmlMemBlocks()) {
19949 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19950 xmlMemBlocks() - mem_base);
19952 printf(" %d", n_ctxt);
19953 printf(" %d", n_doc);
19954 printf(" %d", n_node);
19955 printf(" %d", n_options);
19969 test_xmlDocCopyNode(void) {
19973 xmlNodePtr ret_val;
19974 xmlNodePtr node; /* the node */
19976 xmlDocPtr doc; /* the document */
19978 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19981 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19982 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19983 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19984 mem_base = xmlMemBlocks();
19985 node = gen_xmlNodePtr(n_node, 0);
19986 doc = gen_xmlDocPtr(n_doc, 1);
19987 extended = gen_int(n_extended, 2);
19989 ret_val = xmlDocCopyNode(node, doc, extended);
19990 desret_xmlNodePtr(ret_val);
19992 des_xmlNodePtr(n_node, node, 0);
19993 des_xmlDocPtr(n_doc, doc, 1);
19994 des_int(n_extended, extended, 2);
19995 xmlResetLastError();
19996 if (mem_base != xmlMemBlocks()) {
19997 printf("Leak of %d blocks found in xmlDocCopyNode",
19998 xmlMemBlocks() - mem_base);
20000 printf(" %d", n_node);
20001 printf(" %d", n_doc);
20002 printf(" %d", n_extended);
20015 test_xmlDocCopyNodeList(void) {
20019 xmlNodePtr ret_val;
20020 xmlDocPtr doc; /* the target document */
20022 xmlNodePtr node; /* the first node in the list. */
20025 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20026 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20027 mem_base = xmlMemBlocks();
20028 doc = gen_xmlDocPtr(n_doc, 0);
20029 node = gen_xmlNodePtr(n_node, 1);
20031 ret_val = xmlDocCopyNodeList(doc, node);
20032 desret_xmlNodePtr(ret_val);
20034 des_xmlDocPtr(n_doc, doc, 0);
20035 des_xmlNodePtr(n_node, node, 1);
20036 xmlResetLastError();
20037 if (mem_base != xmlMemBlocks()) {
20038 printf("Leak of %d blocks found in xmlDocCopyNodeList",
20039 xmlMemBlocks() - mem_base);
20041 printf(" %d", n_doc);
20042 printf(" %d", n_node);
20054 test_xmlDocDump(void) {
20057 #if defined(LIBXML_OUTPUT_ENABLED)
20060 FILE * f; /* the FILE* */
20062 xmlDocPtr cur; /* the document */
20065 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20066 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20067 mem_base = xmlMemBlocks();
20068 f = gen_FILE_ptr(n_f, 0);
20069 cur = gen_xmlDocPtr(n_cur, 1);
20071 ret_val = xmlDocDump(f, cur);
20072 desret_int(ret_val);
20074 des_FILE_ptr(n_f, f, 0);
20075 des_xmlDocPtr(n_cur, cur, 1);
20076 xmlResetLastError();
20077 if (mem_base != xmlMemBlocks()) {
20078 printf("Leak of %d blocks found in xmlDocDump",
20079 xmlMemBlocks() - mem_base);
20081 printf(" %d", n_f);
20082 printf(" %d", n_cur);
20095 test_xmlDocDumpFormatMemory(void) {
20098 #if defined(LIBXML_OUTPUT_ENABLED)
20100 xmlDocPtr cur; /* the document */
20102 xmlChar ** mem; /* OUT: the memory pointer */
20104 int * size; /* OUT: the memory length */
20106 int format; /* should formatting spaces been added */
20109 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20110 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20111 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20112 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20113 mem_base = xmlMemBlocks();
20114 cur = gen_xmlDocPtr(n_cur, 0);
20115 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20116 size = gen_int_ptr(n_size, 2);
20117 format = gen_int(n_format, 3);
20119 xmlDocDumpFormatMemory(cur, mem, size, format);
20121 des_xmlDocPtr(n_cur, cur, 0);
20122 des_xmlChar_ptr_ptr(n_mem, mem, 1);
20123 des_int_ptr(n_size, size, 2);
20124 des_int(n_format, format, 3);
20125 xmlResetLastError();
20126 if (mem_base != xmlMemBlocks()) {
20127 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20128 xmlMemBlocks() - mem_base);
20130 printf(" %d", n_cur);
20131 printf(" %d", n_mem);
20132 printf(" %d", n_size);
20133 printf(" %d", n_format);
20148 test_xmlDocDumpFormatMemoryEnc(void) {
20151 #if defined(LIBXML_OUTPUT_ENABLED)
20153 xmlDocPtr out_doc; /* Document to generate XML text from */
20155 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20157 int * doc_txt_len; /* Length of the generated XML text */
20159 char * txt_encoding; /* Character encoding to use when generating XML text */
20160 int n_txt_encoding;
20161 int format; /* should formatting spaces been added */
20164 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20165 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20166 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20167 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20168 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20169 mem_base = xmlMemBlocks();
20170 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20171 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20172 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20173 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20174 format = gen_int(n_format, 4);
20176 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
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 des_int(n_format, format, 4);
20183 xmlResetLastError();
20184 if (mem_base != xmlMemBlocks()) {
20185 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20186 xmlMemBlocks() - mem_base);
20188 printf(" %d", n_out_doc);
20189 printf(" %d", n_doc_txt_ptr);
20190 printf(" %d", n_doc_txt_len);
20191 printf(" %d", n_txt_encoding);
20192 printf(" %d", n_format);
20208 test_xmlDocDumpMemory(void) {
20211 #if defined(LIBXML_OUTPUT_ENABLED)
20213 xmlDocPtr cur; /* the document */
20215 xmlChar ** mem; /* OUT: the memory pointer */
20217 int * size; /* OUT: the memory length */
20220 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20221 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20222 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20223 mem_base = xmlMemBlocks();
20224 cur = gen_xmlDocPtr(n_cur, 0);
20225 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20226 size = gen_int_ptr(n_size, 2);
20228 xmlDocDumpMemory(cur, mem, size);
20230 des_xmlDocPtr(n_cur, cur, 0);
20231 des_xmlChar_ptr_ptr(n_mem, mem, 1);
20232 des_int_ptr(n_size, size, 2);
20233 xmlResetLastError();
20234 if (mem_base != xmlMemBlocks()) {
20235 printf("Leak of %d blocks found in xmlDocDumpMemory",
20236 xmlMemBlocks() - mem_base);
20238 printf(" %d", n_cur);
20239 printf(" %d", n_mem);
20240 printf(" %d", n_size);
20254 test_xmlDocDumpMemoryEnc(void) {
20257 #if defined(LIBXML_OUTPUT_ENABLED)
20259 xmlDocPtr out_doc; /* Document to generate XML text from */
20261 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20263 int * doc_txt_len; /* Length of the generated XML text */
20265 char * txt_encoding; /* Character encoding to use when generating XML text */
20266 int n_txt_encoding;
20268 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20269 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20270 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20271 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20272 mem_base = xmlMemBlocks();
20273 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20274 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20275 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20276 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20278 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20280 des_xmlDocPtr(n_out_doc, out_doc, 0);
20281 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20282 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20283 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20284 xmlResetLastError();
20285 if (mem_base != xmlMemBlocks()) {
20286 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20287 xmlMemBlocks() - mem_base);
20289 printf(" %d", n_out_doc);
20290 printf(" %d", n_doc_txt_ptr);
20291 printf(" %d", n_doc_txt_len);
20292 printf(" %d", n_txt_encoding);
20307 test_xmlDocFormatDump(void) {
20310 #if defined(LIBXML_OUTPUT_ENABLED)
20313 FILE * f; /* the FILE* */
20315 xmlDocPtr cur; /* the document */
20317 int format; /* should formatting spaces been added */
20320 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20321 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20322 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20323 mem_base = xmlMemBlocks();
20324 f = gen_FILE_ptr(n_f, 0);
20325 cur = gen_xmlDocPtr(n_cur, 1);
20326 format = gen_int(n_format, 2);
20328 ret_val = xmlDocFormatDump(f, cur, format);
20329 desret_int(ret_val);
20331 des_FILE_ptr(n_f, f, 0);
20332 des_xmlDocPtr(n_cur, cur, 1);
20333 des_int(n_format, format, 2);
20334 xmlResetLastError();
20335 if (mem_base != xmlMemBlocks()) {
20336 printf("Leak of %d blocks found in xmlDocFormatDump",
20337 xmlMemBlocks() - mem_base);
20339 printf(" %d", n_f);
20340 printf(" %d", n_cur);
20341 printf(" %d", n_format);
20355 test_xmlDocGetRootElement(void) {
20359 xmlNodePtr ret_val;
20360 xmlDoc * doc; /* the document */
20363 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20364 mem_base = xmlMemBlocks();
20365 doc = gen_const_xmlDoc_ptr(n_doc, 0);
20367 ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
20368 desret_xmlNodePtr(ret_val);
20370 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20371 xmlResetLastError();
20372 if (mem_base != xmlMemBlocks()) {
20373 printf("Leak of %d blocks found in xmlDocGetRootElement",
20374 xmlMemBlocks() - mem_base);
20376 printf(" %d", n_doc);
20387 test_xmlDocSetRootElement(void) {
20390 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20392 xmlNodePtr ret_val;
20393 xmlDocPtr doc; /* the document */
20395 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. */
20398 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20399 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20400 mem_base = xmlMemBlocks();
20401 doc = gen_xmlDocPtr(n_doc, 0);
20402 root = gen_xmlNodePtr_in(n_root, 1);
20404 ret_val = xmlDocSetRootElement(doc, root);
20405 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20406 desret_xmlNodePtr(ret_val);
20408 des_xmlDocPtr(n_doc, doc, 0);
20409 des_xmlNodePtr_in(n_root, root, 1);
20410 xmlResetLastError();
20411 if (mem_base != xmlMemBlocks()) {
20412 printf("Leak of %d blocks found in xmlDocSetRootElement",
20413 xmlMemBlocks() - mem_base);
20415 printf(" %d", n_doc);
20416 printf(" %d", n_root);
20429 test_xmlElemDump(void) {
20432 #if defined(LIBXML_OUTPUT_ENABLED)
20434 FILE * f; /* the FILE * for the output */
20436 xmlDocPtr doc; /* the document */
20438 xmlNodePtr cur; /* the current node */
20441 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20442 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20443 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20444 mem_base = xmlMemBlocks();
20445 f = gen_FILE_ptr(n_f, 0);
20446 doc = gen_xmlDocPtr(n_doc, 1);
20447 cur = gen_xmlNodePtr(n_cur, 2);
20449 xmlElemDump(f, doc, cur);
20451 des_FILE_ptr(n_f, f, 0);
20452 des_xmlDocPtr(n_doc, doc, 1);
20453 des_xmlNodePtr(n_cur, cur, 2);
20454 xmlResetLastError();
20455 if (mem_base != xmlMemBlocks()) {
20456 printf("Leak of %d blocks found in xmlElemDump",
20457 xmlMemBlocks() - mem_base);
20459 printf(" %d", n_f);
20460 printf(" %d", n_doc);
20461 printf(" %d", n_cur);
20475 test_xmlFirstElementChild(void) {
20478 #if defined(LIBXML_TREE_ENABLED)
20480 xmlNodePtr ret_val;
20481 xmlNodePtr parent; /* the parent node */
20484 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20485 mem_base = xmlMemBlocks();
20486 parent = gen_xmlNodePtr(n_parent, 0);
20488 ret_val = xmlFirstElementChild(parent);
20489 desret_xmlNodePtr(ret_val);
20491 des_xmlNodePtr(n_parent, parent, 0);
20492 xmlResetLastError();
20493 if (mem_base != xmlMemBlocks()) {
20494 printf("Leak of %d blocks found in xmlFirstElementChild",
20495 xmlMemBlocks() - mem_base);
20497 printf(" %d", n_parent);
20509 test_xmlGetBufferAllocationScheme(void) {
20513 xmlBufferAllocationScheme ret_val;
20515 mem_base = xmlMemBlocks();
20517 ret_val = xmlGetBufferAllocationScheme();
20518 desret_xmlBufferAllocationScheme(ret_val);
20520 xmlResetLastError();
20521 if (mem_base != xmlMemBlocks()) {
20522 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20523 xmlMemBlocks() - mem_base);
20534 test_xmlGetCompressMode(void) {
20540 mem_base = xmlMemBlocks();
20542 ret_val = xmlGetCompressMode();
20543 desret_int(ret_val);
20545 xmlResetLastError();
20546 if (mem_base != xmlMemBlocks()) {
20547 printf("Leak of %d blocks found in xmlGetCompressMode",
20548 xmlMemBlocks() - mem_base);
20559 test_xmlGetDocCompressMode(void) {
20564 xmlDoc * doc; /* the document */
20567 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20568 mem_base = xmlMemBlocks();
20569 doc = gen_const_xmlDoc_ptr(n_doc, 0);
20571 ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
20572 desret_int(ret_val);
20574 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20575 xmlResetLastError();
20576 if (mem_base != xmlMemBlocks()) {
20577 printf("Leak of %d blocks found in xmlGetDocCompressMode",
20578 xmlMemBlocks() - mem_base);
20580 printf(" %d", n_doc);
20591 test_xmlGetIntSubset(void) {
20596 xmlDoc * doc; /* the document pointer */
20599 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20600 mem_base = xmlMemBlocks();
20601 doc = gen_const_xmlDoc_ptr(n_doc, 0);
20603 ret_val = xmlGetIntSubset((const xmlDoc *)doc);
20604 desret_xmlDtdPtr(ret_val);
20606 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20607 xmlResetLastError();
20608 if (mem_base != xmlMemBlocks()) {
20609 printf("Leak of %d blocks found in xmlGetIntSubset",
20610 xmlMemBlocks() - mem_base);
20612 printf(" %d", n_doc);
20623 test_xmlGetLastChild(void) {
20627 xmlNodePtr ret_val;
20628 xmlNode * parent; /* the parent node */
20631 for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
20632 mem_base = xmlMemBlocks();
20633 parent = gen_const_xmlNode_ptr(n_parent, 0);
20635 ret_val = xmlGetLastChild((const xmlNode *)parent);
20636 desret_xmlNodePtr(ret_val);
20638 des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
20639 xmlResetLastError();
20640 if (mem_base != xmlMemBlocks()) {
20641 printf("Leak of %d blocks found in xmlGetLastChild",
20642 xmlMemBlocks() - mem_base);
20644 printf(" %d", n_parent);
20655 test_xmlGetLineNo(void) {
20660 xmlNode * node; /* valid node */
20663 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20664 mem_base = xmlMemBlocks();
20665 node = gen_const_xmlNode_ptr(n_node, 0);
20667 ret_val = xmlGetLineNo((const xmlNode *)node);
20668 desret_long(ret_val);
20670 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20671 xmlResetLastError();
20672 if (mem_base != xmlMemBlocks()) {
20673 printf("Leak of %d blocks found in xmlGetLineNo",
20674 xmlMemBlocks() - mem_base);
20676 printf(" %d", n_node);
20687 test_xmlGetNoNsProp(void) {
20692 xmlNode * node; /* the node */
20694 xmlChar * name; /* the attribute name */
20697 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20698 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20699 mem_base = xmlMemBlocks();
20700 node = gen_const_xmlNode_ptr(n_node, 0);
20701 name = gen_const_xmlChar_ptr(n_name, 1);
20703 ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
20704 desret_xmlChar_ptr(ret_val);
20706 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20707 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20708 xmlResetLastError();
20709 if (mem_base != xmlMemBlocks()) {
20710 printf("Leak of %d blocks found in xmlGetNoNsProp",
20711 xmlMemBlocks() - mem_base);
20713 printf(" %d", n_node);
20714 printf(" %d", n_name);
20726 test_xmlGetNodePath(void) {
20729 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20732 xmlNode * node; /* a node */
20735 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20736 mem_base = xmlMemBlocks();
20737 node = gen_const_xmlNode_ptr(n_node, 0);
20739 ret_val = xmlGetNodePath((const xmlNode *)node);
20740 desret_xmlChar_ptr(ret_val);
20742 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20743 xmlResetLastError();
20744 if (mem_base != xmlMemBlocks()) {
20745 printf("Leak of %d blocks found in xmlGetNodePath",
20746 xmlMemBlocks() - mem_base);
20748 printf(" %d", n_node);
20760 test_xmlGetNsList(void) {
20764 /* missing type support */
20770 test_xmlGetNsProp(void) {
20775 xmlNode * node; /* the node */
20777 xmlChar * name; /* the attribute name */
20779 xmlChar * nameSpace; /* the URI of the namespace */
20782 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20783 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20784 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20785 mem_base = xmlMemBlocks();
20786 node = gen_const_xmlNode_ptr(n_node, 0);
20787 name = gen_const_xmlChar_ptr(n_name, 1);
20788 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20790 ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20791 desret_xmlChar_ptr(ret_val);
20793 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20794 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20795 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20796 xmlResetLastError();
20797 if (mem_base != xmlMemBlocks()) {
20798 printf("Leak of %d blocks found in xmlGetNsProp",
20799 xmlMemBlocks() - mem_base);
20801 printf(" %d", n_node);
20802 printf(" %d", n_name);
20803 printf(" %d", n_nameSpace);
20816 test_xmlGetProp(void) {
20821 xmlNode * node; /* the node */
20823 xmlChar * name; /* the attribute name */
20826 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20827 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20828 mem_base = xmlMemBlocks();
20829 node = gen_const_xmlNode_ptr(n_node, 0);
20830 name = gen_const_xmlChar_ptr(n_name, 1);
20832 ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
20833 desret_xmlChar_ptr(ret_val);
20835 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20836 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20837 xmlResetLastError();
20838 if (mem_base != xmlMemBlocks()) {
20839 printf("Leak of %d blocks found in xmlGetProp",
20840 xmlMemBlocks() - mem_base);
20842 printf(" %d", n_node);
20843 printf(" %d", n_name);
20855 test_xmlHasNsProp(void) {
20859 xmlAttrPtr ret_val;
20860 xmlNode * node; /* the node */
20862 xmlChar * name; /* the attribute name */
20864 xmlChar * nameSpace; /* the URI of the namespace */
20867 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20868 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20869 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20870 mem_base = xmlMemBlocks();
20871 node = gen_const_xmlNode_ptr(n_node, 0);
20872 name = gen_const_xmlChar_ptr(n_name, 1);
20873 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20875 ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20876 desret_xmlAttrPtr(ret_val);
20878 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20879 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20880 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20881 xmlResetLastError();
20882 if (mem_base != xmlMemBlocks()) {
20883 printf("Leak of %d blocks found in xmlHasNsProp",
20884 xmlMemBlocks() - mem_base);
20886 printf(" %d", n_node);
20887 printf(" %d", n_name);
20888 printf(" %d", n_nameSpace);
20901 test_xmlHasProp(void) {
20905 xmlAttrPtr ret_val;
20906 xmlNode * node; /* the node */
20908 xmlChar * name; /* the attribute name */
20911 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20912 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20913 mem_base = xmlMemBlocks();
20914 node = gen_const_xmlNode_ptr(n_node, 0);
20915 name = gen_const_xmlChar_ptr(n_name, 1);
20917 ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
20918 desret_xmlAttrPtr(ret_val);
20920 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20921 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20922 xmlResetLastError();
20923 if (mem_base != xmlMemBlocks()) {
20924 printf("Leak of %d blocks found in xmlHasProp",
20925 xmlMemBlocks() - mem_base);
20927 printf(" %d", n_node);
20928 printf(" %d", n_name);
20940 test_xmlIsBlankNode(void) {
20945 xmlNode * node; /* the node */
20948 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20949 mem_base = xmlMemBlocks();
20950 node = gen_const_xmlNode_ptr(n_node, 0);
20952 ret_val = xmlIsBlankNode((const xmlNode *)node);
20953 desret_int(ret_val);
20955 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20956 xmlResetLastError();
20957 if (mem_base != xmlMemBlocks()) {
20958 printf("Leak of %d blocks found in xmlIsBlankNode",
20959 xmlMemBlocks() - mem_base);
20961 printf(" %d", n_node);
20972 test_xmlIsXHTML(void) {
20977 xmlChar * systemID; /* the system identifier */
20979 xmlChar * publicID; /* the public identifier */
20982 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20983 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20984 mem_base = xmlMemBlocks();
20985 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20986 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20988 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20989 desret_int(ret_val);
20991 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20992 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20993 xmlResetLastError();
20994 if (mem_base != xmlMemBlocks()) {
20995 printf("Leak of %d blocks found in xmlIsXHTML",
20996 xmlMemBlocks() - mem_base);
20998 printf(" %d", n_systemID);
20999 printf(" %d", n_publicID);
21011 test_xmlLastElementChild(void) {
21014 #if defined(LIBXML_TREE_ENABLED)
21016 xmlNodePtr ret_val;
21017 xmlNodePtr parent; /* the parent node */
21020 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21021 mem_base = xmlMemBlocks();
21022 parent = gen_xmlNodePtr(n_parent, 0);
21024 ret_val = xmlLastElementChild(parent);
21025 desret_xmlNodePtr(ret_val);
21027 des_xmlNodePtr(n_parent, parent, 0);
21028 xmlResetLastError();
21029 if (mem_base != xmlMemBlocks()) {
21030 printf("Leak of %d blocks found in xmlLastElementChild",
21031 xmlMemBlocks() - mem_base);
21033 printf(" %d", n_parent);
21045 test_xmlNewCDataBlock(void) {
21049 xmlNodePtr ret_val;
21050 xmlDocPtr doc; /* the document */
21052 xmlChar * content; /* the CDATA block content content */
21054 int len; /* the length of the block */
21057 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21058 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21059 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21060 mem_base = xmlMemBlocks();
21061 doc = gen_xmlDocPtr(n_doc, 0);
21062 content = gen_const_xmlChar_ptr(n_content, 1);
21063 len = gen_int(n_len, 2);
21064 if ((content != NULL) &&
21065 (len > (int) strlen((const char *) content) + 1))
21068 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
21069 desret_xmlNodePtr(ret_val);
21071 des_xmlDocPtr(n_doc, doc, 0);
21072 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21073 des_int(n_len, len, 2);
21074 xmlResetLastError();
21075 if (mem_base != xmlMemBlocks()) {
21076 printf("Leak of %d blocks found in xmlNewCDataBlock",
21077 xmlMemBlocks() - mem_base);
21079 printf(" %d", n_doc);
21080 printf(" %d", n_content);
21081 printf(" %d", n_len);
21094 test_xmlNewCharRef(void) {
21098 xmlNodePtr ret_val;
21099 xmlDocPtr doc; /* the document */
21101 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
21104 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21105 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21106 mem_base = xmlMemBlocks();
21107 doc = gen_xmlDocPtr(n_doc, 0);
21108 name = gen_const_xmlChar_ptr(n_name, 1);
21110 ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21111 desret_xmlNodePtr(ret_val);
21113 des_xmlDocPtr(n_doc, doc, 0);
21114 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21115 xmlResetLastError();
21116 if (mem_base != xmlMemBlocks()) {
21117 printf("Leak of %d blocks found in xmlNewCharRef",
21118 xmlMemBlocks() - mem_base);
21120 printf(" %d", n_doc);
21121 printf(" %d", n_name);
21133 test_xmlNewChild(void) {
21136 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21137 #ifdef LIBXML_TREE_ENABLED
21139 xmlNodePtr ret_val;
21140 xmlNodePtr parent; /* the parent node */
21142 xmlNsPtr ns; /* a namespace if any */
21144 xmlChar * name; /* the name of the child */
21146 xmlChar * content; /* the XML content of the child if any. */
21149 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21150 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21151 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21152 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21153 mem_base = xmlMemBlocks();
21154 parent = gen_xmlNodePtr(n_parent, 0);
21155 ns = gen_xmlNsPtr(n_ns, 1);
21156 name = gen_const_xmlChar_ptr(n_name, 2);
21157 content = gen_const_xmlChar_ptr(n_content, 3);
21159 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21160 desret_xmlNodePtr(ret_val);
21162 des_xmlNodePtr(n_parent, parent, 0);
21163 des_xmlNsPtr(n_ns, ns, 1);
21164 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21165 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21166 xmlResetLastError();
21167 if (mem_base != xmlMemBlocks()) {
21168 printf("Leak of %d blocks found in xmlNewChild",
21169 xmlMemBlocks() - mem_base);
21171 printf(" %d", n_parent);
21172 printf(" %d", n_ns);
21173 printf(" %d", n_name);
21174 printf(" %d", n_content);
21190 test_xmlNewComment(void) {
21194 xmlNodePtr ret_val;
21195 xmlChar * content; /* the comment content */
21198 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21199 mem_base = xmlMemBlocks();
21200 content = gen_const_xmlChar_ptr(n_content, 0);
21202 ret_val = xmlNewComment((const xmlChar *)content);
21203 desret_xmlNodePtr(ret_val);
21205 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21206 xmlResetLastError();
21207 if (mem_base != xmlMemBlocks()) {
21208 printf("Leak of %d blocks found in xmlNewComment",
21209 xmlMemBlocks() - mem_base);
21211 printf(" %d", n_content);
21222 test_xmlNewDoc(void) {
21227 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21230 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21231 mem_base = xmlMemBlocks();
21232 version = gen_const_xmlChar_ptr(n_version, 0);
21234 ret_val = xmlNewDoc((const xmlChar *)version);
21235 desret_xmlDocPtr(ret_val);
21237 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21238 xmlResetLastError();
21239 if (mem_base != xmlMemBlocks()) {
21240 printf("Leak of %d blocks found in xmlNewDoc",
21241 xmlMemBlocks() - mem_base);
21243 printf(" %d", n_version);
21254 test_xmlNewDocComment(void) {
21258 xmlNodePtr ret_val;
21259 xmlDocPtr doc; /* the document */
21261 xmlChar * content; /* the comment content */
21264 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21265 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21266 mem_base = xmlMemBlocks();
21267 doc = gen_xmlDocPtr(n_doc, 0);
21268 content = gen_const_xmlChar_ptr(n_content, 1);
21270 ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21271 desret_xmlNodePtr(ret_val);
21273 des_xmlDocPtr(n_doc, doc, 0);
21274 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21275 xmlResetLastError();
21276 if (mem_base != xmlMemBlocks()) {
21277 printf("Leak of %d blocks found in xmlNewDocComment",
21278 xmlMemBlocks() - mem_base);
21280 printf(" %d", n_doc);
21281 printf(" %d", n_content);
21293 test_xmlNewDocFragment(void) {
21296 #if defined(LIBXML_TREE_ENABLED)
21298 xmlNodePtr ret_val;
21299 xmlDocPtr doc; /* the document owning the fragment */
21302 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21303 mem_base = xmlMemBlocks();
21304 doc = gen_xmlDocPtr(n_doc, 0);
21306 ret_val = xmlNewDocFragment(doc);
21307 desret_xmlNodePtr(ret_val);
21309 des_xmlDocPtr(n_doc, doc, 0);
21310 xmlResetLastError();
21311 if (mem_base != xmlMemBlocks()) {
21312 printf("Leak of %d blocks found in xmlNewDocFragment",
21313 xmlMemBlocks() - mem_base);
21315 printf(" %d", n_doc);
21327 test_xmlNewDocNode(void) {
21331 xmlNodePtr ret_val;
21332 xmlDocPtr doc; /* the document */
21334 xmlNsPtr ns; /* namespace if any */
21336 xmlChar * name; /* the node name */
21338 xmlChar * content; /* the XML text content if any */
21341 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21342 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21343 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21344 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21345 mem_base = xmlMemBlocks();
21346 doc = gen_xmlDocPtr(n_doc, 0);
21347 ns = gen_xmlNsPtr(n_ns, 1);
21348 name = gen_const_xmlChar_ptr(n_name, 2);
21349 content = gen_const_xmlChar_ptr(n_content, 3);
21351 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21352 desret_xmlNodePtr(ret_val);
21354 des_xmlDocPtr(n_doc, doc, 0);
21355 des_xmlNsPtr(n_ns, ns, 1);
21356 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21357 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21358 xmlResetLastError();
21359 if (mem_base != xmlMemBlocks()) {
21360 printf("Leak of %d blocks found in xmlNewDocNode",
21361 xmlMemBlocks() - mem_base);
21363 printf(" %d", n_doc);
21364 printf(" %d", n_ns);
21365 printf(" %d", n_name);
21366 printf(" %d", n_content);
21380 test_xmlNewDocNodeEatName(void) {
21384 xmlNodePtr ret_val;
21385 xmlDocPtr doc; /* the document */
21387 xmlNsPtr ns; /* namespace if any */
21389 xmlChar * name; /* the node name */
21391 xmlChar * content; /* the XML text content if any */
21394 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21395 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21396 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21397 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21398 mem_base = xmlMemBlocks();
21399 doc = gen_xmlDocPtr(n_doc, 0);
21400 ns = gen_xmlNsPtr(n_ns, 1);
21401 name = gen_eaten_name(n_name, 2);
21402 content = gen_const_xmlChar_ptr(n_content, 3);
21404 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21405 desret_xmlNodePtr(ret_val);
21407 des_xmlDocPtr(n_doc, doc, 0);
21408 des_xmlNsPtr(n_ns, ns, 1);
21409 des_eaten_name(n_name, name, 2);
21410 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21411 xmlResetLastError();
21412 if (mem_base != xmlMemBlocks()) {
21413 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21414 xmlMemBlocks() - mem_base);
21416 printf(" %d", n_doc);
21417 printf(" %d", n_ns);
21418 printf(" %d", n_name);
21419 printf(" %d", n_content);
21433 test_xmlNewDocPI(void) {
21437 xmlNodePtr ret_val;
21438 xmlDocPtr doc; /* the target document */
21440 xmlChar * name; /* the processing instruction name */
21442 xmlChar * content; /* the PI content */
21445 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21446 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21447 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21448 mem_base = xmlMemBlocks();
21449 doc = gen_xmlDocPtr(n_doc, 0);
21450 name = gen_const_xmlChar_ptr(n_name, 1);
21451 content = gen_const_xmlChar_ptr(n_content, 2);
21453 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21454 desret_xmlNodePtr(ret_val);
21456 des_xmlDocPtr(n_doc, doc, 0);
21457 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21458 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21459 xmlResetLastError();
21460 if (mem_base != xmlMemBlocks()) {
21461 printf("Leak of %d blocks found in xmlNewDocPI",
21462 xmlMemBlocks() - mem_base);
21464 printf(" %d", n_doc);
21465 printf(" %d", n_name);
21466 printf(" %d", n_content);
21479 test_xmlNewDocProp(void) {
21483 xmlAttrPtr ret_val;
21484 xmlDocPtr doc; /* the document */
21486 xmlChar * name; /* the name of the attribute */
21488 xmlChar * value; /* the value of the attribute */
21491 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21492 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21493 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21494 mem_base = xmlMemBlocks();
21495 doc = gen_xmlDocPtr(n_doc, 0);
21496 name = gen_const_xmlChar_ptr(n_name, 1);
21497 value = gen_const_xmlChar_ptr(n_value, 2);
21499 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21500 desret_xmlAttrPtr(ret_val);
21502 des_xmlDocPtr(n_doc, doc, 0);
21503 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21504 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21505 xmlResetLastError();
21506 if (mem_base != xmlMemBlocks()) {
21507 printf("Leak of %d blocks found in xmlNewDocProp",
21508 xmlMemBlocks() - mem_base);
21510 printf(" %d", n_doc);
21511 printf(" %d", n_name);
21512 printf(" %d", n_value);
21525 test_xmlNewDocRawNode(void) {
21528 #if defined(LIBXML_TREE_ENABLED)
21529 #ifdef LIBXML_TREE_ENABLED
21531 xmlNodePtr ret_val;
21532 xmlDocPtr doc; /* the document */
21534 xmlNsPtr ns; /* namespace if any */
21536 xmlChar * name; /* the node name */
21538 xmlChar * content; /* the text content if any */
21541 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21542 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21543 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21544 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21545 mem_base = xmlMemBlocks();
21546 doc = gen_xmlDocPtr(n_doc, 0);
21547 ns = gen_xmlNsPtr(n_ns, 1);
21548 name = gen_const_xmlChar_ptr(n_name, 2);
21549 content = gen_const_xmlChar_ptr(n_content, 3);
21551 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21552 desret_xmlNodePtr(ret_val);
21554 des_xmlDocPtr(n_doc, doc, 0);
21555 des_xmlNsPtr(n_ns, ns, 1);
21556 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21557 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21558 xmlResetLastError();
21559 if (mem_base != xmlMemBlocks()) {
21560 printf("Leak of %d blocks found in xmlNewDocRawNode",
21561 xmlMemBlocks() - mem_base);
21563 printf(" %d", n_doc);
21564 printf(" %d", n_ns);
21565 printf(" %d", n_name);
21566 printf(" %d", n_content);
21582 test_xmlNewDocText(void) {
21586 xmlNodePtr ret_val;
21587 xmlDoc * doc; /* the document */
21589 xmlChar * content; /* the text content */
21592 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21593 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21594 mem_base = xmlMemBlocks();
21595 doc = gen_const_xmlDoc_ptr(n_doc, 0);
21596 content = gen_const_xmlChar_ptr(n_content, 1);
21598 ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
21599 desret_xmlNodePtr(ret_val);
21601 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21602 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21603 xmlResetLastError();
21604 if (mem_base != xmlMemBlocks()) {
21605 printf("Leak of %d blocks found in xmlNewDocText",
21606 xmlMemBlocks() - mem_base);
21608 printf(" %d", n_doc);
21609 printf(" %d", n_content);
21621 test_xmlNewDocTextLen(void) {
21625 xmlNodePtr ret_val;
21626 xmlDocPtr doc; /* the document */
21628 xmlChar * content; /* the text content */
21630 int len; /* the text len. */
21633 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21634 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21635 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21636 mem_base = xmlMemBlocks();
21637 doc = gen_xmlDocPtr(n_doc, 0);
21638 content = gen_const_xmlChar_ptr(n_content, 1);
21639 len = gen_int(n_len, 2);
21640 if ((content != NULL) &&
21641 (len > (int) strlen((const char *) content) + 1))
21644 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21645 desret_xmlNodePtr(ret_val);
21647 des_xmlDocPtr(n_doc, doc, 0);
21648 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21649 des_int(n_len, len, 2);
21650 xmlResetLastError();
21651 if (mem_base != xmlMemBlocks()) {
21652 printf("Leak of %d blocks found in xmlNewDocTextLen",
21653 xmlMemBlocks() - mem_base);
21655 printf(" %d", n_doc);
21656 printf(" %d", n_content);
21657 printf(" %d", n_len);
21670 test_xmlNewDtd(void) {
21675 xmlDocPtr doc; /* the document pointer */
21677 xmlChar * name; /* the DTD name */
21679 xmlChar * ExternalID; /* the external ID */
21681 xmlChar * SystemID; /* the system ID */
21684 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21685 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21686 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21687 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21688 mem_base = xmlMemBlocks();
21689 doc = gen_xmlDocPtr(n_doc, 0);
21690 name = gen_const_xmlChar_ptr(n_name, 1);
21691 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21692 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21694 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21695 desret_xmlDtdPtr(ret_val);
21697 des_xmlDocPtr(n_doc, doc, 0);
21698 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21699 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21700 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21701 xmlResetLastError();
21702 if (mem_base != xmlMemBlocks()) {
21703 printf("Leak of %d blocks found in xmlNewDtd",
21704 xmlMemBlocks() - mem_base);
21706 printf(" %d", n_doc);
21707 printf(" %d", n_name);
21708 printf(" %d", n_ExternalID);
21709 printf(" %d", n_SystemID);
21723 test_xmlNewNode(void) {
21727 xmlNodePtr ret_val;
21728 xmlNsPtr ns; /* namespace if any */
21730 xmlChar * name; /* the node name */
21733 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21734 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21735 mem_base = xmlMemBlocks();
21736 ns = gen_xmlNsPtr(n_ns, 0);
21737 name = gen_const_xmlChar_ptr(n_name, 1);
21739 ret_val = xmlNewNode(ns, (const xmlChar *)name);
21740 desret_xmlNodePtr(ret_val);
21742 des_xmlNsPtr(n_ns, ns, 0);
21743 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21744 xmlResetLastError();
21745 if (mem_base != xmlMemBlocks()) {
21746 printf("Leak of %d blocks found in xmlNewNode",
21747 xmlMemBlocks() - mem_base);
21749 printf(" %d", n_ns);
21750 printf(" %d", n_name);
21762 test_xmlNewNodeEatName(void) {
21766 xmlNodePtr ret_val;
21767 xmlNsPtr ns; /* namespace if any */
21769 xmlChar * name; /* the node name */
21772 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21773 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21774 mem_base = xmlMemBlocks();
21775 ns = gen_xmlNsPtr(n_ns, 0);
21776 name = gen_eaten_name(n_name, 1);
21778 ret_val = xmlNewNodeEatName(ns, name);
21779 desret_xmlNodePtr(ret_val);
21781 des_xmlNsPtr(n_ns, ns, 0);
21782 des_eaten_name(n_name, name, 1);
21783 xmlResetLastError();
21784 if (mem_base != xmlMemBlocks()) {
21785 printf("Leak of %d blocks found in xmlNewNodeEatName",
21786 xmlMemBlocks() - mem_base);
21788 printf(" %d", n_ns);
21789 printf(" %d", n_name);
21801 test_xmlNewNs(void) {
21806 xmlNodePtr node; /* the element carrying the namespace */
21808 xmlChar * href; /* the URI associated */
21810 xmlChar * prefix; /* the prefix for the namespace */
21813 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21814 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21815 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21816 mem_base = xmlMemBlocks();
21817 node = gen_xmlNodePtr(n_node, 0);
21818 href = gen_const_xmlChar_ptr(n_href, 1);
21819 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21821 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21822 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21823 desret_xmlNsPtr(ret_val);
21825 des_xmlNodePtr(n_node, node, 0);
21826 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21827 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21828 xmlResetLastError();
21829 if (mem_base != xmlMemBlocks()) {
21830 printf("Leak of %d blocks found in xmlNewNs",
21831 xmlMemBlocks() - mem_base);
21833 printf(" %d", n_node);
21834 printf(" %d", n_href);
21835 printf(" %d", n_prefix);
21848 test_xmlNewNsProp(void) {
21852 xmlAttrPtr ret_val;
21853 xmlNodePtr node; /* the holding node */
21855 xmlNsPtr ns; /* the namespace */
21857 xmlChar * name; /* the name of the attribute */
21859 xmlChar * value; /* the value of the attribute */
21862 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21863 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21864 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21865 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21866 mem_base = xmlMemBlocks();
21867 node = gen_xmlNodePtr(n_node, 0);
21868 ns = gen_xmlNsPtr(n_ns, 1);
21869 name = gen_const_xmlChar_ptr(n_name, 2);
21870 value = gen_const_xmlChar_ptr(n_value, 3);
21872 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21873 desret_xmlAttrPtr(ret_val);
21875 des_xmlNodePtr(n_node, node, 0);
21876 des_xmlNsPtr(n_ns, ns, 1);
21877 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21878 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21879 xmlResetLastError();
21880 if (mem_base != xmlMemBlocks()) {
21881 printf("Leak of %d blocks found in xmlNewNsProp",
21882 xmlMemBlocks() - mem_base);
21884 printf(" %d", n_node);
21885 printf(" %d", n_ns);
21886 printf(" %d", n_name);
21887 printf(" %d", n_value);
21901 test_xmlNewNsPropEatName(void) {
21905 xmlAttrPtr ret_val;
21906 xmlNodePtr node; /* the holding node */
21908 xmlNsPtr ns; /* the namespace */
21910 xmlChar * name; /* the name of the attribute */
21912 xmlChar * value; /* the value of the attribute */
21915 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21916 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21917 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21918 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21919 mem_base = xmlMemBlocks();
21920 node = gen_xmlNodePtr(n_node, 0);
21921 ns = gen_xmlNsPtr(n_ns, 1);
21922 name = gen_eaten_name(n_name, 2);
21923 value = gen_const_xmlChar_ptr(n_value, 3);
21925 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21926 desret_xmlAttrPtr(ret_val);
21928 des_xmlNodePtr(n_node, node, 0);
21929 des_xmlNsPtr(n_ns, ns, 1);
21930 des_eaten_name(n_name, name, 2);
21931 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21932 xmlResetLastError();
21933 if (mem_base != xmlMemBlocks()) {
21934 printf("Leak of %d blocks found in xmlNewNsPropEatName",
21935 xmlMemBlocks() - mem_base);
21937 printf(" %d", n_node);
21938 printf(" %d", n_ns);
21939 printf(" %d", n_name);
21940 printf(" %d", n_value);
21954 test_xmlNewPI(void) {
21958 xmlNodePtr ret_val;
21959 xmlChar * name; /* the processing instruction name */
21961 xmlChar * content; /* the PI content */
21964 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21965 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21966 mem_base = xmlMemBlocks();
21967 name = gen_const_xmlChar_ptr(n_name, 0);
21968 content = gen_const_xmlChar_ptr(n_content, 1);
21970 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21971 desret_xmlNodePtr(ret_val);
21973 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21974 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21975 xmlResetLastError();
21976 if (mem_base != xmlMemBlocks()) {
21977 printf("Leak of %d blocks found in xmlNewPI",
21978 xmlMemBlocks() - mem_base);
21980 printf(" %d", n_name);
21981 printf(" %d", n_content);
21993 test_xmlNewProp(void) {
21996 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21997 #ifdef LIBXML_TREE_ENABLED
21999 xmlAttrPtr ret_val;
22000 xmlNodePtr node; /* the holding node */
22002 xmlChar * name; /* the name of the attribute */
22004 xmlChar * value; /* the value of the attribute */
22007 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22008 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22009 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22010 mem_base = xmlMemBlocks();
22011 node = gen_xmlNodePtr(n_node, 0);
22012 name = gen_const_xmlChar_ptr(n_name, 1);
22013 value = gen_const_xmlChar_ptr(n_value, 2);
22015 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
22016 desret_xmlAttrPtr(ret_val);
22018 des_xmlNodePtr(n_node, node, 0);
22019 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22020 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22021 xmlResetLastError();
22022 if (mem_base != xmlMemBlocks()) {
22023 printf("Leak of %d blocks found in xmlNewProp",
22024 xmlMemBlocks() - mem_base);
22026 printf(" %d", n_node);
22027 printf(" %d", n_name);
22028 printf(" %d", n_value);
22043 test_xmlNewReference(void) {
22047 xmlNodePtr ret_val;
22048 xmlDoc * doc; /* the document */
22050 xmlChar * name; /* the reference name, or the reference string with & and ; */
22053 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22054 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22055 mem_base = xmlMemBlocks();
22056 doc = gen_const_xmlDoc_ptr(n_doc, 0);
22057 name = gen_const_xmlChar_ptr(n_name, 1);
22059 ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
22060 desret_xmlNodePtr(ret_val);
22062 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22063 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22064 xmlResetLastError();
22065 if (mem_base != xmlMemBlocks()) {
22066 printf("Leak of %d blocks found in xmlNewReference",
22067 xmlMemBlocks() - mem_base);
22069 printf(" %d", n_doc);
22070 printf(" %d", n_name);
22082 test_xmlNewText(void) {
22086 xmlNodePtr ret_val;
22087 xmlChar * content; /* the text content */
22090 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22091 mem_base = xmlMemBlocks();
22092 content = gen_const_xmlChar_ptr(n_content, 0);
22094 ret_val = xmlNewText((const xmlChar *)content);
22095 desret_xmlNodePtr(ret_val);
22097 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22098 xmlResetLastError();
22099 if (mem_base != xmlMemBlocks()) {
22100 printf("Leak of %d blocks found in xmlNewText",
22101 xmlMemBlocks() - mem_base);
22103 printf(" %d", n_content);
22114 test_xmlNewTextChild(void) {
22117 #if defined(LIBXML_TREE_ENABLED)
22118 #ifdef LIBXML_TREE_ENABLED
22120 xmlNodePtr ret_val;
22121 xmlNodePtr parent; /* the parent node */
22123 xmlNsPtr ns; /* a namespace if any */
22125 xmlChar * name; /* the name of the child */
22127 xmlChar * content; /* the text content of the child if any. */
22130 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22131 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22132 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22133 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22134 mem_base = xmlMemBlocks();
22135 parent = gen_xmlNodePtr(n_parent, 0);
22136 ns = gen_xmlNsPtr(n_ns, 1);
22137 name = gen_const_xmlChar_ptr(n_name, 2);
22138 content = gen_const_xmlChar_ptr(n_content, 3);
22140 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22141 desret_xmlNodePtr(ret_val);
22143 des_xmlNodePtr(n_parent, parent, 0);
22144 des_xmlNsPtr(n_ns, ns, 1);
22145 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22146 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22147 xmlResetLastError();
22148 if (mem_base != xmlMemBlocks()) {
22149 printf("Leak of %d blocks found in xmlNewTextChild",
22150 xmlMemBlocks() - mem_base);
22152 printf(" %d", n_parent);
22153 printf(" %d", n_ns);
22154 printf(" %d", n_name);
22155 printf(" %d", n_content);
22171 test_xmlNewTextLen(void) {
22175 xmlNodePtr ret_val;
22176 xmlChar * content; /* the text content */
22178 int len; /* the text len. */
22181 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22182 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22183 mem_base = xmlMemBlocks();
22184 content = gen_const_xmlChar_ptr(n_content, 0);
22185 len = gen_int(n_len, 1);
22186 if ((content != NULL) &&
22187 (len > (int) strlen((const char *) content) + 1))
22190 ret_val = xmlNewTextLen((const xmlChar *)content, len);
22191 desret_xmlNodePtr(ret_val);
22193 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22194 des_int(n_len, len, 1);
22195 xmlResetLastError();
22196 if (mem_base != xmlMemBlocks()) {
22197 printf("Leak of %d blocks found in xmlNewTextLen",
22198 xmlMemBlocks() - mem_base);
22200 printf(" %d", n_content);
22201 printf(" %d", n_len);
22213 test_xmlNextElementSibling(void) {
22216 #if defined(LIBXML_TREE_ENABLED)
22218 xmlNodePtr ret_val;
22219 xmlNodePtr node; /* the current node */
22222 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22223 mem_base = xmlMemBlocks();
22224 node = gen_xmlNodePtr(n_node, 0);
22226 ret_val = xmlNextElementSibling(node);
22227 desret_xmlNodePtr(ret_val);
22229 des_xmlNodePtr(n_node, node, 0);
22230 xmlResetLastError();
22231 if (mem_base != xmlMemBlocks()) {
22232 printf("Leak of %d blocks found in xmlNextElementSibling",
22233 xmlMemBlocks() - mem_base);
22235 printf(" %d", n_node);
22247 test_xmlNodeAddContent(void) {
22251 xmlNodePtr cur; /* the node being modified */
22253 xmlChar * content; /* extra content */
22256 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22257 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22258 mem_base = xmlMemBlocks();
22259 cur = gen_xmlNodePtr(n_cur, 0);
22260 content = gen_const_xmlChar_ptr(n_content, 1);
22262 xmlNodeAddContent(cur, (const xmlChar *)content);
22264 des_xmlNodePtr(n_cur, cur, 0);
22265 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22266 xmlResetLastError();
22267 if (mem_base != xmlMemBlocks()) {
22268 printf("Leak of %d blocks found in xmlNodeAddContent",
22269 xmlMemBlocks() - mem_base);
22271 printf(" %d", n_cur);
22272 printf(" %d", n_content);
22284 test_xmlNodeAddContentLen(void) {
22288 xmlNodePtr cur; /* the node being modified */
22290 xmlChar * content; /* extra content */
22292 int len; /* the size of @content */
22295 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22296 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22297 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22298 mem_base = xmlMemBlocks();
22299 cur = gen_xmlNodePtr(n_cur, 0);
22300 content = gen_const_xmlChar_ptr(n_content, 1);
22301 len = gen_int(n_len, 2);
22302 if ((content != NULL) &&
22303 (len > (int) strlen((const char *) content) + 1))
22306 xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22308 des_xmlNodePtr(n_cur, cur, 0);
22309 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22310 des_int(n_len, len, 2);
22311 xmlResetLastError();
22312 if (mem_base != xmlMemBlocks()) {
22313 printf("Leak of %d blocks found in xmlNodeAddContentLen",
22314 xmlMemBlocks() - mem_base);
22316 printf(" %d", n_cur);
22317 printf(" %d", n_content);
22318 printf(" %d", n_len);
22331 test_xmlNodeBufGetContent(void) {
22336 xmlBufferPtr buffer; /* a buffer */
22338 xmlNode * cur; /* the node being read */
22341 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22342 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22343 mem_base = xmlMemBlocks();
22344 buffer = gen_xmlBufferPtr(n_buffer, 0);
22345 cur = gen_const_xmlNode_ptr(n_cur, 1);
22347 ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
22348 desret_int(ret_val);
22350 des_xmlBufferPtr(n_buffer, buffer, 0);
22351 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22352 xmlResetLastError();
22353 if (mem_base != xmlMemBlocks()) {
22354 printf("Leak of %d blocks found in xmlNodeBufGetContent",
22355 xmlMemBlocks() - mem_base);
22357 printf(" %d", n_buffer);
22358 printf(" %d", n_cur);
22370 test_xmlNodeDump(void) {
22373 #if defined(LIBXML_OUTPUT_ENABLED)
22376 xmlBufferPtr buf; /* the XML buffer output */
22378 xmlDocPtr doc; /* the document */
22380 xmlNodePtr cur; /* the current node */
22382 int level; /* the imbrication level for indenting */
22384 int format; /* is formatting allowed */
22387 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22388 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22389 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22390 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22391 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22392 mem_base = xmlMemBlocks();
22393 buf = gen_xmlBufferPtr(n_buf, 0);
22394 doc = gen_xmlDocPtr(n_doc, 1);
22395 cur = gen_xmlNodePtr(n_cur, 2);
22396 level = gen_int(n_level, 3);
22397 format = gen_int(n_format, 4);
22399 ret_val = xmlNodeDump(buf, doc, cur, level, format);
22400 desret_int(ret_val);
22402 des_xmlBufferPtr(n_buf, buf, 0);
22403 des_xmlDocPtr(n_doc, doc, 1);
22404 des_xmlNodePtr(n_cur, cur, 2);
22405 des_int(n_level, level, 3);
22406 des_int(n_format, format, 4);
22407 xmlResetLastError();
22408 if (mem_base != xmlMemBlocks()) {
22409 printf("Leak of %d blocks found in xmlNodeDump",
22410 xmlMemBlocks() - mem_base);
22412 printf(" %d", n_buf);
22413 printf(" %d", n_doc);
22414 printf(" %d", n_cur);
22415 printf(" %d", n_level);
22416 printf(" %d", n_format);
22432 test_xmlNodeDumpOutput(void) {
22435 #if defined(LIBXML_OUTPUT_ENABLED)
22437 xmlOutputBufferPtr buf; /* the XML buffer output */
22439 xmlDocPtr doc; /* the document */
22441 xmlNodePtr cur; /* the current node */
22443 int level; /* the imbrication level for indenting */
22445 int format; /* is formatting allowed */
22447 char * encoding; /* an optional encoding string */
22450 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22451 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22452 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22453 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22454 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22455 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22456 mem_base = xmlMemBlocks();
22457 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22458 doc = gen_xmlDocPtr(n_doc, 1);
22459 cur = gen_xmlNodePtr(n_cur, 2);
22460 level = gen_int(n_level, 3);
22461 format = gen_int(n_format, 4);
22462 encoding = gen_const_char_ptr(n_encoding, 5);
22464 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22466 des_xmlOutputBufferPtr(n_buf, buf, 0);
22467 des_xmlDocPtr(n_doc, doc, 1);
22468 des_xmlNodePtr(n_cur, cur, 2);
22469 des_int(n_level, level, 3);
22470 des_int(n_format, format, 4);
22471 des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22472 xmlResetLastError();
22473 if (mem_base != xmlMemBlocks()) {
22474 printf("Leak of %d blocks found in xmlNodeDumpOutput",
22475 xmlMemBlocks() - mem_base);
22477 printf(" %d", n_buf);
22478 printf(" %d", n_doc);
22479 printf(" %d", n_cur);
22480 printf(" %d", n_level);
22481 printf(" %d", n_format);
22482 printf(" %d", n_encoding);
22499 test_xmlNodeGetBase(void) {
22504 xmlDoc * doc; /* the document the node pertains to */
22506 xmlNode * cur; /* the node being checked */
22509 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22510 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22511 mem_base = xmlMemBlocks();
22512 doc = gen_const_xmlDoc_ptr(n_doc, 0);
22513 cur = gen_const_xmlNode_ptr(n_cur, 1);
22515 ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
22516 desret_xmlChar_ptr(ret_val);
22518 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22519 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22520 xmlResetLastError();
22521 if (mem_base != xmlMemBlocks()) {
22522 printf("Leak of %d blocks found in xmlNodeGetBase",
22523 xmlMemBlocks() - mem_base);
22525 printf(" %d", n_doc);
22526 printf(" %d", n_cur);
22538 test_xmlNodeGetContent(void) {
22543 xmlNode * cur; /* the node being read */
22546 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22547 mem_base = xmlMemBlocks();
22548 cur = gen_const_xmlNode_ptr(n_cur, 0);
22550 ret_val = xmlNodeGetContent((const xmlNode *)cur);
22551 desret_xmlChar_ptr(ret_val);
22553 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22554 xmlResetLastError();
22555 if (mem_base != xmlMemBlocks()) {
22556 printf("Leak of %d blocks found in xmlNodeGetContent",
22557 xmlMemBlocks() - mem_base);
22559 printf(" %d", n_cur);
22570 test_xmlNodeGetLang(void) {
22575 xmlNode * cur; /* the node being checked */
22578 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22579 mem_base = xmlMemBlocks();
22580 cur = gen_const_xmlNode_ptr(n_cur, 0);
22582 ret_val = xmlNodeGetLang((const xmlNode *)cur);
22583 desret_xmlChar_ptr(ret_val);
22585 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22586 xmlResetLastError();
22587 if (mem_base != xmlMemBlocks()) {
22588 printf("Leak of %d blocks found in xmlNodeGetLang",
22589 xmlMemBlocks() - mem_base);
22591 printf(" %d", n_cur);
22602 test_xmlNodeGetSpacePreserve(void) {
22607 xmlNode * cur; /* the node being checked */
22610 for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22611 mem_base = xmlMemBlocks();
22612 cur = gen_const_xmlNode_ptr(n_cur, 0);
22614 ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
22615 desret_int(ret_val);
22617 des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22618 xmlResetLastError();
22619 if (mem_base != xmlMemBlocks()) {
22620 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22621 xmlMemBlocks() - mem_base);
22623 printf(" %d", n_cur);
22634 test_xmlNodeIsText(void) {
22639 xmlNode * node; /* the node */
22642 for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
22643 mem_base = xmlMemBlocks();
22644 node = gen_const_xmlNode_ptr(n_node, 0);
22646 ret_val = xmlNodeIsText((const xmlNode *)node);
22647 desret_int(ret_val);
22649 des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
22650 xmlResetLastError();
22651 if (mem_base != xmlMemBlocks()) {
22652 printf("Leak of %d blocks found in xmlNodeIsText",
22653 xmlMemBlocks() - mem_base);
22655 printf(" %d", n_node);
22666 test_xmlNodeListGetRawString(void) {
22669 #if defined(LIBXML_TREE_ENABLED)
22672 xmlDoc * doc; /* the document */
22674 xmlNode * list; /* a Node list */
22676 int inLine; /* should we replace entity contents or show their external form */
22679 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22680 for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22681 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22682 mem_base = xmlMemBlocks();
22683 doc = gen_const_xmlDoc_ptr(n_doc, 0);
22684 list = gen_const_xmlNode_ptr(n_list, 1);
22685 inLine = gen_int(n_inLine, 2);
22687 ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
22688 desret_xmlChar_ptr(ret_val);
22690 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22691 des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22692 des_int(n_inLine, inLine, 2);
22693 xmlResetLastError();
22694 if (mem_base != xmlMemBlocks()) {
22695 printf("Leak of %d blocks found in xmlNodeListGetRawString",
22696 xmlMemBlocks() - mem_base);
22698 printf(" %d", n_doc);
22699 printf(" %d", n_list);
22700 printf(" %d", n_inLine);
22714 test_xmlNodeListGetString(void) {
22719 xmlDocPtr doc; /* the document */
22721 xmlNode * list; /* a Node list */
22723 int inLine; /* should we replace entity contents or show their external form */
22726 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22727 for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22728 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22729 mem_base = xmlMemBlocks();
22730 doc = gen_xmlDocPtr(n_doc, 0);
22731 list = gen_const_xmlNode_ptr(n_list, 1);
22732 inLine = gen_int(n_inLine, 2);
22734 ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
22735 desret_xmlChar_ptr(ret_val);
22737 des_xmlDocPtr(n_doc, doc, 0);
22738 des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22739 des_int(n_inLine, inLine, 2);
22740 xmlResetLastError();
22741 if (mem_base != xmlMemBlocks()) {
22742 printf("Leak of %d blocks found in xmlNodeListGetString",
22743 xmlMemBlocks() - mem_base);
22745 printf(" %d", n_doc);
22746 printf(" %d", n_list);
22747 printf(" %d", n_inLine);
22760 test_xmlNodeSetBase(void) {
22763 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22765 xmlNodePtr cur; /* the node being changed */
22767 xmlChar * uri; /* the new base URI */
22770 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22771 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22772 mem_base = xmlMemBlocks();
22773 cur = gen_xmlNodePtr(n_cur, 0);
22774 uri = gen_const_xmlChar_ptr(n_uri, 1);
22776 xmlNodeSetBase(cur, (const xmlChar *)uri);
22778 des_xmlNodePtr(n_cur, cur, 0);
22779 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22780 xmlResetLastError();
22781 if (mem_base != xmlMemBlocks()) {
22782 printf("Leak of %d blocks found in xmlNodeSetBase",
22783 xmlMemBlocks() - mem_base);
22785 printf(" %d", n_cur);
22786 printf(" %d", n_uri);
22799 test_xmlNodeSetContent(void) {
22803 xmlNodePtr cur; /* the node being modified */
22805 xmlChar * content; /* the new value of the content */
22808 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22809 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22810 mem_base = xmlMemBlocks();
22811 cur = gen_xmlNodePtr(n_cur, 0);
22812 content = gen_const_xmlChar_ptr(n_content, 1);
22814 xmlNodeSetContent(cur, (const xmlChar *)content);
22816 des_xmlNodePtr(n_cur, cur, 0);
22817 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22818 xmlResetLastError();
22819 if (mem_base != xmlMemBlocks()) {
22820 printf("Leak of %d blocks found in xmlNodeSetContent",
22821 xmlMemBlocks() - mem_base);
22823 printf(" %d", n_cur);
22824 printf(" %d", n_content);
22836 test_xmlNodeSetContentLen(void) {
22839 #if defined(LIBXML_TREE_ENABLED)
22841 xmlNodePtr cur; /* the node being modified */
22843 xmlChar * content; /* the new value of the content */
22845 int len; /* the size of @content */
22848 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22849 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22850 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22851 mem_base = xmlMemBlocks();
22852 cur = gen_xmlNodePtr(n_cur, 0);
22853 content = gen_const_xmlChar_ptr(n_content, 1);
22854 len = gen_int(n_len, 2);
22855 if ((content != NULL) &&
22856 (len > (int) strlen((const char *) content) + 1))
22859 xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22861 des_xmlNodePtr(n_cur, cur, 0);
22862 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22863 des_int(n_len, len, 2);
22864 xmlResetLastError();
22865 if (mem_base != xmlMemBlocks()) {
22866 printf("Leak of %d blocks found in xmlNodeSetContentLen",
22867 xmlMemBlocks() - mem_base);
22869 printf(" %d", n_cur);
22870 printf(" %d", n_content);
22871 printf(" %d", n_len);
22885 test_xmlNodeSetLang(void) {
22888 #if defined(LIBXML_TREE_ENABLED)
22890 xmlNodePtr cur; /* the node being changed */
22892 xmlChar * lang; /* the language description */
22895 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22896 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22897 mem_base = xmlMemBlocks();
22898 cur = gen_xmlNodePtr(n_cur, 0);
22899 lang = gen_const_xmlChar_ptr(n_lang, 1);
22901 xmlNodeSetLang(cur, (const xmlChar *)lang);
22903 des_xmlNodePtr(n_cur, cur, 0);
22904 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22905 xmlResetLastError();
22906 if (mem_base != xmlMemBlocks()) {
22907 printf("Leak of %d blocks found in xmlNodeSetLang",
22908 xmlMemBlocks() - mem_base);
22910 printf(" %d", n_cur);
22911 printf(" %d", n_lang);
22924 test_xmlNodeSetName(void) {
22927 #if defined(LIBXML_TREE_ENABLED)
22929 xmlNodePtr cur; /* the node being changed */
22931 xmlChar * name; /* the new tag name */
22934 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22935 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22936 mem_base = xmlMemBlocks();
22937 cur = gen_xmlNodePtr(n_cur, 0);
22938 name = gen_const_xmlChar_ptr(n_name, 1);
22940 xmlNodeSetName(cur, (const xmlChar *)name);
22942 des_xmlNodePtr(n_cur, cur, 0);
22943 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22944 xmlResetLastError();
22945 if (mem_base != xmlMemBlocks()) {
22946 printf("Leak of %d blocks found in xmlNodeSetName",
22947 xmlMemBlocks() - mem_base);
22949 printf(" %d", n_cur);
22950 printf(" %d", n_name);
22963 test_xmlNodeSetSpacePreserve(void) {
22966 #if defined(LIBXML_TREE_ENABLED)
22968 xmlNodePtr cur; /* the node being changed */
22970 int val; /* the xml:space value ("0": default, 1: "preserve") */
22973 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22974 for (n_val = 0;n_val < gen_nb_int;n_val++) {
22975 mem_base = xmlMemBlocks();
22976 cur = gen_xmlNodePtr(n_cur, 0);
22977 val = gen_int(n_val, 1);
22979 xmlNodeSetSpacePreserve(cur, val);
22981 des_xmlNodePtr(n_cur, cur, 0);
22982 des_int(n_val, val, 1);
22983 xmlResetLastError();
22984 if (mem_base != xmlMemBlocks()) {
22985 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22986 xmlMemBlocks() - mem_base);
22988 printf(" %d", n_cur);
22989 printf(" %d", n_val);
23002 test_xmlPreviousElementSibling(void) {
23005 #if defined(LIBXML_TREE_ENABLED)
23007 xmlNodePtr ret_val;
23008 xmlNodePtr node; /* the current node */
23011 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23012 mem_base = xmlMemBlocks();
23013 node = gen_xmlNodePtr(n_node, 0);
23015 ret_val = xmlPreviousElementSibling(node);
23016 desret_xmlNodePtr(ret_val);
23018 des_xmlNodePtr(n_node, node, 0);
23019 xmlResetLastError();
23020 if (mem_base != xmlMemBlocks()) {
23021 printf("Leak of %d blocks found in xmlPreviousElementSibling",
23022 xmlMemBlocks() - mem_base);
23024 printf(" %d", n_node);
23036 test_xmlReconciliateNs(void) {
23039 #if defined(LIBXML_TREE_ENABLED)
23040 #ifdef LIBXML_TREE_ENABLED
23043 xmlDocPtr doc; /* the document */
23045 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
23048 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23049 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
23050 mem_base = xmlMemBlocks();
23051 doc = gen_xmlDocPtr(n_doc, 0);
23052 tree = gen_xmlNodePtr(n_tree, 1);
23054 ret_val = xmlReconciliateNs(doc, tree);
23055 desret_int(ret_val);
23057 des_xmlDocPtr(n_doc, doc, 0);
23058 des_xmlNodePtr(n_tree, tree, 1);
23059 xmlResetLastError();
23060 if (mem_base != xmlMemBlocks()) {
23061 printf("Leak of %d blocks found in xmlReconciliateNs",
23062 xmlMemBlocks() - mem_base);
23064 printf(" %d", n_doc);
23065 printf(" %d", n_tree);
23079 test_xmlRemoveProp(void) {
23084 xmlAttrPtr cur; /* an attribute */
23087 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
23088 mem_base = xmlMemBlocks();
23089 cur = gen_xmlAttrPtr(n_cur, 0);
23091 ret_val = xmlRemoveProp(cur);
23093 desret_int(ret_val);
23095 des_xmlAttrPtr(n_cur, cur, 0);
23096 xmlResetLastError();
23097 if (mem_base != xmlMemBlocks()) {
23098 printf("Leak of %d blocks found in xmlRemoveProp",
23099 xmlMemBlocks() - mem_base);
23101 printf(" %d", n_cur);
23112 test_xmlReplaceNode(void) {
23115 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23117 xmlNodePtr ret_val;
23118 xmlNodePtr old; /* the old node */
23120 xmlNodePtr cur; /* the node */
23123 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23124 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23125 mem_base = xmlMemBlocks();
23126 old = gen_xmlNodePtr(n_old, 0);
23127 cur = gen_xmlNodePtr_in(n_cur, 1);
23129 ret_val = xmlReplaceNode(old, cur);
23131 xmlUnlinkNode(cur);
23132 xmlFreeNode(cur) ; cur = NULL ; }
23134 xmlUnlinkNode(old);
23135 xmlFreeNode(old) ; old = NULL ; }
23137 desret_xmlNodePtr(ret_val);
23139 des_xmlNodePtr(n_old, old, 0);
23140 des_xmlNodePtr_in(n_cur, cur, 1);
23141 xmlResetLastError();
23142 if (mem_base != xmlMemBlocks()) {
23143 printf("Leak of %d blocks found in xmlReplaceNode",
23144 xmlMemBlocks() - mem_base);
23146 printf(" %d", n_old);
23147 printf(" %d", n_cur);
23160 test_xmlSaveFile(void) {
23163 #if defined(LIBXML_OUTPUT_ENABLED)
23166 const char * filename; /* the filename (or URL) */
23168 xmlDocPtr cur; /* the document */
23171 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23172 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23173 mem_base = xmlMemBlocks();
23174 filename = gen_fileoutput(n_filename, 0);
23175 cur = gen_xmlDocPtr(n_cur, 1);
23177 ret_val = xmlSaveFile(filename, cur);
23178 desret_int(ret_val);
23180 des_fileoutput(n_filename, filename, 0);
23181 des_xmlDocPtr(n_cur, cur, 1);
23182 xmlResetLastError();
23183 if (mem_base != xmlMemBlocks()) {
23184 printf("Leak of %d blocks found in xmlSaveFile",
23185 xmlMemBlocks() - mem_base);
23187 printf(" %d", n_filename);
23188 printf(" %d", n_cur);
23201 test_xmlSaveFileEnc(void) {
23204 #if defined(LIBXML_OUTPUT_ENABLED)
23207 const char * filename; /* the filename (or URL) */
23209 xmlDocPtr cur; /* the document */
23211 char * encoding; /* the name of an encoding (or NULL) */
23214 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23215 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23216 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23217 mem_base = xmlMemBlocks();
23218 filename = gen_fileoutput(n_filename, 0);
23219 cur = gen_xmlDocPtr(n_cur, 1);
23220 encoding = gen_const_char_ptr(n_encoding, 2);
23222 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23223 desret_int(ret_val);
23225 des_fileoutput(n_filename, filename, 0);
23226 des_xmlDocPtr(n_cur, cur, 1);
23227 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23228 xmlResetLastError();
23229 if (mem_base != xmlMemBlocks()) {
23230 printf("Leak of %d blocks found in xmlSaveFileEnc",
23231 xmlMemBlocks() - mem_base);
23233 printf(" %d", n_filename);
23234 printf(" %d", n_cur);
23235 printf(" %d", n_encoding);
23249 test_xmlSaveFileTo(void) {
23252 #if defined(LIBXML_OUTPUT_ENABLED)
23255 xmlOutputBufferPtr buf; /* an output I/O buffer */
23257 xmlDocPtr cur; /* the document */
23259 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23262 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23263 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23264 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23265 mem_base = xmlMemBlocks();
23266 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23267 cur = gen_xmlDocPtr(n_cur, 1);
23268 encoding = gen_const_char_ptr(n_encoding, 2);
23270 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23272 desret_int(ret_val);
23274 des_xmlOutputBufferPtr(n_buf, buf, 0);
23275 des_xmlDocPtr(n_cur, cur, 1);
23276 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23277 xmlResetLastError();
23278 if (mem_base != xmlMemBlocks()) {
23279 printf("Leak of %d blocks found in xmlSaveFileTo",
23280 xmlMemBlocks() - mem_base);
23282 printf(" %d", n_buf);
23283 printf(" %d", n_cur);
23284 printf(" %d", n_encoding);
23298 test_xmlSaveFormatFile(void) {
23301 #if defined(LIBXML_OUTPUT_ENABLED)
23304 const char * filename; /* the filename (or URL) */
23306 xmlDocPtr cur; /* the document */
23308 int format; /* should formatting spaces been added */
23311 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23312 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23313 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23314 mem_base = xmlMemBlocks();
23315 filename = gen_fileoutput(n_filename, 0);
23316 cur = gen_xmlDocPtr(n_cur, 1);
23317 format = gen_int(n_format, 2);
23319 ret_val = xmlSaveFormatFile(filename, cur, format);
23320 desret_int(ret_val);
23322 des_fileoutput(n_filename, filename, 0);
23323 des_xmlDocPtr(n_cur, cur, 1);
23324 des_int(n_format, format, 2);
23325 xmlResetLastError();
23326 if (mem_base != xmlMemBlocks()) {
23327 printf("Leak of %d blocks found in xmlSaveFormatFile",
23328 xmlMemBlocks() - mem_base);
23330 printf(" %d", n_filename);
23331 printf(" %d", n_cur);
23332 printf(" %d", n_format);
23346 test_xmlSaveFormatFileEnc(void) {
23349 #if defined(LIBXML_OUTPUT_ENABLED)
23352 const char * filename; /* the filename or URL to output */
23354 xmlDocPtr cur; /* the document being saved */
23356 char * encoding; /* the name of the encoding to use or NULL. */
23358 int format; /* should formatting spaces be added. */
23361 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23362 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23363 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23364 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23365 mem_base = xmlMemBlocks();
23366 filename = gen_fileoutput(n_filename, 0);
23367 cur = gen_xmlDocPtr(n_cur, 1);
23368 encoding = gen_const_char_ptr(n_encoding, 2);
23369 format = gen_int(n_format, 3);
23371 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23372 desret_int(ret_val);
23374 des_fileoutput(n_filename, filename, 0);
23375 des_xmlDocPtr(n_cur, cur, 1);
23376 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23377 des_int(n_format, format, 3);
23378 xmlResetLastError();
23379 if (mem_base != xmlMemBlocks()) {
23380 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23381 xmlMemBlocks() - mem_base);
23383 printf(" %d", n_filename);
23384 printf(" %d", n_cur);
23385 printf(" %d", n_encoding);
23386 printf(" %d", n_format);
23401 test_xmlSaveFormatFileTo(void) {
23404 #if defined(LIBXML_OUTPUT_ENABLED)
23407 xmlOutputBufferPtr buf; /* an output I/O buffer */
23409 xmlDocPtr cur; /* the document */
23411 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23413 int format; /* should formatting spaces been added */
23416 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23417 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23418 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23419 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23420 mem_base = xmlMemBlocks();
23421 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23422 cur = gen_xmlDocPtr(n_cur, 1);
23423 encoding = gen_const_char_ptr(n_encoding, 2);
23424 format = gen_int(n_format, 3);
23426 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23428 desret_int(ret_val);
23430 des_xmlOutputBufferPtr(n_buf, buf, 0);
23431 des_xmlDocPtr(n_cur, cur, 1);
23432 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23433 des_int(n_format, format, 3);
23434 xmlResetLastError();
23435 if (mem_base != xmlMemBlocks()) {
23436 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23437 xmlMemBlocks() - mem_base);
23439 printf(" %d", n_buf);
23440 printf(" %d", n_cur);
23441 printf(" %d", n_encoding);
23442 printf(" %d", n_format);
23457 test_xmlSearchNs(void) {
23462 xmlDocPtr doc; /* the document */
23464 xmlNodePtr node; /* the current node */
23466 xmlChar * nameSpace; /* the namespace prefix */
23469 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23470 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23471 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23472 mem_base = xmlMemBlocks();
23473 doc = gen_xmlDocPtr(n_doc, 0);
23474 node = gen_xmlNodePtr(n_node, 1);
23475 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23477 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23478 desret_xmlNsPtr(ret_val);
23480 des_xmlDocPtr(n_doc, doc, 0);
23481 des_xmlNodePtr(n_node, node, 1);
23482 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23483 xmlResetLastError();
23484 if (mem_base != xmlMemBlocks()) {
23485 printf("Leak of %d blocks found in xmlSearchNs",
23486 xmlMemBlocks() - mem_base);
23488 printf(" %d", n_doc);
23489 printf(" %d", n_node);
23490 printf(" %d", n_nameSpace);
23503 test_xmlSearchNsByHref(void) {
23508 xmlDocPtr doc; /* the document */
23510 xmlNodePtr node; /* the current node */
23512 xmlChar * href; /* the namespace value */
23515 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23516 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23517 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23518 mem_base = xmlMemBlocks();
23519 doc = gen_xmlDocPtr(n_doc, 0);
23520 node = gen_xmlNodePtr(n_node, 1);
23521 href = gen_const_xmlChar_ptr(n_href, 2);
23523 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23524 desret_xmlNsPtr(ret_val);
23526 des_xmlDocPtr(n_doc, doc, 0);
23527 des_xmlNodePtr(n_node, node, 1);
23528 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23529 xmlResetLastError();
23530 if (mem_base != xmlMemBlocks()) {
23531 printf("Leak of %d blocks found in xmlSearchNsByHref",
23532 xmlMemBlocks() - mem_base);
23534 printf(" %d", n_doc);
23535 printf(" %d", n_node);
23536 printf(" %d", n_href);
23549 test_xmlSetBufferAllocationScheme(void) {
23553 xmlBufferAllocationScheme scheme; /* allocation method to use */
23556 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23557 mem_base = xmlMemBlocks();
23558 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23560 xmlSetBufferAllocationScheme(scheme);
23562 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23563 xmlResetLastError();
23564 if (mem_base != xmlMemBlocks()) {
23565 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23566 xmlMemBlocks() - mem_base);
23568 printf(" %d", n_scheme);
23579 test_xmlSetCompressMode(void) {
23583 int mode; /* the compression ratio */
23586 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23587 mem_base = xmlMemBlocks();
23588 mode = gen_int(n_mode, 0);
23590 xmlSetCompressMode(mode);
23592 des_int(n_mode, mode, 0);
23593 xmlResetLastError();
23594 if (mem_base != xmlMemBlocks()) {
23595 printf("Leak of %d blocks found in xmlSetCompressMode",
23596 xmlMemBlocks() - mem_base);
23598 printf(" %d", n_mode);
23609 test_xmlSetDocCompressMode(void) {
23613 xmlDocPtr doc; /* the document */
23615 int mode; /* the compression ratio */
23618 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23619 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23620 mem_base = xmlMemBlocks();
23621 doc = gen_xmlDocPtr(n_doc, 0);
23622 mode = gen_int(n_mode, 1);
23624 xmlSetDocCompressMode(doc, mode);
23626 des_xmlDocPtr(n_doc, doc, 0);
23627 des_int(n_mode, mode, 1);
23628 xmlResetLastError();
23629 if (mem_base != xmlMemBlocks()) {
23630 printf("Leak of %d blocks found in xmlSetDocCompressMode",
23631 xmlMemBlocks() - mem_base);
23633 printf(" %d", n_doc);
23634 printf(" %d", n_mode);
23646 test_xmlSetNs(void) {
23650 xmlNodePtr node; /* a node in the document */
23652 xmlNsPtr ns; /* a namespace pointer */
23655 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23656 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23657 mem_base = xmlMemBlocks();
23658 node = gen_xmlNodePtr(n_node, 0);
23659 ns = gen_xmlNsPtr(n_ns, 1);
23661 xmlSetNs(node, ns);
23663 des_xmlNodePtr(n_node, node, 0);
23664 des_xmlNsPtr(n_ns, ns, 1);
23665 xmlResetLastError();
23666 if (mem_base != xmlMemBlocks()) {
23667 printf("Leak of %d blocks found in xmlSetNs",
23668 xmlMemBlocks() - mem_base);
23670 printf(" %d", n_node);
23671 printf(" %d", n_ns);
23683 test_xmlSetNsProp(void) {
23686 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23688 xmlAttrPtr ret_val;
23689 xmlNodePtr node; /* the node */
23691 xmlNsPtr ns; /* the namespace definition */
23693 xmlChar * name; /* the attribute name */
23695 xmlChar * value; /* the attribute value */
23698 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23699 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23700 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23701 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23702 mem_base = xmlMemBlocks();
23703 node = gen_xmlNodePtr(n_node, 0);
23704 ns = gen_xmlNsPtr(n_ns, 1);
23705 name = gen_const_xmlChar_ptr(n_name, 2);
23706 value = gen_const_xmlChar_ptr(n_value, 3);
23708 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23709 desret_xmlAttrPtr(ret_val);
23711 des_xmlNodePtr(n_node, node, 0);
23712 des_xmlNsPtr(n_ns, ns, 1);
23713 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23714 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23715 xmlResetLastError();
23716 if (mem_base != xmlMemBlocks()) {
23717 printf("Leak of %d blocks found in xmlSetNsProp",
23718 xmlMemBlocks() - mem_base);
23720 printf(" %d", n_node);
23721 printf(" %d", n_ns);
23722 printf(" %d", n_name);
23723 printf(" %d", n_value);
23738 test_xmlSetProp(void) {
23741 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23743 xmlAttrPtr ret_val;
23744 xmlNodePtr node; /* the node */
23746 xmlChar * name; /* the attribute name (a QName) */
23748 xmlChar * value; /* the attribute value */
23751 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23752 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23753 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23754 mem_base = xmlMemBlocks();
23755 node = gen_xmlNodePtr(n_node, 0);
23756 name = gen_const_xmlChar_ptr(n_name, 1);
23757 value = gen_const_xmlChar_ptr(n_value, 2);
23759 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23760 desret_xmlAttrPtr(ret_val);
23762 des_xmlNodePtr(n_node, node, 0);
23763 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23764 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23765 xmlResetLastError();
23766 if (mem_base != xmlMemBlocks()) {
23767 printf("Leak of %d blocks found in xmlSetProp",
23768 xmlMemBlocks() - mem_base);
23770 printf(" %d", n_node);
23771 printf(" %d", n_name);
23772 printf(" %d", n_value);
23786 test_xmlSplitQName2(void) {
23791 xmlChar * name; /* the full QName */
23793 xmlChar ** prefix; /* a xmlChar ** */
23796 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23797 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23798 mem_base = xmlMemBlocks();
23799 name = gen_const_xmlChar_ptr(n_name, 0);
23800 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23802 ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23803 desret_xmlChar_ptr(ret_val);
23805 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23806 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23807 xmlResetLastError();
23808 if (mem_base != xmlMemBlocks()) {
23809 printf("Leak of %d blocks found in xmlSplitQName2",
23810 xmlMemBlocks() - mem_base);
23812 printf(" %d", n_name);
23813 printf(" %d", n_prefix);
23825 test_xmlSplitQName3(void) {
23829 const xmlChar * ret_val;
23830 xmlChar * name; /* the full QName */
23832 int * len; /* an int * */
23835 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23836 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23837 mem_base = xmlMemBlocks();
23838 name = gen_const_xmlChar_ptr(n_name, 0);
23839 len = gen_int_ptr(n_len, 1);
23841 ret_val = xmlSplitQName3((const xmlChar *)name, len);
23842 desret_const_xmlChar_ptr(ret_val);
23844 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23845 des_int_ptr(n_len, len, 1);
23846 xmlResetLastError();
23847 if (mem_base != xmlMemBlocks()) {
23848 printf("Leak of %d blocks found in xmlSplitQName3",
23849 xmlMemBlocks() - mem_base);
23851 printf(" %d", n_name);
23852 printf(" %d", n_len);
23864 test_xmlStringGetNodeList(void) {
23868 xmlNodePtr ret_val;
23869 xmlDoc * doc; /* the document */
23871 xmlChar * value; /* the value of the attribute */
23874 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23875 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23876 mem_base = xmlMemBlocks();
23877 doc = gen_const_xmlDoc_ptr(n_doc, 0);
23878 value = gen_const_xmlChar_ptr(n_value, 1);
23880 ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
23881 desret_xmlNodePtr(ret_val);
23883 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23884 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23885 xmlResetLastError();
23886 if (mem_base != xmlMemBlocks()) {
23887 printf("Leak of %d blocks found in xmlStringGetNodeList",
23888 xmlMemBlocks() - mem_base);
23890 printf(" %d", n_doc);
23891 printf(" %d", n_value);
23903 test_xmlStringLenGetNodeList(void) {
23907 xmlNodePtr ret_val;
23908 xmlDoc * doc; /* the document */
23910 xmlChar * value; /* the value of the text */
23912 int len; /* the length of the string value */
23915 for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23916 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23917 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23918 mem_base = xmlMemBlocks();
23919 doc = gen_const_xmlDoc_ptr(n_doc, 0);
23920 value = gen_const_xmlChar_ptr(n_value, 1);
23921 len = gen_int(n_len, 2);
23922 if ((value != NULL) &&
23923 (len > (int) strlen((const char *) value) + 1))
23926 ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
23927 desret_xmlNodePtr(ret_val);
23929 des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23930 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23931 des_int(n_len, len, 2);
23932 xmlResetLastError();
23933 if (mem_base != xmlMemBlocks()) {
23934 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23935 xmlMemBlocks() - mem_base);
23937 printf(" %d", n_doc);
23938 printf(" %d", n_value);
23939 printf(" %d", n_len);
23952 test_xmlTextConcat(void) {
23957 xmlNodePtr node; /* the node */
23959 xmlChar * content; /* the content */
23961 int len; /* @content length */
23964 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23965 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23966 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23967 mem_base = xmlMemBlocks();
23968 node = gen_xmlNodePtr(n_node, 0);
23969 content = gen_const_xmlChar_ptr(n_content, 1);
23970 len = gen_int(n_len, 2);
23971 if ((content != NULL) &&
23972 (len > (int) strlen((const char *) content) + 1))
23975 ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23976 desret_int(ret_val);
23978 des_xmlNodePtr(n_node, node, 0);
23979 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23980 des_int(n_len, len, 2);
23981 xmlResetLastError();
23982 if (mem_base != xmlMemBlocks()) {
23983 printf("Leak of %d blocks found in xmlTextConcat",
23984 xmlMemBlocks() - mem_base);
23986 printf(" %d", n_node);
23987 printf(" %d", n_content);
23988 printf(" %d", n_len);
24001 test_xmlTextMerge(void) {
24005 xmlNodePtr ret_val;
24006 xmlNodePtr first; /* the first text node */
24008 xmlNodePtr second; /* the second text node being merged */
24011 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
24012 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
24013 mem_base = xmlMemBlocks();
24014 first = gen_xmlNodePtr_in(n_first, 0);
24015 second = gen_xmlNodePtr_in(n_second, 1);
24017 ret_val = xmlTextMerge(first, second);
24018 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
24019 xmlUnlinkNode(second);
24020 xmlFreeNode(second) ; second = NULL ; }
24021 desret_xmlNodePtr(ret_val);
24023 des_xmlNodePtr_in(n_first, first, 0);
24024 des_xmlNodePtr_in(n_second, second, 1);
24025 xmlResetLastError();
24026 if (mem_base != xmlMemBlocks()) {
24027 printf("Leak of %d blocks found in xmlTextMerge",
24028 xmlMemBlocks() - mem_base);
24030 printf(" %d", n_first);
24031 printf(" %d", n_second);
24043 test_xmlUnsetNsProp(void) {
24046 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24049 xmlNodePtr node; /* the node */
24051 xmlNsPtr ns; /* the namespace definition */
24053 xmlChar * name; /* the attribute name */
24056 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24057 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24058 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24059 mem_base = xmlMemBlocks();
24060 node = gen_xmlNodePtr(n_node, 0);
24061 ns = gen_xmlNsPtr(n_ns, 1);
24062 name = gen_const_xmlChar_ptr(n_name, 2);
24064 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
24065 desret_int(ret_val);
24067 des_xmlNodePtr(n_node, node, 0);
24068 des_xmlNsPtr(n_ns, ns, 1);
24069 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24070 xmlResetLastError();
24071 if (mem_base != xmlMemBlocks()) {
24072 printf("Leak of %d blocks found in xmlUnsetNsProp",
24073 xmlMemBlocks() - mem_base);
24075 printf(" %d", n_node);
24076 printf(" %d", n_ns);
24077 printf(" %d", n_name);
24091 test_xmlUnsetProp(void) {
24094 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24097 xmlNodePtr node; /* the node */
24099 xmlChar * name; /* the attribute name */
24102 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24103 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24104 mem_base = xmlMemBlocks();
24105 node = gen_xmlNodePtr(n_node, 0);
24106 name = gen_const_xmlChar_ptr(n_name, 1);
24108 ret_val = xmlUnsetProp(node, (const xmlChar *)name);
24109 desret_int(ret_val);
24111 des_xmlNodePtr(n_node, node, 0);
24112 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24113 xmlResetLastError();
24114 if (mem_base != xmlMemBlocks()) {
24115 printf("Leak of %d blocks found in xmlUnsetProp",
24116 xmlMemBlocks() - mem_base);
24118 printf(" %d", n_node);
24119 printf(" %d", n_name);
24132 test_xmlValidateNCName(void) {
24135 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
24136 #ifdef LIBXML_TREE_ENABLED
24139 xmlChar * value; /* the value to check */
24141 int space; /* allow spaces in front and end of the string */
24144 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24145 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24146 mem_base = xmlMemBlocks();
24147 value = gen_const_xmlChar_ptr(n_value, 0);
24148 space = gen_int(n_space, 1);
24150 ret_val = xmlValidateNCName((const xmlChar *)value, space);
24151 desret_int(ret_val);
24153 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24154 des_int(n_space, space, 1);
24155 xmlResetLastError();
24156 if (mem_base != xmlMemBlocks()) {
24157 printf("Leak of %d blocks found in xmlValidateNCName",
24158 xmlMemBlocks() - mem_base);
24160 printf(" %d", n_value);
24161 printf(" %d", n_space);
24175 test_xmlValidateNMToken(void) {
24178 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24179 #ifdef LIBXML_TREE_ENABLED
24182 xmlChar * value; /* the value to check */
24184 int space; /* allow spaces in front and end of the string */
24187 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24188 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24189 mem_base = xmlMemBlocks();
24190 value = gen_const_xmlChar_ptr(n_value, 0);
24191 space = gen_int(n_space, 1);
24193 ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24194 desret_int(ret_val);
24196 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24197 des_int(n_space, space, 1);
24198 xmlResetLastError();
24199 if (mem_base != xmlMemBlocks()) {
24200 printf("Leak of %d blocks found in xmlValidateNMToken",
24201 xmlMemBlocks() - mem_base);
24203 printf(" %d", n_value);
24204 printf(" %d", n_space);
24218 test_xmlValidateName(void) {
24221 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24222 #ifdef LIBXML_TREE_ENABLED
24225 xmlChar * value; /* the value to check */
24227 int space; /* allow spaces in front and end of the string */
24230 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24231 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24232 mem_base = xmlMemBlocks();
24233 value = gen_const_xmlChar_ptr(n_value, 0);
24234 space = gen_int(n_space, 1);
24236 ret_val = xmlValidateName((const xmlChar *)value, space);
24237 desret_int(ret_val);
24239 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24240 des_int(n_space, space, 1);
24241 xmlResetLastError();
24242 if (mem_base != xmlMemBlocks()) {
24243 printf("Leak of %d blocks found in xmlValidateName",
24244 xmlMemBlocks() - mem_base);
24246 printf(" %d", n_value);
24247 printf(" %d", n_space);
24261 test_xmlValidateQName(void) {
24264 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24265 #ifdef LIBXML_TREE_ENABLED
24268 xmlChar * value; /* the value to check */
24270 int space; /* allow spaces in front and end of the string */
24273 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24274 for (n_space = 0;n_space < gen_nb_int;n_space++) {
24275 mem_base = xmlMemBlocks();
24276 value = gen_const_xmlChar_ptr(n_value, 0);
24277 space = gen_int(n_space, 1);
24279 ret_val = xmlValidateQName((const xmlChar *)value, space);
24280 desret_int(ret_val);
24282 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24283 des_int(n_space, space, 1);
24284 xmlResetLastError();
24285 if (mem_base != xmlMemBlocks()) {
24286 printf("Leak of %d blocks found in xmlValidateQName",
24287 xmlMemBlocks() - mem_base);
24289 printf(" %d", n_value);
24290 printf(" %d", n_space);
24306 if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24307 test_ret += test_xmlAddChild();
24308 test_ret += test_xmlAddChildList();
24309 test_ret += test_xmlAddNextSibling();
24310 test_ret += test_xmlAddPrevSibling();
24311 test_ret += test_xmlAddSibling();
24312 test_ret += test_xmlAttrSerializeTxtContent();
24313 test_ret += test_xmlBufContent();
24314 test_ret += test_xmlBufEnd();
24315 test_ret += test_xmlBufGetNodeContent();
24316 test_ret += test_xmlBufNodeDump();
24317 test_ret += test_xmlBufShrink();
24318 test_ret += test_xmlBufUse();
24319 test_ret += test_xmlBufferAdd();
24320 test_ret += test_xmlBufferAddHead();
24321 test_ret += test_xmlBufferCCat();
24322 test_ret += test_xmlBufferCat();
24323 test_ret += test_xmlBufferContent();
24324 test_ret += test_xmlBufferCreate();
24325 test_ret += test_xmlBufferCreateSize();
24326 test_ret += test_xmlBufferCreateStatic();
24327 test_ret += test_xmlBufferDetach();
24328 test_ret += test_xmlBufferEmpty();
24329 test_ret += test_xmlBufferGrow();
24330 test_ret += test_xmlBufferLength();
24331 test_ret += test_xmlBufferResize();
24332 test_ret += test_xmlBufferSetAllocationScheme();
24333 test_ret += test_xmlBufferShrink();
24334 test_ret += test_xmlBufferWriteCHAR();
24335 test_ret += test_xmlBufferWriteChar();
24336 test_ret += test_xmlBufferWriteQuotedString();
24337 test_ret += test_xmlBuildQName();
24338 test_ret += test_xmlChildElementCount();
24339 test_ret += test_xmlCopyDoc();
24340 test_ret += test_xmlCopyDtd();
24341 test_ret += test_xmlCopyNamespace();
24342 test_ret += test_xmlCopyNamespaceList();
24343 test_ret += test_xmlCopyNode();
24344 test_ret += test_xmlCopyNodeList();
24345 test_ret += test_xmlCopyProp();
24346 test_ret += test_xmlCopyPropList();
24347 test_ret += test_xmlCreateIntSubset();
24348 test_ret += test_xmlDOMWrapAdoptNode();
24349 test_ret += test_xmlDOMWrapCloneNode();
24350 test_ret += test_xmlDOMWrapNewCtxt();
24351 test_ret += test_xmlDOMWrapReconcileNamespaces();
24352 test_ret += test_xmlDOMWrapRemoveNode();
24353 test_ret += test_xmlDocCopyNode();
24354 test_ret += test_xmlDocCopyNodeList();
24355 test_ret += test_xmlDocDump();
24356 test_ret += test_xmlDocDumpFormatMemory();
24357 test_ret += test_xmlDocDumpFormatMemoryEnc();
24358 test_ret += test_xmlDocDumpMemory();
24359 test_ret += test_xmlDocDumpMemoryEnc();
24360 test_ret += test_xmlDocFormatDump();
24361 test_ret += test_xmlDocGetRootElement();
24362 test_ret += test_xmlDocSetRootElement();
24363 test_ret += test_xmlElemDump();
24364 test_ret += test_xmlFirstElementChild();
24365 test_ret += test_xmlGetBufferAllocationScheme();
24366 test_ret += test_xmlGetCompressMode();
24367 test_ret += test_xmlGetDocCompressMode();
24368 test_ret += test_xmlGetIntSubset();
24369 test_ret += test_xmlGetLastChild();
24370 test_ret += test_xmlGetLineNo();
24371 test_ret += test_xmlGetNoNsProp();
24372 test_ret += test_xmlGetNodePath();
24373 test_ret += test_xmlGetNsList();
24374 test_ret += test_xmlGetNsProp();
24375 test_ret += test_xmlGetProp();
24376 test_ret += test_xmlHasNsProp();
24377 test_ret += test_xmlHasProp();
24378 test_ret += test_xmlIsBlankNode();
24379 test_ret += test_xmlIsXHTML();
24380 test_ret += test_xmlLastElementChild();
24381 test_ret += test_xmlNewCDataBlock();
24382 test_ret += test_xmlNewCharRef();
24383 test_ret += test_xmlNewChild();
24384 test_ret += test_xmlNewComment();
24385 test_ret += test_xmlNewDoc();
24386 test_ret += test_xmlNewDocComment();
24387 test_ret += test_xmlNewDocFragment();
24388 test_ret += test_xmlNewDocNode();
24389 test_ret += test_xmlNewDocNodeEatName();
24390 test_ret += test_xmlNewDocPI();
24391 test_ret += test_xmlNewDocProp();
24392 test_ret += test_xmlNewDocRawNode();
24393 test_ret += test_xmlNewDocText();
24394 test_ret += test_xmlNewDocTextLen();
24395 test_ret += test_xmlNewDtd();
24396 test_ret += test_xmlNewNode();
24397 test_ret += test_xmlNewNodeEatName();
24398 test_ret += test_xmlNewNs();
24399 test_ret += test_xmlNewNsProp();
24400 test_ret += test_xmlNewNsPropEatName();
24401 test_ret += test_xmlNewPI();
24402 test_ret += test_xmlNewProp();
24403 test_ret += test_xmlNewReference();
24404 test_ret += test_xmlNewText();
24405 test_ret += test_xmlNewTextChild();
24406 test_ret += test_xmlNewTextLen();
24407 test_ret += test_xmlNextElementSibling();
24408 test_ret += test_xmlNodeAddContent();
24409 test_ret += test_xmlNodeAddContentLen();
24410 test_ret += test_xmlNodeBufGetContent();
24411 test_ret += test_xmlNodeDump();
24412 test_ret += test_xmlNodeDumpOutput();
24413 test_ret += test_xmlNodeGetBase();
24414 test_ret += test_xmlNodeGetContent();
24415 test_ret += test_xmlNodeGetLang();
24416 test_ret += test_xmlNodeGetSpacePreserve();
24417 test_ret += test_xmlNodeIsText();
24418 test_ret += test_xmlNodeListGetRawString();
24419 test_ret += test_xmlNodeListGetString();
24420 test_ret += test_xmlNodeSetBase();
24421 test_ret += test_xmlNodeSetContent();
24422 test_ret += test_xmlNodeSetContentLen();
24423 test_ret += test_xmlNodeSetLang();
24424 test_ret += test_xmlNodeSetName();
24425 test_ret += test_xmlNodeSetSpacePreserve();
24426 test_ret += test_xmlPreviousElementSibling();
24427 test_ret += test_xmlReconciliateNs();
24428 test_ret += test_xmlRemoveProp();
24429 test_ret += test_xmlReplaceNode();
24430 test_ret += test_xmlSaveFile();
24431 test_ret += test_xmlSaveFileEnc();
24432 test_ret += test_xmlSaveFileTo();
24433 test_ret += test_xmlSaveFormatFile();
24434 test_ret += test_xmlSaveFormatFileEnc();
24435 test_ret += test_xmlSaveFormatFileTo();
24436 test_ret += test_xmlSearchNs();
24437 test_ret += test_xmlSearchNsByHref();
24438 test_ret += test_xmlSetBufferAllocationScheme();
24439 test_ret += test_xmlSetCompressMode();
24440 test_ret += test_xmlSetDocCompressMode();
24441 test_ret += test_xmlSetNs();
24442 test_ret += test_xmlSetNsProp();
24443 test_ret += test_xmlSetProp();
24444 test_ret += test_xmlSplitQName2();
24445 test_ret += test_xmlSplitQName3();
24446 test_ret += test_xmlStringGetNodeList();
24447 test_ret += test_xmlStringLenGetNodeList();
24448 test_ret += test_xmlTextConcat();
24449 test_ret += test_xmlTextMerge();
24450 test_ret += test_xmlUnsetNsProp();
24451 test_ret += test_xmlUnsetProp();
24452 test_ret += test_xmlValidateNCName();
24453 test_ret += test_xmlValidateNMToken();
24454 test_ret += test_xmlValidateName();
24455 test_ret += test_xmlValidateQName();
24458 printf("Module tree: %d errors\n", test_ret);
24463 test_xmlBuildRelativeURI(void) {
24468 xmlChar * URI; /* the URI reference under consideration */
24470 xmlChar * base; /* the base value */
24473 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24474 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24475 mem_base = xmlMemBlocks();
24476 URI = gen_const_xmlChar_ptr(n_URI, 0);
24477 base = gen_const_xmlChar_ptr(n_base, 1);
24479 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24480 desret_xmlChar_ptr(ret_val);
24482 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24483 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24484 xmlResetLastError();
24485 if (mem_base != xmlMemBlocks()) {
24486 printf("Leak of %d blocks found in xmlBuildRelativeURI",
24487 xmlMemBlocks() - mem_base);
24489 printf(" %d", n_URI);
24490 printf(" %d", n_base);
24502 test_xmlBuildURI(void) {
24507 xmlChar * URI; /* the URI instance found in the document */
24509 xmlChar * base; /* the base value */
24512 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24513 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24514 mem_base = xmlMemBlocks();
24515 URI = gen_const_xmlChar_ptr(n_URI, 0);
24516 base = gen_const_xmlChar_ptr(n_base, 1);
24518 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24519 desret_xmlChar_ptr(ret_val);
24521 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24522 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24523 xmlResetLastError();
24524 if (mem_base != xmlMemBlocks()) {
24525 printf("Leak of %d blocks found in xmlBuildURI",
24526 xmlMemBlocks() - mem_base);
24528 printf(" %d", n_URI);
24529 printf(" %d", n_base);
24541 test_xmlCanonicPath(void) {
24546 xmlChar * path; /* the resource locator in a filesystem notation */
24549 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24550 mem_base = xmlMemBlocks();
24551 path = gen_const_xmlChar_ptr(n_path, 0);
24553 ret_val = xmlCanonicPath((const xmlChar *)path);
24554 desret_xmlChar_ptr(ret_val);
24556 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24557 xmlResetLastError();
24558 if (mem_base != xmlMemBlocks()) {
24559 printf("Leak of %d blocks found in xmlCanonicPath",
24560 xmlMemBlocks() - mem_base);
24562 printf(" %d", n_path);
24573 test_xmlCreateURI(void) {
24577 /* missing type support */
24583 test_xmlNormalizeURIPath(void) {
24588 char * path; /* pointer to the path string */
24591 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24592 mem_base = xmlMemBlocks();
24593 path = gen_char_ptr(n_path, 0);
24595 ret_val = xmlNormalizeURIPath(path);
24596 desret_int(ret_val);
24598 des_char_ptr(n_path, path, 0);
24599 xmlResetLastError();
24600 if (mem_base != xmlMemBlocks()) {
24601 printf("Leak of %d blocks found in xmlNormalizeURIPath",
24602 xmlMemBlocks() - mem_base);
24604 printf(" %d", n_path);
24615 test_xmlParseURI(void) {
24619 /* missing type support */
24625 test_xmlParseURIRaw(void) {
24629 /* missing type support */
24634 #define gen_nb_xmlURIPtr 1
24635 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24638 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24642 test_xmlParseURIReference(void) {
24647 xmlURIPtr uri; /* pointer to an URI structure */
24649 char * str; /* the string to analyze */
24652 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24653 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24654 mem_base = xmlMemBlocks();
24655 uri = gen_xmlURIPtr(n_uri, 0);
24656 str = gen_const_char_ptr(n_str, 1);
24658 ret_val = xmlParseURIReference(uri, (const char *)str);
24659 desret_int(ret_val);
24661 des_xmlURIPtr(n_uri, uri, 0);
24662 des_const_char_ptr(n_str, (const char *)str, 1);
24663 xmlResetLastError();
24664 if (mem_base != xmlMemBlocks()) {
24665 printf("Leak of %d blocks found in xmlParseURIReference",
24666 xmlMemBlocks() - mem_base);
24668 printf(" %d", n_uri);
24669 printf(" %d", n_str);
24681 test_xmlPathToURI(void) {
24686 xmlChar * path; /* the resource locator in a filesystem notation */
24689 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24690 mem_base = xmlMemBlocks();
24691 path = gen_const_xmlChar_ptr(n_path, 0);
24693 ret_val = xmlPathToURI((const xmlChar *)path);
24694 desret_xmlChar_ptr(ret_val);
24696 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24697 xmlResetLastError();
24698 if (mem_base != xmlMemBlocks()) {
24699 printf("Leak of %d blocks found in xmlPathToURI",
24700 xmlMemBlocks() - mem_base);
24702 printf(" %d", n_path);
24713 test_xmlPrintURI(void) {
24717 FILE * stream; /* a FILE* for the output */
24719 xmlURIPtr uri; /* pointer to an xmlURI */
24722 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24723 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24724 mem_base = xmlMemBlocks();
24725 stream = gen_FILE_ptr(n_stream, 0);
24726 uri = gen_xmlURIPtr(n_uri, 1);
24728 xmlPrintURI(stream, uri);
24730 des_FILE_ptr(n_stream, stream, 0);
24731 des_xmlURIPtr(n_uri, uri, 1);
24732 xmlResetLastError();
24733 if (mem_base != xmlMemBlocks()) {
24734 printf("Leak of %d blocks found in xmlPrintURI",
24735 xmlMemBlocks() - mem_base);
24737 printf(" %d", n_stream);
24738 printf(" %d", n_uri);
24750 test_xmlSaveUri(void) {
24755 xmlURIPtr uri; /* pointer to an xmlURI */
24758 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24759 mem_base = xmlMemBlocks();
24760 uri = gen_xmlURIPtr(n_uri, 0);
24762 ret_val = xmlSaveUri(uri);
24763 desret_xmlChar_ptr(ret_val);
24765 des_xmlURIPtr(n_uri, uri, 0);
24766 xmlResetLastError();
24767 if (mem_base != xmlMemBlocks()) {
24768 printf("Leak of %d blocks found in xmlSaveUri",
24769 xmlMemBlocks() - mem_base);
24771 printf(" %d", n_uri);
24782 test_xmlURIEscape(void) {
24787 xmlChar * str; /* the string of the URI to escape */
24790 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24791 mem_base = xmlMemBlocks();
24792 str = gen_const_xmlChar_ptr(n_str, 0);
24794 ret_val = xmlURIEscape((const xmlChar *)str);
24795 desret_xmlChar_ptr(ret_val);
24797 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24798 xmlResetLastError();
24799 if (mem_base != xmlMemBlocks()) {
24800 printf("Leak of %d blocks found in xmlURIEscape",
24801 xmlMemBlocks() - mem_base);
24803 printf(" %d", n_str);
24814 test_xmlURIEscapeStr(void) {
24819 xmlChar * str; /* string to escape */
24821 xmlChar * list; /* exception list string of chars not to escape */
24824 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24825 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24826 mem_base = xmlMemBlocks();
24827 str = gen_const_xmlChar_ptr(n_str, 0);
24828 list = gen_const_xmlChar_ptr(n_list, 1);
24830 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24831 desret_xmlChar_ptr(ret_val);
24833 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24834 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24835 xmlResetLastError();
24836 if (mem_base != xmlMemBlocks()) {
24837 printf("Leak of %d blocks found in xmlURIEscapeStr",
24838 xmlMemBlocks() - mem_base);
24840 printf(" %d", n_str);
24841 printf(" %d", n_list);
24853 test_xmlURIUnescapeString(void) {
24857 /* missing type support */
24865 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24866 test_ret += test_xmlBuildRelativeURI();
24867 test_ret += test_xmlBuildURI();
24868 test_ret += test_xmlCanonicPath();
24869 test_ret += test_xmlCreateURI();
24870 test_ret += test_xmlNormalizeURIPath();
24871 test_ret += test_xmlParseURI();
24872 test_ret += test_xmlParseURIRaw();
24873 test_ret += test_xmlParseURIReference();
24874 test_ret += test_xmlPathToURI();
24875 test_ret += test_xmlPrintURI();
24876 test_ret += test_xmlSaveUri();
24877 test_ret += test_xmlURIEscape();
24878 test_ret += test_xmlURIEscapeStr();
24879 test_ret += test_xmlURIUnescapeString();
24882 printf("Module uri: %d errors\n", test_ret);
24887 test_xmlAddAttributeDecl(void) {
24891 xmlAttributePtr ret_val;
24892 xmlValidCtxtPtr ctxt; /* the validation context */
24894 xmlDtdPtr dtd; /* pointer to the DTD */
24896 xmlChar * elem; /* the element name */
24898 xmlChar * name; /* the attribute name */
24900 xmlChar * ns; /* the attribute namespace prefix */
24902 xmlAttributeType type; /* the attribute type */
24904 xmlAttributeDefault def; /* the attribute default type */
24906 xmlChar * defaultValue; /* the attribute default value */
24907 int n_defaultValue;
24908 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24911 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24912 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24913 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24914 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24915 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24916 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24917 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24918 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24919 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24920 mem_base = xmlMemBlocks();
24921 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24922 dtd = gen_xmlDtdPtr(n_dtd, 1);
24923 elem = gen_const_xmlChar_ptr(n_elem, 2);
24924 name = gen_const_xmlChar_ptr(n_name, 3);
24925 ns = gen_const_xmlChar_ptr(n_ns, 4);
24926 type = gen_xmlAttributeType(n_type, 5);
24927 def = gen_xmlAttributeDefault(n_def, 6);
24928 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24929 tree = gen_xmlEnumerationPtr(n_tree, 8);
24931 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24932 desret_xmlAttributePtr(ret_val);
24934 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24935 des_xmlDtdPtr(n_dtd, dtd, 1);
24936 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24937 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24938 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24939 des_xmlAttributeType(n_type, type, 5);
24940 des_xmlAttributeDefault(n_def, def, 6);
24941 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24942 des_xmlEnumerationPtr(n_tree, tree, 8);
24943 xmlResetLastError();
24944 if (mem_base != xmlMemBlocks()) {
24945 printf("Leak of %d blocks found in xmlAddAttributeDecl",
24946 xmlMemBlocks() - mem_base);
24948 printf(" %d", n_ctxt);
24949 printf(" %d", n_dtd);
24950 printf(" %d", n_elem);
24951 printf(" %d", n_name);
24952 printf(" %d", n_ns);
24953 printf(" %d", n_type);
24954 printf(" %d", n_def);
24955 printf(" %d", n_defaultValue);
24956 printf(" %d", n_tree);
24975 test_xmlAddElementDecl(void) {
24979 xmlElementPtr ret_val;
24980 xmlValidCtxtPtr ctxt; /* the validation context */
24982 xmlDtdPtr dtd; /* pointer to the DTD */
24984 xmlChar * name; /* the entity name */
24986 xmlElementTypeVal type; /* the element type */
24988 xmlElementContentPtr content; /* the element content tree or NULL */
24991 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24992 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24993 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24994 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24995 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24996 mem_base = xmlMemBlocks();
24997 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24998 dtd = gen_xmlDtdPtr(n_dtd, 1);
24999 name = gen_const_xmlChar_ptr(n_name, 2);
25000 type = gen_xmlElementTypeVal(n_type, 3);
25001 content = gen_xmlElementContentPtr(n_content, 4);
25003 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
25004 desret_xmlElementPtr(ret_val);
25006 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25007 des_xmlDtdPtr(n_dtd, dtd, 1);
25008 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25009 des_xmlElementTypeVal(n_type, type, 3);
25010 des_xmlElementContentPtr(n_content, content, 4);
25011 xmlResetLastError();
25012 if (mem_base != xmlMemBlocks()) {
25013 printf("Leak of %d blocks found in xmlAddElementDecl",
25014 xmlMemBlocks() - mem_base);
25016 printf(" %d", n_ctxt);
25017 printf(" %d", n_dtd);
25018 printf(" %d", n_name);
25019 printf(" %d", n_type);
25020 printf(" %d", n_content);
25035 test_xmlAddID(void) {
25039 /* missing type support */
25045 test_xmlAddNotationDecl(void) {
25049 /* missing type support */
25055 test_xmlAddRef(void) {
25059 /* missing type support */
25064 #define gen_nb_xmlAttributeTablePtr 1
25065 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25068 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25072 test_xmlCopyAttributeTable(void) {
25076 /* missing type support */
25082 test_xmlCopyDocElementContent(void) {
25086 xmlElementContentPtr ret_val;
25087 xmlDocPtr doc; /* the document owning the element declaration */
25089 xmlElementContentPtr cur; /* An element content pointer. */
25092 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25093 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25094 mem_base = xmlMemBlocks();
25095 doc = gen_xmlDocPtr(n_doc, 0);
25096 cur = gen_xmlElementContentPtr(n_cur, 1);
25098 ret_val = xmlCopyDocElementContent(doc, cur);
25099 desret_xmlElementContentPtr(ret_val);
25101 des_xmlDocPtr(n_doc, doc, 0);
25102 des_xmlElementContentPtr(n_cur, cur, 1);
25103 xmlResetLastError();
25104 if (mem_base != xmlMemBlocks()) {
25105 printf("Leak of %d blocks found in xmlCopyDocElementContent",
25106 xmlMemBlocks() - mem_base);
25108 printf(" %d", n_doc);
25109 printf(" %d", n_cur);
25121 test_xmlCopyElementContent(void) {
25125 xmlElementContentPtr ret_val;
25126 xmlElementContentPtr cur; /* An element content pointer. */
25129 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25130 mem_base = xmlMemBlocks();
25131 cur = gen_xmlElementContentPtr(n_cur, 0);
25133 ret_val = xmlCopyElementContent(cur);
25134 desret_xmlElementContentPtr(ret_val);
25136 des_xmlElementContentPtr(n_cur, cur, 0);
25137 xmlResetLastError();
25138 if (mem_base != xmlMemBlocks()) {
25139 printf("Leak of %d blocks found in xmlCopyElementContent",
25140 xmlMemBlocks() - mem_base);
25142 printf(" %d", n_cur);
25152 #define gen_nb_xmlElementTablePtr 1
25153 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25156 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25160 test_xmlCopyElementTable(void) {
25164 /* missing type support */
25170 test_xmlCopyEnumeration(void) {
25174 /* missing type support */
25179 #define gen_nb_xmlNotationTablePtr 1
25180 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25183 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25187 test_xmlCopyNotationTable(void) {
25191 /* missing type support */
25197 test_xmlCreateEnumeration(void) {
25201 /* missing type support */
25206 #define gen_nb_xmlAttributePtr 1
25207 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25210 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25214 test_xmlDumpAttributeDecl(void) {
25217 #if defined(LIBXML_OUTPUT_ENABLED)
25219 xmlBufferPtr buf; /* the XML buffer output */
25221 xmlAttributePtr attr; /* An attribute declaration */
25224 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25225 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25226 mem_base = xmlMemBlocks();
25227 buf = gen_xmlBufferPtr(n_buf, 0);
25228 attr = gen_xmlAttributePtr(n_attr, 1);
25230 xmlDumpAttributeDecl(buf, attr);
25232 des_xmlBufferPtr(n_buf, buf, 0);
25233 des_xmlAttributePtr(n_attr, attr, 1);
25234 xmlResetLastError();
25235 if (mem_base != xmlMemBlocks()) {
25236 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25237 xmlMemBlocks() - mem_base);
25239 printf(" %d", n_buf);
25240 printf(" %d", n_attr);
25253 test_xmlDumpAttributeTable(void) {
25256 #if defined(LIBXML_OUTPUT_ENABLED)
25258 xmlBufferPtr buf; /* the XML buffer output */
25260 xmlAttributeTablePtr table; /* An attribute table */
25263 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25264 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25265 mem_base = xmlMemBlocks();
25266 buf = gen_xmlBufferPtr(n_buf, 0);
25267 table = gen_xmlAttributeTablePtr(n_table, 1);
25269 xmlDumpAttributeTable(buf, table);
25271 des_xmlBufferPtr(n_buf, buf, 0);
25272 des_xmlAttributeTablePtr(n_table, table, 1);
25273 xmlResetLastError();
25274 if (mem_base != xmlMemBlocks()) {
25275 printf("Leak of %d blocks found in xmlDumpAttributeTable",
25276 xmlMemBlocks() - mem_base);
25278 printf(" %d", n_buf);
25279 printf(" %d", n_table);
25291 #define gen_nb_xmlElementPtr 1
25292 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25295 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25299 test_xmlDumpElementDecl(void) {
25302 #if defined(LIBXML_OUTPUT_ENABLED)
25304 xmlBufferPtr buf; /* the XML buffer output */
25306 xmlElementPtr elem; /* An element table */
25309 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25310 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25311 mem_base = xmlMemBlocks();
25312 buf = gen_xmlBufferPtr(n_buf, 0);
25313 elem = gen_xmlElementPtr(n_elem, 1);
25315 xmlDumpElementDecl(buf, elem);
25317 des_xmlBufferPtr(n_buf, buf, 0);
25318 des_xmlElementPtr(n_elem, elem, 1);
25319 xmlResetLastError();
25320 if (mem_base != xmlMemBlocks()) {
25321 printf("Leak of %d blocks found in xmlDumpElementDecl",
25322 xmlMemBlocks() - mem_base);
25324 printf(" %d", n_buf);
25325 printf(" %d", n_elem);
25338 test_xmlDumpElementTable(void) {
25341 #if defined(LIBXML_OUTPUT_ENABLED)
25343 xmlBufferPtr buf; /* the XML buffer output */
25345 xmlElementTablePtr table; /* An element table */
25348 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25349 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25350 mem_base = xmlMemBlocks();
25351 buf = gen_xmlBufferPtr(n_buf, 0);
25352 table = gen_xmlElementTablePtr(n_table, 1);
25354 xmlDumpElementTable(buf, table);
25356 des_xmlBufferPtr(n_buf, buf, 0);
25357 des_xmlElementTablePtr(n_table, table, 1);
25358 xmlResetLastError();
25359 if (mem_base != xmlMemBlocks()) {
25360 printf("Leak of %d blocks found in xmlDumpElementTable",
25361 xmlMemBlocks() - mem_base);
25363 printf(" %d", n_buf);
25364 printf(" %d", n_table);
25376 #define gen_nb_xmlNotationPtr 1
25377 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25380 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25384 test_xmlDumpNotationDecl(void) {
25387 #if defined(LIBXML_OUTPUT_ENABLED)
25389 xmlBufferPtr buf; /* the XML buffer output */
25391 xmlNotationPtr nota; /* A notation declaration */
25394 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25395 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25396 mem_base = xmlMemBlocks();
25397 buf = gen_xmlBufferPtr(n_buf, 0);
25398 nota = gen_xmlNotationPtr(n_nota, 1);
25400 xmlDumpNotationDecl(buf, nota);
25402 des_xmlBufferPtr(n_buf, buf, 0);
25403 des_xmlNotationPtr(n_nota, nota, 1);
25404 xmlResetLastError();
25405 if (mem_base != xmlMemBlocks()) {
25406 printf("Leak of %d blocks found in xmlDumpNotationDecl",
25407 xmlMemBlocks() - mem_base);
25409 printf(" %d", n_buf);
25410 printf(" %d", n_nota);
25423 test_xmlDumpNotationTable(void) {
25426 #if defined(LIBXML_OUTPUT_ENABLED)
25428 xmlBufferPtr buf; /* the XML buffer output */
25430 xmlNotationTablePtr table; /* A notation table */
25433 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25434 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25435 mem_base = xmlMemBlocks();
25436 buf = gen_xmlBufferPtr(n_buf, 0);
25437 table = gen_xmlNotationTablePtr(n_table, 1);
25439 xmlDumpNotationTable(buf, table);
25441 des_xmlBufferPtr(n_buf, buf, 0);
25442 des_xmlNotationTablePtr(n_table, table, 1);
25443 xmlResetLastError();
25444 if (mem_base != xmlMemBlocks()) {
25445 printf("Leak of %d blocks found in xmlDumpNotationTable",
25446 xmlMemBlocks() - mem_base);
25448 printf(" %d", n_buf);
25449 printf(" %d", n_table);
25462 test_xmlGetDtdAttrDesc(void) {
25466 xmlAttributePtr ret_val;
25467 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25469 xmlChar * elem; /* the element name */
25471 xmlChar * name; /* the attribute name */
25474 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25475 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25476 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25477 mem_base = xmlMemBlocks();
25478 dtd = gen_xmlDtdPtr(n_dtd, 0);
25479 elem = gen_const_xmlChar_ptr(n_elem, 1);
25480 name = gen_const_xmlChar_ptr(n_name, 2);
25482 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25483 desret_xmlAttributePtr(ret_val);
25485 des_xmlDtdPtr(n_dtd, dtd, 0);
25486 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25487 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25488 xmlResetLastError();
25489 if (mem_base != xmlMemBlocks()) {
25490 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25491 xmlMemBlocks() - mem_base);
25493 printf(" %d", n_dtd);
25494 printf(" %d", n_elem);
25495 printf(" %d", n_name);
25508 test_xmlGetDtdElementDesc(void) {
25512 xmlElementPtr ret_val;
25513 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25515 xmlChar * name; /* the element name */
25518 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25519 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25520 mem_base = xmlMemBlocks();
25521 dtd = gen_xmlDtdPtr(n_dtd, 0);
25522 name = gen_const_xmlChar_ptr(n_name, 1);
25524 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25525 desret_xmlElementPtr(ret_val);
25527 des_xmlDtdPtr(n_dtd, dtd, 0);
25528 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25529 xmlResetLastError();
25530 if (mem_base != xmlMemBlocks()) {
25531 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25532 xmlMemBlocks() - mem_base);
25534 printf(" %d", n_dtd);
25535 printf(" %d", n_name);
25547 test_xmlGetDtdNotationDesc(void) {
25551 /* missing type support */
25557 test_xmlGetDtdQAttrDesc(void) {
25561 xmlAttributePtr ret_val;
25562 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25564 xmlChar * elem; /* the element name */
25566 xmlChar * name; /* the attribute name */
25568 xmlChar * prefix; /* the attribute namespace prefix */
25571 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25572 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25573 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25574 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25575 mem_base = xmlMemBlocks();
25576 dtd = gen_xmlDtdPtr(n_dtd, 0);
25577 elem = gen_const_xmlChar_ptr(n_elem, 1);
25578 name = gen_const_xmlChar_ptr(n_name, 2);
25579 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25581 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25582 desret_xmlAttributePtr(ret_val);
25584 des_xmlDtdPtr(n_dtd, dtd, 0);
25585 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25586 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25587 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25588 xmlResetLastError();
25589 if (mem_base != xmlMemBlocks()) {
25590 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25591 xmlMemBlocks() - mem_base);
25593 printf(" %d", n_dtd);
25594 printf(" %d", n_elem);
25595 printf(" %d", n_name);
25596 printf(" %d", n_prefix);
25610 test_xmlGetDtdQElementDesc(void) {
25614 xmlElementPtr ret_val;
25615 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25617 xmlChar * name; /* the element name */
25619 xmlChar * prefix; /* the element namespace prefix */
25622 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25623 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25624 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25625 mem_base = xmlMemBlocks();
25626 dtd = gen_xmlDtdPtr(n_dtd, 0);
25627 name = gen_const_xmlChar_ptr(n_name, 1);
25628 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25630 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25631 desret_xmlElementPtr(ret_val);
25633 des_xmlDtdPtr(n_dtd, dtd, 0);
25634 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25635 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25636 xmlResetLastError();
25637 if (mem_base != xmlMemBlocks()) {
25638 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25639 xmlMemBlocks() - mem_base);
25641 printf(" %d", n_dtd);
25642 printf(" %d", n_name);
25643 printf(" %d", n_prefix);
25656 test_xmlGetID(void) {
25660 xmlAttrPtr ret_val;
25661 xmlDocPtr doc; /* pointer to the document */
25663 xmlChar * ID; /* the ID value */
25666 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25667 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25668 mem_base = xmlMemBlocks();
25669 doc = gen_xmlDocPtr(n_doc, 0);
25670 ID = gen_const_xmlChar_ptr(n_ID, 1);
25672 ret_val = xmlGetID(doc, (const xmlChar *)ID);
25673 desret_xmlAttrPtr(ret_val);
25675 des_xmlDocPtr(n_doc, doc, 0);
25676 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25677 xmlResetLastError();
25678 if (mem_base != xmlMemBlocks()) {
25679 printf("Leak of %d blocks found in xmlGetID",
25680 xmlMemBlocks() - mem_base);
25682 printf(" %d", n_doc);
25683 printf(" %d", n_ID);
25695 test_xmlGetRefs(void) {
25699 /* missing type support */
25705 test_xmlIsID(void) {
25710 xmlDocPtr doc; /* the document */
25712 xmlNodePtr elem; /* the element carrying the attribute */
25714 xmlAttrPtr attr; /* the attribute */
25717 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25718 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25719 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25720 mem_base = xmlMemBlocks();
25721 doc = gen_xmlDocPtr(n_doc, 0);
25722 elem = gen_xmlNodePtr(n_elem, 1);
25723 attr = gen_xmlAttrPtr(n_attr, 2);
25725 ret_val = xmlIsID(doc, elem, attr);
25726 desret_int(ret_val);
25728 des_xmlDocPtr(n_doc, doc, 0);
25729 des_xmlNodePtr(n_elem, elem, 1);
25730 des_xmlAttrPtr(n_attr, attr, 2);
25731 xmlResetLastError();
25732 if (mem_base != xmlMemBlocks()) {
25733 printf("Leak of %d blocks found in xmlIsID",
25734 xmlMemBlocks() - mem_base);
25736 printf(" %d", n_doc);
25737 printf(" %d", n_elem);
25738 printf(" %d", n_attr);
25751 test_xmlIsMixedElement(void) {
25756 xmlDocPtr doc; /* the document */
25758 xmlChar * name; /* the element name */
25761 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25762 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25763 mem_base = xmlMemBlocks();
25764 doc = gen_xmlDocPtr(n_doc, 0);
25765 name = gen_const_xmlChar_ptr(n_name, 1);
25767 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25768 desret_int(ret_val);
25770 des_xmlDocPtr(n_doc, doc, 0);
25771 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25772 xmlResetLastError();
25773 if (mem_base != xmlMemBlocks()) {
25774 printf("Leak of %d blocks found in xmlIsMixedElement",
25775 xmlMemBlocks() - mem_base);
25777 printf(" %d", n_doc);
25778 printf(" %d", n_name);
25790 test_xmlIsRef(void) {
25795 xmlDocPtr doc; /* the document */
25797 xmlNodePtr elem; /* the element carrying the attribute */
25799 xmlAttrPtr attr; /* the attribute */
25802 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25803 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25804 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25805 mem_base = xmlMemBlocks();
25806 doc = gen_xmlDocPtr(n_doc, 0);
25807 elem = gen_xmlNodePtr(n_elem, 1);
25808 attr = gen_xmlAttrPtr(n_attr, 2);
25810 ret_val = xmlIsRef(doc, elem, attr);
25811 desret_int(ret_val);
25813 des_xmlDocPtr(n_doc, doc, 0);
25814 des_xmlNodePtr(n_elem, elem, 1);
25815 des_xmlAttrPtr(n_attr, attr, 2);
25816 xmlResetLastError();
25817 if (mem_base != xmlMemBlocks()) {
25818 printf("Leak of %d blocks found in xmlIsRef",
25819 xmlMemBlocks() - mem_base);
25821 printf(" %d", n_doc);
25822 printf(" %d", n_elem);
25823 printf(" %d", n_attr);
25836 test_xmlNewDocElementContent(void) {
25840 xmlElementContentPtr ret_val;
25841 xmlDocPtr doc; /* the document */
25843 xmlChar * name; /* the subelement name or NULL */
25845 xmlElementContentType type; /* the type of element content decl */
25848 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25849 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25850 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25851 mem_base = xmlMemBlocks();
25852 doc = gen_xmlDocPtr(n_doc, 0);
25853 name = gen_const_xmlChar_ptr(n_name, 1);
25854 type = gen_xmlElementContentType(n_type, 2);
25856 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25857 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25858 desret_xmlElementContentPtr(ret_val);
25860 des_xmlDocPtr(n_doc, doc, 0);
25861 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25862 des_xmlElementContentType(n_type, type, 2);
25863 xmlResetLastError();
25864 if (mem_base != xmlMemBlocks()) {
25865 printf("Leak of %d blocks found in xmlNewDocElementContent",
25866 xmlMemBlocks() - mem_base);
25868 printf(" %d", n_doc);
25869 printf(" %d", n_name);
25870 printf(" %d", n_type);
25883 test_xmlNewElementContent(void) {
25887 xmlElementContentPtr ret_val;
25888 xmlChar * name; /* the subelement name or NULL */
25890 xmlElementContentType type; /* the type of element content decl */
25893 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25894 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25895 mem_base = xmlMemBlocks();
25896 name = gen_const_xmlChar_ptr(n_name, 0);
25897 type = gen_xmlElementContentType(n_type, 1);
25899 ret_val = xmlNewElementContent((const xmlChar *)name, type);
25900 desret_xmlElementContentPtr(ret_val);
25902 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25903 des_xmlElementContentType(n_type, type, 1);
25904 xmlResetLastError();
25905 if (mem_base != xmlMemBlocks()) {
25906 printf("Leak of %d blocks found in xmlNewElementContent",
25907 xmlMemBlocks() - mem_base);
25909 printf(" %d", n_name);
25910 printf(" %d", n_type);
25922 test_xmlNewValidCtxt(void) {
25926 /* missing type support */
25932 test_xmlRemoveID(void) {
25937 xmlDocPtr doc; /* the document */
25939 xmlAttrPtr attr; /* the attribute */
25942 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25943 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25944 mem_base = xmlMemBlocks();
25945 doc = gen_xmlDocPtr(n_doc, 0);
25946 attr = gen_xmlAttrPtr(n_attr, 1);
25948 ret_val = xmlRemoveID(doc, attr);
25949 desret_int(ret_val);
25951 des_xmlDocPtr(n_doc, doc, 0);
25952 des_xmlAttrPtr(n_attr, attr, 1);
25953 xmlResetLastError();
25954 if (mem_base != xmlMemBlocks()) {
25955 printf("Leak of %d blocks found in xmlRemoveID",
25956 xmlMemBlocks() - mem_base);
25958 printf(" %d", n_doc);
25959 printf(" %d", n_attr);
25971 test_xmlRemoveRef(void) {
25976 xmlDocPtr doc; /* the document */
25978 xmlAttrPtr attr; /* the attribute */
25981 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25982 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25983 mem_base = xmlMemBlocks();
25984 doc = gen_xmlDocPtr(n_doc, 0);
25985 attr = gen_xmlAttrPtr(n_attr, 1);
25987 ret_val = xmlRemoveRef(doc, attr);
25988 desret_int(ret_val);
25990 des_xmlDocPtr(n_doc, doc, 0);
25991 des_xmlAttrPtr(n_attr, attr, 1);
25992 xmlResetLastError();
25993 if (mem_base != xmlMemBlocks()) {
25994 printf("Leak of %d blocks found in xmlRemoveRef",
25995 xmlMemBlocks() - mem_base);
25997 printf(" %d", n_doc);
25998 printf(" %d", n_attr);
26010 test_xmlSnprintfElementContent(void) {
26014 char * buf; /* an output buffer */
26016 int size; /* the buffer size */
26018 xmlElementContentPtr content; /* An element table */
26020 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26023 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26024 for (n_size = 0;n_size < gen_nb_int;n_size++) {
26025 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26026 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26027 mem_base = xmlMemBlocks();
26028 buf = gen_char_ptr(n_buf, 0);
26029 size = gen_int(n_size, 1);
26030 content = gen_xmlElementContentPtr(n_content, 2);
26031 englob = gen_int(n_englob, 3);
26033 xmlSnprintfElementContent(buf, size, content, englob);
26035 des_char_ptr(n_buf, buf, 0);
26036 des_int(n_size, size, 1);
26037 des_xmlElementContentPtr(n_content, content, 2);
26038 des_int(n_englob, englob, 3);
26039 xmlResetLastError();
26040 if (mem_base != xmlMemBlocks()) {
26041 printf("Leak of %d blocks found in xmlSnprintfElementContent",
26042 xmlMemBlocks() - mem_base);
26044 printf(" %d", n_buf);
26045 printf(" %d", n_size);
26046 printf(" %d", n_content);
26047 printf(" %d", n_englob);
26061 test_xmlSprintfElementContent(void) {
26064 #if defined(LIBXML_OUTPUT_ENABLED)
26065 #ifdef LIBXML_OUTPUT_ENABLED
26067 char * buf; /* an output buffer */
26069 xmlElementContentPtr content; /* An element table */
26071 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26074 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26075 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26076 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26077 mem_base = xmlMemBlocks();
26078 buf = gen_char_ptr(n_buf, 0);
26079 content = gen_xmlElementContentPtr(n_content, 1);
26080 englob = gen_int(n_englob, 2);
26082 xmlSprintfElementContent(buf, content, englob);
26084 des_char_ptr(n_buf, buf, 0);
26085 des_xmlElementContentPtr(n_content, content, 1);
26086 des_int(n_englob, englob, 2);
26087 xmlResetLastError();
26088 if (mem_base != xmlMemBlocks()) {
26089 printf("Leak of %d blocks found in xmlSprintfElementContent",
26090 xmlMemBlocks() - mem_base);
26092 printf(" %d", n_buf);
26093 printf(" %d", n_content);
26094 printf(" %d", n_englob);
26109 test_xmlValidBuildContentModel(void) {
26112 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26115 xmlValidCtxtPtr ctxt; /* a validation context */
26117 xmlElementPtr elem; /* an element declaration node */
26120 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26121 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26122 mem_base = xmlMemBlocks();
26123 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26124 elem = gen_xmlElementPtr(n_elem, 1);
26126 ret_val = xmlValidBuildContentModel(ctxt, elem);
26127 desret_int(ret_val);
26129 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26130 des_xmlElementPtr(n_elem, elem, 1);
26131 xmlResetLastError();
26132 if (mem_base != xmlMemBlocks()) {
26133 printf("Leak of %d blocks found in xmlValidBuildContentModel",
26134 xmlMemBlocks() - mem_base);
26136 printf(" %d", n_ctxt);
26137 printf(" %d", n_elem);
26150 test_xmlValidCtxtNormalizeAttributeValue(void) {
26153 #if defined(LIBXML_VALID_ENABLED)
26156 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26158 xmlDocPtr doc; /* the document */
26160 xmlNodePtr elem; /* the parent */
26162 xmlChar * name; /* the attribute name */
26164 xmlChar * value; /* the attribute value */
26167 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26168 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26169 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26170 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26171 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26172 mem_base = xmlMemBlocks();
26173 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26174 doc = gen_xmlDocPtr(n_doc, 1);
26175 elem = gen_xmlNodePtr(n_elem, 2);
26176 name = gen_const_xmlChar_ptr(n_name, 3);
26177 value = gen_const_xmlChar_ptr(n_value, 4);
26179 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26180 desret_xmlChar_ptr(ret_val);
26182 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26183 des_xmlDocPtr(n_doc, doc, 1);
26184 des_xmlNodePtr(n_elem, elem, 2);
26185 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26186 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26187 xmlResetLastError();
26188 if (mem_base != xmlMemBlocks()) {
26189 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26190 xmlMemBlocks() - mem_base);
26192 printf(" %d", n_ctxt);
26193 printf(" %d", n_doc);
26194 printf(" %d", n_elem);
26195 printf(" %d", n_name);
26196 printf(" %d", n_value);
26211 #define gen_nb_xmlElementContent_ptr 1
26212 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26215 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26219 test_xmlValidGetPotentialChildren(void) {
26222 #if defined(LIBXML_VALID_ENABLED)
26223 #ifdef LIBXML_VALID_ENABLED
26226 xmlElementContent * ctree; /* an element content tree */
26228 xmlChar ** names; /* an array to store the list of child names */
26230 int * len; /* a pointer to the number of element in the list */
26232 int max; /* the size of the array */
26235 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26236 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26237 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26238 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26239 mem_base = xmlMemBlocks();
26240 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26241 names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26242 len = gen_int_ptr(n_len, 2);
26243 max = gen_int(n_max, 3);
26245 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26246 desret_int(ret_val);
26248 des_xmlElementContent_ptr(n_ctree, ctree, 0);
26249 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26250 des_int_ptr(n_len, len, 2);
26251 des_int(n_max, max, 3);
26252 xmlResetLastError();
26253 if (mem_base != xmlMemBlocks()) {
26254 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26255 xmlMemBlocks() - mem_base);
26257 printf(" %d", n_ctree);
26258 printf(" %d", n_names);
26259 printf(" %d", n_len);
26260 printf(" %d", n_max);
26276 test_xmlValidGetValidElements(void) {
26279 #if defined(LIBXML_VALID_ENABLED)
26280 #ifdef LIBXML_VALID_ENABLED
26283 xmlNode * prev; /* an element to insert after */
26285 xmlNode * next; /* an element to insert next */
26287 xmlChar ** names; /* an array to store the list of child names */
26289 int max; /* the size of the array */
26292 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26293 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26294 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26295 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26296 mem_base = xmlMemBlocks();
26297 prev = gen_xmlNodePtr(n_prev, 0);
26298 next = gen_xmlNodePtr(n_next, 1);
26299 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26300 max = gen_int(n_max, 3);
26302 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26303 desret_int(ret_val);
26305 des_xmlNodePtr(n_prev, prev, 0);
26306 des_xmlNodePtr(n_next, next, 1);
26307 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26308 des_int(n_max, max, 3);
26309 xmlResetLastError();
26310 if (mem_base != xmlMemBlocks()) {
26311 printf("Leak of %d blocks found in xmlValidGetValidElements",
26312 xmlMemBlocks() - mem_base);
26314 printf(" %d", n_prev);
26315 printf(" %d", n_next);
26316 printf(" %d", n_names);
26317 printf(" %d", n_max);
26333 test_xmlValidNormalizeAttributeValue(void) {
26336 #if defined(LIBXML_VALID_ENABLED)
26339 xmlDocPtr doc; /* the document */
26341 xmlNodePtr elem; /* the parent */
26343 xmlChar * name; /* the attribute name */
26345 xmlChar * value; /* the attribute value */
26348 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26349 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26350 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26351 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26352 mem_base = xmlMemBlocks();
26353 doc = gen_xmlDocPtr(n_doc, 0);
26354 elem = gen_xmlNodePtr(n_elem, 1);
26355 name = gen_const_xmlChar_ptr(n_name, 2);
26356 value = gen_const_xmlChar_ptr(n_value, 3);
26358 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26359 desret_xmlChar_ptr(ret_val);
26361 des_xmlDocPtr(n_doc, doc, 0);
26362 des_xmlNodePtr(n_elem, elem, 1);
26363 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26364 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26365 xmlResetLastError();
26366 if (mem_base != xmlMemBlocks()) {
26367 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26368 xmlMemBlocks() - mem_base);
26370 printf(" %d", n_doc);
26371 printf(" %d", n_elem);
26372 printf(" %d", n_name);
26373 printf(" %d", n_value);
26388 test_xmlValidateAttributeDecl(void) {
26391 #if defined(LIBXML_VALID_ENABLED)
26394 xmlValidCtxtPtr ctxt; /* the validation context */
26396 xmlDocPtr doc; /* a document instance */
26398 xmlAttributePtr attr; /* an attribute definition */
26401 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26402 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26403 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26404 mem_base = xmlMemBlocks();
26405 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26406 doc = gen_xmlDocPtr(n_doc, 1);
26407 attr = gen_xmlAttributePtr(n_attr, 2);
26409 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26410 desret_int(ret_val);
26412 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26413 des_xmlDocPtr(n_doc, doc, 1);
26414 des_xmlAttributePtr(n_attr, attr, 2);
26415 xmlResetLastError();
26416 if (mem_base != xmlMemBlocks()) {
26417 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26418 xmlMemBlocks() - mem_base);
26420 printf(" %d", n_ctxt);
26421 printf(" %d", n_doc);
26422 printf(" %d", n_attr);
26436 test_xmlValidateAttributeValue(void) {
26439 #if defined(LIBXML_VALID_ENABLED)
26442 xmlAttributeType type; /* an attribute type */
26444 xmlChar * value; /* an attribute value */
26447 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26448 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26449 mem_base = xmlMemBlocks();
26450 type = gen_xmlAttributeType(n_type, 0);
26451 value = gen_const_xmlChar_ptr(n_value, 1);
26453 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26454 desret_int(ret_val);
26456 des_xmlAttributeType(n_type, type, 0);
26457 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26458 xmlResetLastError();
26459 if (mem_base != xmlMemBlocks()) {
26460 printf("Leak of %d blocks found in xmlValidateAttributeValue",
26461 xmlMemBlocks() - mem_base);
26463 printf(" %d", n_type);
26464 printf(" %d", n_value);
26477 test_xmlValidateDocument(void) {
26480 #if defined(LIBXML_VALID_ENABLED)
26483 xmlValidCtxtPtr ctxt; /* the validation context */
26485 xmlDocPtr doc; /* a document instance */
26488 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26489 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26490 mem_base = xmlMemBlocks();
26491 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26492 doc = gen_xmlDocPtr(n_doc, 1);
26494 ret_val = xmlValidateDocument(ctxt, doc);
26495 desret_int(ret_val);
26497 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26498 des_xmlDocPtr(n_doc, doc, 1);
26499 xmlResetLastError();
26500 if (mem_base != xmlMemBlocks()) {
26501 printf("Leak of %d blocks found in xmlValidateDocument",
26502 xmlMemBlocks() - mem_base);
26504 printf(" %d", n_ctxt);
26505 printf(" %d", n_doc);
26518 test_xmlValidateDocumentFinal(void) {
26521 #if defined(LIBXML_VALID_ENABLED)
26524 xmlValidCtxtPtr ctxt; /* the validation context */
26526 xmlDocPtr doc; /* a document instance */
26529 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26530 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26531 mem_base = xmlMemBlocks();
26532 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26533 doc = gen_xmlDocPtr(n_doc, 1);
26535 ret_val = xmlValidateDocumentFinal(ctxt, doc);
26536 desret_int(ret_val);
26538 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26539 des_xmlDocPtr(n_doc, doc, 1);
26540 xmlResetLastError();
26541 if (mem_base != xmlMemBlocks()) {
26542 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26543 xmlMemBlocks() - mem_base);
26545 printf(" %d", n_ctxt);
26546 printf(" %d", n_doc);
26559 test_xmlValidateDtd(void) {
26562 #if defined(LIBXML_VALID_ENABLED)
26565 xmlValidCtxtPtr ctxt; /* the validation context */
26567 xmlDocPtr doc; /* a document instance */
26569 xmlDtdPtr dtd; /* a dtd instance */
26572 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26573 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26574 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26575 mem_base = xmlMemBlocks();
26576 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26577 doc = gen_xmlDocPtr(n_doc, 1);
26578 dtd = gen_xmlDtdPtr(n_dtd, 2);
26580 ret_val = xmlValidateDtd(ctxt, doc, dtd);
26581 desret_int(ret_val);
26583 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26584 des_xmlDocPtr(n_doc, doc, 1);
26585 des_xmlDtdPtr(n_dtd, dtd, 2);
26586 xmlResetLastError();
26587 if (mem_base != xmlMemBlocks()) {
26588 printf("Leak of %d blocks found in xmlValidateDtd",
26589 xmlMemBlocks() - mem_base);
26591 printf(" %d", n_ctxt);
26592 printf(" %d", n_doc);
26593 printf(" %d", n_dtd);
26607 test_xmlValidateDtdFinal(void) {
26610 #if defined(LIBXML_VALID_ENABLED)
26613 xmlValidCtxtPtr ctxt; /* the validation context */
26615 xmlDocPtr doc; /* a document instance */
26618 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26619 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26620 mem_base = xmlMemBlocks();
26621 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26622 doc = gen_xmlDocPtr(n_doc, 1);
26624 ret_val = xmlValidateDtdFinal(ctxt, doc);
26625 desret_int(ret_val);
26627 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26628 des_xmlDocPtr(n_doc, doc, 1);
26629 xmlResetLastError();
26630 if (mem_base != xmlMemBlocks()) {
26631 printf("Leak of %d blocks found in xmlValidateDtdFinal",
26632 xmlMemBlocks() - mem_base);
26634 printf(" %d", n_ctxt);
26635 printf(" %d", n_doc);
26648 test_xmlValidateElement(void) {
26651 #if defined(LIBXML_VALID_ENABLED)
26654 xmlValidCtxtPtr ctxt; /* the validation context */
26656 xmlDocPtr doc; /* a document instance */
26658 xmlNodePtr elem; /* an element instance */
26661 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26662 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26663 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26664 mem_base = xmlMemBlocks();
26665 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26666 doc = gen_xmlDocPtr(n_doc, 1);
26667 elem = gen_xmlNodePtr(n_elem, 2);
26669 ret_val = xmlValidateElement(ctxt, doc, elem);
26670 desret_int(ret_val);
26672 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26673 des_xmlDocPtr(n_doc, doc, 1);
26674 des_xmlNodePtr(n_elem, elem, 2);
26675 xmlResetLastError();
26676 if (mem_base != xmlMemBlocks()) {
26677 printf("Leak of %d blocks found in xmlValidateElement",
26678 xmlMemBlocks() - mem_base);
26680 printf(" %d", n_ctxt);
26681 printf(" %d", n_doc);
26682 printf(" %d", n_elem);
26696 test_xmlValidateElementDecl(void) {
26699 #if defined(LIBXML_VALID_ENABLED)
26702 xmlValidCtxtPtr ctxt; /* the validation context */
26704 xmlDocPtr doc; /* a document instance */
26706 xmlElementPtr elem; /* an element definition */
26709 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26710 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26711 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26712 mem_base = xmlMemBlocks();
26713 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26714 doc = gen_xmlDocPtr(n_doc, 1);
26715 elem = gen_xmlElementPtr(n_elem, 2);
26717 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26718 desret_int(ret_val);
26720 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26721 des_xmlDocPtr(n_doc, doc, 1);
26722 des_xmlElementPtr(n_elem, elem, 2);
26723 xmlResetLastError();
26724 if (mem_base != xmlMemBlocks()) {
26725 printf("Leak of %d blocks found in xmlValidateElementDecl",
26726 xmlMemBlocks() - mem_base);
26728 printf(" %d", n_ctxt);
26729 printf(" %d", n_doc);
26730 printf(" %d", n_elem);
26744 test_xmlValidateNameValue(void) {
26747 #if defined(LIBXML_VALID_ENABLED)
26750 xmlChar * value; /* an Name value */
26753 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26754 mem_base = xmlMemBlocks();
26755 value = gen_const_xmlChar_ptr(n_value, 0);
26757 ret_val = xmlValidateNameValue((const xmlChar *)value);
26758 desret_int(ret_val);
26760 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26761 xmlResetLastError();
26762 if (mem_base != xmlMemBlocks()) {
26763 printf("Leak of %d blocks found in xmlValidateNameValue",
26764 xmlMemBlocks() - mem_base);
26766 printf(" %d", n_value);
26778 test_xmlValidateNamesValue(void) {
26781 #if defined(LIBXML_VALID_ENABLED)
26784 xmlChar * value; /* an Names value */
26787 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26788 mem_base = xmlMemBlocks();
26789 value = gen_const_xmlChar_ptr(n_value, 0);
26791 ret_val = xmlValidateNamesValue((const xmlChar *)value);
26792 desret_int(ret_val);
26794 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26795 xmlResetLastError();
26796 if (mem_base != xmlMemBlocks()) {
26797 printf("Leak of %d blocks found in xmlValidateNamesValue",
26798 xmlMemBlocks() - mem_base);
26800 printf(" %d", n_value);
26812 test_xmlValidateNmtokenValue(void) {
26815 #if defined(LIBXML_VALID_ENABLED)
26818 xmlChar * value; /* an Nmtoken value */
26821 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26822 mem_base = xmlMemBlocks();
26823 value = gen_const_xmlChar_ptr(n_value, 0);
26825 ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26826 desret_int(ret_val);
26828 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26829 xmlResetLastError();
26830 if (mem_base != xmlMemBlocks()) {
26831 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26832 xmlMemBlocks() - mem_base);
26834 printf(" %d", n_value);
26846 test_xmlValidateNmtokensValue(void) {
26849 #if defined(LIBXML_VALID_ENABLED)
26852 xmlChar * value; /* an Nmtokens value */
26855 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26856 mem_base = xmlMemBlocks();
26857 value = gen_const_xmlChar_ptr(n_value, 0);
26859 ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26860 desret_int(ret_val);
26862 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26863 xmlResetLastError();
26864 if (mem_base != xmlMemBlocks()) {
26865 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26866 xmlMemBlocks() - mem_base);
26868 printf(" %d", n_value);
26880 test_xmlValidateNotationDecl(void) {
26883 #if defined(LIBXML_VALID_ENABLED)
26886 xmlValidCtxtPtr ctxt; /* the validation context */
26888 xmlDocPtr doc; /* a document instance */
26890 xmlNotationPtr nota; /* a notation definition */
26893 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26894 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26895 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26896 mem_base = xmlMemBlocks();
26897 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26898 doc = gen_xmlDocPtr(n_doc, 1);
26899 nota = gen_xmlNotationPtr(n_nota, 2);
26901 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26902 desret_int(ret_val);
26904 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26905 des_xmlDocPtr(n_doc, doc, 1);
26906 des_xmlNotationPtr(n_nota, nota, 2);
26907 xmlResetLastError();
26908 if (mem_base != xmlMemBlocks()) {
26909 printf("Leak of %d blocks found in xmlValidateNotationDecl",
26910 xmlMemBlocks() - mem_base);
26912 printf(" %d", n_ctxt);
26913 printf(" %d", n_doc);
26914 printf(" %d", n_nota);
26928 test_xmlValidateNotationUse(void) {
26931 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26934 xmlValidCtxtPtr ctxt; /* the validation context */
26936 xmlDocPtr doc; /* the document */
26938 xmlChar * notationName; /* the notation name to check */
26939 int n_notationName;
26941 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26942 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26943 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26944 mem_base = xmlMemBlocks();
26945 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26946 doc = gen_xmlDocPtr(n_doc, 1);
26947 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26949 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26950 desret_int(ret_val);
26952 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26953 des_xmlDocPtr(n_doc, doc, 1);
26954 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26955 xmlResetLastError();
26956 if (mem_base != xmlMemBlocks()) {
26957 printf("Leak of %d blocks found in xmlValidateNotationUse",
26958 xmlMemBlocks() - mem_base);
26960 printf(" %d", n_ctxt);
26961 printf(" %d", n_doc);
26962 printf(" %d", n_notationName);
26976 test_xmlValidateOneAttribute(void) {
26979 #if defined(LIBXML_VALID_ENABLED)
26982 xmlValidCtxtPtr ctxt; /* the validation context */
26984 xmlDocPtr doc; /* a document instance */
26986 xmlNodePtr elem; /* an element instance */
26988 xmlAttrPtr attr; /* an attribute instance */
26990 xmlChar * value; /* the attribute value (without entities processing) */
26993 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26994 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26995 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26996 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26997 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26998 mem_base = xmlMemBlocks();
26999 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27000 doc = gen_xmlDocPtr(n_doc, 1);
27001 elem = gen_xmlNodePtr(n_elem, 2);
27002 attr = gen_xmlAttrPtr(n_attr, 3);
27003 value = gen_const_xmlChar_ptr(n_value, 4);
27005 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
27006 desret_int(ret_val);
27008 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27009 des_xmlDocPtr(n_doc, doc, 1);
27010 des_xmlNodePtr(n_elem, elem, 2);
27011 des_xmlAttrPtr(n_attr, attr, 3);
27012 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
27013 xmlResetLastError();
27014 if (mem_base != xmlMemBlocks()) {
27015 printf("Leak of %d blocks found in xmlValidateOneAttribute",
27016 xmlMemBlocks() - mem_base);
27018 printf(" %d", n_ctxt);
27019 printf(" %d", n_doc);
27020 printf(" %d", n_elem);
27021 printf(" %d", n_attr);
27022 printf(" %d", n_value);
27038 test_xmlValidateOneElement(void) {
27041 #if defined(LIBXML_VALID_ENABLED)
27044 xmlValidCtxtPtr ctxt; /* the validation context */
27046 xmlDocPtr doc; /* a document instance */
27048 xmlNodePtr elem; /* an element instance */
27051 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27052 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27053 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27054 mem_base = xmlMemBlocks();
27055 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27056 doc = gen_xmlDocPtr(n_doc, 1);
27057 elem = gen_xmlNodePtr(n_elem, 2);
27059 ret_val = xmlValidateOneElement(ctxt, doc, elem);
27060 desret_int(ret_val);
27062 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27063 des_xmlDocPtr(n_doc, doc, 1);
27064 des_xmlNodePtr(n_elem, elem, 2);
27065 xmlResetLastError();
27066 if (mem_base != xmlMemBlocks()) {
27067 printf("Leak of %d blocks found in xmlValidateOneElement",
27068 xmlMemBlocks() - mem_base);
27070 printf(" %d", n_ctxt);
27071 printf(" %d", n_doc);
27072 printf(" %d", n_elem);
27086 test_xmlValidateOneNamespace(void) {
27089 #if defined(LIBXML_VALID_ENABLED)
27092 xmlValidCtxtPtr ctxt; /* the validation context */
27094 xmlDocPtr doc; /* a document instance */
27096 xmlNodePtr elem; /* an element instance */
27098 xmlChar * prefix; /* the namespace prefix */
27100 xmlNsPtr ns; /* an namespace declaration instance */
27102 xmlChar * value; /* the attribute value (without entities processing) */
27105 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27106 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27107 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27108 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
27109 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
27110 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27111 mem_base = xmlMemBlocks();
27112 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27113 doc = gen_xmlDocPtr(n_doc, 1);
27114 elem = gen_xmlNodePtr(n_elem, 2);
27115 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
27116 ns = gen_xmlNsPtr(n_ns, 4);
27117 value = gen_const_xmlChar_ptr(n_value, 5);
27119 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
27120 desret_int(ret_val);
27122 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27123 des_xmlDocPtr(n_doc, doc, 1);
27124 des_xmlNodePtr(n_elem, elem, 2);
27125 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27126 des_xmlNsPtr(n_ns, ns, 4);
27127 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27128 xmlResetLastError();
27129 if (mem_base != xmlMemBlocks()) {
27130 printf("Leak of %d blocks found in xmlValidateOneNamespace",
27131 xmlMemBlocks() - mem_base);
27133 printf(" %d", n_ctxt);
27134 printf(" %d", n_doc);
27135 printf(" %d", n_elem);
27136 printf(" %d", n_prefix);
27137 printf(" %d", n_ns);
27138 printf(" %d", n_value);
27155 test_xmlValidatePopElement(void) {
27158 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27161 xmlValidCtxtPtr ctxt; /* the validation context */
27163 xmlDocPtr doc; /* a document instance */
27165 xmlNodePtr elem; /* an element instance */
27167 xmlChar * qname; /* the qualified name as appearing in the serialization */
27170 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27171 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27172 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27173 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27174 mem_base = xmlMemBlocks();
27175 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27176 doc = gen_xmlDocPtr(n_doc, 1);
27177 elem = gen_xmlNodePtr(n_elem, 2);
27178 qname = gen_const_xmlChar_ptr(n_qname, 3);
27180 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27181 desret_int(ret_val);
27183 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27184 des_xmlDocPtr(n_doc, doc, 1);
27185 des_xmlNodePtr(n_elem, elem, 2);
27186 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27187 xmlResetLastError();
27188 if (mem_base != xmlMemBlocks()) {
27189 printf("Leak of %d blocks found in xmlValidatePopElement",
27190 xmlMemBlocks() - mem_base);
27192 printf(" %d", n_ctxt);
27193 printf(" %d", n_doc);
27194 printf(" %d", n_elem);
27195 printf(" %d", n_qname);
27210 test_xmlValidatePushCData(void) {
27213 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27216 xmlValidCtxtPtr ctxt; /* the validation context */
27218 xmlChar * data; /* some character data read */
27220 int len; /* the length of the data */
27223 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27224 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27225 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27226 mem_base = xmlMemBlocks();
27227 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27228 data = gen_const_xmlChar_ptr(n_data, 1);
27229 len = gen_int(n_len, 2);
27230 if ((data != NULL) &&
27231 (len > (int) strlen((const char *) data) + 1))
27234 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27235 desret_int(ret_val);
27237 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27238 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27239 des_int(n_len, len, 2);
27240 xmlResetLastError();
27241 if (mem_base != xmlMemBlocks()) {
27242 printf("Leak of %d blocks found in xmlValidatePushCData",
27243 xmlMemBlocks() - mem_base);
27245 printf(" %d", n_ctxt);
27246 printf(" %d", n_data);
27247 printf(" %d", n_len);
27261 test_xmlValidatePushElement(void) {
27264 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27267 xmlValidCtxtPtr ctxt; /* the validation context */
27269 xmlDocPtr doc; /* a document instance */
27271 xmlNodePtr elem; /* an element instance */
27273 xmlChar * qname; /* the qualified name as appearing in the serialization */
27276 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27277 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27278 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27279 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27280 mem_base = xmlMemBlocks();
27281 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27282 doc = gen_xmlDocPtr(n_doc, 1);
27283 elem = gen_xmlNodePtr(n_elem, 2);
27284 qname = gen_const_xmlChar_ptr(n_qname, 3);
27286 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27287 desret_int(ret_val);
27289 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27290 des_xmlDocPtr(n_doc, doc, 1);
27291 des_xmlNodePtr(n_elem, elem, 2);
27292 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27293 xmlResetLastError();
27294 if (mem_base != xmlMemBlocks()) {
27295 printf("Leak of %d blocks found in xmlValidatePushElement",
27296 xmlMemBlocks() - mem_base);
27298 printf(" %d", n_ctxt);
27299 printf(" %d", n_doc);
27300 printf(" %d", n_elem);
27301 printf(" %d", n_qname);
27316 test_xmlValidateRoot(void) {
27319 #if defined(LIBXML_VALID_ENABLED)
27322 xmlValidCtxtPtr ctxt; /* the validation context */
27324 xmlDocPtr doc; /* a document instance */
27327 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27328 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27329 mem_base = xmlMemBlocks();
27330 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27331 doc = gen_xmlDocPtr(n_doc, 1);
27333 ret_val = xmlValidateRoot(ctxt, doc);
27334 desret_int(ret_val);
27336 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27337 des_xmlDocPtr(n_doc, doc, 1);
27338 xmlResetLastError();
27339 if (mem_base != xmlMemBlocks()) {
27340 printf("Leak of %d blocks found in xmlValidateRoot",
27341 xmlMemBlocks() - mem_base);
27343 printf(" %d", n_ctxt);
27344 printf(" %d", n_doc);
27359 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27360 test_ret += test_xmlAddAttributeDecl();
27361 test_ret += test_xmlAddElementDecl();
27362 test_ret += test_xmlAddID();
27363 test_ret += test_xmlAddNotationDecl();
27364 test_ret += test_xmlAddRef();
27365 test_ret += test_xmlCopyAttributeTable();
27366 test_ret += test_xmlCopyDocElementContent();
27367 test_ret += test_xmlCopyElementContent();
27368 test_ret += test_xmlCopyElementTable();
27369 test_ret += test_xmlCopyEnumeration();
27370 test_ret += test_xmlCopyNotationTable();
27371 test_ret += test_xmlCreateEnumeration();
27372 test_ret += test_xmlDumpAttributeDecl();
27373 test_ret += test_xmlDumpAttributeTable();
27374 test_ret += test_xmlDumpElementDecl();
27375 test_ret += test_xmlDumpElementTable();
27376 test_ret += test_xmlDumpNotationDecl();
27377 test_ret += test_xmlDumpNotationTable();
27378 test_ret += test_xmlGetDtdAttrDesc();
27379 test_ret += test_xmlGetDtdElementDesc();
27380 test_ret += test_xmlGetDtdNotationDesc();
27381 test_ret += test_xmlGetDtdQAttrDesc();
27382 test_ret += test_xmlGetDtdQElementDesc();
27383 test_ret += test_xmlGetID();
27384 test_ret += test_xmlGetRefs();
27385 test_ret += test_xmlIsID();
27386 test_ret += test_xmlIsMixedElement();
27387 test_ret += test_xmlIsRef();
27388 test_ret += test_xmlNewDocElementContent();
27389 test_ret += test_xmlNewElementContent();
27390 test_ret += test_xmlNewValidCtxt();
27391 test_ret += test_xmlRemoveID();
27392 test_ret += test_xmlRemoveRef();
27393 test_ret += test_xmlSnprintfElementContent();
27394 test_ret += test_xmlSprintfElementContent();
27395 test_ret += test_xmlValidBuildContentModel();
27396 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27397 test_ret += test_xmlValidGetPotentialChildren();
27398 test_ret += test_xmlValidGetValidElements();
27399 test_ret += test_xmlValidNormalizeAttributeValue();
27400 test_ret += test_xmlValidateAttributeDecl();
27401 test_ret += test_xmlValidateAttributeValue();
27402 test_ret += test_xmlValidateDocument();
27403 test_ret += test_xmlValidateDocumentFinal();
27404 test_ret += test_xmlValidateDtd();
27405 test_ret += test_xmlValidateDtdFinal();
27406 test_ret += test_xmlValidateElement();
27407 test_ret += test_xmlValidateElementDecl();
27408 test_ret += test_xmlValidateNameValue();
27409 test_ret += test_xmlValidateNamesValue();
27410 test_ret += test_xmlValidateNmtokenValue();
27411 test_ret += test_xmlValidateNmtokensValue();
27412 test_ret += test_xmlValidateNotationDecl();
27413 test_ret += test_xmlValidateNotationUse();
27414 test_ret += test_xmlValidateOneAttribute();
27415 test_ret += test_xmlValidateOneElement();
27416 test_ret += test_xmlValidateOneNamespace();
27417 test_ret += test_xmlValidatePopElement();
27418 test_ret += test_xmlValidatePushCData();
27419 test_ret += test_xmlValidatePushElement();
27420 test_ret += test_xmlValidateRoot();
27423 printf("Module valid: %d errors\n", test_ret);
27428 test_xmlXIncludeNewContext(void) {
27432 /* missing type support */
27438 test_xmlXIncludeProcess(void) {
27441 #if defined(LIBXML_XINCLUDE_ENABLED)
27444 xmlDocPtr doc; /* an XML document */
27447 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27448 mem_base = xmlMemBlocks();
27449 doc = gen_xmlDocPtr(n_doc, 0);
27451 ret_val = xmlXIncludeProcess(doc);
27452 desret_int(ret_val);
27454 des_xmlDocPtr(n_doc, doc, 0);
27455 xmlResetLastError();
27456 if (mem_base != xmlMemBlocks()) {
27457 printf("Leak of %d blocks found in xmlXIncludeProcess",
27458 xmlMemBlocks() - mem_base);
27460 printf(" %d", n_doc);
27472 test_xmlXIncludeProcessFlags(void) {
27475 #if defined(LIBXML_XINCLUDE_ENABLED)
27478 xmlDocPtr doc; /* an XML document */
27480 int flags; /* a set of xmlParserOption used for parsing XML includes */
27483 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27484 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27485 mem_base = xmlMemBlocks();
27486 doc = gen_xmlDocPtr(n_doc, 0);
27487 flags = gen_int(n_flags, 1);
27489 ret_val = xmlXIncludeProcessFlags(doc, flags);
27490 desret_int(ret_val);
27492 des_xmlDocPtr(n_doc, doc, 0);
27493 des_int(n_flags, flags, 1);
27494 xmlResetLastError();
27495 if (mem_base != xmlMemBlocks()) {
27496 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27497 xmlMemBlocks() - mem_base);
27499 printf(" %d", n_doc);
27500 printf(" %d", n_flags);
27513 test_xmlXIncludeProcessFlagsData(void) {
27516 #if defined(LIBXML_XINCLUDE_ENABLED)
27519 xmlDocPtr doc; /* an XML document */
27521 int flags; /* a set of xmlParserOption used for parsing XML includes */
27523 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27526 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27527 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27528 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27529 mem_base = xmlMemBlocks();
27530 doc = gen_xmlDocPtr(n_doc, 0);
27531 flags = gen_int(n_flags, 1);
27532 data = gen_userdata(n_data, 2);
27534 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27535 desret_int(ret_val);
27537 des_xmlDocPtr(n_doc, doc, 0);
27538 des_int(n_flags, flags, 1);
27539 des_userdata(n_data, data, 2);
27540 xmlResetLastError();
27541 if (mem_base != xmlMemBlocks()) {
27542 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27543 xmlMemBlocks() - mem_base);
27545 printf(" %d", n_doc);
27546 printf(" %d", n_flags);
27547 printf(" %d", n_data);
27559 #ifdef LIBXML_XINCLUDE_ENABLED
27561 #define gen_nb_xmlXIncludeCtxtPtr 1
27562 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27565 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27571 test_xmlXIncludeProcessNode(void) {
27574 #if defined(LIBXML_XINCLUDE_ENABLED)
27577 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27579 xmlNodePtr node; /* a node in an XML document */
27582 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27583 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27584 mem_base = xmlMemBlocks();
27585 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27586 node = gen_xmlNodePtr(n_node, 1);
27588 ret_val = xmlXIncludeProcessNode(ctxt, node);
27589 desret_int(ret_val);
27591 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27592 des_xmlNodePtr(n_node, node, 1);
27593 xmlResetLastError();
27594 if (mem_base != xmlMemBlocks()) {
27595 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27596 xmlMemBlocks() - mem_base);
27598 printf(" %d", n_ctxt);
27599 printf(" %d", n_node);
27612 test_xmlXIncludeProcessTree(void) {
27615 #if defined(LIBXML_XINCLUDE_ENABLED)
27618 xmlNodePtr tree; /* a node in an XML document */
27621 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27622 mem_base = xmlMemBlocks();
27623 tree = gen_xmlNodePtr(n_tree, 0);
27625 ret_val = xmlXIncludeProcessTree(tree);
27626 desret_int(ret_val);
27628 des_xmlNodePtr(n_tree, tree, 0);
27629 xmlResetLastError();
27630 if (mem_base != xmlMemBlocks()) {
27631 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27632 xmlMemBlocks() - mem_base);
27634 printf(" %d", n_tree);
27646 test_xmlXIncludeProcessTreeFlags(void) {
27649 #if defined(LIBXML_XINCLUDE_ENABLED)
27652 xmlNodePtr tree; /* a node in an XML document */
27654 int flags; /* a set of xmlParserOption used for parsing XML includes */
27657 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27658 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27659 mem_base = xmlMemBlocks();
27660 tree = gen_xmlNodePtr(n_tree, 0);
27661 flags = gen_int(n_flags, 1);
27663 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27664 desret_int(ret_val);
27666 des_xmlNodePtr(n_tree, tree, 0);
27667 des_int(n_flags, flags, 1);
27668 xmlResetLastError();
27669 if (mem_base != xmlMemBlocks()) {
27670 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27671 xmlMemBlocks() - mem_base);
27673 printf(" %d", n_tree);
27674 printf(" %d", n_flags);
27687 test_xmlXIncludeProcessTreeFlagsData(void) {
27690 #if defined(LIBXML_XINCLUDE_ENABLED)
27693 xmlNodePtr tree; /* an XML node */
27695 int flags; /* a set of xmlParserOption used for parsing XML includes */
27697 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27700 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27701 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27702 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27703 mem_base = xmlMemBlocks();
27704 tree = gen_xmlNodePtr(n_tree, 0);
27705 flags = gen_int(n_flags, 1);
27706 data = gen_userdata(n_data, 2);
27708 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27709 desret_int(ret_val);
27711 des_xmlNodePtr(n_tree, tree, 0);
27712 des_int(n_flags, flags, 1);
27713 des_userdata(n_data, data, 2);
27714 xmlResetLastError();
27715 if (mem_base != xmlMemBlocks()) {
27716 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27717 xmlMemBlocks() - mem_base);
27719 printf(" %d", n_tree);
27720 printf(" %d", n_flags);
27721 printf(" %d", n_data);
27735 test_xmlXIncludeSetFlags(void) {
27738 #if defined(LIBXML_XINCLUDE_ENABLED)
27741 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27743 int flags; /* a set of xmlParserOption used for parsing XML includes */
27746 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27747 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27748 mem_base = xmlMemBlocks();
27749 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27750 flags = gen_int(n_flags, 1);
27752 ret_val = xmlXIncludeSetFlags(ctxt, flags);
27753 desret_int(ret_val);
27755 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27756 des_int(n_flags, flags, 1);
27757 xmlResetLastError();
27758 if (mem_base != xmlMemBlocks()) {
27759 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27760 xmlMemBlocks() - mem_base);
27762 printf(" %d", n_ctxt);
27763 printf(" %d", n_flags);
27775 test_xinclude(void) {
27778 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27779 test_ret += test_xmlXIncludeNewContext();
27780 test_ret += test_xmlXIncludeProcess();
27781 test_ret += test_xmlXIncludeProcessFlags();
27782 test_ret += test_xmlXIncludeProcessFlagsData();
27783 test_ret += test_xmlXIncludeProcessNode();
27784 test_ret += test_xmlXIncludeProcessTree();
27785 test_ret += test_xmlXIncludeProcessTreeFlags();
27786 test_ret += test_xmlXIncludeProcessTreeFlagsData();
27787 test_ret += test_xmlXIncludeSetFlags();
27790 printf("Module xinclude: %d errors\n", test_ret);
27795 test_xmlAllocOutputBuffer(void) {
27798 #if defined(LIBXML_OUTPUT_ENABLED)
27800 xmlOutputBufferPtr ret_val;
27801 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27804 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27805 mem_base = xmlMemBlocks();
27806 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27808 ret_val = xmlAllocOutputBuffer(encoder);
27809 desret_xmlOutputBufferPtr(ret_val);
27811 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27812 xmlResetLastError();
27813 if (mem_base != xmlMemBlocks()) {
27814 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27815 xmlMemBlocks() - mem_base);
27817 printf(" %d", n_encoder);
27829 test_xmlAllocParserInputBuffer(void) {
27833 xmlParserInputBufferPtr ret_val;
27834 xmlCharEncoding enc; /* the charset encoding if known */
27837 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27838 mem_base = xmlMemBlocks();
27839 enc = gen_xmlCharEncoding(n_enc, 0);
27841 ret_val = xmlAllocParserInputBuffer(enc);
27842 desret_xmlParserInputBufferPtr(ret_val);
27844 des_xmlCharEncoding(n_enc, enc, 0);
27845 xmlResetLastError();
27846 if (mem_base != xmlMemBlocks()) {
27847 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27848 xmlMemBlocks() - mem_base);
27850 printf(" %d", n_enc);
27861 test_xmlCheckFilename(void) {
27866 char * path; /* the path to check */
27869 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27870 mem_base = xmlMemBlocks();
27871 path = gen_const_char_ptr(n_path, 0);
27873 ret_val = xmlCheckFilename((const char *)path);
27874 desret_int(ret_val);
27876 des_const_char_ptr(n_path, (const char *)path, 0);
27877 xmlResetLastError();
27878 if (mem_base != xmlMemBlocks()) {
27879 printf("Leak of %d blocks found in xmlCheckFilename",
27880 xmlMemBlocks() - mem_base);
27882 printf(" %d", n_path);
27893 test_xmlCheckHTTPInput(void) {
27897 xmlParserInputPtr ret_val;
27898 xmlParserCtxtPtr ctxt; /* an XML parser context */
27900 xmlParserInputPtr ret; /* an XML parser input */
27903 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27904 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27905 mem_base = xmlMemBlocks();
27906 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27907 ret = gen_xmlParserInputPtr(n_ret, 1);
27909 ret_val = xmlCheckHTTPInput(ctxt, ret);
27910 desret_xmlParserInputPtr(ret_val);
27912 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27913 des_xmlParserInputPtr(n_ret, ret, 1);
27914 xmlResetLastError();
27915 if (mem_base != xmlMemBlocks()) {
27916 printf("Leak of %d blocks found in xmlCheckHTTPInput",
27917 xmlMemBlocks() - mem_base);
27919 printf(" %d", n_ctxt);
27920 printf(" %d", n_ret);
27932 test_xmlCleanupInputCallbacks(void) {
27937 mem_base = xmlMemBlocks();
27939 xmlCleanupInputCallbacks();
27941 xmlResetLastError();
27942 if (mem_base != xmlMemBlocks()) {
27943 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27944 xmlMemBlocks() - mem_base);
27955 test_xmlCleanupOutputCallbacks(void) {
27958 #if defined(LIBXML_OUTPUT_ENABLED)
27961 mem_base = xmlMemBlocks();
27963 xmlCleanupOutputCallbacks();
27965 xmlResetLastError();
27966 if (mem_base != xmlMemBlocks()) {
27967 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27968 xmlMemBlocks() - mem_base);
27980 test_xmlFileClose(void) {
27985 void * context; /* the I/O context */
27988 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27989 mem_base = xmlMemBlocks();
27990 context = gen_void_ptr(n_context, 0);
27992 ret_val = xmlFileClose(context);
27993 desret_int(ret_val);
27995 des_void_ptr(n_context, context, 0);
27996 xmlResetLastError();
27997 if (mem_base != xmlMemBlocks()) {
27998 printf("Leak of %d blocks found in xmlFileClose",
27999 xmlMemBlocks() - mem_base);
28001 printf(" %d", n_context);
28012 test_xmlFileMatch(void) {
28017 const char * filename; /* the URI for matching */
28020 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28021 mem_base = xmlMemBlocks();
28022 filename = gen_filepath(n_filename, 0);
28024 ret_val = xmlFileMatch(filename);
28025 desret_int(ret_val);
28027 des_filepath(n_filename, filename, 0);
28028 xmlResetLastError();
28029 if (mem_base != xmlMemBlocks()) {
28030 printf("Leak of %d blocks found in xmlFileMatch",
28031 xmlMemBlocks() - mem_base);
28033 printf(" %d", n_filename);
28044 test_xmlFileOpen(void) {
28049 const char * filename; /* the URI for matching */
28052 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28053 mem_base = xmlMemBlocks();
28054 filename = gen_filepath(n_filename, 0);
28056 ret_val = xmlFileOpen(filename);
28057 desret_void_ptr(ret_val);
28059 des_filepath(n_filename, filename, 0);
28060 xmlResetLastError();
28061 if (mem_base != xmlMemBlocks()) {
28062 printf("Leak of %d blocks found in xmlFileOpen",
28063 xmlMemBlocks() - mem_base);
28065 printf(" %d", n_filename);
28076 test_xmlFileRead(void) {
28081 void * context; /* the I/O context */
28083 char * buffer; /* where to drop data */
28085 int len; /* number of bytes to write */
28088 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28089 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28090 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28091 mem_base = xmlMemBlocks();
28092 context = gen_void_ptr(n_context, 0);
28093 buffer = gen_char_ptr(n_buffer, 1);
28094 len = gen_int(n_len, 2);
28096 ret_val = xmlFileRead(context, buffer, len);
28097 desret_int(ret_val);
28099 des_void_ptr(n_context, context, 0);
28100 des_char_ptr(n_buffer, buffer, 1);
28101 des_int(n_len, len, 2);
28102 xmlResetLastError();
28103 if (mem_base != xmlMemBlocks()) {
28104 printf("Leak of %d blocks found in xmlFileRead",
28105 xmlMemBlocks() - mem_base);
28107 printf(" %d", n_context);
28108 printf(" %d", n_buffer);
28109 printf(" %d", n_len);
28122 test_xmlIOFTPClose(void) {
28125 #if defined(LIBXML_FTP_ENABLED)
28128 void * context; /* the I/O context */
28131 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28132 mem_base = xmlMemBlocks();
28133 context = gen_void_ptr(n_context, 0);
28135 ret_val = xmlIOFTPClose(context);
28136 desret_int(ret_val);
28138 des_void_ptr(n_context, context, 0);
28139 xmlResetLastError();
28140 if (mem_base != xmlMemBlocks()) {
28141 printf("Leak of %d blocks found in xmlIOFTPClose",
28142 xmlMemBlocks() - mem_base);
28144 printf(" %d", n_context);
28156 test_xmlIOFTPMatch(void) {
28159 #if defined(LIBXML_FTP_ENABLED)
28162 const char * filename; /* the URI for matching */
28165 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28166 mem_base = xmlMemBlocks();
28167 filename = gen_filepath(n_filename, 0);
28169 ret_val = xmlIOFTPMatch(filename);
28170 desret_int(ret_val);
28172 des_filepath(n_filename, filename, 0);
28173 xmlResetLastError();
28174 if (mem_base != xmlMemBlocks()) {
28175 printf("Leak of %d blocks found in xmlIOFTPMatch",
28176 xmlMemBlocks() - mem_base);
28178 printf(" %d", n_filename);
28190 test_xmlIOFTPOpen(void) {
28193 #if defined(LIBXML_FTP_ENABLED)
28196 const char * filename; /* the URI for matching */
28199 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28200 mem_base = xmlMemBlocks();
28201 filename = gen_filepath(n_filename, 0);
28203 ret_val = xmlIOFTPOpen(filename);
28204 desret_void_ptr(ret_val);
28206 des_filepath(n_filename, filename, 0);
28207 xmlResetLastError();
28208 if (mem_base != xmlMemBlocks()) {
28209 printf("Leak of %d blocks found in xmlIOFTPOpen",
28210 xmlMemBlocks() - mem_base);
28212 printf(" %d", n_filename);
28224 test_xmlIOFTPRead(void) {
28227 #if defined(LIBXML_FTP_ENABLED)
28230 void * context; /* the I/O context */
28232 char * buffer; /* where to drop data */
28234 int len; /* number of bytes to write */
28237 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28238 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28239 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28240 mem_base = xmlMemBlocks();
28241 context = gen_void_ptr(n_context, 0);
28242 buffer = gen_char_ptr(n_buffer, 1);
28243 len = gen_int(n_len, 2);
28245 ret_val = xmlIOFTPRead(context, buffer, len);
28246 desret_int(ret_val);
28248 des_void_ptr(n_context, context, 0);
28249 des_char_ptr(n_buffer, buffer, 1);
28250 des_int(n_len, len, 2);
28251 xmlResetLastError();
28252 if (mem_base != xmlMemBlocks()) {
28253 printf("Leak of %d blocks found in xmlIOFTPRead",
28254 xmlMemBlocks() - mem_base);
28256 printf(" %d", n_context);
28257 printf(" %d", n_buffer);
28258 printf(" %d", n_len);
28272 test_xmlIOHTTPClose(void) {
28275 #if defined(LIBXML_HTTP_ENABLED)
28278 void * context; /* the I/O context */
28281 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28282 mem_base = xmlMemBlocks();
28283 context = gen_void_ptr(n_context, 0);
28285 ret_val = xmlIOHTTPClose(context);
28286 desret_int(ret_val);
28288 des_void_ptr(n_context, context, 0);
28289 xmlResetLastError();
28290 if (mem_base != xmlMemBlocks()) {
28291 printf("Leak of %d blocks found in xmlIOHTTPClose",
28292 xmlMemBlocks() - mem_base);
28294 printf(" %d", n_context);
28306 test_xmlIOHTTPMatch(void) {
28309 #if defined(LIBXML_HTTP_ENABLED)
28312 const char * filename; /* the URI for matching */
28315 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28316 mem_base = xmlMemBlocks();
28317 filename = gen_filepath(n_filename, 0);
28319 ret_val = xmlIOHTTPMatch(filename);
28320 desret_int(ret_val);
28322 des_filepath(n_filename, filename, 0);
28323 xmlResetLastError();
28324 if (mem_base != xmlMemBlocks()) {
28325 printf("Leak of %d blocks found in xmlIOHTTPMatch",
28326 xmlMemBlocks() - mem_base);
28328 printf(" %d", n_filename);
28340 test_xmlIOHTTPOpen(void) {
28343 #if defined(LIBXML_HTTP_ENABLED)
28346 const char * filename; /* the URI for matching */
28349 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28350 mem_base = xmlMemBlocks();
28351 filename = gen_filepath(n_filename, 0);
28353 ret_val = xmlIOHTTPOpen(filename);
28354 desret_xmlNanoHTTPCtxtPtr(ret_val);
28356 des_filepath(n_filename, filename, 0);
28357 xmlResetLastError();
28358 if (mem_base != xmlMemBlocks()) {
28359 printf("Leak of %d blocks found in xmlIOHTTPOpen",
28360 xmlMemBlocks() - mem_base);
28362 printf(" %d", n_filename);
28374 test_xmlIOHTTPRead(void) {
28377 #if defined(LIBXML_HTTP_ENABLED)
28380 void * context; /* the I/O context */
28382 char * buffer; /* where to drop data */
28384 int len; /* number of bytes to write */
28387 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28388 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28389 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28390 mem_base = xmlMemBlocks();
28391 context = gen_void_ptr(n_context, 0);
28392 buffer = gen_char_ptr(n_buffer, 1);
28393 len = gen_int(n_len, 2);
28395 ret_val = xmlIOHTTPRead(context, buffer, len);
28396 desret_int(ret_val);
28398 des_void_ptr(n_context, context, 0);
28399 des_char_ptr(n_buffer, buffer, 1);
28400 des_int(n_len, len, 2);
28401 xmlResetLastError();
28402 if (mem_base != xmlMemBlocks()) {
28403 printf("Leak of %d blocks found in xmlIOHTTPRead",
28404 xmlMemBlocks() - mem_base);
28406 printf(" %d", n_context);
28407 printf(" %d", n_buffer);
28408 printf(" %d", n_len);
28422 test_xmlNoNetExternalEntityLoader(void) {
28426 xmlParserInputPtr ret_val;
28427 const char * URL; /* the URL for the entity to load */
28429 char * ID; /* the System ID for the entity to load */
28431 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28434 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28435 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28436 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28437 mem_base = xmlMemBlocks();
28438 URL = gen_filepath(n_URL, 0);
28439 ID = gen_const_char_ptr(n_ID, 1);
28440 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28442 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28443 desret_xmlParserInputPtr(ret_val);
28445 des_filepath(n_URL, URL, 0);
28446 des_const_char_ptr(n_ID, (const char *)ID, 1);
28447 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28448 xmlResetLastError();
28449 if (mem_base != xmlMemBlocks()) {
28450 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28451 xmlMemBlocks() - mem_base);
28453 printf(" %d", n_URL);
28454 printf(" %d", n_ID);
28455 printf(" %d", n_ctxt);
28468 test_xmlNormalizeWindowsPath(void) {
28473 xmlChar * path; /* the input file path */
28476 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28477 mem_base = xmlMemBlocks();
28478 path = gen_const_xmlChar_ptr(n_path, 0);
28480 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28481 desret_xmlChar_ptr(ret_val);
28483 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28484 xmlResetLastError();
28485 if (mem_base != xmlMemBlocks()) {
28486 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28487 xmlMemBlocks() - mem_base);
28489 printf(" %d", n_path);
28500 test_xmlOutputBufferCreateBuffer(void) {
28503 #if defined(LIBXML_OUTPUT_ENABLED)
28505 xmlOutputBufferPtr ret_val;
28506 xmlBufferPtr buffer; /* a xmlBufferPtr */
28508 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28511 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28512 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28513 mem_base = xmlMemBlocks();
28514 buffer = gen_xmlBufferPtr(n_buffer, 0);
28515 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28517 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28518 desret_xmlOutputBufferPtr(ret_val);
28520 des_xmlBufferPtr(n_buffer, buffer, 0);
28521 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28522 xmlResetLastError();
28523 if (mem_base != xmlMemBlocks()) {
28524 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28525 xmlMemBlocks() - mem_base);
28527 printf(" %d", n_buffer);
28528 printf(" %d", n_encoder);
28541 test_xmlOutputBufferCreateFd(void) {
28544 #if defined(LIBXML_OUTPUT_ENABLED)
28546 xmlOutputBufferPtr ret_val;
28547 int fd; /* a file descriptor number */
28549 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28552 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28553 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28554 mem_base = xmlMemBlocks();
28555 fd = gen_int(n_fd, 0);
28556 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28558 ret_val = xmlOutputBufferCreateFd(fd, encoder);
28559 desret_xmlOutputBufferPtr(ret_val);
28561 des_int(n_fd, fd, 0);
28562 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28563 xmlResetLastError();
28564 if (mem_base != xmlMemBlocks()) {
28565 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28566 xmlMemBlocks() - mem_base);
28568 printf(" %d", n_fd);
28569 printf(" %d", n_encoder);
28582 test_xmlOutputBufferCreateFile(void) {
28585 #if defined(LIBXML_OUTPUT_ENABLED)
28587 xmlOutputBufferPtr ret_val;
28588 FILE * file; /* a FILE* */
28590 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28593 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28594 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28595 mem_base = xmlMemBlocks();
28596 file = gen_FILE_ptr(n_file, 0);
28597 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28599 ret_val = xmlOutputBufferCreateFile(file, encoder);
28600 desret_xmlOutputBufferPtr(ret_val);
28602 des_FILE_ptr(n_file, file, 0);
28603 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28604 xmlResetLastError();
28605 if (mem_base != xmlMemBlocks()) {
28606 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28607 xmlMemBlocks() - mem_base);
28609 printf(" %d", n_file);
28610 printf(" %d", n_encoder);
28623 test_xmlOutputBufferCreateFilename(void) {
28626 #if defined(LIBXML_OUTPUT_ENABLED)
28628 xmlOutputBufferPtr ret_val;
28629 const char * URI; /* a C string containing the URI or filename */
28631 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28633 int compression; /* the compression ration (0 none, 9 max). */
28636 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28637 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28638 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28639 mem_base = xmlMemBlocks();
28640 URI = gen_fileoutput(n_URI, 0);
28641 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28642 compression = gen_int(n_compression, 2);
28644 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28645 desret_xmlOutputBufferPtr(ret_val);
28647 des_fileoutput(n_URI, URI, 0);
28648 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28649 des_int(n_compression, compression, 2);
28650 xmlResetLastError();
28651 if (mem_base != xmlMemBlocks()) {
28652 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28653 xmlMemBlocks() - mem_base);
28655 printf(" %d", n_URI);
28656 printf(" %d", n_encoder);
28657 printf(" %d", n_compression);
28671 test_xmlOutputBufferFlush(void) {
28674 #if defined(LIBXML_OUTPUT_ENABLED)
28677 xmlOutputBufferPtr out; /* a buffered output */
28680 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28681 mem_base = xmlMemBlocks();
28682 out = gen_xmlOutputBufferPtr(n_out, 0);
28684 ret_val = xmlOutputBufferFlush(out);
28685 desret_int(ret_val);
28687 des_xmlOutputBufferPtr(n_out, out, 0);
28688 xmlResetLastError();
28689 if (mem_base != xmlMemBlocks()) {
28690 printf("Leak of %d blocks found in xmlOutputBufferFlush",
28691 xmlMemBlocks() - mem_base);
28693 printf(" %d", n_out);
28705 test_xmlOutputBufferGetContent(void) {
28708 #if defined(LIBXML_OUTPUT_ENABLED)
28710 const xmlChar * ret_val;
28711 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28714 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28715 mem_base = xmlMemBlocks();
28716 out = gen_xmlOutputBufferPtr(n_out, 0);
28718 ret_val = xmlOutputBufferGetContent(out);
28719 desret_const_xmlChar_ptr(ret_val);
28721 des_xmlOutputBufferPtr(n_out, out, 0);
28722 xmlResetLastError();
28723 if (mem_base != xmlMemBlocks()) {
28724 printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28725 xmlMemBlocks() - mem_base);
28727 printf(" %d", n_out);
28739 test_xmlOutputBufferGetSize(void) {
28743 /* missing type support */
28749 test_xmlOutputBufferWrite(void) {
28752 #if defined(LIBXML_OUTPUT_ENABLED)
28755 xmlOutputBufferPtr out; /* a buffered parser output */
28757 int len; /* the size in bytes of the array. */
28759 char * buf; /* an char array */
28762 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28763 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28764 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28765 mem_base = xmlMemBlocks();
28766 out = gen_xmlOutputBufferPtr(n_out, 0);
28767 len = gen_int(n_len, 1);
28768 buf = gen_const_char_ptr(n_buf, 2);
28769 if ((buf != NULL) &&
28770 (len > (int) strlen((const char *) buf) + 1))
28773 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28774 desret_int(ret_val);
28776 des_xmlOutputBufferPtr(n_out, out, 0);
28777 des_int(n_len, len, 1);
28778 des_const_char_ptr(n_buf, (const char *)buf, 2);
28779 xmlResetLastError();
28780 if (mem_base != xmlMemBlocks()) {
28781 printf("Leak of %d blocks found in xmlOutputBufferWrite",
28782 xmlMemBlocks() - mem_base);
28784 printf(" %d", n_out);
28785 printf(" %d", n_len);
28786 printf(" %d", n_buf);
28800 test_xmlOutputBufferWriteEscape(void) {
28804 /* missing type support */
28810 test_xmlOutputBufferWriteString(void) {
28813 #if defined(LIBXML_OUTPUT_ENABLED)
28816 xmlOutputBufferPtr out; /* a buffered parser output */
28818 char * str; /* a zero terminated C string */
28821 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28822 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28823 mem_base = xmlMemBlocks();
28824 out = gen_xmlOutputBufferPtr(n_out, 0);
28825 str = gen_const_char_ptr(n_str, 1);
28827 ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28828 desret_int(ret_val);
28830 des_xmlOutputBufferPtr(n_out, out, 0);
28831 des_const_char_ptr(n_str, (const char *)str, 1);
28832 xmlResetLastError();
28833 if (mem_base != xmlMemBlocks()) {
28834 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28835 xmlMemBlocks() - mem_base);
28837 printf(" %d", n_out);
28838 printf(" %d", n_str);
28851 test_xmlParserGetDirectory(void) {
28855 /* missing type support */
28861 test_xmlParserInputBufferCreateFd(void) {
28865 xmlParserInputBufferPtr ret_val;
28866 int fd; /* a file descriptor number */
28868 xmlCharEncoding enc; /* the charset encoding if known */
28871 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28872 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28873 mem_base = xmlMemBlocks();
28874 fd = gen_int(n_fd, 0);
28875 enc = gen_xmlCharEncoding(n_enc, 1);
28876 if (fd >= 0) fd = -1;
28878 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28879 desret_xmlParserInputBufferPtr(ret_val);
28881 des_int(n_fd, fd, 0);
28882 des_xmlCharEncoding(n_enc, enc, 1);
28883 xmlResetLastError();
28884 if (mem_base != xmlMemBlocks()) {
28885 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28886 xmlMemBlocks() - mem_base);
28888 printf(" %d", n_fd);
28889 printf(" %d", n_enc);
28901 test_xmlParserInputBufferCreateFile(void) {
28905 xmlParserInputBufferPtr ret_val;
28906 FILE * file; /* a FILE* */
28908 xmlCharEncoding enc; /* the charset encoding if known */
28911 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28912 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28913 mem_base = xmlMemBlocks();
28914 file = gen_FILE_ptr(n_file, 0);
28915 enc = gen_xmlCharEncoding(n_enc, 1);
28917 ret_val = xmlParserInputBufferCreateFile(file, enc);
28918 desret_xmlParserInputBufferPtr(ret_val);
28920 des_FILE_ptr(n_file, file, 0);
28921 des_xmlCharEncoding(n_enc, enc, 1);
28922 xmlResetLastError();
28923 if (mem_base != xmlMemBlocks()) {
28924 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28925 xmlMemBlocks() - mem_base);
28927 printf(" %d", n_file);
28928 printf(" %d", n_enc);
28940 test_xmlParserInputBufferCreateFilename(void) {
28944 xmlParserInputBufferPtr ret_val;
28945 const char * URI; /* a C string containing the URI or filename */
28947 xmlCharEncoding enc; /* the charset encoding if known */
28950 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28951 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28952 mem_base = xmlMemBlocks();
28953 URI = gen_fileoutput(n_URI, 0);
28954 enc = gen_xmlCharEncoding(n_enc, 1);
28956 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28957 desret_xmlParserInputBufferPtr(ret_val);
28959 des_fileoutput(n_URI, URI, 0);
28960 des_xmlCharEncoding(n_enc, enc, 1);
28961 xmlResetLastError();
28962 if (mem_base != xmlMemBlocks()) {
28963 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28964 xmlMemBlocks() - mem_base);
28966 printf(" %d", n_URI);
28967 printf(" %d", n_enc);
28979 test_xmlParserInputBufferCreateMem(void) {
28983 xmlParserInputBufferPtr ret_val;
28984 char * mem; /* the memory input */
28986 int size; /* the length of the memory block */
28988 xmlCharEncoding enc; /* the charset encoding if known */
28991 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28992 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28993 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28994 mem_base = xmlMemBlocks();
28995 mem = gen_const_char_ptr(n_mem, 0);
28996 size = gen_int(n_size, 1);
28997 enc = gen_xmlCharEncoding(n_enc, 2);
28998 if ((mem != NULL) &&
28999 (size > (int) strlen((const char *) mem) + 1))
29002 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
29003 desret_xmlParserInputBufferPtr(ret_val);
29005 des_const_char_ptr(n_mem, (const char *)mem, 0);
29006 des_int(n_size, size, 1);
29007 des_xmlCharEncoding(n_enc, enc, 2);
29008 xmlResetLastError();
29009 if (mem_base != xmlMemBlocks()) {
29010 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
29011 xmlMemBlocks() - mem_base);
29013 printf(" %d", n_mem);
29014 printf(" %d", n_size);
29015 printf(" %d", n_enc);
29028 test_xmlParserInputBufferCreateStatic(void) {
29032 xmlParserInputBufferPtr ret_val;
29033 char * mem; /* the memory input */
29035 int size; /* the length of the memory block */
29037 xmlCharEncoding enc; /* the charset encoding if known */
29040 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29041 for (n_size = 0;n_size < gen_nb_int;n_size++) {
29042 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29043 mem_base = xmlMemBlocks();
29044 mem = gen_const_char_ptr(n_mem, 0);
29045 size = gen_int(n_size, 1);
29046 enc = gen_xmlCharEncoding(n_enc, 2);
29047 if ((mem != NULL) &&
29048 (size > (int) strlen((const char *) mem) + 1))
29051 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
29052 desret_xmlParserInputBufferPtr(ret_val);
29054 des_const_char_ptr(n_mem, (const char *)mem, 0);
29055 des_int(n_size, size, 1);
29056 des_xmlCharEncoding(n_enc, enc, 2);
29057 xmlResetLastError();
29058 if (mem_base != xmlMemBlocks()) {
29059 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
29060 xmlMemBlocks() - mem_base);
29062 printf(" %d", n_mem);
29063 printf(" %d", n_size);
29064 printf(" %d", n_enc);
29077 test_xmlParserInputBufferGrow(void) {
29082 xmlParserInputBufferPtr in; /* a buffered parser input */
29084 int len; /* indicative value of the amount of chars to read */
29087 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29088 for (n_len = 0;n_len < gen_nb_int;n_len++) {
29089 mem_base = xmlMemBlocks();
29090 in = gen_xmlParserInputBufferPtr(n_in, 0);
29091 len = gen_int(n_len, 1);
29093 ret_val = xmlParserInputBufferGrow(in, len);
29094 desret_int(ret_val);
29096 des_xmlParserInputBufferPtr(n_in, in, 0);
29097 des_int(n_len, len, 1);
29098 xmlResetLastError();
29099 if (mem_base != xmlMemBlocks()) {
29100 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
29101 xmlMemBlocks() - mem_base);
29103 printf(" %d", n_in);
29104 printf(" %d", n_len);
29116 test_xmlParserInputBufferPush(void) {
29121 xmlParserInputBufferPtr in; /* a buffered parser input */
29123 int len; /* the size in bytes of the array. */
29125 char * buf; /* an char array */
29128 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29129 for (n_len = 0;n_len < gen_nb_int;n_len++) {
29130 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29131 mem_base = xmlMemBlocks();
29132 in = gen_xmlParserInputBufferPtr(n_in, 0);
29133 len = gen_int(n_len, 1);
29134 buf = gen_const_char_ptr(n_buf, 2);
29135 if ((buf != NULL) &&
29136 (len > (int) strlen((const char *) buf) + 1))
29139 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29140 desret_int(ret_val);
29142 des_xmlParserInputBufferPtr(n_in, in, 0);
29143 des_int(n_len, len, 1);
29144 des_const_char_ptr(n_buf, (const char *)buf, 2);
29145 xmlResetLastError();
29146 if (mem_base != xmlMemBlocks()) {
29147 printf("Leak of %d blocks found in xmlParserInputBufferPush",
29148 xmlMemBlocks() - mem_base);
29150 printf(" %d", n_in);
29151 printf(" %d", n_len);
29152 printf(" %d", n_buf);
29165 test_xmlParserInputBufferRead(void) {
29170 xmlParserInputBufferPtr in; /* a buffered parser input */
29172 int len; /* indicative value of the amount of chars to read */
29175 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29176 for (n_len = 0;n_len < gen_nb_int;n_len++) {
29177 mem_base = xmlMemBlocks();
29178 in = gen_xmlParserInputBufferPtr(n_in, 0);
29179 len = gen_int(n_len, 1);
29181 ret_val = xmlParserInputBufferRead(in, len);
29182 desret_int(ret_val);
29184 des_xmlParserInputBufferPtr(n_in, in, 0);
29185 des_int(n_len, len, 1);
29186 xmlResetLastError();
29187 if (mem_base != xmlMemBlocks()) {
29188 printf("Leak of %d blocks found in xmlParserInputBufferRead",
29189 xmlMemBlocks() - mem_base);
29191 printf(" %d", n_in);
29192 printf(" %d", n_len);
29204 test_xmlPopInputCallbacks(void) {
29210 mem_base = xmlMemBlocks();
29212 ret_val = xmlPopInputCallbacks();
29213 desret_int(ret_val);
29215 xmlResetLastError();
29216 if (mem_base != xmlMemBlocks()) {
29217 printf("Leak of %d blocks found in xmlPopInputCallbacks",
29218 xmlMemBlocks() - mem_base);
29229 test_xmlRegisterDefaultInputCallbacks(void) {
29234 mem_base = xmlMemBlocks();
29236 xmlRegisterDefaultInputCallbacks();
29238 xmlResetLastError();
29239 if (mem_base != xmlMemBlocks()) {
29240 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29241 xmlMemBlocks() - mem_base);
29252 test_xmlRegisterDefaultOutputCallbacks(void) {
29255 #if defined(LIBXML_OUTPUT_ENABLED)
29258 mem_base = xmlMemBlocks();
29260 xmlRegisterDefaultOutputCallbacks();
29262 xmlResetLastError();
29263 if (mem_base != xmlMemBlocks()) {
29264 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29265 xmlMemBlocks() - mem_base);
29277 test_xmlRegisterHTTPPostCallbacks(void) {
29280 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29283 mem_base = xmlMemBlocks();
29285 xmlRegisterHTTPPostCallbacks();
29287 xmlResetLastError();
29288 if (mem_base != xmlMemBlocks()) {
29289 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29290 xmlMemBlocks() - mem_base);
29304 if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29305 test_ret += test_xmlAllocOutputBuffer();
29306 test_ret += test_xmlAllocParserInputBuffer();
29307 test_ret += test_xmlCheckFilename();
29308 test_ret += test_xmlCheckHTTPInput();
29309 test_ret += test_xmlCleanupInputCallbacks();
29310 test_ret += test_xmlCleanupOutputCallbacks();
29311 test_ret += test_xmlFileClose();
29312 test_ret += test_xmlFileMatch();
29313 test_ret += test_xmlFileOpen();
29314 test_ret += test_xmlFileRead();
29315 test_ret += test_xmlIOFTPClose();
29316 test_ret += test_xmlIOFTPMatch();
29317 test_ret += test_xmlIOFTPOpen();
29318 test_ret += test_xmlIOFTPRead();
29319 test_ret += test_xmlIOHTTPClose();
29320 test_ret += test_xmlIOHTTPMatch();
29321 test_ret += test_xmlIOHTTPOpen();
29322 test_ret += test_xmlIOHTTPRead();
29323 test_ret += test_xmlNoNetExternalEntityLoader();
29324 test_ret += test_xmlNormalizeWindowsPath();
29325 test_ret += test_xmlOutputBufferCreateBuffer();
29326 test_ret += test_xmlOutputBufferCreateFd();
29327 test_ret += test_xmlOutputBufferCreateFile();
29328 test_ret += test_xmlOutputBufferCreateFilename();
29329 test_ret += test_xmlOutputBufferFlush();
29330 test_ret += test_xmlOutputBufferGetContent();
29331 test_ret += test_xmlOutputBufferGetSize();
29332 test_ret += test_xmlOutputBufferWrite();
29333 test_ret += test_xmlOutputBufferWriteEscape();
29334 test_ret += test_xmlOutputBufferWriteString();
29335 test_ret += test_xmlParserGetDirectory();
29336 test_ret += test_xmlParserInputBufferCreateFd();
29337 test_ret += test_xmlParserInputBufferCreateFile();
29338 test_ret += test_xmlParserInputBufferCreateFilename();
29339 test_ret += test_xmlParserInputBufferCreateMem();
29340 test_ret += test_xmlParserInputBufferCreateStatic();
29341 test_ret += test_xmlParserInputBufferGrow();
29342 test_ret += test_xmlParserInputBufferPush();
29343 test_ret += test_xmlParserInputBufferRead();
29344 test_ret += test_xmlPopInputCallbacks();
29345 test_ret += test_xmlRegisterDefaultInputCallbacks();
29346 test_ret += test_xmlRegisterDefaultOutputCallbacks();
29347 test_ret += test_xmlRegisterHTTPPostCallbacks();
29350 printf("Module xmlIO: %d errors\n", test_ret);
29353 #ifdef LIBXML_AUTOMATA_ENABLED
29355 #define gen_nb_xmlAutomataPtr 1
29356 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29359 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29365 test_xmlAutomataCompile(void) {
29369 /* missing type support */
29375 test_xmlAutomataGetInitState(void) {
29379 /* missing type support */
29385 test_xmlAutomataIsDeterminist(void) {
29388 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29391 xmlAutomataPtr am; /* an automata */
29394 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29395 mem_base = xmlMemBlocks();
29396 am = gen_xmlAutomataPtr(n_am, 0);
29398 ret_val = xmlAutomataIsDeterminist(am);
29399 desret_int(ret_val);
29401 des_xmlAutomataPtr(n_am, am, 0);
29402 xmlResetLastError();
29403 if (mem_base != xmlMemBlocks()) {
29404 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29405 xmlMemBlocks() - mem_base);
29407 printf(" %d", n_am);
29417 #ifdef LIBXML_AUTOMATA_ENABLED
29419 #define gen_nb_xmlAutomataStatePtr 1
29420 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29423 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29429 test_xmlAutomataNewAllTrans(void) {
29433 /* missing type support */
29439 test_xmlAutomataNewCountTrans(void) {
29443 /* missing type support */
29449 test_xmlAutomataNewCountTrans2(void) {
29453 /* missing type support */
29459 test_xmlAutomataNewCountedTrans(void) {
29463 /* missing type support */
29469 test_xmlAutomataNewCounter(void) {
29472 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29475 xmlAutomataPtr am; /* an automata */
29477 int min; /* the minimal value on the counter */
29479 int max; /* the maximal value on the counter */
29482 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29483 for (n_min = 0;n_min < gen_nb_int;n_min++) {
29484 for (n_max = 0;n_max < gen_nb_int;n_max++) {
29485 mem_base = xmlMemBlocks();
29486 am = gen_xmlAutomataPtr(n_am, 0);
29487 min = gen_int(n_min, 1);
29488 max = gen_int(n_max, 2);
29490 ret_val = xmlAutomataNewCounter(am, min, max);
29491 desret_int(ret_val);
29493 des_xmlAutomataPtr(n_am, am, 0);
29494 des_int(n_min, min, 1);
29495 des_int(n_max, max, 2);
29496 xmlResetLastError();
29497 if (mem_base != xmlMemBlocks()) {
29498 printf("Leak of %d blocks found in xmlAutomataNewCounter",
29499 xmlMemBlocks() - mem_base);
29501 printf(" %d", n_am);
29502 printf(" %d", n_min);
29503 printf(" %d", n_max);
29517 test_xmlAutomataNewCounterTrans(void) {
29521 /* missing type support */
29527 test_xmlAutomataNewEpsilon(void) {
29531 /* missing type support */
29537 test_xmlAutomataNewNegTrans(void) {
29541 /* missing type support */
29547 test_xmlAutomataNewOnceTrans(void) {
29551 /* missing type support */
29557 test_xmlAutomataNewOnceTrans2(void) {
29561 /* missing type support */
29567 test_xmlAutomataNewState(void) {
29571 /* missing type support */
29577 test_xmlAutomataNewTransition(void) {
29581 /* missing type support */
29587 test_xmlAutomataNewTransition2(void) {
29591 /* missing type support */
29597 test_xmlAutomataSetFinalState(void) {
29600 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29603 xmlAutomataPtr am; /* an automata */
29605 xmlAutomataStatePtr state; /* a state in this automata */
29608 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29609 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29610 mem_base = xmlMemBlocks();
29611 am = gen_xmlAutomataPtr(n_am, 0);
29612 state = gen_xmlAutomataStatePtr(n_state, 1);
29614 ret_val = xmlAutomataSetFinalState(am, state);
29615 desret_int(ret_val);
29617 des_xmlAutomataPtr(n_am, am, 0);
29618 des_xmlAutomataStatePtr(n_state, state, 1);
29619 xmlResetLastError();
29620 if (mem_base != xmlMemBlocks()) {
29621 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29622 xmlMemBlocks() - mem_base);
29624 printf(" %d", n_am);
29625 printf(" %d", n_state);
29638 test_xmlNewAutomata(void) {
29642 /* missing type support */
29647 test_xmlautomata(void) {
29650 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29651 test_ret += test_xmlAutomataCompile();
29652 test_ret += test_xmlAutomataGetInitState();
29653 test_ret += test_xmlAutomataIsDeterminist();
29654 test_ret += test_xmlAutomataNewAllTrans();
29655 test_ret += test_xmlAutomataNewCountTrans();
29656 test_ret += test_xmlAutomataNewCountTrans2();
29657 test_ret += test_xmlAutomataNewCountedTrans();
29658 test_ret += test_xmlAutomataNewCounter();
29659 test_ret += test_xmlAutomataNewCounterTrans();
29660 test_ret += test_xmlAutomataNewEpsilon();
29661 test_ret += test_xmlAutomataNewNegTrans();
29662 test_ret += test_xmlAutomataNewOnceTrans();
29663 test_ret += test_xmlAutomataNewOnceTrans2();
29664 test_ret += test_xmlAutomataNewState();
29665 test_ret += test_xmlAutomataNewTransition();
29666 test_ret += test_xmlAutomataNewTransition2();
29667 test_ret += test_xmlAutomataSetFinalState();
29668 test_ret += test_xmlNewAutomata();
29671 printf("Module xmlautomata: %d errors\n", test_ret);
29675 #define gen_nb_xmlGenericErrorFunc_ptr 1
29676 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29679 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29683 test_initGenericErrorDefaultFunc(void) {
29687 xmlGenericErrorFunc * handler; /* the handler */
29690 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29691 mem_base = xmlMemBlocks();
29692 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29694 initGenericErrorDefaultFunc(handler);
29696 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29697 xmlResetLastError();
29698 if (mem_base != xmlMemBlocks()) {
29699 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29700 xmlMemBlocks() - mem_base);
29702 printf(" %d", n_handler);
29712 #define gen_nb_xmlErrorPtr 1
29713 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29716 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29720 test_xmlCopyError(void) {
29725 xmlErrorPtr from; /* a source error */
29727 xmlErrorPtr to; /* a target error */
29730 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29731 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29732 mem_base = xmlMemBlocks();
29733 from = gen_xmlErrorPtr(n_from, 0);
29734 to = gen_xmlErrorPtr(n_to, 1);
29736 ret_val = xmlCopyError(from, to);
29737 desret_int(ret_val);
29739 des_xmlErrorPtr(n_from, from, 0);
29740 des_xmlErrorPtr(n_to, to, 1);
29741 xmlResetLastError();
29742 if (mem_base != xmlMemBlocks()) {
29743 printf("Leak of %d blocks found in xmlCopyError",
29744 xmlMemBlocks() - mem_base);
29746 printf(" %d", n_from);
29747 printf(" %d", n_to);
29759 test_xmlCtxtGetLastError(void) {
29763 /* missing type support */
29769 test_xmlCtxtResetLastError(void) {
29773 void * ctx; /* an XML parser context */
29776 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29777 mem_base = xmlMemBlocks();
29778 ctx = gen_void_ptr(n_ctx, 0);
29780 xmlCtxtResetLastError(ctx);
29782 des_void_ptr(n_ctx, ctx, 0);
29783 xmlResetLastError();
29784 if (mem_base != xmlMemBlocks()) {
29785 printf("Leak of %d blocks found in xmlCtxtResetLastError",
29786 xmlMemBlocks() - mem_base);
29788 printf(" %d", n_ctx);
29799 test_xmlGetLastError(void) {
29803 /* missing type support */
29809 test_xmlParserError(void) {
29813 /* missing type support */
29819 test_xmlParserPrintFileContext(void) {
29823 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29826 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29827 mem_base = xmlMemBlocks();
29828 input = gen_xmlParserInputPtr(n_input, 0);
29830 xmlParserPrintFileContext(input);
29832 des_xmlParserInputPtr(n_input, input, 0);
29833 xmlResetLastError();
29834 if (mem_base != xmlMemBlocks()) {
29835 printf("Leak of %d blocks found in xmlParserPrintFileContext",
29836 xmlMemBlocks() - mem_base);
29838 printf(" %d", n_input);
29849 test_xmlParserPrintFileInfo(void) {
29853 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29856 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29857 mem_base = xmlMemBlocks();
29858 input = gen_xmlParserInputPtr(n_input, 0);
29860 xmlParserPrintFileInfo(input);
29862 des_xmlParserInputPtr(n_input, input, 0);
29863 xmlResetLastError();
29864 if (mem_base != xmlMemBlocks()) {
29865 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29866 xmlMemBlocks() - mem_base);
29868 printf(" %d", n_input);
29879 test_xmlParserValidityError(void) {
29883 /* missing type support */
29889 test_xmlParserValidityWarning(void) {
29893 /* missing type support */
29899 test_xmlParserWarning(void) {
29903 /* missing type support */
29909 test_xmlResetError(void) {
29913 xmlErrorPtr err; /* pointer to the error. */
29916 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29917 mem_base = xmlMemBlocks();
29918 err = gen_xmlErrorPtr(n_err, 0);
29920 xmlResetError(err);
29922 des_xmlErrorPtr(n_err, err, 0);
29923 xmlResetLastError();
29924 if (mem_base != xmlMemBlocks()) {
29925 printf("Leak of %d blocks found in xmlResetError",
29926 xmlMemBlocks() - mem_base);
29928 printf(" %d", n_err);
29939 test_xmlResetLastError(void) {
29944 xmlResetLastError();
29946 xmlResetLastError();
29954 test_xmlSetGenericErrorFunc(void) {
29958 /* missing type support */
29964 test_xmlSetStructuredErrorFunc(void) {
29968 /* missing type support */
29973 test_xmlerror(void) {
29976 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29977 test_ret += test_initGenericErrorDefaultFunc();
29978 test_ret += test_xmlCopyError();
29979 test_ret += test_xmlCtxtGetLastError();
29980 test_ret += test_xmlCtxtResetLastError();
29981 test_ret += test_xmlGetLastError();
29982 test_ret += test_xmlParserError();
29983 test_ret += test_xmlParserPrintFileContext();
29984 test_ret += test_xmlParserPrintFileInfo();
29985 test_ret += test_xmlParserValidityError();
29986 test_ret += test_xmlParserValidityWarning();
29987 test_ret += test_xmlParserWarning();
29988 test_ret += test_xmlResetError();
29989 test_ret += test_xmlResetLastError();
29990 test_ret += test_xmlSetGenericErrorFunc();
29991 test_ret += test_xmlSetStructuredErrorFunc();
29994 printf("Module xmlerror: %d errors\n", test_ret);
29997 #ifdef LIBXML_MODULES_ENABLED
29999 #define gen_nb_xmlModulePtr 1
30000 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30003 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30009 test_xmlModuleClose(void) {
30012 #if defined(LIBXML_MODULES_ENABLED)
30015 xmlModulePtr module; /* the module handle */
30018 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30019 mem_base = xmlMemBlocks();
30020 module = gen_xmlModulePtr(n_module, 0);
30022 ret_val = xmlModuleClose(module);
30023 desret_int(ret_val);
30025 des_xmlModulePtr(n_module, module, 0);
30026 xmlResetLastError();
30027 if (mem_base != xmlMemBlocks()) {
30028 printf("Leak of %d blocks found in xmlModuleClose",
30029 xmlMemBlocks() - mem_base);
30031 printf(" %d", n_module);
30043 test_xmlModuleOpen(void) {
30047 /* missing type support */
30053 test_xmlModuleSymbol(void) {
30056 #if defined(LIBXML_MODULES_ENABLED)
30059 xmlModulePtr module; /* the module */
30061 char * name; /* the name of the symbol */
30063 void ** symbol; /* the resulting symbol address */
30066 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30067 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
30068 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
30069 mem_base = xmlMemBlocks();
30070 module = gen_xmlModulePtr(n_module, 0);
30071 name = gen_const_char_ptr(n_name, 1);
30072 symbol = gen_void_ptr_ptr(n_symbol, 2);
30074 ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
30075 desret_int(ret_val);
30077 des_xmlModulePtr(n_module, module, 0);
30078 des_const_char_ptr(n_name, (const char *)name, 1);
30079 des_void_ptr_ptr(n_symbol, symbol, 2);
30080 xmlResetLastError();
30081 if (mem_base != xmlMemBlocks()) {
30082 printf("Leak of %d blocks found in xmlModuleSymbol",
30083 xmlMemBlocks() - mem_base);
30085 printf(" %d", n_module);
30086 printf(" %d", n_name);
30087 printf(" %d", n_symbol);
30100 test_xmlmodule(void) {
30103 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
30104 test_ret += test_xmlModuleClose();
30105 test_ret += test_xmlModuleOpen();
30106 test_ret += test_xmlModuleSymbol();
30109 printf("Module xmlmodule: %d errors\n", test_ret);
30114 test_xmlNewTextReader(void) {
30117 #if defined(LIBXML_READER_ENABLED)
30119 xmlTextReaderPtr ret_val;
30120 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30122 const char * URI; /* the URI information for the source if available */
30125 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30126 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30127 mem_base = xmlMemBlocks();
30128 input = gen_xmlParserInputBufferPtr(n_input, 0);
30129 URI = gen_filepath(n_URI, 1);
30131 ret_val = xmlNewTextReader(input, URI);
30132 desret_xmlTextReaderPtr(ret_val);
30134 des_xmlParserInputBufferPtr(n_input, input, 0);
30135 des_filepath(n_URI, URI, 1);
30136 xmlResetLastError();
30137 if (mem_base != xmlMemBlocks()) {
30138 printf("Leak of %d blocks found in xmlNewTextReader",
30139 xmlMemBlocks() - mem_base);
30141 printf(" %d", n_input);
30142 printf(" %d", n_URI);
30155 test_xmlNewTextReaderFilename(void) {
30158 #if defined(LIBXML_READER_ENABLED)
30160 xmlTextReaderPtr ret_val;
30161 const char * URI; /* the URI of the resource to process */
30164 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30165 mem_base = xmlMemBlocks();
30166 URI = gen_filepath(n_URI, 0);
30168 ret_val = xmlNewTextReaderFilename(URI);
30169 desret_xmlTextReaderPtr(ret_val);
30171 des_filepath(n_URI, URI, 0);
30172 xmlResetLastError();
30173 if (mem_base != xmlMemBlocks()) {
30174 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30175 xmlMemBlocks() - mem_base);
30177 printf(" %d", n_URI);
30189 test_xmlReaderForDoc(void) {
30192 #if defined(LIBXML_READER_ENABLED)
30194 xmlTextReaderPtr ret_val;
30195 xmlChar * cur; /* a pointer to a zero terminated string */
30197 const char * URL; /* the base URL to use for the document */
30199 char * encoding; /* the document encoding, or NULL */
30201 int options; /* a combination of xmlParserOption */
30204 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30205 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30206 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30207 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30208 mem_base = xmlMemBlocks();
30209 cur = gen_const_xmlChar_ptr(n_cur, 0);
30210 URL = gen_filepath(n_URL, 1);
30211 encoding = gen_const_char_ptr(n_encoding, 2);
30212 options = gen_parseroptions(n_options, 3);
30214 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30215 desret_xmlTextReaderPtr(ret_val);
30217 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30218 des_filepath(n_URL, URL, 1);
30219 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30220 des_parseroptions(n_options, options, 3);
30221 xmlResetLastError();
30222 if (mem_base != xmlMemBlocks()) {
30223 printf("Leak of %d blocks found in xmlReaderForDoc",
30224 xmlMemBlocks() - mem_base);
30226 printf(" %d", n_cur);
30227 printf(" %d", n_URL);
30228 printf(" %d", n_encoding);
30229 printf(" %d", n_options);
30244 test_xmlReaderForFile(void) {
30247 #if defined(LIBXML_READER_ENABLED)
30249 xmlTextReaderPtr ret_val;
30250 const char * filename; /* a file or URL */
30252 char * encoding; /* the document encoding, or NULL */
30254 int options; /* a combination of xmlParserOption */
30257 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30258 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30259 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30260 mem_base = xmlMemBlocks();
30261 filename = gen_filepath(n_filename, 0);
30262 encoding = gen_const_char_ptr(n_encoding, 1);
30263 options = gen_parseroptions(n_options, 2);
30265 ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30266 desret_xmlTextReaderPtr(ret_val);
30268 des_filepath(n_filename, filename, 0);
30269 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30270 des_parseroptions(n_options, options, 2);
30271 xmlResetLastError();
30272 if (mem_base != xmlMemBlocks()) {
30273 printf("Leak of %d blocks found in xmlReaderForFile",
30274 xmlMemBlocks() - mem_base);
30276 printf(" %d", n_filename);
30277 printf(" %d", n_encoding);
30278 printf(" %d", n_options);
30292 test_xmlReaderForMemory(void) {
30295 #if defined(LIBXML_READER_ENABLED)
30297 xmlTextReaderPtr ret_val;
30298 char * buffer; /* a pointer to a char array */
30300 int size; /* the size of the array */
30302 const char * URL; /* the base URL to use for the document */
30304 char * encoding; /* the document encoding, or NULL */
30306 int options; /* a combination of xmlParserOption */
30309 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30310 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30311 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30312 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30313 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30314 mem_base = xmlMemBlocks();
30315 buffer = gen_const_char_ptr(n_buffer, 0);
30316 size = gen_int(n_size, 1);
30317 URL = gen_filepath(n_URL, 2);
30318 encoding = gen_const_char_ptr(n_encoding, 3);
30319 options = gen_parseroptions(n_options, 4);
30320 if ((buffer != NULL) &&
30321 (size > (int) strlen((const char *) buffer) + 1))
30324 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30325 desret_xmlTextReaderPtr(ret_val);
30327 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30328 des_int(n_size, size, 1);
30329 des_filepath(n_URL, URL, 2);
30330 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30331 des_parseroptions(n_options, options, 4);
30332 xmlResetLastError();
30333 if (mem_base != xmlMemBlocks()) {
30334 printf("Leak of %d blocks found in xmlReaderForMemory",
30335 xmlMemBlocks() - mem_base);
30337 printf(" %d", n_buffer);
30338 printf(" %d", n_size);
30339 printf(" %d", n_URL);
30340 printf(" %d", n_encoding);
30341 printf(" %d", n_options);
30357 test_xmlReaderNewDoc(void) {
30360 #if defined(LIBXML_READER_ENABLED)
30363 xmlTextReaderPtr reader; /* an XML reader */
30365 xmlChar * cur; /* a pointer to a zero terminated string */
30367 const char * URL; /* the base URL to use for the document */
30369 char * encoding; /* the document encoding, or NULL */
30371 int options; /* a combination of xmlParserOption */
30374 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30375 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30376 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30377 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30378 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30379 mem_base = xmlMemBlocks();
30380 reader = gen_xmlTextReaderPtr(n_reader, 0);
30381 cur = gen_const_xmlChar_ptr(n_cur, 1);
30382 URL = gen_filepath(n_URL, 2);
30383 encoding = gen_const_char_ptr(n_encoding, 3);
30384 options = gen_parseroptions(n_options, 4);
30386 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30387 desret_int(ret_val);
30389 des_xmlTextReaderPtr(n_reader, reader, 0);
30390 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30391 des_filepath(n_URL, URL, 2);
30392 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30393 des_parseroptions(n_options, options, 4);
30394 xmlResetLastError();
30395 if (mem_base != xmlMemBlocks()) {
30396 printf("Leak of %d blocks found in xmlReaderNewDoc",
30397 xmlMemBlocks() - mem_base);
30399 printf(" %d", n_reader);
30400 printf(" %d", n_cur);
30401 printf(" %d", n_URL);
30402 printf(" %d", n_encoding);
30403 printf(" %d", n_options);
30419 test_xmlReaderNewFile(void) {
30422 #if defined(LIBXML_READER_ENABLED)
30425 xmlTextReaderPtr reader; /* an XML reader */
30427 const char * filename; /* a file or URL */
30429 char * encoding; /* the document encoding, or NULL */
30431 int options; /* a combination of xmlParserOption */
30434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30435 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30436 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30437 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30438 mem_base = xmlMemBlocks();
30439 reader = gen_xmlTextReaderPtr(n_reader, 0);
30440 filename = gen_filepath(n_filename, 1);
30441 encoding = gen_const_char_ptr(n_encoding, 2);
30442 options = gen_parseroptions(n_options, 3);
30444 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30445 desret_int(ret_val);
30447 des_xmlTextReaderPtr(n_reader, reader, 0);
30448 des_filepath(n_filename, filename, 1);
30449 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30450 des_parseroptions(n_options, options, 3);
30451 xmlResetLastError();
30452 if (mem_base != xmlMemBlocks()) {
30453 printf("Leak of %d blocks found in xmlReaderNewFile",
30454 xmlMemBlocks() - mem_base);
30456 printf(" %d", n_reader);
30457 printf(" %d", n_filename);
30458 printf(" %d", n_encoding);
30459 printf(" %d", n_options);
30474 test_xmlReaderNewMemory(void) {
30477 #if defined(LIBXML_READER_ENABLED)
30480 xmlTextReaderPtr reader; /* an XML reader */
30482 char * buffer; /* a pointer to a char array */
30484 int size; /* the size of the array */
30486 const char * URL; /* the base URL to use for the document */
30488 char * encoding; /* the document encoding, or NULL */
30490 int options; /* a combination of xmlParserOption */
30493 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30494 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30495 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30496 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30497 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30498 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30499 mem_base = xmlMemBlocks();
30500 reader = gen_xmlTextReaderPtr(n_reader, 0);
30501 buffer = gen_const_char_ptr(n_buffer, 1);
30502 size = gen_int(n_size, 2);
30503 URL = gen_filepath(n_URL, 3);
30504 encoding = gen_const_char_ptr(n_encoding, 4);
30505 options = gen_parseroptions(n_options, 5);
30506 if ((buffer != NULL) &&
30507 (size > (int) strlen((const char *) buffer) + 1))
30510 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30511 desret_int(ret_val);
30513 des_xmlTextReaderPtr(n_reader, reader, 0);
30514 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30515 des_int(n_size, size, 2);
30516 des_filepath(n_URL, URL, 3);
30517 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30518 des_parseroptions(n_options, options, 5);
30519 xmlResetLastError();
30520 if (mem_base != xmlMemBlocks()) {
30521 printf("Leak of %d blocks found in xmlReaderNewMemory",
30522 xmlMemBlocks() - mem_base);
30524 printf(" %d", n_reader);
30525 printf(" %d", n_buffer);
30526 printf(" %d", n_size);
30527 printf(" %d", n_URL);
30528 printf(" %d", n_encoding);
30529 printf(" %d", n_options);
30546 test_xmlReaderNewWalker(void) {
30549 #if defined(LIBXML_READER_ENABLED)
30552 xmlTextReaderPtr reader; /* an XML reader */
30554 xmlDocPtr doc; /* a preparsed document */
30557 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30558 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30559 mem_base = xmlMemBlocks();
30560 reader = gen_xmlTextReaderPtr(n_reader, 0);
30561 doc = gen_xmlDocPtr(n_doc, 1);
30563 ret_val = xmlReaderNewWalker(reader, doc);
30564 desret_int(ret_val);
30566 des_xmlTextReaderPtr(n_reader, reader, 0);
30567 des_xmlDocPtr(n_doc, doc, 1);
30568 xmlResetLastError();
30569 if (mem_base != xmlMemBlocks()) {
30570 printf("Leak of %d blocks found in xmlReaderNewWalker",
30571 xmlMemBlocks() - mem_base);
30573 printf(" %d", n_reader);
30574 printf(" %d", n_doc);
30587 test_xmlReaderWalker(void) {
30590 #if defined(LIBXML_READER_ENABLED)
30592 xmlTextReaderPtr ret_val;
30593 xmlDocPtr doc; /* a preparsed document */
30596 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30597 mem_base = xmlMemBlocks();
30598 doc = gen_xmlDocPtr(n_doc, 0);
30600 ret_val = xmlReaderWalker(doc);
30601 desret_xmlTextReaderPtr(ret_val);
30603 des_xmlDocPtr(n_doc, doc, 0);
30604 xmlResetLastError();
30605 if (mem_base != xmlMemBlocks()) {
30606 printf("Leak of %d blocks found in xmlReaderWalker",
30607 xmlMemBlocks() - mem_base);
30609 printf(" %d", n_doc);
30621 test_xmlTextReaderAttributeCount(void) {
30624 #if defined(LIBXML_READER_ENABLED)
30627 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30630 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30631 mem_base = xmlMemBlocks();
30632 reader = gen_xmlTextReaderPtr(n_reader, 0);
30634 ret_val = xmlTextReaderAttributeCount(reader);
30635 desret_int(ret_val);
30637 des_xmlTextReaderPtr(n_reader, reader, 0);
30638 xmlResetLastError();
30639 if (mem_base != xmlMemBlocks()) {
30640 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30641 xmlMemBlocks() - mem_base);
30643 printf(" %d", n_reader);
30655 test_xmlTextReaderBaseUri(void) {
30658 #if defined(LIBXML_READER_ENABLED)
30661 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30664 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30665 mem_base = xmlMemBlocks();
30666 reader = gen_xmlTextReaderPtr(n_reader, 0);
30668 ret_val = xmlTextReaderBaseUri(reader);
30669 desret_xmlChar_ptr(ret_val);
30671 des_xmlTextReaderPtr(n_reader, reader, 0);
30672 xmlResetLastError();
30673 if (mem_base != xmlMemBlocks()) {
30674 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30675 xmlMemBlocks() - mem_base);
30677 printf(" %d", n_reader);
30689 test_xmlTextReaderByteConsumed(void) {
30692 #if defined(LIBXML_READER_ENABLED)
30695 xmlTextReaderPtr reader; /* an XML reader */
30698 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30699 mem_base = xmlMemBlocks();
30700 reader = gen_xmlTextReaderPtr(n_reader, 0);
30702 ret_val = xmlTextReaderByteConsumed(reader);
30703 desret_long(ret_val);
30705 des_xmlTextReaderPtr(n_reader, reader, 0);
30706 xmlResetLastError();
30707 if (mem_base != xmlMemBlocks()) {
30708 printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30709 xmlMemBlocks() - mem_base);
30711 printf(" %d", n_reader);
30723 test_xmlTextReaderClose(void) {
30726 #if defined(LIBXML_READER_ENABLED)
30729 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30732 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30733 mem_base = xmlMemBlocks();
30734 reader = gen_xmlTextReaderPtr(n_reader, 0);
30736 ret_val = xmlTextReaderClose(reader);
30737 desret_int(ret_val);
30739 des_xmlTextReaderPtr(n_reader, reader, 0);
30740 xmlResetLastError();
30741 if (mem_base != xmlMemBlocks()) {
30742 printf("Leak of %d blocks found in xmlTextReaderClose",
30743 xmlMemBlocks() - mem_base);
30745 printf(" %d", n_reader);
30757 test_xmlTextReaderConstBaseUri(void) {
30760 #if defined(LIBXML_READER_ENABLED)
30762 const xmlChar * ret_val;
30763 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30766 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30767 mem_base = xmlMemBlocks();
30768 reader = gen_xmlTextReaderPtr(n_reader, 0);
30770 ret_val = xmlTextReaderConstBaseUri(reader);
30771 desret_const_xmlChar_ptr(ret_val);
30773 des_xmlTextReaderPtr(n_reader, reader, 0);
30774 xmlResetLastError();
30775 if (mem_base != xmlMemBlocks()) {
30776 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30777 xmlMemBlocks() - mem_base);
30779 printf(" %d", n_reader);
30791 test_xmlTextReaderConstEncoding(void) {
30794 #if defined(LIBXML_READER_ENABLED)
30796 const xmlChar * ret_val;
30797 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30800 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30801 mem_base = xmlMemBlocks();
30802 reader = gen_xmlTextReaderPtr(n_reader, 0);
30804 ret_val = xmlTextReaderConstEncoding(reader);
30805 desret_const_xmlChar_ptr(ret_val);
30807 des_xmlTextReaderPtr(n_reader, reader, 0);
30808 xmlResetLastError();
30809 if (mem_base != xmlMemBlocks()) {
30810 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30811 xmlMemBlocks() - mem_base);
30813 printf(" %d", n_reader);
30825 test_xmlTextReaderConstLocalName(void) {
30828 #if defined(LIBXML_READER_ENABLED)
30830 const xmlChar * ret_val;
30831 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30834 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30835 mem_base = xmlMemBlocks();
30836 reader = gen_xmlTextReaderPtr(n_reader, 0);
30838 ret_val = xmlTextReaderConstLocalName(reader);
30839 desret_const_xmlChar_ptr(ret_val);
30841 des_xmlTextReaderPtr(n_reader, reader, 0);
30842 xmlResetLastError();
30843 if (mem_base != xmlMemBlocks()) {
30844 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30845 xmlMemBlocks() - mem_base);
30847 printf(" %d", n_reader);
30859 test_xmlTextReaderConstName(void) {
30862 #if defined(LIBXML_READER_ENABLED)
30864 const xmlChar * ret_val;
30865 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30868 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30869 mem_base = xmlMemBlocks();
30870 reader = gen_xmlTextReaderPtr(n_reader, 0);
30872 ret_val = xmlTextReaderConstName(reader);
30873 desret_const_xmlChar_ptr(ret_val);
30875 des_xmlTextReaderPtr(n_reader, reader, 0);
30876 xmlResetLastError();
30877 if (mem_base != xmlMemBlocks()) {
30878 printf("Leak of %d blocks found in xmlTextReaderConstName",
30879 xmlMemBlocks() - mem_base);
30881 printf(" %d", n_reader);
30893 test_xmlTextReaderConstNamespaceUri(void) {
30896 #if defined(LIBXML_READER_ENABLED)
30898 const xmlChar * ret_val;
30899 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30902 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30903 mem_base = xmlMemBlocks();
30904 reader = gen_xmlTextReaderPtr(n_reader, 0);
30906 ret_val = xmlTextReaderConstNamespaceUri(reader);
30907 desret_const_xmlChar_ptr(ret_val);
30909 des_xmlTextReaderPtr(n_reader, reader, 0);
30910 xmlResetLastError();
30911 if (mem_base != xmlMemBlocks()) {
30912 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30913 xmlMemBlocks() - mem_base);
30915 printf(" %d", n_reader);
30927 test_xmlTextReaderConstPrefix(void) {
30930 #if defined(LIBXML_READER_ENABLED)
30932 const xmlChar * ret_val;
30933 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30936 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30937 mem_base = xmlMemBlocks();
30938 reader = gen_xmlTextReaderPtr(n_reader, 0);
30940 ret_val = xmlTextReaderConstPrefix(reader);
30941 desret_const_xmlChar_ptr(ret_val);
30943 des_xmlTextReaderPtr(n_reader, reader, 0);
30944 xmlResetLastError();
30945 if (mem_base != xmlMemBlocks()) {
30946 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30947 xmlMemBlocks() - mem_base);
30949 printf(" %d", n_reader);
30961 test_xmlTextReaderConstString(void) {
30964 #if defined(LIBXML_READER_ENABLED)
30966 const xmlChar * ret_val;
30967 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30969 xmlChar * str; /* the string to intern. */
30972 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30973 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30974 mem_base = xmlMemBlocks();
30975 reader = gen_xmlTextReaderPtr(n_reader, 0);
30976 str = gen_const_xmlChar_ptr(n_str, 1);
30978 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30979 desret_const_xmlChar_ptr(ret_val);
30981 des_xmlTextReaderPtr(n_reader, reader, 0);
30982 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30983 xmlResetLastError();
30984 if (mem_base != xmlMemBlocks()) {
30985 printf("Leak of %d blocks found in xmlTextReaderConstString",
30986 xmlMemBlocks() - mem_base);
30988 printf(" %d", n_reader);
30989 printf(" %d", n_str);
31002 test_xmlTextReaderConstValue(void) {
31005 #if defined(LIBXML_READER_ENABLED)
31007 const xmlChar * ret_val;
31008 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31011 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31012 mem_base = xmlMemBlocks();
31013 reader = gen_xmlTextReaderPtr(n_reader, 0);
31015 ret_val = xmlTextReaderConstValue(reader);
31016 desret_const_xmlChar_ptr(ret_val);
31018 des_xmlTextReaderPtr(n_reader, reader, 0);
31019 xmlResetLastError();
31020 if (mem_base != xmlMemBlocks()) {
31021 printf("Leak of %d blocks found in xmlTextReaderConstValue",
31022 xmlMemBlocks() - mem_base);
31024 printf(" %d", n_reader);
31036 test_xmlTextReaderConstXmlLang(void) {
31039 #if defined(LIBXML_READER_ENABLED)
31041 const xmlChar * ret_val;
31042 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31045 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31046 mem_base = xmlMemBlocks();
31047 reader = gen_xmlTextReaderPtr(n_reader, 0);
31049 ret_val = xmlTextReaderConstXmlLang(reader);
31050 desret_const_xmlChar_ptr(ret_val);
31052 des_xmlTextReaderPtr(n_reader, reader, 0);
31053 xmlResetLastError();
31054 if (mem_base != xmlMemBlocks()) {
31055 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
31056 xmlMemBlocks() - mem_base);
31058 printf(" %d", n_reader);
31070 test_xmlTextReaderConstXmlVersion(void) {
31073 #if defined(LIBXML_READER_ENABLED)
31075 const xmlChar * ret_val;
31076 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31079 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31080 mem_base = xmlMemBlocks();
31081 reader = gen_xmlTextReaderPtr(n_reader, 0);
31083 ret_val = xmlTextReaderConstXmlVersion(reader);
31084 desret_const_xmlChar_ptr(ret_val);
31086 des_xmlTextReaderPtr(n_reader, reader, 0);
31087 xmlResetLastError();
31088 if (mem_base != xmlMemBlocks()) {
31089 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
31090 xmlMemBlocks() - mem_base);
31092 printf(" %d", n_reader);
31104 test_xmlTextReaderCurrentDoc(void) {
31107 #if defined(LIBXML_READER_ENABLED)
31110 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31113 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31114 mem_base = xmlMemBlocks();
31115 reader = gen_xmlTextReaderPtr(n_reader, 0);
31117 ret_val = xmlTextReaderCurrentDoc(reader);
31118 desret_xmlDocPtr(ret_val);
31120 des_xmlTextReaderPtr(n_reader, reader, 0);
31121 xmlResetLastError();
31122 if (mem_base != xmlMemBlocks()) {
31123 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31124 xmlMemBlocks() - mem_base);
31126 printf(" %d", n_reader);
31138 test_xmlTextReaderCurrentNode(void) {
31141 #if defined(LIBXML_READER_ENABLED)
31143 xmlNodePtr ret_val;
31144 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31147 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31148 mem_base = xmlMemBlocks();
31149 reader = gen_xmlTextReaderPtr(n_reader, 0);
31151 ret_val = xmlTextReaderCurrentNode(reader);
31152 desret_xmlNodePtr(ret_val);
31154 des_xmlTextReaderPtr(n_reader, reader, 0);
31155 xmlResetLastError();
31156 if (mem_base != xmlMemBlocks()) {
31157 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31158 xmlMemBlocks() - mem_base);
31160 printf(" %d", n_reader);
31172 test_xmlTextReaderDepth(void) {
31175 #if defined(LIBXML_READER_ENABLED)
31178 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31181 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31182 mem_base = xmlMemBlocks();
31183 reader = gen_xmlTextReaderPtr(n_reader, 0);
31185 ret_val = xmlTextReaderDepth(reader);
31186 desret_int(ret_val);
31188 des_xmlTextReaderPtr(n_reader, reader, 0);
31189 xmlResetLastError();
31190 if (mem_base != xmlMemBlocks()) {
31191 printf("Leak of %d blocks found in xmlTextReaderDepth",
31192 xmlMemBlocks() - mem_base);
31194 printf(" %d", n_reader);
31206 test_xmlTextReaderExpand(void) {
31209 #if defined(LIBXML_READER_ENABLED)
31211 xmlNodePtr ret_val;
31212 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31215 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31216 mem_base = xmlMemBlocks();
31217 reader = gen_xmlTextReaderPtr(n_reader, 0);
31219 ret_val = xmlTextReaderExpand(reader);
31220 desret_xmlNodePtr(ret_val);
31222 des_xmlTextReaderPtr(n_reader, reader, 0);
31223 xmlResetLastError();
31224 if (mem_base != xmlMemBlocks()) {
31225 printf("Leak of %d blocks found in xmlTextReaderExpand",
31226 xmlMemBlocks() - mem_base);
31228 printf(" %d", n_reader);
31240 test_xmlTextReaderGetAttribute(void) {
31243 #if defined(LIBXML_READER_ENABLED)
31246 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31248 xmlChar * name; /* the qualified name of the attribute. */
31251 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31252 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31253 mem_base = xmlMemBlocks();
31254 reader = gen_xmlTextReaderPtr(n_reader, 0);
31255 name = gen_const_xmlChar_ptr(n_name, 1);
31257 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31258 desret_xmlChar_ptr(ret_val);
31260 des_xmlTextReaderPtr(n_reader, reader, 0);
31261 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31262 xmlResetLastError();
31263 if (mem_base != xmlMemBlocks()) {
31264 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31265 xmlMemBlocks() - mem_base);
31267 printf(" %d", n_reader);
31268 printf(" %d", n_name);
31281 test_xmlTextReaderGetAttributeNo(void) {
31284 #if defined(LIBXML_READER_ENABLED)
31287 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31289 int no; /* the zero-based index of the attribute relative to the containing element */
31292 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31293 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31294 mem_base = xmlMemBlocks();
31295 reader = gen_xmlTextReaderPtr(n_reader, 0);
31296 no = gen_int(n_no, 1);
31298 ret_val = xmlTextReaderGetAttributeNo(reader, no);
31299 desret_xmlChar_ptr(ret_val);
31301 des_xmlTextReaderPtr(n_reader, reader, 0);
31302 des_int(n_no, no, 1);
31303 xmlResetLastError();
31304 if (mem_base != xmlMemBlocks()) {
31305 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31306 xmlMemBlocks() - mem_base);
31308 printf(" %d", n_reader);
31309 printf(" %d", n_no);
31322 test_xmlTextReaderGetAttributeNs(void) {
31325 #if defined(LIBXML_READER_ENABLED)
31328 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31330 xmlChar * localName; /* the local name of the attribute. */
31332 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31333 int n_namespaceURI;
31335 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31336 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31337 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31338 mem_base = xmlMemBlocks();
31339 reader = gen_xmlTextReaderPtr(n_reader, 0);
31340 localName = gen_const_xmlChar_ptr(n_localName, 1);
31341 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31343 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31344 desret_xmlChar_ptr(ret_val);
31346 des_xmlTextReaderPtr(n_reader, reader, 0);
31347 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31348 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31349 xmlResetLastError();
31350 if (mem_base != xmlMemBlocks()) {
31351 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31352 xmlMemBlocks() - mem_base);
31354 printf(" %d", n_reader);
31355 printf(" %d", n_localName);
31356 printf(" %d", n_namespaceURI);
31368 #ifdef LIBXML_READER_ENABLED
31370 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31371 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31374 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31380 test_xmlTextReaderGetErrorHandler(void) {
31383 #if defined(LIBXML_READER_ENABLED)
31385 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31387 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31389 void ** arg; /* a user argument */
31392 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31393 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31394 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31395 mem_base = xmlMemBlocks();
31396 reader = gen_xmlTextReaderPtr(n_reader, 0);
31397 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31398 arg = gen_void_ptr_ptr(n_arg, 2);
31400 xmlTextReaderGetErrorHandler(reader, f, arg);
31402 des_xmlTextReaderPtr(n_reader, reader, 0);
31403 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31404 des_void_ptr_ptr(n_arg, arg, 2);
31405 xmlResetLastError();
31406 if (mem_base != xmlMemBlocks()) {
31407 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31408 xmlMemBlocks() - mem_base);
31410 printf(" %d", n_reader);
31411 printf(" %d", n_f);
31412 printf(" %d", n_arg);
31426 test_xmlTextReaderGetParserColumnNumber(void) {
31429 #if defined(LIBXML_READER_ENABLED)
31432 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31435 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31436 mem_base = xmlMemBlocks();
31437 reader = gen_xmlTextReaderPtr(n_reader, 0);
31439 ret_val = xmlTextReaderGetParserColumnNumber(reader);
31440 desret_int(ret_val);
31442 des_xmlTextReaderPtr(n_reader, reader, 0);
31443 xmlResetLastError();
31444 if (mem_base != xmlMemBlocks()) {
31445 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31446 xmlMemBlocks() - mem_base);
31448 printf(" %d", n_reader);
31460 test_xmlTextReaderGetParserLineNumber(void) {
31463 #if defined(LIBXML_READER_ENABLED)
31466 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31469 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31470 mem_base = xmlMemBlocks();
31471 reader = gen_xmlTextReaderPtr(n_reader, 0);
31473 ret_val = xmlTextReaderGetParserLineNumber(reader);
31474 desret_int(ret_val);
31476 des_xmlTextReaderPtr(n_reader, reader, 0);
31477 xmlResetLastError();
31478 if (mem_base != xmlMemBlocks()) {
31479 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31480 xmlMemBlocks() - mem_base);
31482 printf(" %d", n_reader);
31494 test_xmlTextReaderGetParserProp(void) {
31497 #if defined(LIBXML_READER_ENABLED)
31500 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31502 int prop; /* the xmlParserProperties to get */
31505 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31506 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31507 mem_base = xmlMemBlocks();
31508 reader = gen_xmlTextReaderPtr(n_reader, 0);
31509 prop = gen_int(n_prop, 1);
31511 ret_val = xmlTextReaderGetParserProp(reader, prop);
31512 desret_int(ret_val);
31514 des_xmlTextReaderPtr(n_reader, reader, 0);
31515 des_int(n_prop, prop, 1);
31516 xmlResetLastError();
31517 if (mem_base != xmlMemBlocks()) {
31518 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31519 xmlMemBlocks() - mem_base);
31521 printf(" %d", n_reader);
31522 printf(" %d", n_prop);
31535 test_xmlTextReaderGetRemainder(void) {
31538 #if defined(LIBXML_READER_ENABLED)
31540 xmlParserInputBufferPtr ret_val;
31541 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31544 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31545 mem_base = xmlMemBlocks();
31546 reader = gen_xmlTextReaderPtr(n_reader, 0);
31548 ret_val = xmlTextReaderGetRemainder(reader);
31549 desret_xmlParserInputBufferPtr(ret_val);
31551 des_xmlTextReaderPtr(n_reader, reader, 0);
31552 xmlResetLastError();
31553 if (mem_base != xmlMemBlocks()) {
31554 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31555 xmlMemBlocks() - mem_base);
31557 printf(" %d", n_reader);
31569 test_xmlTextReaderHasAttributes(void) {
31572 #if defined(LIBXML_READER_ENABLED)
31575 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31578 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31579 mem_base = xmlMemBlocks();
31580 reader = gen_xmlTextReaderPtr(n_reader, 0);
31582 ret_val = xmlTextReaderHasAttributes(reader);
31583 desret_int(ret_val);
31585 des_xmlTextReaderPtr(n_reader, reader, 0);
31586 xmlResetLastError();
31587 if (mem_base != xmlMemBlocks()) {
31588 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31589 xmlMemBlocks() - mem_base);
31591 printf(" %d", n_reader);
31603 test_xmlTextReaderHasValue(void) {
31606 #if defined(LIBXML_READER_ENABLED)
31609 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31612 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31613 mem_base = xmlMemBlocks();
31614 reader = gen_xmlTextReaderPtr(n_reader, 0);
31616 ret_val = xmlTextReaderHasValue(reader);
31617 desret_int(ret_val);
31619 des_xmlTextReaderPtr(n_reader, reader, 0);
31620 xmlResetLastError();
31621 if (mem_base != xmlMemBlocks()) {
31622 printf("Leak of %d blocks found in xmlTextReaderHasValue",
31623 xmlMemBlocks() - mem_base);
31625 printf(" %d", n_reader);
31637 test_xmlTextReaderIsDefault(void) {
31640 #if defined(LIBXML_READER_ENABLED)
31643 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31646 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31647 mem_base = xmlMemBlocks();
31648 reader = gen_xmlTextReaderPtr(n_reader, 0);
31650 ret_val = xmlTextReaderIsDefault(reader);
31651 desret_int(ret_val);
31653 des_xmlTextReaderPtr(n_reader, reader, 0);
31654 xmlResetLastError();
31655 if (mem_base != xmlMemBlocks()) {
31656 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31657 xmlMemBlocks() - mem_base);
31659 printf(" %d", n_reader);
31671 test_xmlTextReaderIsEmptyElement(void) {
31674 #if defined(LIBXML_READER_ENABLED)
31677 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31680 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31681 mem_base = xmlMemBlocks();
31682 reader = gen_xmlTextReaderPtr(n_reader, 0);
31684 ret_val = xmlTextReaderIsEmptyElement(reader);
31685 desret_int(ret_val);
31687 des_xmlTextReaderPtr(n_reader, reader, 0);
31688 xmlResetLastError();
31689 if (mem_base != xmlMemBlocks()) {
31690 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31691 xmlMemBlocks() - mem_base);
31693 printf(" %d", n_reader);
31705 test_xmlTextReaderIsNamespaceDecl(void) {
31708 #if defined(LIBXML_READER_ENABLED)
31711 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31714 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31715 mem_base = xmlMemBlocks();
31716 reader = gen_xmlTextReaderPtr(n_reader, 0);
31718 ret_val = xmlTextReaderIsNamespaceDecl(reader);
31719 desret_int(ret_val);
31721 des_xmlTextReaderPtr(n_reader, reader, 0);
31722 xmlResetLastError();
31723 if (mem_base != xmlMemBlocks()) {
31724 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31725 xmlMemBlocks() - mem_base);
31727 printf(" %d", n_reader);
31739 test_xmlTextReaderIsValid(void) {
31742 #if defined(LIBXML_READER_ENABLED)
31745 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31748 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31749 mem_base = xmlMemBlocks();
31750 reader = gen_xmlTextReaderPtr(n_reader, 0);
31752 ret_val = xmlTextReaderIsValid(reader);
31753 desret_int(ret_val);
31755 des_xmlTextReaderPtr(n_reader, reader, 0);
31756 xmlResetLastError();
31757 if (mem_base != xmlMemBlocks()) {
31758 printf("Leak of %d blocks found in xmlTextReaderIsValid",
31759 xmlMemBlocks() - mem_base);
31761 printf(" %d", n_reader);
31773 test_xmlTextReaderLocalName(void) {
31776 #if defined(LIBXML_READER_ENABLED)
31779 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31782 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31783 mem_base = xmlMemBlocks();
31784 reader = gen_xmlTextReaderPtr(n_reader, 0);
31786 ret_val = xmlTextReaderLocalName(reader);
31787 desret_xmlChar_ptr(ret_val);
31789 des_xmlTextReaderPtr(n_reader, reader, 0);
31790 xmlResetLastError();
31791 if (mem_base != xmlMemBlocks()) {
31792 printf("Leak of %d blocks found in xmlTextReaderLocalName",
31793 xmlMemBlocks() - mem_base);
31795 printf(" %d", n_reader);
31805 #ifdef LIBXML_READER_ENABLED
31807 #define gen_nb_xmlTextReaderLocatorPtr 1
31808 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31811 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31817 test_xmlTextReaderLocatorBaseURI(void) {
31820 #if defined(LIBXML_READER_ENABLED)
31823 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31826 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31827 mem_base = xmlMemBlocks();
31828 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31830 ret_val = xmlTextReaderLocatorBaseURI(locator);
31831 desret_xmlChar_ptr(ret_val);
31833 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31834 xmlResetLastError();
31835 if (mem_base != xmlMemBlocks()) {
31836 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31837 xmlMemBlocks() - mem_base);
31839 printf(" %d", n_locator);
31851 test_xmlTextReaderLocatorLineNumber(void) {
31854 #if defined(LIBXML_READER_ENABLED)
31857 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31860 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31861 mem_base = xmlMemBlocks();
31862 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31864 ret_val = xmlTextReaderLocatorLineNumber(locator);
31865 desret_int(ret_val);
31867 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31868 xmlResetLastError();
31869 if (mem_base != xmlMemBlocks()) {
31870 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31871 xmlMemBlocks() - mem_base);
31873 printf(" %d", n_locator);
31885 test_xmlTextReaderLookupNamespace(void) {
31888 #if defined(LIBXML_READER_ENABLED)
31891 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31893 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31896 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31897 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31898 mem_base = xmlMemBlocks();
31899 reader = gen_xmlTextReaderPtr(n_reader, 0);
31900 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31902 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31903 desret_xmlChar_ptr(ret_val);
31905 des_xmlTextReaderPtr(n_reader, reader, 0);
31906 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31907 xmlResetLastError();
31908 if (mem_base != xmlMemBlocks()) {
31909 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31910 xmlMemBlocks() - mem_base);
31912 printf(" %d", n_reader);
31913 printf(" %d", n_prefix);
31926 test_xmlTextReaderMoveToAttribute(void) {
31929 #if defined(LIBXML_READER_ENABLED)
31932 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31934 xmlChar * name; /* the qualified name of the attribute. */
31937 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31938 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31939 mem_base = xmlMemBlocks();
31940 reader = gen_xmlTextReaderPtr(n_reader, 0);
31941 name = gen_const_xmlChar_ptr(n_name, 1);
31943 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31944 desret_int(ret_val);
31946 des_xmlTextReaderPtr(n_reader, reader, 0);
31947 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31948 xmlResetLastError();
31949 if (mem_base != xmlMemBlocks()) {
31950 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31951 xmlMemBlocks() - mem_base);
31953 printf(" %d", n_reader);
31954 printf(" %d", n_name);
31967 test_xmlTextReaderMoveToAttributeNo(void) {
31970 #if defined(LIBXML_READER_ENABLED)
31973 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31975 int no; /* the zero-based index of the attribute relative to the containing element. */
31978 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31979 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31980 mem_base = xmlMemBlocks();
31981 reader = gen_xmlTextReaderPtr(n_reader, 0);
31982 no = gen_int(n_no, 1);
31984 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31985 desret_int(ret_val);
31987 des_xmlTextReaderPtr(n_reader, reader, 0);
31988 des_int(n_no, no, 1);
31989 xmlResetLastError();
31990 if (mem_base != xmlMemBlocks()) {
31991 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31992 xmlMemBlocks() - mem_base);
31994 printf(" %d", n_reader);
31995 printf(" %d", n_no);
32008 test_xmlTextReaderMoveToAttributeNs(void) {
32011 #if defined(LIBXML_READER_ENABLED)
32014 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32016 xmlChar * localName; /* the local name of the attribute. */
32018 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32019 int n_namespaceURI;
32021 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32022 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32023 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32024 mem_base = xmlMemBlocks();
32025 reader = gen_xmlTextReaderPtr(n_reader, 0);
32026 localName = gen_const_xmlChar_ptr(n_localName, 1);
32027 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32029 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32030 desret_int(ret_val);
32032 des_xmlTextReaderPtr(n_reader, reader, 0);
32033 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32034 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32035 xmlResetLastError();
32036 if (mem_base != xmlMemBlocks()) {
32037 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
32038 xmlMemBlocks() - mem_base);
32040 printf(" %d", n_reader);
32041 printf(" %d", n_localName);
32042 printf(" %d", n_namespaceURI);
32056 test_xmlTextReaderMoveToElement(void) {
32059 #if defined(LIBXML_READER_ENABLED)
32062 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32065 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32066 mem_base = xmlMemBlocks();
32067 reader = gen_xmlTextReaderPtr(n_reader, 0);
32069 ret_val = xmlTextReaderMoveToElement(reader);
32070 desret_int(ret_val);
32072 des_xmlTextReaderPtr(n_reader, reader, 0);
32073 xmlResetLastError();
32074 if (mem_base != xmlMemBlocks()) {
32075 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
32076 xmlMemBlocks() - mem_base);
32078 printf(" %d", n_reader);
32090 test_xmlTextReaderMoveToFirstAttribute(void) {
32093 #if defined(LIBXML_READER_ENABLED)
32096 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32099 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32100 mem_base = xmlMemBlocks();
32101 reader = gen_xmlTextReaderPtr(n_reader, 0);
32103 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
32104 desret_int(ret_val);
32106 des_xmlTextReaderPtr(n_reader, reader, 0);
32107 xmlResetLastError();
32108 if (mem_base != xmlMemBlocks()) {
32109 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
32110 xmlMemBlocks() - mem_base);
32112 printf(" %d", n_reader);
32124 test_xmlTextReaderMoveToNextAttribute(void) {
32127 #if defined(LIBXML_READER_ENABLED)
32130 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32133 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32134 mem_base = xmlMemBlocks();
32135 reader = gen_xmlTextReaderPtr(n_reader, 0);
32137 ret_val = xmlTextReaderMoveToNextAttribute(reader);
32138 desret_int(ret_val);
32140 des_xmlTextReaderPtr(n_reader, reader, 0);
32141 xmlResetLastError();
32142 if (mem_base != xmlMemBlocks()) {
32143 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32144 xmlMemBlocks() - mem_base);
32146 printf(" %d", n_reader);
32158 test_xmlTextReaderName(void) {
32161 #if defined(LIBXML_READER_ENABLED)
32164 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32167 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32168 mem_base = xmlMemBlocks();
32169 reader = gen_xmlTextReaderPtr(n_reader, 0);
32171 ret_val = xmlTextReaderName(reader);
32172 desret_xmlChar_ptr(ret_val);
32174 des_xmlTextReaderPtr(n_reader, reader, 0);
32175 xmlResetLastError();
32176 if (mem_base != xmlMemBlocks()) {
32177 printf("Leak of %d blocks found in xmlTextReaderName",
32178 xmlMemBlocks() - mem_base);
32180 printf(" %d", n_reader);
32192 test_xmlTextReaderNamespaceUri(void) {
32195 #if defined(LIBXML_READER_ENABLED)
32198 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32201 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32202 mem_base = xmlMemBlocks();
32203 reader = gen_xmlTextReaderPtr(n_reader, 0);
32205 ret_val = xmlTextReaderNamespaceUri(reader);
32206 desret_xmlChar_ptr(ret_val);
32208 des_xmlTextReaderPtr(n_reader, reader, 0);
32209 xmlResetLastError();
32210 if (mem_base != xmlMemBlocks()) {
32211 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32212 xmlMemBlocks() - mem_base);
32214 printf(" %d", n_reader);
32226 test_xmlTextReaderNext(void) {
32229 #if defined(LIBXML_READER_ENABLED)
32232 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32235 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32236 mem_base = xmlMemBlocks();
32237 reader = gen_xmlTextReaderPtr(n_reader, 0);
32239 ret_val = xmlTextReaderNext(reader);
32240 desret_int(ret_val);
32242 des_xmlTextReaderPtr(n_reader, reader, 0);
32243 xmlResetLastError();
32244 if (mem_base != xmlMemBlocks()) {
32245 printf("Leak of %d blocks found in xmlTextReaderNext",
32246 xmlMemBlocks() - mem_base);
32248 printf(" %d", n_reader);
32260 test_xmlTextReaderNextSibling(void) {
32263 #if defined(LIBXML_READER_ENABLED)
32266 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32269 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32270 mem_base = xmlMemBlocks();
32271 reader = gen_xmlTextReaderPtr(n_reader, 0);
32273 ret_val = xmlTextReaderNextSibling(reader);
32274 desret_int(ret_val);
32276 des_xmlTextReaderPtr(n_reader, reader, 0);
32277 xmlResetLastError();
32278 if (mem_base != xmlMemBlocks()) {
32279 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32280 xmlMemBlocks() - mem_base);
32282 printf(" %d", n_reader);
32294 test_xmlTextReaderNodeType(void) {
32297 #if defined(LIBXML_READER_ENABLED)
32300 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32303 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32304 mem_base = xmlMemBlocks();
32305 reader = gen_xmlTextReaderPtr(n_reader, 0);
32307 ret_val = xmlTextReaderNodeType(reader);
32308 desret_int(ret_val);
32310 des_xmlTextReaderPtr(n_reader, reader, 0);
32311 xmlResetLastError();
32312 if (mem_base != xmlMemBlocks()) {
32313 printf("Leak of %d blocks found in xmlTextReaderNodeType",
32314 xmlMemBlocks() - mem_base);
32316 printf(" %d", n_reader);
32328 test_xmlTextReaderNormalization(void) {
32331 #if defined(LIBXML_READER_ENABLED)
32334 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32337 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32338 mem_base = xmlMemBlocks();
32339 reader = gen_xmlTextReaderPtr(n_reader, 0);
32341 ret_val = xmlTextReaderNormalization(reader);
32342 desret_int(ret_val);
32344 des_xmlTextReaderPtr(n_reader, reader, 0);
32345 xmlResetLastError();
32346 if (mem_base != xmlMemBlocks()) {
32347 printf("Leak of %d blocks found in xmlTextReaderNormalization",
32348 xmlMemBlocks() - mem_base);
32350 printf(" %d", n_reader);
32362 test_xmlTextReaderPrefix(void) {
32365 #if defined(LIBXML_READER_ENABLED)
32368 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32371 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32372 mem_base = xmlMemBlocks();
32373 reader = gen_xmlTextReaderPtr(n_reader, 0);
32375 ret_val = xmlTextReaderPrefix(reader);
32376 desret_xmlChar_ptr(ret_val);
32378 des_xmlTextReaderPtr(n_reader, reader, 0);
32379 xmlResetLastError();
32380 if (mem_base != xmlMemBlocks()) {
32381 printf("Leak of %d blocks found in xmlTextReaderPrefix",
32382 xmlMemBlocks() - mem_base);
32384 printf(" %d", n_reader);
32396 test_xmlTextReaderPreserve(void) {
32399 #if defined(LIBXML_READER_ENABLED)
32401 xmlNodePtr ret_val;
32402 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32405 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32406 mem_base = xmlMemBlocks();
32407 reader = gen_xmlTextReaderPtr(n_reader, 0);
32409 ret_val = xmlTextReaderPreserve(reader);
32410 desret_xmlNodePtr(ret_val);
32412 des_xmlTextReaderPtr(n_reader, reader, 0);
32413 xmlResetLastError();
32414 if (mem_base != xmlMemBlocks()) {
32415 printf("Leak of %d blocks found in xmlTextReaderPreserve",
32416 xmlMemBlocks() - mem_base);
32418 printf(" %d", n_reader);
32430 test_xmlTextReaderPreservePattern(void) {
32433 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32434 #ifdef LIBXML_PATTERN_ENABLED
32437 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32439 xmlChar * pattern; /* an XPath subset pattern */
32441 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32444 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32445 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32446 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32447 mem_base = xmlMemBlocks();
32448 reader = gen_xmlTextReaderPtr(n_reader, 0);
32449 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32450 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32452 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32453 desret_int(ret_val);
32455 des_xmlTextReaderPtr(n_reader, reader, 0);
32456 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32457 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32458 xmlResetLastError();
32459 if (mem_base != xmlMemBlocks()) {
32460 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32461 xmlMemBlocks() - mem_base);
32463 printf(" %d", n_reader);
32464 printf(" %d", n_pattern);
32465 printf(" %d", n_namespaces);
32480 test_xmlTextReaderQuoteChar(void) {
32483 #if defined(LIBXML_READER_ENABLED)
32486 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32489 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32490 mem_base = xmlMemBlocks();
32491 reader = gen_xmlTextReaderPtr(n_reader, 0);
32493 ret_val = xmlTextReaderQuoteChar(reader);
32494 desret_int(ret_val);
32496 des_xmlTextReaderPtr(n_reader, reader, 0);
32497 xmlResetLastError();
32498 if (mem_base != xmlMemBlocks()) {
32499 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32500 xmlMemBlocks() - mem_base);
32502 printf(" %d", n_reader);
32514 test_xmlTextReaderRead(void) {
32517 #if defined(LIBXML_READER_ENABLED)
32520 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32523 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32524 mem_base = xmlMemBlocks();
32525 reader = gen_xmlTextReaderPtr(n_reader, 0);
32527 ret_val = xmlTextReaderRead(reader);
32528 desret_int(ret_val);
32530 des_xmlTextReaderPtr(n_reader, reader, 0);
32531 xmlResetLastError();
32532 if (mem_base != xmlMemBlocks()) {
32533 printf("Leak of %d blocks found in xmlTextReaderRead",
32534 xmlMemBlocks() - mem_base);
32536 printf(" %d", n_reader);
32548 test_xmlTextReaderReadAttributeValue(void) {
32551 #if defined(LIBXML_READER_ENABLED)
32554 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32557 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32558 mem_base = xmlMemBlocks();
32559 reader = gen_xmlTextReaderPtr(n_reader, 0);
32561 ret_val = xmlTextReaderReadAttributeValue(reader);
32562 desret_int(ret_val);
32564 des_xmlTextReaderPtr(n_reader, reader, 0);
32565 xmlResetLastError();
32566 if (mem_base != xmlMemBlocks()) {
32567 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32568 xmlMemBlocks() - mem_base);
32570 printf(" %d", n_reader);
32582 test_xmlTextReaderReadState(void) {
32585 #if defined(LIBXML_READER_ENABLED)
32588 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32591 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32592 mem_base = xmlMemBlocks();
32593 reader = gen_xmlTextReaderPtr(n_reader, 0);
32595 ret_val = xmlTextReaderReadState(reader);
32596 desret_int(ret_val);
32598 des_xmlTextReaderPtr(n_reader, reader, 0);
32599 xmlResetLastError();
32600 if (mem_base != xmlMemBlocks()) {
32601 printf("Leak of %d blocks found in xmlTextReaderReadState",
32602 xmlMemBlocks() - mem_base);
32604 printf(" %d", n_reader);
32616 test_xmlTextReaderRelaxNGSetSchema(void) {
32619 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32622 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32624 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32627 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32628 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32629 mem_base = xmlMemBlocks();
32630 reader = gen_xmlTextReaderPtr(n_reader, 0);
32631 schema = gen_xmlRelaxNGPtr(n_schema, 1);
32633 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32634 desret_int(ret_val);
32636 des_xmlTextReaderPtr(n_reader, reader, 0);
32637 des_xmlRelaxNGPtr(n_schema, schema, 1);
32638 xmlResetLastError();
32639 if (mem_base != xmlMemBlocks()) {
32640 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32641 xmlMemBlocks() - mem_base);
32643 printf(" %d", n_reader);
32644 printf(" %d", n_schema);
32657 test_xmlTextReaderRelaxNGValidate(void) {
32660 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32663 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32665 char * rng; /* the path to a RelaxNG schema or NULL */
32668 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32669 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32670 mem_base = xmlMemBlocks();
32671 reader = gen_xmlTextReaderPtr(n_reader, 0);
32672 rng = gen_const_char_ptr(n_rng, 1);
32674 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32675 desret_int(ret_val);
32677 des_xmlTextReaderPtr(n_reader, reader, 0);
32678 des_const_char_ptr(n_rng, (const char *)rng, 1);
32679 xmlResetLastError();
32680 if (mem_base != xmlMemBlocks()) {
32681 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32682 xmlMemBlocks() - mem_base);
32684 printf(" %d", n_reader);
32685 printf(" %d", n_rng);
32698 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32701 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32704 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32706 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32708 int options; /* options (not used yet) */
32711 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32712 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32713 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32714 mem_base = xmlMemBlocks();
32715 reader = gen_xmlTextReaderPtr(n_reader, 0);
32716 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32717 options = gen_parseroptions(n_options, 2);
32719 ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32720 desret_int(ret_val);
32722 des_xmlTextReaderPtr(n_reader, reader, 0);
32723 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32724 des_parseroptions(n_options, options, 2);
32725 xmlResetLastError();
32726 if (mem_base != xmlMemBlocks()) {
32727 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32728 xmlMemBlocks() - mem_base);
32730 printf(" %d", n_reader);
32731 printf(" %d", n_ctxt);
32732 printf(" %d", n_options);
32746 test_xmlTextReaderSchemaValidate(void) {
32749 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32751 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32753 char * xsd; /* the path to a W3C XSD schema or NULL */
32756 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32757 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32758 reader = gen_xmlTextReaderPtr(n_reader, 0);
32759 xsd = gen_const_char_ptr(n_xsd, 1);
32761 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32762 desret_int(ret_val);
32764 des_xmlTextReaderPtr(n_reader, reader, 0);
32765 des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32766 xmlResetLastError();
32777 test_xmlTextReaderSchemaValidateCtxt(void) {
32780 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32783 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32785 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32787 int options; /* options (not used yet) */
32790 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32791 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32792 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32793 mem_base = xmlMemBlocks();
32794 reader = gen_xmlTextReaderPtr(n_reader, 0);
32795 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32796 options = gen_parseroptions(n_options, 2);
32798 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32799 desret_int(ret_val);
32801 des_xmlTextReaderPtr(n_reader, reader, 0);
32802 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32803 des_parseroptions(n_options, options, 2);
32804 xmlResetLastError();
32805 if (mem_base != xmlMemBlocks()) {
32806 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32807 xmlMemBlocks() - mem_base);
32809 printf(" %d", n_reader);
32810 printf(" %d", n_ctxt);
32811 printf(" %d", n_options);
32825 test_xmlTextReaderSetErrorHandler(void) {
32829 /* missing type support */
32835 test_xmlTextReaderSetParserProp(void) {
32838 #if defined(LIBXML_READER_ENABLED)
32841 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32843 int prop; /* the xmlParserProperties to set */
32845 int value; /* usually 0 or 1 to (de)activate it */
32848 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32849 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32850 for (n_value = 0;n_value < gen_nb_int;n_value++) {
32851 mem_base = xmlMemBlocks();
32852 reader = gen_xmlTextReaderPtr(n_reader, 0);
32853 prop = gen_int(n_prop, 1);
32854 value = gen_int(n_value, 2);
32856 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32857 desret_int(ret_val);
32859 des_xmlTextReaderPtr(n_reader, reader, 0);
32860 des_int(n_prop, prop, 1);
32861 des_int(n_value, value, 2);
32862 xmlResetLastError();
32863 if (mem_base != xmlMemBlocks()) {
32864 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32865 xmlMemBlocks() - mem_base);
32867 printf(" %d", n_reader);
32868 printf(" %d", n_prop);
32869 printf(" %d", n_value);
32883 test_xmlTextReaderSetSchema(void) {
32886 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32889 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32891 xmlSchemaPtr schema; /* a precompiled Schema schema */
32894 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32895 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32896 mem_base = xmlMemBlocks();
32897 reader = gen_xmlTextReaderPtr(n_reader, 0);
32898 schema = gen_xmlSchemaPtr(n_schema, 1);
32900 ret_val = xmlTextReaderSetSchema(reader, schema);
32901 desret_int(ret_val);
32903 des_xmlTextReaderPtr(n_reader, reader, 0);
32904 des_xmlSchemaPtr(n_schema, schema, 1);
32905 xmlResetLastError();
32906 if (mem_base != xmlMemBlocks()) {
32907 printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32908 xmlMemBlocks() - mem_base);
32910 printf(" %d", n_reader);
32911 printf(" %d", n_schema);
32924 test_xmlTextReaderSetStructuredErrorHandler(void) {
32928 /* missing type support */
32934 test_xmlTextReaderSetup(void) {
32937 #if defined(LIBXML_READER_ENABLED)
32940 xmlTextReaderPtr reader; /* an XML reader */
32942 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32944 const char * URL; /* the base URL to use for the document */
32946 char * encoding; /* the document encoding, or NULL */
32948 int options; /* a combination of xmlParserOption */
32951 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32952 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32953 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32954 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32955 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32956 mem_base = xmlMemBlocks();
32957 reader = gen_xmlTextReaderPtr(n_reader, 0);
32958 input = gen_xmlParserInputBufferPtr(n_input, 1);
32959 URL = gen_filepath(n_URL, 2);
32960 encoding = gen_const_char_ptr(n_encoding, 3);
32961 options = gen_parseroptions(n_options, 4);
32963 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32964 desret_int(ret_val);
32966 des_xmlTextReaderPtr(n_reader, reader, 0);
32967 des_filepath(n_URL, URL, 2);
32968 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32969 des_parseroptions(n_options, options, 4);
32970 xmlResetLastError();
32971 if (mem_base != xmlMemBlocks()) {
32972 printf("Leak of %d blocks found in xmlTextReaderSetup",
32973 xmlMemBlocks() - mem_base);
32975 printf(" %d", n_reader);
32976 printf(" %d", n_input);
32977 printf(" %d", n_URL);
32978 printf(" %d", n_encoding);
32979 printf(" %d", n_options);
32995 test_xmlTextReaderStandalone(void) {
32998 #if defined(LIBXML_READER_ENABLED)
33001 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33004 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33005 mem_base = xmlMemBlocks();
33006 reader = gen_xmlTextReaderPtr(n_reader, 0);
33008 ret_val = xmlTextReaderStandalone(reader);
33009 desret_int(ret_val);
33011 des_xmlTextReaderPtr(n_reader, reader, 0);
33012 xmlResetLastError();
33013 if (mem_base != xmlMemBlocks()) {
33014 printf("Leak of %d blocks found in xmlTextReaderStandalone",
33015 xmlMemBlocks() - mem_base);
33017 printf(" %d", n_reader);
33029 test_xmlTextReaderValue(void) {
33032 #if defined(LIBXML_READER_ENABLED)
33035 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33038 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33039 mem_base = xmlMemBlocks();
33040 reader = gen_xmlTextReaderPtr(n_reader, 0);
33042 ret_val = xmlTextReaderValue(reader);
33043 desret_xmlChar_ptr(ret_val);
33045 des_xmlTextReaderPtr(n_reader, reader, 0);
33046 xmlResetLastError();
33047 if (mem_base != xmlMemBlocks()) {
33048 printf("Leak of %d blocks found in xmlTextReaderValue",
33049 xmlMemBlocks() - mem_base);
33051 printf(" %d", n_reader);
33063 test_xmlTextReaderXmlLang(void) {
33066 #if defined(LIBXML_READER_ENABLED)
33069 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33072 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33073 mem_base = xmlMemBlocks();
33074 reader = gen_xmlTextReaderPtr(n_reader, 0);
33076 ret_val = xmlTextReaderXmlLang(reader);
33077 desret_xmlChar_ptr(ret_val);
33079 des_xmlTextReaderPtr(n_reader, reader, 0);
33080 xmlResetLastError();
33081 if (mem_base != xmlMemBlocks()) {
33082 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
33083 xmlMemBlocks() - mem_base);
33085 printf(" %d", n_reader);
33096 test_xmlreader(void) {
33099 if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
33100 test_ret += test_xmlNewTextReader();
33101 test_ret += test_xmlNewTextReaderFilename();
33102 test_ret += test_xmlReaderForDoc();
33103 test_ret += test_xmlReaderForFile();
33104 test_ret += test_xmlReaderForMemory();
33105 test_ret += test_xmlReaderNewDoc();
33106 test_ret += test_xmlReaderNewFile();
33107 test_ret += test_xmlReaderNewMemory();
33108 test_ret += test_xmlReaderNewWalker();
33109 test_ret += test_xmlReaderWalker();
33110 test_ret += test_xmlTextReaderAttributeCount();
33111 test_ret += test_xmlTextReaderBaseUri();
33112 test_ret += test_xmlTextReaderByteConsumed();
33113 test_ret += test_xmlTextReaderClose();
33114 test_ret += test_xmlTextReaderConstBaseUri();
33115 test_ret += test_xmlTextReaderConstEncoding();
33116 test_ret += test_xmlTextReaderConstLocalName();
33117 test_ret += test_xmlTextReaderConstName();
33118 test_ret += test_xmlTextReaderConstNamespaceUri();
33119 test_ret += test_xmlTextReaderConstPrefix();
33120 test_ret += test_xmlTextReaderConstString();
33121 test_ret += test_xmlTextReaderConstValue();
33122 test_ret += test_xmlTextReaderConstXmlLang();
33123 test_ret += test_xmlTextReaderConstXmlVersion();
33124 test_ret += test_xmlTextReaderCurrentDoc();
33125 test_ret += test_xmlTextReaderCurrentNode();
33126 test_ret += test_xmlTextReaderDepth();
33127 test_ret += test_xmlTextReaderExpand();
33128 test_ret += test_xmlTextReaderGetAttribute();
33129 test_ret += test_xmlTextReaderGetAttributeNo();
33130 test_ret += test_xmlTextReaderGetAttributeNs();
33131 test_ret += test_xmlTextReaderGetErrorHandler();
33132 test_ret += test_xmlTextReaderGetParserColumnNumber();
33133 test_ret += test_xmlTextReaderGetParserLineNumber();
33134 test_ret += test_xmlTextReaderGetParserProp();
33135 test_ret += test_xmlTextReaderGetRemainder();
33136 test_ret += test_xmlTextReaderHasAttributes();
33137 test_ret += test_xmlTextReaderHasValue();
33138 test_ret += test_xmlTextReaderIsDefault();
33139 test_ret += test_xmlTextReaderIsEmptyElement();
33140 test_ret += test_xmlTextReaderIsNamespaceDecl();
33141 test_ret += test_xmlTextReaderIsValid();
33142 test_ret += test_xmlTextReaderLocalName();
33143 test_ret += test_xmlTextReaderLocatorBaseURI();
33144 test_ret += test_xmlTextReaderLocatorLineNumber();
33145 test_ret += test_xmlTextReaderLookupNamespace();
33146 test_ret += test_xmlTextReaderMoveToAttribute();
33147 test_ret += test_xmlTextReaderMoveToAttributeNo();
33148 test_ret += test_xmlTextReaderMoveToAttributeNs();
33149 test_ret += test_xmlTextReaderMoveToElement();
33150 test_ret += test_xmlTextReaderMoveToFirstAttribute();
33151 test_ret += test_xmlTextReaderMoveToNextAttribute();
33152 test_ret += test_xmlTextReaderName();
33153 test_ret += test_xmlTextReaderNamespaceUri();
33154 test_ret += test_xmlTextReaderNext();
33155 test_ret += test_xmlTextReaderNextSibling();
33156 test_ret += test_xmlTextReaderNodeType();
33157 test_ret += test_xmlTextReaderNormalization();
33158 test_ret += test_xmlTextReaderPrefix();
33159 test_ret += test_xmlTextReaderPreserve();
33160 test_ret += test_xmlTextReaderPreservePattern();
33161 test_ret += test_xmlTextReaderQuoteChar();
33162 test_ret += test_xmlTextReaderRead();
33163 test_ret += test_xmlTextReaderReadAttributeValue();
33164 test_ret += test_xmlTextReaderReadState();
33165 test_ret += test_xmlTextReaderRelaxNGSetSchema();
33166 test_ret += test_xmlTextReaderRelaxNGValidate();
33167 test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33168 test_ret += test_xmlTextReaderSchemaValidate();
33169 test_ret += test_xmlTextReaderSchemaValidateCtxt();
33170 test_ret += test_xmlTextReaderSetErrorHandler();
33171 test_ret += test_xmlTextReaderSetParserProp();
33172 test_ret += test_xmlTextReaderSetSchema();
33173 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33174 test_ret += test_xmlTextReaderSetup();
33175 test_ret += test_xmlTextReaderStandalone();
33176 test_ret += test_xmlTextReaderValue();
33177 test_ret += test_xmlTextReaderXmlLang();
33180 printf("Module xmlreader: %d errors\n", test_ret);
33185 test_xmlExpCtxtNbCons(void) {
33188 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33191 xmlExpCtxtPtr ctxt; /* an expression context */
33194 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33195 mem_base = xmlMemBlocks();
33196 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33198 ret_val = xmlExpCtxtNbCons(ctxt);
33199 desret_int(ret_val);
33201 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33202 xmlResetLastError();
33203 if (mem_base != xmlMemBlocks()) {
33204 printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33205 xmlMemBlocks() - mem_base);
33207 printf(" %d", n_ctxt);
33219 test_xmlExpCtxtNbNodes(void) {
33222 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33225 xmlExpCtxtPtr ctxt; /* an expression context */
33228 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33229 mem_base = xmlMemBlocks();
33230 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33232 ret_val = xmlExpCtxtNbNodes(ctxt);
33233 desret_int(ret_val);
33235 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33236 xmlResetLastError();
33237 if (mem_base != xmlMemBlocks()) {
33238 printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33239 xmlMemBlocks() - mem_base);
33241 printf(" %d", n_ctxt);
33253 test_xmlExpDump(void) {
33256 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33258 xmlBufferPtr buf; /* a buffer to receive the output */
33260 xmlExpNodePtr expr; /* the compiled expression */
33263 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33264 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33265 mem_base = xmlMemBlocks();
33266 buf = gen_xmlBufferPtr(n_buf, 0);
33267 expr = gen_xmlExpNodePtr(n_expr, 1);
33269 xmlExpDump(buf, expr);
33271 des_xmlBufferPtr(n_buf, buf, 0);
33272 des_xmlExpNodePtr(n_expr, expr, 1);
33273 xmlResetLastError();
33274 if (mem_base != xmlMemBlocks()) {
33275 printf("Leak of %d blocks found in xmlExpDump",
33276 xmlMemBlocks() - mem_base);
33278 printf(" %d", n_buf);
33279 printf(" %d", n_expr);
33292 test_xmlExpExpDerive(void) {
33296 /* missing type support */
33302 test_xmlExpGetLanguage(void) {
33305 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33308 xmlExpCtxtPtr ctxt; /* the expression context */
33310 xmlExpNodePtr exp; /* the expression */
33312 xmlChar ** langList; /* where to store the tokens */
33314 int len; /* the allocated length of @list */
33317 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33318 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33319 for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33320 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33321 mem_base = xmlMemBlocks();
33322 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33323 exp = gen_xmlExpNodePtr(n_exp, 1);
33324 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33325 len = gen_int(n_len, 3);
33327 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33328 desret_int(ret_val);
33330 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33331 des_xmlExpNodePtr(n_exp, exp, 1);
33332 des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33333 des_int(n_len, len, 3);
33334 xmlResetLastError();
33335 if (mem_base != xmlMemBlocks()) {
33336 printf("Leak of %d blocks found in xmlExpGetLanguage",
33337 xmlMemBlocks() - mem_base);
33339 printf(" %d", n_ctxt);
33340 printf(" %d", n_exp);
33341 printf(" %d", n_langList);
33342 printf(" %d", n_len);
33357 test_xmlExpGetStart(void) {
33360 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33363 xmlExpCtxtPtr ctxt; /* the expression context */
33365 xmlExpNodePtr exp; /* the expression */
33367 xmlChar ** tokList; /* where to store the tokens */
33369 int len; /* the allocated length of @list */
33372 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33373 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33374 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33375 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33376 mem_base = xmlMemBlocks();
33377 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33378 exp = gen_xmlExpNodePtr(n_exp, 1);
33379 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33380 len = gen_int(n_len, 3);
33382 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33383 desret_int(ret_val);
33385 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33386 des_xmlExpNodePtr(n_exp, exp, 1);
33387 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33388 des_int(n_len, len, 3);
33389 xmlResetLastError();
33390 if (mem_base != xmlMemBlocks()) {
33391 printf("Leak of %d blocks found in xmlExpGetStart",
33392 xmlMemBlocks() - mem_base);
33394 printf(" %d", n_ctxt);
33395 printf(" %d", n_exp);
33396 printf(" %d", n_tokList);
33397 printf(" %d", n_len);
33412 test_xmlExpIsNillable(void) {
33415 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33418 xmlExpNodePtr exp; /* the expression */
33421 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33422 mem_base = xmlMemBlocks();
33423 exp = gen_xmlExpNodePtr(n_exp, 0);
33425 ret_val = xmlExpIsNillable(exp);
33426 desret_int(ret_val);
33428 des_xmlExpNodePtr(n_exp, exp, 0);
33429 xmlResetLastError();
33430 if (mem_base != xmlMemBlocks()) {
33431 printf("Leak of %d blocks found in xmlExpIsNillable",
33432 xmlMemBlocks() - mem_base);
33434 printf(" %d", n_exp);
33446 test_xmlExpMaxToken(void) {
33449 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33452 xmlExpNodePtr expr; /* a compiled expression */
33455 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33456 mem_base = xmlMemBlocks();
33457 expr = gen_xmlExpNodePtr(n_expr, 0);
33459 ret_val = xmlExpMaxToken(expr);
33460 desret_int(ret_val);
33462 des_xmlExpNodePtr(n_expr, expr, 0);
33463 xmlResetLastError();
33464 if (mem_base != xmlMemBlocks()) {
33465 printf("Leak of %d blocks found in xmlExpMaxToken",
33466 xmlMemBlocks() - mem_base);
33468 printf(" %d", n_expr);
33480 test_xmlExpNewAtom(void) {
33484 /* missing type support */
33490 test_xmlExpNewCtxt(void) {
33494 /* missing type support */
33500 test_xmlExpNewOr(void) {
33504 /* missing type support */
33510 test_xmlExpNewRange(void) {
33514 /* missing type support */
33520 test_xmlExpNewSeq(void) {
33524 /* missing type support */
33530 test_xmlExpParse(void) {
33534 /* missing type support */
33540 test_xmlExpRef(void) {
33543 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33545 xmlExpNodePtr exp; /* the expression */
33548 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33549 mem_base = xmlMemBlocks();
33550 exp = gen_xmlExpNodePtr(n_exp, 0);
33554 des_xmlExpNodePtr(n_exp, exp, 0);
33555 xmlResetLastError();
33556 if (mem_base != xmlMemBlocks()) {
33557 printf("Leak of %d blocks found in xmlExpRef",
33558 xmlMemBlocks() - mem_base);
33560 printf(" %d", n_exp);
33572 test_xmlExpStringDerive(void) {
33576 /* missing type support */
33582 test_xmlExpSubsume(void) {
33585 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33588 xmlExpCtxtPtr ctxt; /* the expressions context */
33590 xmlExpNodePtr exp; /* the englobing expression */
33592 xmlExpNodePtr sub; /* the subexpression */
33595 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33596 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33597 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33598 mem_base = xmlMemBlocks();
33599 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33600 exp = gen_xmlExpNodePtr(n_exp, 1);
33601 sub = gen_xmlExpNodePtr(n_sub, 2);
33603 ret_val = xmlExpSubsume(ctxt, exp, sub);
33604 desret_int(ret_val);
33606 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33607 des_xmlExpNodePtr(n_exp, exp, 1);
33608 des_xmlExpNodePtr(n_sub, sub, 2);
33609 xmlResetLastError();
33610 if (mem_base != xmlMemBlocks()) {
33611 printf("Leak of %d blocks found in xmlExpSubsume",
33612 xmlMemBlocks() - mem_base);
33614 printf(" %d", n_ctxt);
33615 printf(" %d", n_exp);
33616 printf(" %d", n_sub);
33628 #ifdef LIBXML_REGEXP_ENABLED
33630 #define gen_nb_xmlRegExecCtxtPtr 1
33631 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33634 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33640 test_xmlRegExecErrInfo(void) {
33643 #if defined(LIBXML_REGEXP_ENABLED)
33646 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33648 xmlChar ** string; /* return value for the error string */
33650 int * nbval; /* pointer to the number of accepted values IN/OUT */
33652 int * nbneg; /* return number of negative transitions */
33654 xmlChar ** values; /* pointer to the array of acceptable values */
33656 int * terminal; /* return value if this was a terminal state */
33659 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33660 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33661 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33662 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33663 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33664 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33665 mem_base = xmlMemBlocks();
33666 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33667 string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33668 nbval = gen_int_ptr(n_nbval, 2);
33669 nbneg = gen_int_ptr(n_nbneg, 3);
33670 values = gen_xmlChar_ptr_ptr(n_values, 4);
33671 terminal = gen_int_ptr(n_terminal, 5);
33673 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33674 desret_int(ret_val);
33676 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33677 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33678 des_int_ptr(n_nbval, nbval, 2);
33679 des_int_ptr(n_nbneg, nbneg, 3);
33680 des_xmlChar_ptr_ptr(n_values, values, 4);
33681 des_int_ptr(n_terminal, terminal, 5);
33682 xmlResetLastError();
33683 if (mem_base != xmlMemBlocks()) {
33684 printf("Leak of %d blocks found in xmlRegExecErrInfo",
33685 xmlMemBlocks() - mem_base);
33687 printf(" %d", n_exec);
33688 printf(" %d", n_string);
33689 printf(" %d", n_nbval);
33690 printf(" %d", n_nbneg);
33691 printf(" %d", n_values);
33692 printf(" %d", n_terminal);
33709 test_xmlRegExecNextValues(void) {
33712 #if defined(LIBXML_REGEXP_ENABLED)
33715 xmlRegExecCtxtPtr exec; /* a regexp execution context */
33717 int * nbval; /* pointer to the number of accepted values IN/OUT */
33719 int * nbneg; /* return number of negative transitions */
33721 xmlChar ** values; /* pointer to the array of acceptable values */
33723 int * terminal; /* return value if this was a terminal state */
33726 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33727 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33728 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33729 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33730 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33731 mem_base = xmlMemBlocks();
33732 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33733 nbval = gen_int_ptr(n_nbval, 1);
33734 nbneg = gen_int_ptr(n_nbneg, 2);
33735 values = gen_xmlChar_ptr_ptr(n_values, 3);
33736 terminal = gen_int_ptr(n_terminal, 4);
33738 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33739 desret_int(ret_val);
33741 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33742 des_int_ptr(n_nbval, nbval, 1);
33743 des_int_ptr(n_nbneg, nbneg, 2);
33744 des_xmlChar_ptr_ptr(n_values, values, 3);
33745 des_int_ptr(n_terminal, terminal, 4);
33746 xmlResetLastError();
33747 if (mem_base != xmlMemBlocks()) {
33748 printf("Leak of %d blocks found in xmlRegExecNextValues",
33749 xmlMemBlocks() - mem_base);
33751 printf(" %d", n_exec);
33752 printf(" %d", n_nbval);
33753 printf(" %d", n_nbneg);
33754 printf(" %d", n_values);
33755 printf(" %d", n_terminal);
33771 test_xmlRegExecPushString(void) {
33774 #if defined(LIBXML_REGEXP_ENABLED)
33777 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33779 xmlChar * value; /* a string token input */
33781 void * data; /* data associated to the token to reuse in callbacks */
33784 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33785 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33786 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33787 mem_base = xmlMemBlocks();
33788 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33789 value = gen_const_xmlChar_ptr(n_value, 1);
33790 data = gen_userdata(n_data, 2);
33792 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33793 desret_int(ret_val);
33795 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33796 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33797 des_userdata(n_data, data, 2);
33798 xmlResetLastError();
33799 if (mem_base != xmlMemBlocks()) {
33800 printf("Leak of %d blocks found in xmlRegExecPushString",
33801 xmlMemBlocks() - mem_base);
33803 printf(" %d", n_exec);
33804 printf(" %d", n_value);
33805 printf(" %d", n_data);
33819 test_xmlRegExecPushString2(void) {
33822 #if defined(LIBXML_REGEXP_ENABLED)
33825 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33827 xmlChar * value; /* the first string token input */
33829 xmlChar * value2; /* the second string token input */
33831 void * data; /* data associated to the token to reuse in callbacks */
33834 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33835 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33836 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33837 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33838 mem_base = xmlMemBlocks();
33839 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33840 value = gen_const_xmlChar_ptr(n_value, 1);
33841 value2 = gen_const_xmlChar_ptr(n_value2, 2);
33842 data = gen_userdata(n_data, 3);
33844 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33845 desret_int(ret_val);
33847 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33848 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33849 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33850 des_userdata(n_data, data, 3);
33851 xmlResetLastError();
33852 if (mem_base != xmlMemBlocks()) {
33853 printf("Leak of %d blocks found in xmlRegExecPushString2",
33854 xmlMemBlocks() - mem_base);
33856 printf(" %d", n_exec);
33857 printf(" %d", n_value);
33858 printf(" %d", n_value2);
33859 printf(" %d", n_data);
33872 #ifdef LIBXML_REGEXP_ENABLED
33874 #define gen_nb_xmlRegexpPtr 1
33875 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33878 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33884 test_xmlRegNewExecCtxt(void) {
33888 /* missing type support */
33894 test_xmlRegexpCompile(void) {
33898 /* missing type support */
33904 test_xmlRegexpExec(void) {
33907 #if defined(LIBXML_REGEXP_ENABLED)
33910 xmlRegexpPtr comp; /* the compiled regular expression */
33912 xmlChar * content; /* the value to check against the regular expression */
33915 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33916 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33917 mem_base = xmlMemBlocks();
33918 comp = gen_xmlRegexpPtr(n_comp, 0);
33919 content = gen_const_xmlChar_ptr(n_content, 1);
33921 ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33922 desret_int(ret_val);
33924 des_xmlRegexpPtr(n_comp, comp, 0);
33925 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33926 xmlResetLastError();
33927 if (mem_base != xmlMemBlocks()) {
33928 printf("Leak of %d blocks found in xmlRegexpExec",
33929 xmlMemBlocks() - mem_base);
33931 printf(" %d", n_comp);
33932 printf(" %d", n_content);
33945 test_xmlRegexpIsDeterminist(void) {
33948 #if defined(LIBXML_REGEXP_ENABLED)
33951 xmlRegexpPtr comp; /* the compiled regular expression */
33954 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33955 mem_base = xmlMemBlocks();
33956 comp = gen_xmlRegexpPtr(n_comp, 0);
33958 ret_val = xmlRegexpIsDeterminist(comp);
33959 desret_int(ret_val);
33961 des_xmlRegexpPtr(n_comp, comp, 0);
33962 xmlResetLastError();
33963 if (mem_base != xmlMemBlocks()) {
33964 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33965 xmlMemBlocks() - mem_base);
33967 printf(" %d", n_comp);
33979 test_xmlRegexpPrint(void) {
33982 #if defined(LIBXML_REGEXP_ENABLED)
33984 FILE * output; /* the file for the output debug */
33986 xmlRegexpPtr regexp; /* the compiled regexp */
33989 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33990 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33991 mem_base = xmlMemBlocks();
33992 output = gen_FILE_ptr(n_output, 0);
33993 regexp = gen_xmlRegexpPtr(n_regexp, 1);
33995 xmlRegexpPrint(output, regexp);
33997 des_FILE_ptr(n_output, output, 0);
33998 des_xmlRegexpPtr(n_regexp, regexp, 1);
33999 xmlResetLastError();
34000 if (mem_base != xmlMemBlocks()) {
34001 printf("Leak of %d blocks found in xmlRegexpPrint",
34002 xmlMemBlocks() - mem_base);
34004 printf(" %d", n_output);
34005 printf(" %d", n_regexp);
34017 test_xmlregexp(void) {
34020 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
34021 test_ret += test_xmlExpCtxtNbCons();
34022 test_ret += test_xmlExpCtxtNbNodes();
34023 test_ret += test_xmlExpDump();
34024 test_ret += test_xmlExpExpDerive();
34025 test_ret += test_xmlExpGetLanguage();
34026 test_ret += test_xmlExpGetStart();
34027 test_ret += test_xmlExpIsNillable();
34028 test_ret += test_xmlExpMaxToken();
34029 test_ret += test_xmlExpNewAtom();
34030 test_ret += test_xmlExpNewCtxt();
34031 test_ret += test_xmlExpNewOr();
34032 test_ret += test_xmlExpNewRange();
34033 test_ret += test_xmlExpNewSeq();
34034 test_ret += test_xmlExpParse();
34035 test_ret += test_xmlExpRef();
34036 test_ret += test_xmlExpStringDerive();
34037 test_ret += test_xmlExpSubsume();
34038 test_ret += test_xmlRegExecErrInfo();
34039 test_ret += test_xmlRegExecNextValues();
34040 test_ret += test_xmlRegExecPushString();
34041 test_ret += test_xmlRegExecPushString2();
34042 test_ret += test_xmlRegNewExecCtxt();
34043 test_ret += test_xmlRegexpCompile();
34044 test_ret += test_xmlRegexpExec();
34045 test_ret += test_xmlRegexpIsDeterminist();
34046 test_ret += test_xmlRegexpPrint();
34049 printf("Module xmlregexp: %d errors\n", test_ret);
34052 #ifdef LIBXML_OUTPUT_ENABLED
34054 #define gen_nb_xmlSaveCtxtPtr 1
34055 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34058 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34064 test_xmlSaveClose(void) {
34067 #if defined(LIBXML_OUTPUT_ENABLED)
34070 xmlSaveCtxtPtr ctxt; /* a document saving context */
34073 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34074 mem_base = xmlMemBlocks();
34075 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34077 ret_val = xmlSaveClose(ctxt);
34078 desret_int(ret_val);
34080 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34081 xmlResetLastError();
34082 if (mem_base != xmlMemBlocks()) {
34083 printf("Leak of %d blocks found in xmlSaveClose",
34084 xmlMemBlocks() - mem_base);
34086 printf(" %d", n_ctxt);
34098 test_xmlSaveDoc(void) {
34101 #if defined(LIBXML_OUTPUT_ENABLED)
34104 xmlSaveCtxtPtr ctxt; /* a document saving context */
34106 xmlDocPtr doc; /* a document */
34109 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34110 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34111 mem_base = xmlMemBlocks();
34112 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34113 doc = gen_xmlDocPtr(n_doc, 1);
34115 ret_val = xmlSaveDoc(ctxt, doc);
34116 desret_long(ret_val);
34118 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34119 des_xmlDocPtr(n_doc, doc, 1);
34120 xmlResetLastError();
34121 if (mem_base != xmlMemBlocks()) {
34122 printf("Leak of %d blocks found in xmlSaveDoc",
34123 xmlMemBlocks() - mem_base);
34125 printf(" %d", n_ctxt);
34126 printf(" %d", n_doc);
34139 test_xmlSaveFlush(void) {
34142 #if defined(LIBXML_OUTPUT_ENABLED)
34145 xmlSaveCtxtPtr ctxt; /* a document saving context */
34148 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34149 mem_base = xmlMemBlocks();
34150 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34152 ret_val = xmlSaveFlush(ctxt);
34153 desret_int(ret_val);
34155 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34156 xmlResetLastError();
34157 if (mem_base != xmlMemBlocks()) {
34158 printf("Leak of %d blocks found in xmlSaveFlush",
34159 xmlMemBlocks() - mem_base);
34161 printf(" %d", n_ctxt);
34173 test_xmlSaveSetAttrEscape(void) {
34177 /* missing type support */
34183 test_xmlSaveSetEscape(void) {
34187 /* missing type support */
34193 test_xmlSaveToBuffer(void) {
34197 /* missing type support */
34203 test_xmlSaveToFd(void) {
34207 /* missing type support */
34213 test_xmlSaveToFilename(void) {
34217 /* missing type support */
34223 test_xmlSaveTree(void) {
34226 #if defined(LIBXML_OUTPUT_ENABLED)
34229 xmlSaveCtxtPtr ctxt; /* a document saving context */
34231 xmlNodePtr node; /* the top node of the subtree to save */
34234 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34235 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34236 mem_base = xmlMemBlocks();
34237 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34238 node = gen_xmlNodePtr(n_node, 1);
34240 ret_val = xmlSaveTree(ctxt, node);
34241 desret_long(ret_val);
34243 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34244 des_xmlNodePtr(n_node, node, 1);
34245 xmlResetLastError();
34246 if (mem_base != xmlMemBlocks()) {
34247 printf("Leak of %d blocks found in xmlSaveTree",
34248 xmlMemBlocks() - mem_base);
34250 printf(" %d", n_ctxt);
34251 printf(" %d", n_node);
34263 test_xmlsave(void) {
34266 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34267 test_ret += test_xmlSaveClose();
34268 test_ret += test_xmlSaveDoc();
34269 test_ret += test_xmlSaveFlush();
34270 test_ret += test_xmlSaveSetAttrEscape();
34271 test_ret += test_xmlSaveSetEscape();
34272 test_ret += test_xmlSaveToBuffer();
34273 test_ret += test_xmlSaveToFd();
34274 test_ret += test_xmlSaveToFilename();
34275 test_ret += test_xmlSaveTree();
34278 printf("Module xmlsave: %d errors\n", test_ret);
34283 test_xmlSchemaDump(void) {
34286 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34288 FILE * output; /* the file output */
34290 xmlSchemaPtr schema; /* a schema structure */
34293 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34294 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34295 mem_base = xmlMemBlocks();
34296 output = gen_FILE_ptr(n_output, 0);
34297 schema = gen_xmlSchemaPtr(n_schema, 1);
34299 xmlSchemaDump(output, schema);
34301 des_FILE_ptr(n_output, output, 0);
34302 des_xmlSchemaPtr(n_schema, schema, 1);
34303 xmlResetLastError();
34304 if (mem_base != xmlMemBlocks()) {
34305 printf("Leak of %d blocks found in xmlSchemaDump",
34306 xmlMemBlocks() - mem_base);
34308 printf(" %d", n_output);
34309 printf(" %d", n_schema);
34320 #ifdef LIBXML_SCHEMAS_ENABLED
34322 #define gen_nb_xmlSchemaParserCtxtPtr 1
34323 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34326 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34330 #ifdef LIBXML_SCHEMAS_ENABLED
34332 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
34333 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34336 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34340 #ifdef LIBXML_SCHEMAS_ENABLED
34342 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
34343 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34346 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34352 test_xmlSchemaGetParserErrors(void) {
34355 #if defined(LIBXML_SCHEMAS_ENABLED)
34358 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34360 xmlSchemaValidityErrorFunc * err; /* the error callback result */
34362 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34364 void ** ctx; /* contextual data for the callbacks result */
34367 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34368 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34369 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34370 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34371 mem_base = xmlMemBlocks();
34372 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34373 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34374 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34375 ctx = gen_void_ptr_ptr(n_ctx, 3);
34377 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34378 desret_int(ret_val);
34380 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34381 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34382 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34383 des_void_ptr_ptr(n_ctx, ctx, 3);
34384 xmlResetLastError();
34385 if (mem_base != xmlMemBlocks()) {
34386 printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34387 xmlMemBlocks() - mem_base);
34389 printf(" %d", n_ctxt);
34390 printf(" %d", n_err);
34391 printf(" %d", n_warn);
34392 printf(" %d", n_ctx);
34407 test_xmlSchemaGetValidErrors(void) {
34410 #if defined(LIBXML_SCHEMAS_ENABLED)
34413 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34415 xmlSchemaValidityErrorFunc * err; /* the error function result */
34417 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34419 void ** ctx; /* the functions context result */
34422 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34423 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34424 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34425 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34426 mem_base = xmlMemBlocks();
34427 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34428 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34429 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34430 ctx = gen_void_ptr_ptr(n_ctx, 3);
34432 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34433 desret_int(ret_val);
34435 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34436 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34437 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34438 des_void_ptr_ptr(n_ctx, ctx, 3);
34439 xmlResetLastError();
34440 if (mem_base != xmlMemBlocks()) {
34441 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34442 xmlMemBlocks() - mem_base);
34444 printf(" %d", n_ctxt);
34445 printf(" %d", n_err);
34446 printf(" %d", n_warn);
34447 printf(" %d", n_ctx);
34462 test_xmlSchemaIsValid(void) {
34465 #if defined(LIBXML_SCHEMAS_ENABLED)
34468 xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34471 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34472 mem_base = xmlMemBlocks();
34473 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34475 ret_val = xmlSchemaIsValid(ctxt);
34476 desret_int(ret_val);
34478 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34479 xmlResetLastError();
34480 if (mem_base != xmlMemBlocks()) {
34481 printf("Leak of %d blocks found in xmlSchemaIsValid",
34482 xmlMemBlocks() - mem_base);
34484 printf(" %d", n_ctxt);
34496 test_xmlSchemaNewDocParserCtxt(void) {
34499 #if defined(LIBXML_SCHEMAS_ENABLED)
34501 xmlSchemaParserCtxtPtr ret_val;
34502 xmlDocPtr doc; /* a preparsed document tree */
34505 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34506 mem_base = xmlMemBlocks();
34507 doc = gen_xmlDocPtr(n_doc, 0);
34509 ret_val = xmlSchemaNewDocParserCtxt(doc);
34510 desret_xmlSchemaParserCtxtPtr(ret_val);
34512 des_xmlDocPtr(n_doc, doc, 0);
34513 xmlResetLastError();
34514 if (mem_base != xmlMemBlocks()) {
34515 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34516 xmlMemBlocks() - mem_base);
34518 printf(" %d", n_doc);
34530 test_xmlSchemaNewMemParserCtxt(void) {
34533 #if defined(LIBXML_SCHEMAS_ENABLED)
34535 xmlSchemaParserCtxtPtr ret_val;
34536 char * buffer; /* a pointer to a char array containing the schemas */
34538 int size; /* the size of the array */
34541 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34542 for (n_size = 0;n_size < gen_nb_int;n_size++) {
34543 mem_base = xmlMemBlocks();
34544 buffer = gen_const_char_ptr(n_buffer, 0);
34545 size = gen_int(n_size, 1);
34546 if ((buffer != NULL) &&
34547 (size > (int) strlen((const char *) buffer) + 1))
34550 ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34551 desret_xmlSchemaParserCtxtPtr(ret_val);
34553 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34554 des_int(n_size, size, 1);
34555 xmlResetLastError();
34556 if (mem_base != xmlMemBlocks()) {
34557 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34558 xmlMemBlocks() - mem_base);
34560 printf(" %d", n_buffer);
34561 printf(" %d", n_size);
34574 test_xmlSchemaNewParserCtxt(void) {
34577 #if defined(LIBXML_SCHEMAS_ENABLED)
34579 xmlSchemaParserCtxtPtr ret_val;
34580 char * URL; /* the location of the schema */
34583 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34584 mem_base = xmlMemBlocks();
34585 URL = gen_const_char_ptr(n_URL, 0);
34587 ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34588 desret_xmlSchemaParserCtxtPtr(ret_val);
34590 des_const_char_ptr(n_URL, (const char *)URL, 0);
34591 xmlResetLastError();
34592 if (mem_base != xmlMemBlocks()) {
34593 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34594 xmlMemBlocks() - mem_base);
34596 printf(" %d", n_URL);
34608 test_xmlSchemaNewValidCtxt(void) {
34612 /* missing type support */
34618 test_xmlSchemaParse(void) {
34622 /* missing type support */
34626 #ifdef LIBXML_SCHEMAS_ENABLED
34628 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34629 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34632 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34638 test_xmlSchemaSAXPlug(void) {
34642 /* missing type support */
34646 #ifdef LIBXML_SCHEMAS_ENABLED
34648 #define gen_nb_xmlSchemaSAXPlugPtr 1
34649 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34652 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34658 test_xmlSchemaSAXUnplug(void) {
34661 #if defined(LIBXML_SCHEMAS_ENABLED)
34664 xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34667 for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34668 mem_base = xmlMemBlocks();
34669 plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34671 ret_val = xmlSchemaSAXUnplug(plug);
34672 desret_int(ret_val);
34674 des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34675 xmlResetLastError();
34676 if (mem_base != xmlMemBlocks()) {
34677 printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34678 xmlMemBlocks() - mem_base);
34680 printf(" %d", n_plug);
34692 test_xmlSchemaSetParserErrors(void) {
34696 /* missing type support */
34702 test_xmlSchemaSetParserStructuredErrors(void) {
34706 /* missing type support */
34712 test_xmlSchemaSetValidErrors(void) {
34716 /* missing type support */
34722 test_xmlSchemaSetValidOptions(void) {
34725 #if defined(LIBXML_SCHEMAS_ENABLED)
34728 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34730 int options; /* a combination of xmlSchemaValidOption */
34733 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34734 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34735 mem_base = xmlMemBlocks();
34736 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34737 options = gen_int(n_options, 1);
34739 ret_val = xmlSchemaSetValidOptions(ctxt, options);
34740 desret_int(ret_val);
34742 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34743 des_int(n_options, options, 1);
34744 xmlResetLastError();
34745 if (mem_base != xmlMemBlocks()) {
34746 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34747 xmlMemBlocks() - mem_base);
34749 printf(" %d", n_ctxt);
34750 printf(" %d", n_options);
34763 test_xmlSchemaSetValidStructuredErrors(void) {
34767 /* missing type support */
34773 test_xmlSchemaValidCtxtGetOptions(void) {
34776 #if defined(LIBXML_SCHEMAS_ENABLED)
34779 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34782 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34783 mem_base = xmlMemBlocks();
34784 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34786 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34787 desret_int(ret_val);
34789 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34790 xmlResetLastError();
34791 if (mem_base != xmlMemBlocks()) {
34792 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34793 xmlMemBlocks() - mem_base);
34795 printf(" %d", n_ctxt);
34807 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34810 #if defined(LIBXML_SCHEMAS_ENABLED)
34812 xmlParserCtxtPtr ret_val;
34813 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34816 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34817 mem_base = xmlMemBlocks();
34818 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34820 ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34821 desret_xmlParserCtxtPtr(ret_val);
34823 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34824 xmlResetLastError();
34825 if (mem_base != xmlMemBlocks()) {
34826 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34827 xmlMemBlocks() - mem_base);
34829 printf(" %d", n_ctxt);
34841 test_xmlSchemaValidateDoc(void) {
34844 #if defined(LIBXML_SCHEMAS_ENABLED)
34847 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34849 xmlDocPtr doc; /* a parsed document tree */
34852 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34853 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34854 mem_base = xmlMemBlocks();
34855 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34856 doc = gen_xmlDocPtr(n_doc, 1);
34858 ret_val = xmlSchemaValidateDoc(ctxt, doc);
34859 desret_int(ret_val);
34861 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34862 des_xmlDocPtr(n_doc, doc, 1);
34863 xmlResetLastError();
34864 if (mem_base != xmlMemBlocks()) {
34865 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34866 xmlMemBlocks() - mem_base);
34868 printf(" %d", n_ctxt);
34869 printf(" %d", n_doc);
34882 test_xmlSchemaValidateFile(void) {
34885 #if defined(LIBXML_SCHEMAS_ENABLED)
34888 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34890 const char * filename; /* the URI of the instance */
34892 int options; /* a future set of options, currently unused */
34895 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34896 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34897 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34898 mem_base = xmlMemBlocks();
34899 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34900 filename = gen_filepath(n_filename, 1);
34901 options = gen_int(n_options, 2);
34903 ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34904 desret_int(ret_val);
34906 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34907 des_filepath(n_filename, filename, 1);
34908 des_int(n_options, options, 2);
34909 xmlResetLastError();
34910 if (mem_base != xmlMemBlocks()) {
34911 printf("Leak of %d blocks found in xmlSchemaValidateFile",
34912 xmlMemBlocks() - mem_base);
34914 printf(" %d", n_ctxt);
34915 printf(" %d", n_filename);
34916 printf(" %d", n_options);
34930 test_xmlSchemaValidateOneElement(void) {
34933 #if defined(LIBXML_SCHEMAS_ENABLED)
34936 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34938 xmlNodePtr elem; /* an element node */
34941 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34942 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34943 mem_base = xmlMemBlocks();
34944 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34945 elem = gen_xmlNodePtr(n_elem, 1);
34947 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34948 desret_int(ret_val);
34950 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34951 des_xmlNodePtr(n_elem, elem, 1);
34952 xmlResetLastError();
34953 if (mem_base != xmlMemBlocks()) {
34954 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34955 xmlMemBlocks() - mem_base);
34957 printf(" %d", n_ctxt);
34958 printf(" %d", n_elem);
34971 test_xmlSchemaValidateSetFilename(void) {
34974 #if defined(LIBXML_SCHEMAS_ENABLED)
34976 xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34978 const char * filename; /* the file name */
34981 for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34982 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34983 mem_base = xmlMemBlocks();
34984 vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34985 filename = gen_filepath(n_filename, 1);
34987 xmlSchemaValidateSetFilename(vctxt, filename);
34989 des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34990 des_filepath(n_filename, filename, 1);
34991 xmlResetLastError();
34992 if (mem_base != xmlMemBlocks()) {
34993 printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34994 xmlMemBlocks() - mem_base);
34996 printf(" %d", n_vctxt);
34997 printf(" %d", n_filename);
35010 test_xmlSchemaValidateSetLocator(void) {
35014 /* missing type support */
35020 test_xmlSchemaValidateStream(void) {
35023 #if defined(LIBXML_SCHEMAS_ENABLED)
35026 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35028 xmlParserInputBufferPtr input; /* the input to use for reading the data */
35030 xmlCharEncoding enc; /* an optional encoding information */
35032 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
35034 void * user_data; /* the context to provide to the SAX handler. */
35037 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35038 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
35039 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
35040 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
35041 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
35042 mem_base = xmlMemBlocks();
35043 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35044 input = gen_xmlParserInputBufferPtr(n_input, 1);
35045 enc = gen_xmlCharEncoding(n_enc, 2);
35046 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
35047 user_data = gen_userdata(n_user_data, 4);
35049 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
35050 desret_int(ret_val);
35052 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35053 des_xmlParserInputBufferPtr(n_input, input, 1);
35054 des_xmlCharEncoding(n_enc, enc, 2);
35055 des_xmlSAXHandlerPtr(n_sax, sax, 3);
35056 des_userdata(n_user_data, user_data, 4);
35057 xmlResetLastError();
35058 if (mem_base != xmlMemBlocks()) {
35059 printf("Leak of %d blocks found in xmlSchemaValidateStream",
35060 xmlMemBlocks() - mem_base);
35062 printf(" %d", n_ctxt);
35063 printf(" %d", n_input);
35064 printf(" %d", n_enc);
35065 printf(" %d", n_sax);
35066 printf(" %d", n_user_data);
35081 test_xmlschemas(void) {
35084 if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
35085 test_ret += test_xmlSchemaDump();
35086 test_ret += test_xmlSchemaGetParserErrors();
35087 test_ret += test_xmlSchemaGetValidErrors();
35088 test_ret += test_xmlSchemaIsValid();
35089 test_ret += test_xmlSchemaNewDocParserCtxt();
35090 test_ret += test_xmlSchemaNewMemParserCtxt();
35091 test_ret += test_xmlSchemaNewParserCtxt();
35092 test_ret += test_xmlSchemaNewValidCtxt();
35093 test_ret += test_xmlSchemaParse();
35094 test_ret += test_xmlSchemaSAXPlug();
35095 test_ret += test_xmlSchemaSAXUnplug();
35096 test_ret += test_xmlSchemaSetParserErrors();
35097 test_ret += test_xmlSchemaSetParserStructuredErrors();
35098 test_ret += test_xmlSchemaSetValidErrors();
35099 test_ret += test_xmlSchemaSetValidOptions();
35100 test_ret += test_xmlSchemaSetValidStructuredErrors();
35101 test_ret += test_xmlSchemaValidCtxtGetOptions();
35102 test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
35103 test_ret += test_xmlSchemaValidateDoc();
35104 test_ret += test_xmlSchemaValidateFile();
35105 test_ret += test_xmlSchemaValidateOneElement();
35106 test_ret += test_xmlSchemaValidateSetFilename();
35107 test_ret += test_xmlSchemaValidateSetLocator();
35108 test_ret += test_xmlSchemaValidateStream();
35111 printf("Module xmlschemas: %d errors\n", test_ret);
35114 #ifdef LIBXML_SCHEMAS_ENABLED
35116 #define gen_nb_xmlSchemaFacetPtr 1
35117 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35120 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35124 #ifdef LIBXML_SCHEMAS_ENABLED
35126 #define gen_nb_xmlSchemaTypePtr 1
35127 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35130 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35136 test_xmlSchemaCheckFacet(void) {
35139 #if defined(LIBXML_SCHEMAS_ENABLED)
35142 xmlSchemaFacetPtr facet; /* the facet */
35144 xmlSchemaTypePtr typeDecl; /* the schema type definition */
35146 xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35148 xmlChar * name; /* the optional name of the type */
35151 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35152 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35153 for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35154 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35155 mem_base = xmlMemBlocks();
35156 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35157 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35158 pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35159 name = gen_const_xmlChar_ptr(n_name, 3);
35161 ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35162 desret_int(ret_val);
35164 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35165 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35166 des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35167 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35168 xmlResetLastError();
35169 if (mem_base != xmlMemBlocks()) {
35170 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35171 xmlMemBlocks() - mem_base);
35173 printf(" %d", n_facet);
35174 printf(" %d", n_typeDecl);
35175 printf(" %d", n_pctxt);
35176 printf(" %d", n_name);
35191 test_xmlSchemaCleanupTypes(void) {
35194 #if defined(LIBXML_SCHEMAS_ENABLED)
35197 xmlSchemaCleanupTypes();
35199 xmlResetLastError();
35208 test_xmlSchemaCollapseString(void) {
35211 #if defined(LIBXML_SCHEMAS_ENABLED)
35214 xmlChar * value; /* a value */
35217 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35218 mem_base = xmlMemBlocks();
35219 value = gen_const_xmlChar_ptr(n_value, 0);
35221 ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35222 desret_xmlChar_ptr(ret_val);
35224 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35225 xmlResetLastError();
35226 if (mem_base != xmlMemBlocks()) {
35227 printf("Leak of %d blocks found in xmlSchemaCollapseString",
35228 xmlMemBlocks() - mem_base);
35230 printf(" %d", n_value);
35240 #ifdef LIBXML_SCHEMAS_ENABLED
35242 #define gen_nb_xmlSchemaValPtr 1
35243 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35246 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35252 test_xmlSchemaCompareValues(void) {
35255 #if defined(LIBXML_SCHEMAS_ENABLED)
35258 xmlSchemaValPtr x; /* a first value */
35260 xmlSchemaValPtr y; /* a second value */
35263 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35264 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35265 mem_base = xmlMemBlocks();
35266 x = gen_xmlSchemaValPtr(n_x, 0);
35267 y = gen_xmlSchemaValPtr(n_y, 1);
35269 ret_val = xmlSchemaCompareValues(x, y);
35270 desret_int(ret_val);
35272 des_xmlSchemaValPtr(n_x, x, 0);
35273 des_xmlSchemaValPtr(n_y, y, 1);
35274 xmlResetLastError();
35275 if (mem_base != xmlMemBlocks()) {
35276 printf("Leak of %d blocks found in xmlSchemaCompareValues",
35277 xmlMemBlocks() - mem_base);
35279 printf(" %d", n_x);
35280 printf(" %d", n_y);
35293 test_xmlSchemaCompareValuesWhtsp(void) {
35296 #if defined(LIBXML_SCHEMAS_ENABLED)
35299 xmlSchemaValPtr x; /* a first value */
35301 xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35303 xmlSchemaValPtr y; /* a second value */
35305 xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35308 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35309 for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35310 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35311 for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35312 mem_base = xmlMemBlocks();
35313 x = gen_xmlSchemaValPtr(n_x, 0);
35314 xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35315 y = gen_xmlSchemaValPtr(n_y, 2);
35316 yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35318 ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35319 desret_int(ret_val);
35321 des_xmlSchemaValPtr(n_x, x, 0);
35322 des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35323 des_xmlSchemaValPtr(n_y, y, 2);
35324 des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35325 xmlResetLastError();
35326 if (mem_base != xmlMemBlocks()) {
35327 printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35328 xmlMemBlocks() - mem_base);
35330 printf(" %d", n_x);
35331 printf(" %d", n_xws);
35332 printf(" %d", n_y);
35333 printf(" %d", n_yws);
35348 test_xmlSchemaCopyValue(void) {
35352 /* missing type support */
35358 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35361 #if defined(LIBXML_SCHEMAS_ENABLED)
35363 xmlSchemaTypePtr ret_val;
35364 xmlSchemaTypePtr type; /* the built-in simple type. */
35367 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35368 mem_base = xmlMemBlocks();
35369 type = gen_xmlSchemaTypePtr(n_type, 0);
35371 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35372 desret_xmlSchemaTypePtr(ret_val);
35374 des_xmlSchemaTypePtr(n_type, type, 0);
35375 xmlResetLastError();
35376 if (mem_base != xmlMemBlocks()) {
35377 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35378 xmlMemBlocks() - mem_base);
35380 printf(" %d", n_type);
35392 test_xmlSchemaGetBuiltInType(void) {
35395 #if defined(LIBXML_SCHEMAS_ENABLED)
35396 xmlSchemaTypePtr ret_val;
35397 xmlSchemaValType type; /* the type of the built in type */
35400 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35401 type = gen_xmlSchemaValType(n_type, 0);
35403 ret_val = xmlSchemaGetBuiltInType(type);
35404 desret_xmlSchemaTypePtr(ret_val);
35406 des_xmlSchemaValType(n_type, type, 0);
35407 xmlResetLastError();
35417 test_xmlSchemaGetCanonValue(void) {
35420 #if defined(LIBXML_SCHEMAS_ENABLED)
35423 xmlSchemaValPtr val; /* the precomputed value */
35425 xmlChar ** retValue; /* the returned value */
35428 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35429 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35430 mem_base = xmlMemBlocks();
35431 val = gen_xmlSchemaValPtr(n_val, 0);
35432 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35434 ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35435 desret_int(ret_val);
35437 des_xmlSchemaValPtr(n_val, val, 0);
35438 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35439 xmlResetLastError();
35440 if (mem_base != xmlMemBlocks()) {
35441 printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35442 xmlMemBlocks() - mem_base);
35444 printf(" %d", n_val);
35445 printf(" %d", n_retValue);
35458 test_xmlSchemaGetCanonValueWhtsp(void) {
35461 #if defined(LIBXML_SCHEMAS_ENABLED)
35464 xmlSchemaValPtr val; /* the precomputed value */
35466 xmlChar ** retValue; /* the returned value */
35468 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35471 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35472 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35473 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35474 mem_base = xmlMemBlocks();
35475 val = gen_xmlSchemaValPtr(n_val, 0);
35476 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35477 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35479 ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35480 desret_int(ret_val);
35482 des_xmlSchemaValPtr(n_val, val, 0);
35483 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35484 des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35485 xmlResetLastError();
35486 if (mem_base != xmlMemBlocks()) {
35487 printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35488 xmlMemBlocks() - mem_base);
35490 printf(" %d", n_val);
35491 printf(" %d", n_retValue);
35492 printf(" %d", n_ws);
35506 test_xmlSchemaGetFacetValueAsULong(void) {
35509 #if defined(LIBXML_SCHEMAS_ENABLED)
35511 unsigned long ret_val;
35512 xmlSchemaFacetPtr facet; /* an schemas type facet */
35515 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35516 mem_base = xmlMemBlocks();
35517 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35519 ret_val = xmlSchemaGetFacetValueAsULong(facet);
35520 desret_unsigned_long(ret_val);
35522 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35523 xmlResetLastError();
35524 if (mem_base != xmlMemBlocks()) {
35525 printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35526 xmlMemBlocks() - mem_base);
35528 printf(" %d", n_facet);
35540 test_xmlSchemaGetPredefinedType(void) {
35543 #if defined(LIBXML_SCHEMAS_ENABLED)
35545 xmlSchemaTypePtr ret_val;
35546 xmlChar * name; /* the type name */
35548 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35551 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35552 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35553 mem_base = xmlMemBlocks();
35554 name = gen_const_xmlChar_ptr(n_name, 0);
35555 ns = gen_const_xmlChar_ptr(n_ns, 1);
35557 ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35558 desret_xmlSchemaTypePtr(ret_val);
35560 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35561 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35562 xmlResetLastError();
35563 if (mem_base != xmlMemBlocks()) {
35564 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35565 xmlMemBlocks() - mem_base);
35567 printf(" %d", n_name);
35568 printf(" %d", n_ns);
35581 test_xmlSchemaGetValType(void) {
35584 #if defined(LIBXML_SCHEMAS_ENABLED)
35586 xmlSchemaValType ret_val;
35587 xmlSchemaValPtr val; /* a schemas value */
35590 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35591 mem_base = xmlMemBlocks();
35592 val = gen_xmlSchemaValPtr(n_val, 0);
35594 ret_val = xmlSchemaGetValType(val);
35595 desret_xmlSchemaValType(ret_val);
35597 des_xmlSchemaValPtr(n_val, val, 0);
35598 xmlResetLastError();
35599 if (mem_base != xmlMemBlocks()) {
35600 printf("Leak of %d blocks found in xmlSchemaGetValType",
35601 xmlMemBlocks() - mem_base);
35603 printf(" %d", n_val);
35615 test_xmlSchemaInitTypes(void) {
35618 #if defined(LIBXML_SCHEMAS_ENABLED)
35621 xmlSchemaInitTypes();
35623 xmlResetLastError();
35632 test_xmlSchemaIsBuiltInTypeFacet(void) {
35635 #if defined(LIBXML_SCHEMAS_ENABLED)
35638 xmlSchemaTypePtr type; /* the built-in type */
35640 int facetType; /* the facet type */
35643 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35644 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35645 mem_base = xmlMemBlocks();
35646 type = gen_xmlSchemaTypePtr(n_type, 0);
35647 facetType = gen_int(n_facetType, 1);
35649 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35650 desret_int(ret_val);
35652 des_xmlSchemaTypePtr(n_type, type, 0);
35653 des_int(n_facetType, facetType, 1);
35654 xmlResetLastError();
35655 if (mem_base != xmlMemBlocks()) {
35656 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35657 xmlMemBlocks() - mem_base);
35659 printf(" %d", n_type);
35660 printf(" %d", n_facetType);
35673 test_xmlSchemaNewFacet(void) {
35677 /* missing type support */
35683 test_xmlSchemaNewNOTATIONValue(void) {
35687 /* missing type support */
35693 test_xmlSchemaNewQNameValue(void) {
35697 /* missing type support */
35703 test_xmlSchemaNewStringValue(void) {
35707 /* missing type support */
35711 #ifdef LIBXML_SCHEMAS_ENABLED
35713 #define gen_nb_xmlSchemaValPtr_ptr 1
35714 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35717 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35723 test_xmlSchemaValPredefTypeNode(void) {
35726 #if defined(LIBXML_SCHEMAS_ENABLED)
35729 xmlSchemaTypePtr type; /* the predefined type */
35731 xmlChar * value; /* the value to check */
35733 xmlSchemaValPtr * val; /* the return computed value */
35735 xmlNodePtr node; /* the node containing the value */
35738 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35739 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35740 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35741 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35742 mem_base = xmlMemBlocks();
35743 type = gen_xmlSchemaTypePtr(n_type, 0);
35744 value = gen_const_xmlChar_ptr(n_value, 1);
35745 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35746 node = gen_xmlNodePtr(n_node, 3);
35748 ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35749 desret_int(ret_val);
35751 des_xmlSchemaTypePtr(n_type, type, 0);
35752 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35753 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35754 des_xmlNodePtr(n_node, node, 3);
35755 xmlResetLastError();
35756 if (mem_base != xmlMemBlocks()) {
35757 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35758 xmlMemBlocks() - mem_base);
35760 printf(" %d", n_type);
35761 printf(" %d", n_value);
35762 printf(" %d", n_val);
35763 printf(" %d", n_node);
35778 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35781 #if defined(LIBXML_SCHEMAS_ENABLED)
35784 xmlSchemaTypePtr type; /* the predefined type */
35786 xmlChar * value; /* the value to check */
35788 xmlSchemaValPtr * val; /* the return computed value */
35790 xmlNodePtr node; /* the node containing the value */
35793 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35794 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35795 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35796 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35797 mem_base = xmlMemBlocks();
35798 type = gen_xmlSchemaTypePtr(n_type, 0);
35799 value = gen_const_xmlChar_ptr(n_value, 1);
35800 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35801 node = gen_xmlNodePtr(n_node, 3);
35803 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35804 desret_int(ret_val);
35806 des_xmlSchemaTypePtr(n_type, type, 0);
35807 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35808 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35809 des_xmlNodePtr(n_node, node, 3);
35810 xmlResetLastError();
35811 if (mem_base != xmlMemBlocks()) {
35812 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35813 xmlMemBlocks() - mem_base);
35815 printf(" %d", n_type);
35816 printf(" %d", n_value);
35817 printf(" %d", n_val);
35818 printf(" %d", n_node);
35833 test_xmlSchemaValidateFacet(void) {
35836 #if defined(LIBXML_SCHEMAS_ENABLED)
35839 xmlSchemaTypePtr base; /* the base type */
35841 xmlSchemaFacetPtr facet; /* the facet to check */
35843 xmlChar * value; /* the lexical repr of the value to validate */
35845 xmlSchemaValPtr val; /* the precomputed value */
35848 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35849 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35850 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35851 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35852 mem_base = xmlMemBlocks();
35853 base = gen_xmlSchemaTypePtr(n_base, 0);
35854 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35855 value = gen_const_xmlChar_ptr(n_value, 2);
35856 val = gen_xmlSchemaValPtr(n_val, 3);
35858 ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35859 desret_int(ret_val);
35861 des_xmlSchemaTypePtr(n_base, base, 0);
35862 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35863 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35864 des_xmlSchemaValPtr(n_val, val, 3);
35865 xmlResetLastError();
35866 if (mem_base != xmlMemBlocks()) {
35867 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35868 xmlMemBlocks() - mem_base);
35870 printf(" %d", n_base);
35871 printf(" %d", n_facet);
35872 printf(" %d", n_value);
35873 printf(" %d", n_val);
35888 test_xmlSchemaValidateFacetWhtsp(void) {
35891 #if defined(LIBXML_SCHEMAS_ENABLED)
35894 xmlSchemaFacetPtr facet; /* the facet to check */
35896 xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35898 xmlSchemaValType valType; /* the built-in type of the value */
35900 xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35902 xmlSchemaValPtr val; /* the precomputed value */
35904 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35907 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35908 for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35909 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35910 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35911 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35912 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35913 mem_base = xmlMemBlocks();
35914 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35915 fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35916 valType = gen_xmlSchemaValType(n_valType, 2);
35917 value = gen_const_xmlChar_ptr(n_value, 3);
35918 val = gen_xmlSchemaValPtr(n_val, 4);
35919 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35921 ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35922 desret_int(ret_val);
35924 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35925 des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35926 des_xmlSchemaValType(n_valType, valType, 2);
35927 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35928 des_xmlSchemaValPtr(n_val, val, 4);
35929 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35930 xmlResetLastError();
35931 if (mem_base != xmlMemBlocks()) {
35932 printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35933 xmlMemBlocks() - mem_base);
35935 printf(" %d", n_facet);
35936 printf(" %d", n_fws);
35937 printf(" %d", n_valType);
35938 printf(" %d", n_value);
35939 printf(" %d", n_val);
35940 printf(" %d", n_ws);
35957 test_xmlSchemaValidateLengthFacet(void) {
35960 #if defined(LIBXML_SCHEMAS_ENABLED)
35963 xmlSchemaTypePtr type; /* the built-in type */
35965 xmlSchemaFacetPtr facet; /* the facet to check */
35967 xmlChar * value; /* the lexical repr. of the value to be validated */
35969 xmlSchemaValPtr val; /* the precomputed value */
35971 unsigned long * length; /* the actual length of the value */
35974 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35975 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35976 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35977 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35978 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35979 mem_base = xmlMemBlocks();
35980 type = gen_xmlSchemaTypePtr(n_type, 0);
35981 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35982 value = gen_const_xmlChar_ptr(n_value, 2);
35983 val = gen_xmlSchemaValPtr(n_val, 3);
35984 length = gen_unsigned_long_ptr(n_length, 4);
35986 ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35987 desret_int(ret_val);
35989 des_xmlSchemaTypePtr(n_type, type, 0);
35990 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35991 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35992 des_xmlSchemaValPtr(n_val, val, 3);
35993 des_unsigned_long_ptr(n_length, length, 4);
35994 xmlResetLastError();
35995 if (mem_base != xmlMemBlocks()) {
35996 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35997 xmlMemBlocks() - mem_base);
35999 printf(" %d", n_type);
36000 printf(" %d", n_facet);
36001 printf(" %d", n_value);
36002 printf(" %d", n_val);
36003 printf(" %d", n_length);
36019 test_xmlSchemaValidateLengthFacetWhtsp(void) {
36022 #if defined(LIBXML_SCHEMAS_ENABLED)
36025 xmlSchemaFacetPtr facet; /* the facet to check */
36027 xmlSchemaValType valType; /* the built-in type */
36029 xmlChar * value; /* the lexical repr. of the value to be validated */
36031 xmlSchemaValPtr val; /* the precomputed value */
36033 unsigned long * length; /* the actual length of the value */
36035 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36038 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36039 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36040 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36041 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36042 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36043 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36044 mem_base = xmlMemBlocks();
36045 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36046 valType = gen_xmlSchemaValType(n_valType, 1);
36047 value = gen_const_xmlChar_ptr(n_value, 2);
36048 val = gen_xmlSchemaValPtr(n_val, 3);
36049 length = gen_unsigned_long_ptr(n_length, 4);
36050 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36052 ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
36053 desret_int(ret_val);
36055 des_xmlSchemaFacetPtr(n_facet, facet, 0);
36056 des_xmlSchemaValType(n_valType, valType, 1);
36057 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36058 des_xmlSchemaValPtr(n_val, val, 3);
36059 des_unsigned_long_ptr(n_length, length, 4);
36060 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36061 xmlResetLastError();
36062 if (mem_base != xmlMemBlocks()) {
36063 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
36064 xmlMemBlocks() - mem_base);
36066 printf(" %d", n_facet);
36067 printf(" %d", n_valType);
36068 printf(" %d", n_value);
36069 printf(" %d", n_val);
36070 printf(" %d", n_length);
36071 printf(" %d", n_ws);
36088 test_xmlSchemaValidateListSimpleTypeFacet(void) {
36091 #if defined(LIBXML_SCHEMAS_ENABLED)
36094 xmlSchemaFacetPtr facet; /* the facet to check */
36096 xmlChar * value; /* the lexical repr of the value to validate */
36098 unsigned long actualLen; /* the number of list items */
36100 unsigned long * expectedLen; /* the resulting expected number of list items */
36103 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36104 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36105 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
36106 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
36107 mem_base = xmlMemBlocks();
36108 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36109 value = gen_const_xmlChar_ptr(n_value, 1);
36110 actualLen = gen_unsigned_long(n_actualLen, 2);
36111 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
36113 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
36114 desret_int(ret_val);
36116 des_xmlSchemaFacetPtr(n_facet, facet, 0);
36117 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36118 des_unsigned_long(n_actualLen, actualLen, 2);
36119 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
36120 xmlResetLastError();
36121 if (mem_base != xmlMemBlocks()) {
36122 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
36123 xmlMemBlocks() - mem_base);
36125 printf(" %d", n_facet);
36126 printf(" %d", n_value);
36127 printf(" %d", n_actualLen);
36128 printf(" %d", n_expectedLen);
36143 test_xmlSchemaValidatePredefinedType(void) {
36146 #if defined(LIBXML_SCHEMAS_ENABLED)
36149 xmlSchemaTypePtr type; /* the predefined type */
36151 xmlChar * value; /* the value to check */
36153 xmlSchemaValPtr * val; /* the return computed value */
36156 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36157 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36158 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36159 mem_base = xmlMemBlocks();
36160 type = gen_xmlSchemaTypePtr(n_type, 0);
36161 value = gen_const_xmlChar_ptr(n_value, 1);
36162 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36164 ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36165 desret_int(ret_val);
36167 des_xmlSchemaTypePtr(n_type, type, 0);
36168 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36169 des_xmlSchemaValPtr_ptr(n_val, val, 2);
36170 xmlResetLastError();
36171 if (mem_base != xmlMemBlocks()) {
36172 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36173 xmlMemBlocks() - mem_base);
36175 printf(" %d", n_type);
36176 printf(" %d", n_value);
36177 printf(" %d", n_val);
36191 test_xmlSchemaValueAppend(void) {
36194 #if defined(LIBXML_SCHEMAS_ENABLED)
36197 xmlSchemaValPtr prev; /* the value */
36199 xmlSchemaValPtr cur; /* the value to be appended */
36202 for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36203 for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36204 mem_base = xmlMemBlocks();
36205 prev = gen_xmlSchemaValPtr(n_prev, 0);
36206 cur = gen_xmlSchemaValPtr(n_cur, 1);
36208 ret_val = xmlSchemaValueAppend(prev, cur);
36209 desret_int(ret_val);
36211 des_xmlSchemaValPtr(n_prev, prev, 0);
36212 des_xmlSchemaValPtr(n_cur, cur, 1);
36213 xmlResetLastError();
36214 if (mem_base != xmlMemBlocks()) {
36215 printf("Leak of %d blocks found in xmlSchemaValueAppend",
36216 xmlMemBlocks() - mem_base);
36218 printf(" %d", n_prev);
36219 printf(" %d", n_cur);
36232 test_xmlSchemaValueGetAsBoolean(void) {
36235 #if defined(LIBXML_SCHEMAS_ENABLED)
36238 xmlSchemaValPtr val; /* the value */
36241 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36242 mem_base = xmlMemBlocks();
36243 val = gen_xmlSchemaValPtr(n_val, 0);
36245 ret_val = xmlSchemaValueGetAsBoolean(val);
36246 desret_int(ret_val);
36248 des_xmlSchemaValPtr(n_val, val, 0);
36249 xmlResetLastError();
36250 if (mem_base != xmlMemBlocks()) {
36251 printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36252 xmlMemBlocks() - mem_base);
36254 printf(" %d", n_val);
36266 test_xmlSchemaValueGetAsString(void) {
36269 #if defined(LIBXML_SCHEMAS_ENABLED)
36271 const xmlChar * ret_val;
36272 xmlSchemaValPtr val; /* the value */
36275 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36276 mem_base = xmlMemBlocks();
36277 val = gen_xmlSchemaValPtr(n_val, 0);
36279 ret_val = xmlSchemaValueGetAsString(val);
36280 desret_const_xmlChar_ptr(ret_val);
36282 des_xmlSchemaValPtr(n_val, val, 0);
36283 xmlResetLastError();
36284 if (mem_base != xmlMemBlocks()) {
36285 printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36286 xmlMemBlocks() - mem_base);
36288 printf(" %d", n_val);
36300 test_xmlSchemaValueGetNext(void) {
36304 /* missing type support */
36310 test_xmlSchemaWhiteSpaceReplace(void) {
36313 #if defined(LIBXML_SCHEMAS_ENABLED)
36316 xmlChar * value; /* a value */
36319 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36320 mem_base = xmlMemBlocks();
36321 value = gen_const_xmlChar_ptr(n_value, 0);
36323 ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36324 desret_xmlChar_ptr(ret_val);
36326 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36327 xmlResetLastError();
36328 if (mem_base != xmlMemBlocks()) {
36329 printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36330 xmlMemBlocks() - mem_base);
36332 printf(" %d", n_value);
36343 test_xmlschemastypes(void) {
36346 if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36347 test_ret += test_xmlSchemaCheckFacet();
36348 test_ret += test_xmlSchemaCleanupTypes();
36349 test_ret += test_xmlSchemaCollapseString();
36350 test_ret += test_xmlSchemaCompareValues();
36351 test_ret += test_xmlSchemaCompareValuesWhtsp();
36352 test_ret += test_xmlSchemaCopyValue();
36353 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36354 test_ret += test_xmlSchemaGetBuiltInType();
36355 test_ret += test_xmlSchemaGetCanonValue();
36356 test_ret += test_xmlSchemaGetCanonValueWhtsp();
36357 test_ret += test_xmlSchemaGetFacetValueAsULong();
36358 test_ret += test_xmlSchemaGetPredefinedType();
36359 test_ret += test_xmlSchemaGetValType();
36360 test_ret += test_xmlSchemaInitTypes();
36361 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36362 test_ret += test_xmlSchemaNewFacet();
36363 test_ret += test_xmlSchemaNewNOTATIONValue();
36364 test_ret += test_xmlSchemaNewQNameValue();
36365 test_ret += test_xmlSchemaNewStringValue();
36366 test_ret += test_xmlSchemaValPredefTypeNode();
36367 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36368 test_ret += test_xmlSchemaValidateFacet();
36369 test_ret += test_xmlSchemaValidateFacetWhtsp();
36370 test_ret += test_xmlSchemaValidateLengthFacet();
36371 test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36372 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36373 test_ret += test_xmlSchemaValidatePredefinedType();
36374 test_ret += test_xmlSchemaValueAppend();
36375 test_ret += test_xmlSchemaValueGetAsBoolean();
36376 test_ret += test_xmlSchemaValueGetAsString();
36377 test_ret += test_xmlSchemaValueGetNext();
36378 test_ret += test_xmlSchemaWhiteSpaceReplace();
36381 printf("Module xmlschemastypes: %d errors\n", test_ret);
36386 test_xmlCharStrdup(void) {
36391 char * cur; /* the input char * */
36394 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36395 mem_base = xmlMemBlocks();
36396 cur = gen_const_char_ptr(n_cur, 0);
36398 ret_val = xmlCharStrdup((const char *)cur);
36399 desret_xmlChar_ptr(ret_val);
36401 des_const_char_ptr(n_cur, (const char *)cur, 0);
36402 xmlResetLastError();
36403 if (mem_base != xmlMemBlocks()) {
36404 printf("Leak of %d blocks found in xmlCharStrdup",
36405 xmlMemBlocks() - mem_base);
36407 printf(" %d", n_cur);
36418 test_xmlCharStrndup(void) {
36423 char * cur; /* the input char * */
36425 int len; /* the len of @cur */
36428 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36429 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36430 mem_base = xmlMemBlocks();
36431 cur = gen_const_char_ptr(n_cur, 0);
36432 len = gen_int(n_len, 1);
36433 if ((cur != NULL) &&
36434 (len > (int) strlen((const char *) cur) + 1))
36437 ret_val = xmlCharStrndup((const char *)cur, len);
36438 desret_xmlChar_ptr(ret_val);
36440 des_const_char_ptr(n_cur, (const char *)cur, 0);
36441 des_int(n_len, len, 1);
36442 xmlResetLastError();
36443 if (mem_base != xmlMemBlocks()) {
36444 printf("Leak of %d blocks found in xmlCharStrndup",
36445 xmlMemBlocks() - mem_base);
36447 printf(" %d", n_cur);
36448 printf(" %d", n_len);
36460 test_xmlCheckUTF8(void) {
36465 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36468 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36469 mem_base = xmlMemBlocks();
36470 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36472 ret_val = xmlCheckUTF8((const unsigned char *)utf);
36473 desret_int(ret_val);
36475 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36476 xmlResetLastError();
36477 if (mem_base != xmlMemBlocks()) {
36478 printf("Leak of %d blocks found in xmlCheckUTF8",
36479 xmlMemBlocks() - mem_base);
36481 printf(" %d", n_utf);
36492 test_xmlGetUTF8Char(void) {
36497 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36499 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. */
36502 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36503 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36504 mem_base = xmlMemBlocks();
36505 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36506 len = gen_int_ptr(n_len, 1);
36508 ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36509 desret_int(ret_val);
36511 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36512 des_int_ptr(n_len, len, 1);
36513 xmlResetLastError();
36514 if (mem_base != xmlMemBlocks()) {
36515 printf("Leak of %d blocks found in xmlGetUTF8Char",
36516 xmlMemBlocks() - mem_base);
36518 printf(" %d", n_utf);
36519 printf(" %d", n_len);
36531 test_xmlStrEqual(void) {
36536 xmlChar * str1; /* the first xmlChar * */
36538 xmlChar * str2; /* the second xmlChar * */
36541 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36542 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36543 mem_base = xmlMemBlocks();
36544 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36545 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36547 ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36548 desret_int(ret_val);
36550 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36551 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36552 xmlResetLastError();
36553 if (mem_base != xmlMemBlocks()) {
36554 printf("Leak of %d blocks found in xmlStrEqual",
36555 xmlMemBlocks() - mem_base);
36557 printf(" %d", n_str1);
36558 printf(" %d", n_str2);
36570 test_xmlStrPrintf(void) {
36574 /* missing type support */
36580 test_xmlStrQEqual(void) {
36585 xmlChar * pref; /* the prefix of the QName */
36587 xmlChar * name; /* the localname of the QName */
36589 xmlChar * str; /* the second xmlChar * */
36592 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36593 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36594 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36595 mem_base = xmlMemBlocks();
36596 pref = gen_const_xmlChar_ptr(n_pref, 0);
36597 name = gen_const_xmlChar_ptr(n_name, 1);
36598 str = gen_const_xmlChar_ptr(n_str, 2);
36600 ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36601 desret_int(ret_val);
36603 des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36604 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36605 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36606 xmlResetLastError();
36607 if (mem_base != xmlMemBlocks()) {
36608 printf("Leak of %d blocks found in xmlStrQEqual",
36609 xmlMemBlocks() - mem_base);
36611 printf(" %d", n_pref);
36612 printf(" %d", n_name);
36613 printf(" %d", n_str);
36626 test_xmlStrVPrintf(void) {
36630 /* missing type support */
36636 test_xmlStrcasecmp(void) {
36641 xmlChar * str1; /* the first xmlChar * */
36643 xmlChar * str2; /* the second xmlChar * */
36646 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36647 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36648 mem_base = xmlMemBlocks();
36649 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36650 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36652 ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36653 desret_int(ret_val);
36655 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36656 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36657 xmlResetLastError();
36658 if (mem_base != xmlMemBlocks()) {
36659 printf("Leak of %d blocks found in xmlStrcasecmp",
36660 xmlMemBlocks() - mem_base);
36662 printf(" %d", n_str1);
36663 printf(" %d", n_str2);
36675 test_xmlStrcasestr(void) {
36679 const xmlChar * ret_val;
36680 xmlChar * str; /* the xmlChar * array (haystack) */
36682 xmlChar * val; /* the xmlChar to search (needle) */
36685 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36686 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36687 mem_base = xmlMemBlocks();
36688 str = gen_const_xmlChar_ptr(n_str, 0);
36689 val = gen_const_xmlChar_ptr(n_val, 1);
36691 ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36692 desret_const_xmlChar_ptr(ret_val);
36694 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36695 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36696 xmlResetLastError();
36697 if (mem_base != xmlMemBlocks()) {
36698 printf("Leak of %d blocks found in xmlStrcasestr",
36699 xmlMemBlocks() - mem_base);
36701 printf(" %d", n_str);
36702 printf(" %d", n_val);
36714 test_xmlStrchr(void) {
36718 const xmlChar * ret_val;
36719 xmlChar * str; /* the xmlChar * array */
36721 xmlChar val; /* the xmlChar to search */
36724 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36725 for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36726 mem_base = xmlMemBlocks();
36727 str = gen_const_xmlChar_ptr(n_str, 0);
36728 val = gen_xmlChar(n_val, 1);
36730 ret_val = xmlStrchr((const xmlChar *)str, val);
36731 desret_const_xmlChar_ptr(ret_val);
36733 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36734 des_xmlChar(n_val, val, 1);
36735 xmlResetLastError();
36736 if (mem_base != xmlMemBlocks()) {
36737 printf("Leak of %d blocks found in xmlStrchr",
36738 xmlMemBlocks() - mem_base);
36740 printf(" %d", n_str);
36741 printf(" %d", n_val);
36753 test_xmlStrcmp(void) {
36758 xmlChar * str1; /* the first xmlChar * */
36760 xmlChar * str2; /* the second xmlChar * */
36763 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36764 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36765 mem_base = xmlMemBlocks();
36766 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36767 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36769 ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36770 desret_int(ret_val);
36772 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36773 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36774 xmlResetLastError();
36775 if (mem_base != xmlMemBlocks()) {
36776 printf("Leak of %d blocks found in xmlStrcmp",
36777 xmlMemBlocks() - mem_base);
36779 printf(" %d", n_str1);
36780 printf(" %d", n_str2);
36792 test_xmlStrdup(void) {
36797 xmlChar * cur; /* the input xmlChar * */
36800 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36801 mem_base = xmlMemBlocks();
36802 cur = gen_const_xmlChar_ptr(n_cur, 0);
36804 ret_val = xmlStrdup((const xmlChar *)cur);
36805 desret_xmlChar_ptr(ret_val);
36807 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36808 xmlResetLastError();
36809 if (mem_base != xmlMemBlocks()) {
36810 printf("Leak of %d blocks found in xmlStrdup",
36811 xmlMemBlocks() - mem_base);
36813 printf(" %d", n_cur);
36824 test_xmlStrlen(void) {
36829 xmlChar * str; /* the xmlChar * array */
36832 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36833 mem_base = xmlMemBlocks();
36834 str = gen_const_xmlChar_ptr(n_str, 0);
36836 ret_val = xmlStrlen((const xmlChar *)str);
36837 desret_int(ret_val);
36839 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36840 xmlResetLastError();
36841 if (mem_base != xmlMemBlocks()) {
36842 printf("Leak of %d blocks found in xmlStrlen",
36843 xmlMemBlocks() - mem_base);
36845 printf(" %d", n_str);
36856 test_xmlStrncasecmp(void) {
36861 xmlChar * str1; /* the first xmlChar * */
36863 xmlChar * str2; /* the second xmlChar * */
36865 int len; /* the max comparison length */
36868 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36869 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36870 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36871 mem_base = xmlMemBlocks();
36872 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36873 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36874 len = gen_int(n_len, 2);
36875 if ((str2 != NULL) &&
36876 (len > (int) strlen((const char *) str2) + 1))
36879 ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36880 desret_int(ret_val);
36882 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36883 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36884 des_int(n_len, len, 2);
36885 xmlResetLastError();
36886 if (mem_base != xmlMemBlocks()) {
36887 printf("Leak of %d blocks found in xmlStrncasecmp",
36888 xmlMemBlocks() - mem_base);
36890 printf(" %d", n_str1);
36891 printf(" %d", n_str2);
36892 printf(" %d", n_len);
36905 test_xmlStrncatNew(void) {
36910 xmlChar * str1; /* first xmlChar string */
36912 xmlChar * str2; /* second xmlChar string */
36914 int len; /* the len of @str2 or < 0 */
36917 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36918 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36919 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36920 mem_base = xmlMemBlocks();
36921 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36922 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36923 len = gen_int(n_len, 2);
36924 if ((str2 != NULL) &&
36925 (len > (int) strlen((const char *) str2) + 1))
36928 ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36929 desret_xmlChar_ptr(ret_val);
36931 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36932 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36933 des_int(n_len, len, 2);
36934 xmlResetLastError();
36935 if (mem_base != xmlMemBlocks()) {
36936 printf("Leak of %d blocks found in xmlStrncatNew",
36937 xmlMemBlocks() - mem_base);
36939 printf(" %d", n_str1);
36940 printf(" %d", n_str2);
36941 printf(" %d", n_len);
36954 test_xmlStrncmp(void) {
36959 xmlChar * str1; /* the first xmlChar * */
36961 xmlChar * str2; /* the second xmlChar * */
36963 int len; /* the max comparison length */
36966 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36967 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36968 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36969 mem_base = xmlMemBlocks();
36970 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36971 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36972 len = gen_int(n_len, 2);
36973 if ((str2 != NULL) &&
36974 (len > (int) strlen((const char *) str2) + 1))
36977 ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36978 desret_int(ret_val);
36980 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36981 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36982 des_int(n_len, len, 2);
36983 xmlResetLastError();
36984 if (mem_base != xmlMemBlocks()) {
36985 printf("Leak of %d blocks found in xmlStrncmp",
36986 xmlMemBlocks() - mem_base);
36988 printf(" %d", n_str1);
36989 printf(" %d", n_str2);
36990 printf(" %d", n_len);
37003 test_xmlStrndup(void) {
37008 xmlChar * cur; /* the input xmlChar * */
37010 int len; /* the len of @cur */
37013 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37014 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37015 mem_base = xmlMemBlocks();
37016 cur = gen_const_xmlChar_ptr(n_cur, 0);
37017 len = gen_int(n_len, 1);
37018 if ((cur != NULL) &&
37019 (len > (int) strlen((const char *) cur) + 1))
37022 ret_val = xmlStrndup((const xmlChar *)cur, len);
37023 desret_xmlChar_ptr(ret_val);
37025 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37026 des_int(n_len, len, 1);
37027 xmlResetLastError();
37028 if (mem_base != xmlMemBlocks()) {
37029 printf("Leak of %d blocks found in xmlStrndup",
37030 xmlMemBlocks() - mem_base);
37032 printf(" %d", n_cur);
37033 printf(" %d", n_len);
37045 test_xmlStrstr(void) {
37049 const xmlChar * ret_val;
37050 xmlChar * str; /* the xmlChar * array (haystack) */
37052 xmlChar * val; /* the xmlChar to search (needle) */
37055 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37056 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37057 mem_base = xmlMemBlocks();
37058 str = gen_const_xmlChar_ptr(n_str, 0);
37059 val = gen_const_xmlChar_ptr(n_val, 1);
37061 ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
37062 desret_const_xmlChar_ptr(ret_val);
37064 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37065 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37066 xmlResetLastError();
37067 if (mem_base != xmlMemBlocks()) {
37068 printf("Leak of %d blocks found in xmlStrstr",
37069 xmlMemBlocks() - mem_base);
37071 printf(" %d", n_str);
37072 printf(" %d", n_val);
37084 test_xmlStrsub(void) {
37089 xmlChar * str; /* the xmlChar * array (haystack) */
37091 int start; /* the index of the first char (zero based) */
37093 int len; /* the length of the substring */
37096 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37097 for (n_start = 0;n_start < gen_nb_int;n_start++) {
37098 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37099 mem_base = xmlMemBlocks();
37100 str = gen_const_xmlChar_ptr(n_str, 0);
37101 start = gen_int(n_start, 1);
37102 len = gen_int(n_len, 2);
37103 if ((str != NULL) &&
37104 (start > (int) strlen((const char *) str) + 1))
37106 if ((str != NULL) &&
37107 (len > (int) strlen((const char *) str) + 1))
37110 ret_val = xmlStrsub((const xmlChar *)str, start, len);
37111 desret_xmlChar_ptr(ret_val);
37113 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37114 des_int(n_start, start, 1);
37115 des_int(n_len, len, 2);
37116 xmlResetLastError();
37117 if (mem_base != xmlMemBlocks()) {
37118 printf("Leak of %d blocks found in xmlStrsub",
37119 xmlMemBlocks() - mem_base);
37121 printf(" %d", n_str);
37122 printf(" %d", n_start);
37123 printf(" %d", n_len);
37136 test_xmlUTF8Charcmp(void) {
37141 xmlChar * utf1; /* pointer to first UTF8 char */
37143 xmlChar * utf2; /* pointer to second UTF8 char */
37146 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
37147 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
37148 mem_base = xmlMemBlocks();
37149 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
37150 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
37152 ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
37153 desret_int(ret_val);
37155 des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
37156 des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
37157 xmlResetLastError();
37158 if (mem_base != xmlMemBlocks()) {
37159 printf("Leak of %d blocks found in xmlUTF8Charcmp",
37160 xmlMemBlocks() - mem_base);
37162 printf(" %d", n_utf1);
37163 printf(" %d", n_utf2);
37175 test_xmlUTF8Size(void) {
37180 xmlChar * utf; /* pointer to the UTF8 character */
37183 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37184 mem_base = xmlMemBlocks();
37185 utf = gen_const_xmlChar_ptr(n_utf, 0);
37187 ret_val = xmlUTF8Size((const xmlChar *)utf);
37188 desret_int(ret_val);
37190 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37191 xmlResetLastError();
37192 if (mem_base != xmlMemBlocks()) {
37193 printf("Leak of %d blocks found in xmlUTF8Size",
37194 xmlMemBlocks() - mem_base);
37196 printf(" %d", n_utf);
37207 test_xmlUTF8Strlen(void) {
37212 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37215 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37216 mem_base = xmlMemBlocks();
37217 utf = gen_const_xmlChar_ptr(n_utf, 0);
37219 ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37220 desret_int(ret_val);
37222 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37223 xmlResetLastError();
37224 if (mem_base != xmlMemBlocks()) {
37225 printf("Leak of %d blocks found in xmlUTF8Strlen",
37226 xmlMemBlocks() - mem_base);
37228 printf(" %d", n_utf);
37239 test_xmlUTF8Strloc(void) {
37244 xmlChar * utf; /* the input UTF8 * */
37246 xmlChar * utfchar; /* the UTF8 character to be found */
37249 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37250 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37251 mem_base = xmlMemBlocks();
37252 utf = gen_const_xmlChar_ptr(n_utf, 0);
37253 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37255 ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37256 desret_int(ret_val);
37258 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37259 des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37260 xmlResetLastError();
37261 if (mem_base != xmlMemBlocks()) {
37262 printf("Leak of %d blocks found in xmlUTF8Strloc",
37263 xmlMemBlocks() - mem_base);
37265 printf(" %d", n_utf);
37266 printf(" %d", n_utfchar);
37278 test_xmlUTF8Strndup(void) {
37283 xmlChar * utf; /* the input UTF8 * */
37285 int len; /* the len of @utf (in chars) */
37288 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37289 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37290 mem_base = xmlMemBlocks();
37291 utf = gen_const_xmlChar_ptr(n_utf, 0);
37292 len = gen_int(n_len, 1);
37293 if ((utf != NULL) &&
37294 (len > (int) strlen((const char *) utf) + 1))
37297 ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37298 desret_xmlChar_ptr(ret_val);
37300 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37301 des_int(n_len, len, 1);
37302 xmlResetLastError();
37303 if (mem_base != xmlMemBlocks()) {
37304 printf("Leak of %d blocks found in xmlUTF8Strndup",
37305 xmlMemBlocks() - mem_base);
37307 printf(" %d", n_utf);
37308 printf(" %d", n_len);
37320 test_xmlUTF8Strpos(void) {
37324 const xmlChar * ret_val;
37325 xmlChar * utf; /* the input UTF8 * */
37327 int pos; /* the position of the desired UTF8 char (in chars) */
37330 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37331 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37332 mem_base = xmlMemBlocks();
37333 utf = gen_const_xmlChar_ptr(n_utf, 0);
37334 pos = gen_int(n_pos, 1);
37336 ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37337 desret_const_xmlChar_ptr(ret_val);
37339 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37340 des_int(n_pos, pos, 1);
37341 xmlResetLastError();
37342 if (mem_base != xmlMemBlocks()) {
37343 printf("Leak of %d blocks found in xmlUTF8Strpos",
37344 xmlMemBlocks() - mem_base);
37346 printf(" %d", n_utf);
37347 printf(" %d", n_pos);
37359 test_xmlUTF8Strsize(void) {
37364 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37366 int len; /* the number of characters in the array */
37369 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37370 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37371 mem_base = xmlMemBlocks();
37372 utf = gen_const_xmlChar_ptr(n_utf, 0);
37373 len = gen_int(n_len, 1);
37374 if ((utf != NULL) &&
37375 (len > (int) strlen((const char *) utf) + 1))
37378 ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37379 desret_int(ret_val);
37381 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37382 des_int(n_len, len, 1);
37383 xmlResetLastError();
37384 if (mem_base != xmlMemBlocks()) {
37385 printf("Leak of %d blocks found in xmlUTF8Strsize",
37386 xmlMemBlocks() - mem_base);
37388 printf(" %d", n_utf);
37389 printf(" %d", n_len);
37401 test_xmlUTF8Strsub(void) {
37406 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37408 int start; /* relative pos of first char */
37410 int len; /* total number to copy */
37413 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37414 for (n_start = 0;n_start < gen_nb_int;n_start++) {
37415 for (n_len = 0;n_len < gen_nb_int;n_len++) {
37416 mem_base = xmlMemBlocks();
37417 utf = gen_const_xmlChar_ptr(n_utf, 0);
37418 start = gen_int(n_start, 1);
37419 len = gen_int(n_len, 2);
37420 if ((utf != NULL) &&
37421 (start > (int) strlen((const char *) utf) + 1))
37423 if ((utf != NULL) &&
37424 (len > (int) strlen((const char *) utf) + 1))
37427 ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37428 desret_xmlChar_ptr(ret_val);
37430 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37431 des_int(n_start, start, 1);
37432 des_int(n_len, len, 2);
37433 xmlResetLastError();
37434 if (mem_base != xmlMemBlocks()) {
37435 printf("Leak of %d blocks found in xmlUTF8Strsub",
37436 xmlMemBlocks() - mem_base);
37438 printf(" %d", n_utf);
37439 printf(" %d", n_start);
37440 printf(" %d", n_len);
37452 test_xmlstring(void) {
37455 if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37456 test_ret += test_xmlCharStrdup();
37457 test_ret += test_xmlCharStrndup();
37458 test_ret += test_xmlCheckUTF8();
37459 test_ret += test_xmlGetUTF8Char();
37460 test_ret += test_xmlStrEqual();
37461 test_ret += test_xmlStrPrintf();
37462 test_ret += test_xmlStrQEqual();
37463 test_ret += test_xmlStrVPrintf();
37464 test_ret += test_xmlStrcasecmp();
37465 test_ret += test_xmlStrcasestr();
37466 test_ret += test_xmlStrchr();
37467 test_ret += test_xmlStrcmp();
37468 test_ret += test_xmlStrdup();
37469 test_ret += test_xmlStrlen();
37470 test_ret += test_xmlStrncasecmp();
37471 test_ret += test_xmlStrncatNew();
37472 test_ret += test_xmlStrncmp();
37473 test_ret += test_xmlStrndup();
37474 test_ret += test_xmlStrstr();
37475 test_ret += test_xmlStrsub();
37476 test_ret += test_xmlUTF8Charcmp();
37477 test_ret += test_xmlUTF8Size();
37478 test_ret += test_xmlUTF8Strlen();
37479 test_ret += test_xmlUTF8Strloc();
37480 test_ret += test_xmlUTF8Strndup();
37481 test_ret += test_xmlUTF8Strpos();
37482 test_ret += test_xmlUTF8Strsize();
37483 test_ret += test_xmlUTF8Strsub();
37486 printf("Module xmlstring: %d errors\n", test_ret);
37491 test_xmlUCSIsAegeanNumbers(void) {
37494 #if defined(LIBXML_UNICODE_ENABLED)
37497 int code; /* UCS code point */
37500 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37501 mem_base = xmlMemBlocks();
37502 code = gen_int(n_code, 0);
37504 ret_val = xmlUCSIsAegeanNumbers(code);
37505 desret_int(ret_val);
37507 des_int(n_code, code, 0);
37508 xmlResetLastError();
37509 if (mem_base != xmlMemBlocks()) {
37510 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37511 xmlMemBlocks() - mem_base);
37513 printf(" %d", n_code);
37525 test_xmlUCSIsAlphabeticPresentationForms(void) {
37528 #if defined(LIBXML_UNICODE_ENABLED)
37531 int code; /* UCS code point */
37534 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37535 mem_base = xmlMemBlocks();
37536 code = gen_int(n_code, 0);
37538 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37539 desret_int(ret_val);
37541 des_int(n_code, code, 0);
37542 xmlResetLastError();
37543 if (mem_base != xmlMemBlocks()) {
37544 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37545 xmlMemBlocks() - mem_base);
37547 printf(" %d", n_code);
37559 test_xmlUCSIsArabic(void) {
37562 #if defined(LIBXML_UNICODE_ENABLED)
37565 int code; /* UCS code point */
37568 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37569 mem_base = xmlMemBlocks();
37570 code = gen_int(n_code, 0);
37572 ret_val = xmlUCSIsArabic(code);
37573 desret_int(ret_val);
37575 des_int(n_code, code, 0);
37576 xmlResetLastError();
37577 if (mem_base != xmlMemBlocks()) {
37578 printf("Leak of %d blocks found in xmlUCSIsArabic",
37579 xmlMemBlocks() - mem_base);
37581 printf(" %d", n_code);
37593 test_xmlUCSIsArabicPresentationFormsA(void) {
37596 #if defined(LIBXML_UNICODE_ENABLED)
37599 int code; /* UCS code point */
37602 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37603 mem_base = xmlMemBlocks();
37604 code = gen_int(n_code, 0);
37606 ret_val = xmlUCSIsArabicPresentationFormsA(code);
37607 desret_int(ret_val);
37609 des_int(n_code, code, 0);
37610 xmlResetLastError();
37611 if (mem_base != xmlMemBlocks()) {
37612 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37613 xmlMemBlocks() - mem_base);
37615 printf(" %d", n_code);
37627 test_xmlUCSIsArabicPresentationFormsB(void) {
37630 #if defined(LIBXML_UNICODE_ENABLED)
37633 int code; /* UCS code point */
37636 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37637 mem_base = xmlMemBlocks();
37638 code = gen_int(n_code, 0);
37640 ret_val = xmlUCSIsArabicPresentationFormsB(code);
37641 desret_int(ret_val);
37643 des_int(n_code, code, 0);
37644 xmlResetLastError();
37645 if (mem_base != xmlMemBlocks()) {
37646 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37647 xmlMemBlocks() - mem_base);
37649 printf(" %d", n_code);
37661 test_xmlUCSIsArmenian(void) {
37664 #if defined(LIBXML_UNICODE_ENABLED)
37667 int code; /* UCS code point */
37670 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37671 mem_base = xmlMemBlocks();
37672 code = gen_int(n_code, 0);
37674 ret_val = xmlUCSIsArmenian(code);
37675 desret_int(ret_val);
37677 des_int(n_code, code, 0);
37678 xmlResetLastError();
37679 if (mem_base != xmlMemBlocks()) {
37680 printf("Leak of %d blocks found in xmlUCSIsArmenian",
37681 xmlMemBlocks() - mem_base);
37683 printf(" %d", n_code);
37695 test_xmlUCSIsArrows(void) {
37698 #if defined(LIBXML_UNICODE_ENABLED)
37701 int code; /* UCS code point */
37704 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37705 mem_base = xmlMemBlocks();
37706 code = gen_int(n_code, 0);
37708 ret_val = xmlUCSIsArrows(code);
37709 desret_int(ret_val);
37711 des_int(n_code, code, 0);
37712 xmlResetLastError();
37713 if (mem_base != xmlMemBlocks()) {
37714 printf("Leak of %d blocks found in xmlUCSIsArrows",
37715 xmlMemBlocks() - mem_base);
37717 printf(" %d", n_code);
37729 test_xmlUCSIsBasicLatin(void) {
37732 #if defined(LIBXML_UNICODE_ENABLED)
37735 int code; /* UCS code point */
37738 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37739 mem_base = xmlMemBlocks();
37740 code = gen_int(n_code, 0);
37742 ret_val = xmlUCSIsBasicLatin(code);
37743 desret_int(ret_val);
37745 des_int(n_code, code, 0);
37746 xmlResetLastError();
37747 if (mem_base != xmlMemBlocks()) {
37748 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37749 xmlMemBlocks() - mem_base);
37751 printf(" %d", n_code);
37763 test_xmlUCSIsBengali(void) {
37766 #if defined(LIBXML_UNICODE_ENABLED)
37769 int code; /* UCS code point */
37772 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37773 mem_base = xmlMemBlocks();
37774 code = gen_int(n_code, 0);
37776 ret_val = xmlUCSIsBengali(code);
37777 desret_int(ret_val);
37779 des_int(n_code, code, 0);
37780 xmlResetLastError();
37781 if (mem_base != xmlMemBlocks()) {
37782 printf("Leak of %d blocks found in xmlUCSIsBengali",
37783 xmlMemBlocks() - mem_base);
37785 printf(" %d", n_code);
37797 test_xmlUCSIsBlock(void) {
37800 #if defined(LIBXML_UNICODE_ENABLED)
37803 int code; /* UCS code point */
37805 char * block; /* UCS block name */
37808 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37809 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37810 mem_base = xmlMemBlocks();
37811 code = gen_int(n_code, 0);
37812 block = gen_const_char_ptr(n_block, 1);
37814 ret_val = xmlUCSIsBlock(code, (const char *)block);
37815 desret_int(ret_val);
37817 des_int(n_code, code, 0);
37818 des_const_char_ptr(n_block, (const char *)block, 1);
37819 xmlResetLastError();
37820 if (mem_base != xmlMemBlocks()) {
37821 printf("Leak of %d blocks found in xmlUCSIsBlock",
37822 xmlMemBlocks() - mem_base);
37824 printf(" %d", n_code);
37825 printf(" %d", n_block);
37838 test_xmlUCSIsBlockElements(void) {
37841 #if defined(LIBXML_UNICODE_ENABLED)
37844 int code; /* UCS code point */
37847 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37848 mem_base = xmlMemBlocks();
37849 code = gen_int(n_code, 0);
37851 ret_val = xmlUCSIsBlockElements(code);
37852 desret_int(ret_val);
37854 des_int(n_code, code, 0);
37855 xmlResetLastError();
37856 if (mem_base != xmlMemBlocks()) {
37857 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37858 xmlMemBlocks() - mem_base);
37860 printf(" %d", n_code);
37872 test_xmlUCSIsBopomofo(void) {
37875 #if defined(LIBXML_UNICODE_ENABLED)
37878 int code; /* UCS code point */
37881 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37882 mem_base = xmlMemBlocks();
37883 code = gen_int(n_code, 0);
37885 ret_val = xmlUCSIsBopomofo(code);
37886 desret_int(ret_val);
37888 des_int(n_code, code, 0);
37889 xmlResetLastError();
37890 if (mem_base != xmlMemBlocks()) {
37891 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37892 xmlMemBlocks() - mem_base);
37894 printf(" %d", n_code);
37906 test_xmlUCSIsBopomofoExtended(void) {
37909 #if defined(LIBXML_UNICODE_ENABLED)
37912 int code; /* UCS code point */
37915 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37916 mem_base = xmlMemBlocks();
37917 code = gen_int(n_code, 0);
37919 ret_val = xmlUCSIsBopomofoExtended(code);
37920 desret_int(ret_val);
37922 des_int(n_code, code, 0);
37923 xmlResetLastError();
37924 if (mem_base != xmlMemBlocks()) {
37925 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37926 xmlMemBlocks() - mem_base);
37928 printf(" %d", n_code);
37940 test_xmlUCSIsBoxDrawing(void) {
37943 #if defined(LIBXML_UNICODE_ENABLED)
37946 int code; /* UCS code point */
37949 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37950 mem_base = xmlMemBlocks();
37951 code = gen_int(n_code, 0);
37953 ret_val = xmlUCSIsBoxDrawing(code);
37954 desret_int(ret_val);
37956 des_int(n_code, code, 0);
37957 xmlResetLastError();
37958 if (mem_base != xmlMemBlocks()) {
37959 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37960 xmlMemBlocks() - mem_base);
37962 printf(" %d", n_code);
37974 test_xmlUCSIsBraillePatterns(void) {
37977 #if defined(LIBXML_UNICODE_ENABLED)
37980 int code; /* UCS code point */
37983 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37984 mem_base = xmlMemBlocks();
37985 code = gen_int(n_code, 0);
37987 ret_val = xmlUCSIsBraillePatterns(code);
37988 desret_int(ret_val);
37990 des_int(n_code, code, 0);
37991 xmlResetLastError();
37992 if (mem_base != xmlMemBlocks()) {
37993 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37994 xmlMemBlocks() - mem_base);
37996 printf(" %d", n_code);
38008 test_xmlUCSIsBuhid(void) {
38011 #if defined(LIBXML_UNICODE_ENABLED)
38014 int code; /* UCS code point */
38017 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38018 mem_base = xmlMemBlocks();
38019 code = gen_int(n_code, 0);
38021 ret_val = xmlUCSIsBuhid(code);
38022 desret_int(ret_val);
38024 des_int(n_code, code, 0);
38025 xmlResetLastError();
38026 if (mem_base != xmlMemBlocks()) {
38027 printf("Leak of %d blocks found in xmlUCSIsBuhid",
38028 xmlMemBlocks() - mem_base);
38030 printf(" %d", n_code);
38042 test_xmlUCSIsByzantineMusicalSymbols(void) {
38045 #if defined(LIBXML_UNICODE_ENABLED)
38048 int code; /* UCS code point */
38051 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38052 mem_base = xmlMemBlocks();
38053 code = gen_int(n_code, 0);
38055 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
38056 desret_int(ret_val);
38058 des_int(n_code, code, 0);
38059 xmlResetLastError();
38060 if (mem_base != xmlMemBlocks()) {
38061 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
38062 xmlMemBlocks() - mem_base);
38064 printf(" %d", n_code);
38076 test_xmlUCSIsCJKCompatibility(void) {
38079 #if defined(LIBXML_UNICODE_ENABLED)
38082 int code; /* UCS code point */
38085 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38086 mem_base = xmlMemBlocks();
38087 code = gen_int(n_code, 0);
38089 ret_val = xmlUCSIsCJKCompatibility(code);
38090 desret_int(ret_val);
38092 des_int(n_code, code, 0);
38093 xmlResetLastError();
38094 if (mem_base != xmlMemBlocks()) {
38095 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
38096 xmlMemBlocks() - mem_base);
38098 printf(" %d", n_code);
38110 test_xmlUCSIsCJKCompatibilityForms(void) {
38113 #if defined(LIBXML_UNICODE_ENABLED)
38116 int code; /* UCS code point */
38119 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38120 mem_base = xmlMemBlocks();
38121 code = gen_int(n_code, 0);
38123 ret_val = xmlUCSIsCJKCompatibilityForms(code);
38124 desret_int(ret_val);
38126 des_int(n_code, code, 0);
38127 xmlResetLastError();
38128 if (mem_base != xmlMemBlocks()) {
38129 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
38130 xmlMemBlocks() - mem_base);
38132 printf(" %d", n_code);
38144 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
38147 #if defined(LIBXML_UNICODE_ENABLED)
38150 int code; /* UCS code point */
38153 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38154 mem_base = xmlMemBlocks();
38155 code = gen_int(n_code, 0);
38157 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
38158 desret_int(ret_val);
38160 des_int(n_code, code, 0);
38161 xmlResetLastError();
38162 if (mem_base != xmlMemBlocks()) {
38163 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
38164 xmlMemBlocks() - mem_base);
38166 printf(" %d", n_code);
38178 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38181 #if defined(LIBXML_UNICODE_ENABLED)
38184 int code; /* UCS code point */
38187 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38188 mem_base = xmlMemBlocks();
38189 code = gen_int(n_code, 0);
38191 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38192 desret_int(ret_val);
38194 des_int(n_code, code, 0);
38195 xmlResetLastError();
38196 if (mem_base != xmlMemBlocks()) {
38197 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38198 xmlMemBlocks() - mem_base);
38200 printf(" %d", n_code);
38212 test_xmlUCSIsCJKRadicalsSupplement(void) {
38215 #if defined(LIBXML_UNICODE_ENABLED)
38218 int code; /* UCS code point */
38221 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38222 mem_base = xmlMemBlocks();
38223 code = gen_int(n_code, 0);
38225 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38226 desret_int(ret_val);
38228 des_int(n_code, code, 0);
38229 xmlResetLastError();
38230 if (mem_base != xmlMemBlocks()) {
38231 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38232 xmlMemBlocks() - mem_base);
38234 printf(" %d", n_code);
38246 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38249 #if defined(LIBXML_UNICODE_ENABLED)
38252 int code; /* UCS code point */
38255 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38256 mem_base = xmlMemBlocks();
38257 code = gen_int(n_code, 0);
38259 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38260 desret_int(ret_val);
38262 des_int(n_code, code, 0);
38263 xmlResetLastError();
38264 if (mem_base != xmlMemBlocks()) {
38265 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38266 xmlMemBlocks() - mem_base);
38268 printf(" %d", n_code);
38280 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38283 #if defined(LIBXML_UNICODE_ENABLED)
38286 int code; /* UCS code point */
38289 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38290 mem_base = xmlMemBlocks();
38291 code = gen_int(n_code, 0);
38293 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38294 desret_int(ret_val);
38296 des_int(n_code, code, 0);
38297 xmlResetLastError();
38298 if (mem_base != xmlMemBlocks()) {
38299 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38300 xmlMemBlocks() - mem_base);
38302 printf(" %d", n_code);
38314 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38317 #if defined(LIBXML_UNICODE_ENABLED)
38320 int code; /* UCS code point */
38323 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38324 mem_base = xmlMemBlocks();
38325 code = gen_int(n_code, 0);
38327 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38328 desret_int(ret_val);
38330 des_int(n_code, code, 0);
38331 xmlResetLastError();
38332 if (mem_base != xmlMemBlocks()) {
38333 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38334 xmlMemBlocks() - mem_base);
38336 printf(" %d", n_code);
38348 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38351 #if defined(LIBXML_UNICODE_ENABLED)
38354 int code; /* UCS code point */
38357 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38358 mem_base = xmlMemBlocks();
38359 code = gen_int(n_code, 0);
38361 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38362 desret_int(ret_val);
38364 des_int(n_code, code, 0);
38365 xmlResetLastError();
38366 if (mem_base != xmlMemBlocks()) {
38367 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38368 xmlMemBlocks() - mem_base);
38370 printf(" %d", n_code);
38382 test_xmlUCSIsCat(void) {
38385 #if defined(LIBXML_UNICODE_ENABLED)
38388 int code; /* UCS code point */
38390 char * cat; /* UCS Category name */
38393 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38394 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38395 mem_base = xmlMemBlocks();
38396 code = gen_int(n_code, 0);
38397 cat = gen_const_char_ptr(n_cat, 1);
38399 ret_val = xmlUCSIsCat(code, (const char *)cat);
38400 desret_int(ret_val);
38402 des_int(n_code, code, 0);
38403 des_const_char_ptr(n_cat, (const char *)cat, 1);
38404 xmlResetLastError();
38405 if (mem_base != xmlMemBlocks()) {
38406 printf("Leak of %d blocks found in xmlUCSIsCat",
38407 xmlMemBlocks() - mem_base);
38409 printf(" %d", n_code);
38410 printf(" %d", n_cat);
38423 test_xmlUCSIsCatC(void) {
38426 #if defined(LIBXML_UNICODE_ENABLED)
38429 int code; /* UCS code point */
38432 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38433 mem_base = xmlMemBlocks();
38434 code = gen_int(n_code, 0);
38436 ret_val = xmlUCSIsCatC(code);
38437 desret_int(ret_val);
38439 des_int(n_code, code, 0);
38440 xmlResetLastError();
38441 if (mem_base != xmlMemBlocks()) {
38442 printf("Leak of %d blocks found in xmlUCSIsCatC",
38443 xmlMemBlocks() - mem_base);
38445 printf(" %d", n_code);
38457 test_xmlUCSIsCatCc(void) {
38460 #if defined(LIBXML_UNICODE_ENABLED)
38463 int code; /* UCS code point */
38466 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38467 mem_base = xmlMemBlocks();
38468 code = gen_int(n_code, 0);
38470 ret_val = xmlUCSIsCatCc(code);
38471 desret_int(ret_val);
38473 des_int(n_code, code, 0);
38474 xmlResetLastError();
38475 if (mem_base != xmlMemBlocks()) {
38476 printf("Leak of %d blocks found in xmlUCSIsCatCc",
38477 xmlMemBlocks() - mem_base);
38479 printf(" %d", n_code);
38491 test_xmlUCSIsCatCf(void) {
38494 #if defined(LIBXML_UNICODE_ENABLED)
38497 int code; /* UCS code point */
38500 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38501 mem_base = xmlMemBlocks();
38502 code = gen_int(n_code, 0);
38504 ret_val = xmlUCSIsCatCf(code);
38505 desret_int(ret_val);
38507 des_int(n_code, code, 0);
38508 xmlResetLastError();
38509 if (mem_base != xmlMemBlocks()) {
38510 printf("Leak of %d blocks found in xmlUCSIsCatCf",
38511 xmlMemBlocks() - mem_base);
38513 printf(" %d", n_code);
38525 test_xmlUCSIsCatCo(void) {
38528 #if defined(LIBXML_UNICODE_ENABLED)
38531 int code; /* UCS code point */
38534 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38535 mem_base = xmlMemBlocks();
38536 code = gen_int(n_code, 0);
38538 ret_val = xmlUCSIsCatCo(code);
38539 desret_int(ret_val);
38541 des_int(n_code, code, 0);
38542 xmlResetLastError();
38543 if (mem_base != xmlMemBlocks()) {
38544 printf("Leak of %d blocks found in xmlUCSIsCatCo",
38545 xmlMemBlocks() - mem_base);
38547 printf(" %d", n_code);
38559 test_xmlUCSIsCatCs(void) {
38562 #if defined(LIBXML_UNICODE_ENABLED)
38565 int code; /* UCS code point */
38568 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38569 mem_base = xmlMemBlocks();
38570 code = gen_int(n_code, 0);
38572 ret_val = xmlUCSIsCatCs(code);
38573 desret_int(ret_val);
38575 des_int(n_code, code, 0);
38576 xmlResetLastError();
38577 if (mem_base != xmlMemBlocks()) {
38578 printf("Leak of %d blocks found in xmlUCSIsCatCs",
38579 xmlMemBlocks() - mem_base);
38581 printf(" %d", n_code);
38593 test_xmlUCSIsCatL(void) {
38596 #if defined(LIBXML_UNICODE_ENABLED)
38599 int code; /* UCS code point */
38602 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38603 mem_base = xmlMemBlocks();
38604 code = gen_int(n_code, 0);
38606 ret_val = xmlUCSIsCatL(code);
38607 desret_int(ret_val);
38609 des_int(n_code, code, 0);
38610 xmlResetLastError();
38611 if (mem_base != xmlMemBlocks()) {
38612 printf("Leak of %d blocks found in xmlUCSIsCatL",
38613 xmlMemBlocks() - mem_base);
38615 printf(" %d", n_code);
38627 test_xmlUCSIsCatLl(void) {
38630 #if defined(LIBXML_UNICODE_ENABLED)
38633 int code; /* UCS code point */
38636 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38637 mem_base = xmlMemBlocks();
38638 code = gen_int(n_code, 0);
38640 ret_val = xmlUCSIsCatLl(code);
38641 desret_int(ret_val);
38643 des_int(n_code, code, 0);
38644 xmlResetLastError();
38645 if (mem_base != xmlMemBlocks()) {
38646 printf("Leak of %d blocks found in xmlUCSIsCatLl",
38647 xmlMemBlocks() - mem_base);
38649 printf(" %d", n_code);
38661 test_xmlUCSIsCatLm(void) {
38664 #if defined(LIBXML_UNICODE_ENABLED)
38667 int code; /* UCS code point */
38670 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38671 mem_base = xmlMemBlocks();
38672 code = gen_int(n_code, 0);
38674 ret_val = xmlUCSIsCatLm(code);
38675 desret_int(ret_val);
38677 des_int(n_code, code, 0);
38678 xmlResetLastError();
38679 if (mem_base != xmlMemBlocks()) {
38680 printf("Leak of %d blocks found in xmlUCSIsCatLm",
38681 xmlMemBlocks() - mem_base);
38683 printf(" %d", n_code);
38695 test_xmlUCSIsCatLo(void) {
38698 #if defined(LIBXML_UNICODE_ENABLED)
38701 int code; /* UCS code point */
38704 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38705 mem_base = xmlMemBlocks();
38706 code = gen_int(n_code, 0);
38708 ret_val = xmlUCSIsCatLo(code);
38709 desret_int(ret_val);
38711 des_int(n_code, code, 0);
38712 xmlResetLastError();
38713 if (mem_base != xmlMemBlocks()) {
38714 printf("Leak of %d blocks found in xmlUCSIsCatLo",
38715 xmlMemBlocks() - mem_base);
38717 printf(" %d", n_code);
38729 test_xmlUCSIsCatLt(void) {
38732 #if defined(LIBXML_UNICODE_ENABLED)
38735 int code; /* UCS code point */
38738 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38739 mem_base = xmlMemBlocks();
38740 code = gen_int(n_code, 0);
38742 ret_val = xmlUCSIsCatLt(code);
38743 desret_int(ret_val);
38745 des_int(n_code, code, 0);
38746 xmlResetLastError();
38747 if (mem_base != xmlMemBlocks()) {
38748 printf("Leak of %d blocks found in xmlUCSIsCatLt",
38749 xmlMemBlocks() - mem_base);
38751 printf(" %d", n_code);
38763 test_xmlUCSIsCatLu(void) {
38766 #if defined(LIBXML_UNICODE_ENABLED)
38769 int code; /* UCS code point */
38772 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38773 mem_base = xmlMemBlocks();
38774 code = gen_int(n_code, 0);
38776 ret_val = xmlUCSIsCatLu(code);
38777 desret_int(ret_val);
38779 des_int(n_code, code, 0);
38780 xmlResetLastError();
38781 if (mem_base != xmlMemBlocks()) {
38782 printf("Leak of %d blocks found in xmlUCSIsCatLu",
38783 xmlMemBlocks() - mem_base);
38785 printf(" %d", n_code);
38797 test_xmlUCSIsCatM(void) {
38800 #if defined(LIBXML_UNICODE_ENABLED)
38803 int code; /* UCS code point */
38806 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38807 mem_base = xmlMemBlocks();
38808 code = gen_int(n_code, 0);
38810 ret_val = xmlUCSIsCatM(code);
38811 desret_int(ret_val);
38813 des_int(n_code, code, 0);
38814 xmlResetLastError();
38815 if (mem_base != xmlMemBlocks()) {
38816 printf("Leak of %d blocks found in xmlUCSIsCatM",
38817 xmlMemBlocks() - mem_base);
38819 printf(" %d", n_code);
38831 test_xmlUCSIsCatMc(void) {
38834 #if defined(LIBXML_UNICODE_ENABLED)
38837 int code; /* UCS code point */
38840 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38841 mem_base = xmlMemBlocks();
38842 code = gen_int(n_code, 0);
38844 ret_val = xmlUCSIsCatMc(code);
38845 desret_int(ret_val);
38847 des_int(n_code, code, 0);
38848 xmlResetLastError();
38849 if (mem_base != xmlMemBlocks()) {
38850 printf("Leak of %d blocks found in xmlUCSIsCatMc",
38851 xmlMemBlocks() - mem_base);
38853 printf(" %d", n_code);
38865 test_xmlUCSIsCatMe(void) {
38868 #if defined(LIBXML_UNICODE_ENABLED)
38871 int code; /* UCS code point */
38874 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38875 mem_base = xmlMemBlocks();
38876 code = gen_int(n_code, 0);
38878 ret_val = xmlUCSIsCatMe(code);
38879 desret_int(ret_val);
38881 des_int(n_code, code, 0);
38882 xmlResetLastError();
38883 if (mem_base != xmlMemBlocks()) {
38884 printf("Leak of %d blocks found in xmlUCSIsCatMe",
38885 xmlMemBlocks() - mem_base);
38887 printf(" %d", n_code);
38899 test_xmlUCSIsCatMn(void) {
38902 #if defined(LIBXML_UNICODE_ENABLED)
38905 int code; /* UCS code point */
38908 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38909 mem_base = xmlMemBlocks();
38910 code = gen_int(n_code, 0);
38912 ret_val = xmlUCSIsCatMn(code);
38913 desret_int(ret_val);
38915 des_int(n_code, code, 0);
38916 xmlResetLastError();
38917 if (mem_base != xmlMemBlocks()) {
38918 printf("Leak of %d blocks found in xmlUCSIsCatMn",
38919 xmlMemBlocks() - mem_base);
38921 printf(" %d", n_code);
38933 test_xmlUCSIsCatN(void) {
38936 #if defined(LIBXML_UNICODE_ENABLED)
38939 int code; /* UCS code point */
38942 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38943 mem_base = xmlMemBlocks();
38944 code = gen_int(n_code, 0);
38946 ret_val = xmlUCSIsCatN(code);
38947 desret_int(ret_val);
38949 des_int(n_code, code, 0);
38950 xmlResetLastError();
38951 if (mem_base != xmlMemBlocks()) {
38952 printf("Leak of %d blocks found in xmlUCSIsCatN",
38953 xmlMemBlocks() - mem_base);
38955 printf(" %d", n_code);
38967 test_xmlUCSIsCatNd(void) {
38970 #if defined(LIBXML_UNICODE_ENABLED)
38973 int code; /* UCS code point */
38976 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38977 mem_base = xmlMemBlocks();
38978 code = gen_int(n_code, 0);
38980 ret_val = xmlUCSIsCatNd(code);
38981 desret_int(ret_val);
38983 des_int(n_code, code, 0);
38984 xmlResetLastError();
38985 if (mem_base != xmlMemBlocks()) {
38986 printf("Leak of %d blocks found in xmlUCSIsCatNd",
38987 xmlMemBlocks() - mem_base);
38989 printf(" %d", n_code);
39001 test_xmlUCSIsCatNl(void) {
39004 #if defined(LIBXML_UNICODE_ENABLED)
39007 int code; /* UCS code point */
39010 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39011 mem_base = xmlMemBlocks();
39012 code = gen_int(n_code, 0);
39014 ret_val = xmlUCSIsCatNl(code);
39015 desret_int(ret_val);
39017 des_int(n_code, code, 0);
39018 xmlResetLastError();
39019 if (mem_base != xmlMemBlocks()) {
39020 printf("Leak of %d blocks found in xmlUCSIsCatNl",
39021 xmlMemBlocks() - mem_base);
39023 printf(" %d", n_code);
39035 test_xmlUCSIsCatNo(void) {
39038 #if defined(LIBXML_UNICODE_ENABLED)
39041 int code; /* UCS code point */
39044 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39045 mem_base = xmlMemBlocks();
39046 code = gen_int(n_code, 0);
39048 ret_val = xmlUCSIsCatNo(code);
39049 desret_int(ret_val);
39051 des_int(n_code, code, 0);
39052 xmlResetLastError();
39053 if (mem_base != xmlMemBlocks()) {
39054 printf("Leak of %d blocks found in xmlUCSIsCatNo",
39055 xmlMemBlocks() - mem_base);
39057 printf(" %d", n_code);
39069 test_xmlUCSIsCatP(void) {
39072 #if defined(LIBXML_UNICODE_ENABLED)
39075 int code; /* UCS code point */
39078 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39079 mem_base = xmlMemBlocks();
39080 code = gen_int(n_code, 0);
39082 ret_val = xmlUCSIsCatP(code);
39083 desret_int(ret_val);
39085 des_int(n_code, code, 0);
39086 xmlResetLastError();
39087 if (mem_base != xmlMemBlocks()) {
39088 printf("Leak of %d blocks found in xmlUCSIsCatP",
39089 xmlMemBlocks() - mem_base);
39091 printf(" %d", n_code);
39103 test_xmlUCSIsCatPc(void) {
39106 #if defined(LIBXML_UNICODE_ENABLED)
39109 int code; /* UCS code point */
39112 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39113 mem_base = xmlMemBlocks();
39114 code = gen_int(n_code, 0);
39116 ret_val = xmlUCSIsCatPc(code);
39117 desret_int(ret_val);
39119 des_int(n_code, code, 0);
39120 xmlResetLastError();
39121 if (mem_base != xmlMemBlocks()) {
39122 printf("Leak of %d blocks found in xmlUCSIsCatPc",
39123 xmlMemBlocks() - mem_base);
39125 printf(" %d", n_code);
39137 test_xmlUCSIsCatPd(void) {
39140 #if defined(LIBXML_UNICODE_ENABLED)
39143 int code; /* UCS code point */
39146 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39147 mem_base = xmlMemBlocks();
39148 code = gen_int(n_code, 0);
39150 ret_val = xmlUCSIsCatPd(code);
39151 desret_int(ret_val);
39153 des_int(n_code, code, 0);
39154 xmlResetLastError();
39155 if (mem_base != xmlMemBlocks()) {
39156 printf("Leak of %d blocks found in xmlUCSIsCatPd",
39157 xmlMemBlocks() - mem_base);
39159 printf(" %d", n_code);
39171 test_xmlUCSIsCatPe(void) {
39174 #if defined(LIBXML_UNICODE_ENABLED)
39177 int code; /* UCS code point */
39180 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39181 mem_base = xmlMemBlocks();
39182 code = gen_int(n_code, 0);
39184 ret_val = xmlUCSIsCatPe(code);
39185 desret_int(ret_val);
39187 des_int(n_code, code, 0);
39188 xmlResetLastError();
39189 if (mem_base != xmlMemBlocks()) {
39190 printf("Leak of %d blocks found in xmlUCSIsCatPe",
39191 xmlMemBlocks() - mem_base);
39193 printf(" %d", n_code);
39205 test_xmlUCSIsCatPf(void) {
39208 #if defined(LIBXML_UNICODE_ENABLED)
39211 int code; /* UCS code point */
39214 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39215 mem_base = xmlMemBlocks();
39216 code = gen_int(n_code, 0);
39218 ret_val = xmlUCSIsCatPf(code);
39219 desret_int(ret_val);
39221 des_int(n_code, code, 0);
39222 xmlResetLastError();
39223 if (mem_base != xmlMemBlocks()) {
39224 printf("Leak of %d blocks found in xmlUCSIsCatPf",
39225 xmlMemBlocks() - mem_base);
39227 printf(" %d", n_code);
39239 test_xmlUCSIsCatPi(void) {
39242 #if defined(LIBXML_UNICODE_ENABLED)
39245 int code; /* UCS code point */
39248 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39249 mem_base = xmlMemBlocks();
39250 code = gen_int(n_code, 0);
39252 ret_val = xmlUCSIsCatPi(code);
39253 desret_int(ret_val);
39255 des_int(n_code, code, 0);
39256 xmlResetLastError();
39257 if (mem_base != xmlMemBlocks()) {
39258 printf("Leak of %d blocks found in xmlUCSIsCatPi",
39259 xmlMemBlocks() - mem_base);
39261 printf(" %d", n_code);
39273 test_xmlUCSIsCatPo(void) {
39276 #if defined(LIBXML_UNICODE_ENABLED)
39279 int code; /* UCS code point */
39282 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39283 mem_base = xmlMemBlocks();
39284 code = gen_int(n_code, 0);
39286 ret_val = xmlUCSIsCatPo(code);
39287 desret_int(ret_val);
39289 des_int(n_code, code, 0);
39290 xmlResetLastError();
39291 if (mem_base != xmlMemBlocks()) {
39292 printf("Leak of %d blocks found in xmlUCSIsCatPo",
39293 xmlMemBlocks() - mem_base);
39295 printf(" %d", n_code);
39307 test_xmlUCSIsCatPs(void) {
39310 #if defined(LIBXML_UNICODE_ENABLED)
39313 int code; /* UCS code point */
39316 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39317 mem_base = xmlMemBlocks();
39318 code = gen_int(n_code, 0);
39320 ret_val = xmlUCSIsCatPs(code);
39321 desret_int(ret_val);
39323 des_int(n_code, code, 0);
39324 xmlResetLastError();
39325 if (mem_base != xmlMemBlocks()) {
39326 printf("Leak of %d blocks found in xmlUCSIsCatPs",
39327 xmlMemBlocks() - mem_base);
39329 printf(" %d", n_code);
39341 test_xmlUCSIsCatS(void) {
39344 #if defined(LIBXML_UNICODE_ENABLED)
39347 int code; /* UCS code point */
39350 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39351 mem_base = xmlMemBlocks();
39352 code = gen_int(n_code, 0);
39354 ret_val = xmlUCSIsCatS(code);
39355 desret_int(ret_val);
39357 des_int(n_code, code, 0);
39358 xmlResetLastError();
39359 if (mem_base != xmlMemBlocks()) {
39360 printf("Leak of %d blocks found in xmlUCSIsCatS",
39361 xmlMemBlocks() - mem_base);
39363 printf(" %d", n_code);
39375 test_xmlUCSIsCatSc(void) {
39378 #if defined(LIBXML_UNICODE_ENABLED)
39381 int code; /* UCS code point */
39384 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39385 mem_base = xmlMemBlocks();
39386 code = gen_int(n_code, 0);
39388 ret_val = xmlUCSIsCatSc(code);
39389 desret_int(ret_val);
39391 des_int(n_code, code, 0);
39392 xmlResetLastError();
39393 if (mem_base != xmlMemBlocks()) {
39394 printf("Leak of %d blocks found in xmlUCSIsCatSc",
39395 xmlMemBlocks() - mem_base);
39397 printf(" %d", n_code);
39409 test_xmlUCSIsCatSk(void) {
39412 #if defined(LIBXML_UNICODE_ENABLED)
39415 int code; /* UCS code point */
39418 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39419 mem_base = xmlMemBlocks();
39420 code = gen_int(n_code, 0);
39422 ret_val = xmlUCSIsCatSk(code);
39423 desret_int(ret_val);
39425 des_int(n_code, code, 0);
39426 xmlResetLastError();
39427 if (mem_base != xmlMemBlocks()) {
39428 printf("Leak of %d blocks found in xmlUCSIsCatSk",
39429 xmlMemBlocks() - mem_base);
39431 printf(" %d", n_code);
39443 test_xmlUCSIsCatSm(void) {
39446 #if defined(LIBXML_UNICODE_ENABLED)
39449 int code; /* UCS code point */
39452 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39453 mem_base = xmlMemBlocks();
39454 code = gen_int(n_code, 0);
39456 ret_val = xmlUCSIsCatSm(code);
39457 desret_int(ret_val);
39459 des_int(n_code, code, 0);
39460 xmlResetLastError();
39461 if (mem_base != xmlMemBlocks()) {
39462 printf("Leak of %d blocks found in xmlUCSIsCatSm",
39463 xmlMemBlocks() - mem_base);
39465 printf(" %d", n_code);
39477 test_xmlUCSIsCatSo(void) {
39480 #if defined(LIBXML_UNICODE_ENABLED)
39483 int code; /* UCS code point */
39486 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39487 mem_base = xmlMemBlocks();
39488 code = gen_int(n_code, 0);
39490 ret_val = xmlUCSIsCatSo(code);
39491 desret_int(ret_val);
39493 des_int(n_code, code, 0);
39494 xmlResetLastError();
39495 if (mem_base != xmlMemBlocks()) {
39496 printf("Leak of %d blocks found in xmlUCSIsCatSo",
39497 xmlMemBlocks() - mem_base);
39499 printf(" %d", n_code);
39511 test_xmlUCSIsCatZ(void) {
39514 #if defined(LIBXML_UNICODE_ENABLED)
39517 int code; /* UCS code point */
39520 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39521 mem_base = xmlMemBlocks();
39522 code = gen_int(n_code, 0);
39524 ret_val = xmlUCSIsCatZ(code);
39525 desret_int(ret_val);
39527 des_int(n_code, code, 0);
39528 xmlResetLastError();
39529 if (mem_base != xmlMemBlocks()) {
39530 printf("Leak of %d blocks found in xmlUCSIsCatZ",
39531 xmlMemBlocks() - mem_base);
39533 printf(" %d", n_code);
39545 test_xmlUCSIsCatZl(void) {
39548 #if defined(LIBXML_UNICODE_ENABLED)
39551 int code; /* UCS code point */
39554 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39555 mem_base = xmlMemBlocks();
39556 code = gen_int(n_code, 0);
39558 ret_val = xmlUCSIsCatZl(code);
39559 desret_int(ret_val);
39561 des_int(n_code, code, 0);
39562 xmlResetLastError();
39563 if (mem_base != xmlMemBlocks()) {
39564 printf("Leak of %d blocks found in xmlUCSIsCatZl",
39565 xmlMemBlocks() - mem_base);
39567 printf(" %d", n_code);
39579 test_xmlUCSIsCatZp(void) {
39582 #if defined(LIBXML_UNICODE_ENABLED)
39585 int code; /* UCS code point */
39588 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39589 mem_base = xmlMemBlocks();
39590 code = gen_int(n_code, 0);
39592 ret_val = xmlUCSIsCatZp(code);
39593 desret_int(ret_val);
39595 des_int(n_code, code, 0);
39596 xmlResetLastError();
39597 if (mem_base != xmlMemBlocks()) {
39598 printf("Leak of %d blocks found in xmlUCSIsCatZp",
39599 xmlMemBlocks() - mem_base);
39601 printf(" %d", n_code);
39613 test_xmlUCSIsCatZs(void) {
39616 #if defined(LIBXML_UNICODE_ENABLED)
39619 int code; /* UCS code point */
39622 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39623 mem_base = xmlMemBlocks();
39624 code = gen_int(n_code, 0);
39626 ret_val = xmlUCSIsCatZs(code);
39627 desret_int(ret_val);
39629 des_int(n_code, code, 0);
39630 xmlResetLastError();
39631 if (mem_base != xmlMemBlocks()) {
39632 printf("Leak of %d blocks found in xmlUCSIsCatZs",
39633 xmlMemBlocks() - mem_base);
39635 printf(" %d", n_code);
39647 test_xmlUCSIsCherokee(void) {
39650 #if defined(LIBXML_UNICODE_ENABLED)
39653 int code; /* UCS code point */
39656 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39657 mem_base = xmlMemBlocks();
39658 code = gen_int(n_code, 0);
39660 ret_val = xmlUCSIsCherokee(code);
39661 desret_int(ret_val);
39663 des_int(n_code, code, 0);
39664 xmlResetLastError();
39665 if (mem_base != xmlMemBlocks()) {
39666 printf("Leak of %d blocks found in xmlUCSIsCherokee",
39667 xmlMemBlocks() - mem_base);
39669 printf(" %d", n_code);
39681 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39684 #if defined(LIBXML_UNICODE_ENABLED)
39687 int code; /* UCS code point */
39690 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39691 mem_base = xmlMemBlocks();
39692 code = gen_int(n_code, 0);
39694 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39695 desret_int(ret_val);
39697 des_int(n_code, code, 0);
39698 xmlResetLastError();
39699 if (mem_base != xmlMemBlocks()) {
39700 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39701 xmlMemBlocks() - mem_base);
39703 printf(" %d", n_code);
39715 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39718 #if defined(LIBXML_UNICODE_ENABLED)
39721 int code; /* UCS code point */
39724 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39725 mem_base = xmlMemBlocks();
39726 code = gen_int(n_code, 0);
39728 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39729 desret_int(ret_val);
39731 des_int(n_code, code, 0);
39732 xmlResetLastError();
39733 if (mem_base != xmlMemBlocks()) {
39734 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39735 xmlMemBlocks() - mem_base);
39737 printf(" %d", n_code);
39749 test_xmlUCSIsCombiningHalfMarks(void) {
39752 #if defined(LIBXML_UNICODE_ENABLED)
39755 int code; /* UCS code point */
39758 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39759 mem_base = xmlMemBlocks();
39760 code = gen_int(n_code, 0);
39762 ret_val = xmlUCSIsCombiningHalfMarks(code);
39763 desret_int(ret_val);
39765 des_int(n_code, code, 0);
39766 xmlResetLastError();
39767 if (mem_base != xmlMemBlocks()) {
39768 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39769 xmlMemBlocks() - mem_base);
39771 printf(" %d", n_code);
39783 test_xmlUCSIsCombiningMarksforSymbols(void) {
39786 #if defined(LIBXML_UNICODE_ENABLED)
39789 int code; /* UCS code point */
39792 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39793 mem_base = xmlMemBlocks();
39794 code = gen_int(n_code, 0);
39796 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39797 desret_int(ret_val);
39799 des_int(n_code, code, 0);
39800 xmlResetLastError();
39801 if (mem_base != xmlMemBlocks()) {
39802 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39803 xmlMemBlocks() - mem_base);
39805 printf(" %d", n_code);
39817 test_xmlUCSIsControlPictures(void) {
39820 #if defined(LIBXML_UNICODE_ENABLED)
39823 int code; /* UCS code point */
39826 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39827 mem_base = xmlMemBlocks();
39828 code = gen_int(n_code, 0);
39830 ret_val = xmlUCSIsControlPictures(code);
39831 desret_int(ret_val);
39833 des_int(n_code, code, 0);
39834 xmlResetLastError();
39835 if (mem_base != xmlMemBlocks()) {
39836 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39837 xmlMemBlocks() - mem_base);
39839 printf(" %d", n_code);
39851 test_xmlUCSIsCurrencySymbols(void) {
39854 #if defined(LIBXML_UNICODE_ENABLED)
39857 int code; /* UCS code point */
39860 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39861 mem_base = xmlMemBlocks();
39862 code = gen_int(n_code, 0);
39864 ret_val = xmlUCSIsCurrencySymbols(code);
39865 desret_int(ret_val);
39867 des_int(n_code, code, 0);
39868 xmlResetLastError();
39869 if (mem_base != xmlMemBlocks()) {
39870 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39871 xmlMemBlocks() - mem_base);
39873 printf(" %d", n_code);
39885 test_xmlUCSIsCypriotSyllabary(void) {
39888 #if defined(LIBXML_UNICODE_ENABLED)
39891 int code; /* UCS code point */
39894 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39895 mem_base = xmlMemBlocks();
39896 code = gen_int(n_code, 0);
39898 ret_val = xmlUCSIsCypriotSyllabary(code);
39899 desret_int(ret_val);
39901 des_int(n_code, code, 0);
39902 xmlResetLastError();
39903 if (mem_base != xmlMemBlocks()) {
39904 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39905 xmlMemBlocks() - mem_base);
39907 printf(" %d", n_code);
39919 test_xmlUCSIsCyrillic(void) {
39922 #if defined(LIBXML_UNICODE_ENABLED)
39925 int code; /* UCS code point */
39928 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39929 mem_base = xmlMemBlocks();
39930 code = gen_int(n_code, 0);
39932 ret_val = xmlUCSIsCyrillic(code);
39933 desret_int(ret_val);
39935 des_int(n_code, code, 0);
39936 xmlResetLastError();
39937 if (mem_base != xmlMemBlocks()) {
39938 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39939 xmlMemBlocks() - mem_base);
39941 printf(" %d", n_code);
39953 test_xmlUCSIsCyrillicSupplement(void) {
39956 #if defined(LIBXML_UNICODE_ENABLED)
39959 int code; /* UCS code point */
39962 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39963 mem_base = xmlMemBlocks();
39964 code = gen_int(n_code, 0);
39966 ret_val = xmlUCSIsCyrillicSupplement(code);
39967 desret_int(ret_val);
39969 des_int(n_code, code, 0);
39970 xmlResetLastError();
39971 if (mem_base != xmlMemBlocks()) {
39972 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39973 xmlMemBlocks() - mem_base);
39975 printf(" %d", n_code);
39987 test_xmlUCSIsDeseret(void) {
39990 #if defined(LIBXML_UNICODE_ENABLED)
39993 int code; /* UCS code point */
39996 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39997 mem_base = xmlMemBlocks();
39998 code = gen_int(n_code, 0);
40000 ret_val = xmlUCSIsDeseret(code);
40001 desret_int(ret_val);
40003 des_int(n_code, code, 0);
40004 xmlResetLastError();
40005 if (mem_base != xmlMemBlocks()) {
40006 printf("Leak of %d blocks found in xmlUCSIsDeseret",
40007 xmlMemBlocks() - mem_base);
40009 printf(" %d", n_code);
40021 test_xmlUCSIsDevanagari(void) {
40024 #if defined(LIBXML_UNICODE_ENABLED)
40027 int code; /* UCS code point */
40030 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40031 mem_base = xmlMemBlocks();
40032 code = gen_int(n_code, 0);
40034 ret_val = xmlUCSIsDevanagari(code);
40035 desret_int(ret_val);
40037 des_int(n_code, code, 0);
40038 xmlResetLastError();
40039 if (mem_base != xmlMemBlocks()) {
40040 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
40041 xmlMemBlocks() - mem_base);
40043 printf(" %d", n_code);
40055 test_xmlUCSIsDingbats(void) {
40058 #if defined(LIBXML_UNICODE_ENABLED)
40061 int code; /* UCS code point */
40064 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40065 mem_base = xmlMemBlocks();
40066 code = gen_int(n_code, 0);
40068 ret_val = xmlUCSIsDingbats(code);
40069 desret_int(ret_val);
40071 des_int(n_code, code, 0);
40072 xmlResetLastError();
40073 if (mem_base != xmlMemBlocks()) {
40074 printf("Leak of %d blocks found in xmlUCSIsDingbats",
40075 xmlMemBlocks() - mem_base);
40077 printf(" %d", n_code);
40089 test_xmlUCSIsEnclosedAlphanumerics(void) {
40092 #if defined(LIBXML_UNICODE_ENABLED)
40095 int code; /* UCS code point */
40098 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40099 mem_base = xmlMemBlocks();
40100 code = gen_int(n_code, 0);
40102 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
40103 desret_int(ret_val);
40105 des_int(n_code, code, 0);
40106 xmlResetLastError();
40107 if (mem_base != xmlMemBlocks()) {
40108 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
40109 xmlMemBlocks() - mem_base);
40111 printf(" %d", n_code);
40123 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
40126 #if defined(LIBXML_UNICODE_ENABLED)
40129 int code; /* UCS code point */
40132 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40133 mem_base = xmlMemBlocks();
40134 code = gen_int(n_code, 0);
40136 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
40137 desret_int(ret_val);
40139 des_int(n_code, code, 0);
40140 xmlResetLastError();
40141 if (mem_base != xmlMemBlocks()) {
40142 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
40143 xmlMemBlocks() - mem_base);
40145 printf(" %d", n_code);
40157 test_xmlUCSIsEthiopic(void) {
40160 #if defined(LIBXML_UNICODE_ENABLED)
40163 int code; /* UCS code point */
40166 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40167 mem_base = xmlMemBlocks();
40168 code = gen_int(n_code, 0);
40170 ret_val = xmlUCSIsEthiopic(code);
40171 desret_int(ret_val);
40173 des_int(n_code, code, 0);
40174 xmlResetLastError();
40175 if (mem_base != xmlMemBlocks()) {
40176 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
40177 xmlMemBlocks() - mem_base);
40179 printf(" %d", n_code);
40191 test_xmlUCSIsGeneralPunctuation(void) {
40194 #if defined(LIBXML_UNICODE_ENABLED)
40197 int code; /* UCS code point */
40200 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40201 mem_base = xmlMemBlocks();
40202 code = gen_int(n_code, 0);
40204 ret_val = xmlUCSIsGeneralPunctuation(code);
40205 desret_int(ret_val);
40207 des_int(n_code, code, 0);
40208 xmlResetLastError();
40209 if (mem_base != xmlMemBlocks()) {
40210 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40211 xmlMemBlocks() - mem_base);
40213 printf(" %d", n_code);
40225 test_xmlUCSIsGeometricShapes(void) {
40228 #if defined(LIBXML_UNICODE_ENABLED)
40231 int code; /* UCS code point */
40234 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40235 mem_base = xmlMemBlocks();
40236 code = gen_int(n_code, 0);
40238 ret_val = xmlUCSIsGeometricShapes(code);
40239 desret_int(ret_val);
40241 des_int(n_code, code, 0);
40242 xmlResetLastError();
40243 if (mem_base != xmlMemBlocks()) {
40244 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40245 xmlMemBlocks() - mem_base);
40247 printf(" %d", n_code);
40259 test_xmlUCSIsGeorgian(void) {
40262 #if defined(LIBXML_UNICODE_ENABLED)
40265 int code; /* UCS code point */
40268 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40269 mem_base = xmlMemBlocks();
40270 code = gen_int(n_code, 0);
40272 ret_val = xmlUCSIsGeorgian(code);
40273 desret_int(ret_val);
40275 des_int(n_code, code, 0);
40276 xmlResetLastError();
40277 if (mem_base != xmlMemBlocks()) {
40278 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40279 xmlMemBlocks() - mem_base);
40281 printf(" %d", n_code);
40293 test_xmlUCSIsGothic(void) {
40296 #if defined(LIBXML_UNICODE_ENABLED)
40299 int code; /* UCS code point */
40302 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40303 mem_base = xmlMemBlocks();
40304 code = gen_int(n_code, 0);
40306 ret_val = xmlUCSIsGothic(code);
40307 desret_int(ret_val);
40309 des_int(n_code, code, 0);
40310 xmlResetLastError();
40311 if (mem_base != xmlMemBlocks()) {
40312 printf("Leak of %d blocks found in xmlUCSIsGothic",
40313 xmlMemBlocks() - mem_base);
40315 printf(" %d", n_code);
40327 test_xmlUCSIsGreek(void) {
40330 #if defined(LIBXML_UNICODE_ENABLED)
40333 int code; /* UCS code point */
40336 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40337 mem_base = xmlMemBlocks();
40338 code = gen_int(n_code, 0);
40340 ret_val = xmlUCSIsGreek(code);
40341 desret_int(ret_val);
40343 des_int(n_code, code, 0);
40344 xmlResetLastError();
40345 if (mem_base != xmlMemBlocks()) {
40346 printf("Leak of %d blocks found in xmlUCSIsGreek",
40347 xmlMemBlocks() - mem_base);
40349 printf(" %d", n_code);
40361 test_xmlUCSIsGreekExtended(void) {
40364 #if defined(LIBXML_UNICODE_ENABLED)
40367 int code; /* UCS code point */
40370 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40371 mem_base = xmlMemBlocks();
40372 code = gen_int(n_code, 0);
40374 ret_val = xmlUCSIsGreekExtended(code);
40375 desret_int(ret_val);
40377 des_int(n_code, code, 0);
40378 xmlResetLastError();
40379 if (mem_base != xmlMemBlocks()) {
40380 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40381 xmlMemBlocks() - mem_base);
40383 printf(" %d", n_code);
40395 test_xmlUCSIsGreekandCoptic(void) {
40398 #if defined(LIBXML_UNICODE_ENABLED)
40401 int code; /* UCS code point */
40404 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40405 mem_base = xmlMemBlocks();
40406 code = gen_int(n_code, 0);
40408 ret_val = xmlUCSIsGreekandCoptic(code);
40409 desret_int(ret_val);
40411 des_int(n_code, code, 0);
40412 xmlResetLastError();
40413 if (mem_base != xmlMemBlocks()) {
40414 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40415 xmlMemBlocks() - mem_base);
40417 printf(" %d", n_code);
40429 test_xmlUCSIsGujarati(void) {
40432 #if defined(LIBXML_UNICODE_ENABLED)
40435 int code; /* UCS code point */
40438 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40439 mem_base = xmlMemBlocks();
40440 code = gen_int(n_code, 0);
40442 ret_val = xmlUCSIsGujarati(code);
40443 desret_int(ret_val);
40445 des_int(n_code, code, 0);
40446 xmlResetLastError();
40447 if (mem_base != xmlMemBlocks()) {
40448 printf("Leak of %d blocks found in xmlUCSIsGujarati",
40449 xmlMemBlocks() - mem_base);
40451 printf(" %d", n_code);
40463 test_xmlUCSIsGurmukhi(void) {
40466 #if defined(LIBXML_UNICODE_ENABLED)
40469 int code; /* UCS code point */
40472 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40473 mem_base = xmlMemBlocks();
40474 code = gen_int(n_code, 0);
40476 ret_val = xmlUCSIsGurmukhi(code);
40477 desret_int(ret_val);
40479 des_int(n_code, code, 0);
40480 xmlResetLastError();
40481 if (mem_base != xmlMemBlocks()) {
40482 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40483 xmlMemBlocks() - mem_base);
40485 printf(" %d", n_code);
40497 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40500 #if defined(LIBXML_UNICODE_ENABLED)
40503 int code; /* UCS code point */
40506 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40507 mem_base = xmlMemBlocks();
40508 code = gen_int(n_code, 0);
40510 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40511 desret_int(ret_val);
40513 des_int(n_code, code, 0);
40514 xmlResetLastError();
40515 if (mem_base != xmlMemBlocks()) {
40516 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40517 xmlMemBlocks() - mem_base);
40519 printf(" %d", n_code);
40531 test_xmlUCSIsHangulCompatibilityJamo(void) {
40534 #if defined(LIBXML_UNICODE_ENABLED)
40537 int code; /* UCS code point */
40540 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40541 mem_base = xmlMemBlocks();
40542 code = gen_int(n_code, 0);
40544 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40545 desret_int(ret_val);
40547 des_int(n_code, code, 0);
40548 xmlResetLastError();
40549 if (mem_base != xmlMemBlocks()) {
40550 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40551 xmlMemBlocks() - mem_base);
40553 printf(" %d", n_code);
40565 test_xmlUCSIsHangulJamo(void) {
40568 #if defined(LIBXML_UNICODE_ENABLED)
40571 int code; /* UCS code point */
40574 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40575 mem_base = xmlMemBlocks();
40576 code = gen_int(n_code, 0);
40578 ret_val = xmlUCSIsHangulJamo(code);
40579 desret_int(ret_val);
40581 des_int(n_code, code, 0);
40582 xmlResetLastError();
40583 if (mem_base != xmlMemBlocks()) {
40584 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40585 xmlMemBlocks() - mem_base);
40587 printf(" %d", n_code);
40599 test_xmlUCSIsHangulSyllables(void) {
40602 #if defined(LIBXML_UNICODE_ENABLED)
40605 int code; /* UCS code point */
40608 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40609 mem_base = xmlMemBlocks();
40610 code = gen_int(n_code, 0);
40612 ret_val = xmlUCSIsHangulSyllables(code);
40613 desret_int(ret_val);
40615 des_int(n_code, code, 0);
40616 xmlResetLastError();
40617 if (mem_base != xmlMemBlocks()) {
40618 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40619 xmlMemBlocks() - mem_base);
40621 printf(" %d", n_code);
40633 test_xmlUCSIsHanunoo(void) {
40636 #if defined(LIBXML_UNICODE_ENABLED)
40639 int code; /* UCS code point */
40642 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40643 mem_base = xmlMemBlocks();
40644 code = gen_int(n_code, 0);
40646 ret_val = xmlUCSIsHanunoo(code);
40647 desret_int(ret_val);
40649 des_int(n_code, code, 0);
40650 xmlResetLastError();
40651 if (mem_base != xmlMemBlocks()) {
40652 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40653 xmlMemBlocks() - mem_base);
40655 printf(" %d", n_code);
40667 test_xmlUCSIsHebrew(void) {
40670 #if defined(LIBXML_UNICODE_ENABLED)
40673 int code; /* UCS code point */
40676 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40677 mem_base = xmlMemBlocks();
40678 code = gen_int(n_code, 0);
40680 ret_val = xmlUCSIsHebrew(code);
40681 desret_int(ret_val);
40683 des_int(n_code, code, 0);
40684 xmlResetLastError();
40685 if (mem_base != xmlMemBlocks()) {
40686 printf("Leak of %d blocks found in xmlUCSIsHebrew",
40687 xmlMemBlocks() - mem_base);
40689 printf(" %d", n_code);
40701 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40704 #if defined(LIBXML_UNICODE_ENABLED)
40707 int code; /* UCS code point */
40710 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40711 mem_base = xmlMemBlocks();
40712 code = gen_int(n_code, 0);
40714 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40715 desret_int(ret_val);
40717 des_int(n_code, code, 0);
40718 xmlResetLastError();
40719 if (mem_base != xmlMemBlocks()) {
40720 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40721 xmlMemBlocks() - mem_base);
40723 printf(" %d", n_code);
40735 test_xmlUCSIsHighSurrogates(void) {
40738 #if defined(LIBXML_UNICODE_ENABLED)
40741 int code; /* UCS code point */
40744 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40745 mem_base = xmlMemBlocks();
40746 code = gen_int(n_code, 0);
40748 ret_val = xmlUCSIsHighSurrogates(code);
40749 desret_int(ret_val);
40751 des_int(n_code, code, 0);
40752 xmlResetLastError();
40753 if (mem_base != xmlMemBlocks()) {
40754 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40755 xmlMemBlocks() - mem_base);
40757 printf(" %d", n_code);
40769 test_xmlUCSIsHiragana(void) {
40772 #if defined(LIBXML_UNICODE_ENABLED)
40775 int code; /* UCS code point */
40778 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40779 mem_base = xmlMemBlocks();
40780 code = gen_int(n_code, 0);
40782 ret_val = xmlUCSIsHiragana(code);
40783 desret_int(ret_val);
40785 des_int(n_code, code, 0);
40786 xmlResetLastError();
40787 if (mem_base != xmlMemBlocks()) {
40788 printf("Leak of %d blocks found in xmlUCSIsHiragana",
40789 xmlMemBlocks() - mem_base);
40791 printf(" %d", n_code);
40803 test_xmlUCSIsIPAExtensions(void) {
40806 #if defined(LIBXML_UNICODE_ENABLED)
40809 int code; /* UCS code point */
40812 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40813 mem_base = xmlMemBlocks();
40814 code = gen_int(n_code, 0);
40816 ret_val = xmlUCSIsIPAExtensions(code);
40817 desret_int(ret_val);
40819 des_int(n_code, code, 0);
40820 xmlResetLastError();
40821 if (mem_base != xmlMemBlocks()) {
40822 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40823 xmlMemBlocks() - mem_base);
40825 printf(" %d", n_code);
40837 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40840 #if defined(LIBXML_UNICODE_ENABLED)
40843 int code; /* UCS code point */
40846 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40847 mem_base = xmlMemBlocks();
40848 code = gen_int(n_code, 0);
40850 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40851 desret_int(ret_val);
40853 des_int(n_code, code, 0);
40854 xmlResetLastError();
40855 if (mem_base != xmlMemBlocks()) {
40856 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40857 xmlMemBlocks() - mem_base);
40859 printf(" %d", n_code);
40871 test_xmlUCSIsKanbun(void) {
40874 #if defined(LIBXML_UNICODE_ENABLED)
40877 int code; /* UCS code point */
40880 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40881 mem_base = xmlMemBlocks();
40882 code = gen_int(n_code, 0);
40884 ret_val = xmlUCSIsKanbun(code);
40885 desret_int(ret_val);
40887 des_int(n_code, code, 0);
40888 xmlResetLastError();
40889 if (mem_base != xmlMemBlocks()) {
40890 printf("Leak of %d blocks found in xmlUCSIsKanbun",
40891 xmlMemBlocks() - mem_base);
40893 printf(" %d", n_code);
40905 test_xmlUCSIsKangxiRadicals(void) {
40908 #if defined(LIBXML_UNICODE_ENABLED)
40911 int code; /* UCS code point */
40914 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40915 mem_base = xmlMemBlocks();
40916 code = gen_int(n_code, 0);
40918 ret_val = xmlUCSIsKangxiRadicals(code);
40919 desret_int(ret_val);
40921 des_int(n_code, code, 0);
40922 xmlResetLastError();
40923 if (mem_base != xmlMemBlocks()) {
40924 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40925 xmlMemBlocks() - mem_base);
40927 printf(" %d", n_code);
40939 test_xmlUCSIsKannada(void) {
40942 #if defined(LIBXML_UNICODE_ENABLED)
40945 int code; /* UCS code point */
40948 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40949 mem_base = xmlMemBlocks();
40950 code = gen_int(n_code, 0);
40952 ret_val = xmlUCSIsKannada(code);
40953 desret_int(ret_val);
40955 des_int(n_code, code, 0);
40956 xmlResetLastError();
40957 if (mem_base != xmlMemBlocks()) {
40958 printf("Leak of %d blocks found in xmlUCSIsKannada",
40959 xmlMemBlocks() - mem_base);
40961 printf(" %d", n_code);
40973 test_xmlUCSIsKatakana(void) {
40976 #if defined(LIBXML_UNICODE_ENABLED)
40979 int code; /* UCS code point */
40982 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40983 mem_base = xmlMemBlocks();
40984 code = gen_int(n_code, 0);
40986 ret_val = xmlUCSIsKatakana(code);
40987 desret_int(ret_val);
40989 des_int(n_code, code, 0);
40990 xmlResetLastError();
40991 if (mem_base != xmlMemBlocks()) {
40992 printf("Leak of %d blocks found in xmlUCSIsKatakana",
40993 xmlMemBlocks() - mem_base);
40995 printf(" %d", n_code);
41007 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
41010 #if defined(LIBXML_UNICODE_ENABLED)
41013 int code; /* UCS code point */
41016 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41017 mem_base = xmlMemBlocks();
41018 code = gen_int(n_code, 0);
41020 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
41021 desret_int(ret_val);
41023 des_int(n_code, code, 0);
41024 xmlResetLastError();
41025 if (mem_base != xmlMemBlocks()) {
41026 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
41027 xmlMemBlocks() - mem_base);
41029 printf(" %d", n_code);
41041 test_xmlUCSIsKhmer(void) {
41044 #if defined(LIBXML_UNICODE_ENABLED)
41047 int code; /* UCS code point */
41050 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41051 mem_base = xmlMemBlocks();
41052 code = gen_int(n_code, 0);
41054 ret_val = xmlUCSIsKhmer(code);
41055 desret_int(ret_val);
41057 des_int(n_code, code, 0);
41058 xmlResetLastError();
41059 if (mem_base != xmlMemBlocks()) {
41060 printf("Leak of %d blocks found in xmlUCSIsKhmer",
41061 xmlMemBlocks() - mem_base);
41063 printf(" %d", n_code);
41075 test_xmlUCSIsKhmerSymbols(void) {
41078 #if defined(LIBXML_UNICODE_ENABLED)
41081 int code; /* UCS code point */
41084 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41085 mem_base = xmlMemBlocks();
41086 code = gen_int(n_code, 0);
41088 ret_val = xmlUCSIsKhmerSymbols(code);
41089 desret_int(ret_val);
41091 des_int(n_code, code, 0);
41092 xmlResetLastError();
41093 if (mem_base != xmlMemBlocks()) {
41094 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
41095 xmlMemBlocks() - mem_base);
41097 printf(" %d", n_code);
41109 test_xmlUCSIsLao(void) {
41112 #if defined(LIBXML_UNICODE_ENABLED)
41115 int code; /* UCS code point */
41118 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41119 mem_base = xmlMemBlocks();
41120 code = gen_int(n_code, 0);
41122 ret_val = xmlUCSIsLao(code);
41123 desret_int(ret_val);
41125 des_int(n_code, code, 0);
41126 xmlResetLastError();
41127 if (mem_base != xmlMemBlocks()) {
41128 printf("Leak of %d blocks found in xmlUCSIsLao",
41129 xmlMemBlocks() - mem_base);
41131 printf(" %d", n_code);
41143 test_xmlUCSIsLatin1Supplement(void) {
41146 #if defined(LIBXML_UNICODE_ENABLED)
41149 int code; /* UCS code point */
41152 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41153 mem_base = xmlMemBlocks();
41154 code = gen_int(n_code, 0);
41156 ret_val = xmlUCSIsLatin1Supplement(code);
41157 desret_int(ret_val);
41159 des_int(n_code, code, 0);
41160 xmlResetLastError();
41161 if (mem_base != xmlMemBlocks()) {
41162 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
41163 xmlMemBlocks() - mem_base);
41165 printf(" %d", n_code);
41177 test_xmlUCSIsLatinExtendedA(void) {
41180 #if defined(LIBXML_UNICODE_ENABLED)
41183 int code; /* UCS code point */
41186 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41187 mem_base = xmlMemBlocks();
41188 code = gen_int(n_code, 0);
41190 ret_val = xmlUCSIsLatinExtendedA(code);
41191 desret_int(ret_val);
41193 des_int(n_code, code, 0);
41194 xmlResetLastError();
41195 if (mem_base != xmlMemBlocks()) {
41196 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41197 xmlMemBlocks() - mem_base);
41199 printf(" %d", n_code);
41211 test_xmlUCSIsLatinExtendedAdditional(void) {
41214 #if defined(LIBXML_UNICODE_ENABLED)
41217 int code; /* UCS code point */
41220 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41221 mem_base = xmlMemBlocks();
41222 code = gen_int(n_code, 0);
41224 ret_val = xmlUCSIsLatinExtendedAdditional(code);
41225 desret_int(ret_val);
41227 des_int(n_code, code, 0);
41228 xmlResetLastError();
41229 if (mem_base != xmlMemBlocks()) {
41230 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41231 xmlMemBlocks() - mem_base);
41233 printf(" %d", n_code);
41245 test_xmlUCSIsLatinExtendedB(void) {
41248 #if defined(LIBXML_UNICODE_ENABLED)
41251 int code; /* UCS code point */
41254 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41255 mem_base = xmlMemBlocks();
41256 code = gen_int(n_code, 0);
41258 ret_val = xmlUCSIsLatinExtendedB(code);
41259 desret_int(ret_val);
41261 des_int(n_code, code, 0);
41262 xmlResetLastError();
41263 if (mem_base != xmlMemBlocks()) {
41264 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41265 xmlMemBlocks() - mem_base);
41267 printf(" %d", n_code);
41279 test_xmlUCSIsLetterlikeSymbols(void) {
41282 #if defined(LIBXML_UNICODE_ENABLED)
41285 int code; /* UCS code point */
41288 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41289 mem_base = xmlMemBlocks();
41290 code = gen_int(n_code, 0);
41292 ret_val = xmlUCSIsLetterlikeSymbols(code);
41293 desret_int(ret_val);
41295 des_int(n_code, code, 0);
41296 xmlResetLastError();
41297 if (mem_base != xmlMemBlocks()) {
41298 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41299 xmlMemBlocks() - mem_base);
41301 printf(" %d", n_code);
41313 test_xmlUCSIsLimbu(void) {
41316 #if defined(LIBXML_UNICODE_ENABLED)
41319 int code; /* UCS code point */
41322 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41323 mem_base = xmlMemBlocks();
41324 code = gen_int(n_code, 0);
41326 ret_val = xmlUCSIsLimbu(code);
41327 desret_int(ret_val);
41329 des_int(n_code, code, 0);
41330 xmlResetLastError();
41331 if (mem_base != xmlMemBlocks()) {
41332 printf("Leak of %d blocks found in xmlUCSIsLimbu",
41333 xmlMemBlocks() - mem_base);
41335 printf(" %d", n_code);
41347 test_xmlUCSIsLinearBIdeograms(void) {
41350 #if defined(LIBXML_UNICODE_ENABLED)
41353 int code; /* UCS code point */
41356 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41357 mem_base = xmlMemBlocks();
41358 code = gen_int(n_code, 0);
41360 ret_val = xmlUCSIsLinearBIdeograms(code);
41361 desret_int(ret_val);
41363 des_int(n_code, code, 0);
41364 xmlResetLastError();
41365 if (mem_base != xmlMemBlocks()) {
41366 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41367 xmlMemBlocks() - mem_base);
41369 printf(" %d", n_code);
41381 test_xmlUCSIsLinearBSyllabary(void) {
41384 #if defined(LIBXML_UNICODE_ENABLED)
41387 int code; /* UCS code point */
41390 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41391 mem_base = xmlMemBlocks();
41392 code = gen_int(n_code, 0);
41394 ret_val = xmlUCSIsLinearBSyllabary(code);
41395 desret_int(ret_val);
41397 des_int(n_code, code, 0);
41398 xmlResetLastError();
41399 if (mem_base != xmlMemBlocks()) {
41400 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41401 xmlMemBlocks() - mem_base);
41403 printf(" %d", n_code);
41415 test_xmlUCSIsLowSurrogates(void) {
41418 #if defined(LIBXML_UNICODE_ENABLED)
41421 int code; /* UCS code point */
41424 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41425 mem_base = xmlMemBlocks();
41426 code = gen_int(n_code, 0);
41428 ret_val = xmlUCSIsLowSurrogates(code);
41429 desret_int(ret_val);
41431 des_int(n_code, code, 0);
41432 xmlResetLastError();
41433 if (mem_base != xmlMemBlocks()) {
41434 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41435 xmlMemBlocks() - mem_base);
41437 printf(" %d", n_code);
41449 test_xmlUCSIsMalayalam(void) {
41452 #if defined(LIBXML_UNICODE_ENABLED)
41455 int code; /* UCS code point */
41458 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41459 mem_base = xmlMemBlocks();
41460 code = gen_int(n_code, 0);
41462 ret_val = xmlUCSIsMalayalam(code);
41463 desret_int(ret_val);
41465 des_int(n_code, code, 0);
41466 xmlResetLastError();
41467 if (mem_base != xmlMemBlocks()) {
41468 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41469 xmlMemBlocks() - mem_base);
41471 printf(" %d", n_code);
41483 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41486 #if defined(LIBXML_UNICODE_ENABLED)
41489 int code; /* UCS code point */
41492 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41493 mem_base = xmlMemBlocks();
41494 code = gen_int(n_code, 0);
41496 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41497 desret_int(ret_val);
41499 des_int(n_code, code, 0);
41500 xmlResetLastError();
41501 if (mem_base != xmlMemBlocks()) {
41502 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41503 xmlMemBlocks() - mem_base);
41505 printf(" %d", n_code);
41517 test_xmlUCSIsMathematicalOperators(void) {
41520 #if defined(LIBXML_UNICODE_ENABLED)
41523 int code; /* UCS code point */
41526 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41527 mem_base = xmlMemBlocks();
41528 code = gen_int(n_code, 0);
41530 ret_val = xmlUCSIsMathematicalOperators(code);
41531 desret_int(ret_val);
41533 des_int(n_code, code, 0);
41534 xmlResetLastError();
41535 if (mem_base != xmlMemBlocks()) {
41536 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41537 xmlMemBlocks() - mem_base);
41539 printf(" %d", n_code);
41551 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41554 #if defined(LIBXML_UNICODE_ENABLED)
41557 int code; /* UCS code point */
41560 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41561 mem_base = xmlMemBlocks();
41562 code = gen_int(n_code, 0);
41564 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41565 desret_int(ret_val);
41567 des_int(n_code, code, 0);
41568 xmlResetLastError();
41569 if (mem_base != xmlMemBlocks()) {
41570 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41571 xmlMemBlocks() - mem_base);
41573 printf(" %d", n_code);
41585 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41588 #if defined(LIBXML_UNICODE_ENABLED)
41591 int code; /* UCS code point */
41594 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41595 mem_base = xmlMemBlocks();
41596 code = gen_int(n_code, 0);
41598 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41599 desret_int(ret_val);
41601 des_int(n_code, code, 0);
41602 xmlResetLastError();
41603 if (mem_base != xmlMemBlocks()) {
41604 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41605 xmlMemBlocks() - mem_base);
41607 printf(" %d", n_code);
41619 test_xmlUCSIsMiscellaneousSymbols(void) {
41622 #if defined(LIBXML_UNICODE_ENABLED)
41625 int code; /* UCS code point */
41628 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41629 mem_base = xmlMemBlocks();
41630 code = gen_int(n_code, 0);
41632 ret_val = xmlUCSIsMiscellaneousSymbols(code);
41633 desret_int(ret_val);
41635 des_int(n_code, code, 0);
41636 xmlResetLastError();
41637 if (mem_base != xmlMemBlocks()) {
41638 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41639 xmlMemBlocks() - mem_base);
41641 printf(" %d", n_code);
41653 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41656 #if defined(LIBXML_UNICODE_ENABLED)
41659 int code; /* UCS code point */
41662 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41663 mem_base = xmlMemBlocks();
41664 code = gen_int(n_code, 0);
41666 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41667 desret_int(ret_val);
41669 des_int(n_code, code, 0);
41670 xmlResetLastError();
41671 if (mem_base != xmlMemBlocks()) {
41672 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41673 xmlMemBlocks() - mem_base);
41675 printf(" %d", n_code);
41687 test_xmlUCSIsMiscellaneousTechnical(void) {
41690 #if defined(LIBXML_UNICODE_ENABLED)
41693 int code; /* UCS code point */
41696 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41697 mem_base = xmlMemBlocks();
41698 code = gen_int(n_code, 0);
41700 ret_val = xmlUCSIsMiscellaneousTechnical(code);
41701 desret_int(ret_val);
41703 des_int(n_code, code, 0);
41704 xmlResetLastError();
41705 if (mem_base != xmlMemBlocks()) {
41706 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41707 xmlMemBlocks() - mem_base);
41709 printf(" %d", n_code);
41721 test_xmlUCSIsMongolian(void) {
41724 #if defined(LIBXML_UNICODE_ENABLED)
41727 int code; /* UCS code point */
41730 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41731 mem_base = xmlMemBlocks();
41732 code = gen_int(n_code, 0);
41734 ret_val = xmlUCSIsMongolian(code);
41735 desret_int(ret_val);
41737 des_int(n_code, code, 0);
41738 xmlResetLastError();
41739 if (mem_base != xmlMemBlocks()) {
41740 printf("Leak of %d blocks found in xmlUCSIsMongolian",
41741 xmlMemBlocks() - mem_base);
41743 printf(" %d", n_code);
41755 test_xmlUCSIsMusicalSymbols(void) {
41758 #if defined(LIBXML_UNICODE_ENABLED)
41761 int code; /* UCS code point */
41764 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41765 mem_base = xmlMemBlocks();
41766 code = gen_int(n_code, 0);
41768 ret_val = xmlUCSIsMusicalSymbols(code);
41769 desret_int(ret_val);
41771 des_int(n_code, code, 0);
41772 xmlResetLastError();
41773 if (mem_base != xmlMemBlocks()) {
41774 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41775 xmlMemBlocks() - mem_base);
41777 printf(" %d", n_code);
41789 test_xmlUCSIsMyanmar(void) {
41792 #if defined(LIBXML_UNICODE_ENABLED)
41795 int code; /* UCS code point */
41798 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41799 mem_base = xmlMemBlocks();
41800 code = gen_int(n_code, 0);
41802 ret_val = xmlUCSIsMyanmar(code);
41803 desret_int(ret_val);
41805 des_int(n_code, code, 0);
41806 xmlResetLastError();
41807 if (mem_base != xmlMemBlocks()) {
41808 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41809 xmlMemBlocks() - mem_base);
41811 printf(" %d", n_code);
41823 test_xmlUCSIsNumberForms(void) {
41826 #if defined(LIBXML_UNICODE_ENABLED)
41829 int code; /* UCS code point */
41832 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41833 mem_base = xmlMemBlocks();
41834 code = gen_int(n_code, 0);
41836 ret_val = xmlUCSIsNumberForms(code);
41837 desret_int(ret_val);
41839 des_int(n_code, code, 0);
41840 xmlResetLastError();
41841 if (mem_base != xmlMemBlocks()) {
41842 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41843 xmlMemBlocks() - mem_base);
41845 printf(" %d", n_code);
41857 test_xmlUCSIsOgham(void) {
41860 #if defined(LIBXML_UNICODE_ENABLED)
41863 int code; /* UCS code point */
41866 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41867 mem_base = xmlMemBlocks();
41868 code = gen_int(n_code, 0);
41870 ret_val = xmlUCSIsOgham(code);
41871 desret_int(ret_val);
41873 des_int(n_code, code, 0);
41874 xmlResetLastError();
41875 if (mem_base != xmlMemBlocks()) {
41876 printf("Leak of %d blocks found in xmlUCSIsOgham",
41877 xmlMemBlocks() - mem_base);
41879 printf(" %d", n_code);
41891 test_xmlUCSIsOldItalic(void) {
41894 #if defined(LIBXML_UNICODE_ENABLED)
41897 int code; /* UCS code point */
41900 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41901 mem_base = xmlMemBlocks();
41902 code = gen_int(n_code, 0);
41904 ret_val = xmlUCSIsOldItalic(code);
41905 desret_int(ret_val);
41907 des_int(n_code, code, 0);
41908 xmlResetLastError();
41909 if (mem_base != xmlMemBlocks()) {
41910 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41911 xmlMemBlocks() - mem_base);
41913 printf(" %d", n_code);
41925 test_xmlUCSIsOpticalCharacterRecognition(void) {
41928 #if defined(LIBXML_UNICODE_ENABLED)
41931 int code; /* UCS code point */
41934 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41935 mem_base = xmlMemBlocks();
41936 code = gen_int(n_code, 0);
41938 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41939 desret_int(ret_val);
41941 des_int(n_code, code, 0);
41942 xmlResetLastError();
41943 if (mem_base != xmlMemBlocks()) {
41944 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41945 xmlMemBlocks() - mem_base);
41947 printf(" %d", n_code);
41959 test_xmlUCSIsOriya(void) {
41962 #if defined(LIBXML_UNICODE_ENABLED)
41965 int code; /* UCS code point */
41968 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41969 mem_base = xmlMemBlocks();
41970 code = gen_int(n_code, 0);
41972 ret_val = xmlUCSIsOriya(code);
41973 desret_int(ret_val);
41975 des_int(n_code, code, 0);
41976 xmlResetLastError();
41977 if (mem_base != xmlMemBlocks()) {
41978 printf("Leak of %d blocks found in xmlUCSIsOriya",
41979 xmlMemBlocks() - mem_base);
41981 printf(" %d", n_code);
41993 test_xmlUCSIsOsmanya(void) {
41996 #if defined(LIBXML_UNICODE_ENABLED)
41999 int code; /* UCS code point */
42002 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42003 mem_base = xmlMemBlocks();
42004 code = gen_int(n_code, 0);
42006 ret_val = xmlUCSIsOsmanya(code);
42007 desret_int(ret_val);
42009 des_int(n_code, code, 0);
42010 xmlResetLastError();
42011 if (mem_base != xmlMemBlocks()) {
42012 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
42013 xmlMemBlocks() - mem_base);
42015 printf(" %d", n_code);
42027 test_xmlUCSIsPhoneticExtensions(void) {
42030 #if defined(LIBXML_UNICODE_ENABLED)
42033 int code; /* UCS code point */
42036 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42037 mem_base = xmlMemBlocks();
42038 code = gen_int(n_code, 0);
42040 ret_val = xmlUCSIsPhoneticExtensions(code);
42041 desret_int(ret_val);
42043 des_int(n_code, code, 0);
42044 xmlResetLastError();
42045 if (mem_base != xmlMemBlocks()) {
42046 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
42047 xmlMemBlocks() - mem_base);
42049 printf(" %d", n_code);
42061 test_xmlUCSIsPrivateUse(void) {
42064 #if defined(LIBXML_UNICODE_ENABLED)
42067 int code; /* UCS code point */
42070 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42071 mem_base = xmlMemBlocks();
42072 code = gen_int(n_code, 0);
42074 ret_val = xmlUCSIsPrivateUse(code);
42075 desret_int(ret_val);
42077 des_int(n_code, code, 0);
42078 xmlResetLastError();
42079 if (mem_base != xmlMemBlocks()) {
42080 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
42081 xmlMemBlocks() - mem_base);
42083 printf(" %d", n_code);
42095 test_xmlUCSIsPrivateUseArea(void) {
42098 #if defined(LIBXML_UNICODE_ENABLED)
42101 int code; /* UCS code point */
42104 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42105 mem_base = xmlMemBlocks();
42106 code = gen_int(n_code, 0);
42108 ret_val = xmlUCSIsPrivateUseArea(code);
42109 desret_int(ret_val);
42111 des_int(n_code, code, 0);
42112 xmlResetLastError();
42113 if (mem_base != xmlMemBlocks()) {
42114 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
42115 xmlMemBlocks() - mem_base);
42117 printf(" %d", n_code);
42129 test_xmlUCSIsRunic(void) {
42132 #if defined(LIBXML_UNICODE_ENABLED)
42135 int code; /* UCS code point */
42138 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42139 mem_base = xmlMemBlocks();
42140 code = gen_int(n_code, 0);
42142 ret_val = xmlUCSIsRunic(code);
42143 desret_int(ret_val);
42145 des_int(n_code, code, 0);
42146 xmlResetLastError();
42147 if (mem_base != xmlMemBlocks()) {
42148 printf("Leak of %d blocks found in xmlUCSIsRunic",
42149 xmlMemBlocks() - mem_base);
42151 printf(" %d", n_code);
42163 test_xmlUCSIsShavian(void) {
42166 #if defined(LIBXML_UNICODE_ENABLED)
42169 int code; /* UCS code point */
42172 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42173 mem_base = xmlMemBlocks();
42174 code = gen_int(n_code, 0);
42176 ret_val = xmlUCSIsShavian(code);
42177 desret_int(ret_val);
42179 des_int(n_code, code, 0);
42180 xmlResetLastError();
42181 if (mem_base != xmlMemBlocks()) {
42182 printf("Leak of %d blocks found in xmlUCSIsShavian",
42183 xmlMemBlocks() - mem_base);
42185 printf(" %d", n_code);
42197 test_xmlUCSIsSinhala(void) {
42200 #if defined(LIBXML_UNICODE_ENABLED)
42203 int code; /* UCS code point */
42206 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42207 mem_base = xmlMemBlocks();
42208 code = gen_int(n_code, 0);
42210 ret_val = xmlUCSIsSinhala(code);
42211 desret_int(ret_val);
42213 des_int(n_code, code, 0);
42214 xmlResetLastError();
42215 if (mem_base != xmlMemBlocks()) {
42216 printf("Leak of %d blocks found in xmlUCSIsSinhala",
42217 xmlMemBlocks() - mem_base);
42219 printf(" %d", n_code);
42231 test_xmlUCSIsSmallFormVariants(void) {
42234 #if defined(LIBXML_UNICODE_ENABLED)
42237 int code; /* UCS code point */
42240 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42241 mem_base = xmlMemBlocks();
42242 code = gen_int(n_code, 0);
42244 ret_val = xmlUCSIsSmallFormVariants(code);
42245 desret_int(ret_val);
42247 des_int(n_code, code, 0);
42248 xmlResetLastError();
42249 if (mem_base != xmlMemBlocks()) {
42250 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42251 xmlMemBlocks() - mem_base);
42253 printf(" %d", n_code);
42265 test_xmlUCSIsSpacingModifierLetters(void) {
42268 #if defined(LIBXML_UNICODE_ENABLED)
42271 int code; /* UCS code point */
42274 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42275 mem_base = xmlMemBlocks();
42276 code = gen_int(n_code, 0);
42278 ret_val = xmlUCSIsSpacingModifierLetters(code);
42279 desret_int(ret_val);
42281 des_int(n_code, code, 0);
42282 xmlResetLastError();
42283 if (mem_base != xmlMemBlocks()) {
42284 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42285 xmlMemBlocks() - mem_base);
42287 printf(" %d", n_code);
42299 test_xmlUCSIsSpecials(void) {
42302 #if defined(LIBXML_UNICODE_ENABLED)
42305 int code; /* UCS code point */
42308 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42309 mem_base = xmlMemBlocks();
42310 code = gen_int(n_code, 0);
42312 ret_val = xmlUCSIsSpecials(code);
42313 desret_int(ret_val);
42315 des_int(n_code, code, 0);
42316 xmlResetLastError();
42317 if (mem_base != xmlMemBlocks()) {
42318 printf("Leak of %d blocks found in xmlUCSIsSpecials",
42319 xmlMemBlocks() - mem_base);
42321 printf(" %d", n_code);
42333 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42336 #if defined(LIBXML_UNICODE_ENABLED)
42339 int code; /* UCS code point */
42342 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42343 mem_base = xmlMemBlocks();
42344 code = gen_int(n_code, 0);
42346 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42347 desret_int(ret_val);
42349 des_int(n_code, code, 0);
42350 xmlResetLastError();
42351 if (mem_base != xmlMemBlocks()) {
42352 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42353 xmlMemBlocks() - mem_base);
42355 printf(" %d", n_code);
42367 test_xmlUCSIsSupplementalArrowsA(void) {
42370 #if defined(LIBXML_UNICODE_ENABLED)
42373 int code; /* UCS code point */
42376 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42377 mem_base = xmlMemBlocks();
42378 code = gen_int(n_code, 0);
42380 ret_val = xmlUCSIsSupplementalArrowsA(code);
42381 desret_int(ret_val);
42383 des_int(n_code, code, 0);
42384 xmlResetLastError();
42385 if (mem_base != xmlMemBlocks()) {
42386 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42387 xmlMemBlocks() - mem_base);
42389 printf(" %d", n_code);
42401 test_xmlUCSIsSupplementalArrowsB(void) {
42404 #if defined(LIBXML_UNICODE_ENABLED)
42407 int code; /* UCS code point */
42410 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42411 mem_base = xmlMemBlocks();
42412 code = gen_int(n_code, 0);
42414 ret_val = xmlUCSIsSupplementalArrowsB(code);
42415 desret_int(ret_val);
42417 des_int(n_code, code, 0);
42418 xmlResetLastError();
42419 if (mem_base != xmlMemBlocks()) {
42420 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42421 xmlMemBlocks() - mem_base);
42423 printf(" %d", n_code);
42435 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42438 #if defined(LIBXML_UNICODE_ENABLED)
42441 int code; /* UCS code point */
42444 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42445 mem_base = xmlMemBlocks();
42446 code = gen_int(n_code, 0);
42448 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42449 desret_int(ret_val);
42451 des_int(n_code, code, 0);
42452 xmlResetLastError();
42453 if (mem_base != xmlMemBlocks()) {
42454 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42455 xmlMemBlocks() - mem_base);
42457 printf(" %d", n_code);
42469 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42472 #if defined(LIBXML_UNICODE_ENABLED)
42475 int code; /* UCS code point */
42478 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42479 mem_base = xmlMemBlocks();
42480 code = gen_int(n_code, 0);
42482 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42483 desret_int(ret_val);
42485 des_int(n_code, code, 0);
42486 xmlResetLastError();
42487 if (mem_base != xmlMemBlocks()) {
42488 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42489 xmlMemBlocks() - mem_base);
42491 printf(" %d", n_code);
42503 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42506 #if defined(LIBXML_UNICODE_ENABLED)
42509 int code; /* UCS code point */
42512 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42513 mem_base = xmlMemBlocks();
42514 code = gen_int(n_code, 0);
42516 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42517 desret_int(ret_val);
42519 des_int(n_code, code, 0);
42520 xmlResetLastError();
42521 if (mem_base != xmlMemBlocks()) {
42522 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42523 xmlMemBlocks() - mem_base);
42525 printf(" %d", n_code);
42537 test_xmlUCSIsSyriac(void) {
42540 #if defined(LIBXML_UNICODE_ENABLED)
42543 int code; /* UCS code point */
42546 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42547 mem_base = xmlMemBlocks();
42548 code = gen_int(n_code, 0);
42550 ret_val = xmlUCSIsSyriac(code);
42551 desret_int(ret_val);
42553 des_int(n_code, code, 0);
42554 xmlResetLastError();
42555 if (mem_base != xmlMemBlocks()) {
42556 printf("Leak of %d blocks found in xmlUCSIsSyriac",
42557 xmlMemBlocks() - mem_base);
42559 printf(" %d", n_code);
42571 test_xmlUCSIsTagalog(void) {
42574 #if defined(LIBXML_UNICODE_ENABLED)
42577 int code; /* UCS code point */
42580 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42581 mem_base = xmlMemBlocks();
42582 code = gen_int(n_code, 0);
42584 ret_val = xmlUCSIsTagalog(code);
42585 desret_int(ret_val);
42587 des_int(n_code, code, 0);
42588 xmlResetLastError();
42589 if (mem_base != xmlMemBlocks()) {
42590 printf("Leak of %d blocks found in xmlUCSIsTagalog",
42591 xmlMemBlocks() - mem_base);
42593 printf(" %d", n_code);
42605 test_xmlUCSIsTagbanwa(void) {
42608 #if defined(LIBXML_UNICODE_ENABLED)
42611 int code; /* UCS code point */
42614 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42615 mem_base = xmlMemBlocks();
42616 code = gen_int(n_code, 0);
42618 ret_val = xmlUCSIsTagbanwa(code);
42619 desret_int(ret_val);
42621 des_int(n_code, code, 0);
42622 xmlResetLastError();
42623 if (mem_base != xmlMemBlocks()) {
42624 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42625 xmlMemBlocks() - mem_base);
42627 printf(" %d", n_code);
42639 test_xmlUCSIsTags(void) {
42642 #if defined(LIBXML_UNICODE_ENABLED)
42645 int code; /* UCS code point */
42648 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42649 mem_base = xmlMemBlocks();
42650 code = gen_int(n_code, 0);
42652 ret_val = xmlUCSIsTags(code);
42653 desret_int(ret_val);
42655 des_int(n_code, code, 0);
42656 xmlResetLastError();
42657 if (mem_base != xmlMemBlocks()) {
42658 printf("Leak of %d blocks found in xmlUCSIsTags",
42659 xmlMemBlocks() - mem_base);
42661 printf(" %d", n_code);
42673 test_xmlUCSIsTaiLe(void) {
42676 #if defined(LIBXML_UNICODE_ENABLED)
42679 int code; /* UCS code point */
42682 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42683 mem_base = xmlMemBlocks();
42684 code = gen_int(n_code, 0);
42686 ret_val = xmlUCSIsTaiLe(code);
42687 desret_int(ret_val);
42689 des_int(n_code, code, 0);
42690 xmlResetLastError();
42691 if (mem_base != xmlMemBlocks()) {
42692 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42693 xmlMemBlocks() - mem_base);
42695 printf(" %d", n_code);
42707 test_xmlUCSIsTaiXuanJingSymbols(void) {
42710 #if defined(LIBXML_UNICODE_ENABLED)
42713 int code; /* UCS code point */
42716 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42717 mem_base = xmlMemBlocks();
42718 code = gen_int(n_code, 0);
42720 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42721 desret_int(ret_val);
42723 des_int(n_code, code, 0);
42724 xmlResetLastError();
42725 if (mem_base != xmlMemBlocks()) {
42726 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42727 xmlMemBlocks() - mem_base);
42729 printf(" %d", n_code);
42741 test_xmlUCSIsTamil(void) {
42744 #if defined(LIBXML_UNICODE_ENABLED)
42747 int code; /* UCS code point */
42750 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42751 mem_base = xmlMemBlocks();
42752 code = gen_int(n_code, 0);
42754 ret_val = xmlUCSIsTamil(code);
42755 desret_int(ret_val);
42757 des_int(n_code, code, 0);
42758 xmlResetLastError();
42759 if (mem_base != xmlMemBlocks()) {
42760 printf("Leak of %d blocks found in xmlUCSIsTamil",
42761 xmlMemBlocks() - mem_base);
42763 printf(" %d", n_code);
42775 test_xmlUCSIsTelugu(void) {
42778 #if defined(LIBXML_UNICODE_ENABLED)
42781 int code; /* UCS code point */
42784 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42785 mem_base = xmlMemBlocks();
42786 code = gen_int(n_code, 0);
42788 ret_val = xmlUCSIsTelugu(code);
42789 desret_int(ret_val);
42791 des_int(n_code, code, 0);
42792 xmlResetLastError();
42793 if (mem_base != xmlMemBlocks()) {
42794 printf("Leak of %d blocks found in xmlUCSIsTelugu",
42795 xmlMemBlocks() - mem_base);
42797 printf(" %d", n_code);
42809 test_xmlUCSIsThaana(void) {
42812 #if defined(LIBXML_UNICODE_ENABLED)
42815 int code; /* UCS code point */
42818 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42819 mem_base = xmlMemBlocks();
42820 code = gen_int(n_code, 0);
42822 ret_val = xmlUCSIsThaana(code);
42823 desret_int(ret_val);
42825 des_int(n_code, code, 0);
42826 xmlResetLastError();
42827 if (mem_base != xmlMemBlocks()) {
42828 printf("Leak of %d blocks found in xmlUCSIsThaana",
42829 xmlMemBlocks() - mem_base);
42831 printf(" %d", n_code);
42843 test_xmlUCSIsThai(void) {
42846 #if defined(LIBXML_UNICODE_ENABLED)
42849 int code; /* UCS code point */
42852 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42853 mem_base = xmlMemBlocks();
42854 code = gen_int(n_code, 0);
42856 ret_val = xmlUCSIsThai(code);
42857 desret_int(ret_val);
42859 des_int(n_code, code, 0);
42860 xmlResetLastError();
42861 if (mem_base != xmlMemBlocks()) {
42862 printf("Leak of %d blocks found in xmlUCSIsThai",
42863 xmlMemBlocks() - mem_base);
42865 printf(" %d", n_code);
42877 test_xmlUCSIsTibetan(void) {
42880 #if defined(LIBXML_UNICODE_ENABLED)
42883 int code; /* UCS code point */
42886 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42887 mem_base = xmlMemBlocks();
42888 code = gen_int(n_code, 0);
42890 ret_val = xmlUCSIsTibetan(code);
42891 desret_int(ret_val);
42893 des_int(n_code, code, 0);
42894 xmlResetLastError();
42895 if (mem_base != xmlMemBlocks()) {
42896 printf("Leak of %d blocks found in xmlUCSIsTibetan",
42897 xmlMemBlocks() - mem_base);
42899 printf(" %d", n_code);
42911 test_xmlUCSIsUgaritic(void) {
42914 #if defined(LIBXML_UNICODE_ENABLED)
42917 int code; /* UCS code point */
42920 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42921 mem_base = xmlMemBlocks();
42922 code = gen_int(n_code, 0);
42924 ret_val = xmlUCSIsUgaritic(code);
42925 desret_int(ret_val);
42927 des_int(n_code, code, 0);
42928 xmlResetLastError();
42929 if (mem_base != xmlMemBlocks()) {
42930 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42931 xmlMemBlocks() - mem_base);
42933 printf(" %d", n_code);
42945 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42948 #if defined(LIBXML_UNICODE_ENABLED)
42951 int code; /* UCS code point */
42954 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42955 mem_base = xmlMemBlocks();
42956 code = gen_int(n_code, 0);
42958 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42959 desret_int(ret_val);
42961 des_int(n_code, code, 0);
42962 xmlResetLastError();
42963 if (mem_base != xmlMemBlocks()) {
42964 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42965 xmlMemBlocks() - mem_base);
42967 printf(" %d", n_code);
42979 test_xmlUCSIsVariationSelectors(void) {
42982 #if defined(LIBXML_UNICODE_ENABLED)
42985 int code; /* UCS code point */
42988 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42989 mem_base = xmlMemBlocks();
42990 code = gen_int(n_code, 0);
42992 ret_val = xmlUCSIsVariationSelectors(code);
42993 desret_int(ret_val);
42995 des_int(n_code, code, 0);
42996 xmlResetLastError();
42997 if (mem_base != xmlMemBlocks()) {
42998 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42999 xmlMemBlocks() - mem_base);
43001 printf(" %d", n_code);
43013 test_xmlUCSIsVariationSelectorsSupplement(void) {
43016 #if defined(LIBXML_UNICODE_ENABLED)
43019 int code; /* UCS code point */
43022 for (n_code = 0;n_code < gen_nb_int;n_code++) {
43023 mem_base = xmlMemBlocks();
43024 code = gen_int(n_code, 0);
43026 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
43027 desret_int(ret_val);
43029 des_int(n_code, code, 0);
43030 xmlResetLastError();
43031 if (mem_base != xmlMemBlocks()) {
43032 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
43033 xmlMemBlocks() - mem_base);
43035 printf(" %d", n_code);
43047 test_xmlUCSIsYiRadicals(void) {
43050 #if defined(LIBXML_UNICODE_ENABLED)
43053 int code; /* UCS code point */
43056 for (n_code = 0;n_code < gen_nb_int;n_code++) {
43057 mem_base = xmlMemBlocks();
43058 code = gen_int(n_code, 0);
43060 ret_val = xmlUCSIsYiRadicals(code);
43061 desret_int(ret_val);
43063 des_int(n_code, code, 0);
43064 xmlResetLastError();
43065 if (mem_base != xmlMemBlocks()) {
43066 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
43067 xmlMemBlocks() - mem_base);
43069 printf(" %d", n_code);
43081 test_xmlUCSIsYiSyllables(void) {
43084 #if defined(LIBXML_UNICODE_ENABLED)
43087 int code; /* UCS code point */
43090 for (n_code = 0;n_code < gen_nb_int;n_code++) {
43091 mem_base = xmlMemBlocks();
43092 code = gen_int(n_code, 0);
43094 ret_val = xmlUCSIsYiSyllables(code);
43095 desret_int(ret_val);
43097 des_int(n_code, code, 0);
43098 xmlResetLastError();
43099 if (mem_base != xmlMemBlocks()) {
43100 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
43101 xmlMemBlocks() - mem_base);
43103 printf(" %d", n_code);
43115 test_xmlUCSIsYijingHexagramSymbols(void) {
43118 #if defined(LIBXML_UNICODE_ENABLED)
43121 int code; /* UCS code point */
43124 for (n_code = 0;n_code < gen_nb_int;n_code++) {
43125 mem_base = xmlMemBlocks();
43126 code = gen_int(n_code, 0);
43128 ret_val = xmlUCSIsYijingHexagramSymbols(code);
43129 desret_int(ret_val);
43131 des_int(n_code, code, 0);
43132 xmlResetLastError();
43133 if (mem_base != xmlMemBlocks()) {
43134 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
43135 xmlMemBlocks() - mem_base);
43137 printf(" %d", n_code);
43148 test_xmlunicode(void) {
43151 if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
43152 test_ret += test_xmlUCSIsAegeanNumbers();
43153 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
43154 test_ret += test_xmlUCSIsArabic();
43155 test_ret += test_xmlUCSIsArabicPresentationFormsA();
43156 test_ret += test_xmlUCSIsArabicPresentationFormsB();
43157 test_ret += test_xmlUCSIsArmenian();
43158 test_ret += test_xmlUCSIsArrows();
43159 test_ret += test_xmlUCSIsBasicLatin();
43160 test_ret += test_xmlUCSIsBengali();
43161 test_ret += test_xmlUCSIsBlock();
43162 test_ret += test_xmlUCSIsBlockElements();
43163 test_ret += test_xmlUCSIsBopomofo();
43164 test_ret += test_xmlUCSIsBopomofoExtended();
43165 test_ret += test_xmlUCSIsBoxDrawing();
43166 test_ret += test_xmlUCSIsBraillePatterns();
43167 test_ret += test_xmlUCSIsBuhid();
43168 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
43169 test_ret += test_xmlUCSIsCJKCompatibility();
43170 test_ret += test_xmlUCSIsCJKCompatibilityForms();
43171 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
43172 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
43173 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
43174 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
43175 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
43176 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
43177 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
43178 test_ret += test_xmlUCSIsCat();
43179 test_ret += test_xmlUCSIsCatC();
43180 test_ret += test_xmlUCSIsCatCc();
43181 test_ret += test_xmlUCSIsCatCf();
43182 test_ret += test_xmlUCSIsCatCo();
43183 test_ret += test_xmlUCSIsCatCs();
43184 test_ret += test_xmlUCSIsCatL();
43185 test_ret += test_xmlUCSIsCatLl();
43186 test_ret += test_xmlUCSIsCatLm();
43187 test_ret += test_xmlUCSIsCatLo();
43188 test_ret += test_xmlUCSIsCatLt();
43189 test_ret += test_xmlUCSIsCatLu();
43190 test_ret += test_xmlUCSIsCatM();
43191 test_ret += test_xmlUCSIsCatMc();
43192 test_ret += test_xmlUCSIsCatMe();
43193 test_ret += test_xmlUCSIsCatMn();
43194 test_ret += test_xmlUCSIsCatN();
43195 test_ret += test_xmlUCSIsCatNd();
43196 test_ret += test_xmlUCSIsCatNl();
43197 test_ret += test_xmlUCSIsCatNo();
43198 test_ret += test_xmlUCSIsCatP();
43199 test_ret += test_xmlUCSIsCatPc();
43200 test_ret += test_xmlUCSIsCatPd();
43201 test_ret += test_xmlUCSIsCatPe();
43202 test_ret += test_xmlUCSIsCatPf();
43203 test_ret += test_xmlUCSIsCatPi();
43204 test_ret += test_xmlUCSIsCatPo();
43205 test_ret += test_xmlUCSIsCatPs();
43206 test_ret += test_xmlUCSIsCatS();
43207 test_ret += test_xmlUCSIsCatSc();
43208 test_ret += test_xmlUCSIsCatSk();
43209 test_ret += test_xmlUCSIsCatSm();
43210 test_ret += test_xmlUCSIsCatSo();
43211 test_ret += test_xmlUCSIsCatZ();
43212 test_ret += test_xmlUCSIsCatZl();
43213 test_ret += test_xmlUCSIsCatZp();
43214 test_ret += test_xmlUCSIsCatZs();
43215 test_ret += test_xmlUCSIsCherokee();
43216 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43217 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43218 test_ret += test_xmlUCSIsCombiningHalfMarks();
43219 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43220 test_ret += test_xmlUCSIsControlPictures();
43221 test_ret += test_xmlUCSIsCurrencySymbols();
43222 test_ret += test_xmlUCSIsCypriotSyllabary();
43223 test_ret += test_xmlUCSIsCyrillic();
43224 test_ret += test_xmlUCSIsCyrillicSupplement();
43225 test_ret += test_xmlUCSIsDeseret();
43226 test_ret += test_xmlUCSIsDevanagari();
43227 test_ret += test_xmlUCSIsDingbats();
43228 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43229 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43230 test_ret += test_xmlUCSIsEthiopic();
43231 test_ret += test_xmlUCSIsGeneralPunctuation();
43232 test_ret += test_xmlUCSIsGeometricShapes();
43233 test_ret += test_xmlUCSIsGeorgian();
43234 test_ret += test_xmlUCSIsGothic();
43235 test_ret += test_xmlUCSIsGreek();
43236 test_ret += test_xmlUCSIsGreekExtended();
43237 test_ret += test_xmlUCSIsGreekandCoptic();
43238 test_ret += test_xmlUCSIsGujarati();
43239 test_ret += test_xmlUCSIsGurmukhi();
43240 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43241 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43242 test_ret += test_xmlUCSIsHangulJamo();
43243 test_ret += test_xmlUCSIsHangulSyllables();
43244 test_ret += test_xmlUCSIsHanunoo();
43245 test_ret += test_xmlUCSIsHebrew();
43246 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43247 test_ret += test_xmlUCSIsHighSurrogates();
43248 test_ret += test_xmlUCSIsHiragana();
43249 test_ret += test_xmlUCSIsIPAExtensions();
43250 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43251 test_ret += test_xmlUCSIsKanbun();
43252 test_ret += test_xmlUCSIsKangxiRadicals();
43253 test_ret += test_xmlUCSIsKannada();
43254 test_ret += test_xmlUCSIsKatakana();
43255 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43256 test_ret += test_xmlUCSIsKhmer();
43257 test_ret += test_xmlUCSIsKhmerSymbols();
43258 test_ret += test_xmlUCSIsLao();
43259 test_ret += test_xmlUCSIsLatin1Supplement();
43260 test_ret += test_xmlUCSIsLatinExtendedA();
43261 test_ret += test_xmlUCSIsLatinExtendedAdditional();
43262 test_ret += test_xmlUCSIsLatinExtendedB();
43263 test_ret += test_xmlUCSIsLetterlikeSymbols();
43264 test_ret += test_xmlUCSIsLimbu();
43265 test_ret += test_xmlUCSIsLinearBIdeograms();
43266 test_ret += test_xmlUCSIsLinearBSyllabary();
43267 test_ret += test_xmlUCSIsLowSurrogates();
43268 test_ret += test_xmlUCSIsMalayalam();
43269 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43270 test_ret += test_xmlUCSIsMathematicalOperators();
43271 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43272 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43273 test_ret += test_xmlUCSIsMiscellaneousSymbols();
43274 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43275 test_ret += test_xmlUCSIsMiscellaneousTechnical();
43276 test_ret += test_xmlUCSIsMongolian();
43277 test_ret += test_xmlUCSIsMusicalSymbols();
43278 test_ret += test_xmlUCSIsMyanmar();
43279 test_ret += test_xmlUCSIsNumberForms();
43280 test_ret += test_xmlUCSIsOgham();
43281 test_ret += test_xmlUCSIsOldItalic();
43282 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43283 test_ret += test_xmlUCSIsOriya();
43284 test_ret += test_xmlUCSIsOsmanya();
43285 test_ret += test_xmlUCSIsPhoneticExtensions();
43286 test_ret += test_xmlUCSIsPrivateUse();
43287 test_ret += test_xmlUCSIsPrivateUseArea();
43288 test_ret += test_xmlUCSIsRunic();
43289 test_ret += test_xmlUCSIsShavian();
43290 test_ret += test_xmlUCSIsSinhala();
43291 test_ret += test_xmlUCSIsSmallFormVariants();
43292 test_ret += test_xmlUCSIsSpacingModifierLetters();
43293 test_ret += test_xmlUCSIsSpecials();
43294 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43295 test_ret += test_xmlUCSIsSupplementalArrowsA();
43296 test_ret += test_xmlUCSIsSupplementalArrowsB();
43297 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43298 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43299 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43300 test_ret += test_xmlUCSIsSyriac();
43301 test_ret += test_xmlUCSIsTagalog();
43302 test_ret += test_xmlUCSIsTagbanwa();
43303 test_ret += test_xmlUCSIsTags();
43304 test_ret += test_xmlUCSIsTaiLe();
43305 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43306 test_ret += test_xmlUCSIsTamil();
43307 test_ret += test_xmlUCSIsTelugu();
43308 test_ret += test_xmlUCSIsThaana();
43309 test_ret += test_xmlUCSIsThai();
43310 test_ret += test_xmlUCSIsTibetan();
43311 test_ret += test_xmlUCSIsUgaritic();
43312 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43313 test_ret += test_xmlUCSIsVariationSelectors();
43314 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43315 test_ret += test_xmlUCSIsYiRadicals();
43316 test_ret += test_xmlUCSIsYiSyllables();
43317 test_ret += test_xmlUCSIsYijingHexagramSymbols();
43320 printf("Module xmlunicode: %d errors\n", test_ret);
43325 test_xmlNewTextWriter(void) {
43328 #if defined(LIBXML_WRITER_ENABLED)
43330 xmlTextWriterPtr ret_val;
43331 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43334 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43335 mem_base = xmlMemBlocks();
43336 out = gen_xmlOutputBufferPtr(n_out, 0);
43338 ret_val = xmlNewTextWriter(out);
43339 if (ret_val != NULL) out = NULL;
43340 desret_xmlTextWriterPtr(ret_val);
43342 des_xmlOutputBufferPtr(n_out, out, 0);
43343 xmlResetLastError();
43344 if (mem_base != xmlMemBlocks()) {
43345 printf("Leak of %d blocks found in xmlNewTextWriter",
43346 xmlMemBlocks() - mem_base);
43348 printf(" %d", n_out);
43360 test_xmlNewTextWriterFilename(void) {
43363 #if defined(LIBXML_WRITER_ENABLED)
43365 xmlTextWriterPtr ret_val;
43366 const char * uri; /* the URI of the resource for the output */
43368 int compression; /* compress the output? */
43371 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43372 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43373 mem_base = xmlMemBlocks();
43374 uri = gen_fileoutput(n_uri, 0);
43375 compression = gen_int(n_compression, 1);
43377 ret_val = xmlNewTextWriterFilename(uri, compression);
43378 desret_xmlTextWriterPtr(ret_val);
43380 des_fileoutput(n_uri, uri, 0);
43381 des_int(n_compression, compression, 1);
43382 xmlResetLastError();
43383 if (mem_base != xmlMemBlocks()) {
43384 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43385 xmlMemBlocks() - mem_base);
43387 printf(" %d", n_uri);
43388 printf(" %d", n_compression);
43401 test_xmlNewTextWriterMemory(void) {
43404 #if defined(LIBXML_WRITER_ENABLED)
43406 xmlTextWriterPtr ret_val;
43407 xmlBufferPtr buf; /* xmlBufferPtr */
43409 int compression; /* compress the output? */
43412 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43413 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43414 mem_base = xmlMemBlocks();
43415 buf = gen_xmlBufferPtr(n_buf, 0);
43416 compression = gen_int(n_compression, 1);
43418 ret_val = xmlNewTextWriterMemory(buf, compression);
43419 desret_xmlTextWriterPtr(ret_val);
43421 des_xmlBufferPtr(n_buf, buf, 0);
43422 des_int(n_compression, compression, 1);
43423 xmlResetLastError();
43424 if (mem_base != xmlMemBlocks()) {
43425 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43426 xmlMemBlocks() - mem_base);
43428 printf(" %d", n_buf);
43429 printf(" %d", n_compression);
43442 test_xmlNewTextWriterPushParser(void) {
43445 #if defined(LIBXML_WRITER_ENABLED)
43447 xmlTextWriterPtr ret_val;
43448 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43450 int compression; /* compress the output? */
43453 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43454 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43455 mem_base = xmlMemBlocks();
43456 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43457 compression = gen_int(n_compression, 1);
43459 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43460 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43461 desret_xmlTextWriterPtr(ret_val);
43463 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43464 des_int(n_compression, compression, 1);
43465 xmlResetLastError();
43466 if (mem_base != xmlMemBlocks()) {
43467 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43468 xmlMemBlocks() - mem_base);
43470 printf(" %d", n_ctxt);
43471 printf(" %d", n_compression);
43484 test_xmlNewTextWriterTree(void) {
43487 #if defined(LIBXML_WRITER_ENABLED)
43489 xmlTextWriterPtr ret_val;
43490 xmlDocPtr doc; /* xmlDocPtr */
43492 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43494 int compression; /* compress the output? */
43497 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43498 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43499 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43500 mem_base = xmlMemBlocks();
43501 doc = gen_xmlDocPtr(n_doc, 0);
43502 node = gen_xmlNodePtr(n_node, 1);
43503 compression = gen_int(n_compression, 2);
43505 ret_val = xmlNewTextWriterTree(doc, node, compression);
43506 desret_xmlTextWriterPtr(ret_val);
43508 des_xmlDocPtr(n_doc, doc, 0);
43509 des_xmlNodePtr(n_node, node, 1);
43510 des_int(n_compression, compression, 2);
43511 xmlResetLastError();
43512 if (mem_base != xmlMemBlocks()) {
43513 printf("Leak of %d blocks found in xmlNewTextWriterTree",
43514 xmlMemBlocks() - mem_base);
43516 printf(" %d", n_doc);
43517 printf(" %d", n_node);
43518 printf(" %d", n_compression);
43532 test_xmlTextWriterEndAttribute(void) {
43535 #if defined(LIBXML_WRITER_ENABLED)
43538 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43541 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43542 mem_base = xmlMemBlocks();
43543 writer = gen_xmlTextWriterPtr(n_writer, 0);
43545 ret_val = xmlTextWriterEndAttribute(writer);
43546 desret_int(ret_val);
43548 des_xmlTextWriterPtr(n_writer, writer, 0);
43549 xmlResetLastError();
43550 if (mem_base != xmlMemBlocks()) {
43551 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43552 xmlMemBlocks() - mem_base);
43554 printf(" %d", n_writer);
43566 test_xmlTextWriterEndCDATA(void) {
43569 #if defined(LIBXML_WRITER_ENABLED)
43572 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43575 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43576 mem_base = xmlMemBlocks();
43577 writer = gen_xmlTextWriterPtr(n_writer, 0);
43579 ret_val = xmlTextWriterEndCDATA(writer);
43580 desret_int(ret_val);
43582 des_xmlTextWriterPtr(n_writer, writer, 0);
43583 xmlResetLastError();
43584 if (mem_base != xmlMemBlocks()) {
43585 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43586 xmlMemBlocks() - mem_base);
43588 printf(" %d", n_writer);
43600 test_xmlTextWriterEndComment(void) {
43603 #if defined(LIBXML_WRITER_ENABLED)
43606 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43609 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43610 mem_base = xmlMemBlocks();
43611 writer = gen_xmlTextWriterPtr(n_writer, 0);
43613 ret_val = xmlTextWriterEndComment(writer);
43614 desret_int(ret_val);
43616 des_xmlTextWriterPtr(n_writer, writer, 0);
43617 xmlResetLastError();
43618 if (mem_base != xmlMemBlocks()) {
43619 printf("Leak of %d blocks found in xmlTextWriterEndComment",
43620 xmlMemBlocks() - mem_base);
43622 printf(" %d", n_writer);
43634 test_xmlTextWriterEndDTD(void) {
43637 #if defined(LIBXML_WRITER_ENABLED)
43640 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43643 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43644 mem_base = xmlMemBlocks();
43645 writer = gen_xmlTextWriterPtr(n_writer, 0);
43647 ret_val = xmlTextWriterEndDTD(writer);
43648 desret_int(ret_val);
43650 des_xmlTextWriterPtr(n_writer, writer, 0);
43651 xmlResetLastError();
43652 if (mem_base != xmlMemBlocks()) {
43653 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43654 xmlMemBlocks() - mem_base);
43656 printf(" %d", n_writer);
43668 test_xmlTextWriterEndDTDAttlist(void) {
43671 #if defined(LIBXML_WRITER_ENABLED)
43674 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43677 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43678 mem_base = xmlMemBlocks();
43679 writer = gen_xmlTextWriterPtr(n_writer, 0);
43681 ret_val = xmlTextWriterEndDTDAttlist(writer);
43682 desret_int(ret_val);
43684 des_xmlTextWriterPtr(n_writer, writer, 0);
43685 xmlResetLastError();
43686 if (mem_base != xmlMemBlocks()) {
43687 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43688 xmlMemBlocks() - mem_base);
43690 printf(" %d", n_writer);
43702 test_xmlTextWriterEndDTDElement(void) {
43705 #if defined(LIBXML_WRITER_ENABLED)
43708 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43711 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43712 mem_base = xmlMemBlocks();
43713 writer = gen_xmlTextWriterPtr(n_writer, 0);
43715 ret_val = xmlTextWriterEndDTDElement(writer);
43716 desret_int(ret_val);
43718 des_xmlTextWriterPtr(n_writer, writer, 0);
43719 xmlResetLastError();
43720 if (mem_base != xmlMemBlocks()) {
43721 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43722 xmlMemBlocks() - mem_base);
43724 printf(" %d", n_writer);
43736 test_xmlTextWriterEndDTDEntity(void) {
43739 #if defined(LIBXML_WRITER_ENABLED)
43742 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43745 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43746 mem_base = xmlMemBlocks();
43747 writer = gen_xmlTextWriterPtr(n_writer, 0);
43749 ret_val = xmlTextWriterEndDTDEntity(writer);
43750 desret_int(ret_val);
43752 des_xmlTextWriterPtr(n_writer, writer, 0);
43753 xmlResetLastError();
43754 if (mem_base != xmlMemBlocks()) {
43755 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43756 xmlMemBlocks() - mem_base);
43758 printf(" %d", n_writer);
43770 test_xmlTextWriterEndDocument(void) {
43773 #if defined(LIBXML_WRITER_ENABLED)
43776 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43779 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43780 mem_base = xmlMemBlocks();
43781 writer = gen_xmlTextWriterPtr(n_writer, 0);
43783 ret_val = xmlTextWriterEndDocument(writer);
43784 desret_int(ret_val);
43786 des_xmlTextWriterPtr(n_writer, writer, 0);
43787 xmlResetLastError();
43788 if (mem_base != xmlMemBlocks()) {
43789 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43790 xmlMemBlocks() - mem_base);
43792 printf(" %d", n_writer);
43804 test_xmlTextWriterEndElement(void) {
43807 #if defined(LIBXML_WRITER_ENABLED)
43810 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43813 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43814 mem_base = xmlMemBlocks();
43815 writer = gen_xmlTextWriterPtr(n_writer, 0);
43817 ret_val = xmlTextWriterEndElement(writer);
43818 desret_int(ret_val);
43820 des_xmlTextWriterPtr(n_writer, writer, 0);
43821 xmlResetLastError();
43822 if (mem_base != xmlMemBlocks()) {
43823 printf("Leak of %d blocks found in xmlTextWriterEndElement",
43824 xmlMemBlocks() - mem_base);
43826 printf(" %d", n_writer);
43838 test_xmlTextWriterEndPI(void) {
43841 #if defined(LIBXML_WRITER_ENABLED)
43844 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43847 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43848 mem_base = xmlMemBlocks();
43849 writer = gen_xmlTextWriterPtr(n_writer, 0);
43851 ret_val = xmlTextWriterEndPI(writer);
43852 desret_int(ret_val);
43854 des_xmlTextWriterPtr(n_writer, writer, 0);
43855 xmlResetLastError();
43856 if (mem_base != xmlMemBlocks()) {
43857 printf("Leak of %d blocks found in xmlTextWriterEndPI",
43858 xmlMemBlocks() - mem_base);
43860 printf(" %d", n_writer);
43872 test_xmlTextWriterFlush(void) {
43875 #if defined(LIBXML_WRITER_ENABLED)
43878 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43881 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43882 mem_base = xmlMemBlocks();
43883 writer = gen_xmlTextWriterPtr(n_writer, 0);
43885 ret_val = xmlTextWriterFlush(writer);
43886 desret_int(ret_val);
43888 des_xmlTextWriterPtr(n_writer, writer, 0);
43889 xmlResetLastError();
43890 if (mem_base != xmlMemBlocks()) {
43891 printf("Leak of %d blocks found in xmlTextWriterFlush",
43892 xmlMemBlocks() - mem_base);
43894 printf(" %d", n_writer);
43906 test_xmlTextWriterFullEndElement(void) {
43909 #if defined(LIBXML_WRITER_ENABLED)
43912 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43915 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43916 mem_base = xmlMemBlocks();
43917 writer = gen_xmlTextWriterPtr(n_writer, 0);
43919 ret_val = xmlTextWriterFullEndElement(writer);
43920 desret_int(ret_val);
43922 des_xmlTextWriterPtr(n_writer, writer, 0);
43923 xmlResetLastError();
43924 if (mem_base != xmlMemBlocks()) {
43925 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43926 xmlMemBlocks() - mem_base);
43928 printf(" %d", n_writer);
43940 test_xmlTextWriterSetIndent(void) {
43943 #if defined(LIBXML_WRITER_ENABLED)
43946 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43948 int indent; /* do indentation? */
43951 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43952 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43953 mem_base = xmlMemBlocks();
43954 writer = gen_xmlTextWriterPtr(n_writer, 0);
43955 indent = gen_int(n_indent, 1);
43957 ret_val = xmlTextWriterSetIndent(writer, indent);
43958 desret_int(ret_val);
43960 des_xmlTextWriterPtr(n_writer, writer, 0);
43961 des_int(n_indent, indent, 1);
43962 xmlResetLastError();
43963 if (mem_base != xmlMemBlocks()) {
43964 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43965 xmlMemBlocks() - mem_base);
43967 printf(" %d", n_writer);
43968 printf(" %d", n_indent);
43981 test_xmlTextWriterSetIndentString(void) {
43984 #if defined(LIBXML_WRITER_ENABLED)
43987 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43989 xmlChar * str; /* the xmlChar string */
43992 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43993 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43994 mem_base = xmlMemBlocks();
43995 writer = gen_xmlTextWriterPtr(n_writer, 0);
43996 str = gen_const_xmlChar_ptr(n_str, 1);
43998 ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43999 desret_int(ret_val);
44001 des_xmlTextWriterPtr(n_writer, writer, 0);
44002 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
44003 xmlResetLastError();
44004 if (mem_base != xmlMemBlocks()) {
44005 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
44006 xmlMemBlocks() - mem_base);
44008 printf(" %d", n_writer);
44009 printf(" %d", n_str);
44022 test_xmlTextWriterSetQuoteChar(void) {
44025 #if defined(LIBXML_WRITER_ENABLED)
44028 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44030 xmlChar quotechar; /* the quote character */
44033 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44034 for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
44035 mem_base = xmlMemBlocks();
44036 writer = gen_xmlTextWriterPtr(n_writer, 0);
44037 quotechar = gen_xmlChar(n_quotechar, 1);
44039 ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
44040 desret_int(ret_val);
44042 des_xmlTextWriterPtr(n_writer, writer, 0);
44043 des_xmlChar(n_quotechar, quotechar, 1);
44044 xmlResetLastError();
44045 if (mem_base != xmlMemBlocks()) {
44046 printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
44047 xmlMemBlocks() - mem_base);
44049 printf(" %d", n_writer);
44050 printf(" %d", n_quotechar);
44063 test_xmlTextWriterStartAttribute(void) {
44066 #if defined(LIBXML_WRITER_ENABLED)
44069 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44071 xmlChar * name; /* element name */
44074 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44075 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44076 mem_base = xmlMemBlocks();
44077 writer = gen_xmlTextWriterPtr(n_writer, 0);
44078 name = gen_const_xmlChar_ptr(n_name, 1);
44080 ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
44081 desret_int(ret_val);
44083 des_xmlTextWriterPtr(n_writer, writer, 0);
44084 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44085 xmlResetLastError();
44086 if (mem_base != xmlMemBlocks()) {
44087 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
44088 xmlMemBlocks() - mem_base);
44090 printf(" %d", n_writer);
44091 printf(" %d", n_name);
44104 test_xmlTextWriterStartAttributeNS(void) {
44107 #if defined(LIBXML_WRITER_ENABLED)
44110 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44112 xmlChar * prefix; /* namespace prefix or NULL */
44114 xmlChar * name; /* element local name */
44116 xmlChar * namespaceURI; /* namespace URI or NULL */
44117 int n_namespaceURI;
44119 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44120 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44121 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44122 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44123 mem_base = xmlMemBlocks();
44124 writer = gen_xmlTextWriterPtr(n_writer, 0);
44125 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44126 name = gen_const_xmlChar_ptr(n_name, 2);
44127 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44129 ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44130 desret_int(ret_val);
44132 des_xmlTextWriterPtr(n_writer, writer, 0);
44133 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44134 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44135 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44136 xmlResetLastError();
44137 if (mem_base != xmlMemBlocks()) {
44138 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
44139 xmlMemBlocks() - mem_base);
44141 printf(" %d", n_writer);
44142 printf(" %d", n_prefix);
44143 printf(" %d", n_name);
44144 printf(" %d", n_namespaceURI);
44159 test_xmlTextWriterStartCDATA(void) {
44162 #if defined(LIBXML_WRITER_ENABLED)
44165 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44168 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44169 mem_base = xmlMemBlocks();
44170 writer = gen_xmlTextWriterPtr(n_writer, 0);
44172 ret_val = xmlTextWriterStartCDATA(writer);
44173 desret_int(ret_val);
44175 des_xmlTextWriterPtr(n_writer, writer, 0);
44176 xmlResetLastError();
44177 if (mem_base != xmlMemBlocks()) {
44178 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
44179 xmlMemBlocks() - mem_base);
44181 printf(" %d", n_writer);
44193 test_xmlTextWriterStartComment(void) {
44196 #if defined(LIBXML_WRITER_ENABLED)
44199 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44202 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44203 mem_base = xmlMemBlocks();
44204 writer = gen_xmlTextWriterPtr(n_writer, 0);
44206 ret_val = xmlTextWriterStartComment(writer);
44207 desret_int(ret_val);
44209 des_xmlTextWriterPtr(n_writer, writer, 0);
44210 xmlResetLastError();
44211 if (mem_base != xmlMemBlocks()) {
44212 printf("Leak of %d blocks found in xmlTextWriterStartComment",
44213 xmlMemBlocks() - mem_base);
44215 printf(" %d", n_writer);
44227 test_xmlTextWriterStartDTD(void) {
44230 #if defined(LIBXML_WRITER_ENABLED)
44233 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44235 xmlChar * name; /* the name of the DTD */
44237 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44239 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44242 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44243 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44244 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44245 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44246 mem_base = xmlMemBlocks();
44247 writer = gen_xmlTextWriterPtr(n_writer, 0);
44248 name = gen_const_xmlChar_ptr(n_name, 1);
44249 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44250 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44252 ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44253 desret_int(ret_val);
44255 des_xmlTextWriterPtr(n_writer, writer, 0);
44256 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44257 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44258 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44259 xmlResetLastError();
44260 if (mem_base != xmlMemBlocks()) {
44261 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44262 xmlMemBlocks() - mem_base);
44264 printf(" %d", n_writer);
44265 printf(" %d", n_name);
44266 printf(" %d", n_pubid);
44267 printf(" %d", n_sysid);
44282 test_xmlTextWriterStartDTDAttlist(void) {
44285 #if defined(LIBXML_WRITER_ENABLED)
44288 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44290 xmlChar * name; /* the name of the DTD ATTLIST */
44293 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44294 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44295 mem_base = xmlMemBlocks();
44296 writer = gen_xmlTextWriterPtr(n_writer, 0);
44297 name = gen_const_xmlChar_ptr(n_name, 1);
44299 ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44300 desret_int(ret_val);
44302 des_xmlTextWriterPtr(n_writer, writer, 0);
44303 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44304 xmlResetLastError();
44305 if (mem_base != xmlMemBlocks()) {
44306 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44307 xmlMemBlocks() - mem_base);
44309 printf(" %d", n_writer);
44310 printf(" %d", n_name);
44323 test_xmlTextWriterStartDTDElement(void) {
44326 #if defined(LIBXML_WRITER_ENABLED)
44329 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44331 xmlChar * name; /* the name of the DTD element */
44334 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44335 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44336 mem_base = xmlMemBlocks();
44337 writer = gen_xmlTextWriterPtr(n_writer, 0);
44338 name = gen_const_xmlChar_ptr(n_name, 1);
44340 ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44341 desret_int(ret_val);
44343 des_xmlTextWriterPtr(n_writer, writer, 0);
44344 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44345 xmlResetLastError();
44346 if (mem_base != xmlMemBlocks()) {
44347 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44348 xmlMemBlocks() - mem_base);
44350 printf(" %d", n_writer);
44351 printf(" %d", n_name);
44364 test_xmlTextWriterStartDTDEntity(void) {
44367 #if defined(LIBXML_WRITER_ENABLED)
44370 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44372 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44374 xmlChar * name; /* the name of the DTD ATTLIST */
44377 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44378 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44379 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44380 mem_base = xmlMemBlocks();
44381 writer = gen_xmlTextWriterPtr(n_writer, 0);
44382 pe = gen_int(n_pe, 1);
44383 name = gen_const_xmlChar_ptr(n_name, 2);
44385 ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44386 desret_int(ret_val);
44388 des_xmlTextWriterPtr(n_writer, writer, 0);
44389 des_int(n_pe, pe, 1);
44390 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44391 xmlResetLastError();
44392 if (mem_base != xmlMemBlocks()) {
44393 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44394 xmlMemBlocks() - mem_base);
44396 printf(" %d", n_writer);
44397 printf(" %d", n_pe);
44398 printf(" %d", n_name);
44412 test_xmlTextWriterStartDocument(void) {
44415 #if defined(LIBXML_WRITER_ENABLED)
44418 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44420 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44422 char * encoding; /* the encoding or NULL for default */
44424 char * standalone; /* "yes" or "no" or NULL for default */
44427 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44428 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44429 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44430 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44431 mem_base = xmlMemBlocks();
44432 writer = gen_xmlTextWriterPtr(n_writer, 0);
44433 version = gen_const_char_ptr(n_version, 1);
44434 encoding = gen_const_char_ptr(n_encoding, 2);
44435 standalone = gen_const_char_ptr(n_standalone, 3);
44437 ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44438 desret_int(ret_val);
44440 des_xmlTextWriterPtr(n_writer, writer, 0);
44441 des_const_char_ptr(n_version, (const char *)version, 1);
44442 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44443 des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44444 xmlResetLastError();
44445 if (mem_base != xmlMemBlocks()) {
44446 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44447 xmlMemBlocks() - mem_base);
44449 printf(" %d", n_writer);
44450 printf(" %d", n_version);
44451 printf(" %d", n_encoding);
44452 printf(" %d", n_standalone);
44467 test_xmlTextWriterStartElement(void) {
44470 #if defined(LIBXML_WRITER_ENABLED)
44473 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44475 xmlChar * name; /* element name */
44478 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44479 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44480 mem_base = xmlMemBlocks();
44481 writer = gen_xmlTextWriterPtr(n_writer, 0);
44482 name = gen_const_xmlChar_ptr(n_name, 1);
44484 ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44485 desret_int(ret_val);
44487 des_xmlTextWriterPtr(n_writer, writer, 0);
44488 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44489 xmlResetLastError();
44490 if (mem_base != xmlMemBlocks()) {
44491 printf("Leak of %d blocks found in xmlTextWriterStartElement",
44492 xmlMemBlocks() - mem_base);
44494 printf(" %d", n_writer);
44495 printf(" %d", n_name);
44508 test_xmlTextWriterStartElementNS(void) {
44511 #if defined(LIBXML_WRITER_ENABLED)
44514 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44516 xmlChar * prefix; /* namespace prefix or NULL */
44518 xmlChar * name; /* element local name */
44520 xmlChar * namespaceURI; /* namespace URI or NULL */
44521 int n_namespaceURI;
44523 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44524 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44525 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44526 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44527 mem_base = xmlMemBlocks();
44528 writer = gen_xmlTextWriterPtr(n_writer, 0);
44529 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44530 name = gen_const_xmlChar_ptr(n_name, 2);
44531 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44533 ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44534 desret_int(ret_val);
44536 des_xmlTextWriterPtr(n_writer, writer, 0);
44537 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44538 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44539 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44540 xmlResetLastError();
44541 if (mem_base != xmlMemBlocks()) {
44542 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44543 xmlMemBlocks() - mem_base);
44545 printf(" %d", n_writer);
44546 printf(" %d", n_prefix);
44547 printf(" %d", n_name);
44548 printf(" %d", n_namespaceURI);
44563 test_xmlTextWriterStartPI(void) {
44566 #if defined(LIBXML_WRITER_ENABLED)
44569 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44571 xmlChar * target; /* PI target */
44574 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44575 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44576 mem_base = xmlMemBlocks();
44577 writer = gen_xmlTextWriterPtr(n_writer, 0);
44578 target = gen_const_xmlChar_ptr(n_target, 1);
44580 ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44581 desret_int(ret_val);
44583 des_xmlTextWriterPtr(n_writer, writer, 0);
44584 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44585 xmlResetLastError();
44586 if (mem_base != xmlMemBlocks()) {
44587 printf("Leak of %d blocks found in xmlTextWriterStartPI",
44588 xmlMemBlocks() - mem_base);
44590 printf(" %d", n_writer);
44591 printf(" %d", n_target);
44604 test_xmlTextWriterWriteAttribute(void) {
44607 #if defined(LIBXML_WRITER_ENABLED)
44610 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44612 xmlChar * name; /* attribute name */
44614 xmlChar * content; /* attribute content */
44617 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44618 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44619 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44620 mem_base = xmlMemBlocks();
44621 writer = gen_xmlTextWriterPtr(n_writer, 0);
44622 name = gen_const_xmlChar_ptr(n_name, 1);
44623 content = gen_const_xmlChar_ptr(n_content, 2);
44625 ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44626 desret_int(ret_val);
44628 des_xmlTextWriterPtr(n_writer, writer, 0);
44629 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44630 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44631 xmlResetLastError();
44632 if (mem_base != xmlMemBlocks()) {
44633 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44634 xmlMemBlocks() - mem_base);
44636 printf(" %d", n_writer);
44637 printf(" %d", n_name);
44638 printf(" %d", n_content);
44652 test_xmlTextWriterWriteAttributeNS(void) {
44655 #if defined(LIBXML_WRITER_ENABLED)
44658 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44660 xmlChar * prefix; /* namespace prefix */
44662 xmlChar * name; /* attribute local name */
44664 xmlChar * namespaceURI; /* namespace URI */
44665 int n_namespaceURI;
44666 xmlChar * content; /* attribute content */
44669 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44670 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44671 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44672 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44673 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44674 mem_base = xmlMemBlocks();
44675 writer = gen_xmlTextWriterPtr(n_writer, 0);
44676 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44677 name = gen_const_xmlChar_ptr(n_name, 2);
44678 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44679 content = gen_const_xmlChar_ptr(n_content, 4);
44681 ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44682 desret_int(ret_val);
44684 des_xmlTextWriterPtr(n_writer, writer, 0);
44685 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44686 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44687 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44688 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44689 xmlResetLastError();
44690 if (mem_base != xmlMemBlocks()) {
44691 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44692 xmlMemBlocks() - mem_base);
44694 printf(" %d", n_writer);
44695 printf(" %d", n_prefix);
44696 printf(" %d", n_name);
44697 printf(" %d", n_namespaceURI);
44698 printf(" %d", n_content);
44714 test_xmlTextWriterWriteBase64(void) {
44717 #if defined(LIBXML_WRITER_ENABLED)
44720 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44722 char * data; /* binary data */
44724 int start; /* the position within the data of the first byte to encode */
44726 int len; /* the number of bytes to encode */
44729 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44730 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44731 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44732 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44733 mem_base = xmlMemBlocks();
44734 writer = gen_xmlTextWriterPtr(n_writer, 0);
44735 data = gen_const_char_ptr(n_data, 1);
44736 start = gen_int(n_start, 2);
44737 len = gen_int(n_len, 3);
44738 if ((data != NULL) &&
44739 (start > (int) strlen((const char *) data) + 1))
44741 if ((data != NULL) &&
44742 (len > (int) strlen((const char *) data) + 1))
44745 ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44746 desret_int(ret_val);
44748 des_xmlTextWriterPtr(n_writer, writer, 0);
44749 des_const_char_ptr(n_data, (const char *)data, 1);
44750 des_int(n_start, start, 2);
44751 des_int(n_len, len, 3);
44752 xmlResetLastError();
44753 if (mem_base != xmlMemBlocks()) {
44754 printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44755 xmlMemBlocks() - mem_base);
44757 printf(" %d", n_writer);
44758 printf(" %d", n_data);
44759 printf(" %d", n_start);
44760 printf(" %d", n_len);
44775 test_xmlTextWriterWriteBinHex(void) {
44778 #if defined(LIBXML_WRITER_ENABLED)
44781 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44783 char * data; /* binary data */
44785 int start; /* the position within the data of the first byte to encode */
44787 int len; /* the number of bytes to encode */
44790 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44791 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44792 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44793 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44794 mem_base = xmlMemBlocks();
44795 writer = gen_xmlTextWriterPtr(n_writer, 0);
44796 data = gen_const_char_ptr(n_data, 1);
44797 start = gen_int(n_start, 2);
44798 len = gen_int(n_len, 3);
44799 if ((data != NULL) &&
44800 (start > (int) strlen((const char *) data) + 1))
44802 if ((data != NULL) &&
44803 (len > (int) strlen((const char *) data) + 1))
44806 ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44807 desret_int(ret_val);
44809 des_xmlTextWriterPtr(n_writer, writer, 0);
44810 des_const_char_ptr(n_data, (const char *)data, 1);
44811 des_int(n_start, start, 2);
44812 des_int(n_len, len, 3);
44813 xmlResetLastError();
44814 if (mem_base != xmlMemBlocks()) {
44815 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44816 xmlMemBlocks() - mem_base);
44818 printf(" %d", n_writer);
44819 printf(" %d", n_data);
44820 printf(" %d", n_start);
44821 printf(" %d", n_len);
44836 test_xmlTextWriterWriteCDATA(void) {
44839 #if defined(LIBXML_WRITER_ENABLED)
44842 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44844 xmlChar * content; /* CDATA content */
44847 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44848 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44849 mem_base = xmlMemBlocks();
44850 writer = gen_xmlTextWriterPtr(n_writer, 0);
44851 content = gen_const_xmlChar_ptr(n_content, 1);
44853 ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44854 desret_int(ret_val);
44856 des_xmlTextWriterPtr(n_writer, writer, 0);
44857 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44858 xmlResetLastError();
44859 if (mem_base != xmlMemBlocks()) {
44860 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44861 xmlMemBlocks() - mem_base);
44863 printf(" %d", n_writer);
44864 printf(" %d", n_content);
44877 test_xmlTextWriterWriteComment(void) {
44880 #if defined(LIBXML_WRITER_ENABLED)
44883 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44885 xmlChar * content; /* comment string */
44888 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44889 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44890 mem_base = xmlMemBlocks();
44891 writer = gen_xmlTextWriterPtr(n_writer, 0);
44892 content = gen_const_xmlChar_ptr(n_content, 1);
44894 ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44895 desret_int(ret_val);
44897 des_xmlTextWriterPtr(n_writer, writer, 0);
44898 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44899 xmlResetLastError();
44900 if (mem_base != xmlMemBlocks()) {
44901 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44902 xmlMemBlocks() - mem_base);
44904 printf(" %d", n_writer);
44905 printf(" %d", n_content);
44918 test_xmlTextWriterWriteDTD(void) {
44921 #if defined(LIBXML_WRITER_ENABLED)
44924 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44926 xmlChar * name; /* the name of the DTD */
44928 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44930 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44932 xmlChar * subset; /* string content of the DTD */
44935 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44936 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44937 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44938 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44939 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44940 mem_base = xmlMemBlocks();
44941 writer = gen_xmlTextWriterPtr(n_writer, 0);
44942 name = gen_const_xmlChar_ptr(n_name, 1);
44943 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44944 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44945 subset = gen_const_xmlChar_ptr(n_subset, 4);
44947 ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44948 desret_int(ret_val);
44950 des_xmlTextWriterPtr(n_writer, writer, 0);
44951 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44952 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44953 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44954 des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44955 xmlResetLastError();
44956 if (mem_base != xmlMemBlocks()) {
44957 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44958 xmlMemBlocks() - mem_base);
44960 printf(" %d", n_writer);
44961 printf(" %d", n_name);
44962 printf(" %d", n_pubid);
44963 printf(" %d", n_sysid);
44964 printf(" %d", n_subset);
44980 test_xmlTextWriterWriteDTDAttlist(void) {
44983 #if defined(LIBXML_WRITER_ENABLED)
44986 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44988 xmlChar * name; /* the name of the DTD ATTLIST */
44990 xmlChar * content; /* content of the ATTLIST */
44993 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44994 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44995 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44996 mem_base = xmlMemBlocks();
44997 writer = gen_xmlTextWriterPtr(n_writer, 0);
44998 name = gen_const_xmlChar_ptr(n_name, 1);
44999 content = gen_const_xmlChar_ptr(n_content, 2);
45001 ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
45002 desret_int(ret_val);
45004 des_xmlTextWriterPtr(n_writer, writer, 0);
45005 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45006 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45007 xmlResetLastError();
45008 if (mem_base != xmlMemBlocks()) {
45009 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
45010 xmlMemBlocks() - mem_base);
45012 printf(" %d", n_writer);
45013 printf(" %d", n_name);
45014 printf(" %d", n_content);
45028 test_xmlTextWriterWriteDTDElement(void) {
45031 #if defined(LIBXML_WRITER_ENABLED)
45034 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45036 xmlChar * name; /* the name of the DTD element */
45038 xmlChar * content; /* content of the element */
45041 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45042 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45043 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45044 mem_base = xmlMemBlocks();
45045 writer = gen_xmlTextWriterPtr(n_writer, 0);
45046 name = gen_const_xmlChar_ptr(n_name, 1);
45047 content = gen_const_xmlChar_ptr(n_content, 2);
45049 ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45050 desret_int(ret_val);
45052 des_xmlTextWriterPtr(n_writer, writer, 0);
45053 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45054 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45055 xmlResetLastError();
45056 if (mem_base != xmlMemBlocks()) {
45057 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
45058 xmlMemBlocks() - mem_base);
45060 printf(" %d", n_writer);
45061 printf(" %d", n_name);
45062 printf(" %d", n_content);
45076 test_xmlTextWriterWriteDTDEntity(void) {
45079 #if defined(LIBXML_WRITER_ENABLED)
45082 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45084 int pe; /* TRUE if this is a parameter entity, FALSE if not */
45086 xmlChar * name; /* the name of the DTD entity */
45088 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45090 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45092 xmlChar * ndataid; /* the xml notation name. */
45094 xmlChar * content; /* content of the entity */
45097 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45098 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45099 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45100 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45101 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45102 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45103 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45104 mem_base = xmlMemBlocks();
45105 writer = gen_xmlTextWriterPtr(n_writer, 0);
45106 pe = gen_int(n_pe, 1);
45107 name = gen_const_xmlChar_ptr(n_name, 2);
45108 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45109 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45110 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45111 content = gen_const_xmlChar_ptr(n_content, 6);
45113 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
45114 desret_int(ret_val);
45116 des_xmlTextWriterPtr(n_writer, writer, 0);
45117 des_int(n_pe, pe, 1);
45118 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45119 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45120 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45121 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45122 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
45123 xmlResetLastError();
45124 if (mem_base != xmlMemBlocks()) {
45125 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
45126 xmlMemBlocks() - mem_base);
45128 printf(" %d", n_writer);
45129 printf(" %d", n_pe);
45130 printf(" %d", n_name);
45131 printf(" %d", n_pubid);
45132 printf(" %d", n_sysid);
45133 printf(" %d", n_ndataid);
45134 printf(" %d", n_content);
45152 test_xmlTextWriterWriteDTDExternalEntity(void) {
45155 #if defined(LIBXML_WRITER_ENABLED)
45158 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45160 int pe; /* TRUE if this is a parameter entity, FALSE if not */
45162 xmlChar * name; /* the name of the DTD entity */
45164 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45166 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45168 xmlChar * ndataid; /* the xml notation name. */
45171 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45172 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45173 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45174 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45175 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45176 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45177 mem_base = xmlMemBlocks();
45178 writer = gen_xmlTextWriterPtr(n_writer, 0);
45179 pe = gen_int(n_pe, 1);
45180 name = gen_const_xmlChar_ptr(n_name, 2);
45181 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45182 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45183 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45185 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45186 desret_int(ret_val);
45188 des_xmlTextWriterPtr(n_writer, writer, 0);
45189 des_int(n_pe, pe, 1);
45190 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45191 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45192 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45193 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45194 xmlResetLastError();
45195 if (mem_base != xmlMemBlocks()) {
45196 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45197 xmlMemBlocks() - mem_base);
45199 printf(" %d", n_writer);
45200 printf(" %d", n_pe);
45201 printf(" %d", n_name);
45202 printf(" %d", n_pubid);
45203 printf(" %d", n_sysid);
45204 printf(" %d", n_ndataid);
45221 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45224 #if defined(LIBXML_WRITER_ENABLED)
45227 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45229 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45231 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45233 xmlChar * ndataid; /* the xml notation name. */
45236 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45237 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45238 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45239 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45240 mem_base = xmlMemBlocks();
45241 writer = gen_xmlTextWriterPtr(n_writer, 0);
45242 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45243 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45244 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45246 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45247 desret_int(ret_val);
45249 des_xmlTextWriterPtr(n_writer, writer, 0);
45250 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45251 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45252 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45253 xmlResetLastError();
45254 if (mem_base != xmlMemBlocks()) {
45255 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45256 xmlMemBlocks() - mem_base);
45258 printf(" %d", n_writer);
45259 printf(" %d", n_pubid);
45260 printf(" %d", n_sysid);
45261 printf(" %d", n_ndataid);
45276 test_xmlTextWriterWriteDTDInternalEntity(void) {
45279 #if defined(LIBXML_WRITER_ENABLED)
45282 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45284 int pe; /* TRUE if this is a parameter entity, FALSE if not */
45286 xmlChar * name; /* the name of the DTD entity */
45288 xmlChar * content; /* content of the entity */
45291 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45292 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45293 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45294 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45295 mem_base = xmlMemBlocks();
45296 writer = gen_xmlTextWriterPtr(n_writer, 0);
45297 pe = gen_int(n_pe, 1);
45298 name = gen_const_xmlChar_ptr(n_name, 2);
45299 content = gen_const_xmlChar_ptr(n_content, 3);
45301 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45302 desret_int(ret_val);
45304 des_xmlTextWriterPtr(n_writer, writer, 0);
45305 des_int(n_pe, pe, 1);
45306 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45307 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45308 xmlResetLastError();
45309 if (mem_base != xmlMemBlocks()) {
45310 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45311 xmlMemBlocks() - mem_base);
45313 printf(" %d", n_writer);
45314 printf(" %d", n_pe);
45315 printf(" %d", n_name);
45316 printf(" %d", n_content);
45331 test_xmlTextWriterWriteDTDNotation(void) {
45334 #if defined(LIBXML_WRITER_ENABLED)
45337 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45339 xmlChar * name; /* the name of the xml notation */
45341 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45343 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45346 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45347 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45348 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45349 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45350 mem_base = xmlMemBlocks();
45351 writer = gen_xmlTextWriterPtr(n_writer, 0);
45352 name = gen_const_xmlChar_ptr(n_name, 1);
45353 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45354 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45356 ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45357 desret_int(ret_val);
45359 des_xmlTextWriterPtr(n_writer, writer, 0);
45360 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45361 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45362 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45363 xmlResetLastError();
45364 if (mem_base != xmlMemBlocks()) {
45365 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45366 xmlMemBlocks() - mem_base);
45368 printf(" %d", n_writer);
45369 printf(" %d", n_name);
45370 printf(" %d", n_pubid);
45371 printf(" %d", n_sysid);
45386 test_xmlTextWriterWriteElement(void) {
45389 #if defined(LIBXML_WRITER_ENABLED)
45392 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45394 xmlChar * name; /* element name */
45396 xmlChar * content; /* element content */
45399 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45400 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45401 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45402 mem_base = xmlMemBlocks();
45403 writer = gen_xmlTextWriterPtr(n_writer, 0);
45404 name = gen_const_xmlChar_ptr(n_name, 1);
45405 content = gen_const_xmlChar_ptr(n_content, 2);
45407 ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45408 desret_int(ret_val);
45410 des_xmlTextWriterPtr(n_writer, writer, 0);
45411 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45412 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45413 xmlResetLastError();
45414 if (mem_base != xmlMemBlocks()) {
45415 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45416 xmlMemBlocks() - mem_base);
45418 printf(" %d", n_writer);
45419 printf(" %d", n_name);
45420 printf(" %d", n_content);
45434 test_xmlTextWriterWriteElementNS(void) {
45437 #if defined(LIBXML_WRITER_ENABLED)
45440 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45442 xmlChar * prefix; /* namespace prefix */
45444 xmlChar * name; /* element local name */
45446 xmlChar * namespaceURI; /* namespace URI */
45447 int n_namespaceURI;
45448 xmlChar * content; /* element content */
45451 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45452 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45453 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45454 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45455 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45456 mem_base = xmlMemBlocks();
45457 writer = gen_xmlTextWriterPtr(n_writer, 0);
45458 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45459 name = gen_const_xmlChar_ptr(n_name, 2);
45460 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45461 content = gen_const_xmlChar_ptr(n_content, 4);
45463 ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45464 desret_int(ret_val);
45466 des_xmlTextWriterPtr(n_writer, writer, 0);
45467 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45468 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45469 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45470 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45471 xmlResetLastError();
45472 if (mem_base != xmlMemBlocks()) {
45473 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45474 xmlMemBlocks() - mem_base);
45476 printf(" %d", n_writer);
45477 printf(" %d", n_prefix);
45478 printf(" %d", n_name);
45479 printf(" %d", n_namespaceURI);
45480 printf(" %d", n_content);
45496 test_xmlTextWriterWriteFormatAttribute(void) {
45500 /* missing type support */
45506 test_xmlTextWriterWriteFormatAttributeNS(void) {
45510 /* missing type support */
45516 test_xmlTextWriterWriteFormatCDATA(void) {
45520 /* missing type support */
45526 test_xmlTextWriterWriteFormatComment(void) {
45530 /* missing type support */
45536 test_xmlTextWriterWriteFormatDTD(void) {
45540 /* missing type support */
45546 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45550 /* missing type support */
45556 test_xmlTextWriterWriteFormatDTDElement(void) {
45560 /* missing type support */
45566 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45570 /* missing type support */
45576 test_xmlTextWriterWriteFormatElement(void) {
45580 /* missing type support */
45586 test_xmlTextWriterWriteFormatElementNS(void) {
45590 /* missing type support */
45596 test_xmlTextWriterWriteFormatPI(void) {
45600 /* missing type support */
45606 test_xmlTextWriterWriteFormatRaw(void) {
45610 /* missing type support */
45616 test_xmlTextWriterWriteFormatString(void) {
45620 /* missing type support */
45626 test_xmlTextWriterWritePI(void) {
45629 #if defined(LIBXML_WRITER_ENABLED)
45632 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45634 xmlChar * target; /* PI target */
45636 xmlChar * content; /* PI content */
45639 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45640 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45641 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45642 mem_base = xmlMemBlocks();
45643 writer = gen_xmlTextWriterPtr(n_writer, 0);
45644 target = gen_const_xmlChar_ptr(n_target, 1);
45645 content = gen_const_xmlChar_ptr(n_content, 2);
45647 ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45648 desret_int(ret_val);
45650 des_xmlTextWriterPtr(n_writer, writer, 0);
45651 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45652 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45653 xmlResetLastError();
45654 if (mem_base != xmlMemBlocks()) {
45655 printf("Leak of %d blocks found in xmlTextWriterWritePI",
45656 xmlMemBlocks() - mem_base);
45658 printf(" %d", n_writer);
45659 printf(" %d", n_target);
45660 printf(" %d", n_content);
45674 test_xmlTextWriterWriteRaw(void) {
45677 #if defined(LIBXML_WRITER_ENABLED)
45680 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45682 xmlChar * content; /* text string */
45685 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45686 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45687 mem_base = xmlMemBlocks();
45688 writer = gen_xmlTextWriterPtr(n_writer, 0);
45689 content = gen_const_xmlChar_ptr(n_content, 1);
45691 ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45692 desret_int(ret_val);
45694 des_xmlTextWriterPtr(n_writer, writer, 0);
45695 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45696 xmlResetLastError();
45697 if (mem_base != xmlMemBlocks()) {
45698 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45699 xmlMemBlocks() - mem_base);
45701 printf(" %d", n_writer);
45702 printf(" %d", n_content);
45715 test_xmlTextWriterWriteRawLen(void) {
45718 #if defined(LIBXML_WRITER_ENABLED)
45721 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45723 xmlChar * content; /* text string */
45725 int len; /* length of the text string */
45728 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45729 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45730 for (n_len = 0;n_len < gen_nb_int;n_len++) {
45731 mem_base = xmlMemBlocks();
45732 writer = gen_xmlTextWriterPtr(n_writer, 0);
45733 content = gen_const_xmlChar_ptr(n_content, 1);
45734 len = gen_int(n_len, 2);
45735 if ((content != NULL) &&
45736 (len > (int) strlen((const char *) content) + 1))
45739 ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45740 desret_int(ret_val);
45742 des_xmlTextWriterPtr(n_writer, writer, 0);
45743 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45744 des_int(n_len, len, 2);
45745 xmlResetLastError();
45746 if (mem_base != xmlMemBlocks()) {
45747 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45748 xmlMemBlocks() - mem_base);
45750 printf(" %d", n_writer);
45751 printf(" %d", n_content);
45752 printf(" %d", n_len);
45766 test_xmlTextWriterWriteString(void) {
45769 #if defined(LIBXML_WRITER_ENABLED)
45772 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45774 xmlChar * content; /* text string */
45777 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45778 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45779 mem_base = xmlMemBlocks();
45780 writer = gen_xmlTextWriterPtr(n_writer, 0);
45781 content = gen_const_xmlChar_ptr(n_content, 1);
45783 ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45784 desret_int(ret_val);
45786 des_xmlTextWriterPtr(n_writer, writer, 0);
45787 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45788 xmlResetLastError();
45789 if (mem_base != xmlMemBlocks()) {
45790 printf("Leak of %d blocks found in xmlTextWriterWriteString",
45791 xmlMemBlocks() - mem_base);
45793 printf(" %d", n_writer);
45794 printf(" %d", n_content);
45807 test_xmlTextWriterWriteVFormatAttribute(void) {
45811 /* missing type support */
45817 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45821 /* missing type support */
45827 test_xmlTextWriterWriteVFormatCDATA(void) {
45831 /* missing type support */
45837 test_xmlTextWriterWriteVFormatComment(void) {
45841 /* missing type support */
45847 test_xmlTextWriterWriteVFormatDTD(void) {
45851 /* missing type support */
45857 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45861 /* missing type support */
45867 test_xmlTextWriterWriteVFormatDTDElement(void) {
45871 /* missing type support */
45877 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45881 /* missing type support */
45887 test_xmlTextWriterWriteVFormatElement(void) {
45891 /* missing type support */
45897 test_xmlTextWriterWriteVFormatElementNS(void) {
45901 /* missing type support */
45907 test_xmlTextWriterWriteVFormatPI(void) {
45911 /* missing type support */
45917 test_xmlTextWriterWriteVFormatRaw(void) {
45921 /* missing type support */
45927 test_xmlTextWriterWriteVFormatString(void) {
45931 /* missing type support */
45936 test_xmlwriter(void) {
45939 if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45940 test_ret += test_xmlNewTextWriter();
45941 test_ret += test_xmlNewTextWriterFilename();
45942 test_ret += test_xmlNewTextWriterMemory();
45943 test_ret += test_xmlNewTextWriterPushParser();
45944 test_ret += test_xmlNewTextWriterTree();
45945 test_ret += test_xmlTextWriterEndAttribute();
45946 test_ret += test_xmlTextWriterEndCDATA();
45947 test_ret += test_xmlTextWriterEndComment();
45948 test_ret += test_xmlTextWriterEndDTD();
45949 test_ret += test_xmlTextWriterEndDTDAttlist();
45950 test_ret += test_xmlTextWriterEndDTDElement();
45951 test_ret += test_xmlTextWriterEndDTDEntity();
45952 test_ret += test_xmlTextWriterEndDocument();
45953 test_ret += test_xmlTextWriterEndElement();
45954 test_ret += test_xmlTextWriterEndPI();
45955 test_ret += test_xmlTextWriterFlush();
45956 test_ret += test_xmlTextWriterFullEndElement();
45957 test_ret += test_xmlTextWriterSetIndent();
45958 test_ret += test_xmlTextWriterSetIndentString();
45959 test_ret += test_xmlTextWriterSetQuoteChar();
45960 test_ret += test_xmlTextWriterStartAttribute();
45961 test_ret += test_xmlTextWriterStartAttributeNS();
45962 test_ret += test_xmlTextWriterStartCDATA();
45963 test_ret += test_xmlTextWriterStartComment();
45964 test_ret += test_xmlTextWriterStartDTD();
45965 test_ret += test_xmlTextWriterStartDTDAttlist();
45966 test_ret += test_xmlTextWriterStartDTDElement();
45967 test_ret += test_xmlTextWriterStartDTDEntity();
45968 test_ret += test_xmlTextWriterStartDocument();
45969 test_ret += test_xmlTextWriterStartElement();
45970 test_ret += test_xmlTextWriterStartElementNS();
45971 test_ret += test_xmlTextWriterStartPI();
45972 test_ret += test_xmlTextWriterWriteAttribute();
45973 test_ret += test_xmlTextWriterWriteAttributeNS();
45974 test_ret += test_xmlTextWriterWriteBase64();
45975 test_ret += test_xmlTextWriterWriteBinHex();
45976 test_ret += test_xmlTextWriterWriteCDATA();
45977 test_ret += test_xmlTextWriterWriteComment();
45978 test_ret += test_xmlTextWriterWriteDTD();
45979 test_ret += test_xmlTextWriterWriteDTDAttlist();
45980 test_ret += test_xmlTextWriterWriteDTDElement();
45981 test_ret += test_xmlTextWriterWriteDTDEntity();
45982 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45983 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45984 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45985 test_ret += test_xmlTextWriterWriteDTDNotation();
45986 test_ret += test_xmlTextWriterWriteElement();
45987 test_ret += test_xmlTextWriterWriteElementNS();
45988 test_ret += test_xmlTextWriterWriteFormatAttribute();
45989 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45990 test_ret += test_xmlTextWriterWriteFormatCDATA();
45991 test_ret += test_xmlTextWriterWriteFormatComment();
45992 test_ret += test_xmlTextWriterWriteFormatDTD();
45993 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45994 test_ret += test_xmlTextWriterWriteFormatDTDElement();
45995 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45996 test_ret += test_xmlTextWriterWriteFormatElement();
45997 test_ret += test_xmlTextWriterWriteFormatElementNS();
45998 test_ret += test_xmlTextWriterWriteFormatPI();
45999 test_ret += test_xmlTextWriterWriteFormatRaw();
46000 test_ret += test_xmlTextWriterWriteFormatString();
46001 test_ret += test_xmlTextWriterWritePI();
46002 test_ret += test_xmlTextWriterWriteRaw();
46003 test_ret += test_xmlTextWriterWriteRawLen();
46004 test_ret += test_xmlTextWriterWriteString();
46005 test_ret += test_xmlTextWriterWriteVFormatAttribute();
46006 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
46007 test_ret += test_xmlTextWriterWriteVFormatCDATA();
46008 test_ret += test_xmlTextWriterWriteVFormatComment();
46009 test_ret += test_xmlTextWriterWriteVFormatDTD();
46010 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
46011 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
46012 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
46013 test_ret += test_xmlTextWriterWriteVFormatElement();
46014 test_ret += test_xmlTextWriterWriteVFormatElementNS();
46015 test_ret += test_xmlTextWriterWriteVFormatPI();
46016 test_ret += test_xmlTextWriterWriteVFormatRaw();
46017 test_ret += test_xmlTextWriterWriteVFormatString();
46020 printf("Module xmlwriter: %d errors\n", test_ret);
46025 test_xmlXPathCastBooleanToNumber(void) {
46028 #if defined(LIBXML_XPATH_ENABLED)
46031 int val; /* a boolean */
46034 for (n_val = 0;n_val < gen_nb_int;n_val++) {
46035 mem_base = xmlMemBlocks();
46036 val = gen_int(n_val, 0);
46038 ret_val = xmlXPathCastBooleanToNumber(val);
46039 desret_double(ret_val);
46041 des_int(n_val, val, 0);
46042 xmlResetLastError();
46043 if (mem_base != xmlMemBlocks()) {
46044 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
46045 xmlMemBlocks() - mem_base);
46047 printf(" %d", n_val);
46059 test_xmlXPathCastBooleanToString(void) {
46062 #if defined(LIBXML_XPATH_ENABLED)
46065 int val; /* a boolean */
46068 for (n_val = 0;n_val < gen_nb_int;n_val++) {
46069 mem_base = xmlMemBlocks();
46070 val = gen_int(n_val, 0);
46072 ret_val = xmlXPathCastBooleanToString(val);
46073 desret_xmlChar_ptr(ret_val);
46075 des_int(n_val, val, 0);
46076 xmlResetLastError();
46077 if (mem_base != xmlMemBlocks()) {
46078 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
46079 xmlMemBlocks() - mem_base);
46081 printf(" %d", n_val);
46093 test_xmlXPathCastNodeSetToBoolean(void) {
46096 #if defined(LIBXML_XPATH_ENABLED)
46099 xmlNodeSetPtr ns; /* a node-set */
46102 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46103 mem_base = xmlMemBlocks();
46104 ns = gen_xmlNodeSetPtr(n_ns, 0);
46106 ret_val = xmlXPathCastNodeSetToBoolean(ns);
46107 desret_int(ret_val);
46109 des_xmlNodeSetPtr(n_ns, ns, 0);
46110 xmlResetLastError();
46111 if (mem_base != xmlMemBlocks()) {
46112 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
46113 xmlMemBlocks() - mem_base);
46115 printf(" %d", n_ns);
46127 test_xmlXPathCastNodeSetToNumber(void) {
46130 #if defined(LIBXML_XPATH_ENABLED)
46133 xmlNodeSetPtr ns; /* a node-set */
46136 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46137 mem_base = xmlMemBlocks();
46138 ns = gen_xmlNodeSetPtr(n_ns, 0);
46140 ret_val = xmlXPathCastNodeSetToNumber(ns);
46141 desret_double(ret_val);
46143 des_xmlNodeSetPtr(n_ns, ns, 0);
46144 xmlResetLastError();
46145 if (mem_base != xmlMemBlocks()) {
46146 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
46147 xmlMemBlocks() - mem_base);
46149 printf(" %d", n_ns);
46161 test_xmlXPathCastNodeSetToString(void) {
46164 #if defined(LIBXML_XPATH_ENABLED)
46167 xmlNodeSetPtr ns; /* a node-set */
46170 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46171 mem_base = xmlMemBlocks();
46172 ns = gen_xmlNodeSetPtr(n_ns, 0);
46174 ret_val = xmlXPathCastNodeSetToString(ns);
46175 desret_xmlChar_ptr(ret_val);
46177 des_xmlNodeSetPtr(n_ns, ns, 0);
46178 xmlResetLastError();
46179 if (mem_base != xmlMemBlocks()) {
46180 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
46181 xmlMemBlocks() - mem_base);
46183 printf(" %d", n_ns);
46195 test_xmlXPathCastNodeToNumber(void) {
46198 #if defined(LIBXML_XPATH_ENABLED)
46201 xmlNodePtr node; /* a node */
46204 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46205 mem_base = xmlMemBlocks();
46206 node = gen_xmlNodePtr(n_node, 0);
46208 ret_val = xmlXPathCastNodeToNumber(node);
46209 desret_double(ret_val);
46211 des_xmlNodePtr(n_node, node, 0);
46212 xmlResetLastError();
46213 if (mem_base != xmlMemBlocks()) {
46214 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46215 xmlMemBlocks() - mem_base);
46217 printf(" %d", n_node);
46229 test_xmlXPathCastNodeToString(void) {
46232 #if defined(LIBXML_XPATH_ENABLED)
46235 xmlNodePtr node; /* a node */
46238 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46239 mem_base = xmlMemBlocks();
46240 node = gen_xmlNodePtr(n_node, 0);
46242 ret_val = xmlXPathCastNodeToString(node);
46243 desret_xmlChar_ptr(ret_val);
46245 des_xmlNodePtr(n_node, node, 0);
46246 xmlResetLastError();
46247 if (mem_base != xmlMemBlocks()) {
46248 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46249 xmlMemBlocks() - mem_base);
46251 printf(" %d", n_node);
46263 test_xmlXPathCastNumberToBoolean(void) {
46266 #if defined(LIBXML_XPATH_ENABLED)
46269 double val; /* a number */
46272 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46273 mem_base = xmlMemBlocks();
46274 val = gen_double(n_val, 0);
46276 ret_val = xmlXPathCastNumberToBoolean(val);
46277 desret_int(ret_val);
46279 des_double(n_val, val, 0);
46280 xmlResetLastError();
46281 if (mem_base != xmlMemBlocks()) {
46282 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46283 xmlMemBlocks() - mem_base);
46285 printf(" %d", n_val);
46297 test_xmlXPathCastNumberToString(void) {
46300 #if defined(LIBXML_XPATH_ENABLED)
46303 double val; /* a number */
46306 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46307 mem_base = xmlMemBlocks();
46308 val = gen_double(n_val, 0);
46310 ret_val = xmlXPathCastNumberToString(val);
46311 desret_xmlChar_ptr(ret_val);
46313 des_double(n_val, val, 0);
46314 xmlResetLastError();
46315 if (mem_base != xmlMemBlocks()) {
46316 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46317 xmlMemBlocks() - mem_base);
46319 printf(" %d", n_val);
46331 test_xmlXPathCastStringToBoolean(void) {
46334 #if defined(LIBXML_XPATH_ENABLED)
46337 xmlChar * val; /* a string */
46340 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46341 mem_base = xmlMemBlocks();
46342 val = gen_const_xmlChar_ptr(n_val, 0);
46344 ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46345 desret_int(ret_val);
46347 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46348 xmlResetLastError();
46349 if (mem_base != xmlMemBlocks()) {
46350 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46351 xmlMemBlocks() - mem_base);
46353 printf(" %d", n_val);
46365 test_xmlXPathCastStringToNumber(void) {
46368 #if defined(LIBXML_XPATH_ENABLED)
46371 xmlChar * val; /* a string */
46374 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46375 mem_base = xmlMemBlocks();
46376 val = gen_const_xmlChar_ptr(n_val, 0);
46378 ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46379 desret_double(ret_val);
46381 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46382 xmlResetLastError();
46383 if (mem_base != xmlMemBlocks()) {
46384 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46385 xmlMemBlocks() - mem_base);
46387 printf(" %d", n_val);
46399 test_xmlXPathCastToBoolean(void) {
46402 #if defined(LIBXML_XPATH_ENABLED)
46405 xmlXPathObjectPtr val; /* an XPath object */
46408 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46409 mem_base = xmlMemBlocks();
46410 val = gen_xmlXPathObjectPtr(n_val, 0);
46412 ret_val = xmlXPathCastToBoolean(val);
46413 desret_int(ret_val);
46415 des_xmlXPathObjectPtr(n_val, val, 0);
46416 xmlResetLastError();
46417 if (mem_base != xmlMemBlocks()) {
46418 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46419 xmlMemBlocks() - mem_base);
46421 printf(" %d", n_val);
46433 test_xmlXPathCastToNumber(void) {
46436 #if defined(LIBXML_XPATH_ENABLED)
46439 xmlXPathObjectPtr val; /* an XPath object */
46442 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46443 mem_base = xmlMemBlocks();
46444 val = gen_xmlXPathObjectPtr(n_val, 0);
46446 ret_val = xmlXPathCastToNumber(val);
46447 desret_double(ret_val);
46449 des_xmlXPathObjectPtr(n_val, val, 0);
46450 xmlResetLastError();
46451 if (mem_base != xmlMemBlocks()) {
46452 printf("Leak of %d blocks found in xmlXPathCastToNumber",
46453 xmlMemBlocks() - mem_base);
46455 printf(" %d", n_val);
46467 test_xmlXPathCastToString(void) {
46470 #if defined(LIBXML_XPATH_ENABLED)
46473 xmlXPathObjectPtr val; /* an XPath object */
46476 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46477 mem_base = xmlMemBlocks();
46478 val = gen_xmlXPathObjectPtr(n_val, 0);
46480 ret_val = xmlXPathCastToString(val);
46481 desret_xmlChar_ptr(ret_val);
46483 des_xmlXPathObjectPtr(n_val, val, 0);
46484 xmlResetLastError();
46485 if (mem_base != xmlMemBlocks()) {
46486 printf("Leak of %d blocks found in xmlXPathCastToString",
46487 xmlMemBlocks() - mem_base);
46489 printf(" %d", n_val);
46501 test_xmlXPathCmpNodes(void) {
46504 #if defined(LIBXML_XPATH_ENABLED)
46507 xmlNodePtr node1; /* the first node */
46509 xmlNodePtr node2; /* the second node */
46512 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46513 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46514 mem_base = xmlMemBlocks();
46515 node1 = gen_xmlNodePtr(n_node1, 0);
46516 node2 = gen_xmlNodePtr(n_node2, 1);
46518 ret_val = xmlXPathCmpNodes(node1, node2);
46519 desret_int(ret_val);
46521 des_xmlNodePtr(n_node1, node1, 0);
46522 des_xmlNodePtr(n_node2, node2, 1);
46523 xmlResetLastError();
46524 if (mem_base != xmlMemBlocks()) {
46525 printf("Leak of %d blocks found in xmlXPathCmpNodes",
46526 xmlMemBlocks() - mem_base);
46528 printf(" %d", n_node1);
46529 printf(" %d", n_node2);
46542 test_xmlXPathCompile(void) {
46546 /* missing type support */
46550 #ifdef LIBXML_XPATH_ENABLED
46552 #define gen_nb_xmlXPathCompExprPtr 1
46553 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46556 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46560 #ifdef LIBXML_XPATH_ENABLED
46562 #define gen_nb_xmlXPathContextPtr 1
46563 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46566 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46572 test_xmlXPathCompiledEval(void) {
46575 #if defined(LIBXML_XPATH_ENABLED)
46577 xmlXPathObjectPtr ret_val;
46578 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46580 xmlXPathContextPtr ctx; /* the XPath context */
46583 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46584 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46585 mem_base = xmlMemBlocks();
46586 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46587 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46589 ret_val = xmlXPathCompiledEval(comp, ctx);
46590 desret_xmlXPathObjectPtr(ret_val);
46592 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46593 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46594 xmlResetLastError();
46595 if (mem_base != xmlMemBlocks()) {
46596 printf("Leak of %d blocks found in xmlXPathCompiledEval",
46597 xmlMemBlocks() - mem_base);
46599 printf(" %d", n_comp);
46600 printf(" %d", n_ctx);
46613 test_xmlXPathCompiledEvalToBoolean(void) {
46616 #if defined(LIBXML_XPATH_ENABLED)
46619 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46621 xmlXPathContextPtr ctxt; /* the XPath context */
46624 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46625 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46626 mem_base = xmlMemBlocks();
46627 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46628 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46630 ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46631 desret_int(ret_val);
46633 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46634 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46635 xmlResetLastError();
46636 if (mem_base != xmlMemBlocks()) {
46637 printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46638 xmlMemBlocks() - mem_base);
46640 printf(" %d", n_comp);
46641 printf(" %d", n_ctxt);
46654 test_xmlXPathContextSetCache(void) {
46657 #if defined(LIBXML_XPATH_ENABLED)
46660 xmlXPathContextPtr ctxt; /* the XPath context */
46662 int active; /* enables/disables (creates/frees) the cache */
46664 int value; /* a value with semantics dependant on @options */
46666 int options; /* options (currently only the value 0 is used) */
46669 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46670 for (n_active = 0;n_active < gen_nb_int;n_active++) {
46671 for (n_value = 0;n_value < gen_nb_int;n_value++) {
46672 for (n_options = 0;n_options < gen_nb_int;n_options++) {
46673 mem_base = xmlMemBlocks();
46674 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46675 active = gen_int(n_active, 1);
46676 value = gen_int(n_value, 2);
46677 options = gen_int(n_options, 3);
46679 ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46680 desret_int(ret_val);
46682 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46683 des_int(n_active, active, 1);
46684 des_int(n_value, value, 2);
46685 des_int(n_options, options, 3);
46686 xmlResetLastError();
46687 if (mem_base != xmlMemBlocks()) {
46688 printf("Leak of %d blocks found in xmlXPathContextSetCache",
46689 xmlMemBlocks() - mem_base);
46691 printf(" %d", n_ctxt);
46692 printf(" %d", n_active);
46693 printf(" %d", n_value);
46694 printf(" %d", n_options);
46709 test_xmlXPathConvertBoolean(void) {
46712 #if defined(LIBXML_XPATH_ENABLED)
46714 xmlXPathObjectPtr ret_val;
46715 xmlXPathObjectPtr val; /* an XPath object */
46718 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46719 mem_base = xmlMemBlocks();
46720 val = gen_xmlXPathObjectPtr(n_val, 0);
46722 ret_val = xmlXPathConvertBoolean(val);
46724 desret_xmlXPathObjectPtr(ret_val);
46726 des_xmlXPathObjectPtr(n_val, val, 0);
46727 xmlResetLastError();
46728 if (mem_base != xmlMemBlocks()) {
46729 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46730 xmlMemBlocks() - mem_base);
46732 printf(" %d", n_val);
46744 test_xmlXPathConvertNumber(void) {
46747 #if defined(LIBXML_XPATH_ENABLED)
46749 xmlXPathObjectPtr ret_val;
46750 xmlXPathObjectPtr val; /* an XPath object */
46753 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46754 mem_base = xmlMemBlocks();
46755 val = gen_xmlXPathObjectPtr(n_val, 0);
46757 ret_val = xmlXPathConvertNumber(val);
46759 desret_xmlXPathObjectPtr(ret_val);
46761 des_xmlXPathObjectPtr(n_val, val, 0);
46762 xmlResetLastError();
46763 if (mem_base != xmlMemBlocks()) {
46764 printf("Leak of %d blocks found in xmlXPathConvertNumber",
46765 xmlMemBlocks() - mem_base);
46767 printf(" %d", n_val);
46779 test_xmlXPathConvertString(void) {
46782 #if defined(LIBXML_XPATH_ENABLED)
46784 xmlXPathObjectPtr ret_val;
46785 xmlXPathObjectPtr val; /* an XPath object */
46788 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46789 mem_base = xmlMemBlocks();
46790 val = gen_xmlXPathObjectPtr(n_val, 0);
46792 ret_val = xmlXPathConvertString(val);
46794 desret_xmlXPathObjectPtr(ret_val);
46796 des_xmlXPathObjectPtr(n_val, val, 0);
46797 xmlResetLastError();
46798 if (mem_base != xmlMemBlocks()) {
46799 printf("Leak of %d blocks found in xmlXPathConvertString",
46800 xmlMemBlocks() - mem_base);
46802 printf(" %d", n_val);
46814 test_xmlXPathCtxtCompile(void) {
46818 /* missing type support */
46824 test_xmlXPathEval(void) {
46827 #if defined(LIBXML_XPATH_ENABLED)
46829 xmlXPathObjectPtr ret_val;
46830 xmlChar * str; /* the XPath expression */
46832 xmlXPathContextPtr ctx; /* the XPath context */
46835 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46836 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46837 mem_base = xmlMemBlocks();
46838 str = gen_const_xmlChar_ptr(n_str, 0);
46839 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46841 ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46842 desret_xmlXPathObjectPtr(ret_val);
46844 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46845 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46846 xmlResetLastError();
46847 if (mem_base != xmlMemBlocks()) {
46848 printf("Leak of %d blocks found in xmlXPathEval",
46849 xmlMemBlocks() - mem_base);
46851 printf(" %d", n_str);
46852 printf(" %d", n_ctx);
46865 test_xmlXPathEvalExpression(void) {
46868 #if defined(LIBXML_XPATH_ENABLED)
46870 xmlXPathObjectPtr ret_val;
46871 xmlChar * str; /* the XPath expression */
46873 xmlXPathContextPtr ctxt; /* the XPath context */
46876 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46877 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46878 mem_base = xmlMemBlocks();
46879 str = gen_const_xmlChar_ptr(n_str, 0);
46880 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46882 ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46883 desret_xmlXPathObjectPtr(ret_val);
46885 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46886 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46887 xmlResetLastError();
46888 if (mem_base != xmlMemBlocks()) {
46889 printf("Leak of %d blocks found in xmlXPathEvalExpression",
46890 xmlMemBlocks() - mem_base);
46892 printf(" %d", n_str);
46893 printf(" %d", n_ctxt);
46906 test_xmlXPathEvalPredicate(void) {
46909 #if defined(LIBXML_XPATH_ENABLED)
46912 xmlXPathContextPtr ctxt; /* the XPath context */
46914 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46917 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46918 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46919 mem_base = xmlMemBlocks();
46920 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46921 res = gen_xmlXPathObjectPtr(n_res, 1);
46923 ret_val = xmlXPathEvalPredicate(ctxt, res);
46924 desret_int(ret_val);
46926 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46927 des_xmlXPathObjectPtr(n_res, res, 1);
46928 xmlResetLastError();
46929 if (mem_base != xmlMemBlocks()) {
46930 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46931 xmlMemBlocks() - mem_base);
46933 printf(" %d", n_ctxt);
46934 printf(" %d", n_res);
46947 test_xmlXPathInit(void) {
46950 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46953 mem_base = xmlMemBlocks();
46957 xmlResetLastError();
46958 if (mem_base != xmlMemBlocks()) {
46959 printf("Leak of %d blocks found in xmlXPathInit",
46960 xmlMemBlocks() - mem_base);
46972 test_xmlXPathIsInf(void) {
46975 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46978 double val; /* a double value */
46981 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46982 mem_base = xmlMemBlocks();
46983 val = gen_double(n_val, 0);
46985 ret_val = xmlXPathIsInf(val);
46986 desret_int(ret_val);
46988 des_double(n_val, val, 0);
46989 xmlResetLastError();
46990 if (mem_base != xmlMemBlocks()) {
46991 printf("Leak of %d blocks found in xmlXPathIsInf",
46992 xmlMemBlocks() - mem_base);
46994 printf(" %d", n_val);
47006 test_xmlXPathIsNaN(void) {
47009 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
47012 double val; /* a double value */
47015 for (n_val = 0;n_val < gen_nb_double;n_val++) {
47016 mem_base = xmlMemBlocks();
47017 val = gen_double(n_val, 0);
47019 ret_val = xmlXPathIsNaN(val);
47020 desret_int(ret_val);
47022 des_double(n_val, val, 0);
47023 xmlResetLastError();
47024 if (mem_base != xmlMemBlocks()) {
47025 printf("Leak of %d blocks found in xmlXPathIsNaN",
47026 xmlMemBlocks() - mem_base);
47028 printf(" %d", n_val);
47040 test_xmlXPathNewContext(void) {
47044 /* missing type support */
47050 test_xmlXPathNodeEval(void) {
47053 #if defined(LIBXML_XPATH_ENABLED)
47055 xmlXPathObjectPtr ret_val;
47056 xmlNodePtr node; /* the node to to use as the context node */
47058 xmlChar * str; /* the XPath expression */
47060 xmlXPathContextPtr ctx; /* the XPath context */
47063 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47064 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47065 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47066 mem_base = xmlMemBlocks();
47067 node = gen_xmlNodePtr(n_node, 0);
47068 str = gen_const_xmlChar_ptr(n_str, 1);
47069 ctx = gen_xmlXPathContextPtr(n_ctx, 2);
47071 ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
47072 desret_xmlXPathObjectPtr(ret_val);
47074 des_xmlNodePtr(n_node, node, 0);
47075 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
47076 des_xmlXPathContextPtr(n_ctx, ctx, 2);
47077 xmlResetLastError();
47078 if (mem_base != xmlMemBlocks()) {
47079 printf("Leak of %d blocks found in xmlXPathNodeEval",
47080 xmlMemBlocks() - mem_base);
47082 printf(" %d", n_node);
47083 printf(" %d", n_str);
47084 printf(" %d", n_ctx);
47098 test_xmlXPathNodeSetCreate(void) {
47101 #if defined(LIBXML_XPATH_ENABLED)
47103 xmlNodeSetPtr ret_val;
47104 xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
47107 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47108 mem_base = xmlMemBlocks();
47109 val = gen_xmlNodePtr(n_val, 0);
47111 ret_val = xmlXPathNodeSetCreate(val);
47112 desret_xmlNodeSetPtr(ret_val);
47114 des_xmlNodePtr(n_val, val, 0);
47115 xmlResetLastError();
47116 if (mem_base != xmlMemBlocks()) {
47117 printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
47118 xmlMemBlocks() - mem_base);
47120 printf(" %d", n_val);
47132 test_xmlXPathObjectCopy(void) {
47135 #if defined(LIBXML_XPATH_ENABLED)
47137 xmlXPathObjectPtr ret_val;
47138 xmlXPathObjectPtr val; /* the original object */
47141 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47142 mem_base = xmlMemBlocks();
47143 val = gen_xmlXPathObjectPtr(n_val, 0);
47145 ret_val = xmlXPathObjectCopy(val);
47146 desret_xmlXPathObjectPtr(ret_val);
47148 des_xmlXPathObjectPtr(n_val, val, 0);
47149 xmlResetLastError();
47150 if (mem_base != xmlMemBlocks()) {
47151 printf("Leak of %d blocks found in xmlXPathObjectCopy",
47152 xmlMemBlocks() - mem_base);
47154 printf(" %d", n_val);
47166 test_xmlXPathOrderDocElems(void) {
47169 #if defined(LIBXML_XPATH_ENABLED)
47172 xmlDocPtr doc; /* an input document */
47175 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
47176 mem_base = xmlMemBlocks();
47177 doc = gen_xmlDocPtr(n_doc, 0);
47179 ret_val = xmlXPathOrderDocElems(doc);
47180 desret_long(ret_val);
47182 des_xmlDocPtr(n_doc, doc, 0);
47183 xmlResetLastError();
47184 if (mem_base != xmlMemBlocks()) {
47185 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
47186 xmlMemBlocks() - mem_base);
47188 printf(" %d", n_doc);
47200 test_xmlXPathSetContextNode(void) {
47203 #if defined(LIBXML_XPATH_ENABLED)
47206 xmlNodePtr node; /* the node to to use as the context node */
47208 xmlXPathContextPtr ctx; /* the XPath context */
47211 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47212 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47213 mem_base = xmlMemBlocks();
47214 node = gen_xmlNodePtr(n_node, 0);
47215 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47217 ret_val = xmlXPathSetContextNode(node, ctx);
47218 desret_int(ret_val);
47220 des_xmlNodePtr(n_node, node, 0);
47221 des_xmlXPathContextPtr(n_ctx, ctx, 1);
47222 xmlResetLastError();
47223 if (mem_base != xmlMemBlocks()) {
47224 printf("Leak of %d blocks found in xmlXPathSetContextNode",
47225 xmlMemBlocks() - mem_base);
47227 printf(" %d", n_node);
47228 printf(" %d", n_ctx);
47243 if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47244 test_ret += test_xmlXPathCastBooleanToNumber();
47245 test_ret += test_xmlXPathCastBooleanToString();
47246 test_ret += test_xmlXPathCastNodeSetToBoolean();
47247 test_ret += test_xmlXPathCastNodeSetToNumber();
47248 test_ret += test_xmlXPathCastNodeSetToString();
47249 test_ret += test_xmlXPathCastNodeToNumber();
47250 test_ret += test_xmlXPathCastNodeToString();
47251 test_ret += test_xmlXPathCastNumberToBoolean();
47252 test_ret += test_xmlXPathCastNumberToString();
47253 test_ret += test_xmlXPathCastStringToBoolean();
47254 test_ret += test_xmlXPathCastStringToNumber();
47255 test_ret += test_xmlXPathCastToBoolean();
47256 test_ret += test_xmlXPathCastToNumber();
47257 test_ret += test_xmlXPathCastToString();
47258 test_ret += test_xmlXPathCmpNodes();
47259 test_ret += test_xmlXPathCompile();
47260 test_ret += test_xmlXPathCompiledEval();
47261 test_ret += test_xmlXPathCompiledEvalToBoolean();
47262 test_ret += test_xmlXPathContextSetCache();
47263 test_ret += test_xmlXPathConvertBoolean();
47264 test_ret += test_xmlXPathConvertNumber();
47265 test_ret += test_xmlXPathConvertString();
47266 test_ret += test_xmlXPathCtxtCompile();
47267 test_ret += test_xmlXPathEval();
47268 test_ret += test_xmlXPathEvalExpression();
47269 test_ret += test_xmlXPathEvalPredicate();
47270 test_ret += test_xmlXPathInit();
47271 test_ret += test_xmlXPathIsInf();
47272 test_ret += test_xmlXPathIsNaN();
47273 test_ret += test_xmlXPathNewContext();
47274 test_ret += test_xmlXPathNodeEval();
47275 test_ret += test_xmlXPathNodeSetCreate();
47276 test_ret += test_xmlXPathObjectCopy();
47277 test_ret += test_xmlXPathOrderDocElems();
47278 test_ret += test_xmlXPathSetContextNode();
47281 printf("Module xpath: %d errors\n", test_ret);
47284 #ifdef LIBXML_XPATH_ENABLED
47286 #define gen_nb_xmlXPathParserContextPtr 1
47287 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47290 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47296 test_valuePop(void) {
47299 #if defined(LIBXML_XPATH_ENABLED)
47301 xmlXPathObjectPtr ret_val;
47302 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47305 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47306 mem_base = xmlMemBlocks();
47307 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47309 ret_val = valuePop(ctxt);
47310 desret_xmlXPathObjectPtr(ret_val);
47312 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47313 xmlResetLastError();
47314 if (mem_base != xmlMemBlocks()) {
47315 printf("Leak of %d blocks found in valuePop",
47316 xmlMemBlocks() - mem_base);
47318 printf(" %d", n_ctxt);
47330 test_valuePush(void) {
47333 #if defined(LIBXML_XPATH_ENABLED)
47336 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47338 xmlXPathObjectPtr value; /* the XPath object */
47341 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47342 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47343 mem_base = xmlMemBlocks();
47344 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47345 value = gen_xmlXPathObjectPtr(n_value, 1);
47347 ret_val = valuePush(ctxt, value);
47348 desret_int(ret_val);
47350 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47351 des_xmlXPathObjectPtr(n_value, value, 1);
47352 xmlResetLastError();
47353 if (mem_base != xmlMemBlocks()) {
47354 printf("Leak of %d blocks found in valuePush",
47355 xmlMemBlocks() - mem_base);
47357 printf(" %d", n_ctxt);
47358 printf(" %d", n_value);
47371 test_xmlXPathAddValues(void) {
47374 #if defined(LIBXML_XPATH_ENABLED)
47376 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47379 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47380 mem_base = xmlMemBlocks();
47381 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47383 xmlXPathAddValues(ctxt);
47385 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47386 xmlResetLastError();
47387 if (mem_base != xmlMemBlocks()) {
47388 printf("Leak of %d blocks found in xmlXPathAddValues",
47389 xmlMemBlocks() - mem_base);
47391 printf(" %d", n_ctxt);
47403 test_xmlXPathBooleanFunction(void) {
47406 #if defined(LIBXML_XPATH_ENABLED)
47408 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47410 int nargs; /* the number of arguments */
47413 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47414 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47415 mem_base = xmlMemBlocks();
47416 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47417 nargs = gen_int(n_nargs, 1);
47419 xmlXPathBooleanFunction(ctxt, nargs);
47421 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47422 des_int(n_nargs, nargs, 1);
47423 xmlResetLastError();
47424 if (mem_base != xmlMemBlocks()) {
47425 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47426 xmlMemBlocks() - mem_base);
47428 printf(" %d", n_ctxt);
47429 printf(" %d", n_nargs);
47442 test_xmlXPathCeilingFunction(void) {
47445 #if defined(LIBXML_XPATH_ENABLED)
47447 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47449 int nargs; /* the number of arguments */
47452 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47453 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47454 mem_base = xmlMemBlocks();
47455 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47456 nargs = gen_int(n_nargs, 1);
47458 xmlXPathCeilingFunction(ctxt, nargs);
47460 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47461 des_int(n_nargs, nargs, 1);
47462 xmlResetLastError();
47463 if (mem_base != xmlMemBlocks()) {
47464 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47465 xmlMemBlocks() - mem_base);
47467 printf(" %d", n_ctxt);
47468 printf(" %d", n_nargs);
47481 test_xmlXPathCompareValues(void) {
47484 #if defined(LIBXML_XPATH_ENABLED)
47487 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47489 int inf; /* less than (1) or greater than (0) */
47491 int strict; /* is the comparison strict */
47494 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47495 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47496 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47497 mem_base = xmlMemBlocks();
47498 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47499 inf = gen_int(n_inf, 1);
47500 strict = gen_int(n_strict, 2);
47502 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47503 desret_int(ret_val);
47505 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47506 des_int(n_inf, inf, 1);
47507 des_int(n_strict, strict, 2);
47508 xmlResetLastError();
47509 if (mem_base != xmlMemBlocks()) {
47510 printf("Leak of %d blocks found in xmlXPathCompareValues",
47511 xmlMemBlocks() - mem_base);
47513 printf(" %d", n_ctxt);
47514 printf(" %d", n_inf);
47515 printf(" %d", n_strict);
47529 test_xmlXPathConcatFunction(void) {
47532 #if defined(LIBXML_XPATH_ENABLED)
47534 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47536 int nargs; /* the number of arguments */
47539 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47540 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47541 mem_base = xmlMemBlocks();
47542 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47543 nargs = gen_int(n_nargs, 1);
47545 xmlXPathConcatFunction(ctxt, nargs);
47547 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47548 des_int(n_nargs, nargs, 1);
47549 xmlResetLastError();
47550 if (mem_base != xmlMemBlocks()) {
47551 printf("Leak of %d blocks found in xmlXPathConcatFunction",
47552 xmlMemBlocks() - mem_base);
47554 printf(" %d", n_ctxt);
47555 printf(" %d", n_nargs);
47568 test_xmlXPathContainsFunction(void) {
47571 #if defined(LIBXML_XPATH_ENABLED)
47573 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47575 int nargs; /* the number of arguments */
47578 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47579 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47580 mem_base = xmlMemBlocks();
47581 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47582 nargs = gen_int(n_nargs, 1);
47584 xmlXPathContainsFunction(ctxt, nargs);
47586 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47587 des_int(n_nargs, nargs, 1);
47588 xmlResetLastError();
47589 if (mem_base != xmlMemBlocks()) {
47590 printf("Leak of %d blocks found in xmlXPathContainsFunction",
47591 xmlMemBlocks() - mem_base);
47593 printf(" %d", n_ctxt);
47594 printf(" %d", n_nargs);
47607 test_xmlXPathCountFunction(void) {
47610 #if defined(LIBXML_XPATH_ENABLED)
47612 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47614 int nargs; /* the number of arguments */
47617 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47618 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47619 mem_base = xmlMemBlocks();
47620 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47621 nargs = gen_int(n_nargs, 1);
47623 xmlXPathCountFunction(ctxt, nargs);
47625 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47626 des_int(n_nargs, nargs, 1);
47627 xmlResetLastError();
47628 if (mem_base != xmlMemBlocks()) {
47629 printf("Leak of %d blocks found in xmlXPathCountFunction",
47630 xmlMemBlocks() - mem_base);
47632 printf(" %d", n_ctxt);
47633 printf(" %d", n_nargs);
47646 test_xmlXPathDebugDumpCompExpr(void) {
47649 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47651 FILE * output; /* the FILE * for the output */
47653 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47655 int depth; /* the indentation level. */
47658 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47659 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47660 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47661 mem_base = xmlMemBlocks();
47662 output = gen_FILE_ptr(n_output, 0);
47663 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47664 depth = gen_int(n_depth, 2);
47666 xmlXPathDebugDumpCompExpr(output, comp, depth);
47668 des_FILE_ptr(n_output, output, 0);
47669 des_xmlXPathCompExprPtr(n_comp, comp, 1);
47670 des_int(n_depth, depth, 2);
47671 xmlResetLastError();
47672 if (mem_base != xmlMemBlocks()) {
47673 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47674 xmlMemBlocks() - mem_base);
47676 printf(" %d", n_output);
47677 printf(" %d", n_comp);
47678 printf(" %d", n_depth);
47692 test_xmlXPathDebugDumpObject(void) {
47695 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47697 FILE * output; /* the FILE * to dump the output */
47699 xmlXPathObjectPtr cur; /* the object to inspect */
47701 int depth; /* indentation level */
47704 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47705 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47706 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47707 mem_base = xmlMemBlocks();
47708 output = gen_FILE_ptr(n_output, 0);
47709 cur = gen_xmlXPathObjectPtr(n_cur, 1);
47710 depth = gen_int(n_depth, 2);
47712 xmlXPathDebugDumpObject(output, cur, depth);
47714 des_FILE_ptr(n_output, output, 0);
47715 des_xmlXPathObjectPtr(n_cur, cur, 1);
47716 des_int(n_depth, depth, 2);
47717 xmlResetLastError();
47718 if (mem_base != xmlMemBlocks()) {
47719 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47720 xmlMemBlocks() - mem_base);
47722 printf(" %d", n_output);
47723 printf(" %d", n_cur);
47724 printf(" %d", n_depth);
47738 test_xmlXPathDifference(void) {
47741 #if defined(LIBXML_XPATH_ENABLED)
47743 xmlNodeSetPtr ret_val;
47744 xmlNodeSetPtr nodes1; /* a node-set */
47746 xmlNodeSetPtr nodes2; /* a node-set */
47749 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47750 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47751 mem_base = xmlMemBlocks();
47752 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47753 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47755 ret_val = xmlXPathDifference(nodes1, nodes2);
47756 desret_xmlNodeSetPtr(ret_val);
47758 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47759 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47760 xmlResetLastError();
47761 if (mem_base != xmlMemBlocks()) {
47762 printf("Leak of %d blocks found in xmlXPathDifference",
47763 xmlMemBlocks() - mem_base);
47765 printf(" %d", n_nodes1);
47766 printf(" %d", n_nodes2);
47779 test_xmlXPathDistinct(void) {
47782 #if defined(LIBXML_XPATH_ENABLED)
47784 xmlNodeSetPtr ret_val;
47785 xmlNodeSetPtr nodes; /* a node-set */
47788 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47789 mem_base = xmlMemBlocks();
47790 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47792 ret_val = xmlXPathDistinct(nodes);
47793 desret_xmlNodeSetPtr(ret_val);
47795 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47796 xmlResetLastError();
47797 if (mem_base != xmlMemBlocks()) {
47798 printf("Leak of %d blocks found in xmlXPathDistinct",
47799 xmlMemBlocks() - mem_base);
47801 printf(" %d", n_nodes);
47813 test_xmlXPathDistinctSorted(void) {
47816 #if defined(LIBXML_XPATH_ENABLED)
47818 xmlNodeSetPtr ret_val;
47819 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47822 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47823 mem_base = xmlMemBlocks();
47824 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47826 ret_val = xmlXPathDistinctSorted(nodes);
47827 desret_xmlNodeSetPtr(ret_val);
47829 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47830 xmlResetLastError();
47831 if (mem_base != xmlMemBlocks()) {
47832 printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47833 xmlMemBlocks() - mem_base);
47835 printf(" %d", n_nodes);
47847 test_xmlXPathDivValues(void) {
47850 #if defined(LIBXML_XPATH_ENABLED)
47852 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47855 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47856 mem_base = xmlMemBlocks();
47857 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47859 xmlXPathDivValues(ctxt);
47861 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47862 xmlResetLastError();
47863 if (mem_base != xmlMemBlocks()) {
47864 printf("Leak of %d blocks found in xmlXPathDivValues",
47865 xmlMemBlocks() - mem_base);
47867 printf(" %d", n_ctxt);
47879 test_xmlXPathEqualValues(void) {
47882 #if defined(LIBXML_XPATH_ENABLED)
47885 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47889 mem_base = xmlMemBlocks();
47890 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47892 ret_val = xmlXPathEqualValues(ctxt);
47893 desret_int(ret_val);
47895 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47896 xmlResetLastError();
47897 if (mem_base != xmlMemBlocks()) {
47898 printf("Leak of %d blocks found in xmlXPathEqualValues",
47899 xmlMemBlocks() - mem_base);
47901 printf(" %d", n_ctxt);
47913 test_xmlXPathErr(void) {
47916 #if defined(LIBXML_XPATH_ENABLED)
47918 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47920 int error; /* the error code */
47923 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47924 for (n_error = 0;n_error < gen_nb_int;n_error++) {
47925 mem_base = xmlMemBlocks();
47926 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47927 error = gen_int(n_error, 1);
47929 xmlXPathErr(ctxt, error);
47931 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47932 des_int(n_error, error, 1);
47933 xmlResetLastError();
47934 if (mem_base != xmlMemBlocks()) {
47935 printf("Leak of %d blocks found in xmlXPathErr",
47936 xmlMemBlocks() - mem_base);
47938 printf(" %d", n_ctxt);
47939 printf(" %d", n_error);
47952 test_xmlXPathEvalExpr(void) {
47955 #if defined(LIBXML_XPATH_ENABLED)
47957 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47960 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47961 mem_base = xmlMemBlocks();
47962 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47964 xmlXPathEvalExpr(ctxt);
47966 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47967 xmlResetLastError();
47968 if (mem_base != xmlMemBlocks()) {
47969 printf("Leak of %d blocks found in xmlXPathEvalExpr",
47970 xmlMemBlocks() - mem_base);
47972 printf(" %d", n_ctxt);
47984 test_xmlXPathEvaluatePredicateResult(void) {
47987 #if defined(LIBXML_XPATH_ENABLED)
47990 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47992 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47995 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47996 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47997 mem_base = xmlMemBlocks();
47998 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47999 res = gen_xmlXPathObjectPtr(n_res, 1);
48001 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
48002 desret_int(ret_val);
48004 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48005 des_xmlXPathObjectPtr(n_res, res, 1);
48006 xmlResetLastError();
48007 if (mem_base != xmlMemBlocks()) {
48008 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
48009 xmlMemBlocks() - mem_base);
48011 printf(" %d", n_ctxt);
48012 printf(" %d", n_res);
48025 test_xmlXPathFalseFunction(void) {
48028 #if defined(LIBXML_XPATH_ENABLED)
48030 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48032 int nargs; /* the number of arguments */
48035 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48036 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48037 mem_base = xmlMemBlocks();
48038 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48039 nargs = gen_int(n_nargs, 1);
48041 xmlXPathFalseFunction(ctxt, nargs);
48043 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48044 des_int(n_nargs, nargs, 1);
48045 xmlResetLastError();
48046 if (mem_base != xmlMemBlocks()) {
48047 printf("Leak of %d blocks found in xmlXPathFalseFunction",
48048 xmlMemBlocks() - mem_base);
48050 printf(" %d", n_ctxt);
48051 printf(" %d", n_nargs);
48064 test_xmlXPathFloorFunction(void) {
48067 #if defined(LIBXML_XPATH_ENABLED)
48069 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48071 int nargs; /* the number of arguments */
48074 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48075 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48076 mem_base = xmlMemBlocks();
48077 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48078 nargs = gen_int(n_nargs, 1);
48080 xmlXPathFloorFunction(ctxt, nargs);
48082 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48083 des_int(n_nargs, nargs, 1);
48084 xmlResetLastError();
48085 if (mem_base != xmlMemBlocks()) {
48086 printf("Leak of %d blocks found in xmlXPathFloorFunction",
48087 xmlMemBlocks() - mem_base);
48089 printf(" %d", n_ctxt);
48090 printf(" %d", n_nargs);
48103 test_xmlXPathFunctionLookup(void) {
48107 /* missing type support */
48113 test_xmlXPathFunctionLookupNS(void) {
48117 /* missing type support */
48123 test_xmlXPathHasSameNodes(void) {
48126 #if defined(LIBXML_XPATH_ENABLED)
48129 xmlNodeSetPtr nodes1; /* a node-set */
48131 xmlNodeSetPtr nodes2; /* a node-set */
48134 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48135 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48136 mem_base = xmlMemBlocks();
48137 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48138 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48140 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
48141 desret_int(ret_val);
48143 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48144 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48145 xmlResetLastError();
48146 if (mem_base != xmlMemBlocks()) {
48147 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
48148 xmlMemBlocks() - mem_base);
48150 printf(" %d", n_nodes1);
48151 printf(" %d", n_nodes2);
48164 test_xmlXPathIdFunction(void) {
48167 #if defined(LIBXML_XPATH_ENABLED)
48169 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48171 int nargs; /* the number of arguments */
48174 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48175 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48176 mem_base = xmlMemBlocks();
48177 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48178 nargs = gen_int(n_nargs, 1);
48180 xmlXPathIdFunction(ctxt, nargs);
48182 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48183 des_int(n_nargs, nargs, 1);
48184 xmlResetLastError();
48185 if (mem_base != xmlMemBlocks()) {
48186 printf("Leak of %d blocks found in xmlXPathIdFunction",
48187 xmlMemBlocks() - mem_base);
48189 printf(" %d", n_ctxt);
48190 printf(" %d", n_nargs);
48203 test_xmlXPathIntersection(void) {
48206 #if defined(LIBXML_XPATH_ENABLED)
48208 xmlNodeSetPtr ret_val;
48209 xmlNodeSetPtr nodes1; /* a node-set */
48211 xmlNodeSetPtr nodes2; /* a node-set */
48214 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48215 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48216 mem_base = xmlMemBlocks();
48217 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48218 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48220 ret_val = xmlXPathIntersection(nodes1, nodes2);
48221 desret_xmlNodeSetPtr(ret_val);
48223 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48224 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48225 xmlResetLastError();
48226 if (mem_base != xmlMemBlocks()) {
48227 printf("Leak of %d blocks found in xmlXPathIntersection",
48228 xmlMemBlocks() - mem_base);
48230 printf(" %d", n_nodes1);
48231 printf(" %d", n_nodes2);
48244 test_xmlXPathIsNodeType(void) {
48247 #if defined(LIBXML_XPATH_ENABLED)
48250 xmlChar * name; /* a name string */
48253 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48254 mem_base = xmlMemBlocks();
48255 name = gen_const_xmlChar_ptr(n_name, 0);
48257 ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48258 desret_int(ret_val);
48260 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48261 xmlResetLastError();
48262 if (mem_base != xmlMemBlocks()) {
48263 printf("Leak of %d blocks found in xmlXPathIsNodeType",
48264 xmlMemBlocks() - mem_base);
48266 printf(" %d", n_name);
48278 test_xmlXPathLangFunction(void) {
48281 #if defined(LIBXML_XPATH_ENABLED)
48283 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48285 int nargs; /* the number of arguments */
48288 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48289 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48290 mem_base = xmlMemBlocks();
48291 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48292 nargs = gen_int(n_nargs, 1);
48294 xmlXPathLangFunction(ctxt, nargs);
48296 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48297 des_int(n_nargs, nargs, 1);
48298 xmlResetLastError();
48299 if (mem_base != xmlMemBlocks()) {
48300 printf("Leak of %d blocks found in xmlXPathLangFunction",
48301 xmlMemBlocks() - mem_base);
48303 printf(" %d", n_ctxt);
48304 printf(" %d", n_nargs);
48317 test_xmlXPathLastFunction(void) {
48320 #if defined(LIBXML_XPATH_ENABLED)
48322 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48324 int nargs; /* the number of arguments */
48327 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48328 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48329 mem_base = xmlMemBlocks();
48330 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48331 nargs = gen_int(n_nargs, 1);
48333 xmlXPathLastFunction(ctxt, nargs);
48335 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48336 des_int(n_nargs, nargs, 1);
48337 xmlResetLastError();
48338 if (mem_base != xmlMemBlocks()) {
48339 printf("Leak of %d blocks found in xmlXPathLastFunction",
48340 xmlMemBlocks() - mem_base);
48342 printf(" %d", n_ctxt);
48343 printf(" %d", n_nargs);
48356 test_xmlXPathLeading(void) {
48359 #if defined(LIBXML_XPATH_ENABLED)
48361 xmlNodeSetPtr ret_val;
48362 xmlNodeSetPtr nodes1; /* a node-set */
48364 xmlNodeSetPtr nodes2; /* a node-set */
48367 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48368 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48369 mem_base = xmlMemBlocks();
48370 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48371 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48373 ret_val = xmlXPathLeading(nodes1, nodes2);
48374 desret_xmlNodeSetPtr(ret_val);
48376 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48377 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48378 xmlResetLastError();
48379 if (mem_base != xmlMemBlocks()) {
48380 printf("Leak of %d blocks found in xmlXPathLeading",
48381 xmlMemBlocks() - mem_base);
48383 printf(" %d", n_nodes1);
48384 printf(" %d", n_nodes2);
48397 test_xmlXPathLeadingSorted(void) {
48400 #if defined(LIBXML_XPATH_ENABLED)
48402 xmlNodeSetPtr ret_val;
48403 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48405 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48408 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48409 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48410 mem_base = xmlMemBlocks();
48411 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48412 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48414 ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48415 desret_xmlNodeSetPtr(ret_val);
48417 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48418 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48419 xmlResetLastError();
48420 if (mem_base != xmlMemBlocks()) {
48421 printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48422 xmlMemBlocks() - mem_base);
48424 printf(" %d", n_nodes1);
48425 printf(" %d", n_nodes2);
48438 test_xmlXPathLocalNameFunction(void) {
48441 #if defined(LIBXML_XPATH_ENABLED)
48443 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48445 int nargs; /* the number of arguments */
48448 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48449 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48450 mem_base = xmlMemBlocks();
48451 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48452 nargs = gen_int(n_nargs, 1);
48454 xmlXPathLocalNameFunction(ctxt, nargs);
48456 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48457 des_int(n_nargs, nargs, 1);
48458 xmlResetLastError();
48459 if (mem_base != xmlMemBlocks()) {
48460 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48461 xmlMemBlocks() - mem_base);
48463 printf(" %d", n_ctxt);
48464 printf(" %d", n_nargs);
48477 test_xmlXPathModValues(void) {
48480 #if defined(LIBXML_XPATH_ENABLED)
48482 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48485 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48486 mem_base = xmlMemBlocks();
48487 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48489 xmlXPathModValues(ctxt);
48491 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48492 xmlResetLastError();
48493 if (mem_base != xmlMemBlocks()) {
48494 printf("Leak of %d blocks found in xmlXPathModValues",
48495 xmlMemBlocks() - mem_base);
48497 printf(" %d", n_ctxt);
48509 test_xmlXPathMultValues(void) {
48512 #if defined(LIBXML_XPATH_ENABLED)
48514 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48517 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48518 mem_base = xmlMemBlocks();
48519 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48521 xmlXPathMultValues(ctxt);
48523 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48524 xmlResetLastError();
48525 if (mem_base != xmlMemBlocks()) {
48526 printf("Leak of %d blocks found in xmlXPathMultValues",
48527 xmlMemBlocks() - mem_base);
48529 printf(" %d", n_ctxt);
48541 test_xmlXPathNamespaceURIFunction(void) {
48544 #if defined(LIBXML_XPATH_ENABLED)
48546 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48548 int nargs; /* the number of arguments */
48551 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48552 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48553 mem_base = xmlMemBlocks();
48554 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48555 nargs = gen_int(n_nargs, 1);
48557 xmlXPathNamespaceURIFunction(ctxt, nargs);
48559 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48560 des_int(n_nargs, nargs, 1);
48561 xmlResetLastError();
48562 if (mem_base != xmlMemBlocks()) {
48563 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48564 xmlMemBlocks() - mem_base);
48566 printf(" %d", n_ctxt);
48567 printf(" %d", n_nargs);
48580 test_xmlXPathNewBoolean(void) {
48583 #if defined(LIBXML_XPATH_ENABLED)
48585 xmlXPathObjectPtr ret_val;
48586 int val; /* the boolean value */
48589 for (n_val = 0;n_val < gen_nb_int;n_val++) {
48590 mem_base = xmlMemBlocks();
48591 val = gen_int(n_val, 0);
48593 ret_val = xmlXPathNewBoolean(val);
48594 desret_xmlXPathObjectPtr(ret_val);
48596 des_int(n_val, val, 0);
48597 xmlResetLastError();
48598 if (mem_base != xmlMemBlocks()) {
48599 printf("Leak of %d blocks found in xmlXPathNewBoolean",
48600 xmlMemBlocks() - mem_base);
48602 printf(" %d", n_val);
48614 test_xmlXPathNewCString(void) {
48617 #if defined(LIBXML_XPATH_ENABLED)
48619 xmlXPathObjectPtr ret_val;
48620 char * val; /* the char * value */
48623 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48624 mem_base = xmlMemBlocks();
48625 val = gen_const_char_ptr(n_val, 0);
48627 ret_val = xmlXPathNewCString((const char *)val);
48628 desret_xmlXPathObjectPtr(ret_val);
48630 des_const_char_ptr(n_val, (const char *)val, 0);
48631 xmlResetLastError();
48632 if (mem_base != xmlMemBlocks()) {
48633 printf("Leak of %d blocks found in xmlXPathNewCString",
48634 xmlMemBlocks() - mem_base);
48636 printf(" %d", n_val);
48648 test_xmlXPathNewFloat(void) {
48651 #if defined(LIBXML_XPATH_ENABLED)
48653 xmlXPathObjectPtr ret_val;
48654 double val; /* the double value */
48657 for (n_val = 0;n_val < gen_nb_double;n_val++) {
48658 mem_base = xmlMemBlocks();
48659 val = gen_double(n_val, 0);
48661 ret_val = xmlXPathNewFloat(val);
48662 desret_xmlXPathObjectPtr(ret_val);
48664 des_double(n_val, val, 0);
48665 xmlResetLastError();
48666 if (mem_base != xmlMemBlocks()) {
48667 printf("Leak of %d blocks found in xmlXPathNewFloat",
48668 xmlMemBlocks() - mem_base);
48670 printf(" %d", n_val);
48682 test_xmlXPathNewNodeSet(void) {
48685 #if defined(LIBXML_XPATH_ENABLED)
48687 xmlXPathObjectPtr ret_val;
48688 xmlNodePtr val; /* the NodePtr value */
48691 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48692 mem_base = xmlMemBlocks();
48693 val = gen_xmlNodePtr(n_val, 0);
48695 ret_val = xmlXPathNewNodeSet(val);
48696 desret_xmlXPathObjectPtr(ret_val);
48698 des_xmlNodePtr(n_val, val, 0);
48699 xmlResetLastError();
48700 if (mem_base != xmlMemBlocks()) {
48701 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48702 xmlMemBlocks() - mem_base);
48704 printf(" %d", n_val);
48716 test_xmlXPathNewNodeSetList(void) {
48719 #if defined(LIBXML_XPATH_ENABLED)
48721 xmlXPathObjectPtr ret_val;
48722 xmlNodeSetPtr val; /* an existing NodeSet */
48725 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48726 mem_base = xmlMemBlocks();
48727 val = gen_xmlNodeSetPtr(n_val, 0);
48729 ret_val = xmlXPathNewNodeSetList(val);
48730 desret_xmlXPathObjectPtr(ret_val);
48732 des_xmlNodeSetPtr(n_val, val, 0);
48733 xmlResetLastError();
48734 if (mem_base != xmlMemBlocks()) {
48735 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48736 xmlMemBlocks() - mem_base);
48738 printf(" %d", n_val);
48750 test_xmlXPathNewParserContext(void) {
48754 /* missing type support */
48760 test_xmlXPathNewString(void) {
48763 #if defined(LIBXML_XPATH_ENABLED)
48765 xmlXPathObjectPtr ret_val;
48766 xmlChar * val; /* the xmlChar * value */
48769 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48770 mem_base = xmlMemBlocks();
48771 val = gen_const_xmlChar_ptr(n_val, 0);
48773 ret_val = xmlXPathNewString((const xmlChar *)val);
48774 desret_xmlXPathObjectPtr(ret_val);
48776 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48777 xmlResetLastError();
48778 if (mem_base != xmlMemBlocks()) {
48779 printf("Leak of %d blocks found in xmlXPathNewString",
48780 xmlMemBlocks() - mem_base);
48782 printf(" %d", n_val);
48794 test_xmlXPathNextAncestor(void) {
48797 #if defined(LIBXML_XPATH_ENABLED)
48799 xmlNodePtr ret_val;
48800 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48802 xmlNodePtr cur; /* the current node in the traversal */
48805 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48806 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48807 mem_base = xmlMemBlocks();
48808 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48809 cur = gen_xmlNodePtr(n_cur, 1);
48811 ret_val = xmlXPathNextAncestor(ctxt, cur);
48812 desret_xmlNodePtr(ret_val);
48814 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48815 des_xmlNodePtr(n_cur, cur, 1);
48816 xmlResetLastError();
48817 if (mem_base != xmlMemBlocks()) {
48818 printf("Leak of %d blocks found in xmlXPathNextAncestor",
48819 xmlMemBlocks() - mem_base);
48821 printf(" %d", n_ctxt);
48822 printf(" %d", n_cur);
48835 test_xmlXPathNextAncestorOrSelf(void) {
48838 #if defined(LIBXML_XPATH_ENABLED)
48840 xmlNodePtr ret_val;
48841 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48843 xmlNodePtr cur; /* the current node in the traversal */
48846 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48847 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48848 mem_base = xmlMemBlocks();
48849 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48850 cur = gen_xmlNodePtr(n_cur, 1);
48852 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48853 desret_xmlNodePtr(ret_val);
48855 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48856 des_xmlNodePtr(n_cur, cur, 1);
48857 xmlResetLastError();
48858 if (mem_base != xmlMemBlocks()) {
48859 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48860 xmlMemBlocks() - mem_base);
48862 printf(" %d", n_ctxt);
48863 printf(" %d", n_cur);
48876 test_xmlXPathNextAttribute(void) {
48879 #if defined(LIBXML_XPATH_ENABLED)
48881 xmlNodePtr ret_val;
48882 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48884 xmlNodePtr cur; /* the current attribute in the traversal */
48887 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48888 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48889 mem_base = xmlMemBlocks();
48890 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48891 cur = gen_xmlNodePtr(n_cur, 1);
48893 ret_val = xmlXPathNextAttribute(ctxt, cur);
48894 desret_xmlNodePtr(ret_val);
48896 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48897 des_xmlNodePtr(n_cur, cur, 1);
48898 xmlResetLastError();
48899 if (mem_base != xmlMemBlocks()) {
48900 printf("Leak of %d blocks found in xmlXPathNextAttribute",
48901 xmlMemBlocks() - mem_base);
48903 printf(" %d", n_ctxt);
48904 printf(" %d", n_cur);
48917 test_xmlXPathNextChild(void) {
48920 #if defined(LIBXML_XPATH_ENABLED)
48922 xmlNodePtr ret_val;
48923 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48925 xmlNodePtr cur; /* the current node in the traversal */
48928 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48929 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48930 mem_base = xmlMemBlocks();
48931 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48932 cur = gen_xmlNodePtr(n_cur, 1);
48934 ret_val = xmlXPathNextChild(ctxt, cur);
48935 desret_xmlNodePtr(ret_val);
48937 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48938 des_xmlNodePtr(n_cur, cur, 1);
48939 xmlResetLastError();
48940 if (mem_base != xmlMemBlocks()) {
48941 printf("Leak of %d blocks found in xmlXPathNextChild",
48942 xmlMemBlocks() - mem_base);
48944 printf(" %d", n_ctxt);
48945 printf(" %d", n_cur);
48958 test_xmlXPathNextDescendant(void) {
48961 #if defined(LIBXML_XPATH_ENABLED)
48963 xmlNodePtr ret_val;
48964 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48966 xmlNodePtr cur; /* the current node in the traversal */
48969 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48970 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48971 mem_base = xmlMemBlocks();
48972 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48973 cur = gen_xmlNodePtr(n_cur, 1);
48975 ret_val = xmlXPathNextDescendant(ctxt, cur);
48976 desret_xmlNodePtr(ret_val);
48978 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48979 des_xmlNodePtr(n_cur, cur, 1);
48980 xmlResetLastError();
48981 if (mem_base != xmlMemBlocks()) {
48982 printf("Leak of %d blocks found in xmlXPathNextDescendant",
48983 xmlMemBlocks() - mem_base);
48985 printf(" %d", n_ctxt);
48986 printf(" %d", n_cur);
48999 test_xmlXPathNextDescendantOrSelf(void) {
49002 #if defined(LIBXML_XPATH_ENABLED)
49004 xmlNodePtr ret_val;
49005 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49007 xmlNodePtr cur; /* the current node in the traversal */
49010 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49011 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49012 mem_base = xmlMemBlocks();
49013 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49014 cur = gen_xmlNodePtr(n_cur, 1);
49016 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
49017 desret_xmlNodePtr(ret_val);
49019 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49020 des_xmlNodePtr(n_cur, cur, 1);
49021 xmlResetLastError();
49022 if (mem_base != xmlMemBlocks()) {
49023 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
49024 xmlMemBlocks() - mem_base);
49026 printf(" %d", n_ctxt);
49027 printf(" %d", n_cur);
49040 test_xmlXPathNextFollowing(void) {
49043 #if defined(LIBXML_XPATH_ENABLED)
49045 xmlNodePtr ret_val;
49046 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49048 xmlNodePtr cur; /* the current node in the traversal */
49051 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49052 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49053 mem_base = xmlMemBlocks();
49054 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49055 cur = gen_xmlNodePtr(n_cur, 1);
49057 ret_val = xmlXPathNextFollowing(ctxt, cur);
49058 desret_xmlNodePtr(ret_val);
49060 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49061 des_xmlNodePtr(n_cur, cur, 1);
49062 xmlResetLastError();
49063 if (mem_base != xmlMemBlocks()) {
49064 printf("Leak of %d blocks found in xmlXPathNextFollowing",
49065 xmlMemBlocks() - mem_base);
49067 printf(" %d", n_ctxt);
49068 printf(" %d", n_cur);
49081 test_xmlXPathNextFollowingSibling(void) {
49084 #if defined(LIBXML_XPATH_ENABLED)
49086 xmlNodePtr ret_val;
49087 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49089 xmlNodePtr cur; /* the current node in the traversal */
49092 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49093 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49094 mem_base = xmlMemBlocks();
49095 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49096 cur = gen_xmlNodePtr(n_cur, 1);
49098 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
49099 desret_xmlNodePtr(ret_val);
49101 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49102 des_xmlNodePtr(n_cur, cur, 1);
49103 xmlResetLastError();
49104 if (mem_base != xmlMemBlocks()) {
49105 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
49106 xmlMemBlocks() - mem_base);
49108 printf(" %d", n_ctxt);
49109 printf(" %d", n_cur);
49122 test_xmlXPathNextNamespace(void) {
49125 #if defined(LIBXML_XPATH_ENABLED)
49127 xmlNodePtr ret_val;
49128 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49130 xmlNodePtr cur; /* the current attribute in the traversal */
49133 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49134 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49135 mem_base = xmlMemBlocks();
49136 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49137 cur = gen_xmlNodePtr(n_cur, 1);
49139 ret_val = xmlXPathNextNamespace(ctxt, cur);
49140 desret_xmlNodePtr(ret_val);
49142 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49143 des_xmlNodePtr(n_cur, cur, 1);
49144 xmlResetLastError();
49145 if (mem_base != xmlMemBlocks()) {
49146 printf("Leak of %d blocks found in xmlXPathNextNamespace",
49147 xmlMemBlocks() - mem_base);
49149 printf(" %d", n_ctxt);
49150 printf(" %d", n_cur);
49163 test_xmlXPathNextParent(void) {
49166 #if defined(LIBXML_XPATH_ENABLED)
49168 xmlNodePtr ret_val;
49169 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49171 xmlNodePtr cur; /* the current node in the traversal */
49174 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49175 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49176 mem_base = xmlMemBlocks();
49177 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49178 cur = gen_xmlNodePtr(n_cur, 1);
49180 ret_val = xmlXPathNextParent(ctxt, cur);
49181 desret_xmlNodePtr(ret_val);
49183 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49184 des_xmlNodePtr(n_cur, cur, 1);
49185 xmlResetLastError();
49186 if (mem_base != xmlMemBlocks()) {
49187 printf("Leak of %d blocks found in xmlXPathNextParent",
49188 xmlMemBlocks() - mem_base);
49190 printf(" %d", n_ctxt);
49191 printf(" %d", n_cur);
49204 test_xmlXPathNextPreceding(void) {
49207 #if defined(LIBXML_XPATH_ENABLED)
49209 xmlNodePtr ret_val;
49210 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49212 xmlNodePtr cur; /* the current node in the traversal */
49215 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49216 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49217 mem_base = xmlMemBlocks();
49218 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49219 cur = gen_xmlNodePtr(n_cur, 1);
49221 ret_val = xmlXPathNextPreceding(ctxt, cur);
49222 desret_xmlNodePtr(ret_val);
49224 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49225 des_xmlNodePtr(n_cur, cur, 1);
49226 xmlResetLastError();
49227 if (mem_base != xmlMemBlocks()) {
49228 printf("Leak of %d blocks found in xmlXPathNextPreceding",
49229 xmlMemBlocks() - mem_base);
49231 printf(" %d", n_ctxt);
49232 printf(" %d", n_cur);
49245 test_xmlXPathNextPrecedingSibling(void) {
49248 #if defined(LIBXML_XPATH_ENABLED)
49250 xmlNodePtr ret_val;
49251 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49253 xmlNodePtr cur; /* the current node in the traversal */
49256 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49257 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49258 mem_base = xmlMemBlocks();
49259 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49260 cur = gen_xmlNodePtr(n_cur, 1);
49262 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49263 desret_xmlNodePtr(ret_val);
49265 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49266 des_xmlNodePtr(n_cur, cur, 1);
49267 xmlResetLastError();
49268 if (mem_base != xmlMemBlocks()) {
49269 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49270 xmlMemBlocks() - mem_base);
49272 printf(" %d", n_ctxt);
49273 printf(" %d", n_cur);
49286 test_xmlXPathNextSelf(void) {
49289 #if defined(LIBXML_XPATH_ENABLED)
49291 xmlNodePtr ret_val;
49292 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49294 xmlNodePtr cur; /* the current node in the traversal */
49297 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49298 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49299 mem_base = xmlMemBlocks();
49300 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49301 cur = gen_xmlNodePtr(n_cur, 1);
49303 ret_val = xmlXPathNextSelf(ctxt, cur);
49304 desret_xmlNodePtr(ret_val);
49306 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49307 des_xmlNodePtr(n_cur, cur, 1);
49308 xmlResetLastError();
49309 if (mem_base != xmlMemBlocks()) {
49310 printf("Leak of %d blocks found in xmlXPathNextSelf",
49311 xmlMemBlocks() - mem_base);
49313 printf(" %d", n_ctxt);
49314 printf(" %d", n_cur);
49327 test_xmlXPathNodeLeading(void) {
49330 #if defined(LIBXML_XPATH_ENABLED)
49332 xmlNodeSetPtr ret_val;
49333 xmlNodeSetPtr nodes; /* a node-set */
49335 xmlNodePtr node; /* a node */
49338 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49339 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49340 mem_base = xmlMemBlocks();
49341 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49342 node = gen_xmlNodePtr(n_node, 1);
49344 ret_val = xmlXPathNodeLeading(nodes, node);
49345 desret_xmlNodeSetPtr(ret_val);
49347 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49348 des_xmlNodePtr(n_node, node, 1);
49349 xmlResetLastError();
49350 if (mem_base != xmlMemBlocks()) {
49351 printf("Leak of %d blocks found in xmlXPathNodeLeading",
49352 xmlMemBlocks() - mem_base);
49354 printf(" %d", n_nodes);
49355 printf(" %d", n_node);
49368 test_xmlXPathNodeLeadingSorted(void) {
49371 #if defined(LIBXML_XPATH_ENABLED)
49373 xmlNodeSetPtr ret_val;
49374 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49376 xmlNodePtr node; /* a node */
49379 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49380 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49381 mem_base = xmlMemBlocks();
49382 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49383 node = gen_xmlNodePtr(n_node, 1);
49385 ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49386 desret_xmlNodeSetPtr(ret_val);
49388 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49389 des_xmlNodePtr(n_node, node, 1);
49390 xmlResetLastError();
49391 if (mem_base != xmlMemBlocks()) {
49392 printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49393 xmlMemBlocks() - mem_base);
49395 printf(" %d", n_nodes);
49396 printf(" %d", n_node);
49409 test_xmlXPathNodeSetAdd(void) {
49412 #if defined(LIBXML_XPATH_ENABLED)
49415 xmlNodeSetPtr cur; /* the initial node set */
49417 xmlNodePtr val; /* a new xmlNodePtr */
49420 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49421 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49422 mem_base = xmlMemBlocks();
49423 cur = gen_xmlNodeSetPtr(n_cur, 0);
49424 val = gen_xmlNodePtr(n_val, 1);
49426 ret_val = xmlXPathNodeSetAdd(cur, val);
49427 desret_int(ret_val);
49429 des_xmlNodeSetPtr(n_cur, cur, 0);
49430 des_xmlNodePtr(n_val, val, 1);
49431 xmlResetLastError();
49432 if (mem_base != xmlMemBlocks()) {
49433 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49434 xmlMemBlocks() - mem_base);
49436 printf(" %d", n_cur);
49437 printf(" %d", n_val);
49450 test_xmlXPathNodeSetAddNs(void) {
49453 #if defined(LIBXML_XPATH_ENABLED)
49456 xmlNodeSetPtr cur; /* the initial node set */
49458 xmlNodePtr node; /* the hosting node */
49460 xmlNsPtr ns; /* a the namespace node */
49463 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49464 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49465 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49466 mem_base = xmlMemBlocks();
49467 cur = gen_xmlNodeSetPtr(n_cur, 0);
49468 node = gen_xmlNodePtr(n_node, 1);
49469 ns = gen_xmlNsPtr(n_ns, 2);
49471 ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49472 desret_int(ret_val);
49474 des_xmlNodeSetPtr(n_cur, cur, 0);
49475 des_xmlNodePtr(n_node, node, 1);
49476 des_xmlNsPtr(n_ns, ns, 2);
49477 xmlResetLastError();
49478 if (mem_base != xmlMemBlocks()) {
49479 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49480 xmlMemBlocks() - mem_base);
49482 printf(" %d", n_cur);
49483 printf(" %d", n_node);
49484 printf(" %d", n_ns);
49498 test_xmlXPathNodeSetAddUnique(void) {
49501 #if defined(LIBXML_XPATH_ENABLED)
49504 xmlNodeSetPtr cur; /* the initial node set */
49506 xmlNodePtr val; /* a new xmlNodePtr */
49509 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49510 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49511 mem_base = xmlMemBlocks();
49512 cur = gen_xmlNodeSetPtr(n_cur, 0);
49513 val = gen_xmlNodePtr(n_val, 1);
49515 ret_val = xmlXPathNodeSetAddUnique(cur, val);
49516 desret_int(ret_val);
49518 des_xmlNodeSetPtr(n_cur, cur, 0);
49519 des_xmlNodePtr(n_val, val, 1);
49520 xmlResetLastError();
49521 if (mem_base != xmlMemBlocks()) {
49522 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49523 xmlMemBlocks() - mem_base);
49525 printf(" %d", n_cur);
49526 printf(" %d", n_val);
49539 test_xmlXPathNodeSetContains(void) {
49542 #if defined(LIBXML_XPATH_ENABLED)
49545 xmlNodeSetPtr cur; /* the node-set */
49547 xmlNodePtr val; /* the node */
49550 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49551 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49552 mem_base = xmlMemBlocks();
49553 cur = gen_xmlNodeSetPtr(n_cur, 0);
49554 val = gen_xmlNodePtr(n_val, 1);
49556 ret_val = xmlXPathNodeSetContains(cur, val);
49557 desret_int(ret_val);
49559 des_xmlNodeSetPtr(n_cur, cur, 0);
49560 des_xmlNodePtr(n_val, val, 1);
49561 xmlResetLastError();
49562 if (mem_base != xmlMemBlocks()) {
49563 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49564 xmlMemBlocks() - mem_base);
49566 printf(" %d", n_cur);
49567 printf(" %d", n_val);
49580 test_xmlXPathNodeSetDel(void) {
49583 #if defined(LIBXML_XPATH_ENABLED)
49585 xmlNodeSetPtr cur; /* the initial node set */
49587 xmlNodePtr val; /* an xmlNodePtr */
49590 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49591 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49592 mem_base = xmlMemBlocks();
49593 cur = gen_xmlNodeSetPtr(n_cur, 0);
49594 val = gen_xmlNodePtr(n_val, 1);
49596 xmlXPathNodeSetDel(cur, val);
49598 des_xmlNodeSetPtr(n_cur, cur, 0);
49599 des_xmlNodePtr(n_val, val, 1);
49600 xmlResetLastError();
49601 if (mem_base != xmlMemBlocks()) {
49602 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49603 xmlMemBlocks() - mem_base);
49605 printf(" %d", n_cur);
49606 printf(" %d", n_val);
49619 test_xmlXPathNodeSetMerge(void) {
49622 #if defined(LIBXML_XPATH_ENABLED)
49624 xmlNodeSetPtr ret_val;
49625 xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49627 xmlNodeSetPtr val2; /* the second NodeSet */
49630 for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49631 for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49632 mem_base = xmlMemBlocks();
49633 val1 = gen_xmlNodeSetPtr(n_val1, 0);
49634 val2 = gen_xmlNodeSetPtr(n_val2, 1);
49636 ret_val = xmlXPathNodeSetMerge(val1, val2);
49637 desret_xmlNodeSetPtr(ret_val);
49639 des_xmlNodeSetPtr(n_val1, val1, 0);
49640 des_xmlNodeSetPtr(n_val2, val2, 1);
49641 xmlResetLastError();
49642 if (mem_base != xmlMemBlocks()) {
49643 printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49644 xmlMemBlocks() - mem_base);
49646 printf(" %d", n_val1);
49647 printf(" %d", n_val2);
49660 test_xmlXPathNodeSetRemove(void) {
49663 #if defined(LIBXML_XPATH_ENABLED)
49665 xmlNodeSetPtr cur; /* the initial node set */
49667 int val; /* the index to remove */
49670 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49671 for (n_val = 0;n_val < gen_nb_int;n_val++) {
49672 mem_base = xmlMemBlocks();
49673 cur = gen_xmlNodeSetPtr(n_cur, 0);
49674 val = gen_int(n_val, 1);
49676 xmlXPathNodeSetRemove(cur, val);
49678 des_xmlNodeSetPtr(n_cur, cur, 0);
49679 des_int(n_val, val, 1);
49680 xmlResetLastError();
49681 if (mem_base != xmlMemBlocks()) {
49682 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49683 xmlMemBlocks() - mem_base);
49685 printf(" %d", n_cur);
49686 printf(" %d", n_val);
49699 test_xmlXPathNodeSetSort(void) {
49702 #if defined(LIBXML_XPATH_ENABLED)
49704 xmlNodeSetPtr set; /* the node set */
49707 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49708 mem_base = xmlMemBlocks();
49709 set = gen_xmlNodeSetPtr(n_set, 0);
49711 xmlXPathNodeSetSort(set);
49713 des_xmlNodeSetPtr(n_set, set, 0);
49714 xmlResetLastError();
49715 if (mem_base != xmlMemBlocks()) {
49716 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49717 xmlMemBlocks() - mem_base);
49719 printf(" %d", n_set);
49731 test_xmlXPathNodeTrailing(void) {
49734 #if defined(LIBXML_XPATH_ENABLED)
49736 xmlNodeSetPtr ret_val;
49737 xmlNodeSetPtr nodes; /* a node-set */
49739 xmlNodePtr node; /* a node */
49742 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49743 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49744 mem_base = xmlMemBlocks();
49745 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49746 node = gen_xmlNodePtr(n_node, 1);
49748 ret_val = xmlXPathNodeTrailing(nodes, node);
49749 desret_xmlNodeSetPtr(ret_val);
49751 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49752 des_xmlNodePtr(n_node, node, 1);
49753 xmlResetLastError();
49754 if (mem_base != xmlMemBlocks()) {
49755 printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49756 xmlMemBlocks() - mem_base);
49758 printf(" %d", n_nodes);
49759 printf(" %d", n_node);
49772 test_xmlXPathNodeTrailingSorted(void) {
49775 #if defined(LIBXML_XPATH_ENABLED)
49777 xmlNodeSetPtr ret_val;
49778 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49780 xmlNodePtr node; /* a node */
49783 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49784 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49785 mem_base = xmlMemBlocks();
49786 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49787 node = gen_xmlNodePtr(n_node, 1);
49789 ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49790 desret_xmlNodeSetPtr(ret_val);
49792 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49793 des_xmlNodePtr(n_node, node, 1);
49794 xmlResetLastError();
49795 if (mem_base != xmlMemBlocks()) {
49796 printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49797 xmlMemBlocks() - mem_base);
49799 printf(" %d", n_nodes);
49800 printf(" %d", n_node);
49813 test_xmlXPathNormalizeFunction(void) {
49816 #if defined(LIBXML_XPATH_ENABLED)
49818 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49820 int nargs; /* the number of arguments */
49823 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49824 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49825 mem_base = xmlMemBlocks();
49826 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49827 nargs = gen_int(n_nargs, 1);
49829 xmlXPathNormalizeFunction(ctxt, nargs);
49831 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49832 des_int(n_nargs, nargs, 1);
49833 xmlResetLastError();
49834 if (mem_base != xmlMemBlocks()) {
49835 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49836 xmlMemBlocks() - mem_base);
49838 printf(" %d", n_ctxt);
49839 printf(" %d", n_nargs);
49852 test_xmlXPathNotEqualValues(void) {
49855 #if defined(LIBXML_XPATH_ENABLED)
49858 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49861 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49862 mem_base = xmlMemBlocks();
49863 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49865 ret_val = xmlXPathNotEqualValues(ctxt);
49866 desret_int(ret_val);
49868 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49869 xmlResetLastError();
49870 if (mem_base != xmlMemBlocks()) {
49871 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49872 xmlMemBlocks() - mem_base);
49874 printf(" %d", n_ctxt);
49886 test_xmlXPathNotFunction(void) {
49889 #if defined(LIBXML_XPATH_ENABLED)
49891 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49893 int nargs; /* the number of arguments */
49896 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49897 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49898 mem_base = xmlMemBlocks();
49899 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49900 nargs = gen_int(n_nargs, 1);
49902 xmlXPathNotFunction(ctxt, nargs);
49904 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49905 des_int(n_nargs, nargs, 1);
49906 xmlResetLastError();
49907 if (mem_base != xmlMemBlocks()) {
49908 printf("Leak of %d blocks found in xmlXPathNotFunction",
49909 xmlMemBlocks() - mem_base);
49911 printf(" %d", n_ctxt);
49912 printf(" %d", n_nargs);
49925 test_xmlXPathNsLookup(void) {
49928 #if defined(LIBXML_XPATH_ENABLED)
49930 const xmlChar * ret_val;
49931 xmlXPathContextPtr ctxt; /* the XPath context */
49933 xmlChar * prefix; /* the namespace prefix value */
49936 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49937 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49938 mem_base = xmlMemBlocks();
49939 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49940 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49942 ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49943 desret_const_xmlChar_ptr(ret_val);
49945 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49946 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49947 xmlResetLastError();
49948 if (mem_base != xmlMemBlocks()) {
49949 printf("Leak of %d blocks found in xmlXPathNsLookup",
49950 xmlMemBlocks() - mem_base);
49952 printf(" %d", n_ctxt);
49953 printf(" %d", n_prefix);
49966 test_xmlXPathNumberFunction(void) {
49969 #if defined(LIBXML_XPATH_ENABLED)
49971 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49973 int nargs; /* the number of arguments */
49976 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49977 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49978 mem_base = xmlMemBlocks();
49979 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49980 nargs = gen_int(n_nargs, 1);
49982 xmlXPathNumberFunction(ctxt, nargs);
49984 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49985 des_int(n_nargs, nargs, 1);
49986 xmlResetLastError();
49987 if (mem_base != xmlMemBlocks()) {
49988 printf("Leak of %d blocks found in xmlXPathNumberFunction",
49989 xmlMemBlocks() - mem_base);
49991 printf(" %d", n_ctxt);
49992 printf(" %d", n_nargs);
50005 test_xmlXPathParseNCName(void) {
50008 #if defined(LIBXML_XPATH_ENABLED)
50011 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50014 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50015 mem_base = xmlMemBlocks();
50016 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50018 ret_val = xmlXPathParseNCName(ctxt);
50019 desret_xmlChar_ptr(ret_val);
50021 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50022 xmlResetLastError();
50023 if (mem_base != xmlMemBlocks()) {
50024 printf("Leak of %d blocks found in xmlXPathParseNCName",
50025 xmlMemBlocks() - mem_base);
50027 printf(" %d", n_ctxt);
50039 test_xmlXPathParseName(void) {
50042 #if defined(LIBXML_XPATH_ENABLED)
50045 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50048 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50049 mem_base = xmlMemBlocks();
50050 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50052 ret_val = xmlXPathParseName(ctxt);
50053 desret_xmlChar_ptr(ret_val);
50055 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50056 xmlResetLastError();
50057 if (mem_base != xmlMemBlocks()) {
50058 printf("Leak of %d blocks found in xmlXPathParseName",
50059 xmlMemBlocks() - mem_base);
50061 printf(" %d", n_ctxt);
50073 test_xmlXPathPopBoolean(void) {
50076 #if defined(LIBXML_XPATH_ENABLED)
50079 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50082 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50083 mem_base = xmlMemBlocks();
50084 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50086 ret_val = xmlXPathPopBoolean(ctxt);
50087 desret_int(ret_val);
50089 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50090 xmlResetLastError();
50091 if (mem_base != xmlMemBlocks()) {
50092 printf("Leak of %d blocks found in xmlXPathPopBoolean",
50093 xmlMemBlocks() - mem_base);
50095 printf(" %d", n_ctxt);
50107 test_xmlXPathPopExternal(void) {
50110 #if defined(LIBXML_XPATH_ENABLED)
50113 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50116 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50117 mem_base = xmlMemBlocks();
50118 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50120 ret_val = xmlXPathPopExternal(ctxt);
50121 desret_void_ptr(ret_val);
50123 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50124 xmlResetLastError();
50125 if (mem_base != xmlMemBlocks()) {
50126 printf("Leak of %d blocks found in xmlXPathPopExternal",
50127 xmlMemBlocks() - mem_base);
50129 printf(" %d", n_ctxt);
50141 test_xmlXPathPopNodeSet(void) {
50144 #if defined(LIBXML_XPATH_ENABLED)
50146 xmlNodeSetPtr ret_val;
50147 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50150 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50151 mem_base = xmlMemBlocks();
50152 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50154 ret_val = xmlXPathPopNodeSet(ctxt);
50155 desret_xmlNodeSetPtr(ret_val);
50157 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50158 xmlResetLastError();
50159 if (mem_base != xmlMemBlocks()) {
50160 printf("Leak of %d blocks found in xmlXPathPopNodeSet",
50161 xmlMemBlocks() - mem_base);
50163 printf(" %d", n_ctxt);
50175 test_xmlXPathPopNumber(void) {
50178 #if defined(LIBXML_XPATH_ENABLED)
50181 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50184 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50185 mem_base = xmlMemBlocks();
50186 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50188 ret_val = xmlXPathPopNumber(ctxt);
50189 desret_double(ret_val);
50191 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50192 xmlResetLastError();
50193 if (mem_base != xmlMemBlocks()) {
50194 printf("Leak of %d blocks found in xmlXPathPopNumber",
50195 xmlMemBlocks() - mem_base);
50197 printf(" %d", n_ctxt);
50209 test_xmlXPathPopString(void) {
50212 #if defined(LIBXML_XPATH_ENABLED)
50215 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50218 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50219 mem_base = xmlMemBlocks();
50220 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50222 ret_val = xmlXPathPopString(ctxt);
50223 desret_xmlChar_ptr(ret_val);
50225 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50226 xmlResetLastError();
50227 if (mem_base != xmlMemBlocks()) {
50228 printf("Leak of %d blocks found in xmlXPathPopString",
50229 xmlMemBlocks() - mem_base);
50231 printf(" %d", n_ctxt);
50243 test_xmlXPathPositionFunction(void) {
50246 #if defined(LIBXML_XPATH_ENABLED)
50248 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50250 int nargs; /* the number of arguments */
50253 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50254 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50255 mem_base = xmlMemBlocks();
50256 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50257 nargs = gen_int(n_nargs, 1);
50259 xmlXPathPositionFunction(ctxt, nargs);
50261 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50262 des_int(n_nargs, nargs, 1);
50263 xmlResetLastError();
50264 if (mem_base != xmlMemBlocks()) {
50265 printf("Leak of %d blocks found in xmlXPathPositionFunction",
50266 xmlMemBlocks() - mem_base);
50268 printf(" %d", n_ctxt);
50269 printf(" %d", n_nargs);
50282 test_xmlXPathRegisterAllFunctions(void) {
50285 #if defined(LIBXML_XPATH_ENABLED)
50287 xmlXPathContextPtr ctxt; /* the XPath context */
50290 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50291 mem_base = xmlMemBlocks();
50292 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50294 xmlXPathRegisterAllFunctions(ctxt);
50296 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50297 xmlResetLastError();
50298 if (mem_base != xmlMemBlocks()) {
50299 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50300 xmlMemBlocks() - mem_base);
50302 printf(" %d", n_ctxt);
50314 test_xmlXPathRegisterFunc(void) {
50318 /* missing type support */
50324 test_xmlXPathRegisterFuncLookup(void) {
50328 /* missing type support */
50334 test_xmlXPathRegisterFuncNS(void) {
50338 /* missing type support */
50344 test_xmlXPathRegisterNs(void) {
50347 #if defined(LIBXML_XPATH_ENABLED)
50350 xmlXPathContextPtr ctxt; /* the XPath context */
50352 xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50354 xmlChar * ns_uri; /* the namespace name */
50357 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50358 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50359 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50360 mem_base = xmlMemBlocks();
50361 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50362 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50363 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50365 ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50366 desret_int(ret_val);
50368 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50369 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50370 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50371 xmlResetLastError();
50372 if (mem_base != xmlMemBlocks()) {
50373 printf("Leak of %d blocks found in xmlXPathRegisterNs",
50374 xmlMemBlocks() - mem_base);
50376 printf(" %d", n_ctxt);
50377 printf(" %d", n_prefix);
50378 printf(" %d", n_ns_uri);
50392 test_xmlXPathRegisterVariable(void) {
50395 #if defined(LIBXML_XPATH_ENABLED)
50398 xmlXPathContextPtr ctxt; /* the XPath context */
50400 xmlChar * name; /* the variable name */
50402 xmlXPathObjectPtr value; /* the variable value or NULL */
50405 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50406 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50407 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50408 mem_base = xmlMemBlocks();
50409 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50410 name = gen_const_xmlChar_ptr(n_name, 1);
50411 value = gen_xmlXPathObjectPtr(n_value, 2);
50413 ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50414 desret_int(ret_val);
50416 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50417 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50418 des_xmlXPathObjectPtr(n_value, value, 2);
50419 xmlResetLastError();
50420 if (mem_base != xmlMemBlocks()) {
50421 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50422 xmlMemBlocks() - mem_base);
50424 printf(" %d", n_ctxt);
50425 printf(" %d", n_name);
50426 printf(" %d", n_value);
50440 test_xmlXPathRegisterVariableLookup(void) {
50444 /* missing type support */
50450 test_xmlXPathRegisterVariableNS(void) {
50453 #if defined(LIBXML_XPATH_ENABLED)
50456 xmlXPathContextPtr ctxt; /* the XPath context */
50458 xmlChar * name; /* the variable name */
50460 xmlChar * ns_uri; /* the variable namespace URI */
50462 xmlXPathObjectPtr value; /* the variable value or NULL */
50465 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50466 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50467 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50468 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50469 mem_base = xmlMemBlocks();
50470 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50471 name = gen_const_xmlChar_ptr(n_name, 1);
50472 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50473 value = gen_xmlXPathObjectPtr(n_value, 3);
50475 ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50476 desret_int(ret_val);
50478 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50479 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50480 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50481 des_xmlXPathObjectPtr(n_value, value, 3);
50482 xmlResetLastError();
50483 if (mem_base != xmlMemBlocks()) {
50484 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50485 xmlMemBlocks() - mem_base);
50487 printf(" %d", n_ctxt);
50488 printf(" %d", n_name);
50489 printf(" %d", n_ns_uri);
50490 printf(" %d", n_value);
50505 test_xmlXPathRegisteredFuncsCleanup(void) {
50508 #if defined(LIBXML_XPATH_ENABLED)
50510 xmlXPathContextPtr ctxt; /* the XPath context */
50513 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50514 mem_base = xmlMemBlocks();
50515 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50517 xmlXPathRegisteredFuncsCleanup(ctxt);
50519 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50520 xmlResetLastError();
50521 if (mem_base != xmlMemBlocks()) {
50522 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50523 xmlMemBlocks() - mem_base);
50525 printf(" %d", n_ctxt);
50537 test_xmlXPathRegisteredNsCleanup(void) {
50540 #if defined(LIBXML_XPATH_ENABLED)
50542 xmlXPathContextPtr ctxt; /* the XPath context */
50545 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50546 mem_base = xmlMemBlocks();
50547 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50549 xmlXPathRegisteredNsCleanup(ctxt);
50551 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50552 xmlResetLastError();
50553 if (mem_base != xmlMemBlocks()) {
50554 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50555 xmlMemBlocks() - mem_base);
50557 printf(" %d", n_ctxt);
50569 test_xmlXPathRegisteredVariablesCleanup(void) {
50572 #if defined(LIBXML_XPATH_ENABLED)
50574 xmlXPathContextPtr ctxt; /* the XPath context */
50577 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50578 mem_base = xmlMemBlocks();
50579 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50581 xmlXPathRegisteredVariablesCleanup(ctxt);
50583 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50584 xmlResetLastError();
50585 if (mem_base != xmlMemBlocks()) {
50586 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50587 xmlMemBlocks() - mem_base);
50589 printf(" %d", n_ctxt);
50601 test_xmlXPathRoot(void) {
50604 #if defined(LIBXML_XPATH_ENABLED)
50606 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50609 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50610 mem_base = xmlMemBlocks();
50611 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50613 xmlXPathRoot(ctxt);
50615 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50616 xmlResetLastError();
50617 if (mem_base != xmlMemBlocks()) {
50618 printf("Leak of %d blocks found in xmlXPathRoot",
50619 xmlMemBlocks() - mem_base);
50621 printf(" %d", n_ctxt);
50633 test_xmlXPathRoundFunction(void) {
50636 #if defined(LIBXML_XPATH_ENABLED)
50638 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50640 int nargs; /* the number of arguments */
50643 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50644 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50645 mem_base = xmlMemBlocks();
50646 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50647 nargs = gen_int(n_nargs, 1);
50649 xmlXPathRoundFunction(ctxt, nargs);
50651 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50652 des_int(n_nargs, nargs, 1);
50653 xmlResetLastError();
50654 if (mem_base != xmlMemBlocks()) {
50655 printf("Leak of %d blocks found in xmlXPathRoundFunction",
50656 xmlMemBlocks() - mem_base);
50658 printf(" %d", n_ctxt);
50659 printf(" %d", n_nargs);
50672 test_xmlXPathStartsWithFunction(void) {
50675 #if defined(LIBXML_XPATH_ENABLED)
50677 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50679 int nargs; /* the number of arguments */
50682 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50683 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50684 mem_base = xmlMemBlocks();
50685 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50686 nargs = gen_int(n_nargs, 1);
50688 xmlXPathStartsWithFunction(ctxt, nargs);
50690 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50691 des_int(n_nargs, nargs, 1);
50692 xmlResetLastError();
50693 if (mem_base != xmlMemBlocks()) {
50694 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50695 xmlMemBlocks() - mem_base);
50697 printf(" %d", n_ctxt);
50698 printf(" %d", n_nargs);
50711 test_xmlXPathStringEvalNumber(void) {
50714 #if defined(LIBXML_XPATH_ENABLED)
50717 xmlChar * str; /* A string to scan */
50720 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50721 mem_base = xmlMemBlocks();
50722 str = gen_const_xmlChar_ptr(n_str, 0);
50724 ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50725 desret_double(ret_val);
50727 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50728 xmlResetLastError();
50729 if (mem_base != xmlMemBlocks()) {
50730 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50731 xmlMemBlocks() - mem_base);
50733 printf(" %d", n_str);
50745 test_xmlXPathStringFunction(void) {
50748 #if defined(LIBXML_XPATH_ENABLED)
50750 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50752 int nargs; /* the number of arguments */
50755 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50756 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50757 mem_base = xmlMemBlocks();
50758 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50759 nargs = gen_int(n_nargs, 1);
50761 xmlXPathStringFunction(ctxt, nargs);
50763 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50764 des_int(n_nargs, nargs, 1);
50765 xmlResetLastError();
50766 if (mem_base != xmlMemBlocks()) {
50767 printf("Leak of %d blocks found in xmlXPathStringFunction",
50768 xmlMemBlocks() - mem_base);
50770 printf(" %d", n_ctxt);
50771 printf(" %d", n_nargs);
50784 test_xmlXPathStringLengthFunction(void) {
50787 #if defined(LIBXML_XPATH_ENABLED)
50789 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50791 int nargs; /* the number of arguments */
50794 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50795 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50796 mem_base = xmlMemBlocks();
50797 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50798 nargs = gen_int(n_nargs, 1);
50800 xmlXPathStringLengthFunction(ctxt, nargs);
50802 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50803 des_int(n_nargs, nargs, 1);
50804 xmlResetLastError();
50805 if (mem_base != xmlMemBlocks()) {
50806 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50807 xmlMemBlocks() - mem_base);
50809 printf(" %d", n_ctxt);
50810 printf(" %d", n_nargs);
50823 test_xmlXPathSubValues(void) {
50826 #if defined(LIBXML_XPATH_ENABLED)
50828 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50831 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50832 mem_base = xmlMemBlocks();
50833 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50835 xmlXPathSubValues(ctxt);
50837 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50838 xmlResetLastError();
50839 if (mem_base != xmlMemBlocks()) {
50840 printf("Leak of %d blocks found in xmlXPathSubValues",
50841 xmlMemBlocks() - mem_base);
50843 printf(" %d", n_ctxt);
50855 test_xmlXPathSubstringAfterFunction(void) {
50858 #if defined(LIBXML_XPATH_ENABLED)
50860 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50862 int nargs; /* the number of arguments */
50865 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50866 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50867 mem_base = xmlMemBlocks();
50868 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50869 nargs = gen_int(n_nargs, 1);
50871 xmlXPathSubstringAfterFunction(ctxt, nargs);
50873 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50874 des_int(n_nargs, nargs, 1);
50875 xmlResetLastError();
50876 if (mem_base != xmlMemBlocks()) {
50877 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50878 xmlMemBlocks() - mem_base);
50880 printf(" %d", n_ctxt);
50881 printf(" %d", n_nargs);
50894 test_xmlXPathSubstringBeforeFunction(void) {
50897 #if defined(LIBXML_XPATH_ENABLED)
50899 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50901 int nargs; /* the number of arguments */
50904 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50905 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50906 mem_base = xmlMemBlocks();
50907 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50908 nargs = gen_int(n_nargs, 1);
50910 xmlXPathSubstringBeforeFunction(ctxt, nargs);
50912 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50913 des_int(n_nargs, nargs, 1);
50914 xmlResetLastError();
50915 if (mem_base != xmlMemBlocks()) {
50916 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50917 xmlMemBlocks() - mem_base);
50919 printf(" %d", n_ctxt);
50920 printf(" %d", n_nargs);
50933 test_xmlXPathSubstringFunction(void) {
50936 #if defined(LIBXML_XPATH_ENABLED)
50938 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50940 int nargs; /* the number of arguments */
50943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50944 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50945 mem_base = xmlMemBlocks();
50946 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50947 nargs = gen_int(n_nargs, 1);
50949 xmlXPathSubstringFunction(ctxt, nargs);
50951 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50952 des_int(n_nargs, nargs, 1);
50953 xmlResetLastError();
50954 if (mem_base != xmlMemBlocks()) {
50955 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50956 xmlMemBlocks() - mem_base);
50958 printf(" %d", n_ctxt);
50959 printf(" %d", n_nargs);
50972 test_xmlXPathSumFunction(void) {
50975 #if defined(LIBXML_XPATH_ENABLED)
50977 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50979 int nargs; /* the number of arguments */
50982 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50983 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50984 mem_base = xmlMemBlocks();
50985 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50986 nargs = gen_int(n_nargs, 1);
50988 xmlXPathSumFunction(ctxt, nargs);
50990 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50991 des_int(n_nargs, nargs, 1);
50992 xmlResetLastError();
50993 if (mem_base != xmlMemBlocks()) {
50994 printf("Leak of %d blocks found in xmlXPathSumFunction",
50995 xmlMemBlocks() - mem_base);
50997 printf(" %d", n_ctxt);
50998 printf(" %d", n_nargs);
51011 test_xmlXPathTrailing(void) {
51014 #if defined(LIBXML_XPATH_ENABLED)
51016 xmlNodeSetPtr ret_val;
51017 xmlNodeSetPtr nodes1; /* a node-set */
51019 xmlNodeSetPtr nodes2; /* a node-set */
51022 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51023 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51024 mem_base = xmlMemBlocks();
51025 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51026 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51028 ret_val = xmlXPathTrailing(nodes1, nodes2);
51029 desret_xmlNodeSetPtr(ret_val);
51031 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51032 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51033 xmlResetLastError();
51034 if (mem_base != xmlMemBlocks()) {
51035 printf("Leak of %d blocks found in xmlXPathTrailing",
51036 xmlMemBlocks() - mem_base);
51038 printf(" %d", n_nodes1);
51039 printf(" %d", n_nodes2);
51052 test_xmlXPathTrailingSorted(void) {
51055 #if defined(LIBXML_XPATH_ENABLED)
51057 xmlNodeSetPtr ret_val;
51058 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
51060 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
51063 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51064 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51065 mem_base = xmlMemBlocks();
51066 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51067 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51069 ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
51070 desret_xmlNodeSetPtr(ret_val);
51072 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51073 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51074 xmlResetLastError();
51075 if (mem_base != xmlMemBlocks()) {
51076 printf("Leak of %d blocks found in xmlXPathTrailingSorted",
51077 xmlMemBlocks() - mem_base);
51079 printf(" %d", n_nodes1);
51080 printf(" %d", n_nodes2);
51093 test_xmlXPathTranslateFunction(void) {
51096 #if defined(LIBXML_XPATH_ENABLED)
51098 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51100 int nargs; /* the number of arguments */
51103 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51104 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51105 mem_base = xmlMemBlocks();
51106 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51107 nargs = gen_int(n_nargs, 1);
51109 xmlXPathTranslateFunction(ctxt, nargs);
51111 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51112 des_int(n_nargs, nargs, 1);
51113 xmlResetLastError();
51114 if (mem_base != xmlMemBlocks()) {
51115 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
51116 xmlMemBlocks() - mem_base);
51118 printf(" %d", n_ctxt);
51119 printf(" %d", n_nargs);
51132 test_xmlXPathTrueFunction(void) {
51135 #if defined(LIBXML_XPATH_ENABLED)
51137 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51139 int nargs; /* the number of arguments */
51142 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51143 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51144 mem_base = xmlMemBlocks();
51145 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51146 nargs = gen_int(n_nargs, 1);
51148 xmlXPathTrueFunction(ctxt, nargs);
51150 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51151 des_int(n_nargs, nargs, 1);
51152 xmlResetLastError();
51153 if (mem_base != xmlMemBlocks()) {
51154 printf("Leak of %d blocks found in xmlXPathTrueFunction",
51155 xmlMemBlocks() - mem_base);
51157 printf(" %d", n_ctxt);
51158 printf(" %d", n_nargs);
51171 test_xmlXPathValueFlipSign(void) {
51174 #if defined(LIBXML_XPATH_ENABLED)
51176 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51179 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51180 mem_base = xmlMemBlocks();
51181 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51183 xmlXPathValueFlipSign(ctxt);
51185 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51186 xmlResetLastError();
51187 if (mem_base != xmlMemBlocks()) {
51188 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
51189 xmlMemBlocks() - mem_base);
51191 printf(" %d", n_ctxt);
51203 test_xmlXPathVariableLookup(void) {
51206 #if defined(LIBXML_XPATH_ENABLED)
51208 xmlXPathObjectPtr ret_val;
51209 xmlXPathContextPtr ctxt; /* the XPath context */
51211 xmlChar * name; /* the variable name */
51214 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51215 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51216 mem_base = xmlMemBlocks();
51217 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51218 name = gen_const_xmlChar_ptr(n_name, 1);
51220 ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51221 desret_xmlXPathObjectPtr(ret_val);
51223 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51224 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51225 xmlResetLastError();
51226 if (mem_base != xmlMemBlocks()) {
51227 printf("Leak of %d blocks found in xmlXPathVariableLookup",
51228 xmlMemBlocks() - mem_base);
51230 printf(" %d", n_ctxt);
51231 printf(" %d", n_name);
51244 test_xmlXPathVariableLookupNS(void) {
51247 #if defined(LIBXML_XPATH_ENABLED)
51249 xmlXPathObjectPtr ret_val;
51250 xmlXPathContextPtr ctxt; /* the XPath context */
51252 xmlChar * name; /* the variable name */
51254 xmlChar * ns_uri; /* the variable namespace URI */
51257 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51258 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51259 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51260 mem_base = xmlMemBlocks();
51261 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51262 name = gen_const_xmlChar_ptr(n_name, 1);
51263 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51265 ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51266 desret_xmlXPathObjectPtr(ret_val);
51268 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51269 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51270 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51271 xmlResetLastError();
51272 if (mem_base != xmlMemBlocks()) {
51273 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51274 xmlMemBlocks() - mem_base);
51276 printf(" %d", n_ctxt);
51277 printf(" %d", n_name);
51278 printf(" %d", n_ns_uri);
51292 test_xmlXPathWrapCString(void) {
51295 #if defined(LIBXML_XPATH_ENABLED)
51297 xmlXPathObjectPtr ret_val;
51298 char * val; /* the char * value */
51301 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51302 mem_base = xmlMemBlocks();
51303 val = gen_char_ptr(n_val, 0);
51305 ret_val = xmlXPathWrapCString(val);
51306 desret_xmlXPathObjectPtr(ret_val);
51308 des_char_ptr(n_val, val, 0);
51309 xmlResetLastError();
51310 if (mem_base != xmlMemBlocks()) {
51311 printf("Leak of %d blocks found in xmlXPathWrapCString",
51312 xmlMemBlocks() - mem_base);
51314 printf(" %d", n_val);
51326 test_xmlXPathWrapExternal(void) {
51329 #if defined(LIBXML_XPATH_ENABLED)
51331 xmlXPathObjectPtr ret_val;
51332 void * val; /* the user data */
51335 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51336 mem_base = xmlMemBlocks();
51337 val = gen_void_ptr(n_val, 0);
51339 ret_val = xmlXPathWrapExternal(val);
51340 desret_xmlXPathObjectPtr(ret_val);
51342 des_void_ptr(n_val, val, 0);
51343 xmlResetLastError();
51344 if (mem_base != xmlMemBlocks()) {
51345 printf("Leak of %d blocks found in xmlXPathWrapExternal",
51346 xmlMemBlocks() - mem_base);
51348 printf(" %d", n_val);
51360 test_xmlXPathWrapNodeSet(void) {
51363 #if defined(LIBXML_XPATH_ENABLED)
51365 xmlXPathObjectPtr ret_val;
51366 xmlNodeSetPtr val; /* the NodePtr value */
51369 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51370 mem_base = xmlMemBlocks();
51371 val = gen_xmlNodeSetPtr(n_val, 0);
51373 ret_val = xmlXPathWrapNodeSet(val);
51374 desret_xmlXPathObjectPtr(ret_val);
51376 des_xmlNodeSetPtr(n_val, val, 0);
51377 xmlResetLastError();
51378 if (mem_base != xmlMemBlocks()) {
51379 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51380 xmlMemBlocks() - mem_base);
51382 printf(" %d", n_val);
51394 test_xmlXPatherror(void) {
51397 #if defined(LIBXML_XPATH_ENABLED)
51399 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51401 const char * file; /* the file name */
51403 int line; /* the line number */
51405 int no; /* the error number */
51408 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51409 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51410 for (n_line = 0;n_line < gen_nb_int;n_line++) {
51411 for (n_no = 0;n_no < gen_nb_int;n_no++) {
51412 mem_base = xmlMemBlocks();
51413 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51414 file = gen_filepath(n_file, 1);
51415 line = gen_int(n_line, 2);
51416 no = gen_int(n_no, 3);
51418 xmlXPatherror(ctxt, file, line, no);
51420 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51421 des_filepath(n_file, file, 1);
51422 des_int(n_line, line, 2);
51423 des_int(n_no, no, 3);
51424 xmlResetLastError();
51425 if (mem_base != xmlMemBlocks()) {
51426 printf("Leak of %d blocks found in xmlXPatherror",
51427 xmlMemBlocks() - mem_base);
51429 printf(" %d", n_ctxt);
51430 printf(" %d", n_file);
51431 printf(" %d", n_line);
51432 printf(" %d", n_no);
51446 test_xpathInternals(void) {
51449 if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51450 test_ret += test_valuePop();
51451 test_ret += test_valuePush();
51452 test_ret += test_xmlXPathAddValues();
51453 test_ret += test_xmlXPathBooleanFunction();
51454 test_ret += test_xmlXPathCeilingFunction();
51455 test_ret += test_xmlXPathCompareValues();
51456 test_ret += test_xmlXPathConcatFunction();
51457 test_ret += test_xmlXPathContainsFunction();
51458 test_ret += test_xmlXPathCountFunction();
51459 test_ret += test_xmlXPathDebugDumpCompExpr();
51460 test_ret += test_xmlXPathDebugDumpObject();
51461 test_ret += test_xmlXPathDifference();
51462 test_ret += test_xmlXPathDistinct();
51463 test_ret += test_xmlXPathDistinctSorted();
51464 test_ret += test_xmlXPathDivValues();
51465 test_ret += test_xmlXPathEqualValues();
51466 test_ret += test_xmlXPathErr();
51467 test_ret += test_xmlXPathEvalExpr();
51468 test_ret += test_xmlXPathEvaluatePredicateResult();
51469 test_ret += test_xmlXPathFalseFunction();
51470 test_ret += test_xmlXPathFloorFunction();
51471 test_ret += test_xmlXPathFunctionLookup();
51472 test_ret += test_xmlXPathFunctionLookupNS();
51473 test_ret += test_xmlXPathHasSameNodes();
51474 test_ret += test_xmlXPathIdFunction();
51475 test_ret += test_xmlXPathIntersection();
51476 test_ret += test_xmlXPathIsNodeType();
51477 test_ret += test_xmlXPathLangFunction();
51478 test_ret += test_xmlXPathLastFunction();
51479 test_ret += test_xmlXPathLeading();
51480 test_ret += test_xmlXPathLeadingSorted();
51481 test_ret += test_xmlXPathLocalNameFunction();
51482 test_ret += test_xmlXPathModValues();
51483 test_ret += test_xmlXPathMultValues();
51484 test_ret += test_xmlXPathNamespaceURIFunction();
51485 test_ret += test_xmlXPathNewBoolean();
51486 test_ret += test_xmlXPathNewCString();
51487 test_ret += test_xmlXPathNewFloat();
51488 test_ret += test_xmlXPathNewNodeSet();
51489 test_ret += test_xmlXPathNewNodeSetList();
51490 test_ret += test_xmlXPathNewParserContext();
51491 test_ret += test_xmlXPathNewString();
51492 test_ret += test_xmlXPathNextAncestor();
51493 test_ret += test_xmlXPathNextAncestorOrSelf();
51494 test_ret += test_xmlXPathNextAttribute();
51495 test_ret += test_xmlXPathNextChild();
51496 test_ret += test_xmlXPathNextDescendant();
51497 test_ret += test_xmlXPathNextDescendantOrSelf();
51498 test_ret += test_xmlXPathNextFollowing();
51499 test_ret += test_xmlXPathNextFollowingSibling();
51500 test_ret += test_xmlXPathNextNamespace();
51501 test_ret += test_xmlXPathNextParent();
51502 test_ret += test_xmlXPathNextPreceding();
51503 test_ret += test_xmlXPathNextPrecedingSibling();
51504 test_ret += test_xmlXPathNextSelf();
51505 test_ret += test_xmlXPathNodeLeading();
51506 test_ret += test_xmlXPathNodeLeadingSorted();
51507 test_ret += test_xmlXPathNodeSetAdd();
51508 test_ret += test_xmlXPathNodeSetAddNs();
51509 test_ret += test_xmlXPathNodeSetAddUnique();
51510 test_ret += test_xmlXPathNodeSetContains();
51511 test_ret += test_xmlXPathNodeSetDel();
51512 test_ret += test_xmlXPathNodeSetMerge();
51513 test_ret += test_xmlXPathNodeSetRemove();
51514 test_ret += test_xmlXPathNodeSetSort();
51515 test_ret += test_xmlXPathNodeTrailing();
51516 test_ret += test_xmlXPathNodeTrailingSorted();
51517 test_ret += test_xmlXPathNormalizeFunction();
51518 test_ret += test_xmlXPathNotEqualValues();
51519 test_ret += test_xmlXPathNotFunction();
51520 test_ret += test_xmlXPathNsLookup();
51521 test_ret += test_xmlXPathNumberFunction();
51522 test_ret += test_xmlXPathParseNCName();
51523 test_ret += test_xmlXPathParseName();
51524 test_ret += test_xmlXPathPopBoolean();
51525 test_ret += test_xmlXPathPopExternal();
51526 test_ret += test_xmlXPathPopNodeSet();
51527 test_ret += test_xmlXPathPopNumber();
51528 test_ret += test_xmlXPathPopString();
51529 test_ret += test_xmlXPathPositionFunction();
51530 test_ret += test_xmlXPathRegisterAllFunctions();
51531 test_ret += test_xmlXPathRegisterFunc();
51532 test_ret += test_xmlXPathRegisterFuncLookup();
51533 test_ret += test_xmlXPathRegisterFuncNS();
51534 test_ret += test_xmlXPathRegisterNs();
51535 test_ret += test_xmlXPathRegisterVariable();
51536 test_ret += test_xmlXPathRegisterVariableLookup();
51537 test_ret += test_xmlXPathRegisterVariableNS();
51538 test_ret += test_xmlXPathRegisteredFuncsCleanup();
51539 test_ret += test_xmlXPathRegisteredNsCleanup();
51540 test_ret += test_xmlXPathRegisteredVariablesCleanup();
51541 test_ret += test_xmlXPathRoot();
51542 test_ret += test_xmlXPathRoundFunction();
51543 test_ret += test_xmlXPathStartsWithFunction();
51544 test_ret += test_xmlXPathStringEvalNumber();
51545 test_ret += test_xmlXPathStringFunction();
51546 test_ret += test_xmlXPathStringLengthFunction();
51547 test_ret += test_xmlXPathSubValues();
51548 test_ret += test_xmlXPathSubstringAfterFunction();
51549 test_ret += test_xmlXPathSubstringBeforeFunction();
51550 test_ret += test_xmlXPathSubstringFunction();
51551 test_ret += test_xmlXPathSumFunction();
51552 test_ret += test_xmlXPathTrailing();
51553 test_ret += test_xmlXPathTrailingSorted();
51554 test_ret += test_xmlXPathTranslateFunction();
51555 test_ret += test_xmlXPathTrueFunction();
51556 test_ret += test_xmlXPathValueFlipSign();
51557 test_ret += test_xmlXPathVariableLookup();
51558 test_ret += test_xmlXPathVariableLookupNS();
51559 test_ret += test_xmlXPathWrapCString();
51560 test_ret += test_xmlXPathWrapExternal();
51561 test_ret += test_xmlXPathWrapNodeSet();
51562 test_ret += test_xmlXPatherror();
51565 printf("Module xpathInternals: %d errors\n", test_ret);
51570 test_xmlXPtrBuildNodeList(void) {
51573 #if defined(LIBXML_XPTR_ENABLED)
51575 xmlNodePtr ret_val;
51576 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51579 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51580 mem_base = xmlMemBlocks();
51581 obj = gen_xmlXPathObjectPtr(n_obj, 0);
51583 ret_val = xmlXPtrBuildNodeList(obj);
51584 desret_xmlNodePtr(ret_val);
51586 des_xmlXPathObjectPtr(n_obj, obj, 0);
51587 xmlResetLastError();
51588 if (mem_base != xmlMemBlocks()) {
51589 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51590 xmlMemBlocks() - mem_base);
51592 printf(" %d", n_obj);
51604 test_xmlXPtrEval(void) {
51607 #if defined(LIBXML_XPTR_ENABLED)
51609 xmlXPathObjectPtr ret_val;
51610 xmlChar * str; /* the XPointer expression */
51612 xmlXPathContextPtr ctx; /* the XPointer context */
51615 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51616 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51617 mem_base = xmlMemBlocks();
51618 str = gen_const_xmlChar_ptr(n_str, 0);
51619 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51621 ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51622 desret_xmlXPathObjectPtr(ret_val);
51624 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51625 des_xmlXPathContextPtr(n_ctx, ctx, 1);
51626 xmlResetLastError();
51627 if (mem_base != xmlMemBlocks()) {
51628 printf("Leak of %d blocks found in xmlXPtrEval",
51629 xmlMemBlocks() - mem_base);
51631 printf(" %d", n_str);
51632 printf(" %d", n_ctx);
51645 test_xmlXPtrEvalRangePredicate(void) {
51648 #if defined(LIBXML_XPTR_ENABLED)
51650 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51653 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51654 mem_base = xmlMemBlocks();
51655 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51657 xmlXPtrEvalRangePredicate(ctxt);
51659 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51660 xmlResetLastError();
51661 if (mem_base != xmlMemBlocks()) {
51662 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51663 xmlMemBlocks() - mem_base);
51665 printf(" %d", n_ctxt);
51675 #ifdef LIBXML_XPTR_ENABLED
51677 #define gen_nb_xmlLocationSetPtr 1
51678 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51681 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51687 test_xmlXPtrLocationSetAdd(void) {
51690 #if defined(LIBXML_XPTR_ENABLED)
51692 xmlLocationSetPtr cur; /* the initial range set */
51694 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51697 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51698 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51699 mem_base = xmlMemBlocks();
51700 cur = gen_xmlLocationSetPtr(n_cur, 0);
51701 val = gen_xmlXPathObjectPtr(n_val, 1);
51703 xmlXPtrLocationSetAdd(cur, val);
51705 des_xmlLocationSetPtr(n_cur, cur, 0);
51706 des_xmlXPathObjectPtr(n_val, val, 1);
51707 xmlResetLastError();
51708 if (mem_base != xmlMemBlocks()) {
51709 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51710 xmlMemBlocks() - mem_base);
51712 printf(" %d", n_cur);
51713 printf(" %d", n_val);
51726 test_xmlXPtrLocationSetCreate(void) {
51730 /* missing type support */
51736 test_xmlXPtrLocationSetDel(void) {
51739 #if defined(LIBXML_XPTR_ENABLED)
51741 xmlLocationSetPtr cur; /* the initial range set */
51743 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51746 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51747 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51748 mem_base = xmlMemBlocks();
51749 cur = gen_xmlLocationSetPtr(n_cur, 0);
51750 val = gen_xmlXPathObjectPtr(n_val, 1);
51752 xmlXPtrLocationSetDel(cur, val);
51754 des_xmlLocationSetPtr(n_cur, cur, 0);
51755 des_xmlXPathObjectPtr(n_val, val, 1);
51756 xmlResetLastError();
51757 if (mem_base != xmlMemBlocks()) {
51758 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51759 xmlMemBlocks() - mem_base);
51761 printf(" %d", n_cur);
51762 printf(" %d", n_val);
51775 test_xmlXPtrLocationSetMerge(void) {
51779 /* missing type support */
51785 test_xmlXPtrLocationSetRemove(void) {
51788 #if defined(LIBXML_XPTR_ENABLED)
51790 xmlLocationSetPtr cur; /* the initial range set */
51792 int val; /* the index to remove */
51795 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51796 for (n_val = 0;n_val < gen_nb_int;n_val++) {
51797 mem_base = xmlMemBlocks();
51798 cur = gen_xmlLocationSetPtr(n_cur, 0);
51799 val = gen_int(n_val, 1);
51801 xmlXPtrLocationSetRemove(cur, val);
51803 des_xmlLocationSetPtr(n_cur, cur, 0);
51804 des_int(n_val, val, 1);
51805 xmlResetLastError();
51806 if (mem_base != xmlMemBlocks()) {
51807 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51808 xmlMemBlocks() - mem_base);
51810 printf(" %d", n_cur);
51811 printf(" %d", n_val);
51824 test_xmlXPtrNewCollapsedRange(void) {
51827 #if defined(LIBXML_XPTR_ENABLED)
51829 xmlXPathObjectPtr ret_val;
51830 xmlNodePtr start; /* the starting and ending node */
51833 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51834 mem_base = xmlMemBlocks();
51835 start = gen_xmlNodePtr(n_start, 0);
51837 ret_val = xmlXPtrNewCollapsedRange(start);
51838 desret_xmlXPathObjectPtr(ret_val);
51840 des_xmlNodePtr(n_start, start, 0);
51841 xmlResetLastError();
51842 if (mem_base != xmlMemBlocks()) {
51843 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51844 xmlMemBlocks() - mem_base);
51846 printf(" %d", n_start);
51858 test_xmlXPtrNewContext(void) {
51862 /* missing type support */
51868 test_xmlXPtrNewLocationSetNodeSet(void) {
51871 #if defined(LIBXML_XPTR_ENABLED)
51873 xmlXPathObjectPtr ret_val;
51874 xmlNodeSetPtr set; /* a node set */
51877 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51878 mem_base = xmlMemBlocks();
51879 set = gen_xmlNodeSetPtr(n_set, 0);
51881 ret_val = xmlXPtrNewLocationSetNodeSet(set);
51882 desret_xmlXPathObjectPtr(ret_val);
51884 des_xmlNodeSetPtr(n_set, set, 0);
51885 xmlResetLastError();
51886 if (mem_base != xmlMemBlocks()) {
51887 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51888 xmlMemBlocks() - mem_base);
51890 printf(" %d", n_set);
51902 test_xmlXPtrNewLocationSetNodes(void) {
51905 #if defined(LIBXML_XPTR_ENABLED)
51907 xmlXPathObjectPtr ret_val;
51908 xmlNodePtr start; /* the start NodePtr value */
51910 xmlNodePtr end; /* the end NodePtr value or NULL */
51913 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51914 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51915 mem_base = xmlMemBlocks();
51916 start = gen_xmlNodePtr(n_start, 0);
51917 end = gen_xmlNodePtr(n_end, 1);
51919 ret_val = xmlXPtrNewLocationSetNodes(start, end);
51920 desret_xmlXPathObjectPtr(ret_val);
51922 des_xmlNodePtr(n_start, start, 0);
51923 des_xmlNodePtr(n_end, end, 1);
51924 xmlResetLastError();
51925 if (mem_base != xmlMemBlocks()) {
51926 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51927 xmlMemBlocks() - mem_base);
51929 printf(" %d", n_start);
51930 printf(" %d", n_end);
51943 test_xmlXPtrNewRange(void) {
51946 #if defined(LIBXML_XPTR_ENABLED)
51948 xmlXPathObjectPtr ret_val;
51949 xmlNodePtr start; /* the starting node */
51951 int startindex; /* the start index */
51953 xmlNodePtr end; /* the ending point */
51955 int endindex; /* the ending index */
51958 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51959 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51960 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51961 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51962 mem_base = xmlMemBlocks();
51963 start = gen_xmlNodePtr(n_start, 0);
51964 startindex = gen_int(n_startindex, 1);
51965 end = gen_xmlNodePtr(n_end, 2);
51966 endindex = gen_int(n_endindex, 3);
51968 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51969 desret_xmlXPathObjectPtr(ret_val);
51971 des_xmlNodePtr(n_start, start, 0);
51972 des_int(n_startindex, startindex, 1);
51973 des_xmlNodePtr(n_end, end, 2);
51974 des_int(n_endindex, endindex, 3);
51975 xmlResetLastError();
51976 if (mem_base != xmlMemBlocks()) {
51977 printf("Leak of %d blocks found in xmlXPtrNewRange",
51978 xmlMemBlocks() - mem_base);
51980 printf(" %d", n_start);
51981 printf(" %d", n_startindex);
51982 printf(" %d", n_end);
51983 printf(" %d", n_endindex);
51998 test_xmlXPtrNewRangeNodeObject(void) {
52001 #if defined(LIBXML_XPTR_ENABLED)
52003 xmlXPathObjectPtr ret_val;
52004 xmlNodePtr start; /* the starting node */
52006 xmlXPathObjectPtr end; /* the ending object */
52009 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52010 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52011 mem_base = xmlMemBlocks();
52012 start = gen_xmlNodePtr(n_start, 0);
52013 end = gen_xmlXPathObjectPtr(n_end, 1);
52015 ret_val = xmlXPtrNewRangeNodeObject(start, end);
52016 desret_xmlXPathObjectPtr(ret_val);
52018 des_xmlNodePtr(n_start, start, 0);
52019 des_xmlXPathObjectPtr(n_end, end, 1);
52020 xmlResetLastError();
52021 if (mem_base != xmlMemBlocks()) {
52022 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
52023 xmlMemBlocks() - mem_base);
52025 printf(" %d", n_start);
52026 printf(" %d", n_end);
52039 test_xmlXPtrNewRangeNodePoint(void) {
52042 #if defined(LIBXML_XPTR_ENABLED)
52044 xmlXPathObjectPtr ret_val;
52045 xmlNodePtr start; /* the starting node */
52047 xmlXPathObjectPtr end; /* the ending point */
52050 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52051 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52052 mem_base = xmlMemBlocks();
52053 start = gen_xmlNodePtr(n_start, 0);
52054 end = gen_xmlXPathObjectPtr(n_end, 1);
52056 ret_val = xmlXPtrNewRangeNodePoint(start, end);
52057 desret_xmlXPathObjectPtr(ret_val);
52059 des_xmlNodePtr(n_start, start, 0);
52060 des_xmlXPathObjectPtr(n_end, end, 1);
52061 xmlResetLastError();
52062 if (mem_base != xmlMemBlocks()) {
52063 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
52064 xmlMemBlocks() - mem_base);
52066 printf(" %d", n_start);
52067 printf(" %d", n_end);
52080 test_xmlXPtrNewRangeNodes(void) {
52083 #if defined(LIBXML_XPTR_ENABLED)
52085 xmlXPathObjectPtr ret_val;
52086 xmlNodePtr start; /* the starting node */
52088 xmlNodePtr end; /* the ending node */
52091 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52092 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52093 mem_base = xmlMemBlocks();
52094 start = gen_xmlNodePtr(n_start, 0);
52095 end = gen_xmlNodePtr(n_end, 1);
52097 ret_val = xmlXPtrNewRangeNodes(start, end);
52098 desret_xmlXPathObjectPtr(ret_val);
52100 des_xmlNodePtr(n_start, start, 0);
52101 des_xmlNodePtr(n_end, end, 1);
52102 xmlResetLastError();
52103 if (mem_base != xmlMemBlocks()) {
52104 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
52105 xmlMemBlocks() - mem_base);
52107 printf(" %d", n_start);
52108 printf(" %d", n_end);
52121 test_xmlXPtrNewRangePointNode(void) {
52124 #if defined(LIBXML_XPTR_ENABLED)
52126 xmlXPathObjectPtr ret_val;
52127 xmlXPathObjectPtr start; /* the starting point */
52129 xmlNodePtr end; /* the ending node */
52132 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52133 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52134 mem_base = xmlMemBlocks();
52135 start = gen_xmlXPathObjectPtr(n_start, 0);
52136 end = gen_xmlNodePtr(n_end, 1);
52138 ret_val = xmlXPtrNewRangePointNode(start, end);
52139 desret_xmlXPathObjectPtr(ret_val);
52141 des_xmlXPathObjectPtr(n_start, start, 0);
52142 des_xmlNodePtr(n_end, end, 1);
52143 xmlResetLastError();
52144 if (mem_base != xmlMemBlocks()) {
52145 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
52146 xmlMemBlocks() - mem_base);
52148 printf(" %d", n_start);
52149 printf(" %d", n_end);
52162 test_xmlXPtrNewRangePoints(void) {
52165 #if defined(LIBXML_XPTR_ENABLED)
52167 xmlXPathObjectPtr ret_val;
52168 xmlXPathObjectPtr start; /* the starting point */
52170 xmlXPathObjectPtr end; /* the ending point */
52173 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52174 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52175 mem_base = xmlMemBlocks();
52176 start = gen_xmlXPathObjectPtr(n_start, 0);
52177 end = gen_xmlXPathObjectPtr(n_end, 1);
52179 ret_val = xmlXPtrNewRangePoints(start, end);
52180 desret_xmlXPathObjectPtr(ret_val);
52182 des_xmlXPathObjectPtr(n_start, start, 0);
52183 des_xmlXPathObjectPtr(n_end, end, 1);
52184 xmlResetLastError();
52185 if (mem_base != xmlMemBlocks()) {
52186 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
52187 xmlMemBlocks() - mem_base);
52189 printf(" %d", n_start);
52190 printf(" %d", n_end);
52203 test_xmlXPtrRangeToFunction(void) {
52206 #if defined(LIBXML_XPTR_ENABLED)
52208 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52210 int nargs; /* the number of args */
52213 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52214 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52215 mem_base = xmlMemBlocks();
52216 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52217 nargs = gen_int(n_nargs, 1);
52219 xmlXPtrRangeToFunction(ctxt, nargs);
52221 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52222 des_int(n_nargs, nargs, 1);
52223 xmlResetLastError();
52224 if (mem_base != xmlMemBlocks()) {
52225 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52226 xmlMemBlocks() - mem_base);
52228 printf(" %d", n_ctxt);
52229 printf(" %d", n_nargs);
52242 test_xmlXPtrWrapLocationSet(void) {
52245 #if defined(LIBXML_XPTR_ENABLED)
52247 xmlXPathObjectPtr ret_val;
52248 xmlLocationSetPtr val; /* the LocationSet value */
52251 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52252 mem_base = xmlMemBlocks();
52253 val = gen_xmlLocationSetPtr(n_val, 0);
52255 ret_val = xmlXPtrWrapLocationSet(val);
52256 desret_xmlXPathObjectPtr(ret_val);
52258 des_xmlLocationSetPtr(n_val, val, 0);
52259 xmlResetLastError();
52260 if (mem_base != xmlMemBlocks()) {
52261 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52262 xmlMemBlocks() - mem_base);
52264 printf(" %d", n_val);
52275 test_xpointer(void) {
52278 if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52279 test_ret += test_xmlXPtrBuildNodeList();
52280 test_ret += test_xmlXPtrEval();
52281 test_ret += test_xmlXPtrEvalRangePredicate();
52282 test_ret += test_xmlXPtrLocationSetAdd();
52283 test_ret += test_xmlXPtrLocationSetCreate();
52284 test_ret += test_xmlXPtrLocationSetDel();
52285 test_ret += test_xmlXPtrLocationSetMerge();
52286 test_ret += test_xmlXPtrLocationSetRemove();
52287 test_ret += test_xmlXPtrNewCollapsedRange();
52288 test_ret += test_xmlXPtrNewContext();
52289 test_ret += test_xmlXPtrNewLocationSetNodeSet();
52290 test_ret += test_xmlXPtrNewLocationSetNodes();
52291 test_ret += test_xmlXPtrNewRange();
52292 test_ret += test_xmlXPtrNewRangeNodeObject();
52293 test_ret += test_xmlXPtrNewRangeNodePoint();
52294 test_ret += test_xmlXPtrNewRangeNodes();
52295 test_ret += test_xmlXPtrNewRangePointNode();
52296 test_ret += test_xmlXPtrNewRangePoints();
52297 test_ret += test_xmlXPtrRangeToFunction();
52298 test_ret += test_xmlXPtrWrapLocationSet();
52301 printf("Module xpointer: %d errors\n", test_ret);
52305 test_module(const char *module) {
52306 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52307 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52308 if (!strcmp(module, "SAX2")) return(test_SAX2());
52309 if (!strcmp(module, "c14n")) return(test_c14n());
52310 if (!strcmp(module, "catalog")) return(test_catalog());
52311 if (!strcmp(module, "chvalid")) return(test_chvalid());
52312 if (!strcmp(module, "debugXML")) return(test_debugXML());
52313 if (!strcmp(module, "dict")) return(test_dict());
52314 if (!strcmp(module, "encoding")) return(test_encoding());
52315 if (!strcmp(module, "entities")) return(test_entities());
52316 if (!strcmp(module, "hash")) return(test_hash());
52317 if (!strcmp(module, "list")) return(test_list());
52318 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52319 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52320 if (!strcmp(module, "parser")) return(test_parser());
52321 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52322 if (!strcmp(module, "pattern")) return(test_pattern());
52323 if (!strcmp(module, "relaxng")) return(test_relaxng());
52324 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52325 if (!strcmp(module, "schematron")) return(test_schematron());
52326 if (!strcmp(module, "tree")) return(test_tree());
52327 if (!strcmp(module, "uri")) return(test_uri());
52328 if (!strcmp(module, "valid")) return(test_valid());
52329 if (!strcmp(module, "xinclude")) return(test_xinclude());
52330 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52331 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52332 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52333 if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52334 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52335 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52336 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52337 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52338 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52339 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52340 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52341 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52342 if (!strcmp(module, "xpath")) return(test_xpath());
52343 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52344 if (!strcmp(module, "xpointer")) return(test_xpointer());