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.
17 #include <stdlib.h> /* for putenv() */
19 #include <libxml/xmlerror.h>
20 #include <libxml/relaxng.h>
22 #if defined(_WIN32) && !defined(__CYGWIN__)
23 #define snprintf _snprintf
26 static int testlibxml2(void);
27 static int test_module(const char *module);
29 static int generic_errors = 0;
30 static int call_tests = 0;
31 static int function_tests = 0;
33 static xmlChar chartab[1024];
34 static int inttab[1024];
35 static unsigned long longtab[1024];
37 static xmlDocPtr api_doc = NULL;
38 static xmlDtdPtr api_dtd = NULL;
39 static xmlNodePtr api_root = NULL;
40 static xmlAttrPtr api_attr = NULL;
41 static xmlNsPtr api_ns = NULL;
44 structured_errors(void *userData ATTRIBUTE_UNUSED,
45 xmlErrorPtr error ATTRIBUTE_UNUSED) {
61 if (api_doc == NULL) {
62 api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
71 if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
73 if ((api_doc != NULL) && (api_doc->children != NULL) &&
74 (api_doc->children->type == XML_DTD_NODE))
75 api_dtd = (xmlDtdPtr) api_doc->children;
82 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
84 if ((api_doc != NULL) && (api_doc->children != NULL) &&
85 (api_doc->children->next != NULL) &&
86 (api_doc->children->next->type == XML_ELEMENT_NODE))
87 api_root = api_doc->children->next;
96 api_ns = api_root->nsDef;
102 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
107 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
110 if (api_root == NULL)
112 if (api_root->properties != NULL) {
113 api_attr = api_root->properties;
114 return(api_root->properties);
117 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
118 snprintf((char *) name, 20, "foo%d", nr++);
119 api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
124 static int quiet = 0;
126 int main(int argc, char **argv) {
130 /* access to the proxy can slow up regression tests a lot */
131 putenv((char *) "http_proxy=");
133 memset(chartab, 0, sizeof(chartab));
134 strncpy((char *) chartab, " chartab\n", 20);
135 memset(inttab, 0, sizeof(inttab));
136 memset(longtab, 0, sizeof(longtab));
139 #ifdef LIBXML_SCHEMAS_ENABLED
140 xmlRelaxNGInitTypes();
145 xmlSetStructuredErrorFunc(NULL, structured_errors);
148 if (!strcmp(argv[1], "-q")) {
151 ret = test_module(argv[2]);
155 ret = test_module(argv[1]);
161 blocks = xmlMemBlocks();
163 if ((blocks != 0) || (mem != 0)) {
164 printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
171 #include <libxml/HTMLparser.h>
172 #include <libxml/HTMLtree.h>
173 #include <libxml/catalog.h>
174 #include <libxml/chvalid.h>
175 #include <libxml/dict.h>
176 #include <libxml/encoding.h>
177 #include <libxml/entities.h>
178 #include <libxml/hash.h>
179 #include <libxml/list.h>
180 #include <libxml/nanoftp.h>
181 #include <libxml/nanohttp.h>
182 #include <libxml/parser.h>
183 #include <libxml/parserInternals.h>
184 #include <libxml/pattern.h>
185 #include <libxml/relaxng.h>
186 #include <libxml/schemasInternals.h>
187 #include <libxml/schematron.h>
188 #include <libxml/tree.h>
189 #include <libxml/uri.h>
190 #include <libxml/valid.h>
191 #include <libxml/xinclude.h>
192 #include <libxml/xmlIO.h>
193 #include <libxml/xmlerror.h>
194 #include <libxml/xmlreader.h>
195 #include <libxml/xmlsave.h>
196 #include <libxml/xmlschemas.h>
197 #include <libxml/xmlschemastypes.h>
198 #include <libxml/xmlstring.h>
199 #include <libxml/xmlwriter.h>
200 #include <libxml/xpath.h>
201 #include <libxml/xpointer.h>
202 #include <libxml/debugXML.h>
205 We manually define xmlErrMemory because it's normal declaration
206 is "hidden" by #ifdef IN_LIBXML
208 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
211 We need some "remote" addresses, but want to avoid getting into
212 name resolution delays, so we use these
214 #define REMOTE1GOOD "http://localhost/"
215 #define REMOTE1BAD "http:http://http"
216 #define REMOTE2GOOD "ftp://localhost/foo"
218 #define gen_nb_void_ptr 2
220 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
223 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
227 #define gen_nb_const_void_ptr 2
229 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
230 if (no == 0) return((const void *) "immutable string");
233 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
237 #define gen_nb_userdata 3
239 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
240 if (no == 0) return((void *) &call_tests);
241 if (no == 1) return((void *) -1);
244 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
250 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
251 if (no == 0) return(0);
252 if (no == 1) return(1);
253 if (no == 2) return(-1);
254 if (no == 3) return(122);
258 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
261 #define gen_nb_parseroptions 5
263 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
264 if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
265 if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
266 if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
267 if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
268 return(XML_PARSE_SAX1);
271 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
275 #define gen_nb_long 5
277 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
278 if (no == 0) return(0);
279 if (no == 1) return(1);
280 if (no == 2) return(-1);
281 if (no == 3) return(122);
285 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
289 #define gen_nb_xmlChar 4
291 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
292 if (no == 0) return('a');
293 if (no == 1) return(' ');
294 if (no == 2) return((xmlChar) 'ø');
298 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
301 #define gen_nb_unsigned_int 3
303 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
304 if (no == 0) return(0);
305 if (no == 1) return(1);
306 if (no == 2) return(122);
307 return((unsigned int) -1);
310 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
313 #define gen_nb_unsigned_long 4
315 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
316 if (no == 0) return(0);
317 if (no == 1) return(1);
318 if (no == 2) return(122);
319 return((unsigned long) -1);
322 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
325 #define gen_nb_double 4
327 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
328 if (no == 0) return(0);
329 if (no == 1) return(-1.1);
330 #if defined(LIBXML_XPATH_ENABLED)
331 if (no == 2) return(xmlXPathNAN);
336 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
339 #define gen_nb_unsigned_long_ptr 2
341 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
342 if (no == 0) return(&longtab[nr]);
346 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
349 #define gen_nb_int_ptr 2
351 static int *gen_int_ptr(int no, int nr) {
352 if (no == 0) return(&inttab[nr]);
356 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
359 #define gen_nb_const_char_ptr 4
361 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
362 if (no == 0) return((char *) "foo");
363 if (no == 1) return((char *) "<foo/>");
364 if (no == 2) return((char *) "test/ent2");
367 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
370 #define gen_nb_xmlChar_ptr 2
372 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
373 if (no == 0) return(&chartab[0]);
376 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
379 #define gen_nb_FILE_ptr 2
381 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
382 if (no == 0) return(fopen("test.out", "a+"));
385 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
386 if (val != NULL) fclose(val);
389 #define gen_nb_debug_FILE_ptr 2
390 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
391 return(fopen("test.out", "a+"));
393 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
394 if (val != NULL) fclose(val);
397 #define gen_nb_const_xmlChar_ptr 5
399 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
400 if (no == 0) return((xmlChar *) "foo");
401 if (no == 1) return((xmlChar *) "<foo/>");
402 if (no == 2) return((xmlChar *) "nøne");
403 if (no == 3) return((xmlChar *) " 2ab ");
406 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
409 #define gen_nb_filepath 8
411 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
412 if (no == 0) return("missing.xml");
413 if (no == 1) return("<foo/>");
414 if (no == 2) return("test/ent2");
415 if (no == 3) return("test/valid/REC-xml-19980210.xml");
416 if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
417 if (no == 5) return(REMOTE1GOOD);
418 if (no == 6) return(REMOTE1BAD);
421 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
424 #define gen_nb_eaten_name 2
426 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
427 if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
430 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
433 #define gen_nb_fileoutput 6
435 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
436 if (no == 0) return("/missing.xml");
437 if (no == 1) return("<foo/>");
438 if (no == 2) return(REMOTE2GOOD);
439 if (no == 3) return(REMOTE1GOOD);
440 if (no == 4) return(REMOTE1BAD);
443 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
446 #define gen_nb_xmlParserCtxtPtr 3
447 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
448 if (no == 0) return(xmlNewParserCtxt());
449 if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
452 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
454 xmlFreeParserCtxt(val);
457 #define gen_nb_xmlSAXHandlerPtr 2
458 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
459 #ifdef LIBXML_SAX1_ENABLED
460 if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
464 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
467 #define gen_nb_xmlValidCtxtPtr 2
468 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
469 #ifdef LIBXML_VALID_ENABLED
470 if (no == 0) return(xmlNewValidCtxt());
474 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
475 #ifdef LIBXML_VALID_ENABLED
477 xmlFreeValidCtxt(val);
481 #define gen_nb_xmlParserInputBufferPtr 8
483 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
484 if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
485 if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
486 if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
487 if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
488 if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
489 if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
490 if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
493 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
494 xmlFreeParserInputBuffer(val);
497 #define gen_nb_xmlDocPtr 4
498 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
499 if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
500 if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
501 if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
504 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
505 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
509 #define gen_nb_xmlAttrPtr 2
510 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
511 if (no == 0) return(get_api_attr());
514 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
515 if (no == 0) free_api_doc();
518 #define gen_nb_xmlDictPtr 2
519 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
520 if (no == 0) return(xmlDictCreate());
523 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
528 #define gen_nb_xmlNodePtr 3
529 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
530 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
531 if (no == 1) return(get_api_root());
533 /* if (no == 2) return((xmlNodePtr) get_api_doc()); */
535 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
538 } else if (val != NULL) {
544 #define gen_nb_xmlDtdPtr 3
545 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
547 return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
548 if (no == 1) return(get_api_dtd());
551 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
552 if (no == 1) free_api_doc();
553 else if (val != NULL) {
554 xmlUnlinkNode((xmlNodePtr) val);
555 xmlFreeNode((xmlNodePtr) val);
559 #define gen_nb_xmlNsPtr 2
560 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
561 if (no == 0) return(get_api_ns());
564 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
565 if (no == 0) free_api_doc();
568 #define gen_nb_xmlNodePtr_in 3
569 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
570 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
571 if (no == 0) return(xmlNewText(BAD_CAST "text"));
574 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
577 #ifdef LIBXML_WRITER_ENABLED
578 #define gen_nb_xmlTextWriterPtr 2
579 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
580 if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
583 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
584 if (val != NULL) xmlFreeTextWriter(val);
588 #ifdef LIBXML_READER_ENABLED
589 #define gen_nb_xmlTextReaderPtr 4
590 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
591 if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
592 if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
593 if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
596 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
597 if (val != NULL) xmlFreeTextReader(val);
601 #define gen_nb_xmlBufferPtr 3
602 static const char *static_buf_content = "a static buffer";
603 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
604 if (no == 0) return(xmlBufferCreate());
605 if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
608 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
614 #define gen_nb_xmlListPtr 2
615 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
616 if (no == 0) return(xmlListCreate(NULL, NULL));
619 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
625 #define gen_nb_xmlHashTablePtr 2
626 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
627 if (no == 0) return(xmlHashCreate(10));
630 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
632 xmlHashFree(val, NULL);
636 #include <libxml/xpathInternals.h>
638 #ifdef LIBXML_XPATH_ENABLED
639 #define gen_nb_xmlXPathObjectPtr 5
640 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
641 if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
642 if (no == 1) return(xmlXPathNewFloat(1.1));
643 if (no == 2) return(xmlXPathNewBoolean(1));
644 if (no == 3) return(xmlXPathNewNodeSet(NULL));
647 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
649 xmlXPathFreeObject(val);
654 #ifdef LIBXML_OUTPUT_ENABLED
655 #define gen_nb_xmlOutputBufferPtr 2
656 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
657 if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
660 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
662 xmlOutputBufferClose(val);
667 #ifdef LIBXML_FTP_ENABLED
668 #define gen_nb_xmlNanoFTPCtxtPtr 4
669 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
670 if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
671 if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
672 if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
675 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
677 xmlNanoFTPFreeCtxt(val);
682 #ifdef LIBXML_HTTP_ENABLED
683 #define gen_nb_xmlNanoHTTPCtxtPtr 1
684 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
685 if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
686 if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
687 if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
690 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
692 xmlNanoHTTPClose(val);
697 #define gen_nb_xmlCharEncoding 4
698 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
699 if (no == 0) return(XML_CHAR_ENCODING_UTF8);
700 if (no == 1) return(XML_CHAR_ENCODING_NONE);
701 if (no == 2) return(XML_CHAR_ENCODING_8859_1);
702 return(XML_CHAR_ENCODING_ERROR);
704 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
707 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
709 #define gen_nb_xmlExpCtxtPtr 1
710 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
713 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
716 #define gen_nb_xmlExpNodePtr 1
717 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
720 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
725 #if defined(LIBXML_SCHEMAS_ENABLED)
726 #define gen_nb_xmlSchemaPtr 1
727 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
730 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
733 #define gen_nb_xmlSchemaValidCtxtPtr 1
734 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
737 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
740 #endif /* LIBXML_SCHEMAS_ENABLED */
742 #define gen_nb_xmlHashDeallocator 2
744 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
747 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
748 if (no == 0) return(test_xmlHashDeallocator);
751 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
755 static void desret_int(int val ATTRIBUTE_UNUSED) {
757 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
759 static void desret_long(long val ATTRIBUTE_UNUSED) {
761 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
763 static void desret_double(double val ATTRIBUTE_UNUSED) {
765 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
768 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
771 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
773 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
775 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
777 static void desret_xmlChar_ptr(xmlChar *val) {
781 static void desret_xmlDocPtr(xmlDocPtr val) {
785 static void desret_xmlDictPtr(xmlDictPtr val) {
788 #ifdef LIBXML_OUTPUT_ENABLED
789 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
790 xmlOutputBufferClose(val);
793 #ifdef LIBXML_READER_ENABLED
794 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
795 xmlFreeTextReader(val);
798 static void desret_xmlNodePtr(xmlNodePtr val) {
799 if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
804 static void desret_xmlAttrPtr(xmlAttrPtr val) {
806 xmlUnlinkNode((xmlNodePtr) val);
807 xmlFreeNode((xmlNodePtr) val);
810 static void desret_xmlEntityPtr(xmlEntityPtr val) {
812 xmlUnlinkNode((xmlNodePtr) val);
813 xmlFreeNode((xmlNodePtr) val);
816 static void desret_xmlElementPtr(xmlElementPtr val) {
818 xmlUnlinkNode((xmlNodePtr) val);
821 static void desret_xmlAttributePtr(xmlAttributePtr val) {
823 xmlUnlinkNode((xmlNodePtr) val);
826 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
828 static void desret_xmlDtdPtr(xmlDtdPtr val) {
829 desret_xmlNodePtr((xmlNodePtr)val);
831 #ifdef LIBXML_XPATH_ENABLED
832 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
833 xmlXPathFreeObject(val);
835 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
836 xmlXPathFreeNodeSet(val);
839 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
840 xmlFreeParserCtxt(val);
842 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
843 xmlFreeParserInputBuffer(val);
845 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
846 xmlFreeInputStream(val);
848 #ifdef LIBXML_WRITER_ENABLED
849 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
850 xmlFreeTextWriter(val);
853 static void desret_xmlBufferPtr(xmlBufferPtr val) {
856 #ifdef LIBXML_SCHEMAS_ENABLED
857 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
858 xmlSchemaFreeParserCtxt(val);
860 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
862 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
863 xmlRelaxNGFreeParserCtxt(val);
866 #ifdef LIBXML_HTML_ENABLED
867 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
870 #ifdef LIBXML_HTTP_ENABLED
871 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
872 xmlNanoHTTPClose(val);
875 #ifdef LIBXML_FTP_ENABLED
876 static void desret_xmlNanoFTPCtxtPtr(void *val) {
877 xmlNanoFTPClose(val);
880 /* cut and pasted from autogenerated to avoid troubles */
881 #define gen_nb_const_xmlChar_ptr_ptr 1
882 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
885 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
888 #define gen_nb_unsigned_char_ptr 1
889 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
892 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
895 #define gen_nb_const_unsigned_char_ptr 1
896 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
899 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
902 #ifdef LIBXML_HTML_ENABLED
903 #define gen_nb_const_htmlNodePtr 1
904 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
907 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
911 #ifdef LIBXML_HTML_ENABLED
912 #define gen_nb_htmlDocPtr 3
913 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
914 if (no == 0) return(htmlNewDoc(NULL, NULL));
915 if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
918 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
919 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
922 static void desret_htmlDocPtr(htmlDocPtr val) {
923 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
926 #define gen_nb_htmlParserCtxtPtr 3
927 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
928 if (no == 0) return(xmlNewParserCtxt());
929 if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
932 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
934 htmlFreeParserCtxt(val);
936 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
938 htmlFreeParserCtxt(val);
942 #ifdef LIBXML_XPATH_ENABLED
943 #define gen_nb_xmlNodeSetPtr 1
944 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
947 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
951 #ifdef LIBXML_DEBUG_ENABLED
952 #ifdef LIBXML_XPATH_ENABLED
953 #define gen_nb_xmlShellCtxtPtr 1
954 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
957 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
962 #ifdef LIBXML_PATTERN_ENABLED
963 #define gen_nb_xmlPatternPtr 1
964 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
967 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
971 #define gen_nb_xmlElementContentPtr 1
972 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
975 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
977 xmlFreeElementContent(val);
979 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
981 xmlFreeElementContent(val);
984 #define gen_nb_xmlParserNodeInfoSeqPtr 1
985 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
988 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
991 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
994 #define gen_nb_void_ptr_ptr 1
995 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
998 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1001 /************************************************************************
1003 * WARNING: end of the manually maintained part of the test code *
1004 * do not remove or alter the CUT HERE line *
1006 ************************************************************************/
1008 /* CUT HERE: everything below that line is generated */
1009 #ifdef LIBXML_HTML_ENABLED
1010 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1015 #define gen_nb_xmlAttributeDefault 4
1016 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1017 if (no == 1) return(XML_ATTRIBUTE_FIXED);
1018 if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1019 if (no == 3) return(XML_ATTRIBUTE_NONE);
1020 if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1024 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1027 #define gen_nb_xmlAttributeType 4
1028 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1029 if (no == 1) return(XML_ATTRIBUTE_CDATA);
1030 if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1031 if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1032 if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1036 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1039 #define gen_nb_xmlBufferAllocationScheme 4
1040 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1041 if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1042 if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1043 if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1044 if (no == 4) return(XML_BUFFER_ALLOC_IO);
1048 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1051 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1054 #ifdef LIBXML_CATALOG_ENABLED
1055 #define gen_nb_xmlCatalogAllow 4
1056 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1057 if (no == 1) return(XML_CATA_ALLOW_ALL);
1058 if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1059 if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1060 if (no == 4) return(XML_CATA_ALLOW_NONE);
1064 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1067 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1072 #ifdef LIBXML_CATALOG_ENABLED
1073 #define gen_nb_xmlCatalogPrefer 3
1074 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1075 if (no == 1) return(XML_CATA_PREFER_NONE);
1076 if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1077 if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1081 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1084 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1089 #define gen_nb_xmlElementContentType 4
1090 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1091 if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1092 if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1093 if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1094 if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1098 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1101 #define gen_nb_xmlElementTypeVal 4
1102 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1103 if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1104 if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1105 if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1106 if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1110 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1113 #define gen_nb_xmlFeature 4
1114 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1115 if (no == 1) return(XML_WITH_AUTOMATA);
1116 if (no == 2) return(XML_WITH_C14N);
1117 if (no == 3) return(XML_WITH_CATALOG);
1118 if (no == 4) return(XML_WITH_DEBUG);
1122 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1125 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1128 #ifdef LIBXML_SCHEMAS_ENABLED
1129 #define gen_nb_xmlSchemaValType 4
1130 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1131 if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1132 if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1133 if (no == 3) return(XML_SCHEMAS_ANYURI);
1134 if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1138 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1141 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1146 #ifdef LIBXML_SCHEMAS_ENABLED
1147 #define gen_nb_xmlSchemaWhitespaceValueType 4
1148 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1149 if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1150 if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1151 if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1152 if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1156 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1161 #include <libxml/HTMLparser.h>
1162 #include <libxml/HTMLtree.h>
1163 #include <libxml/SAX2.h>
1164 #include <libxml/c14n.h>
1165 #include <libxml/catalog.h>
1166 #include <libxml/chvalid.h>
1167 #include <libxml/debugXML.h>
1168 #include <libxml/dict.h>
1169 #include <libxml/encoding.h>
1170 #include <libxml/entities.h>
1171 #include <libxml/hash.h>
1172 #include <libxml/list.h>
1173 #include <libxml/nanoftp.h>
1174 #include <libxml/nanohttp.h>
1175 #include <libxml/parser.h>
1176 #include <libxml/parserInternals.h>
1177 #include <libxml/pattern.h>
1178 #include <libxml/relaxng.h>
1179 #include <libxml/schemasInternals.h>
1180 #include <libxml/schematron.h>
1181 #include <libxml/tree.h>
1182 #include <libxml/uri.h>
1183 #include <libxml/valid.h>
1184 #include <libxml/xinclude.h>
1185 #include <libxml/xmlIO.h>
1186 #include <libxml/xmlautomata.h>
1187 #include <libxml/xmlerror.h>
1188 #include <libxml/xmlmodule.h>
1189 #include <libxml/xmlreader.h>
1190 #include <libxml/xmlregexp.h>
1191 #include <libxml/xmlsave.h>
1192 #include <libxml/xmlschemas.h>
1193 #include <libxml/xmlschemastypes.h>
1194 #include <libxml/xmlstring.h>
1195 #include <libxml/xmlunicode.h>
1196 #include <libxml/xmlwriter.h>
1197 #include <libxml/xpath.h>
1198 #include <libxml/xpathInternals.h>
1199 #include <libxml/xpointer.h>
1200 static int test_HTMLparser(void);
1201 static int test_HTMLtree(void);
1202 static int test_SAX2(void);
1203 static int test_c14n(void);
1204 static int test_catalog(void);
1205 static int test_chvalid(void);
1206 static int test_debugXML(void);
1207 static int test_dict(void);
1208 static int test_encoding(void);
1209 static int test_entities(void);
1210 static int test_hash(void);
1211 static int test_list(void);
1212 static int test_nanoftp(void);
1213 static int test_nanohttp(void);
1214 static int test_parser(void);
1215 static int test_parserInternals(void);
1216 static int test_pattern(void);
1217 static int test_relaxng(void);
1218 static int test_schemasInternals(void);
1219 static int test_schematron(void);
1220 static int test_tree(void);
1221 static int test_uri(void);
1222 static int test_valid(void);
1223 static int test_xinclude(void);
1224 static int test_xmlIO(void);
1225 static int test_xmlautomata(void);
1226 static int test_xmlerror(void);
1227 static int test_xmlmodule(void);
1228 static int test_xmlreader(void);
1229 static int test_xmlregexp(void);
1230 static int test_xmlsave(void);
1231 static int test_xmlschemas(void);
1232 static int test_xmlschemastypes(void);
1233 static int test_xmlstring(void);
1234 static int test_xmlunicode(void);
1235 static int test_xmlwriter(void);
1236 static int test_xpath(void);
1237 static int test_xpathInternals(void);
1238 static int test_xpointer(void);
1243 * Main entry point of the tester for the full libxml2 module,
1244 * it calls all the tester entry point for each module.
1246 * Returns the number of error found
1253 test_ret += test_HTMLparser();
1254 test_ret += test_HTMLtree();
1255 test_ret += test_SAX2();
1256 test_ret += test_c14n();
1257 test_ret += test_catalog();
1258 test_ret += test_chvalid();
1259 test_ret += test_debugXML();
1260 test_ret += test_dict();
1261 test_ret += test_encoding();
1262 test_ret += test_entities();
1263 test_ret += test_hash();
1264 test_ret += test_list();
1265 test_ret += test_nanoftp();
1266 test_ret += test_nanohttp();
1267 test_ret += test_parser();
1268 test_ret += test_parserInternals();
1269 test_ret += test_pattern();
1270 test_ret += test_relaxng();
1271 test_ret += test_schemasInternals();
1272 test_ret += test_schematron();
1273 test_ret += test_tree();
1274 test_ret += test_uri();
1275 test_ret += test_valid();
1276 test_ret += test_xinclude();
1277 test_ret += test_xmlIO();
1278 test_ret += test_xmlautomata();
1279 test_ret += test_xmlerror();
1280 test_ret += test_xmlmodule();
1281 test_ret += test_xmlreader();
1282 test_ret += test_xmlregexp();
1283 test_ret += test_xmlsave();
1284 test_ret += test_xmlschemas();
1285 test_ret += test_xmlschemastypes();
1286 test_ret += test_xmlstring();
1287 test_ret += test_xmlunicode();
1288 test_ret += test_xmlwriter();
1289 test_ret += test_xpath();
1290 test_ret += test_xpathInternals();
1291 test_ret += test_xpointer();
1293 printf("Total: %d functions, %d tests, %d errors\n",
1294 function_tests, call_tests, test_ret);
1300 test_UTF8ToHtml(void) {
1303 #if defined(LIBXML_HTML_ENABLED)
1306 unsigned char * out; /* a pointer to an array of bytes to store the result */
1308 int * outlen; /* the length of @out */
1310 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1312 int * inlen; /* the length of @in */
1315 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1316 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1317 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1318 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1319 mem_base = xmlMemBlocks();
1320 out = gen_unsigned_char_ptr(n_out, 0);
1321 outlen = gen_int_ptr(n_outlen, 1);
1322 in = gen_const_unsigned_char_ptr(n_in, 2);
1323 inlen = gen_int_ptr(n_inlen, 3);
1325 ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1326 desret_int(ret_val);
1328 des_unsigned_char_ptr(n_out, out, 0);
1329 des_int_ptr(n_outlen, outlen, 1);
1330 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1331 des_int_ptr(n_inlen, inlen, 3);
1332 xmlResetLastError();
1333 if (mem_base != xmlMemBlocks()) {
1334 printf("Leak of %d blocks found in UTF8ToHtml",
1335 xmlMemBlocks() - mem_base);
1337 printf(" %d", n_out);
1338 printf(" %d", n_outlen);
1339 printf(" %d", n_in);
1340 printf(" %d", n_inlen);
1353 #ifdef LIBXML_HTML_ENABLED
1355 #define gen_nb_const_htmlElemDesc_ptr 1
1356 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1359 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1365 test_htmlAttrAllowed(void) {
1368 #if defined(LIBXML_HTML_ENABLED)
1371 htmlElemDesc * elt; /* HTML element */
1373 xmlChar * attr; /* HTML attribute */
1375 int legacy; /* whether to allow deprecated attributes */
1378 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1379 for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1380 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1381 mem_base = xmlMemBlocks();
1382 elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1383 attr = gen_const_xmlChar_ptr(n_attr, 1);
1384 legacy = gen_int(n_legacy, 2);
1386 ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1387 desret_htmlStatus(ret_val);
1389 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1390 des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1391 des_int(n_legacy, legacy, 2);
1392 xmlResetLastError();
1393 if (mem_base != xmlMemBlocks()) {
1394 printf("Leak of %d blocks found in htmlAttrAllowed",
1395 xmlMemBlocks() - mem_base);
1397 printf(" %d", n_elt);
1398 printf(" %d", n_attr);
1399 printf(" %d", n_legacy);
1411 #ifdef LIBXML_HTML_ENABLED
1413 #define gen_nb_htmlNodePtr 1
1414 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1417 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1423 test_htmlAutoCloseTag(void) {
1426 #if defined(LIBXML_HTML_ENABLED)
1429 htmlDocPtr doc; /* the HTML document */
1431 xmlChar * name; /* The tag name */
1433 htmlNodePtr elem; /* the HTML element */
1436 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1437 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1438 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1439 mem_base = xmlMemBlocks();
1440 doc = gen_htmlDocPtr(n_doc, 0);
1441 name = gen_const_xmlChar_ptr(n_name, 1);
1442 elem = gen_htmlNodePtr(n_elem, 2);
1444 ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1445 desret_int(ret_val);
1447 des_htmlDocPtr(n_doc, doc, 0);
1448 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1449 des_htmlNodePtr(n_elem, elem, 2);
1450 xmlResetLastError();
1451 if (mem_base != xmlMemBlocks()) {
1452 printf("Leak of %d blocks found in htmlAutoCloseTag",
1453 xmlMemBlocks() - mem_base);
1455 printf(" %d", n_doc);
1456 printf(" %d", n_name);
1457 printf(" %d", n_elem);
1471 test_htmlCreateMemoryParserCtxt(void) {
1474 #if defined(LIBXML_HTML_ENABLED)
1476 htmlParserCtxtPtr ret_val;
1477 char * buffer; /* a pointer to a char array */
1479 int size; /* the size of the array */
1482 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1483 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1484 mem_base = xmlMemBlocks();
1485 buffer = gen_const_char_ptr(n_buffer, 0);
1486 size = gen_int(n_size, 1);
1488 ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1489 desret_htmlParserCtxtPtr(ret_val);
1491 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1492 des_int(n_size, size, 1);
1493 xmlResetLastError();
1494 if (mem_base != xmlMemBlocks()) {
1495 printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1496 xmlMemBlocks() - mem_base);
1498 printf(" %d", n_buffer);
1499 printf(" %d", n_size);
1510 #ifdef LIBXML_HTML_ENABLED
1512 #define gen_nb_htmlSAXHandlerPtr 1
1513 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1516 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1522 test_htmlCreatePushParserCtxt(void) {
1525 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1527 htmlParserCtxtPtr ret_val;
1528 htmlSAXHandlerPtr sax; /* a SAX handler */
1530 void * user_data; /* The user data returned on SAX callbacks */
1532 char * chunk; /* a pointer to an array of chars */
1534 int size; /* number of chars in the array */
1536 const char * filename; /* an optional file name or URI */
1538 xmlCharEncoding enc; /* an optional encoding */
1541 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1542 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1543 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1544 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1545 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1546 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1547 mem_base = xmlMemBlocks();
1548 sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1549 user_data = gen_userdata(n_user_data, 1);
1550 chunk = gen_const_char_ptr(n_chunk, 2);
1551 size = gen_int(n_size, 3);
1552 filename = gen_fileoutput(n_filename, 4);
1553 enc = gen_xmlCharEncoding(n_enc, 5);
1555 ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1556 desret_htmlParserCtxtPtr(ret_val);
1558 des_htmlSAXHandlerPtr(n_sax, sax, 0);
1559 des_userdata(n_user_data, user_data, 1);
1560 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1561 des_int(n_size, size, 3);
1562 des_fileoutput(n_filename, filename, 4);
1563 des_xmlCharEncoding(n_enc, enc, 5);
1564 xmlResetLastError();
1565 if (mem_base != xmlMemBlocks()) {
1566 printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1567 xmlMemBlocks() - mem_base);
1569 printf(" %d", n_sax);
1570 printf(" %d", n_user_data);
1571 printf(" %d", n_chunk);
1572 printf(" %d", n_size);
1573 printf(" %d", n_filename);
1574 printf(" %d", n_enc);
1591 test_htmlCtxtReadDoc(void) {
1594 #if defined(LIBXML_HTML_ENABLED)
1597 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1599 xmlChar * cur; /* a pointer to a zero terminated string */
1601 const char * URL; /* the base URL to use for the document */
1603 char * encoding; /* the document encoding, or NULL */
1605 int options; /* a combination of htmlParserOption(s) */
1608 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1609 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1610 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1611 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1612 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1613 mem_base = xmlMemBlocks();
1614 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1615 cur = gen_const_xmlChar_ptr(n_cur, 1);
1616 URL = gen_filepath(n_URL, 2);
1617 encoding = gen_const_char_ptr(n_encoding, 3);
1618 options = gen_int(n_options, 4);
1620 ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1621 desret_htmlDocPtr(ret_val);
1623 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1624 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1625 des_filepath(n_URL, URL, 2);
1626 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1627 des_int(n_options, options, 4);
1628 xmlResetLastError();
1629 if (mem_base != xmlMemBlocks()) {
1630 printf("Leak of %d blocks found in htmlCtxtReadDoc",
1631 xmlMemBlocks() - mem_base);
1633 printf(" %d", n_ctxt);
1634 printf(" %d", n_cur);
1635 printf(" %d", n_URL);
1636 printf(" %d", n_encoding);
1637 printf(" %d", n_options);
1653 test_htmlCtxtReadFile(void) {
1656 #if defined(LIBXML_HTML_ENABLED)
1658 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1660 const char * filename; /* a file or URL */
1662 char * encoding; /* the document encoding, or NULL */
1664 int options; /* a combination of htmlParserOption(s) */
1667 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1668 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1669 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1670 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1671 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1672 filename = gen_filepath(n_filename, 1);
1673 encoding = gen_const_char_ptr(n_encoding, 2);
1674 options = gen_int(n_options, 3);
1676 ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1677 desret_htmlDocPtr(ret_val);
1679 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1680 des_filepath(n_filename, filename, 1);
1681 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1682 des_int(n_options, options, 3);
1683 xmlResetLastError();
1696 test_htmlCtxtReadMemory(void) {
1699 #if defined(LIBXML_HTML_ENABLED)
1702 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1704 char * buffer; /* a pointer to a char array */
1706 int size; /* the size of the array */
1708 const char * URL; /* the base URL to use for the document */
1710 char * encoding; /* the document encoding, or NULL */
1712 int options; /* a combination of htmlParserOption(s) */
1715 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1716 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1717 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1718 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1719 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1720 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1721 mem_base = xmlMemBlocks();
1722 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1723 buffer = gen_const_char_ptr(n_buffer, 1);
1724 size = gen_int(n_size, 2);
1725 URL = gen_filepath(n_URL, 3);
1726 encoding = gen_const_char_ptr(n_encoding, 4);
1727 options = gen_int(n_options, 5);
1729 ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1730 desret_htmlDocPtr(ret_val);
1732 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1733 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1734 des_int(n_size, size, 2);
1735 des_filepath(n_URL, URL, 3);
1736 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1737 des_int(n_options, options, 5);
1738 xmlResetLastError();
1739 if (mem_base != xmlMemBlocks()) {
1740 printf("Leak of %d blocks found in htmlCtxtReadMemory",
1741 xmlMemBlocks() - mem_base);
1743 printf(" %d", n_ctxt);
1744 printf(" %d", n_buffer);
1745 printf(" %d", n_size);
1746 printf(" %d", n_URL);
1747 printf(" %d", n_encoding);
1748 printf(" %d", n_options);
1765 test_htmlCtxtReset(void) {
1768 #if defined(LIBXML_HTML_ENABLED)
1770 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1773 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1774 mem_base = xmlMemBlocks();
1775 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1777 htmlCtxtReset(ctxt);
1779 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1780 xmlResetLastError();
1781 if (mem_base != xmlMemBlocks()) {
1782 printf("Leak of %d blocks found in htmlCtxtReset",
1783 xmlMemBlocks() - mem_base);
1785 printf(" %d", n_ctxt);
1797 test_htmlCtxtUseOptions(void) {
1800 #if defined(LIBXML_HTML_ENABLED)
1803 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1805 int options; /* a combination of htmlParserOption(s) */
1808 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1809 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1810 mem_base = xmlMemBlocks();
1811 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1812 options = gen_int(n_options, 1);
1814 ret_val = htmlCtxtUseOptions(ctxt, options);
1815 desret_int(ret_val);
1817 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1818 des_int(n_options, options, 1);
1819 xmlResetLastError();
1820 if (mem_base != xmlMemBlocks()) {
1821 printf("Leak of %d blocks found in htmlCtxtUseOptions",
1822 xmlMemBlocks() - mem_base);
1824 printf(" %d", n_ctxt);
1825 printf(" %d", n_options);
1838 test_htmlElementAllowedHere(void) {
1841 #if defined(LIBXML_HTML_ENABLED)
1844 htmlElemDesc * parent; /* HTML parent element */
1846 xmlChar * elt; /* HTML element */
1849 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1850 for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1851 mem_base = xmlMemBlocks();
1852 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1853 elt = gen_const_xmlChar_ptr(n_elt, 1);
1855 ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1856 desret_int(ret_val);
1858 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1859 des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1860 xmlResetLastError();
1861 if (mem_base != xmlMemBlocks()) {
1862 printf("Leak of %d blocks found in htmlElementAllowedHere",
1863 xmlMemBlocks() - mem_base);
1865 printf(" %d", n_parent);
1866 printf(" %d", n_elt);
1879 test_htmlElementStatusHere(void) {
1882 #if defined(LIBXML_HTML_ENABLED)
1885 htmlElemDesc * parent; /* HTML parent element */
1887 htmlElemDesc * elt; /* HTML element */
1890 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1891 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1892 mem_base = xmlMemBlocks();
1893 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1894 elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1896 ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1897 desret_htmlStatus(ret_val);
1899 des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1900 des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1901 xmlResetLastError();
1902 if (mem_base != xmlMemBlocks()) {
1903 printf("Leak of %d blocks found in htmlElementStatusHere",
1904 xmlMemBlocks() - mem_base);
1906 printf(" %d", n_parent);
1907 printf(" %d", n_elt);
1920 test_htmlEncodeEntities(void) {
1923 #if defined(LIBXML_HTML_ENABLED)
1926 unsigned char * out; /* a pointer to an array of bytes to store the result */
1928 int * outlen; /* the length of @out */
1930 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1932 int * inlen; /* the length of @in */
1934 int quoteChar; /* the quote character to escape (' or ") or zero. */
1937 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1938 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1939 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1940 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1941 for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1942 mem_base = xmlMemBlocks();
1943 out = gen_unsigned_char_ptr(n_out, 0);
1944 outlen = gen_int_ptr(n_outlen, 1);
1945 in = gen_const_unsigned_char_ptr(n_in, 2);
1946 inlen = gen_int_ptr(n_inlen, 3);
1947 quoteChar = gen_int(n_quoteChar, 4);
1949 ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1950 desret_int(ret_val);
1952 des_unsigned_char_ptr(n_out, out, 0);
1953 des_int_ptr(n_outlen, outlen, 1);
1954 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1955 des_int_ptr(n_inlen, inlen, 3);
1956 des_int(n_quoteChar, quoteChar, 4);
1957 xmlResetLastError();
1958 if (mem_base != xmlMemBlocks()) {
1959 printf("Leak of %d blocks found in htmlEncodeEntities",
1960 xmlMemBlocks() - mem_base);
1962 printf(" %d", n_out);
1963 printf(" %d", n_outlen);
1964 printf(" %d", n_in);
1965 printf(" %d", n_inlen);
1966 printf(" %d", n_quoteChar);
1982 test_htmlEntityLookup(void) {
1985 #if defined(LIBXML_HTML_ENABLED)
1987 const htmlEntityDesc * ret_val;
1988 xmlChar * name; /* the entity name */
1991 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1992 mem_base = xmlMemBlocks();
1993 name = gen_const_xmlChar_ptr(n_name, 0);
1995 ret_val = htmlEntityLookup((const xmlChar *)name);
1996 desret_const_htmlEntityDesc_ptr(ret_val);
1998 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1999 xmlResetLastError();
2000 if (mem_base != xmlMemBlocks()) {
2001 printf("Leak of %d blocks found in htmlEntityLookup",
2002 xmlMemBlocks() - mem_base);
2004 printf(" %d", n_name);
2016 test_htmlEntityValueLookup(void) {
2019 #if defined(LIBXML_HTML_ENABLED)
2021 const htmlEntityDesc * ret_val;
2022 unsigned int value; /* the entity's unicode value */
2025 for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2026 mem_base = xmlMemBlocks();
2027 value = gen_unsigned_int(n_value, 0);
2029 ret_val = htmlEntityValueLookup(value);
2030 desret_const_htmlEntityDesc_ptr(ret_val);
2032 des_unsigned_int(n_value, value, 0);
2033 xmlResetLastError();
2034 if (mem_base != xmlMemBlocks()) {
2035 printf("Leak of %d blocks found in htmlEntityValueLookup",
2036 xmlMemBlocks() - mem_base);
2038 printf(" %d", n_value);
2050 test_htmlHandleOmittedElem(void) {
2053 #if defined(LIBXML_HTML_ENABLED)
2056 int val; /* int 0 or 1 */
2059 for (n_val = 0;n_val < gen_nb_int;n_val++) {
2060 mem_base = xmlMemBlocks();
2061 val = gen_int(n_val, 0);
2063 ret_val = htmlHandleOmittedElem(val);
2064 desret_int(ret_val);
2066 des_int(n_val, val, 0);
2067 xmlResetLastError();
2068 if (mem_base != xmlMemBlocks()) {
2069 printf("Leak of %d blocks found in htmlHandleOmittedElem",
2070 xmlMemBlocks() - mem_base);
2072 printf(" %d", n_val);
2084 test_htmlIsAutoClosed(void) {
2087 #if defined(LIBXML_HTML_ENABLED)
2090 htmlDocPtr doc; /* the HTML document */
2092 htmlNodePtr elem; /* the HTML element */
2095 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2096 for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2097 mem_base = xmlMemBlocks();
2098 doc = gen_htmlDocPtr(n_doc, 0);
2099 elem = gen_htmlNodePtr(n_elem, 1);
2101 ret_val = htmlIsAutoClosed(doc, elem);
2102 desret_int(ret_val);
2104 des_htmlDocPtr(n_doc, doc, 0);
2105 des_htmlNodePtr(n_elem, elem, 1);
2106 xmlResetLastError();
2107 if (mem_base != xmlMemBlocks()) {
2108 printf("Leak of %d blocks found in htmlIsAutoClosed",
2109 xmlMemBlocks() - mem_base);
2111 printf(" %d", n_doc);
2112 printf(" %d", n_elem);
2125 test_htmlIsScriptAttribute(void) {
2128 #if defined(LIBXML_HTML_ENABLED)
2131 xmlChar * name; /* an attribute name */
2134 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2135 mem_base = xmlMemBlocks();
2136 name = gen_const_xmlChar_ptr(n_name, 0);
2138 ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2139 desret_int(ret_val);
2141 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2142 xmlResetLastError();
2143 if (mem_base != xmlMemBlocks()) {
2144 printf("Leak of %d blocks found in htmlIsScriptAttribute",
2145 xmlMemBlocks() - mem_base);
2147 printf(" %d", n_name);
2159 test_htmlNewParserCtxt(void) {
2162 #if defined(LIBXML_HTML_ENABLED)
2164 htmlParserCtxtPtr ret_val;
2166 mem_base = xmlMemBlocks();
2168 ret_val = htmlNewParserCtxt();
2169 desret_htmlParserCtxtPtr(ret_val);
2171 xmlResetLastError();
2172 if (mem_base != xmlMemBlocks()) {
2173 printf("Leak of %d blocks found in htmlNewParserCtxt",
2174 xmlMemBlocks() - mem_base);
2186 test_htmlNodeStatus(void) {
2189 #if defined(LIBXML_HTML_ENABLED)
2192 htmlNodePtr node; /* an htmlNodePtr in a tree */
2194 int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2197 for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2198 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2199 mem_base = xmlMemBlocks();
2200 node = gen_const_htmlNodePtr(n_node, 0);
2201 legacy = gen_int(n_legacy, 1);
2203 ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2204 desret_htmlStatus(ret_val);
2206 des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2207 des_int(n_legacy, legacy, 1);
2208 xmlResetLastError();
2209 if (mem_base != xmlMemBlocks()) {
2210 printf("Leak of %d blocks found in htmlNodeStatus",
2211 xmlMemBlocks() - mem_base);
2213 printf(" %d", n_node);
2214 printf(" %d", n_legacy);
2227 test_htmlParseCharRef(void) {
2230 #if defined(LIBXML_HTML_ENABLED)
2233 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2236 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2237 mem_base = xmlMemBlocks();
2238 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2240 ret_val = htmlParseCharRef(ctxt);
2241 desret_int(ret_val);
2243 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2244 xmlResetLastError();
2245 if (mem_base != xmlMemBlocks()) {
2246 printf("Leak of %d blocks found in htmlParseCharRef",
2247 xmlMemBlocks() - mem_base);
2249 printf(" %d", n_ctxt);
2261 test_htmlParseChunk(void) {
2264 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2267 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2269 char * chunk; /* an char array */
2271 int size; /* the size in byte of the chunk */
2273 int terminate; /* last chunk indicator */
2276 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2277 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2278 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2279 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2280 mem_base = xmlMemBlocks();
2281 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2282 chunk = gen_const_char_ptr(n_chunk, 1);
2283 size = gen_int(n_size, 2);
2284 terminate = gen_int(n_terminate, 3);
2286 ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2287 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2288 desret_int(ret_val);
2290 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2291 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2292 des_int(n_size, size, 2);
2293 des_int(n_terminate, terminate, 3);
2294 xmlResetLastError();
2295 if (mem_base != xmlMemBlocks()) {
2296 printf("Leak of %d blocks found in htmlParseChunk",
2297 xmlMemBlocks() - mem_base);
2299 printf(" %d", n_ctxt);
2300 printf(" %d", n_chunk);
2301 printf(" %d", n_size);
2302 printf(" %d", n_terminate);
2317 test_htmlParseDoc(void) {
2320 #if defined(LIBXML_HTML_ENABLED)
2323 xmlChar * cur; /* a pointer to an array of xmlChar */
2325 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2328 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2329 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2330 mem_base = xmlMemBlocks();
2331 cur = gen_xmlChar_ptr(n_cur, 0);
2332 encoding = gen_const_char_ptr(n_encoding, 1);
2334 ret_val = htmlParseDoc(cur, (const char *)encoding);
2335 desret_htmlDocPtr(ret_val);
2337 des_xmlChar_ptr(n_cur, cur, 0);
2338 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2339 xmlResetLastError();
2340 if (mem_base != xmlMemBlocks()) {
2341 printf("Leak of %d blocks found in htmlParseDoc",
2342 xmlMemBlocks() - mem_base);
2344 printf(" %d", n_cur);
2345 printf(" %d", n_encoding);
2358 test_htmlParseDocument(void) {
2361 #if defined(LIBXML_HTML_ENABLED)
2364 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2367 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2368 mem_base = xmlMemBlocks();
2369 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2371 ret_val = htmlParseDocument(ctxt);
2372 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2373 desret_int(ret_val);
2375 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2376 xmlResetLastError();
2377 if (mem_base != xmlMemBlocks()) {
2378 printf("Leak of %d blocks found in htmlParseDocument",
2379 xmlMemBlocks() - mem_base);
2381 printf(" %d", n_ctxt);
2393 test_htmlParseElement(void) {
2396 #if defined(LIBXML_HTML_ENABLED)
2398 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2401 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2402 mem_base = xmlMemBlocks();
2403 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2405 htmlParseElement(ctxt);
2407 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2408 xmlResetLastError();
2409 if (mem_base != xmlMemBlocks()) {
2410 printf("Leak of %d blocks found in htmlParseElement",
2411 xmlMemBlocks() - mem_base);
2413 printf(" %d", n_ctxt);
2425 test_htmlParseEntityRef(void) {
2428 #if defined(LIBXML_HTML_ENABLED)
2430 const htmlEntityDesc * ret_val;
2431 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2433 xmlChar ** str; /* location to store the entity name */
2436 for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2437 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2438 mem_base = xmlMemBlocks();
2439 ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2440 str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2442 ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2443 desret_const_htmlEntityDesc_ptr(ret_val);
2445 des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2446 des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2447 xmlResetLastError();
2448 if (mem_base != xmlMemBlocks()) {
2449 printf("Leak of %d blocks found in htmlParseEntityRef",
2450 xmlMemBlocks() - mem_base);
2452 printf(" %d", n_ctxt);
2453 printf(" %d", n_str);
2466 test_htmlParseFile(void) {
2469 #if defined(LIBXML_HTML_ENABLED)
2471 const char * filename; /* the filename */
2473 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2476 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2477 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2478 filename = gen_filepath(n_filename, 0);
2479 encoding = gen_const_char_ptr(n_encoding, 1);
2481 ret_val = htmlParseFile(filename, (const char *)encoding);
2482 desret_htmlDocPtr(ret_val);
2484 des_filepath(n_filename, filename, 0);
2485 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2486 xmlResetLastError();
2497 test_htmlReadDoc(void) {
2500 #if defined(LIBXML_HTML_ENABLED)
2503 xmlChar * cur; /* a pointer to a zero terminated string */
2505 const char * URL; /* the base URL to use for the document */
2507 char * encoding; /* the document encoding, or NULL */
2509 int options; /* a combination of htmlParserOption(s) */
2512 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2513 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2514 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2515 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2516 mem_base = xmlMemBlocks();
2517 cur = gen_const_xmlChar_ptr(n_cur, 0);
2518 URL = gen_filepath(n_URL, 1);
2519 encoding = gen_const_char_ptr(n_encoding, 2);
2520 options = gen_int(n_options, 3);
2522 ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2523 desret_htmlDocPtr(ret_val);
2525 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2526 des_filepath(n_URL, URL, 1);
2527 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2528 des_int(n_options, options, 3);
2529 xmlResetLastError();
2530 if (mem_base != xmlMemBlocks()) {
2531 printf("Leak of %d blocks found in htmlReadDoc",
2532 xmlMemBlocks() - mem_base);
2534 printf(" %d", n_cur);
2535 printf(" %d", n_URL);
2536 printf(" %d", n_encoding);
2537 printf(" %d", n_options);
2552 test_htmlReadFile(void) {
2555 #if defined(LIBXML_HTML_ENABLED)
2558 const char * filename; /* a file or URL */
2560 char * encoding; /* the document encoding, or NULL */
2562 int options; /* a combination of htmlParserOption(s) */
2565 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2566 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2567 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2568 mem_base = xmlMemBlocks();
2569 filename = gen_filepath(n_filename, 0);
2570 encoding = gen_const_char_ptr(n_encoding, 1);
2571 options = gen_int(n_options, 2);
2573 ret_val = htmlReadFile(filename, (const char *)encoding, options);
2574 desret_htmlDocPtr(ret_val);
2576 des_filepath(n_filename, filename, 0);
2577 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2578 des_int(n_options, options, 2);
2579 xmlResetLastError();
2580 if (mem_base != xmlMemBlocks()) {
2581 printf("Leak of %d blocks found in htmlReadFile",
2582 xmlMemBlocks() - mem_base);
2584 printf(" %d", n_filename);
2585 printf(" %d", n_encoding);
2586 printf(" %d", n_options);
2600 test_htmlReadMemory(void) {
2603 #if defined(LIBXML_HTML_ENABLED)
2606 char * buffer; /* a pointer to a char array */
2608 int size; /* the size of the array */
2610 const char * URL; /* the base URL to use for the document */
2612 char * encoding; /* the document encoding, or NULL */
2614 int options; /* a combination of htmlParserOption(s) */
2617 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2618 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2619 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2620 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2621 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2622 mem_base = xmlMemBlocks();
2623 buffer = gen_const_char_ptr(n_buffer, 0);
2624 size = gen_int(n_size, 1);
2625 URL = gen_filepath(n_URL, 2);
2626 encoding = gen_const_char_ptr(n_encoding, 3);
2627 options = gen_int(n_options, 4);
2629 ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2630 desret_htmlDocPtr(ret_val);
2632 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2633 des_int(n_size, size, 1);
2634 des_filepath(n_URL, URL, 2);
2635 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2636 des_int(n_options, options, 4);
2637 xmlResetLastError();
2638 if (mem_base != xmlMemBlocks()) {
2639 printf("Leak of %d blocks found in htmlReadMemory",
2640 xmlMemBlocks() - mem_base);
2642 printf(" %d", n_buffer);
2643 printf(" %d", n_size);
2644 printf(" %d", n_URL);
2645 printf(" %d", n_encoding);
2646 printf(" %d", n_options);
2662 test_htmlSAXParseDoc(void) {
2665 #if defined(LIBXML_HTML_ENABLED)
2668 xmlChar * cur; /* a pointer to an array of xmlChar */
2670 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2672 htmlSAXHandlerPtr sax; /* the SAX handler block */
2674 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2677 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2678 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2679 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2680 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2681 mem_base = xmlMemBlocks();
2682 cur = gen_xmlChar_ptr(n_cur, 0);
2683 encoding = gen_const_char_ptr(n_encoding, 1);
2684 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2685 userData = gen_userdata(n_userData, 3);
2687 ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2688 desret_htmlDocPtr(ret_val);
2690 des_xmlChar_ptr(n_cur, cur, 0);
2691 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2692 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2693 des_userdata(n_userData, userData, 3);
2694 xmlResetLastError();
2695 if (mem_base != xmlMemBlocks()) {
2696 printf("Leak of %d blocks found in htmlSAXParseDoc",
2697 xmlMemBlocks() - mem_base);
2699 printf(" %d", n_cur);
2700 printf(" %d", n_encoding);
2701 printf(" %d", n_sax);
2702 printf(" %d", n_userData);
2717 test_htmlSAXParseFile(void) {
2720 #if defined(LIBXML_HTML_ENABLED)
2723 const char * filename; /* the filename */
2725 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2727 htmlSAXHandlerPtr sax; /* the SAX handler block */
2729 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2732 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2733 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2734 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2735 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2736 mem_base = xmlMemBlocks();
2737 filename = gen_filepath(n_filename, 0);
2738 encoding = gen_const_char_ptr(n_encoding, 1);
2739 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2740 userData = gen_userdata(n_userData, 3);
2742 ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2743 desret_htmlDocPtr(ret_val);
2745 des_filepath(n_filename, filename, 0);
2746 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2747 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2748 des_userdata(n_userData, userData, 3);
2749 xmlResetLastError();
2750 if (mem_base != xmlMemBlocks()) {
2751 printf("Leak of %d blocks found in htmlSAXParseFile",
2752 xmlMemBlocks() - mem_base);
2754 printf(" %d", n_filename);
2755 printf(" %d", n_encoding);
2756 printf(" %d", n_sax);
2757 printf(" %d", n_userData);
2772 test_htmlTagLookup(void) {
2776 /* missing type support */
2781 test_HTMLparser(void) {
2784 if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2785 test_ret += test_UTF8ToHtml();
2786 test_ret += test_htmlAttrAllowed();
2787 test_ret += test_htmlAutoCloseTag();
2788 test_ret += test_htmlCreateMemoryParserCtxt();
2789 test_ret += test_htmlCreatePushParserCtxt();
2790 test_ret += test_htmlCtxtReadDoc();
2791 test_ret += test_htmlCtxtReadFile();
2792 test_ret += test_htmlCtxtReadMemory();
2793 test_ret += test_htmlCtxtReset();
2794 test_ret += test_htmlCtxtUseOptions();
2795 test_ret += test_htmlElementAllowedHere();
2796 test_ret += test_htmlElementStatusHere();
2797 test_ret += test_htmlEncodeEntities();
2798 test_ret += test_htmlEntityLookup();
2799 test_ret += test_htmlEntityValueLookup();
2800 test_ret += test_htmlHandleOmittedElem();
2801 test_ret += test_htmlIsAutoClosed();
2802 test_ret += test_htmlIsScriptAttribute();
2803 test_ret += test_htmlNewParserCtxt();
2804 test_ret += test_htmlNodeStatus();
2805 test_ret += test_htmlParseCharRef();
2806 test_ret += test_htmlParseChunk();
2807 test_ret += test_htmlParseDoc();
2808 test_ret += test_htmlParseDocument();
2809 test_ret += test_htmlParseElement();
2810 test_ret += test_htmlParseEntityRef();
2811 test_ret += test_htmlParseFile();
2812 test_ret += test_htmlReadDoc();
2813 test_ret += test_htmlReadFile();
2814 test_ret += test_htmlReadMemory();
2815 test_ret += test_htmlSAXParseDoc();
2816 test_ret += test_htmlSAXParseFile();
2817 test_ret += test_htmlTagLookup();
2820 printf("Module HTMLparser: %d errors\n", test_ret);
2825 test_htmlDocContentDumpFormatOutput(void) {
2828 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2830 xmlOutputBufferPtr buf; /* the HTML buffer output */
2832 xmlDocPtr cur; /* the document */
2834 char * encoding; /* the encoding string */
2836 int format; /* should formatting spaces been added */
2839 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2840 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2841 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2842 for (n_format = 0;n_format < gen_nb_int;n_format++) {
2843 mem_base = xmlMemBlocks();
2844 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2845 cur = gen_xmlDocPtr(n_cur, 1);
2846 encoding = gen_const_char_ptr(n_encoding, 2);
2847 format = gen_int(n_format, 3);
2849 htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2851 des_xmlOutputBufferPtr(n_buf, buf, 0);
2852 des_xmlDocPtr(n_cur, cur, 1);
2853 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2854 des_int(n_format, format, 3);
2855 xmlResetLastError();
2856 if (mem_base != xmlMemBlocks()) {
2857 printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2858 xmlMemBlocks() - mem_base);
2860 printf(" %d", n_buf);
2861 printf(" %d", n_cur);
2862 printf(" %d", n_encoding);
2863 printf(" %d", n_format);
2878 test_htmlDocContentDumpOutput(void) {
2881 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2883 xmlOutputBufferPtr buf; /* the HTML buffer output */
2885 xmlDocPtr cur; /* the document */
2887 char * encoding; /* the encoding string */
2890 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2891 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2892 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2893 mem_base = xmlMemBlocks();
2894 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2895 cur = gen_xmlDocPtr(n_cur, 1);
2896 encoding = gen_const_char_ptr(n_encoding, 2);
2898 htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2900 des_xmlOutputBufferPtr(n_buf, buf, 0);
2901 des_xmlDocPtr(n_cur, cur, 1);
2902 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2903 xmlResetLastError();
2904 if (mem_base != xmlMemBlocks()) {
2905 printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2906 xmlMemBlocks() - mem_base);
2908 printf(" %d", n_buf);
2909 printf(" %d", n_cur);
2910 printf(" %d", n_encoding);
2924 test_htmlDocDump(void) {
2927 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2930 FILE * f; /* the FILE* */
2932 xmlDocPtr cur; /* the document */
2935 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2936 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2937 mem_base = xmlMemBlocks();
2938 f = gen_FILE_ptr(n_f, 0);
2939 cur = gen_xmlDocPtr(n_cur, 1);
2941 ret_val = htmlDocDump(f, cur);
2942 desret_int(ret_val);
2944 des_FILE_ptr(n_f, f, 0);
2945 des_xmlDocPtr(n_cur, cur, 1);
2946 xmlResetLastError();
2947 if (mem_base != xmlMemBlocks()) {
2948 printf("Leak of %d blocks found in htmlDocDump",
2949 xmlMemBlocks() - mem_base);
2952 printf(" %d", n_cur);
2964 #define gen_nb_xmlChar_ptr_ptr 1
2965 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2968 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2972 test_htmlDocDumpMemory(void) {
2975 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2977 xmlDocPtr cur; /* the document */
2979 xmlChar ** mem; /* OUT: the memory pointer */
2981 int * size; /* OUT: the memory length */
2984 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2985 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2986 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2987 mem_base = xmlMemBlocks();
2988 cur = gen_xmlDocPtr(n_cur, 0);
2989 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2990 size = gen_int_ptr(n_size, 2);
2992 htmlDocDumpMemory(cur, mem, size);
2994 des_xmlDocPtr(n_cur, cur, 0);
2995 des_xmlChar_ptr_ptr(n_mem, mem, 1);
2996 des_int_ptr(n_size, size, 2);
2997 xmlResetLastError();
2998 if (mem_base != xmlMemBlocks()) {
2999 printf("Leak of %d blocks found in htmlDocDumpMemory",
3000 xmlMemBlocks() - mem_base);
3002 printf(" %d", n_cur);
3003 printf(" %d", n_mem);
3004 printf(" %d", n_size);
3018 test_htmlDocDumpMemoryFormat(void) {
3021 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3023 xmlDocPtr cur; /* the document */
3025 xmlChar ** mem; /* OUT: the memory pointer */
3027 int * size; /* OUT: the memory length */
3029 int format; /* should formatting spaces been added */
3032 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3033 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3034 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3035 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3036 mem_base = xmlMemBlocks();
3037 cur = gen_xmlDocPtr(n_cur, 0);
3038 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3039 size = gen_int_ptr(n_size, 2);
3040 format = gen_int(n_format, 3);
3042 htmlDocDumpMemoryFormat(cur, mem, size, format);
3044 des_xmlDocPtr(n_cur, cur, 0);
3045 des_xmlChar_ptr_ptr(n_mem, mem, 1);
3046 des_int_ptr(n_size, size, 2);
3047 des_int(n_format, format, 3);
3048 xmlResetLastError();
3049 if (mem_base != xmlMemBlocks()) {
3050 printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3051 xmlMemBlocks() - mem_base);
3053 printf(" %d", n_cur);
3054 printf(" %d", n_mem);
3055 printf(" %d", n_size);
3056 printf(" %d", n_format);
3071 test_htmlGetMetaEncoding(void) {
3074 #if defined(LIBXML_HTML_ENABLED)
3076 const xmlChar * ret_val;
3077 htmlDocPtr doc; /* the document */
3080 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3081 mem_base = xmlMemBlocks();
3082 doc = gen_htmlDocPtr(n_doc, 0);
3084 ret_val = htmlGetMetaEncoding(doc);
3085 desret_const_xmlChar_ptr(ret_val);
3087 des_htmlDocPtr(n_doc, doc, 0);
3088 xmlResetLastError();
3089 if (mem_base != xmlMemBlocks()) {
3090 printf("Leak of %d blocks found in htmlGetMetaEncoding",
3091 xmlMemBlocks() - mem_base);
3093 printf(" %d", n_doc);
3105 test_htmlIsBooleanAttr(void) {
3108 #if defined(LIBXML_HTML_ENABLED)
3111 xmlChar * name; /* the name of the attribute to check */
3114 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3115 mem_base = xmlMemBlocks();
3116 name = gen_const_xmlChar_ptr(n_name, 0);
3118 ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3119 desret_int(ret_val);
3121 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3122 xmlResetLastError();
3123 if (mem_base != xmlMemBlocks()) {
3124 printf("Leak of %d blocks found in htmlIsBooleanAttr",
3125 xmlMemBlocks() - mem_base);
3127 printf(" %d", n_name);
3139 test_htmlNewDoc(void) {
3142 #if defined(LIBXML_HTML_ENABLED)
3145 xmlChar * URI; /* URI for the dtd, or NULL */
3147 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3150 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3151 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3152 mem_base = xmlMemBlocks();
3153 URI = gen_const_xmlChar_ptr(n_URI, 0);
3154 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3156 ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3157 desret_htmlDocPtr(ret_val);
3159 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3160 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3161 xmlResetLastError();
3162 if (mem_base != xmlMemBlocks()) {
3163 printf("Leak of %d blocks found in htmlNewDoc",
3164 xmlMemBlocks() - mem_base);
3166 printf(" %d", n_URI);
3167 printf(" %d", n_ExternalID);
3180 test_htmlNewDocNoDtD(void) {
3183 #if defined(LIBXML_HTML_ENABLED)
3186 xmlChar * URI; /* URI for the dtd, or NULL */
3188 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3191 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3192 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3193 mem_base = xmlMemBlocks();
3194 URI = gen_const_xmlChar_ptr(n_URI, 0);
3195 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3197 ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3198 desret_htmlDocPtr(ret_val);
3200 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3201 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3202 xmlResetLastError();
3203 if (mem_base != xmlMemBlocks()) {
3204 printf("Leak of %d blocks found in htmlNewDocNoDtD",
3205 xmlMemBlocks() - mem_base);
3207 printf(" %d", n_URI);
3208 printf(" %d", n_ExternalID);
3221 test_htmlNodeDump(void) {
3224 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3227 xmlBufferPtr buf; /* the HTML buffer output */
3229 xmlDocPtr doc; /* the document */
3231 xmlNodePtr cur; /* the current node */
3234 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3235 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3236 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3237 mem_base = xmlMemBlocks();
3238 buf = gen_xmlBufferPtr(n_buf, 0);
3239 doc = gen_xmlDocPtr(n_doc, 1);
3240 cur = gen_xmlNodePtr(n_cur, 2);
3242 ret_val = htmlNodeDump(buf, doc, cur);
3243 desret_int(ret_val);
3245 des_xmlBufferPtr(n_buf, buf, 0);
3246 des_xmlDocPtr(n_doc, doc, 1);
3247 des_xmlNodePtr(n_cur, cur, 2);
3248 xmlResetLastError();
3249 if (mem_base != xmlMemBlocks()) {
3250 printf("Leak of %d blocks found in htmlNodeDump",
3251 xmlMemBlocks() - mem_base);
3253 printf(" %d", n_buf);
3254 printf(" %d", n_doc);
3255 printf(" %d", n_cur);
3269 test_htmlNodeDumpFile(void) {
3272 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3274 FILE * out; /* the FILE pointer */
3276 xmlDocPtr doc; /* the document */
3278 xmlNodePtr cur; /* the current node */
3281 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3282 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3283 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3284 mem_base = xmlMemBlocks();
3285 out = gen_FILE_ptr(n_out, 0);
3286 doc = gen_xmlDocPtr(n_doc, 1);
3287 cur = gen_xmlNodePtr(n_cur, 2);
3289 htmlNodeDumpFile(out, doc, cur);
3291 des_FILE_ptr(n_out, out, 0);
3292 des_xmlDocPtr(n_doc, doc, 1);
3293 des_xmlNodePtr(n_cur, cur, 2);
3294 xmlResetLastError();
3295 if (mem_base != xmlMemBlocks()) {
3296 printf("Leak of %d blocks found in htmlNodeDumpFile",
3297 xmlMemBlocks() - mem_base);
3299 printf(" %d", n_out);
3300 printf(" %d", n_doc);
3301 printf(" %d", n_cur);
3315 test_htmlNodeDumpFileFormat(void) {
3318 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3321 FILE * out; /* the FILE pointer */
3323 xmlDocPtr doc; /* the document */
3325 xmlNodePtr cur; /* the current node */
3327 char * encoding; /* the document encoding */
3329 int format; /* should formatting spaces been added */
3332 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3333 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3334 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3335 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3336 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3337 mem_base = xmlMemBlocks();
3338 out = gen_FILE_ptr(n_out, 0);
3339 doc = gen_xmlDocPtr(n_doc, 1);
3340 cur = gen_xmlNodePtr(n_cur, 2);
3341 encoding = gen_const_char_ptr(n_encoding, 3);
3342 format = gen_int(n_format, 4);
3344 ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3345 desret_int(ret_val);
3347 des_FILE_ptr(n_out, out, 0);
3348 des_xmlDocPtr(n_doc, doc, 1);
3349 des_xmlNodePtr(n_cur, cur, 2);
3350 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3351 des_int(n_format, format, 4);
3352 xmlResetLastError();
3353 if (mem_base != xmlMemBlocks()) {
3354 printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3355 xmlMemBlocks() - mem_base);
3357 printf(" %d", n_out);
3358 printf(" %d", n_doc);
3359 printf(" %d", n_cur);
3360 printf(" %d", n_encoding);
3361 printf(" %d", n_format);
3377 test_htmlNodeDumpFormatOutput(void) {
3380 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3382 xmlOutputBufferPtr buf; /* the HTML buffer output */
3384 xmlDocPtr doc; /* the document */
3386 xmlNodePtr cur; /* the current node */
3388 char * encoding; /* the encoding string */
3390 int format; /* should formatting spaces been added */
3393 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3394 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3395 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3396 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3397 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3398 mem_base = xmlMemBlocks();
3399 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3400 doc = gen_xmlDocPtr(n_doc, 1);
3401 cur = gen_xmlNodePtr(n_cur, 2);
3402 encoding = gen_const_char_ptr(n_encoding, 3);
3403 format = gen_int(n_format, 4);
3405 htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3407 des_xmlOutputBufferPtr(n_buf, buf, 0);
3408 des_xmlDocPtr(n_doc, doc, 1);
3409 des_xmlNodePtr(n_cur, cur, 2);
3410 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3411 des_int(n_format, format, 4);
3412 xmlResetLastError();
3413 if (mem_base != xmlMemBlocks()) {
3414 printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3415 xmlMemBlocks() - mem_base);
3417 printf(" %d", n_buf);
3418 printf(" %d", n_doc);
3419 printf(" %d", n_cur);
3420 printf(" %d", n_encoding);
3421 printf(" %d", n_format);
3437 test_htmlNodeDumpOutput(void) {
3440 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3442 xmlOutputBufferPtr buf; /* the HTML buffer output */
3444 xmlDocPtr doc; /* the document */
3446 xmlNodePtr cur; /* the current node */
3448 char * encoding; /* the encoding string */
3451 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3452 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3453 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3454 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3455 mem_base = xmlMemBlocks();
3456 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3457 doc = gen_xmlDocPtr(n_doc, 1);
3458 cur = gen_xmlNodePtr(n_cur, 2);
3459 encoding = gen_const_char_ptr(n_encoding, 3);
3461 htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3463 des_xmlOutputBufferPtr(n_buf, buf, 0);
3464 des_xmlDocPtr(n_doc, doc, 1);
3465 des_xmlNodePtr(n_cur, cur, 2);
3466 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3467 xmlResetLastError();
3468 if (mem_base != xmlMemBlocks()) {
3469 printf("Leak of %d blocks found in htmlNodeDumpOutput",
3470 xmlMemBlocks() - mem_base);
3472 printf(" %d", n_buf);
3473 printf(" %d", n_doc);
3474 printf(" %d", n_cur);
3475 printf(" %d", n_encoding);
3490 test_htmlSaveFile(void) {
3493 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3496 const char * filename; /* the filename (or URL) */
3498 xmlDocPtr cur; /* the document */
3501 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3502 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3503 mem_base = xmlMemBlocks();
3504 filename = gen_fileoutput(n_filename, 0);
3505 cur = gen_xmlDocPtr(n_cur, 1);
3507 ret_val = htmlSaveFile(filename, cur);
3508 desret_int(ret_val);
3510 des_fileoutput(n_filename, filename, 0);
3511 des_xmlDocPtr(n_cur, cur, 1);
3512 xmlResetLastError();
3513 if (mem_base != xmlMemBlocks()) {
3514 printf("Leak of %d blocks found in htmlSaveFile",
3515 xmlMemBlocks() - mem_base);
3517 printf(" %d", n_filename);
3518 printf(" %d", n_cur);
3531 test_htmlSaveFileEnc(void) {
3534 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3537 const char * filename; /* the filename */
3539 xmlDocPtr cur; /* the document */
3541 char * encoding; /* the document encoding */
3544 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3545 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3546 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3547 mem_base = xmlMemBlocks();
3548 filename = gen_fileoutput(n_filename, 0);
3549 cur = gen_xmlDocPtr(n_cur, 1);
3550 encoding = gen_const_char_ptr(n_encoding, 2);
3552 ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3553 desret_int(ret_val);
3555 des_fileoutput(n_filename, filename, 0);
3556 des_xmlDocPtr(n_cur, cur, 1);
3557 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3558 xmlResetLastError();
3559 if (mem_base != xmlMemBlocks()) {
3560 printf("Leak of %d blocks found in htmlSaveFileEnc",
3561 xmlMemBlocks() - mem_base);
3563 printf(" %d", n_filename);
3564 printf(" %d", n_cur);
3565 printf(" %d", n_encoding);
3579 test_htmlSaveFileFormat(void) {
3582 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3585 const char * filename; /* the filename */
3587 xmlDocPtr cur; /* the document */
3589 char * encoding; /* the document encoding */
3591 int format; /* should formatting spaces been added */
3594 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3595 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3596 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3597 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3598 mem_base = xmlMemBlocks();
3599 filename = gen_fileoutput(n_filename, 0);
3600 cur = gen_xmlDocPtr(n_cur, 1);
3601 encoding = gen_const_char_ptr(n_encoding, 2);
3602 format = gen_int(n_format, 3);
3604 ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3605 desret_int(ret_val);
3607 des_fileoutput(n_filename, filename, 0);
3608 des_xmlDocPtr(n_cur, cur, 1);
3609 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3610 des_int(n_format, format, 3);
3611 xmlResetLastError();
3612 if (mem_base != xmlMemBlocks()) {
3613 printf("Leak of %d blocks found in htmlSaveFileFormat",
3614 xmlMemBlocks() - mem_base);
3616 printf(" %d", n_filename);
3617 printf(" %d", n_cur);
3618 printf(" %d", n_encoding);
3619 printf(" %d", n_format);
3634 test_htmlSetMetaEncoding(void) {
3637 #if defined(LIBXML_HTML_ENABLED)
3640 htmlDocPtr doc; /* the document */
3642 xmlChar * encoding; /* the encoding string */
3645 for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3646 for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3647 mem_base = xmlMemBlocks();
3648 doc = gen_htmlDocPtr(n_doc, 0);
3649 encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3651 ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3652 desret_int(ret_val);
3654 des_htmlDocPtr(n_doc, doc, 0);
3655 des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3656 xmlResetLastError();
3657 if (mem_base != xmlMemBlocks()) {
3658 printf("Leak of %d blocks found in htmlSetMetaEncoding",
3659 xmlMemBlocks() - mem_base);
3661 printf(" %d", n_doc);
3662 printf(" %d", n_encoding);
3674 test_HTMLtree(void) {
3677 if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3678 test_ret += test_htmlDocContentDumpFormatOutput();
3679 test_ret += test_htmlDocContentDumpOutput();
3680 test_ret += test_htmlDocDump();
3681 test_ret += test_htmlDocDumpMemory();
3682 test_ret += test_htmlDocDumpMemoryFormat();
3683 test_ret += test_htmlGetMetaEncoding();
3684 test_ret += test_htmlIsBooleanAttr();
3685 test_ret += test_htmlNewDoc();
3686 test_ret += test_htmlNewDocNoDtD();
3687 test_ret += test_htmlNodeDump();
3688 test_ret += test_htmlNodeDumpFile();
3689 test_ret += test_htmlNodeDumpFileFormat();
3690 test_ret += test_htmlNodeDumpFormatOutput();
3691 test_ret += test_htmlNodeDumpOutput();
3692 test_ret += test_htmlSaveFile();
3693 test_ret += test_htmlSaveFileEnc();
3694 test_ret += test_htmlSaveFileFormat();
3695 test_ret += test_htmlSetMetaEncoding();
3698 printf("Module HTMLtree: %d errors\n", test_ret);
3703 test_docbDefaultSAXHandlerInit(void) {
3706 #if defined(LIBXML_DOCB_ENABLED)
3707 #ifdef LIBXML_DOCB_ENABLED
3710 mem_base = xmlMemBlocks();
3712 docbDefaultSAXHandlerInit();
3714 xmlResetLastError();
3715 if (mem_base != xmlMemBlocks()) {
3716 printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3717 xmlMemBlocks() - mem_base);
3730 test_htmlDefaultSAXHandlerInit(void) {
3733 #if defined(LIBXML_HTML_ENABLED)
3734 #ifdef LIBXML_HTML_ENABLED
3737 mem_base = xmlMemBlocks();
3739 htmlDefaultSAXHandlerInit();
3741 xmlResetLastError();
3742 if (mem_base != xmlMemBlocks()) {
3743 printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3744 xmlMemBlocks() - mem_base);
3757 test_xmlDefaultSAXHandlerInit(void) {
3762 mem_base = xmlMemBlocks();
3764 xmlDefaultSAXHandlerInit();
3766 xmlResetLastError();
3767 if (mem_base != xmlMemBlocks()) {
3768 printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3769 xmlMemBlocks() - mem_base);
3779 #define gen_nb_xmlEnumerationPtr 1
3780 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3783 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3787 test_xmlSAX2AttributeDecl(void) {
3791 void * ctx; /* the user data (XML parser context) */
3793 xmlChar * elem; /* the name of the element */
3795 xmlChar * fullname; /* the attribute name */
3797 int type; /* the attribute type */
3799 int def; /* the type of default value */
3801 xmlChar * defaultValue; /* the attribute default value */
3803 xmlEnumerationPtr tree; /* the tree of enumerated value set */
3806 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3807 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3808 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3809 for (n_type = 0;n_type < gen_nb_int;n_type++) {
3810 for (n_def = 0;n_def < gen_nb_int;n_def++) {
3811 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3812 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3813 mem_base = xmlMemBlocks();
3814 ctx = gen_void_ptr(n_ctx, 0);
3815 elem = gen_const_xmlChar_ptr(n_elem, 1);
3816 fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3817 type = gen_int(n_type, 3);
3818 def = gen_int(n_def, 4);
3819 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3820 tree = gen_xmlEnumerationPtr(n_tree, 6);
3822 xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3824 des_void_ptr(n_ctx, ctx, 0);
3825 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3826 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3827 des_int(n_type, type, 3);
3828 des_int(n_def, def, 4);
3829 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3830 des_xmlEnumerationPtr(n_tree, tree, 6);
3831 xmlResetLastError();
3832 if (mem_base != xmlMemBlocks()) {
3833 printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3834 xmlMemBlocks() - mem_base);
3836 printf(" %d", n_ctx);
3837 printf(" %d", n_elem);
3838 printf(" %d", n_fullname);
3839 printf(" %d", n_type);
3840 printf(" %d", n_def);
3841 printf(" %d", n_defaultValue);
3842 printf(" %d", n_tree);
3859 test_xmlSAX2CDataBlock(void) {
3863 void * ctx; /* the user data (XML parser context) */
3865 xmlChar * value; /* The pcdata content */
3867 int len; /* the block length */
3870 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3871 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3872 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3873 mem_base = xmlMemBlocks();
3874 ctx = gen_void_ptr(n_ctx, 0);
3875 value = gen_const_xmlChar_ptr(n_value, 1);
3876 len = gen_int(n_len, 2);
3878 xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3880 des_void_ptr(n_ctx, ctx, 0);
3881 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3882 des_int(n_len, len, 2);
3883 xmlResetLastError();
3884 if (mem_base != xmlMemBlocks()) {
3885 printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3886 xmlMemBlocks() - mem_base);
3888 printf(" %d", n_ctx);
3889 printf(" %d", n_value);
3890 printf(" %d", n_len);
3903 test_xmlSAX2Characters(void) {
3907 void * ctx; /* the user data (XML parser context) */
3909 xmlChar * ch; /* a xmlChar string */
3911 int len; /* the number of xmlChar */
3914 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3915 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3916 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3917 mem_base = xmlMemBlocks();
3918 ctx = gen_void_ptr(n_ctx, 0);
3919 ch = gen_const_xmlChar_ptr(n_ch, 1);
3920 len = gen_int(n_len, 2);
3922 xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3924 des_void_ptr(n_ctx, ctx, 0);
3925 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3926 des_int(n_len, len, 2);
3927 xmlResetLastError();
3928 if (mem_base != xmlMemBlocks()) {
3929 printf("Leak of %d blocks found in xmlSAX2Characters",
3930 xmlMemBlocks() - mem_base);
3932 printf(" %d", n_ctx);
3933 printf(" %d", n_ch);
3934 printf(" %d", n_len);
3947 test_xmlSAX2Comment(void) {
3951 void * ctx; /* the user data (XML parser context) */
3953 xmlChar * value; /* the xmlSAX2Comment content */
3956 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3957 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3958 mem_base = xmlMemBlocks();
3959 ctx = gen_void_ptr(n_ctx, 0);
3960 value = gen_const_xmlChar_ptr(n_value, 1);
3962 xmlSAX2Comment(ctx, (const xmlChar *)value);
3964 des_void_ptr(n_ctx, ctx, 0);
3965 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3966 xmlResetLastError();
3967 if (mem_base != xmlMemBlocks()) {
3968 printf("Leak of %d blocks found in xmlSAX2Comment",
3969 xmlMemBlocks() - mem_base);
3971 printf(" %d", n_ctx);
3972 printf(" %d", n_value);
3984 test_xmlSAX2ElementDecl(void) {
3988 void * ctx; /* the user data (XML parser context) */
3990 xmlChar * name; /* the element name */
3992 int type; /* the element type */
3994 xmlElementContentPtr content; /* the element value tree */
3997 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3998 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3999 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4000 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4001 mem_base = xmlMemBlocks();
4002 ctx = gen_void_ptr(n_ctx, 0);
4003 name = gen_const_xmlChar_ptr(n_name, 1);
4004 type = gen_int(n_type, 2);
4005 content = gen_xmlElementContentPtr(n_content, 3);
4007 xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4009 des_void_ptr(n_ctx, ctx, 0);
4010 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4011 des_int(n_type, type, 2);
4012 des_xmlElementContentPtr(n_content, content, 3);
4013 xmlResetLastError();
4014 if (mem_base != xmlMemBlocks()) {
4015 printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4016 xmlMemBlocks() - mem_base);
4018 printf(" %d", n_ctx);
4019 printf(" %d", n_name);
4020 printf(" %d", n_type);
4021 printf(" %d", n_content);
4035 test_xmlSAX2EndDocument(void) {
4039 void * ctx; /* the user data (XML parser context) */
4042 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4043 mem_base = xmlMemBlocks();
4044 ctx = gen_void_ptr(n_ctx, 0);
4046 xmlSAX2EndDocument(ctx);
4048 des_void_ptr(n_ctx, ctx, 0);
4049 xmlResetLastError();
4050 if (mem_base != xmlMemBlocks()) {
4051 printf("Leak of %d blocks found in xmlSAX2EndDocument",
4052 xmlMemBlocks() - mem_base);
4054 printf(" %d", n_ctx);
4065 test_xmlSAX2EndElement(void) {
4068 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4069 #ifdef LIBXML_SAX1_ENABLED
4071 void * ctx; /* the user data (XML parser context) */
4073 xmlChar * name; /* The element name */
4076 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4077 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4078 mem_base = xmlMemBlocks();
4079 ctx = gen_void_ptr(n_ctx, 0);
4080 name = gen_const_xmlChar_ptr(n_name, 1);
4082 xmlSAX2EndElement(ctx, (const xmlChar *)name);
4084 des_void_ptr(n_ctx, ctx, 0);
4085 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4086 xmlResetLastError();
4087 if (mem_base != xmlMemBlocks()) {
4088 printf("Leak of %d blocks found in xmlSAX2EndElement",
4089 xmlMemBlocks() - mem_base);
4091 printf(" %d", n_ctx);
4092 printf(" %d", n_name);
4106 test_xmlSAX2EndElementNs(void) {
4110 void * ctx; /* the user data (XML parser context) */
4112 xmlChar * localname; /* the local name of the element */
4114 xmlChar * prefix; /* the element namespace prefix if available */
4116 xmlChar * URI; /* the element namespace name if available */
4119 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4120 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4121 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4122 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4123 mem_base = xmlMemBlocks();
4124 ctx = gen_void_ptr(n_ctx, 0);
4125 localname = gen_const_xmlChar_ptr(n_localname, 1);
4126 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4127 URI = gen_const_xmlChar_ptr(n_URI, 3);
4129 xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4131 des_void_ptr(n_ctx, ctx, 0);
4132 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4133 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4134 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4135 xmlResetLastError();
4136 if (mem_base != xmlMemBlocks()) {
4137 printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4138 xmlMemBlocks() - mem_base);
4140 printf(" %d", n_ctx);
4141 printf(" %d", n_localname);
4142 printf(" %d", n_prefix);
4143 printf(" %d", n_URI);
4157 test_xmlSAX2EntityDecl(void) {
4161 void * ctx; /* the user data (XML parser context) */
4163 xmlChar * name; /* the entity name */
4165 int type; /* the entity type */
4167 xmlChar * publicId; /* The public ID of the entity */
4169 xmlChar * systemId; /* The system ID of the entity */
4171 xmlChar * content; /* the entity value (without processing). */
4174 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4175 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4176 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4177 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4178 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4179 for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4180 mem_base = xmlMemBlocks();
4181 ctx = gen_void_ptr(n_ctx, 0);
4182 name = gen_const_xmlChar_ptr(n_name, 1);
4183 type = gen_int(n_type, 2);
4184 publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4185 systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4186 content = gen_xmlChar_ptr(n_content, 5);
4188 xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4190 des_void_ptr(n_ctx, ctx, 0);
4191 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4192 des_int(n_type, type, 2);
4193 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4194 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4195 des_xmlChar_ptr(n_content, content, 5);
4196 xmlResetLastError();
4197 if (mem_base != xmlMemBlocks()) {
4198 printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4199 xmlMemBlocks() - mem_base);
4201 printf(" %d", n_ctx);
4202 printf(" %d", n_name);
4203 printf(" %d", n_type);
4204 printf(" %d", n_publicId);
4205 printf(" %d", n_systemId);
4206 printf(" %d", n_content);
4222 test_xmlSAX2ExternalSubset(void) {
4226 void * ctx; /* the user data (XML parser context) */
4228 xmlChar * name; /* the root element name */
4230 xmlChar * ExternalID; /* the external ID */
4232 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4235 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4236 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4237 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4238 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4239 mem_base = xmlMemBlocks();
4240 ctx = gen_void_ptr(n_ctx, 0);
4241 name = gen_const_xmlChar_ptr(n_name, 1);
4242 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4243 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4245 xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4247 des_void_ptr(n_ctx, ctx, 0);
4248 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4249 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4250 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4251 xmlResetLastError();
4252 if (mem_base != xmlMemBlocks()) {
4253 printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4254 xmlMemBlocks() - mem_base);
4256 printf(" %d", n_ctx);
4257 printf(" %d", n_name);
4258 printf(" %d", n_ExternalID);
4259 printf(" %d", n_SystemID);
4273 test_xmlSAX2GetColumnNumber(void) {
4278 void * ctx; /* the user data (XML parser context) */
4281 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4282 mem_base = xmlMemBlocks();
4283 ctx = gen_void_ptr(n_ctx, 0);
4285 ret_val = xmlSAX2GetColumnNumber(ctx);
4286 desret_int(ret_val);
4288 des_void_ptr(n_ctx, ctx, 0);
4289 xmlResetLastError();
4290 if (mem_base != xmlMemBlocks()) {
4291 printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4292 xmlMemBlocks() - mem_base);
4294 printf(" %d", n_ctx);
4305 test_xmlSAX2GetEntity(void) {
4309 xmlEntityPtr ret_val;
4310 void * ctx; /* the user data (XML parser context) */
4312 xmlChar * name; /* The entity name */
4315 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4316 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4317 mem_base = xmlMemBlocks();
4318 ctx = gen_void_ptr(n_ctx, 0);
4319 name = gen_const_xmlChar_ptr(n_name, 1);
4321 ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4322 desret_xmlEntityPtr(ret_val);
4324 des_void_ptr(n_ctx, ctx, 0);
4325 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4326 xmlResetLastError();
4327 if (mem_base != xmlMemBlocks()) {
4328 printf("Leak of %d blocks found in xmlSAX2GetEntity",
4329 xmlMemBlocks() - mem_base);
4331 printf(" %d", n_ctx);
4332 printf(" %d", n_name);
4344 test_xmlSAX2GetLineNumber(void) {
4349 void * ctx; /* the user data (XML parser context) */
4352 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4353 mem_base = xmlMemBlocks();
4354 ctx = gen_void_ptr(n_ctx, 0);
4356 ret_val = xmlSAX2GetLineNumber(ctx);
4357 desret_int(ret_val);
4359 des_void_ptr(n_ctx, ctx, 0);
4360 xmlResetLastError();
4361 if (mem_base != xmlMemBlocks()) {
4362 printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4363 xmlMemBlocks() - mem_base);
4365 printf(" %d", n_ctx);
4376 test_xmlSAX2GetParameterEntity(void) {
4380 xmlEntityPtr ret_val;
4381 void * ctx; /* the user data (XML parser context) */
4383 xmlChar * name; /* The entity name */
4386 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4387 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4388 mem_base = xmlMemBlocks();
4389 ctx = gen_void_ptr(n_ctx, 0);
4390 name = gen_const_xmlChar_ptr(n_name, 1);
4392 ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4393 desret_xmlEntityPtr(ret_val);
4395 des_void_ptr(n_ctx, ctx, 0);
4396 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4397 xmlResetLastError();
4398 if (mem_base != xmlMemBlocks()) {
4399 printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4400 xmlMemBlocks() - mem_base);
4402 printf(" %d", n_ctx);
4403 printf(" %d", n_name);
4415 test_xmlSAX2GetPublicId(void) {
4419 const xmlChar * ret_val;
4420 void * ctx; /* the user data (XML parser context) */
4423 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4424 mem_base = xmlMemBlocks();
4425 ctx = gen_void_ptr(n_ctx, 0);
4427 ret_val = xmlSAX2GetPublicId(ctx);
4428 desret_const_xmlChar_ptr(ret_val);
4430 des_void_ptr(n_ctx, ctx, 0);
4431 xmlResetLastError();
4432 if (mem_base != xmlMemBlocks()) {
4433 printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4434 xmlMemBlocks() - mem_base);
4436 printf(" %d", n_ctx);
4447 test_xmlSAX2GetSystemId(void) {
4451 const xmlChar * ret_val;
4452 void * ctx; /* the user data (XML parser context) */
4455 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4456 mem_base = xmlMemBlocks();
4457 ctx = gen_void_ptr(n_ctx, 0);
4459 ret_val = xmlSAX2GetSystemId(ctx);
4460 desret_const_xmlChar_ptr(ret_val);
4462 des_void_ptr(n_ctx, ctx, 0);
4463 xmlResetLastError();
4464 if (mem_base != xmlMemBlocks()) {
4465 printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4466 xmlMemBlocks() - mem_base);
4468 printf(" %d", n_ctx);
4479 test_xmlSAX2HasExternalSubset(void) {
4484 void * ctx; /* the user data (XML parser context) */
4487 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4488 mem_base = xmlMemBlocks();
4489 ctx = gen_void_ptr(n_ctx, 0);
4491 ret_val = xmlSAX2HasExternalSubset(ctx);
4492 desret_int(ret_val);
4494 des_void_ptr(n_ctx, ctx, 0);
4495 xmlResetLastError();
4496 if (mem_base != xmlMemBlocks()) {
4497 printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4498 xmlMemBlocks() - mem_base);
4500 printf(" %d", n_ctx);
4511 test_xmlSAX2HasInternalSubset(void) {
4516 void * ctx; /* the user data (XML parser context) */
4519 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4520 mem_base = xmlMemBlocks();
4521 ctx = gen_void_ptr(n_ctx, 0);
4523 ret_val = xmlSAX2HasInternalSubset(ctx);
4524 desret_int(ret_val);
4526 des_void_ptr(n_ctx, ctx, 0);
4527 xmlResetLastError();
4528 if (mem_base != xmlMemBlocks()) {
4529 printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4530 xmlMemBlocks() - mem_base);
4532 printf(" %d", n_ctx);
4543 test_xmlSAX2IgnorableWhitespace(void) {
4547 void * ctx; /* the user data (XML parser context) */
4549 xmlChar * ch; /* a xmlChar string */
4551 int len; /* the number of xmlChar */
4554 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4555 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4556 for (n_len = 0;n_len < gen_nb_int;n_len++) {
4557 mem_base = xmlMemBlocks();
4558 ctx = gen_void_ptr(n_ctx, 0);
4559 ch = gen_const_xmlChar_ptr(n_ch, 1);
4560 len = gen_int(n_len, 2);
4562 xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4564 des_void_ptr(n_ctx, ctx, 0);
4565 des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4566 des_int(n_len, len, 2);
4567 xmlResetLastError();
4568 if (mem_base != xmlMemBlocks()) {
4569 printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4570 xmlMemBlocks() - mem_base);
4572 printf(" %d", n_ctx);
4573 printf(" %d", n_ch);
4574 printf(" %d", n_len);
4586 #define gen_nb_xmlSAXHandler_ptr 1
4587 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4590 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4594 test_xmlSAX2InitDefaultSAXHandler(void) {
4598 xmlSAXHandler * hdlr; /* the SAX handler */
4600 int warning; /* flag if non-zero sets the handler warning procedure */
4603 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4604 for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4605 mem_base = xmlMemBlocks();
4606 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4607 warning = gen_int(n_warning, 1);
4609 xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4611 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4612 des_int(n_warning, warning, 1);
4613 xmlResetLastError();
4614 if (mem_base != xmlMemBlocks()) {
4615 printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4616 xmlMemBlocks() - mem_base);
4618 printf(" %d", n_hdlr);
4619 printf(" %d", n_warning);
4631 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4634 #if defined(LIBXML_DOCB_ENABLED)
4636 xmlSAXHandler * hdlr; /* the SAX handler */
4639 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4640 mem_base = xmlMemBlocks();
4641 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4643 xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4645 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4646 xmlResetLastError();
4647 if (mem_base != xmlMemBlocks()) {
4648 printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4649 xmlMemBlocks() - mem_base);
4651 printf(" %d", n_hdlr);
4663 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4666 #if defined(LIBXML_HTML_ENABLED)
4668 xmlSAXHandler * hdlr; /* the SAX handler */
4671 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4672 mem_base = xmlMemBlocks();
4673 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4675 xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4677 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4678 xmlResetLastError();
4679 if (mem_base != xmlMemBlocks()) {
4680 printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4681 xmlMemBlocks() - mem_base);
4683 printf(" %d", n_hdlr);
4695 test_xmlSAX2InternalSubset(void) {
4699 void * ctx; /* the user data (XML parser context) */
4701 xmlChar * name; /* the root element name */
4703 xmlChar * ExternalID; /* the external ID */
4705 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4708 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4709 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4710 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4711 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4712 mem_base = xmlMemBlocks();
4713 ctx = gen_void_ptr(n_ctx, 0);
4714 name = gen_const_xmlChar_ptr(n_name, 1);
4715 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4716 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4718 xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4720 des_void_ptr(n_ctx, ctx, 0);
4721 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4722 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4723 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4724 xmlResetLastError();
4725 if (mem_base != xmlMemBlocks()) {
4726 printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4727 xmlMemBlocks() - mem_base);
4729 printf(" %d", n_ctx);
4730 printf(" %d", n_name);
4731 printf(" %d", n_ExternalID);
4732 printf(" %d", n_SystemID);
4746 test_xmlSAX2IsStandalone(void) {
4751 void * ctx; /* the user data (XML parser context) */
4754 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4755 mem_base = xmlMemBlocks();
4756 ctx = gen_void_ptr(n_ctx, 0);
4758 ret_val = xmlSAX2IsStandalone(ctx);
4759 desret_int(ret_val);
4761 des_void_ptr(n_ctx, ctx, 0);
4762 xmlResetLastError();
4763 if (mem_base != xmlMemBlocks()) {
4764 printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4765 xmlMemBlocks() - mem_base);
4767 printf(" %d", n_ctx);
4778 test_xmlSAX2NotationDecl(void) {
4782 void * ctx; /* the user data (XML parser context) */
4784 xmlChar * name; /* The name of the notation */
4786 xmlChar * publicId; /* The public ID of the entity */
4788 xmlChar * systemId; /* The system ID of the entity */
4791 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4792 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4793 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4794 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4795 mem_base = xmlMemBlocks();
4796 ctx = gen_void_ptr(n_ctx, 0);
4797 name = gen_const_xmlChar_ptr(n_name, 1);
4798 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4799 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4801 xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4803 des_void_ptr(n_ctx, ctx, 0);
4804 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4805 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4806 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4807 xmlResetLastError();
4808 if (mem_base != xmlMemBlocks()) {
4809 printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4810 xmlMemBlocks() - mem_base);
4812 printf(" %d", n_ctx);
4813 printf(" %d", n_name);
4814 printf(" %d", n_publicId);
4815 printf(" %d", n_systemId);
4829 test_xmlSAX2ProcessingInstruction(void) {
4833 void * ctx; /* the user data (XML parser context) */
4835 xmlChar * target; /* the target name */
4837 xmlChar * data; /* the PI data's */
4840 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4841 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4842 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4843 mem_base = xmlMemBlocks();
4844 ctx = gen_void_ptr(n_ctx, 0);
4845 target = gen_const_xmlChar_ptr(n_target, 1);
4846 data = gen_const_xmlChar_ptr(n_data, 2);
4848 xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4850 des_void_ptr(n_ctx, ctx, 0);
4851 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4852 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4853 xmlResetLastError();
4854 if (mem_base != xmlMemBlocks()) {
4855 printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4856 xmlMemBlocks() - mem_base);
4858 printf(" %d", n_ctx);
4859 printf(" %d", n_target);
4860 printf(" %d", n_data);
4873 test_xmlSAX2Reference(void) {
4877 void * ctx; /* the user data (XML parser context) */
4879 xmlChar * name; /* The entity name */
4882 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4883 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4884 mem_base = xmlMemBlocks();
4885 ctx = gen_void_ptr(n_ctx, 0);
4886 name = gen_const_xmlChar_ptr(n_name, 1);
4888 xmlSAX2Reference(ctx, (const xmlChar *)name);
4890 des_void_ptr(n_ctx, ctx, 0);
4891 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4892 xmlResetLastError();
4893 if (mem_base != xmlMemBlocks()) {
4894 printf("Leak of %d blocks found in xmlSAX2Reference",
4895 xmlMemBlocks() - mem_base);
4897 printf(" %d", n_ctx);
4898 printf(" %d", n_name);
4910 test_xmlSAX2ResolveEntity(void) {
4914 xmlParserInputPtr ret_val;
4915 void * ctx; /* the user data (XML parser context) */
4917 xmlChar * publicId; /* The public ID of the entity */
4919 xmlChar * systemId; /* The system ID of the entity */
4922 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4923 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4924 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4925 mem_base = xmlMemBlocks();
4926 ctx = gen_void_ptr(n_ctx, 0);
4927 publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4928 systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4930 ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4931 desret_xmlParserInputPtr(ret_val);
4933 des_void_ptr(n_ctx, ctx, 0);
4934 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4935 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4936 xmlResetLastError();
4937 if (mem_base != xmlMemBlocks()) {
4938 printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4939 xmlMemBlocks() - mem_base);
4941 printf(" %d", n_ctx);
4942 printf(" %d", n_publicId);
4943 printf(" %d", n_systemId);
4955 #define gen_nb_xmlSAXLocatorPtr 1
4956 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4959 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4963 test_xmlSAX2SetDocumentLocator(void) {
4967 void * ctx; /* the user data (XML parser context) */
4969 xmlSAXLocatorPtr loc; /* A SAX Locator */
4972 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4973 for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4974 mem_base = xmlMemBlocks();
4975 ctx = gen_void_ptr(n_ctx, 0);
4976 loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4978 xmlSAX2SetDocumentLocator(ctx, loc);
4980 des_void_ptr(n_ctx, ctx, 0);
4981 des_xmlSAXLocatorPtr(n_loc, loc, 1);
4982 xmlResetLastError();
4983 if (mem_base != xmlMemBlocks()) {
4984 printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4985 xmlMemBlocks() - mem_base);
4987 printf(" %d", n_ctx);
4988 printf(" %d", n_loc);
5000 test_xmlSAX2StartDocument(void) {
5004 void * ctx; /* the user data (XML parser context) */
5007 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5008 mem_base = xmlMemBlocks();
5009 ctx = gen_void_ptr(n_ctx, 0);
5011 xmlSAX2StartDocument(ctx);
5013 des_void_ptr(n_ctx, ctx, 0);
5014 xmlResetLastError();
5015 if (mem_base != xmlMemBlocks()) {
5016 printf("Leak of %d blocks found in xmlSAX2StartDocument",
5017 xmlMemBlocks() - mem_base);
5019 printf(" %d", n_ctx);
5030 test_xmlSAX2StartElement(void) {
5033 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5034 #ifdef LIBXML_SAX1_ENABLED
5036 void * ctx; /* the user data (XML parser context) */
5038 xmlChar * fullname; /* The element name, including namespace prefix */
5040 xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5043 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5044 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5045 for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5046 mem_base = xmlMemBlocks();
5047 ctx = gen_void_ptr(n_ctx, 0);
5048 fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5049 atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5051 xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5053 des_void_ptr(n_ctx, ctx, 0);
5054 des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5055 des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5056 xmlResetLastError();
5057 if (mem_base != xmlMemBlocks()) {
5058 printf("Leak of %d blocks found in xmlSAX2StartElement",
5059 xmlMemBlocks() - mem_base);
5061 printf(" %d", n_ctx);
5062 printf(" %d", n_fullname);
5063 printf(" %d", n_atts);
5078 test_xmlSAX2StartElementNs(void) {
5082 void * ctx; /* the user data (XML parser context) */
5084 xmlChar * localname; /* the local name of the element */
5086 xmlChar * prefix; /* the element namespace prefix if available */
5088 xmlChar * URI; /* the element namespace name if available */
5090 int nb_namespaces; /* number of namespace definitions on that node */
5091 int n_nb_namespaces;
5092 xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5094 int nb_attributes; /* the number of attributes on that node */
5095 int n_nb_attributes;
5096 int nb_defaulted; /* the number of defaulted attributes. */
5098 xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5101 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5102 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5103 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5104 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5105 for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5106 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5107 for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5108 for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5109 for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5110 mem_base = xmlMemBlocks();
5111 ctx = gen_void_ptr(n_ctx, 0);
5112 localname = gen_const_xmlChar_ptr(n_localname, 1);
5113 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5114 URI = gen_const_xmlChar_ptr(n_URI, 3);
5115 nb_namespaces = gen_int(n_nb_namespaces, 4);
5116 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5117 nb_attributes = gen_int(n_nb_attributes, 6);
5118 nb_defaulted = gen_int(n_nb_defaulted, 7);
5119 attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5121 xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5123 des_void_ptr(n_ctx, ctx, 0);
5124 des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5125 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5126 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5127 des_int(n_nb_namespaces, nb_namespaces, 4);
5128 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5129 des_int(n_nb_attributes, nb_attributes, 6);
5130 des_int(n_nb_defaulted, nb_defaulted, 7);
5131 des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5132 xmlResetLastError();
5133 if (mem_base != xmlMemBlocks()) {
5134 printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5135 xmlMemBlocks() - mem_base);
5137 printf(" %d", n_ctx);
5138 printf(" %d", n_localname);
5139 printf(" %d", n_prefix);
5140 printf(" %d", n_URI);
5141 printf(" %d", n_nb_namespaces);
5142 printf(" %d", n_namespaces);
5143 printf(" %d", n_nb_attributes);
5144 printf(" %d", n_nb_defaulted);
5145 printf(" %d", n_attributes);
5164 test_xmlSAX2UnparsedEntityDecl(void) {
5168 void * ctx; /* the user data (XML parser context) */
5170 xmlChar * name; /* The name of the entity */
5172 xmlChar * publicId; /* The public ID of the entity */
5174 xmlChar * systemId; /* The system ID of the entity */
5176 xmlChar * notationName; /* the name of the notation */
5179 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5180 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5181 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5182 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5183 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5184 mem_base = xmlMemBlocks();
5185 ctx = gen_void_ptr(n_ctx, 0);
5186 name = gen_const_xmlChar_ptr(n_name, 1);
5187 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5188 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5189 notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5191 xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5193 des_void_ptr(n_ctx, ctx, 0);
5194 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5195 des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5196 des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5197 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5198 xmlResetLastError();
5199 if (mem_base != xmlMemBlocks()) {
5200 printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5201 xmlMemBlocks() - mem_base);
5203 printf(" %d", n_ctx);
5204 printf(" %d", n_name);
5205 printf(" %d", n_publicId);
5206 printf(" %d", n_systemId);
5207 printf(" %d", n_notationName);
5222 test_xmlSAXDefaultVersion(void) {
5225 #if defined(LIBXML_SAX1_ENABLED)
5226 #ifdef LIBXML_SAX1_ENABLED
5229 int version; /* the version, 1 or 2 */
5232 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5233 mem_base = xmlMemBlocks();
5234 version = gen_int(n_version, 0);
5236 ret_val = xmlSAXDefaultVersion(version);
5237 desret_int(ret_val);
5239 des_int(n_version, version, 0);
5240 xmlResetLastError();
5241 if (mem_base != xmlMemBlocks()) {
5242 printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5243 xmlMemBlocks() - mem_base);
5245 printf(" %d", n_version);
5258 test_xmlSAXVersion(void) {
5263 xmlSAXHandler * hdlr; /* the SAX handler */
5265 int version; /* the version, 1 or 2 */
5268 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5269 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5270 mem_base = xmlMemBlocks();
5271 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5272 version = gen_int(n_version, 1);
5274 ret_val = xmlSAXVersion(hdlr, version);
5275 desret_int(ret_val);
5277 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5278 des_int(n_version, version, 1);
5279 xmlResetLastError();
5280 if (mem_base != xmlMemBlocks()) {
5281 printf("Leak of %d blocks found in xmlSAXVersion",
5282 xmlMemBlocks() - mem_base);
5284 printf(" %d", n_hdlr);
5285 printf(" %d", n_version);
5299 if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5300 test_ret += test_docbDefaultSAXHandlerInit();
5301 test_ret += test_htmlDefaultSAXHandlerInit();
5302 test_ret += test_xmlDefaultSAXHandlerInit();
5303 test_ret += test_xmlSAX2AttributeDecl();
5304 test_ret += test_xmlSAX2CDataBlock();
5305 test_ret += test_xmlSAX2Characters();
5306 test_ret += test_xmlSAX2Comment();
5307 test_ret += test_xmlSAX2ElementDecl();
5308 test_ret += test_xmlSAX2EndDocument();
5309 test_ret += test_xmlSAX2EndElement();
5310 test_ret += test_xmlSAX2EndElementNs();
5311 test_ret += test_xmlSAX2EntityDecl();
5312 test_ret += test_xmlSAX2ExternalSubset();
5313 test_ret += test_xmlSAX2GetColumnNumber();
5314 test_ret += test_xmlSAX2GetEntity();
5315 test_ret += test_xmlSAX2GetLineNumber();
5316 test_ret += test_xmlSAX2GetParameterEntity();
5317 test_ret += test_xmlSAX2GetPublicId();
5318 test_ret += test_xmlSAX2GetSystemId();
5319 test_ret += test_xmlSAX2HasExternalSubset();
5320 test_ret += test_xmlSAX2HasInternalSubset();
5321 test_ret += test_xmlSAX2IgnorableWhitespace();
5322 test_ret += test_xmlSAX2InitDefaultSAXHandler();
5323 test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5324 test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5325 test_ret += test_xmlSAX2InternalSubset();
5326 test_ret += test_xmlSAX2IsStandalone();
5327 test_ret += test_xmlSAX2NotationDecl();
5328 test_ret += test_xmlSAX2ProcessingInstruction();
5329 test_ret += test_xmlSAX2Reference();
5330 test_ret += test_xmlSAX2ResolveEntity();
5331 test_ret += test_xmlSAX2SetDocumentLocator();
5332 test_ret += test_xmlSAX2StartDocument();
5333 test_ret += test_xmlSAX2StartElement();
5334 test_ret += test_xmlSAX2StartElementNs();
5335 test_ret += test_xmlSAX2UnparsedEntityDecl();
5336 test_ret += test_xmlSAXDefaultVersion();
5337 test_ret += test_xmlSAXVersion();
5340 printf("Module SAX2: %d errors\n", test_ret);
5345 test_xmlC14NDocDumpMemory(void) {
5348 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5351 xmlDocPtr doc; /* the XML document for canonization */
5353 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5355 int mode; /* the c14n mode (see @xmlC14NMode) */
5357 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5358 int n_inclusive_ns_prefixes;
5359 int with_comments; /* include comments in the result (!=0) or not (==0) */
5360 int n_with_comments;
5361 xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
5364 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5365 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5366 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5367 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5368 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5369 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5370 mem_base = xmlMemBlocks();
5371 doc = gen_xmlDocPtr(n_doc, 0);
5372 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5373 mode = gen_int(n_mode, 2);
5374 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5375 with_comments = gen_int(n_with_comments, 4);
5376 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5378 ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5379 desret_int(ret_val);
5381 des_xmlDocPtr(n_doc, doc, 0);
5382 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5383 des_int(n_mode, mode, 2);
5384 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5385 des_int(n_with_comments, with_comments, 4);
5386 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5387 xmlResetLastError();
5388 if (mem_base != xmlMemBlocks()) {
5389 printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5390 xmlMemBlocks() - mem_base);
5392 printf(" %d", n_doc);
5393 printf(" %d", n_nodes);
5394 printf(" %d", n_mode);
5395 printf(" %d", n_inclusive_ns_prefixes);
5396 printf(" %d", n_with_comments);
5397 printf(" %d", n_doc_txt_ptr);
5414 test_xmlC14NDocSave(void) {
5417 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5420 xmlDocPtr doc; /* the XML document for canonization */
5422 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5424 int mode; /* the c14n mode (see @xmlC14NMode) */
5426 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5427 int n_inclusive_ns_prefixes;
5428 int with_comments; /* include comments in the result (!=0) or not (==0) */
5429 int n_with_comments;
5430 const char * filename; /* the filename to store canonical XML image */
5432 int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5435 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5436 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5437 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5438 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5439 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5440 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5441 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5442 mem_base = xmlMemBlocks();
5443 doc = gen_xmlDocPtr(n_doc, 0);
5444 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5445 mode = gen_int(n_mode, 2);
5446 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5447 with_comments = gen_int(n_with_comments, 4);
5448 filename = gen_fileoutput(n_filename, 5);
5449 compression = gen_int(n_compression, 6);
5451 ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5452 desret_int(ret_val);
5454 des_xmlDocPtr(n_doc, doc, 0);
5455 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5456 des_int(n_mode, mode, 2);
5457 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5458 des_int(n_with_comments, with_comments, 4);
5459 des_fileoutput(n_filename, filename, 5);
5460 des_int(n_compression, compression, 6);
5461 xmlResetLastError();
5462 if (mem_base != xmlMemBlocks()) {
5463 printf("Leak of %d blocks found in xmlC14NDocSave",
5464 xmlMemBlocks() - mem_base);
5466 printf(" %d", n_doc);
5467 printf(" %d", n_nodes);
5468 printf(" %d", n_mode);
5469 printf(" %d", n_inclusive_ns_prefixes);
5470 printf(" %d", n_with_comments);
5471 printf(" %d", n_filename);
5472 printf(" %d", n_compression);
5490 test_xmlC14NDocSaveTo(void) {
5493 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5496 xmlDocPtr doc; /* the XML document for canonization */
5498 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5500 int mode; /* the c14n mode (see @xmlC14NMode) */
5502 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5503 int n_inclusive_ns_prefixes;
5504 int with_comments; /* include comments in the result (!=0) or not (==0) */
5505 int n_with_comments;
5506 xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5509 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5510 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5511 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5512 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5513 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5514 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5515 mem_base = xmlMemBlocks();
5516 doc = gen_xmlDocPtr(n_doc, 0);
5517 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5518 mode = gen_int(n_mode, 2);
5519 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5520 with_comments = gen_int(n_with_comments, 4);
5521 buf = gen_xmlOutputBufferPtr(n_buf, 5);
5523 ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5524 desret_int(ret_val);
5526 des_xmlDocPtr(n_doc, doc, 0);
5527 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5528 des_int(n_mode, mode, 2);
5529 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5530 des_int(n_with_comments, with_comments, 4);
5531 des_xmlOutputBufferPtr(n_buf, buf, 5);
5532 xmlResetLastError();
5533 if (mem_base != xmlMemBlocks()) {
5534 printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5535 xmlMemBlocks() - mem_base);
5537 printf(" %d", n_doc);
5538 printf(" %d", n_nodes);
5539 printf(" %d", n_mode);
5540 printf(" %d", n_inclusive_ns_prefixes);
5541 printf(" %d", n_with_comments);
5542 printf(" %d", n_buf);
5559 test_xmlC14NExecute(void) {
5563 /* missing type support */
5571 if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5572 test_ret += test_xmlC14NDocDumpMemory();
5573 test_ret += test_xmlC14NDocSave();
5574 test_ret += test_xmlC14NDocSaveTo();
5575 test_ret += test_xmlC14NExecute();
5578 printf("Module c14n: %d errors\n", test_ret);
5581 #ifdef LIBXML_CATALOG_ENABLED
5583 #define gen_nb_xmlCatalogPtr 1
5584 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5587 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5593 test_xmlACatalogAdd(void) {
5596 #if defined(LIBXML_CATALOG_ENABLED)
5599 xmlCatalogPtr catal; /* a Catalog */
5601 xmlChar * type; /* the type of record to add to the catalog */
5603 xmlChar * orig; /* the system, public or prefix to match */
5605 xmlChar * replace; /* the replacement value for the match */
5608 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5609 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5610 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5611 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5612 mem_base = xmlMemBlocks();
5613 catal = gen_xmlCatalogPtr(n_catal, 0);
5614 type = gen_const_xmlChar_ptr(n_type, 1);
5615 orig = gen_const_xmlChar_ptr(n_orig, 2);
5616 replace = gen_const_xmlChar_ptr(n_replace, 3);
5618 ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5619 desret_int(ret_val);
5621 des_xmlCatalogPtr(n_catal, catal, 0);
5622 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5623 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5624 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5625 xmlResetLastError();
5626 if (mem_base != xmlMemBlocks()) {
5627 printf("Leak of %d blocks found in xmlACatalogAdd",
5628 xmlMemBlocks() - mem_base);
5630 printf(" %d", n_catal);
5631 printf(" %d", n_type);
5632 printf(" %d", n_orig);
5633 printf(" %d", n_replace);
5648 test_xmlACatalogDump(void) {
5651 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5653 xmlCatalogPtr catal; /* a Catalog */
5655 FILE * out; /* the file. */
5658 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5659 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5660 mem_base = xmlMemBlocks();
5661 catal = gen_xmlCatalogPtr(n_catal, 0);
5662 out = gen_FILE_ptr(n_out, 1);
5664 xmlACatalogDump(catal, out);
5666 des_xmlCatalogPtr(n_catal, catal, 0);
5667 des_FILE_ptr(n_out, out, 1);
5668 xmlResetLastError();
5669 if (mem_base != xmlMemBlocks()) {
5670 printf("Leak of %d blocks found in xmlACatalogDump",
5671 xmlMemBlocks() - mem_base);
5673 printf(" %d", n_catal);
5674 printf(" %d", n_out);
5687 test_xmlACatalogRemove(void) {
5690 #if defined(LIBXML_CATALOG_ENABLED)
5693 xmlCatalogPtr catal; /* a Catalog */
5695 xmlChar * value; /* the value to remove */
5698 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5699 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5700 mem_base = xmlMemBlocks();
5701 catal = gen_xmlCatalogPtr(n_catal, 0);
5702 value = gen_const_xmlChar_ptr(n_value, 1);
5704 ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5705 desret_int(ret_val);
5707 des_xmlCatalogPtr(n_catal, catal, 0);
5708 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5709 xmlResetLastError();
5710 if (mem_base != xmlMemBlocks()) {
5711 printf("Leak of %d blocks found in xmlACatalogRemove",
5712 xmlMemBlocks() - mem_base);
5714 printf(" %d", n_catal);
5715 printf(" %d", n_value);
5728 test_xmlACatalogResolve(void) {
5731 #if defined(LIBXML_CATALOG_ENABLED)
5734 xmlCatalogPtr catal; /* a Catalog */
5736 xmlChar * pubID; /* the public ID string */
5738 xmlChar * sysID; /* the system ID string */
5741 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5742 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5743 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5744 mem_base = xmlMemBlocks();
5745 catal = gen_xmlCatalogPtr(n_catal, 0);
5746 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5747 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5749 ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5750 desret_xmlChar_ptr(ret_val);
5752 des_xmlCatalogPtr(n_catal, catal, 0);
5753 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5754 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5755 xmlResetLastError();
5756 if (mem_base != xmlMemBlocks()) {
5757 printf("Leak of %d blocks found in xmlACatalogResolve",
5758 xmlMemBlocks() - mem_base);
5760 printf(" %d", n_catal);
5761 printf(" %d", n_pubID);
5762 printf(" %d", n_sysID);
5776 test_xmlACatalogResolvePublic(void) {
5779 #if defined(LIBXML_CATALOG_ENABLED)
5782 xmlCatalogPtr catal; /* a Catalog */
5784 xmlChar * pubID; /* the public ID string */
5787 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5788 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5789 mem_base = xmlMemBlocks();
5790 catal = gen_xmlCatalogPtr(n_catal, 0);
5791 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5793 ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5794 desret_xmlChar_ptr(ret_val);
5796 des_xmlCatalogPtr(n_catal, catal, 0);
5797 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5798 xmlResetLastError();
5799 if (mem_base != xmlMemBlocks()) {
5800 printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5801 xmlMemBlocks() - mem_base);
5803 printf(" %d", n_catal);
5804 printf(" %d", n_pubID);
5817 test_xmlACatalogResolveSystem(void) {
5820 #if defined(LIBXML_CATALOG_ENABLED)
5823 xmlCatalogPtr catal; /* a Catalog */
5825 xmlChar * sysID; /* the system ID string */
5828 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5829 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5830 mem_base = xmlMemBlocks();
5831 catal = gen_xmlCatalogPtr(n_catal, 0);
5832 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5834 ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5835 desret_xmlChar_ptr(ret_val);
5837 des_xmlCatalogPtr(n_catal, catal, 0);
5838 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5839 xmlResetLastError();
5840 if (mem_base != xmlMemBlocks()) {
5841 printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5842 xmlMemBlocks() - mem_base);
5844 printf(" %d", n_catal);
5845 printf(" %d", n_sysID);
5858 test_xmlACatalogResolveURI(void) {
5861 #if defined(LIBXML_CATALOG_ENABLED)
5864 xmlCatalogPtr catal; /* a Catalog */
5866 xmlChar * URI; /* the URI */
5869 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5870 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5871 mem_base = xmlMemBlocks();
5872 catal = gen_xmlCatalogPtr(n_catal, 0);
5873 URI = gen_const_xmlChar_ptr(n_URI, 1);
5875 ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5876 desret_xmlChar_ptr(ret_val);
5878 des_xmlCatalogPtr(n_catal, catal, 0);
5879 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5880 xmlResetLastError();
5881 if (mem_base != xmlMemBlocks()) {
5882 printf("Leak of %d blocks found in xmlACatalogResolveURI",
5883 xmlMemBlocks() - mem_base);
5885 printf(" %d", n_catal);
5886 printf(" %d", n_URI);
5899 test_xmlCatalogAdd(void) {
5902 #if defined(LIBXML_CATALOG_ENABLED)
5905 xmlChar * type; /* the type of record to add to the catalog */
5907 xmlChar * orig; /* the system, public or prefix to match */
5909 xmlChar * replace; /* the replacement value for the match */
5912 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5913 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5914 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5915 mem_base = xmlMemBlocks();
5916 type = gen_const_xmlChar_ptr(n_type, 0);
5917 orig = gen_const_xmlChar_ptr(n_orig, 1);
5918 replace = gen_const_xmlChar_ptr(n_replace, 2);
5920 ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5921 desret_int(ret_val);
5923 des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5924 des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5925 des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5926 xmlResetLastError();
5927 if (mem_base != xmlMemBlocks()) {
5928 printf("Leak of %d blocks found in xmlCatalogAdd",
5929 xmlMemBlocks() - mem_base);
5931 printf(" %d", n_type);
5932 printf(" %d", n_orig);
5933 printf(" %d", n_replace);
5947 test_xmlCatalogCleanup(void) {
5950 #if defined(LIBXML_CATALOG_ENABLED)
5953 xmlCatalogCleanup();
5955 xmlResetLastError();
5964 test_xmlCatalogConvert(void) {
5967 #if defined(LIBXML_CATALOG_ENABLED)
5971 ret_val = xmlCatalogConvert();
5972 desret_int(ret_val);
5974 xmlResetLastError();
5983 test_xmlCatalogDump(void) {
5986 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5988 FILE * out; /* the file. */
5991 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5992 mem_base = xmlMemBlocks();
5993 out = gen_FILE_ptr(n_out, 0);
5995 xmlCatalogDump(out);
5997 des_FILE_ptr(n_out, out, 0);
5998 xmlResetLastError();
5999 if (mem_base != xmlMemBlocks()) {
6000 printf("Leak of %d blocks found in xmlCatalogDump",
6001 xmlMemBlocks() - mem_base);
6003 printf(" %d", n_out);
6015 test_xmlCatalogGetDefaults(void) {
6018 #if defined(LIBXML_CATALOG_ENABLED)
6020 xmlCatalogAllow ret_val;
6022 mem_base = xmlMemBlocks();
6024 ret_val = xmlCatalogGetDefaults();
6025 desret_xmlCatalogAllow(ret_val);
6027 xmlResetLastError();
6028 if (mem_base != xmlMemBlocks()) {
6029 printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6030 xmlMemBlocks() - mem_base);
6042 test_xmlCatalogIsEmpty(void) {
6045 #if defined(LIBXML_CATALOG_ENABLED)
6048 xmlCatalogPtr catal; /* should this create an SGML catalog */
6051 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6052 mem_base = xmlMemBlocks();
6053 catal = gen_xmlCatalogPtr(n_catal, 0);
6055 ret_val = xmlCatalogIsEmpty(catal);
6056 desret_int(ret_val);
6058 des_xmlCatalogPtr(n_catal, catal, 0);
6059 xmlResetLastError();
6060 if (mem_base != xmlMemBlocks()) {
6061 printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6062 xmlMemBlocks() - mem_base);
6064 printf(" %d", n_catal);
6076 test_xmlCatalogLocalResolve(void) {
6079 #if defined(LIBXML_CATALOG_ENABLED)
6082 void * catalogs; /* a document's list of catalogs */
6084 xmlChar * pubID; /* the public ID string */
6086 xmlChar * sysID; /* the system ID string */
6089 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6090 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6091 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6092 mem_base = xmlMemBlocks();
6093 catalogs = gen_void_ptr(n_catalogs, 0);
6094 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6095 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6097 ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6098 desret_xmlChar_ptr(ret_val);
6100 des_void_ptr(n_catalogs, catalogs, 0);
6101 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6102 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6103 xmlResetLastError();
6104 if (mem_base != xmlMemBlocks()) {
6105 printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6106 xmlMemBlocks() - mem_base);
6108 printf(" %d", n_catalogs);
6109 printf(" %d", n_pubID);
6110 printf(" %d", n_sysID);
6124 test_xmlCatalogLocalResolveURI(void) {
6127 #if defined(LIBXML_CATALOG_ENABLED)
6130 void * catalogs; /* a document's list of catalogs */
6132 xmlChar * URI; /* the URI */
6135 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6136 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6137 mem_base = xmlMemBlocks();
6138 catalogs = gen_void_ptr(n_catalogs, 0);
6139 URI = gen_const_xmlChar_ptr(n_URI, 1);
6141 ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6142 desret_xmlChar_ptr(ret_val);
6144 des_void_ptr(n_catalogs, catalogs, 0);
6145 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6146 xmlResetLastError();
6147 if (mem_base != xmlMemBlocks()) {
6148 printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6149 xmlMemBlocks() - mem_base);
6151 printf(" %d", n_catalogs);
6152 printf(" %d", n_URI);
6165 test_xmlCatalogRemove(void) {
6168 #if defined(LIBXML_CATALOG_ENABLED)
6170 xmlChar * value; /* the value to remove */
6173 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6174 value = gen_const_xmlChar_ptr(n_value, 0);
6176 ret_val = xmlCatalogRemove((const xmlChar *)value);
6177 desret_int(ret_val);
6179 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6180 xmlResetLastError();
6190 test_xmlCatalogResolve(void) {
6193 #if defined(LIBXML_CATALOG_ENABLED)
6195 xmlChar * pubID; /* the public ID string */
6197 xmlChar * sysID; /* the system ID string */
6200 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6201 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6202 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6203 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6205 ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6206 desret_xmlChar_ptr(ret_val);
6208 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6209 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6210 xmlResetLastError();
6221 test_xmlCatalogResolvePublic(void) {
6224 #if defined(LIBXML_CATALOG_ENABLED)
6227 xmlChar * pubID; /* the public ID string */
6230 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6231 mem_base = xmlMemBlocks();
6232 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6234 ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6235 desret_xmlChar_ptr(ret_val);
6237 des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6238 xmlResetLastError();
6239 if (mem_base != xmlMemBlocks()) {
6240 printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6241 xmlMemBlocks() - mem_base);
6243 printf(" %d", n_pubID);
6255 test_xmlCatalogResolveSystem(void) {
6258 #if defined(LIBXML_CATALOG_ENABLED)
6261 xmlChar * sysID; /* the system ID string */
6264 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6265 mem_base = xmlMemBlocks();
6266 sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6268 ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6269 desret_xmlChar_ptr(ret_val);
6271 des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6272 xmlResetLastError();
6273 if (mem_base != xmlMemBlocks()) {
6274 printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6275 xmlMemBlocks() - mem_base);
6277 printf(" %d", n_sysID);
6289 test_xmlCatalogResolveURI(void) {
6292 #if defined(LIBXML_CATALOG_ENABLED)
6295 xmlChar * URI; /* the URI */
6298 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6299 mem_base = xmlMemBlocks();
6300 URI = gen_const_xmlChar_ptr(n_URI, 0);
6302 ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6303 desret_xmlChar_ptr(ret_val);
6305 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6306 xmlResetLastError();
6307 if (mem_base != xmlMemBlocks()) {
6308 printf("Leak of %d blocks found in xmlCatalogResolveURI",
6309 xmlMemBlocks() - mem_base);
6311 printf(" %d", n_URI);
6323 test_xmlCatalogSetDefaultPrefer(void) {
6326 #if defined(LIBXML_CATALOG_ENABLED)
6328 xmlCatalogPrefer ret_val;
6329 xmlCatalogPrefer prefer; /* the default preference for delegation */
6332 for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6333 mem_base = xmlMemBlocks();
6334 prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6336 ret_val = xmlCatalogSetDefaultPrefer(prefer);
6337 desret_xmlCatalogPrefer(ret_val);
6339 des_xmlCatalogPrefer(n_prefer, prefer, 0);
6340 xmlResetLastError();
6341 if (mem_base != xmlMemBlocks()) {
6342 printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6343 xmlMemBlocks() - mem_base);
6345 printf(" %d", n_prefer);
6357 test_xmlCatalogSetDefaults(void) {
6360 #if defined(LIBXML_CATALOG_ENABLED)
6362 xmlCatalogAllow allow; /* what catalogs should be accepted */
6365 for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6366 mem_base = xmlMemBlocks();
6367 allow = gen_xmlCatalogAllow(n_allow, 0);
6369 xmlCatalogSetDefaults(allow);
6371 des_xmlCatalogAllow(n_allow, allow, 0);
6372 xmlResetLastError();
6373 if (mem_base != xmlMemBlocks()) {
6374 printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6375 xmlMemBlocks() - mem_base);
6377 printf(" %d", n_allow);
6389 test_xmlConvertSGMLCatalog(void) {
6392 #if defined(LIBXML_CATALOG_ENABLED)
6395 xmlCatalogPtr catal; /* the catalog */
6398 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6399 mem_base = xmlMemBlocks();
6400 catal = gen_xmlCatalogPtr(n_catal, 0);
6402 ret_val = xmlConvertSGMLCatalog(catal);
6403 desret_int(ret_val);
6405 des_xmlCatalogPtr(n_catal, catal, 0);
6406 xmlResetLastError();
6407 if (mem_base != xmlMemBlocks()) {
6408 printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6409 xmlMemBlocks() - mem_base);
6411 printf(" %d", n_catal);
6423 test_xmlInitializeCatalog(void) {
6426 #if defined(LIBXML_CATALOG_ENABLED)
6429 mem_base = xmlMemBlocks();
6431 xmlInitializeCatalog();
6433 xmlResetLastError();
6434 if (mem_base != xmlMemBlocks()) {
6435 printf("Leak of %d blocks found in xmlInitializeCatalog",
6436 xmlMemBlocks() - mem_base);
6448 test_xmlLoadACatalog(void) {
6452 /* missing type support */
6458 test_xmlLoadCatalog(void) {
6461 #if defined(LIBXML_CATALOG_ENABLED)
6463 const char * filename; /* a file path */
6466 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6467 filename = gen_filepath(n_filename, 0);
6469 ret_val = xmlLoadCatalog(filename);
6470 desret_int(ret_val);
6472 des_filepath(n_filename, filename, 0);
6473 xmlResetLastError();
6483 test_xmlLoadCatalogs(void) {
6486 #if defined(LIBXML_CATALOG_ENABLED)
6487 char * pathss; /* a list of directories separated by a colon or a space. */
6490 for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6491 pathss = gen_const_char_ptr(n_pathss, 0);
6493 xmlLoadCatalogs((const char *)pathss);
6495 des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6496 xmlResetLastError();
6506 test_xmlLoadSGMLSuperCatalog(void) {
6510 /* missing type support */
6516 test_xmlNewCatalog(void) {
6520 /* missing type support */
6526 test_xmlParseCatalogFile(void) {
6529 #if defined(LIBXML_CATALOG_ENABLED)
6532 const char * filename; /* the filename */
6535 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6536 mem_base = xmlMemBlocks();
6537 filename = gen_filepath(n_filename, 0);
6539 ret_val = xmlParseCatalogFile(filename);
6540 desret_xmlDocPtr(ret_val);
6542 des_filepath(n_filename, filename, 0);
6543 xmlResetLastError();
6544 if (mem_base != xmlMemBlocks()) {
6545 printf("Leak of %d blocks found in xmlParseCatalogFile",
6546 xmlMemBlocks() - mem_base);
6548 printf(" %d", n_filename);
6559 test_catalog(void) {
6562 if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6563 test_ret += test_xmlACatalogAdd();
6564 test_ret += test_xmlACatalogDump();
6565 test_ret += test_xmlACatalogRemove();
6566 test_ret += test_xmlACatalogResolve();
6567 test_ret += test_xmlACatalogResolvePublic();
6568 test_ret += test_xmlACatalogResolveSystem();
6569 test_ret += test_xmlACatalogResolveURI();
6570 test_ret += test_xmlCatalogAdd();
6571 test_ret += test_xmlCatalogCleanup();
6572 test_ret += test_xmlCatalogConvert();
6573 test_ret += test_xmlCatalogDump();
6574 test_ret += test_xmlCatalogGetDefaults();
6575 test_ret += test_xmlCatalogIsEmpty();
6576 test_ret += test_xmlCatalogLocalResolve();
6577 test_ret += test_xmlCatalogLocalResolveURI();
6578 test_ret += test_xmlCatalogRemove();
6579 test_ret += test_xmlCatalogResolve();
6580 test_ret += test_xmlCatalogResolvePublic();
6581 test_ret += test_xmlCatalogResolveSystem();
6582 test_ret += test_xmlCatalogResolveURI();
6583 test_ret += test_xmlCatalogSetDefaultPrefer();
6584 test_ret += test_xmlCatalogSetDefaults();
6585 test_ret += test_xmlConvertSGMLCatalog();
6586 test_ret += test_xmlInitializeCatalog();
6587 test_ret += test_xmlLoadACatalog();
6588 test_ret += test_xmlLoadCatalog();
6589 test_ret += test_xmlLoadCatalogs();
6590 test_ret += test_xmlLoadSGMLSuperCatalog();
6591 test_ret += test_xmlNewCatalog();
6592 test_ret += test_xmlParseCatalogFile();
6595 printf("Module catalog: %d errors\n", test_ret);
6599 #define gen_nb_const_xmlChRangeGroup_ptr 1
6600 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6603 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6607 test_xmlCharInRange(void) {
6612 unsigned int val; /* character to be validated */
6614 xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6617 for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6618 for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6619 mem_base = xmlMemBlocks();
6620 val = gen_unsigned_int(n_val, 0);
6621 rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6623 ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6624 desret_int(ret_val);
6626 des_unsigned_int(n_val, val, 0);
6627 des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6628 xmlResetLastError();
6629 if (mem_base != xmlMemBlocks()) {
6630 printf("Leak of %d blocks found in xmlCharInRange",
6631 xmlMemBlocks() - mem_base);
6633 printf(" %d", n_val);
6634 printf(" %d", n_rptr);
6646 test_xmlIsBaseChar(void) {
6651 unsigned int ch; /* character to validate */
6654 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6655 mem_base = xmlMemBlocks();
6656 ch = gen_unsigned_int(n_ch, 0);
6658 ret_val = xmlIsBaseChar(ch);
6659 desret_int(ret_val);
6661 des_unsigned_int(n_ch, ch, 0);
6662 xmlResetLastError();
6663 if (mem_base != xmlMemBlocks()) {
6664 printf("Leak of %d blocks found in xmlIsBaseChar",
6665 xmlMemBlocks() - mem_base);
6667 printf(" %d", n_ch);
6678 test_xmlIsBlank(void) {
6683 unsigned int ch; /* character to validate */
6686 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6687 mem_base = xmlMemBlocks();
6688 ch = gen_unsigned_int(n_ch, 0);
6690 ret_val = xmlIsBlank(ch);
6691 desret_int(ret_val);
6693 des_unsigned_int(n_ch, ch, 0);
6694 xmlResetLastError();
6695 if (mem_base != xmlMemBlocks()) {
6696 printf("Leak of %d blocks found in xmlIsBlank",
6697 xmlMemBlocks() - mem_base);
6699 printf(" %d", n_ch);
6710 test_xmlIsChar(void) {
6715 unsigned int ch; /* character to validate */
6718 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6719 mem_base = xmlMemBlocks();
6720 ch = gen_unsigned_int(n_ch, 0);
6722 ret_val = xmlIsChar(ch);
6723 desret_int(ret_val);
6725 des_unsigned_int(n_ch, ch, 0);
6726 xmlResetLastError();
6727 if (mem_base != xmlMemBlocks()) {
6728 printf("Leak of %d blocks found in xmlIsChar",
6729 xmlMemBlocks() - mem_base);
6731 printf(" %d", n_ch);
6742 test_xmlIsCombining(void) {
6747 unsigned int ch; /* character to validate */
6750 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6751 mem_base = xmlMemBlocks();
6752 ch = gen_unsigned_int(n_ch, 0);
6754 ret_val = xmlIsCombining(ch);
6755 desret_int(ret_val);
6757 des_unsigned_int(n_ch, ch, 0);
6758 xmlResetLastError();
6759 if (mem_base != xmlMemBlocks()) {
6760 printf("Leak of %d blocks found in xmlIsCombining",
6761 xmlMemBlocks() - mem_base);
6763 printf(" %d", n_ch);
6774 test_xmlIsDigit(void) {
6779 unsigned int ch; /* character to validate */
6782 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6783 mem_base = xmlMemBlocks();
6784 ch = gen_unsigned_int(n_ch, 0);
6786 ret_val = xmlIsDigit(ch);
6787 desret_int(ret_val);
6789 des_unsigned_int(n_ch, ch, 0);
6790 xmlResetLastError();
6791 if (mem_base != xmlMemBlocks()) {
6792 printf("Leak of %d blocks found in xmlIsDigit",
6793 xmlMemBlocks() - mem_base);
6795 printf(" %d", n_ch);
6806 test_xmlIsExtender(void) {
6811 unsigned int ch; /* character to validate */
6814 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6815 mem_base = xmlMemBlocks();
6816 ch = gen_unsigned_int(n_ch, 0);
6818 ret_val = xmlIsExtender(ch);
6819 desret_int(ret_val);
6821 des_unsigned_int(n_ch, ch, 0);
6822 xmlResetLastError();
6823 if (mem_base != xmlMemBlocks()) {
6824 printf("Leak of %d blocks found in xmlIsExtender",
6825 xmlMemBlocks() - mem_base);
6827 printf(" %d", n_ch);
6838 test_xmlIsIdeographic(void) {
6843 unsigned int ch; /* character to validate */
6846 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6847 mem_base = xmlMemBlocks();
6848 ch = gen_unsigned_int(n_ch, 0);
6850 ret_val = xmlIsIdeographic(ch);
6851 desret_int(ret_val);
6853 des_unsigned_int(n_ch, ch, 0);
6854 xmlResetLastError();
6855 if (mem_base != xmlMemBlocks()) {
6856 printf("Leak of %d blocks found in xmlIsIdeographic",
6857 xmlMemBlocks() - mem_base);
6859 printf(" %d", n_ch);
6870 test_xmlIsPubidChar(void) {
6875 unsigned int ch; /* character to validate */
6878 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6879 mem_base = xmlMemBlocks();
6880 ch = gen_unsigned_int(n_ch, 0);
6882 ret_val = xmlIsPubidChar(ch);
6883 desret_int(ret_val);
6885 des_unsigned_int(n_ch, ch, 0);
6886 xmlResetLastError();
6887 if (mem_base != xmlMemBlocks()) {
6888 printf("Leak of %d blocks found in xmlIsPubidChar",
6889 xmlMemBlocks() - mem_base);
6891 printf(" %d", n_ch);
6901 test_chvalid(void) {
6904 if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6905 test_ret += test_xmlCharInRange();
6906 test_ret += test_xmlIsBaseChar();
6907 test_ret += test_xmlIsBlank();
6908 test_ret += test_xmlIsChar();
6909 test_ret += test_xmlIsCombining();
6910 test_ret += test_xmlIsDigit();
6911 test_ret += test_xmlIsExtender();
6912 test_ret += test_xmlIsIdeographic();
6913 test_ret += test_xmlIsPubidChar();
6916 printf("Module chvalid: %d errors\n", test_ret);
6921 test_xmlBoolToText(void) {
6924 #if defined(LIBXML_DEBUG_ENABLED)
6926 const char * ret_val;
6927 int boolval; /* a bool to turn into text */
6930 for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6931 mem_base = xmlMemBlocks();
6932 boolval = gen_int(n_boolval, 0);
6934 ret_val = xmlBoolToText(boolval);
6935 desret_const_char_ptr(ret_val);
6937 des_int(n_boolval, boolval, 0);
6938 xmlResetLastError();
6939 if (mem_base != xmlMemBlocks()) {
6940 printf("Leak of %d blocks found in xmlBoolToText",
6941 xmlMemBlocks() - mem_base);
6943 printf(" %d", n_boolval);
6955 test_xmlDebugCheckDocument(void) {
6958 #if defined(LIBXML_DEBUG_ENABLED)
6961 FILE * output; /* the FILE * for the output */
6963 xmlDocPtr doc; /* the document */
6966 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6967 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6968 mem_base = xmlMemBlocks();
6969 output = gen_debug_FILE_ptr(n_output, 0);
6970 doc = gen_xmlDocPtr(n_doc, 1);
6972 ret_val = xmlDebugCheckDocument(output, doc);
6973 desret_int(ret_val);
6975 des_debug_FILE_ptr(n_output, output, 0);
6976 des_xmlDocPtr(n_doc, doc, 1);
6977 xmlResetLastError();
6978 if (mem_base != xmlMemBlocks()) {
6979 printf("Leak of %d blocks found in xmlDebugCheckDocument",
6980 xmlMemBlocks() - mem_base);
6982 printf(" %d", n_output);
6983 printf(" %d", n_doc);
6996 test_xmlDebugDumpAttr(void) {
6999 #if defined(LIBXML_DEBUG_ENABLED)
7001 FILE * output; /* the FILE * for the output */
7003 xmlAttrPtr attr; /* the attribute */
7005 int depth; /* the indentation level. */
7008 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7009 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7010 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7011 mem_base = xmlMemBlocks();
7012 output = gen_debug_FILE_ptr(n_output, 0);
7013 attr = gen_xmlAttrPtr(n_attr, 1);
7014 depth = gen_int(n_depth, 2);
7016 xmlDebugDumpAttr(output, attr, depth);
7018 des_debug_FILE_ptr(n_output, output, 0);
7019 des_xmlAttrPtr(n_attr, attr, 1);
7020 des_int(n_depth, depth, 2);
7021 xmlResetLastError();
7022 if (mem_base != xmlMemBlocks()) {
7023 printf("Leak of %d blocks found in xmlDebugDumpAttr",
7024 xmlMemBlocks() - mem_base);
7026 printf(" %d", n_output);
7027 printf(" %d", n_attr);
7028 printf(" %d", n_depth);
7042 test_xmlDebugDumpAttrList(void) {
7045 #if defined(LIBXML_DEBUG_ENABLED)
7047 FILE * output; /* the FILE * for the output */
7049 xmlAttrPtr attr; /* the attribute list */
7051 int depth; /* the indentation level. */
7054 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7055 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7056 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7057 mem_base = xmlMemBlocks();
7058 output = gen_debug_FILE_ptr(n_output, 0);
7059 attr = gen_xmlAttrPtr(n_attr, 1);
7060 depth = gen_int(n_depth, 2);
7062 xmlDebugDumpAttrList(output, attr, depth);
7064 des_debug_FILE_ptr(n_output, output, 0);
7065 des_xmlAttrPtr(n_attr, attr, 1);
7066 des_int(n_depth, depth, 2);
7067 xmlResetLastError();
7068 if (mem_base != xmlMemBlocks()) {
7069 printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7070 xmlMemBlocks() - mem_base);
7072 printf(" %d", n_output);
7073 printf(" %d", n_attr);
7074 printf(" %d", n_depth);
7088 test_xmlDebugDumpDTD(void) {
7091 #if defined(LIBXML_DEBUG_ENABLED)
7093 FILE * output; /* the FILE * for the output */
7095 xmlDtdPtr dtd; /* the DTD */
7098 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7099 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7100 mem_base = xmlMemBlocks();
7101 output = gen_debug_FILE_ptr(n_output, 0);
7102 dtd = gen_xmlDtdPtr(n_dtd, 1);
7104 xmlDebugDumpDTD(output, dtd);
7106 des_debug_FILE_ptr(n_output, output, 0);
7107 des_xmlDtdPtr(n_dtd, dtd, 1);
7108 xmlResetLastError();
7109 if (mem_base != xmlMemBlocks()) {
7110 printf("Leak of %d blocks found in xmlDebugDumpDTD",
7111 xmlMemBlocks() - mem_base);
7113 printf(" %d", n_output);
7114 printf(" %d", n_dtd);
7127 test_xmlDebugDumpDocument(void) {
7130 #if defined(LIBXML_DEBUG_ENABLED)
7132 FILE * output; /* the FILE * for the output */
7134 xmlDocPtr doc; /* the document */
7137 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7138 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7139 mem_base = xmlMemBlocks();
7140 output = gen_debug_FILE_ptr(n_output, 0);
7141 doc = gen_xmlDocPtr(n_doc, 1);
7143 xmlDebugDumpDocument(output, doc);
7145 des_debug_FILE_ptr(n_output, output, 0);
7146 des_xmlDocPtr(n_doc, doc, 1);
7147 xmlResetLastError();
7148 if (mem_base != xmlMemBlocks()) {
7149 printf("Leak of %d blocks found in xmlDebugDumpDocument",
7150 xmlMemBlocks() - mem_base);
7152 printf(" %d", n_output);
7153 printf(" %d", n_doc);
7166 test_xmlDebugDumpDocumentHead(void) {
7169 #if defined(LIBXML_DEBUG_ENABLED)
7171 FILE * output; /* the FILE * for the output */
7173 xmlDocPtr doc; /* the document */
7176 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7177 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7178 mem_base = xmlMemBlocks();
7179 output = gen_debug_FILE_ptr(n_output, 0);
7180 doc = gen_xmlDocPtr(n_doc, 1);
7182 xmlDebugDumpDocumentHead(output, doc);
7184 des_debug_FILE_ptr(n_output, output, 0);
7185 des_xmlDocPtr(n_doc, doc, 1);
7186 xmlResetLastError();
7187 if (mem_base != xmlMemBlocks()) {
7188 printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7189 xmlMemBlocks() - mem_base);
7191 printf(" %d", n_output);
7192 printf(" %d", n_doc);
7205 test_xmlDebugDumpEntities(void) {
7208 #if defined(LIBXML_DEBUG_ENABLED)
7210 FILE * output; /* the FILE * for the output */
7212 xmlDocPtr doc; /* the document */
7215 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7216 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7217 mem_base = xmlMemBlocks();
7218 output = gen_debug_FILE_ptr(n_output, 0);
7219 doc = gen_xmlDocPtr(n_doc, 1);
7221 xmlDebugDumpEntities(output, doc);
7223 des_debug_FILE_ptr(n_output, output, 0);
7224 des_xmlDocPtr(n_doc, doc, 1);
7225 xmlResetLastError();
7226 if (mem_base != xmlMemBlocks()) {
7227 printf("Leak of %d blocks found in xmlDebugDumpEntities",
7228 xmlMemBlocks() - mem_base);
7230 printf(" %d", n_output);
7231 printf(" %d", n_doc);
7244 test_xmlDebugDumpNode(void) {
7247 #if defined(LIBXML_DEBUG_ENABLED)
7249 FILE * output; /* the FILE * for the output */
7251 xmlNodePtr node; /* the node */
7253 int depth; /* the indentation level. */
7256 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7257 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7258 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7259 mem_base = xmlMemBlocks();
7260 output = gen_debug_FILE_ptr(n_output, 0);
7261 node = gen_xmlNodePtr(n_node, 1);
7262 depth = gen_int(n_depth, 2);
7264 xmlDebugDumpNode(output, node, depth);
7266 des_debug_FILE_ptr(n_output, output, 0);
7267 des_xmlNodePtr(n_node, node, 1);
7268 des_int(n_depth, depth, 2);
7269 xmlResetLastError();
7270 if (mem_base != xmlMemBlocks()) {
7271 printf("Leak of %d blocks found in xmlDebugDumpNode",
7272 xmlMemBlocks() - mem_base);
7274 printf(" %d", n_output);
7275 printf(" %d", n_node);
7276 printf(" %d", n_depth);
7290 test_xmlDebugDumpNodeList(void) {
7293 #if defined(LIBXML_DEBUG_ENABLED)
7295 FILE * output; /* the FILE * for the output */
7297 xmlNodePtr node; /* the node list */
7299 int depth; /* the indentation level. */
7302 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7303 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7304 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7305 mem_base = xmlMemBlocks();
7306 output = gen_debug_FILE_ptr(n_output, 0);
7307 node = gen_xmlNodePtr(n_node, 1);
7308 depth = gen_int(n_depth, 2);
7310 xmlDebugDumpNodeList(output, node, depth);
7312 des_debug_FILE_ptr(n_output, output, 0);
7313 des_xmlNodePtr(n_node, node, 1);
7314 des_int(n_depth, depth, 2);
7315 xmlResetLastError();
7316 if (mem_base != xmlMemBlocks()) {
7317 printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7318 xmlMemBlocks() - mem_base);
7320 printf(" %d", n_output);
7321 printf(" %d", n_node);
7322 printf(" %d", n_depth);
7336 test_xmlDebugDumpOneNode(void) {
7339 #if defined(LIBXML_DEBUG_ENABLED)
7341 FILE * output; /* the FILE * for the output */
7343 xmlNodePtr node; /* the node */
7345 int depth; /* the indentation level. */
7348 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7349 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7350 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7351 mem_base = xmlMemBlocks();
7352 output = gen_debug_FILE_ptr(n_output, 0);
7353 node = gen_xmlNodePtr(n_node, 1);
7354 depth = gen_int(n_depth, 2);
7356 xmlDebugDumpOneNode(output, node, depth);
7358 des_debug_FILE_ptr(n_output, output, 0);
7359 des_xmlNodePtr(n_node, node, 1);
7360 des_int(n_depth, depth, 2);
7361 xmlResetLastError();
7362 if (mem_base != xmlMemBlocks()) {
7363 printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7364 xmlMemBlocks() - mem_base);
7366 printf(" %d", n_output);
7367 printf(" %d", n_node);
7368 printf(" %d", n_depth);
7382 test_xmlDebugDumpString(void) {
7385 #if defined(LIBXML_DEBUG_ENABLED)
7387 FILE * output; /* the FILE * for the output */
7389 xmlChar * str; /* the string */
7392 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7393 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7394 mem_base = xmlMemBlocks();
7395 output = gen_debug_FILE_ptr(n_output, 0);
7396 str = gen_const_xmlChar_ptr(n_str, 1);
7398 xmlDebugDumpString(output, (const xmlChar *)str);
7400 des_debug_FILE_ptr(n_output, output, 0);
7401 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7402 xmlResetLastError();
7403 if (mem_base != xmlMemBlocks()) {
7404 printf("Leak of %d blocks found in xmlDebugDumpString",
7405 xmlMemBlocks() - mem_base);
7407 printf(" %d", n_output);
7408 printf(" %d", n_str);
7421 test_xmlLsCountNode(void) {
7424 #if defined(LIBXML_DEBUG_ENABLED)
7427 xmlNodePtr node; /* the node to count */
7430 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7431 mem_base = xmlMemBlocks();
7432 node = gen_xmlNodePtr(n_node, 0);
7434 ret_val = xmlLsCountNode(node);
7435 desret_int(ret_val);
7437 des_xmlNodePtr(n_node, node, 0);
7438 xmlResetLastError();
7439 if (mem_base != xmlMemBlocks()) {
7440 printf("Leak of %d blocks found in xmlLsCountNode",
7441 xmlMemBlocks() - mem_base);
7443 printf(" %d", n_node);
7455 test_xmlLsOneNode(void) {
7458 #if defined(LIBXML_DEBUG_ENABLED)
7460 FILE * output; /* the FILE * for the output */
7462 xmlNodePtr node; /* the node to dump */
7465 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7466 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7467 mem_base = xmlMemBlocks();
7468 output = gen_debug_FILE_ptr(n_output, 0);
7469 node = gen_xmlNodePtr(n_node, 1);
7471 xmlLsOneNode(output, node);
7473 des_debug_FILE_ptr(n_output, output, 0);
7474 des_xmlNodePtr(n_node, node, 1);
7475 xmlResetLastError();
7476 if (mem_base != xmlMemBlocks()) {
7477 printf("Leak of %d blocks found in xmlLsOneNode",
7478 xmlMemBlocks() - mem_base);
7480 printf(" %d", n_output);
7481 printf(" %d", n_node);
7493 #define gen_nb_char_ptr 1
7494 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7497 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7501 test_xmlShell(void) {
7505 /* missing type support */
7511 test_xmlShellBase(void) {
7514 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7517 xmlShellCtxtPtr ctxt; /* the shell context */
7519 char * arg; /* unused */
7521 xmlNodePtr node; /* a node */
7523 xmlNodePtr node2; /* unused */
7526 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7527 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7528 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7529 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7530 mem_base = xmlMemBlocks();
7531 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7532 arg = gen_char_ptr(n_arg, 1);
7533 node = gen_xmlNodePtr(n_node, 2);
7534 node2 = gen_xmlNodePtr(n_node2, 3);
7536 ret_val = xmlShellBase(ctxt, arg, node, node2);
7537 desret_int(ret_val);
7539 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7540 des_char_ptr(n_arg, arg, 1);
7541 des_xmlNodePtr(n_node, node, 2);
7542 des_xmlNodePtr(n_node2, node2, 3);
7543 xmlResetLastError();
7544 if (mem_base != xmlMemBlocks()) {
7545 printf("Leak of %d blocks found in xmlShellBase",
7546 xmlMemBlocks() - mem_base);
7548 printf(" %d", n_ctxt);
7549 printf(" %d", n_arg);
7550 printf(" %d", n_node);
7551 printf(" %d", n_node2);
7566 test_xmlShellCat(void) {
7569 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7572 xmlShellCtxtPtr ctxt; /* the shell context */
7574 char * arg; /* unused */
7576 xmlNodePtr node; /* a node */
7578 xmlNodePtr node2; /* unused */
7581 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7582 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7583 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7584 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7585 mem_base = xmlMemBlocks();
7586 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7587 arg = gen_char_ptr(n_arg, 1);
7588 node = gen_xmlNodePtr(n_node, 2);
7589 node2 = gen_xmlNodePtr(n_node2, 3);
7591 ret_val = xmlShellCat(ctxt, arg, node, node2);
7592 desret_int(ret_val);
7594 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7595 des_char_ptr(n_arg, arg, 1);
7596 des_xmlNodePtr(n_node, node, 2);
7597 des_xmlNodePtr(n_node2, node2, 3);
7598 xmlResetLastError();
7599 if (mem_base != xmlMemBlocks()) {
7600 printf("Leak of %d blocks found in xmlShellCat",
7601 xmlMemBlocks() - mem_base);
7603 printf(" %d", n_ctxt);
7604 printf(" %d", n_arg);
7605 printf(" %d", n_node);
7606 printf(" %d", n_node2);
7621 test_xmlShellDir(void) {
7624 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7627 xmlShellCtxtPtr ctxt; /* the shell context */
7629 char * arg; /* unused */
7631 xmlNodePtr node; /* a node */
7633 xmlNodePtr node2; /* unused */
7636 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7637 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7638 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7639 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7640 mem_base = xmlMemBlocks();
7641 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7642 arg = gen_char_ptr(n_arg, 1);
7643 node = gen_xmlNodePtr(n_node, 2);
7644 node2 = gen_xmlNodePtr(n_node2, 3);
7646 ret_val = xmlShellDir(ctxt, arg, node, node2);
7647 desret_int(ret_val);
7649 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7650 des_char_ptr(n_arg, arg, 1);
7651 des_xmlNodePtr(n_node, node, 2);
7652 des_xmlNodePtr(n_node2, node2, 3);
7653 xmlResetLastError();
7654 if (mem_base != xmlMemBlocks()) {
7655 printf("Leak of %d blocks found in xmlShellDir",
7656 xmlMemBlocks() - mem_base);
7658 printf(" %d", n_ctxt);
7659 printf(" %d", n_arg);
7660 printf(" %d", n_node);
7661 printf(" %d", n_node2);
7676 test_xmlShellDu(void) {
7679 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7682 xmlShellCtxtPtr ctxt; /* the shell context */
7684 char * arg; /* unused */
7686 xmlNodePtr tree; /* a node defining a subtree */
7688 xmlNodePtr node2; /* unused */
7691 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7692 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7693 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7694 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7695 mem_base = xmlMemBlocks();
7696 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7697 arg = gen_char_ptr(n_arg, 1);
7698 tree = gen_xmlNodePtr(n_tree, 2);
7699 node2 = gen_xmlNodePtr(n_node2, 3);
7701 ret_val = xmlShellDu(ctxt, arg, tree, node2);
7702 desret_int(ret_val);
7704 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7705 des_char_ptr(n_arg, arg, 1);
7706 des_xmlNodePtr(n_tree, tree, 2);
7707 des_xmlNodePtr(n_node2, node2, 3);
7708 xmlResetLastError();
7709 if (mem_base != xmlMemBlocks()) {
7710 printf("Leak of %d blocks found in xmlShellDu",
7711 xmlMemBlocks() - mem_base);
7713 printf(" %d", n_ctxt);
7714 printf(" %d", n_arg);
7715 printf(" %d", n_tree);
7716 printf(" %d", n_node2);
7731 test_xmlShellList(void) {
7734 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7737 xmlShellCtxtPtr ctxt; /* the shell context */
7739 char * arg; /* unused */
7741 xmlNodePtr node; /* a node */
7743 xmlNodePtr node2; /* unused */
7746 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7747 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7748 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7749 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7750 mem_base = xmlMemBlocks();
7751 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7752 arg = gen_char_ptr(n_arg, 1);
7753 node = gen_xmlNodePtr(n_node, 2);
7754 node2 = gen_xmlNodePtr(n_node2, 3);
7756 ret_val = xmlShellList(ctxt, arg, node, node2);
7757 desret_int(ret_val);
7759 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7760 des_char_ptr(n_arg, arg, 1);
7761 des_xmlNodePtr(n_node, node, 2);
7762 des_xmlNodePtr(n_node2, node2, 3);
7763 xmlResetLastError();
7764 if (mem_base != xmlMemBlocks()) {
7765 printf("Leak of %d blocks found in xmlShellList",
7766 xmlMemBlocks() - mem_base);
7768 printf(" %d", n_ctxt);
7769 printf(" %d", n_arg);
7770 printf(" %d", n_node);
7771 printf(" %d", n_node2);
7786 test_xmlShellLoad(void) {
7789 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7792 xmlShellCtxtPtr ctxt; /* the shell context */
7794 char * filename; /* the file name */
7796 xmlNodePtr node; /* unused */
7798 xmlNodePtr node2; /* unused */
7801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7802 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7803 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7804 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7805 mem_base = xmlMemBlocks();
7806 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7807 filename = gen_char_ptr(n_filename, 1);
7808 node = gen_xmlNodePtr(n_node, 2);
7809 node2 = gen_xmlNodePtr(n_node2, 3);
7811 ret_val = xmlShellLoad(ctxt, filename, node, node2);
7812 desret_int(ret_val);
7814 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7815 des_char_ptr(n_filename, filename, 1);
7816 des_xmlNodePtr(n_node, node, 2);
7817 des_xmlNodePtr(n_node2, node2, 3);
7818 xmlResetLastError();
7819 if (mem_base != xmlMemBlocks()) {
7820 printf("Leak of %d blocks found in xmlShellLoad",
7821 xmlMemBlocks() - mem_base);
7823 printf(" %d", n_ctxt);
7824 printf(" %d", n_filename);
7825 printf(" %d", n_node);
7826 printf(" %d", n_node2);
7841 test_xmlShellPrintXPathResult(void) {
7844 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7846 xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7849 for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7850 mem_base = xmlMemBlocks();
7851 list = gen_xmlXPathObjectPtr(n_list, 0);
7853 xmlShellPrintXPathResult(list);
7855 des_xmlXPathObjectPtr(n_list, list, 0);
7856 xmlResetLastError();
7857 if (mem_base != xmlMemBlocks()) {
7858 printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7859 xmlMemBlocks() - mem_base);
7861 printf(" %d", n_list);
7873 test_xmlShellPwd(void) {
7876 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7879 xmlShellCtxtPtr ctxt; /* the shell context */
7881 char * buffer; /* the output buffer */
7883 xmlNodePtr node; /* a node */
7885 xmlNodePtr node2; /* unused */
7888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7889 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7890 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7891 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7892 mem_base = xmlMemBlocks();
7893 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7894 buffer = gen_char_ptr(n_buffer, 1);
7895 node = gen_xmlNodePtr(n_node, 2);
7896 node2 = gen_xmlNodePtr(n_node2, 3);
7898 ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7899 desret_int(ret_val);
7901 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7902 des_char_ptr(n_buffer, buffer, 1);
7903 des_xmlNodePtr(n_node, node, 2);
7904 des_xmlNodePtr(n_node2, node2, 3);
7905 xmlResetLastError();
7906 if (mem_base != xmlMemBlocks()) {
7907 printf("Leak of %d blocks found in xmlShellPwd",
7908 xmlMemBlocks() - mem_base);
7910 printf(" %d", n_ctxt);
7911 printf(" %d", n_buffer);
7912 printf(" %d", n_node);
7913 printf(" %d", n_node2);
7928 test_xmlShellSave(void) {
7931 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7934 xmlShellCtxtPtr ctxt; /* the shell context */
7936 char * filename; /* the file name (optional) */
7938 xmlNodePtr node; /* unused */
7940 xmlNodePtr node2; /* unused */
7943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7944 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7945 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7946 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7947 mem_base = xmlMemBlocks();
7948 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7949 filename = gen_char_ptr(n_filename, 1);
7950 node = gen_xmlNodePtr(n_node, 2);
7951 node2 = gen_xmlNodePtr(n_node2, 3);
7953 ret_val = xmlShellSave(ctxt, filename, node, node2);
7954 desret_int(ret_val);
7956 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7957 des_char_ptr(n_filename, filename, 1);
7958 des_xmlNodePtr(n_node, node, 2);
7959 des_xmlNodePtr(n_node2, node2, 3);
7960 xmlResetLastError();
7961 if (mem_base != xmlMemBlocks()) {
7962 printf("Leak of %d blocks found in xmlShellSave",
7963 xmlMemBlocks() - mem_base);
7965 printf(" %d", n_ctxt);
7966 printf(" %d", n_filename);
7967 printf(" %d", n_node);
7968 printf(" %d", n_node2);
7983 test_xmlShellValidate(void) {
7986 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7989 xmlShellCtxtPtr ctxt; /* the shell context */
7991 char * dtd; /* the DTD URI (optional) */
7993 xmlNodePtr node; /* unused */
7995 xmlNodePtr node2; /* unused */
7998 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7999 for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8000 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8001 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8002 mem_base = xmlMemBlocks();
8003 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8004 dtd = gen_char_ptr(n_dtd, 1);
8005 node = gen_xmlNodePtr(n_node, 2);
8006 node2 = gen_xmlNodePtr(n_node2, 3);
8008 ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8009 desret_int(ret_val);
8011 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8012 des_char_ptr(n_dtd, dtd, 1);
8013 des_xmlNodePtr(n_node, node, 2);
8014 des_xmlNodePtr(n_node2, node2, 3);
8015 xmlResetLastError();
8016 if (mem_base != xmlMemBlocks()) {
8017 printf("Leak of %d blocks found in xmlShellValidate",
8018 xmlMemBlocks() - mem_base);
8020 printf(" %d", n_ctxt);
8021 printf(" %d", n_dtd);
8022 printf(" %d", n_node);
8023 printf(" %d", n_node2);
8038 test_xmlShellWrite(void) {
8041 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8044 xmlShellCtxtPtr ctxt; /* the shell context */
8046 char * filename; /* the file name */
8048 xmlNodePtr node; /* a node in the tree */
8050 xmlNodePtr node2; /* unused */
8053 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8054 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8055 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8056 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8057 mem_base = xmlMemBlocks();
8058 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8059 filename = gen_char_ptr(n_filename, 1);
8060 node = gen_xmlNodePtr(n_node, 2);
8061 node2 = gen_xmlNodePtr(n_node2, 3);
8063 ret_val = xmlShellWrite(ctxt, filename, node, node2);
8064 desret_int(ret_val);
8066 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8067 des_char_ptr(n_filename, filename, 1);
8068 des_xmlNodePtr(n_node, node, 2);
8069 des_xmlNodePtr(n_node2, node2, 3);
8070 xmlResetLastError();
8071 if (mem_base != xmlMemBlocks()) {
8072 printf("Leak of %d blocks found in xmlShellWrite",
8073 xmlMemBlocks() - mem_base);
8075 printf(" %d", n_ctxt);
8076 printf(" %d", n_filename);
8077 printf(" %d", n_node);
8078 printf(" %d", n_node2);
8092 test_debugXML(void) {
8095 if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8096 test_ret += test_xmlBoolToText();
8097 test_ret += test_xmlDebugCheckDocument();
8098 test_ret += test_xmlDebugDumpAttr();
8099 test_ret += test_xmlDebugDumpAttrList();
8100 test_ret += test_xmlDebugDumpDTD();
8101 test_ret += test_xmlDebugDumpDocument();
8102 test_ret += test_xmlDebugDumpDocumentHead();
8103 test_ret += test_xmlDebugDumpEntities();
8104 test_ret += test_xmlDebugDumpNode();
8105 test_ret += test_xmlDebugDumpNodeList();
8106 test_ret += test_xmlDebugDumpOneNode();
8107 test_ret += test_xmlDebugDumpString();
8108 test_ret += test_xmlLsCountNode();
8109 test_ret += test_xmlLsOneNode();
8110 test_ret += test_xmlShell();
8111 test_ret += test_xmlShellBase();
8112 test_ret += test_xmlShellCat();
8113 test_ret += test_xmlShellDir();
8114 test_ret += test_xmlShellDu();
8115 test_ret += test_xmlShellList();
8116 test_ret += test_xmlShellLoad();
8117 test_ret += test_xmlShellPrintXPathResult();
8118 test_ret += test_xmlShellPwd();
8119 test_ret += test_xmlShellSave();
8120 test_ret += test_xmlShellValidate();
8121 test_ret += test_xmlShellWrite();
8124 printf("Module debugXML: %d errors\n", test_ret);
8129 test_xmlDictCleanup(void) {
8134 mem_base = xmlMemBlocks();
8138 xmlResetLastError();
8139 if (mem_base != xmlMemBlocks()) {
8140 printf("Leak of %d blocks found in xmlDictCleanup",
8141 xmlMemBlocks() - mem_base);
8152 test_xmlDictCreate(void) {
8158 mem_base = xmlMemBlocks();
8160 ret_val = xmlDictCreate();
8161 desret_xmlDictPtr(ret_val);
8163 xmlResetLastError();
8164 if (mem_base != xmlMemBlocks()) {
8165 printf("Leak of %d blocks found in xmlDictCreate",
8166 xmlMemBlocks() - mem_base);
8177 test_xmlDictCreateSub(void) {
8182 xmlDictPtr sub; /* an existing dictionnary */
8185 for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8186 mem_base = xmlMemBlocks();
8187 sub = gen_xmlDictPtr(n_sub, 0);
8189 ret_val = xmlDictCreateSub(sub);
8190 desret_xmlDictPtr(ret_val);
8192 des_xmlDictPtr(n_sub, sub, 0);
8193 xmlResetLastError();
8194 if (mem_base != xmlMemBlocks()) {
8195 printf("Leak of %d blocks found in xmlDictCreateSub",
8196 xmlMemBlocks() - mem_base);
8198 printf(" %d", n_sub);
8209 test_xmlDictExists(void) {
8213 const xmlChar * ret_val;
8214 xmlDictPtr dict; /* the dictionnary */
8216 xmlChar * name; /* the name of the userdata */
8218 int len; /* the length of the name, if -1 it is recomputed */
8221 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8222 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8223 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8224 mem_base = xmlMemBlocks();
8225 dict = gen_xmlDictPtr(n_dict, 0);
8226 name = gen_const_xmlChar_ptr(n_name, 1);
8227 len = gen_int(n_len, 2);
8229 ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8230 desret_const_xmlChar_ptr(ret_val);
8232 des_xmlDictPtr(n_dict, dict, 0);
8233 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8234 des_int(n_len, len, 2);
8235 xmlResetLastError();
8236 if (mem_base != xmlMemBlocks()) {
8237 printf("Leak of %d blocks found in xmlDictExists",
8238 xmlMemBlocks() - mem_base);
8240 printf(" %d", n_dict);
8241 printf(" %d", n_name);
8242 printf(" %d", n_len);
8255 test_xmlDictLookup(void) {
8259 const xmlChar * ret_val;
8260 xmlDictPtr dict; /* the dictionnary */
8262 xmlChar * name; /* the name of the userdata */
8264 int len; /* the length of the name, if -1 it is recomputed */
8267 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8268 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8269 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8270 mem_base = xmlMemBlocks();
8271 dict = gen_xmlDictPtr(n_dict, 0);
8272 name = gen_const_xmlChar_ptr(n_name, 1);
8273 len = gen_int(n_len, 2);
8275 ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8276 desret_const_xmlChar_ptr(ret_val);
8278 des_xmlDictPtr(n_dict, dict, 0);
8279 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8280 des_int(n_len, len, 2);
8281 xmlResetLastError();
8282 if (mem_base != xmlMemBlocks()) {
8283 printf("Leak of %d blocks found in xmlDictLookup",
8284 xmlMemBlocks() - mem_base);
8286 printf(" %d", n_dict);
8287 printf(" %d", n_name);
8288 printf(" %d", n_len);
8301 test_xmlDictOwns(void) {
8306 xmlDictPtr dict; /* the dictionnary */
8308 xmlChar * str; /* the string */
8311 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8312 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8313 mem_base = xmlMemBlocks();
8314 dict = gen_xmlDictPtr(n_dict, 0);
8315 str = gen_const_xmlChar_ptr(n_str, 1);
8317 ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8318 desret_int(ret_val);
8320 des_xmlDictPtr(n_dict, dict, 0);
8321 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8322 xmlResetLastError();
8323 if (mem_base != xmlMemBlocks()) {
8324 printf("Leak of %d blocks found in xmlDictOwns",
8325 xmlMemBlocks() - mem_base);
8327 printf(" %d", n_dict);
8328 printf(" %d", n_str);
8340 test_xmlDictQLookup(void) {
8344 const xmlChar * ret_val;
8345 xmlDictPtr dict; /* the dictionnary */
8347 xmlChar * prefix; /* the prefix */
8349 xmlChar * name; /* the name */
8352 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8353 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8354 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8355 mem_base = xmlMemBlocks();
8356 dict = gen_xmlDictPtr(n_dict, 0);
8357 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8358 name = gen_const_xmlChar_ptr(n_name, 2);
8360 ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8361 desret_const_xmlChar_ptr(ret_val);
8363 des_xmlDictPtr(n_dict, dict, 0);
8364 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8365 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8366 xmlResetLastError();
8367 if (mem_base != xmlMemBlocks()) {
8368 printf("Leak of %d blocks found in xmlDictQLookup",
8369 xmlMemBlocks() - mem_base);
8371 printf(" %d", n_dict);
8372 printf(" %d", n_prefix);
8373 printf(" %d", n_name);
8386 test_xmlDictReference(void) {
8391 xmlDictPtr dict; /* the dictionnary */
8394 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8395 mem_base = xmlMemBlocks();
8396 dict = gen_xmlDictPtr(n_dict, 0);
8398 ret_val = xmlDictReference(dict);
8400 desret_int(ret_val);
8402 des_xmlDictPtr(n_dict, dict, 0);
8403 xmlResetLastError();
8404 if (mem_base != xmlMemBlocks()) {
8405 printf("Leak of %d blocks found in xmlDictReference",
8406 xmlMemBlocks() - mem_base);
8408 printf(" %d", n_dict);
8419 test_xmlDictSize(void) {
8424 xmlDictPtr dict; /* the dictionnary */
8427 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8428 mem_base = xmlMemBlocks();
8429 dict = gen_xmlDictPtr(n_dict, 0);
8431 ret_val = xmlDictSize(dict);
8432 desret_int(ret_val);
8434 des_xmlDictPtr(n_dict, dict, 0);
8435 xmlResetLastError();
8436 if (mem_base != xmlMemBlocks()) {
8437 printf("Leak of %d blocks found in xmlDictSize",
8438 xmlMemBlocks() - mem_base);
8440 printf(" %d", n_dict);
8453 if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8454 test_ret += test_xmlDictCleanup();
8455 test_ret += test_xmlDictCreate();
8456 test_ret += test_xmlDictCreateSub();
8457 test_ret += test_xmlDictExists();
8458 test_ret += test_xmlDictLookup();
8459 test_ret += test_xmlDictOwns();
8460 test_ret += test_xmlDictQLookup();
8461 test_ret += test_xmlDictReference();
8462 test_ret += test_xmlDictSize();
8465 printf("Module dict: %d errors\n", test_ret);
8470 test_UTF8Toisolat1(void) {
8473 #if defined(LIBXML_OUTPUT_ENABLED)
8474 #ifdef LIBXML_OUTPUT_ENABLED
8477 unsigned char * out; /* a pointer to an array of bytes to store the result */
8479 int * outlen; /* the length of @out */
8481 unsigned char * in; /* a pointer to an array of UTF-8 chars */
8483 int * inlen; /* the length of @in */
8486 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8487 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8488 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8489 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8490 mem_base = xmlMemBlocks();
8491 out = gen_unsigned_char_ptr(n_out, 0);
8492 outlen = gen_int_ptr(n_outlen, 1);
8493 in = gen_const_unsigned_char_ptr(n_in, 2);
8494 inlen = gen_int_ptr(n_inlen, 3);
8496 ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8497 desret_int(ret_val);
8499 des_unsigned_char_ptr(n_out, out, 0);
8500 des_int_ptr(n_outlen, outlen, 1);
8501 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8502 des_int_ptr(n_inlen, inlen, 3);
8503 xmlResetLastError();
8504 if (mem_base != xmlMemBlocks()) {
8505 printf("Leak of %d blocks found in UTF8Toisolat1",
8506 xmlMemBlocks() - mem_base);
8508 printf(" %d", n_out);
8509 printf(" %d", n_outlen);
8510 printf(" %d", n_in);
8511 printf(" %d", n_inlen);
8527 test_isolat1ToUTF8(void) {
8532 unsigned char * out; /* a pointer to an array of bytes to store the result */
8534 int * outlen; /* the length of @out */
8536 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8538 int * inlen; /* the length of @in */
8541 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8542 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8543 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8544 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8545 mem_base = xmlMemBlocks();
8546 out = gen_unsigned_char_ptr(n_out, 0);
8547 outlen = gen_int_ptr(n_outlen, 1);
8548 in = gen_const_unsigned_char_ptr(n_in, 2);
8549 inlen = gen_int_ptr(n_inlen, 3);
8551 ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8552 desret_int(ret_val);
8554 des_unsigned_char_ptr(n_out, out, 0);
8555 des_int_ptr(n_outlen, outlen, 1);
8556 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8557 des_int_ptr(n_inlen, inlen, 3);
8558 xmlResetLastError();
8559 if (mem_base != xmlMemBlocks()) {
8560 printf("Leak of %d blocks found in isolat1ToUTF8",
8561 xmlMemBlocks() - mem_base);
8563 printf(" %d", n_out);
8564 printf(" %d", n_outlen);
8565 printf(" %d", n_in);
8566 printf(" %d", n_inlen);
8580 test_xmlAddEncodingAlias(void) {
8584 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8586 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8589 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8590 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8591 name = gen_const_char_ptr(n_name, 0);
8592 alias = gen_const_char_ptr(n_alias, 1);
8594 ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8595 desret_int(ret_val);
8597 des_const_char_ptr(n_name, (const char *)name, 0);
8598 des_const_char_ptr(n_alias, (const char *)alias, 1);
8599 xmlResetLastError();
8608 #define gen_nb_xmlCharEncodingHandler_ptr 1
8609 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8612 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8616 test_xmlCharEncCloseFunc(void) {
8621 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8624 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8625 mem_base = xmlMemBlocks();
8626 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8628 ret_val = xmlCharEncCloseFunc(handler);
8629 desret_int(ret_val);
8631 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8632 xmlResetLastError();
8633 if (mem_base != xmlMemBlocks()) {
8634 printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8635 xmlMemBlocks() - mem_base);
8637 printf(" %d", n_handler);
8648 test_xmlCharEncFirstLine(void) {
8653 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8655 xmlBufferPtr out; /* an xmlBuffer for the output. */
8657 xmlBufferPtr in; /* an xmlBuffer for the input */
8660 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8661 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8662 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8663 mem_base = xmlMemBlocks();
8664 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8665 out = gen_xmlBufferPtr(n_out, 1);
8666 in = gen_xmlBufferPtr(n_in, 2);
8668 ret_val = xmlCharEncFirstLine(handler, out, in);
8669 desret_int(ret_val);
8671 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8672 des_xmlBufferPtr(n_out, out, 1);
8673 des_xmlBufferPtr(n_in, in, 2);
8674 xmlResetLastError();
8675 if (mem_base != xmlMemBlocks()) {
8676 printf("Leak of %d blocks found in xmlCharEncFirstLine",
8677 xmlMemBlocks() - mem_base);
8679 printf(" %d", n_handler);
8680 printf(" %d", n_out);
8681 printf(" %d", n_in);
8694 test_xmlCharEncInFunc(void) {
8699 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8701 xmlBufferPtr out; /* an xmlBuffer for the output. */
8703 xmlBufferPtr in; /* an xmlBuffer for the input */
8706 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8707 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8708 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8709 mem_base = xmlMemBlocks();
8710 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8711 out = gen_xmlBufferPtr(n_out, 1);
8712 in = gen_xmlBufferPtr(n_in, 2);
8714 ret_val = xmlCharEncInFunc(handler, out, in);
8715 desret_int(ret_val);
8717 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8718 des_xmlBufferPtr(n_out, out, 1);
8719 des_xmlBufferPtr(n_in, in, 2);
8720 xmlResetLastError();
8721 if (mem_base != xmlMemBlocks()) {
8722 printf("Leak of %d blocks found in xmlCharEncInFunc",
8723 xmlMemBlocks() - mem_base);
8725 printf(" %d", n_handler);
8726 printf(" %d", n_out);
8727 printf(" %d", n_in);
8740 test_xmlCharEncOutFunc(void) {
8745 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8747 xmlBufferPtr out; /* an xmlBuffer for the output. */
8749 xmlBufferPtr in; /* an xmlBuffer for the input */
8752 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8753 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8754 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8755 mem_base = xmlMemBlocks();
8756 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8757 out = gen_xmlBufferPtr(n_out, 1);
8758 in = gen_xmlBufferPtr(n_in, 2);
8760 ret_val = xmlCharEncOutFunc(handler, out, in);
8761 desret_int(ret_val);
8763 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8764 des_xmlBufferPtr(n_out, out, 1);
8765 des_xmlBufferPtr(n_in, in, 2);
8766 xmlResetLastError();
8767 if (mem_base != xmlMemBlocks()) {
8768 printf("Leak of %d blocks found in xmlCharEncOutFunc",
8769 xmlMemBlocks() - mem_base);
8771 printf(" %d", n_handler);
8772 printf(" %d", n_out);
8773 printf(" %d", n_in);
8786 test_xmlCleanupCharEncodingHandlers(void) {
8791 xmlCleanupCharEncodingHandlers();
8793 xmlResetLastError();
8801 test_xmlCleanupEncodingAliases(void) {
8806 mem_base = xmlMemBlocks();
8808 xmlCleanupEncodingAliases();
8810 xmlResetLastError();
8811 if (mem_base != xmlMemBlocks()) {
8812 printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8813 xmlMemBlocks() - mem_base);
8824 test_xmlDelEncodingAlias(void) {
8829 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8832 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8833 mem_base = xmlMemBlocks();
8834 alias = gen_const_char_ptr(n_alias, 0);
8836 ret_val = xmlDelEncodingAlias((const char *)alias);
8837 desret_int(ret_val);
8839 des_const_char_ptr(n_alias, (const char *)alias, 0);
8840 xmlResetLastError();
8841 if (mem_base != xmlMemBlocks()) {
8842 printf("Leak of %d blocks found in xmlDelEncodingAlias",
8843 xmlMemBlocks() - mem_base);
8845 printf(" %d", n_alias);
8856 test_xmlDetectCharEncoding(void) {
8860 xmlCharEncoding ret_val;
8861 unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
8863 int len; /* pointer to the length of the buffer */
8866 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8867 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8868 mem_base = xmlMemBlocks();
8869 in = gen_const_unsigned_char_ptr(n_in, 0);
8870 len = gen_int(n_len, 1);
8872 ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8873 desret_xmlCharEncoding(ret_val);
8875 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8876 des_int(n_len, len, 1);
8877 xmlResetLastError();
8878 if (mem_base != xmlMemBlocks()) {
8879 printf("Leak of %d blocks found in xmlDetectCharEncoding",
8880 xmlMemBlocks() - mem_base);
8882 printf(" %d", n_in);
8883 printf(" %d", n_len);
8895 test_xmlFindCharEncodingHandler(void) {
8899 /* missing type support */
8905 test_xmlGetCharEncodingHandler(void) {
8909 /* missing type support */
8915 test_xmlGetCharEncodingName(void) {
8919 const char * ret_val;
8920 xmlCharEncoding enc; /* the encoding */
8923 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8924 mem_base = xmlMemBlocks();
8925 enc = gen_xmlCharEncoding(n_enc, 0);
8927 ret_val = xmlGetCharEncodingName(enc);
8928 desret_const_char_ptr(ret_val);
8930 des_xmlCharEncoding(n_enc, enc, 0);
8931 xmlResetLastError();
8932 if (mem_base != xmlMemBlocks()) {
8933 printf("Leak of %d blocks found in xmlGetCharEncodingName",
8934 xmlMemBlocks() - mem_base);
8936 printf(" %d", n_enc);
8947 test_xmlGetEncodingAlias(void) {
8951 const char * ret_val;
8952 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8955 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8956 mem_base = xmlMemBlocks();
8957 alias = gen_const_char_ptr(n_alias, 0);
8959 ret_val = xmlGetEncodingAlias((const char *)alias);
8960 desret_const_char_ptr(ret_val);
8962 des_const_char_ptr(n_alias, (const char *)alias, 0);
8963 xmlResetLastError();
8964 if (mem_base != xmlMemBlocks()) {
8965 printf("Leak of %d blocks found in xmlGetEncodingAlias",
8966 xmlMemBlocks() - mem_base);
8968 printf(" %d", n_alias);
8979 test_xmlInitCharEncodingHandlers(void) {
8984 xmlInitCharEncodingHandlers();
8986 xmlResetLastError();
8994 test_xmlNewCharEncodingHandler(void) {
8998 /* missing type support */
9004 test_xmlParseCharEncoding(void) {
9008 xmlCharEncoding ret_val;
9009 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9012 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9013 mem_base = xmlMemBlocks();
9014 name = gen_const_char_ptr(n_name, 0);
9016 ret_val = xmlParseCharEncoding((const char *)name);
9017 desret_xmlCharEncoding(ret_val);
9019 des_const_char_ptr(n_name, (const char *)name, 0);
9020 xmlResetLastError();
9021 if (mem_base != xmlMemBlocks()) {
9022 printf("Leak of %d blocks found in xmlParseCharEncoding",
9023 xmlMemBlocks() - mem_base);
9025 printf(" %d", n_name);
9035 #define gen_nb_xmlCharEncodingHandlerPtr 1
9036 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9039 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9043 test_xmlRegisterCharEncodingHandler(void) {
9047 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9050 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9051 mem_base = xmlMemBlocks();
9052 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9054 xmlRegisterCharEncodingHandler(handler);
9056 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9057 xmlResetLastError();
9058 if (mem_base != xmlMemBlocks()) {
9059 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9060 xmlMemBlocks() - mem_base);
9062 printf(" %d", n_handler);
9072 test_encoding(void) {
9075 if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9076 test_ret += test_UTF8Toisolat1();
9077 test_ret += test_isolat1ToUTF8();
9078 test_ret += test_xmlAddEncodingAlias();
9079 test_ret += test_xmlCharEncCloseFunc();
9080 test_ret += test_xmlCharEncFirstLine();
9081 test_ret += test_xmlCharEncInFunc();
9082 test_ret += test_xmlCharEncOutFunc();
9083 test_ret += test_xmlCleanupCharEncodingHandlers();
9084 test_ret += test_xmlCleanupEncodingAliases();
9085 test_ret += test_xmlDelEncodingAlias();
9086 test_ret += test_xmlDetectCharEncoding();
9087 test_ret += test_xmlFindCharEncodingHandler();
9088 test_ret += test_xmlGetCharEncodingHandler();
9089 test_ret += test_xmlGetCharEncodingName();
9090 test_ret += test_xmlGetEncodingAlias();
9091 test_ret += test_xmlInitCharEncodingHandlers();
9092 test_ret += test_xmlNewCharEncodingHandler();
9093 test_ret += test_xmlParseCharEncoding();
9094 test_ret += test_xmlRegisterCharEncodingHandler();
9097 printf("Module encoding: %d errors\n", test_ret);
9102 test_xmlAddDocEntity(void) {
9106 xmlEntityPtr ret_val;
9107 xmlDocPtr doc; /* the document */
9109 xmlChar * name; /* the entity name */
9111 int type; /* the entity type XML_xxx_yyy_ENTITY */
9113 xmlChar * ExternalID; /* the entity external ID if available */
9115 xmlChar * SystemID; /* the entity system ID if available */
9117 xmlChar * content; /* the entity content */
9120 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9121 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9122 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9123 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9124 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9125 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9126 mem_base = xmlMemBlocks();
9127 doc = gen_xmlDocPtr(n_doc, 0);
9128 name = gen_const_xmlChar_ptr(n_name, 1);
9129 type = gen_int(n_type, 2);
9130 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9131 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9132 content = gen_const_xmlChar_ptr(n_content, 5);
9134 ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9135 desret_xmlEntityPtr(ret_val);
9137 des_xmlDocPtr(n_doc, doc, 0);
9138 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9139 des_int(n_type, type, 2);
9140 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9141 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9142 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9143 xmlResetLastError();
9144 if (mem_base != xmlMemBlocks()) {
9145 printf("Leak of %d blocks found in xmlAddDocEntity",
9146 xmlMemBlocks() - mem_base);
9148 printf(" %d", n_doc);
9149 printf(" %d", n_name);
9150 printf(" %d", n_type);
9151 printf(" %d", n_ExternalID);
9152 printf(" %d", n_SystemID);
9153 printf(" %d", n_content);
9169 test_xmlAddDtdEntity(void) {
9173 xmlEntityPtr ret_val;
9174 xmlDocPtr doc; /* the document */
9176 xmlChar * name; /* the entity name */
9178 int type; /* the entity type XML_xxx_yyy_ENTITY */
9180 xmlChar * ExternalID; /* the entity external ID if available */
9182 xmlChar * SystemID; /* the entity system ID if available */
9184 xmlChar * content; /* the entity content */
9187 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9188 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9189 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9190 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9191 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9192 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9193 mem_base = xmlMemBlocks();
9194 doc = gen_xmlDocPtr(n_doc, 0);
9195 name = gen_const_xmlChar_ptr(n_name, 1);
9196 type = gen_int(n_type, 2);
9197 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9198 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9199 content = gen_const_xmlChar_ptr(n_content, 5);
9201 ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9202 desret_xmlEntityPtr(ret_val);
9204 des_xmlDocPtr(n_doc, doc, 0);
9205 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9206 des_int(n_type, type, 2);
9207 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9208 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9209 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9210 xmlResetLastError();
9211 if (mem_base != xmlMemBlocks()) {
9212 printf("Leak of %d blocks found in xmlAddDtdEntity",
9213 xmlMemBlocks() - mem_base);
9215 printf(" %d", n_doc);
9216 printf(" %d", n_name);
9217 printf(" %d", n_type);
9218 printf(" %d", n_ExternalID);
9219 printf(" %d", n_SystemID);
9220 printf(" %d", n_content);
9236 test_xmlCleanupPredefinedEntities(void) {
9239 #if defined(LIBXML_LEGACY_ENABLED)
9240 #ifdef LIBXML_LEGACY_ENABLED
9243 mem_base = xmlMemBlocks();
9245 xmlCleanupPredefinedEntities();
9247 xmlResetLastError();
9248 if (mem_base != xmlMemBlocks()) {
9249 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9250 xmlMemBlocks() - mem_base);
9262 #define gen_nb_xmlEntitiesTablePtr 1
9263 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9266 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9270 test_xmlCopyEntitiesTable(void) {
9274 /* missing type support */
9280 test_xmlCreateEntitiesTable(void) {
9284 /* missing type support */
9290 test_xmlDumpEntitiesTable(void) {
9293 #if defined(LIBXML_OUTPUT_ENABLED)
9295 xmlBufferPtr buf; /* An XML buffer. */
9297 xmlEntitiesTablePtr table; /* An entity table */
9300 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9301 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9302 mem_base = xmlMemBlocks();
9303 buf = gen_xmlBufferPtr(n_buf, 0);
9304 table = gen_xmlEntitiesTablePtr(n_table, 1);
9306 xmlDumpEntitiesTable(buf, table);
9308 des_xmlBufferPtr(n_buf, buf, 0);
9309 des_xmlEntitiesTablePtr(n_table, table, 1);
9310 xmlResetLastError();
9311 if (mem_base != xmlMemBlocks()) {
9312 printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9313 xmlMemBlocks() - mem_base);
9315 printf(" %d", n_buf);
9316 printf(" %d", n_table);
9328 #define gen_nb_xmlEntityPtr 1
9329 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9332 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9336 test_xmlDumpEntityDecl(void) {
9339 #if defined(LIBXML_OUTPUT_ENABLED)
9341 xmlBufferPtr buf; /* An XML buffer. */
9343 xmlEntityPtr ent; /* An entity table */
9346 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9347 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9348 mem_base = xmlMemBlocks();
9349 buf = gen_xmlBufferPtr(n_buf, 0);
9350 ent = gen_xmlEntityPtr(n_ent, 1);
9352 xmlDumpEntityDecl(buf, ent);
9354 des_xmlBufferPtr(n_buf, buf, 0);
9355 des_xmlEntityPtr(n_ent, ent, 1);
9356 xmlResetLastError();
9357 if (mem_base != xmlMemBlocks()) {
9358 printf("Leak of %d blocks found in xmlDumpEntityDecl",
9359 xmlMemBlocks() - mem_base);
9361 printf(" %d", n_buf);
9362 printf(" %d", n_ent);
9375 test_xmlEncodeEntitiesReentrant(void) {
9380 xmlDocPtr doc; /* the document containing the string */
9382 xmlChar * input; /* A string to convert to XML. */
9385 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9386 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9387 mem_base = xmlMemBlocks();
9388 doc = gen_xmlDocPtr(n_doc, 0);
9389 input = gen_const_xmlChar_ptr(n_input, 1);
9391 ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9392 desret_xmlChar_ptr(ret_val);
9394 des_xmlDocPtr(n_doc, doc, 0);
9395 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9396 xmlResetLastError();
9397 if (mem_base != xmlMemBlocks()) {
9398 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9399 xmlMemBlocks() - mem_base);
9401 printf(" %d", n_doc);
9402 printf(" %d", n_input);
9414 test_xmlEncodeSpecialChars(void) {
9419 xmlDocPtr doc; /* the document containing the string */
9421 xmlChar * input; /* A string to convert to XML. */
9424 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9425 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9426 mem_base = xmlMemBlocks();
9427 doc = gen_xmlDocPtr(n_doc, 0);
9428 input = gen_const_xmlChar_ptr(n_input, 1);
9430 ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9431 desret_xmlChar_ptr(ret_val);
9433 des_xmlDocPtr(n_doc, doc, 0);
9434 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9435 xmlResetLastError();
9436 if (mem_base != xmlMemBlocks()) {
9437 printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9438 xmlMemBlocks() - mem_base);
9440 printf(" %d", n_doc);
9441 printf(" %d", n_input);
9453 test_xmlGetDocEntity(void) {
9457 xmlEntityPtr ret_val;
9458 xmlDocPtr doc; /* the document referencing the entity */
9460 xmlChar * name; /* the entity name */
9463 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9464 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9465 mem_base = xmlMemBlocks();
9466 doc = gen_xmlDocPtr(n_doc, 0);
9467 name = gen_const_xmlChar_ptr(n_name, 1);
9469 ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9470 desret_xmlEntityPtr(ret_val);
9472 des_xmlDocPtr(n_doc, doc, 0);
9473 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9474 xmlResetLastError();
9475 if (mem_base != xmlMemBlocks()) {
9476 printf("Leak of %d blocks found in xmlGetDocEntity",
9477 xmlMemBlocks() - mem_base);
9479 printf(" %d", n_doc);
9480 printf(" %d", n_name);
9492 test_xmlGetDtdEntity(void) {
9496 xmlEntityPtr ret_val;
9497 xmlDocPtr doc; /* the document referencing the entity */
9499 xmlChar * name; /* the entity name */
9502 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9503 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9504 mem_base = xmlMemBlocks();
9505 doc = gen_xmlDocPtr(n_doc, 0);
9506 name = gen_const_xmlChar_ptr(n_name, 1);
9508 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9509 desret_xmlEntityPtr(ret_val);
9511 des_xmlDocPtr(n_doc, doc, 0);
9512 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9513 xmlResetLastError();
9514 if (mem_base != xmlMemBlocks()) {
9515 printf("Leak of %d blocks found in xmlGetDtdEntity",
9516 xmlMemBlocks() - mem_base);
9518 printf(" %d", n_doc);
9519 printf(" %d", n_name);
9531 test_xmlGetParameterEntity(void) {
9535 xmlEntityPtr ret_val;
9536 xmlDocPtr doc; /* the document referencing the entity */
9538 xmlChar * name; /* the entity name */
9541 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9542 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9543 mem_base = xmlMemBlocks();
9544 doc = gen_xmlDocPtr(n_doc, 0);
9545 name = gen_const_xmlChar_ptr(n_name, 1);
9547 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9548 desret_xmlEntityPtr(ret_val);
9550 des_xmlDocPtr(n_doc, doc, 0);
9551 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9552 xmlResetLastError();
9553 if (mem_base != xmlMemBlocks()) {
9554 printf("Leak of %d blocks found in xmlGetParameterEntity",
9555 xmlMemBlocks() - mem_base);
9557 printf(" %d", n_doc);
9558 printf(" %d", n_name);
9570 test_xmlGetPredefinedEntity(void) {
9574 xmlEntityPtr ret_val;
9575 xmlChar * name; /* the entity name */
9578 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9579 mem_base = xmlMemBlocks();
9580 name = gen_const_xmlChar_ptr(n_name, 0);
9582 ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9583 desret_xmlEntityPtr(ret_val);
9585 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9586 xmlResetLastError();
9587 if (mem_base != xmlMemBlocks()) {
9588 printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9589 xmlMemBlocks() - mem_base);
9591 printf(" %d", n_name);
9602 test_xmlInitializePredefinedEntities(void) {
9605 #if defined(LIBXML_LEGACY_ENABLED)
9606 #ifdef LIBXML_LEGACY_ENABLED
9609 mem_base = xmlMemBlocks();
9611 xmlInitializePredefinedEntities();
9613 xmlResetLastError();
9614 if (mem_base != xmlMemBlocks()) {
9615 printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9616 xmlMemBlocks() - mem_base);
9629 test_xmlNewEntity(void) {
9633 xmlEntityPtr ret_val;
9634 xmlDocPtr doc; /* the document */
9636 xmlChar * name; /* the entity name */
9638 int type; /* the entity type XML_xxx_yyy_ENTITY */
9640 xmlChar * ExternalID; /* the entity external ID if available */
9642 xmlChar * SystemID; /* the entity system ID if available */
9644 xmlChar * content; /* the entity content */
9647 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9648 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9649 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9650 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9651 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9652 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9653 mem_base = xmlMemBlocks();
9654 doc = gen_xmlDocPtr(n_doc, 0);
9655 name = gen_const_xmlChar_ptr(n_name, 1);
9656 type = gen_int(n_type, 2);
9657 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9658 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9659 content = gen_const_xmlChar_ptr(n_content, 5);
9661 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9662 desret_xmlEntityPtr(ret_val);
9664 des_xmlDocPtr(n_doc, doc, 0);
9665 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9666 des_int(n_type, type, 2);
9667 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9668 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9669 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9670 xmlResetLastError();
9671 if (mem_base != xmlMemBlocks()) {
9672 printf("Leak of %d blocks found in xmlNewEntity",
9673 xmlMemBlocks() - mem_base);
9675 printf(" %d", n_doc);
9676 printf(" %d", n_name);
9677 printf(" %d", n_type);
9678 printf(" %d", n_ExternalID);
9679 printf(" %d", n_SystemID);
9680 printf(" %d", n_content);
9695 test_entities(void) {
9698 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9699 test_ret += test_xmlAddDocEntity();
9700 test_ret += test_xmlAddDtdEntity();
9701 test_ret += test_xmlCleanupPredefinedEntities();
9702 test_ret += test_xmlCopyEntitiesTable();
9703 test_ret += test_xmlCreateEntitiesTable();
9704 test_ret += test_xmlDumpEntitiesTable();
9705 test_ret += test_xmlDumpEntityDecl();
9706 test_ret += test_xmlEncodeEntitiesReentrant();
9707 test_ret += test_xmlEncodeSpecialChars();
9708 test_ret += test_xmlGetDocEntity();
9709 test_ret += test_xmlGetDtdEntity();
9710 test_ret += test_xmlGetParameterEntity();
9711 test_ret += test_xmlGetPredefinedEntity();
9712 test_ret += test_xmlInitializePredefinedEntities();
9713 test_ret += test_xmlNewEntity();
9716 printf("Module entities: %d errors\n", test_ret);
9721 test_xmlHashAddEntry(void) {
9726 xmlHashTablePtr table; /* the hash table */
9728 xmlChar * name; /* the name of the userdata */
9730 void * userdata; /* a pointer to the userdata */
9733 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9734 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9735 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9736 mem_base = xmlMemBlocks();
9737 table = gen_xmlHashTablePtr(n_table, 0);
9738 name = gen_const_xmlChar_ptr(n_name, 1);
9739 userdata = gen_userdata(n_userdata, 2);
9741 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9742 desret_int(ret_val);
9744 des_xmlHashTablePtr(n_table, table, 0);
9745 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9746 des_userdata(n_userdata, userdata, 2);
9747 xmlResetLastError();
9748 if (mem_base != xmlMemBlocks()) {
9749 printf("Leak of %d blocks found in xmlHashAddEntry",
9750 xmlMemBlocks() - mem_base);
9752 printf(" %d", n_table);
9753 printf(" %d", n_name);
9754 printf(" %d", n_userdata);
9767 test_xmlHashAddEntry2(void) {
9772 xmlHashTablePtr table; /* the hash table */
9774 xmlChar * name; /* the name of the userdata */
9776 xmlChar * name2; /* a second name of the userdata */
9778 void * userdata; /* a pointer to the userdata */
9781 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9782 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9783 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9784 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9785 mem_base = xmlMemBlocks();
9786 table = gen_xmlHashTablePtr(n_table, 0);
9787 name = gen_const_xmlChar_ptr(n_name, 1);
9788 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9789 userdata = gen_userdata(n_userdata, 3);
9791 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9792 desret_int(ret_val);
9794 des_xmlHashTablePtr(n_table, table, 0);
9795 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9796 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9797 des_userdata(n_userdata, userdata, 3);
9798 xmlResetLastError();
9799 if (mem_base != xmlMemBlocks()) {
9800 printf("Leak of %d blocks found in xmlHashAddEntry2",
9801 xmlMemBlocks() - mem_base);
9803 printf(" %d", n_table);
9804 printf(" %d", n_name);
9805 printf(" %d", n_name2);
9806 printf(" %d", n_userdata);
9820 test_xmlHashAddEntry3(void) {
9825 xmlHashTablePtr table; /* the hash table */
9827 xmlChar * name; /* the name of the userdata */
9829 xmlChar * name2; /* a second name of the userdata */
9831 xmlChar * name3; /* a third name of the userdata */
9833 void * userdata; /* a pointer to the userdata */
9836 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9837 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9838 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9839 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9840 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9841 mem_base = xmlMemBlocks();
9842 table = gen_xmlHashTablePtr(n_table, 0);
9843 name = gen_const_xmlChar_ptr(n_name, 1);
9844 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9845 name3 = gen_const_xmlChar_ptr(n_name3, 3);
9846 userdata = gen_userdata(n_userdata, 4);
9848 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9849 desret_int(ret_val);
9851 des_xmlHashTablePtr(n_table, table, 0);
9852 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9853 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9854 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9855 des_userdata(n_userdata, userdata, 4);
9856 xmlResetLastError();
9857 if (mem_base != xmlMemBlocks()) {
9858 printf("Leak of %d blocks found in xmlHashAddEntry3",
9859 xmlMemBlocks() - mem_base);
9861 printf(" %d", n_table);
9862 printf(" %d", n_name);
9863 printf(" %d", n_name2);
9864 printf(" %d", n_name3);
9865 printf(" %d", n_userdata);
9880 test_xmlHashCopy(void) {
9884 /* missing type support */
9890 test_xmlHashCreate(void) {
9894 /* missing type support */
9900 test_xmlHashCreateDict(void) {
9904 /* missing type support */
9910 test_xmlHashLookup(void) {
9915 xmlHashTablePtr table; /* the hash table */
9917 xmlChar * name; /* the name of the userdata */
9920 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9921 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9922 mem_base = xmlMemBlocks();
9923 table = gen_xmlHashTablePtr(n_table, 0);
9924 name = gen_const_xmlChar_ptr(n_name, 1);
9926 ret_val = xmlHashLookup(table, (const xmlChar *)name);
9927 desret_void_ptr(ret_val);
9929 des_xmlHashTablePtr(n_table, table, 0);
9930 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9931 xmlResetLastError();
9932 if (mem_base != xmlMemBlocks()) {
9933 printf("Leak of %d blocks found in xmlHashLookup",
9934 xmlMemBlocks() - mem_base);
9936 printf(" %d", n_table);
9937 printf(" %d", n_name);
9949 test_xmlHashLookup2(void) {
9954 xmlHashTablePtr table; /* the hash table */
9956 xmlChar * name; /* the name of the userdata */
9958 xmlChar * name2; /* a second name of the userdata */
9961 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9962 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9963 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9964 mem_base = xmlMemBlocks();
9965 table = gen_xmlHashTablePtr(n_table, 0);
9966 name = gen_const_xmlChar_ptr(n_name, 1);
9967 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9969 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9970 desret_void_ptr(ret_val);
9972 des_xmlHashTablePtr(n_table, table, 0);
9973 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9974 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9975 xmlResetLastError();
9976 if (mem_base != xmlMemBlocks()) {
9977 printf("Leak of %d blocks found in xmlHashLookup2",
9978 xmlMemBlocks() - mem_base);
9980 printf(" %d", n_table);
9981 printf(" %d", n_name);
9982 printf(" %d", n_name2);
9995 test_xmlHashLookup3(void) {
10000 xmlHashTablePtr table; /* the hash table */
10002 xmlChar * name; /* the name of the userdata */
10004 xmlChar * name2; /* a second name of the userdata */
10006 xmlChar * name3; /* a third name of the userdata */
10009 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10010 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10011 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10012 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10013 mem_base = xmlMemBlocks();
10014 table = gen_xmlHashTablePtr(n_table, 0);
10015 name = gen_const_xmlChar_ptr(n_name, 1);
10016 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10017 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10019 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10020 desret_void_ptr(ret_val);
10022 des_xmlHashTablePtr(n_table, table, 0);
10023 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10024 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10025 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10026 xmlResetLastError();
10027 if (mem_base != xmlMemBlocks()) {
10028 printf("Leak of %d blocks found in xmlHashLookup3",
10029 xmlMemBlocks() - mem_base);
10031 printf(" %d", n_table);
10032 printf(" %d", n_name);
10033 printf(" %d", n_name2);
10034 printf(" %d", n_name3);
10048 test_xmlHashQLookup(void) {
10053 xmlHashTablePtr table; /* the hash table */
10055 xmlChar * prefix; /* the prefix of the userdata */
10057 xmlChar * name; /* the name of the userdata */
10060 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10061 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10062 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10063 mem_base = xmlMemBlocks();
10064 table = gen_xmlHashTablePtr(n_table, 0);
10065 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10066 name = gen_const_xmlChar_ptr(n_name, 2);
10068 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10069 desret_void_ptr(ret_val);
10071 des_xmlHashTablePtr(n_table, table, 0);
10072 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10073 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10074 xmlResetLastError();
10075 if (mem_base != xmlMemBlocks()) {
10076 printf("Leak of %d blocks found in xmlHashQLookup",
10077 xmlMemBlocks() - mem_base);
10079 printf(" %d", n_table);
10080 printf(" %d", n_prefix);
10081 printf(" %d", n_name);
10094 test_xmlHashQLookup2(void) {
10099 xmlHashTablePtr table; /* the hash table */
10101 xmlChar * prefix; /* the prefix of the userdata */
10103 xmlChar * name; /* the name of the userdata */
10105 xmlChar * prefix2; /* the second prefix of the userdata */
10107 xmlChar * name2; /* a second name of the userdata */
10110 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10111 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10112 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10113 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10114 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10115 mem_base = xmlMemBlocks();
10116 table = gen_xmlHashTablePtr(n_table, 0);
10117 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10118 name = gen_const_xmlChar_ptr(n_name, 2);
10119 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10120 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10122 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10123 desret_void_ptr(ret_val);
10125 des_xmlHashTablePtr(n_table, table, 0);
10126 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10127 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10128 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10129 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10130 xmlResetLastError();
10131 if (mem_base != xmlMemBlocks()) {
10132 printf("Leak of %d blocks found in xmlHashQLookup2",
10133 xmlMemBlocks() - mem_base);
10135 printf(" %d", n_table);
10136 printf(" %d", n_prefix);
10137 printf(" %d", n_name);
10138 printf(" %d", n_prefix2);
10139 printf(" %d", n_name2);
10154 test_xmlHashQLookup3(void) {
10159 xmlHashTablePtr table; /* the hash table */
10161 xmlChar * prefix; /* the prefix of the userdata */
10163 xmlChar * name; /* the name of the userdata */
10165 xmlChar * prefix2; /* the second prefix of the userdata */
10167 xmlChar * name2; /* a second name of the userdata */
10169 xmlChar * prefix3; /* the third prefix of the userdata */
10171 xmlChar * name3; /* a third name of the userdata */
10174 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10175 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10177 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10178 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10179 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10180 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10181 mem_base = xmlMemBlocks();
10182 table = gen_xmlHashTablePtr(n_table, 0);
10183 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10184 name = gen_const_xmlChar_ptr(n_name, 2);
10185 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10186 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10187 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10188 name3 = gen_const_xmlChar_ptr(n_name3, 6);
10190 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10191 desret_void_ptr(ret_val);
10193 des_xmlHashTablePtr(n_table, table, 0);
10194 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10195 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10196 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10197 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10198 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10199 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10200 xmlResetLastError();
10201 if (mem_base != xmlMemBlocks()) {
10202 printf("Leak of %d blocks found in xmlHashQLookup3",
10203 xmlMemBlocks() - mem_base);
10205 printf(" %d", n_table);
10206 printf(" %d", n_prefix);
10207 printf(" %d", n_name);
10208 printf(" %d", n_prefix2);
10209 printf(" %d", n_name2);
10210 printf(" %d", n_prefix3);
10211 printf(" %d", n_name3);
10228 test_xmlHashRemoveEntry(void) {
10233 xmlHashTablePtr table; /* the hash table */
10235 xmlChar * name; /* the name of the userdata */
10237 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10240 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10241 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10242 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10243 mem_base = xmlMemBlocks();
10244 table = gen_xmlHashTablePtr(n_table, 0);
10245 name = gen_const_xmlChar_ptr(n_name, 1);
10246 f = gen_xmlHashDeallocator(n_f, 2);
10248 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10249 desret_int(ret_val);
10251 des_xmlHashTablePtr(n_table, table, 0);
10252 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10253 des_xmlHashDeallocator(n_f, f, 2);
10254 xmlResetLastError();
10255 if (mem_base != xmlMemBlocks()) {
10256 printf("Leak of %d blocks found in xmlHashRemoveEntry",
10257 xmlMemBlocks() - mem_base);
10259 printf(" %d", n_table);
10260 printf(" %d", n_name);
10261 printf(" %d", n_f);
10274 test_xmlHashRemoveEntry2(void) {
10279 xmlHashTablePtr table; /* the hash table */
10281 xmlChar * name; /* the name of the userdata */
10283 xmlChar * name2; /* a second name of the userdata */
10285 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10288 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10289 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10290 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10291 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10292 mem_base = xmlMemBlocks();
10293 table = gen_xmlHashTablePtr(n_table, 0);
10294 name = gen_const_xmlChar_ptr(n_name, 1);
10295 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10296 f = gen_xmlHashDeallocator(n_f, 3);
10298 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10299 desret_int(ret_val);
10301 des_xmlHashTablePtr(n_table, table, 0);
10302 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10303 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10304 des_xmlHashDeallocator(n_f, f, 3);
10305 xmlResetLastError();
10306 if (mem_base != xmlMemBlocks()) {
10307 printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10308 xmlMemBlocks() - mem_base);
10310 printf(" %d", n_table);
10311 printf(" %d", n_name);
10312 printf(" %d", n_name2);
10313 printf(" %d", n_f);
10327 test_xmlHashRemoveEntry3(void) {
10332 xmlHashTablePtr table; /* the hash table */
10334 xmlChar * name; /* the name of the userdata */
10336 xmlChar * name2; /* a second name of the userdata */
10338 xmlChar * name3; /* a third name of the userdata */
10340 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10343 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10344 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10345 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10346 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10347 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10348 mem_base = xmlMemBlocks();
10349 table = gen_xmlHashTablePtr(n_table, 0);
10350 name = gen_const_xmlChar_ptr(n_name, 1);
10351 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10352 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10353 f = gen_xmlHashDeallocator(n_f, 4);
10355 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10356 desret_int(ret_val);
10358 des_xmlHashTablePtr(n_table, table, 0);
10359 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10360 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10361 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10362 des_xmlHashDeallocator(n_f, f, 4);
10363 xmlResetLastError();
10364 if (mem_base != xmlMemBlocks()) {
10365 printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10366 xmlMemBlocks() - mem_base);
10368 printf(" %d", n_table);
10369 printf(" %d", n_name);
10370 printf(" %d", n_name2);
10371 printf(" %d", n_name3);
10372 printf(" %d", n_f);
10387 test_xmlHashScan(void) {
10391 /* missing type support */
10397 test_xmlHashScan3(void) {
10401 /* missing type support */
10407 test_xmlHashScanFull(void) {
10411 /* missing type support */
10417 test_xmlHashScanFull3(void) {
10421 /* missing type support */
10427 test_xmlHashSize(void) {
10432 xmlHashTablePtr table; /* the hash table */
10435 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10436 mem_base = xmlMemBlocks();
10437 table = gen_xmlHashTablePtr(n_table, 0);
10439 ret_val = xmlHashSize(table);
10440 desret_int(ret_val);
10442 des_xmlHashTablePtr(n_table, table, 0);
10443 xmlResetLastError();
10444 if (mem_base != xmlMemBlocks()) {
10445 printf("Leak of %d blocks found in xmlHashSize",
10446 xmlMemBlocks() - mem_base);
10448 printf(" %d", n_table);
10459 test_xmlHashUpdateEntry(void) {
10464 xmlHashTablePtr table; /* the hash table */
10466 xmlChar * name; /* the name of the userdata */
10468 void * userdata; /* a pointer to the userdata */
10470 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10473 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10474 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10475 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10476 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10477 mem_base = xmlMemBlocks();
10478 table = gen_xmlHashTablePtr(n_table, 0);
10479 name = gen_const_xmlChar_ptr(n_name, 1);
10480 userdata = gen_userdata(n_userdata, 2);
10481 f = gen_xmlHashDeallocator(n_f, 3);
10483 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10484 desret_int(ret_val);
10486 des_xmlHashTablePtr(n_table, table, 0);
10487 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10488 des_userdata(n_userdata, userdata, 2);
10489 des_xmlHashDeallocator(n_f, f, 3);
10490 xmlResetLastError();
10491 if (mem_base != xmlMemBlocks()) {
10492 printf("Leak of %d blocks found in xmlHashUpdateEntry",
10493 xmlMemBlocks() - mem_base);
10495 printf(" %d", n_table);
10496 printf(" %d", n_name);
10497 printf(" %d", n_userdata);
10498 printf(" %d", n_f);
10512 test_xmlHashUpdateEntry2(void) {
10517 xmlHashTablePtr table; /* the hash table */
10519 xmlChar * name; /* the name of the userdata */
10521 xmlChar * name2; /* a second name of the userdata */
10523 void * userdata; /* a pointer to the userdata */
10525 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10528 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10529 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10530 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10531 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10532 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10533 mem_base = xmlMemBlocks();
10534 table = gen_xmlHashTablePtr(n_table, 0);
10535 name = gen_const_xmlChar_ptr(n_name, 1);
10536 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10537 userdata = gen_userdata(n_userdata, 3);
10538 f = gen_xmlHashDeallocator(n_f, 4);
10540 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10541 desret_int(ret_val);
10543 des_xmlHashTablePtr(n_table, table, 0);
10544 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10545 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10546 des_userdata(n_userdata, userdata, 3);
10547 des_xmlHashDeallocator(n_f, f, 4);
10548 xmlResetLastError();
10549 if (mem_base != xmlMemBlocks()) {
10550 printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10551 xmlMemBlocks() - mem_base);
10553 printf(" %d", n_table);
10554 printf(" %d", n_name);
10555 printf(" %d", n_name2);
10556 printf(" %d", n_userdata);
10557 printf(" %d", n_f);
10572 test_xmlHashUpdateEntry3(void) {
10577 xmlHashTablePtr table; /* the hash table */
10579 xmlChar * name; /* the name of the userdata */
10581 xmlChar * name2; /* a second name of the userdata */
10583 xmlChar * name3; /* a third name of the userdata */
10585 void * userdata; /* a pointer to the userdata */
10587 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10590 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10591 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10592 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10593 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10594 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10595 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10596 mem_base = xmlMemBlocks();
10597 table = gen_xmlHashTablePtr(n_table, 0);
10598 name = gen_const_xmlChar_ptr(n_name, 1);
10599 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10600 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10601 userdata = gen_userdata(n_userdata, 4);
10602 f = gen_xmlHashDeallocator(n_f, 5);
10604 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10605 desret_int(ret_val);
10607 des_xmlHashTablePtr(n_table, table, 0);
10608 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10609 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10610 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10611 des_userdata(n_userdata, userdata, 4);
10612 des_xmlHashDeallocator(n_f, f, 5);
10613 xmlResetLastError();
10614 if (mem_base != xmlMemBlocks()) {
10615 printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10616 xmlMemBlocks() - mem_base);
10618 printf(" %d", n_table);
10619 printf(" %d", n_name);
10620 printf(" %d", n_name2);
10621 printf(" %d", n_name3);
10622 printf(" %d", n_userdata);
10623 printf(" %d", n_f);
10641 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10642 test_ret += test_xmlHashAddEntry();
10643 test_ret += test_xmlHashAddEntry2();
10644 test_ret += test_xmlHashAddEntry3();
10645 test_ret += test_xmlHashCopy();
10646 test_ret += test_xmlHashCreate();
10647 test_ret += test_xmlHashCreateDict();
10648 test_ret += test_xmlHashLookup();
10649 test_ret += test_xmlHashLookup2();
10650 test_ret += test_xmlHashLookup3();
10651 test_ret += test_xmlHashQLookup();
10652 test_ret += test_xmlHashQLookup2();
10653 test_ret += test_xmlHashQLookup3();
10654 test_ret += test_xmlHashRemoveEntry();
10655 test_ret += test_xmlHashRemoveEntry2();
10656 test_ret += test_xmlHashRemoveEntry3();
10657 test_ret += test_xmlHashScan();
10658 test_ret += test_xmlHashScan3();
10659 test_ret += test_xmlHashScanFull();
10660 test_ret += test_xmlHashScanFull3();
10661 test_ret += test_xmlHashSize();
10662 test_ret += test_xmlHashUpdateEntry();
10663 test_ret += test_xmlHashUpdateEntry2();
10664 test_ret += test_xmlHashUpdateEntry3();
10667 printf("Module hash: %d errors\n", test_ret);
10671 #define gen_nb_xmlLinkPtr 1
10672 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10675 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10679 test_xmlLinkGetData(void) {
10684 xmlLinkPtr lk; /* a link */
10687 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10688 mem_base = xmlMemBlocks();
10689 lk = gen_xmlLinkPtr(n_lk, 0);
10691 ret_val = xmlLinkGetData(lk);
10692 desret_void_ptr(ret_val);
10694 des_xmlLinkPtr(n_lk, lk, 0);
10695 xmlResetLastError();
10696 if (mem_base != xmlMemBlocks()) {
10697 printf("Leak of %d blocks found in xmlLinkGetData",
10698 xmlMemBlocks() - mem_base);
10700 printf(" %d", n_lk);
10711 test_xmlListAppend(void) {
10716 xmlListPtr l; /* a list */
10718 void * data; /* the data */
10721 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10722 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10723 mem_base = xmlMemBlocks();
10724 l = gen_xmlListPtr(n_l, 0);
10725 data = gen_userdata(n_data, 1);
10727 ret_val = xmlListAppend(l, data);
10728 desret_int(ret_val);
10730 des_xmlListPtr(n_l, l, 0);
10731 des_userdata(n_data, data, 1);
10732 xmlResetLastError();
10733 if (mem_base != xmlMemBlocks()) {
10734 printf("Leak of %d blocks found in xmlListAppend",
10735 xmlMemBlocks() - mem_base);
10737 printf(" %d", n_l);
10738 printf(" %d", n_data);
10750 test_xmlListClear(void) {
10754 xmlListPtr l; /* a list */
10757 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10758 mem_base = xmlMemBlocks();
10759 l = gen_xmlListPtr(n_l, 0);
10763 des_xmlListPtr(n_l, l, 0);
10764 xmlResetLastError();
10765 if (mem_base != xmlMemBlocks()) {
10766 printf("Leak of %d blocks found in xmlListClear",
10767 xmlMemBlocks() - mem_base);
10769 printf(" %d", n_l);
10779 #define gen_nb_const_xmlListPtr 1
10780 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10783 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10787 test_xmlListCopy(void) {
10792 xmlListPtr cur; /* the new list */
10794 xmlListPtr old; /* the old list */
10797 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10798 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10799 mem_base = xmlMemBlocks();
10800 cur = gen_xmlListPtr(n_cur, 0);
10801 old = gen_const_xmlListPtr(n_old, 1);
10803 ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10804 desret_int(ret_val);
10806 des_xmlListPtr(n_cur, cur, 0);
10807 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10808 xmlResetLastError();
10809 if (mem_base != xmlMemBlocks()) {
10810 printf("Leak of %d blocks found in xmlListCopy",
10811 xmlMemBlocks() - mem_base);
10813 printf(" %d", n_cur);
10814 printf(" %d", n_old);
10826 test_xmlListCreate(void) {
10830 /* missing type support */
10836 test_xmlListDup(void) {
10840 /* missing type support */
10846 test_xmlListEmpty(void) {
10851 xmlListPtr l; /* a list */
10854 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10855 mem_base = xmlMemBlocks();
10856 l = gen_xmlListPtr(n_l, 0);
10858 ret_val = xmlListEmpty(l);
10859 desret_int(ret_val);
10861 des_xmlListPtr(n_l, l, 0);
10862 xmlResetLastError();
10863 if (mem_base != xmlMemBlocks()) {
10864 printf("Leak of %d blocks found in xmlListEmpty",
10865 xmlMemBlocks() - mem_base);
10867 printf(" %d", n_l);
10878 test_xmlListEnd(void) {
10882 /* missing type support */
10888 test_xmlListFront(void) {
10892 /* missing type support */
10898 test_xmlListInsert(void) {
10903 xmlListPtr l; /* a list */
10905 void * data; /* the data */
10908 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10909 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10910 mem_base = xmlMemBlocks();
10911 l = gen_xmlListPtr(n_l, 0);
10912 data = gen_userdata(n_data, 1);
10914 ret_val = xmlListInsert(l, data);
10915 desret_int(ret_val);
10917 des_xmlListPtr(n_l, l, 0);
10918 des_userdata(n_data, data, 1);
10919 xmlResetLastError();
10920 if (mem_base != xmlMemBlocks()) {
10921 printf("Leak of %d blocks found in xmlListInsert",
10922 xmlMemBlocks() - mem_base);
10924 printf(" %d", n_l);
10925 printf(" %d", n_data);
10937 test_xmlListMerge(void) {
10941 xmlListPtr l1; /* the original list */
10943 xmlListPtr l2; /* the new list */
10946 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10947 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10948 mem_base = xmlMemBlocks();
10949 l1 = gen_xmlListPtr(n_l1, 0);
10950 l2 = gen_xmlListPtr(n_l2, 1);
10952 xmlListMerge(l1, l2);
10954 des_xmlListPtr(n_l1, l1, 0);
10955 des_xmlListPtr(n_l2, l2, 1);
10956 xmlResetLastError();
10957 if (mem_base != xmlMemBlocks()) {
10958 printf("Leak of %d blocks found in xmlListMerge",
10959 xmlMemBlocks() - mem_base);
10961 printf(" %d", n_l1);
10962 printf(" %d", n_l2);
10974 test_xmlListPopBack(void) {
10978 xmlListPtr l; /* a list */
10981 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10982 mem_base = xmlMemBlocks();
10983 l = gen_xmlListPtr(n_l, 0);
10987 des_xmlListPtr(n_l, l, 0);
10988 xmlResetLastError();
10989 if (mem_base != xmlMemBlocks()) {
10990 printf("Leak of %d blocks found in xmlListPopBack",
10991 xmlMemBlocks() - mem_base);
10993 printf(" %d", n_l);
11004 test_xmlListPopFront(void) {
11008 xmlListPtr l; /* a list */
11011 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11012 mem_base = xmlMemBlocks();
11013 l = gen_xmlListPtr(n_l, 0);
11015 xmlListPopFront(l);
11017 des_xmlListPtr(n_l, l, 0);
11018 xmlResetLastError();
11019 if (mem_base != xmlMemBlocks()) {
11020 printf("Leak of %d blocks found in xmlListPopFront",
11021 xmlMemBlocks() - mem_base);
11023 printf(" %d", n_l);
11034 test_xmlListPushBack(void) {
11039 xmlListPtr l; /* a list */
11041 void * data; /* new data */
11044 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11045 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11046 mem_base = xmlMemBlocks();
11047 l = gen_xmlListPtr(n_l, 0);
11048 data = gen_userdata(n_data, 1);
11050 ret_val = xmlListPushBack(l, data);
11051 desret_int(ret_val);
11053 des_xmlListPtr(n_l, l, 0);
11054 des_userdata(n_data, data, 1);
11055 xmlResetLastError();
11056 if (mem_base != xmlMemBlocks()) {
11057 printf("Leak of %d blocks found in xmlListPushBack",
11058 xmlMemBlocks() - mem_base);
11060 printf(" %d", n_l);
11061 printf(" %d", n_data);
11073 test_xmlListPushFront(void) {
11078 xmlListPtr l; /* a list */
11080 void * data; /* new data */
11083 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11084 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11085 mem_base = xmlMemBlocks();
11086 l = gen_xmlListPtr(n_l, 0);
11087 data = gen_userdata(n_data, 1);
11089 ret_val = xmlListPushFront(l, data);
11090 desret_int(ret_val);
11092 des_xmlListPtr(n_l, l, 0);
11093 des_userdata(n_data, data, 1);
11094 xmlResetLastError();
11095 if (mem_base != xmlMemBlocks()) {
11096 printf("Leak of %d blocks found in xmlListPushFront",
11097 xmlMemBlocks() - mem_base);
11099 printf(" %d", n_l);
11100 printf(" %d", n_data);
11112 test_xmlListRemoveAll(void) {
11117 xmlListPtr l; /* a list */
11119 void * data; /* list data */
11122 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11123 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11124 mem_base = xmlMemBlocks();
11125 l = gen_xmlListPtr(n_l, 0);
11126 data = gen_userdata(n_data, 1);
11128 ret_val = xmlListRemoveAll(l, data);
11129 desret_int(ret_val);
11131 des_xmlListPtr(n_l, l, 0);
11132 des_userdata(n_data, data, 1);
11133 xmlResetLastError();
11134 if (mem_base != xmlMemBlocks()) {
11135 printf("Leak of %d blocks found in xmlListRemoveAll",
11136 xmlMemBlocks() - mem_base);
11138 printf(" %d", n_l);
11139 printf(" %d", n_data);
11151 test_xmlListRemoveFirst(void) {
11156 xmlListPtr l; /* a list */
11158 void * data; /* list data */
11161 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11162 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11163 mem_base = xmlMemBlocks();
11164 l = gen_xmlListPtr(n_l, 0);
11165 data = gen_userdata(n_data, 1);
11167 ret_val = xmlListRemoveFirst(l, data);
11168 desret_int(ret_val);
11170 des_xmlListPtr(n_l, l, 0);
11171 des_userdata(n_data, data, 1);
11172 xmlResetLastError();
11173 if (mem_base != xmlMemBlocks()) {
11174 printf("Leak of %d blocks found in xmlListRemoveFirst",
11175 xmlMemBlocks() - mem_base);
11177 printf(" %d", n_l);
11178 printf(" %d", n_data);
11190 test_xmlListRemoveLast(void) {
11195 xmlListPtr l; /* a list */
11197 void * data; /* list data */
11200 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11201 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11202 mem_base = xmlMemBlocks();
11203 l = gen_xmlListPtr(n_l, 0);
11204 data = gen_userdata(n_data, 1);
11206 ret_val = xmlListRemoveLast(l, data);
11207 desret_int(ret_val);
11209 des_xmlListPtr(n_l, l, 0);
11210 des_userdata(n_data, data, 1);
11211 xmlResetLastError();
11212 if (mem_base != xmlMemBlocks()) {
11213 printf("Leak of %d blocks found in xmlListRemoveLast",
11214 xmlMemBlocks() - mem_base);
11216 printf(" %d", n_l);
11217 printf(" %d", n_data);
11229 test_xmlListReverse(void) {
11233 xmlListPtr l; /* a list */
11236 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11237 mem_base = xmlMemBlocks();
11238 l = gen_xmlListPtr(n_l, 0);
11242 des_xmlListPtr(n_l, l, 0);
11243 xmlResetLastError();
11244 if (mem_base != xmlMemBlocks()) {
11245 printf("Leak of %d blocks found in xmlListReverse",
11246 xmlMemBlocks() - mem_base);
11248 printf(" %d", n_l);
11259 test_xmlListReverseSearch(void) {
11264 xmlListPtr l; /* a list */
11266 void * data; /* a search value */
11269 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11270 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11271 mem_base = xmlMemBlocks();
11272 l = gen_xmlListPtr(n_l, 0);
11273 data = gen_userdata(n_data, 1);
11275 ret_val = xmlListReverseSearch(l, data);
11276 desret_void_ptr(ret_val);
11278 des_xmlListPtr(n_l, l, 0);
11279 des_userdata(n_data, data, 1);
11280 xmlResetLastError();
11281 if (mem_base != xmlMemBlocks()) {
11282 printf("Leak of %d blocks found in xmlListReverseSearch",
11283 xmlMemBlocks() - mem_base);
11285 printf(" %d", n_l);
11286 printf(" %d", n_data);
11298 test_xmlListReverseWalk(void) {
11302 /* missing type support */
11308 test_xmlListSearch(void) {
11313 xmlListPtr l; /* a list */
11315 void * data; /* a search value */
11318 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11319 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11320 mem_base = xmlMemBlocks();
11321 l = gen_xmlListPtr(n_l, 0);
11322 data = gen_userdata(n_data, 1);
11324 ret_val = xmlListSearch(l, data);
11325 desret_void_ptr(ret_val);
11327 des_xmlListPtr(n_l, l, 0);
11328 des_userdata(n_data, data, 1);
11329 xmlResetLastError();
11330 if (mem_base != xmlMemBlocks()) {
11331 printf("Leak of %d blocks found in xmlListSearch",
11332 xmlMemBlocks() - mem_base);
11334 printf(" %d", n_l);
11335 printf(" %d", n_data);
11347 test_xmlListSize(void) {
11352 xmlListPtr l; /* a list */
11355 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11356 mem_base = xmlMemBlocks();
11357 l = gen_xmlListPtr(n_l, 0);
11359 ret_val = xmlListSize(l);
11360 desret_int(ret_val);
11362 des_xmlListPtr(n_l, l, 0);
11363 xmlResetLastError();
11364 if (mem_base != xmlMemBlocks()) {
11365 printf("Leak of %d blocks found in xmlListSize",
11366 xmlMemBlocks() - mem_base);
11368 printf(" %d", n_l);
11379 test_xmlListSort(void) {
11383 xmlListPtr l; /* a list */
11386 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11387 mem_base = xmlMemBlocks();
11388 l = gen_xmlListPtr(n_l, 0);
11392 des_xmlListPtr(n_l, l, 0);
11393 xmlResetLastError();
11394 if (mem_base != xmlMemBlocks()) {
11395 printf("Leak of %d blocks found in xmlListSort",
11396 xmlMemBlocks() - mem_base);
11398 printf(" %d", n_l);
11409 test_xmlListWalk(void) {
11413 /* missing type support */
11421 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11422 test_ret += test_xmlLinkGetData();
11423 test_ret += test_xmlListAppend();
11424 test_ret += test_xmlListClear();
11425 test_ret += test_xmlListCopy();
11426 test_ret += test_xmlListCreate();
11427 test_ret += test_xmlListDup();
11428 test_ret += test_xmlListEmpty();
11429 test_ret += test_xmlListEnd();
11430 test_ret += test_xmlListFront();
11431 test_ret += test_xmlListInsert();
11432 test_ret += test_xmlListMerge();
11433 test_ret += test_xmlListPopBack();
11434 test_ret += test_xmlListPopFront();
11435 test_ret += test_xmlListPushBack();
11436 test_ret += test_xmlListPushFront();
11437 test_ret += test_xmlListRemoveAll();
11438 test_ret += test_xmlListRemoveFirst();
11439 test_ret += test_xmlListRemoveLast();
11440 test_ret += test_xmlListReverse();
11441 test_ret += test_xmlListReverseSearch();
11442 test_ret += test_xmlListReverseWalk();
11443 test_ret += test_xmlListSearch();
11444 test_ret += test_xmlListSize();
11445 test_ret += test_xmlListSort();
11446 test_ret += test_xmlListWalk();
11449 printf("Module list: %d errors\n", test_ret);
11454 test_xmlNanoFTPCheckResponse(void) {
11457 #if defined(LIBXML_FTP_ENABLED)
11460 void * ctx; /* an FTP context */
11463 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11464 mem_base = xmlMemBlocks();
11465 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11467 ret_val = xmlNanoFTPCheckResponse(ctx);
11468 desret_int(ret_val);
11470 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11471 xmlResetLastError();
11472 if (mem_base != xmlMemBlocks()) {
11473 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11474 xmlMemBlocks() - mem_base);
11476 printf(" %d", n_ctx);
11488 test_xmlNanoFTPCleanup(void) {
11491 #if defined(LIBXML_FTP_ENABLED)
11494 mem_base = xmlMemBlocks();
11496 xmlNanoFTPCleanup();
11498 xmlResetLastError();
11499 if (mem_base != xmlMemBlocks()) {
11500 printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11501 xmlMemBlocks() - mem_base);
11513 test_xmlNanoFTPCloseConnection(void) {
11516 #if defined(LIBXML_FTP_ENABLED)
11519 void * ctx; /* an FTP context */
11522 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11523 mem_base = xmlMemBlocks();
11524 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11526 ret_val = xmlNanoFTPCloseConnection(ctx);
11527 desret_int(ret_val);
11529 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11530 xmlResetLastError();
11531 if (mem_base != xmlMemBlocks()) {
11532 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11533 xmlMemBlocks() - mem_base);
11535 printf(" %d", n_ctx);
11547 test_xmlNanoFTPCwd(void) {
11550 #if defined(LIBXML_FTP_ENABLED)
11553 void * ctx; /* an FTP context */
11555 char * directory; /* a directory on the server */
11558 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11559 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11560 mem_base = xmlMemBlocks();
11561 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11562 directory = gen_const_char_ptr(n_directory, 1);
11564 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11565 desret_int(ret_val);
11567 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11568 des_const_char_ptr(n_directory, (const char *)directory, 1);
11569 xmlResetLastError();
11570 if (mem_base != xmlMemBlocks()) {
11571 printf("Leak of %d blocks found in xmlNanoFTPCwd",
11572 xmlMemBlocks() - mem_base);
11574 printf(" %d", n_ctx);
11575 printf(" %d", n_directory);
11588 test_xmlNanoFTPDele(void) {
11591 #if defined(LIBXML_FTP_ENABLED)
11594 void * ctx; /* an FTP context */
11596 const char * file; /* a file or directory on the server */
11599 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11600 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11601 mem_base = xmlMemBlocks();
11602 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11603 file = gen_filepath(n_file, 1);
11605 ret_val = xmlNanoFTPDele(ctx, file);
11606 desret_int(ret_val);
11608 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11609 des_filepath(n_file, file, 1);
11610 xmlResetLastError();
11611 if (mem_base != xmlMemBlocks()) {
11612 printf("Leak of %d blocks found in xmlNanoFTPDele",
11613 xmlMemBlocks() - mem_base);
11615 printf(" %d", n_ctx);
11616 printf(" %d", n_file);
11629 test_xmlNanoFTPGet(void) {
11633 /* missing type support */
11639 test_xmlNanoFTPGetConnection(void) {
11643 /* missing type support */
11649 test_xmlNanoFTPGetResponse(void) {
11652 #if defined(LIBXML_FTP_ENABLED)
11655 void * ctx; /* an FTP context */
11658 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11659 mem_base = xmlMemBlocks();
11660 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11662 ret_val = xmlNanoFTPGetResponse(ctx);
11663 desret_int(ret_val);
11665 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11666 xmlResetLastError();
11667 if (mem_base != xmlMemBlocks()) {
11668 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11669 xmlMemBlocks() - mem_base);
11671 printf(" %d", n_ctx);
11683 test_xmlNanoFTPGetSocket(void) {
11687 /* missing type support */
11693 test_xmlNanoFTPInit(void) {
11696 #if defined(LIBXML_FTP_ENABLED)
11699 mem_base = xmlMemBlocks();
11703 xmlResetLastError();
11704 if (mem_base != xmlMemBlocks()) {
11705 printf("Leak of %d blocks found in xmlNanoFTPInit",
11706 xmlMemBlocks() - mem_base);
11718 test_xmlNanoFTPList(void) {
11722 /* missing type support */
11728 test_xmlNanoFTPNewCtxt(void) {
11731 #if defined(LIBXML_FTP_ENABLED)
11734 const char * URL; /* The URL used to initialize the context */
11737 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11738 mem_base = xmlMemBlocks();
11739 URL = gen_filepath(n_URL, 0);
11741 ret_val = xmlNanoFTPNewCtxt(URL);
11742 desret_xmlNanoFTPCtxtPtr(ret_val);
11744 des_filepath(n_URL, URL, 0);
11745 xmlResetLastError();
11746 if (mem_base != xmlMemBlocks()) {
11747 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11748 xmlMemBlocks() - mem_base);
11750 printf(" %d", n_URL);
11762 test_xmlNanoFTPOpen(void) {
11765 #if defined(LIBXML_FTP_ENABLED)
11768 const char * URL; /* the URL to the resource */
11771 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11772 mem_base = xmlMemBlocks();
11773 URL = gen_filepath(n_URL, 0);
11775 ret_val = xmlNanoFTPOpen(URL);
11776 desret_xmlNanoFTPCtxtPtr(ret_val);
11778 des_filepath(n_URL, URL, 0);
11779 xmlResetLastError();
11780 if (mem_base != xmlMemBlocks()) {
11781 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11782 xmlMemBlocks() - mem_base);
11784 printf(" %d", n_URL);
11796 test_xmlNanoFTPProxy(void) {
11799 #if defined(LIBXML_FTP_ENABLED)
11800 char * host; /* the proxy host name */
11802 int port; /* the proxy port */
11804 char * user; /* the proxy user name */
11806 char * passwd; /* the proxy password */
11808 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11811 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11812 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11813 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11814 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11815 for (n_type = 0;n_type < gen_nb_int;n_type++) {
11816 host = gen_const_char_ptr(n_host, 0);
11817 port = gen_int(n_port, 1);
11818 user = gen_const_char_ptr(n_user, 2);
11819 passwd = gen_const_char_ptr(n_passwd, 3);
11820 type = gen_int(n_type, 4);
11822 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11824 des_const_char_ptr(n_host, (const char *)host, 0);
11825 des_int(n_port, port, 1);
11826 des_const_char_ptr(n_user, (const char *)user, 2);
11827 des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11828 des_int(n_type, type, 4);
11829 xmlResetLastError();
11843 test_xmlNanoFTPQuit(void) {
11846 #if defined(LIBXML_FTP_ENABLED)
11849 void * ctx; /* an FTP context */
11852 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11853 mem_base = xmlMemBlocks();
11854 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11856 ret_val = xmlNanoFTPQuit(ctx);
11857 desret_int(ret_val);
11859 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11860 xmlResetLastError();
11861 if (mem_base != xmlMemBlocks()) {
11862 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11863 xmlMemBlocks() - mem_base);
11865 printf(" %d", n_ctx);
11877 test_xmlNanoFTPRead(void) {
11880 #if defined(LIBXML_FTP_ENABLED)
11883 void * ctx; /* the FTP context */
11885 void * dest; /* a buffer */
11887 int len; /* the buffer length */
11890 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11891 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11892 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11893 mem_base = xmlMemBlocks();
11894 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11895 dest = gen_void_ptr(n_dest, 1);
11896 len = gen_int(n_len, 2);
11898 ret_val = xmlNanoFTPRead(ctx, dest, len);
11899 desret_int(ret_val);
11901 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11902 des_void_ptr(n_dest, dest, 1);
11903 des_int(n_len, len, 2);
11904 xmlResetLastError();
11905 if (mem_base != xmlMemBlocks()) {
11906 printf("Leak of %d blocks found in xmlNanoFTPRead",
11907 xmlMemBlocks() - mem_base);
11909 printf(" %d", n_ctx);
11910 printf(" %d", n_dest);
11911 printf(" %d", n_len);
11925 test_xmlNanoFTPScanProxy(void) {
11928 #if defined(LIBXML_FTP_ENABLED)
11929 const char * URL; /* The proxy URL used to initialize the proxy context */
11932 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11933 URL = gen_filepath(n_URL, 0);
11935 xmlNanoFTPScanProxy(URL);
11937 des_filepath(n_URL, URL, 0);
11938 xmlResetLastError();
11948 test_xmlNanoFTPUpdateURL(void) {
11951 #if defined(LIBXML_FTP_ENABLED)
11954 void * ctx; /* an FTP context */
11956 const char * URL; /* The URL used to update the context */
11959 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11960 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11961 mem_base = xmlMemBlocks();
11962 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11963 URL = gen_filepath(n_URL, 1);
11965 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11966 desret_int(ret_val);
11968 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11969 des_filepath(n_URL, URL, 1);
11970 xmlResetLastError();
11971 if (mem_base != xmlMemBlocks()) {
11972 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11973 xmlMemBlocks() - mem_base);
11975 printf(" %d", n_ctx);
11976 printf(" %d", n_URL);
11988 test_nanoftp(void) {
11991 if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
11992 test_ret += test_xmlNanoFTPCheckResponse();
11993 test_ret += test_xmlNanoFTPCleanup();
11994 test_ret += test_xmlNanoFTPCloseConnection();
11995 test_ret += test_xmlNanoFTPCwd();
11996 test_ret += test_xmlNanoFTPDele();
11997 test_ret += test_xmlNanoFTPGet();
11998 test_ret += test_xmlNanoFTPGetConnection();
11999 test_ret += test_xmlNanoFTPGetResponse();
12000 test_ret += test_xmlNanoFTPGetSocket();
12001 test_ret += test_xmlNanoFTPInit();
12002 test_ret += test_xmlNanoFTPList();
12003 test_ret += test_xmlNanoFTPNewCtxt();
12004 test_ret += test_xmlNanoFTPOpen();
12005 test_ret += test_xmlNanoFTPProxy();
12006 test_ret += test_xmlNanoFTPQuit();
12007 test_ret += test_xmlNanoFTPRead();
12008 test_ret += test_xmlNanoFTPScanProxy();
12009 test_ret += test_xmlNanoFTPUpdateURL();
12012 printf("Module nanoftp: %d errors\n", test_ret);
12017 test_xmlNanoHTTPAuthHeader(void) {
12020 #if defined(LIBXML_HTTP_ENABLED)
12022 const char * ret_val;
12023 void * ctx; /* the HTTP context */
12026 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12027 mem_base = xmlMemBlocks();
12028 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12030 ret_val = xmlNanoHTTPAuthHeader(ctx);
12031 desret_const_char_ptr(ret_val);
12033 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12034 xmlResetLastError();
12035 if (mem_base != xmlMemBlocks()) {
12036 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12037 xmlMemBlocks() - mem_base);
12039 printf(" %d", n_ctx);
12051 test_xmlNanoHTTPCleanup(void) {
12054 #if defined(LIBXML_HTTP_ENABLED)
12057 mem_base = xmlMemBlocks();
12059 xmlNanoHTTPCleanup();
12061 xmlResetLastError();
12062 if (mem_base != xmlMemBlocks()) {
12063 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12064 xmlMemBlocks() - mem_base);
12076 test_xmlNanoHTTPContentLength(void) {
12079 #if defined(LIBXML_HTTP_ENABLED)
12082 void * ctx; /* the HTTP context */
12085 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12086 mem_base = xmlMemBlocks();
12087 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12089 ret_val = xmlNanoHTTPContentLength(ctx);
12090 desret_int(ret_val);
12092 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12093 xmlResetLastError();
12094 if (mem_base != xmlMemBlocks()) {
12095 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12096 xmlMemBlocks() - mem_base);
12098 printf(" %d", n_ctx);
12110 test_xmlNanoHTTPEncoding(void) {
12113 #if defined(LIBXML_HTTP_ENABLED)
12115 const char * ret_val;
12116 void * ctx; /* the HTTP context */
12119 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12120 mem_base = xmlMemBlocks();
12121 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12123 ret_val = xmlNanoHTTPEncoding(ctx);
12124 desret_const_char_ptr(ret_val);
12126 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12127 xmlResetLastError();
12128 if (mem_base != xmlMemBlocks()) {
12129 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12130 xmlMemBlocks() - mem_base);
12132 printf(" %d", n_ctx);
12143 #define gen_nb_char_ptr_ptr 1
12144 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12147 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12151 test_xmlNanoHTTPFetch(void) {
12154 #if defined(LIBXML_HTTP_ENABLED)
12157 const char * URL; /* The URL to load */
12159 const char * filename; /* the filename where the content should be saved */
12161 char ** contentType; /* if available the Content-Type information will be returned at that location */
12164 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12165 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12166 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12167 mem_base = xmlMemBlocks();
12168 URL = gen_fileoutput(n_URL, 0);
12169 filename = gen_fileoutput(n_filename, 1);
12170 contentType = gen_char_ptr_ptr(n_contentType, 2);
12172 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12173 desret_int(ret_val);
12175 des_fileoutput(n_URL, URL, 0);
12176 des_fileoutput(n_filename, filename, 1);
12177 des_char_ptr_ptr(n_contentType, contentType, 2);
12178 xmlResetLastError();
12179 if (mem_base != xmlMemBlocks()) {
12180 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12181 xmlMemBlocks() - mem_base);
12183 printf(" %d", n_URL);
12184 printf(" %d", n_filename);
12185 printf(" %d", n_contentType);
12199 test_xmlNanoHTTPInit(void) {
12202 #if defined(LIBXML_HTTP_ENABLED)
12205 mem_base = xmlMemBlocks();
12209 xmlResetLastError();
12210 if (mem_base != xmlMemBlocks()) {
12211 printf("Leak of %d blocks found in xmlNanoHTTPInit",
12212 xmlMemBlocks() - mem_base);
12224 test_xmlNanoHTTPMimeType(void) {
12227 #if defined(LIBXML_HTTP_ENABLED)
12229 const char * ret_val;
12230 void * ctx; /* the HTTP context */
12233 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12234 mem_base = xmlMemBlocks();
12235 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12237 ret_val = xmlNanoHTTPMimeType(ctx);
12238 desret_const_char_ptr(ret_val);
12240 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12241 xmlResetLastError();
12242 if (mem_base != xmlMemBlocks()) {
12243 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12244 xmlMemBlocks() - mem_base);
12246 printf(" %d", n_ctx);
12258 test_xmlNanoHTTPOpen(void) {
12261 #if defined(LIBXML_HTTP_ENABLED)
12264 const char * URL; /* The URL to load */
12266 char ** contentType; /* if available the Content-Type information will be returned at that location */
12269 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12270 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12271 mem_base = xmlMemBlocks();
12272 URL = gen_filepath(n_URL, 0);
12273 contentType = gen_char_ptr_ptr(n_contentType, 1);
12275 ret_val = xmlNanoHTTPOpen(URL, contentType);
12276 desret_xmlNanoHTTPCtxtPtr(ret_val);
12278 des_filepath(n_URL, URL, 0);
12279 des_char_ptr_ptr(n_contentType, contentType, 1);
12280 xmlResetLastError();
12281 if (mem_base != xmlMemBlocks()) {
12282 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12283 xmlMemBlocks() - mem_base);
12285 printf(" %d", n_URL);
12286 printf(" %d", n_contentType);
12299 test_xmlNanoHTTPOpenRedir(void) {
12302 #if defined(LIBXML_HTTP_ENABLED)
12305 const char * URL; /* The URL to load */
12307 char ** contentType; /* if available the Content-Type information will be returned at that location */
12309 char ** redir; /* if available the redirected URL will be returned */
12312 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12313 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12314 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12315 mem_base = xmlMemBlocks();
12316 URL = gen_filepath(n_URL, 0);
12317 contentType = gen_char_ptr_ptr(n_contentType, 1);
12318 redir = gen_char_ptr_ptr(n_redir, 2);
12320 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12321 desret_xmlNanoHTTPCtxtPtr(ret_val);
12323 des_filepath(n_URL, URL, 0);
12324 des_char_ptr_ptr(n_contentType, contentType, 1);
12325 des_char_ptr_ptr(n_redir, redir, 2);
12326 xmlResetLastError();
12327 if (mem_base != xmlMemBlocks()) {
12328 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12329 xmlMemBlocks() - mem_base);
12331 printf(" %d", n_URL);
12332 printf(" %d", n_contentType);
12333 printf(" %d", n_redir);
12347 test_xmlNanoHTTPRead(void) {
12350 #if defined(LIBXML_HTTP_ENABLED)
12353 void * ctx; /* the HTTP context */
12355 void * dest; /* a buffer */
12357 int len; /* the buffer length */
12360 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12361 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12362 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12363 mem_base = xmlMemBlocks();
12364 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12365 dest = gen_void_ptr(n_dest, 1);
12366 len = gen_int(n_len, 2);
12368 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12369 desret_int(ret_val);
12371 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12372 des_void_ptr(n_dest, dest, 1);
12373 des_int(n_len, len, 2);
12374 xmlResetLastError();
12375 if (mem_base != xmlMemBlocks()) {
12376 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12377 xmlMemBlocks() - mem_base);
12379 printf(" %d", n_ctx);
12380 printf(" %d", n_dest);
12381 printf(" %d", n_len);
12395 test_xmlNanoHTTPRedir(void) {
12399 /* missing type support */
12405 test_xmlNanoHTTPReturnCode(void) {
12408 #if defined(LIBXML_HTTP_ENABLED)
12411 void * ctx; /* the HTTP context */
12414 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12415 mem_base = xmlMemBlocks();
12416 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12418 ret_val = xmlNanoHTTPReturnCode(ctx);
12419 desret_int(ret_val);
12421 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12422 xmlResetLastError();
12423 if (mem_base != xmlMemBlocks()) {
12424 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12425 xmlMemBlocks() - mem_base);
12427 printf(" %d", n_ctx);
12439 test_xmlNanoHTTPSave(void) {
12442 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12445 void * ctxt; /* the HTTP context */
12447 const char * filename; /* the filename where the content should be saved */
12450 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12451 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12452 mem_base = xmlMemBlocks();
12453 ctxt = gen_void_ptr(n_ctxt, 0);
12454 filename = gen_fileoutput(n_filename, 1);
12456 ret_val = xmlNanoHTTPSave(ctxt, filename);
12457 desret_int(ret_val);
12459 des_void_ptr(n_ctxt, ctxt, 0);
12460 des_fileoutput(n_filename, filename, 1);
12461 xmlResetLastError();
12462 if (mem_base != xmlMemBlocks()) {
12463 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12464 xmlMemBlocks() - mem_base);
12466 printf(" %d", n_ctxt);
12467 printf(" %d", n_filename);
12480 test_xmlNanoHTTPScanProxy(void) {
12483 #if defined(LIBXML_HTTP_ENABLED)
12484 const char * URL; /* The proxy URL used to initialize the proxy context */
12487 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12488 URL = gen_filepath(n_URL, 0);
12490 xmlNanoHTTPScanProxy(URL);
12492 des_filepath(n_URL, URL, 0);
12493 xmlResetLastError();
12502 test_nanohttp(void) {
12505 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12506 test_ret += test_xmlNanoHTTPAuthHeader();
12507 test_ret += test_xmlNanoHTTPCleanup();
12508 test_ret += test_xmlNanoHTTPContentLength();
12509 test_ret += test_xmlNanoHTTPEncoding();
12510 test_ret += test_xmlNanoHTTPFetch();
12511 test_ret += test_xmlNanoHTTPInit();
12512 test_ret += test_xmlNanoHTTPMimeType();
12513 test_ret += test_xmlNanoHTTPOpen();
12514 test_ret += test_xmlNanoHTTPOpenRedir();
12515 test_ret += test_xmlNanoHTTPRead();
12516 test_ret += test_xmlNanoHTTPRedir();
12517 test_ret += test_xmlNanoHTTPReturnCode();
12518 test_ret += test_xmlNanoHTTPSave();
12519 test_ret += test_xmlNanoHTTPScanProxy();
12522 printf("Module nanohttp: %d errors\n", test_ret);
12527 test_xmlByteConsumed(void) {
12532 xmlParserCtxtPtr ctxt; /* an XML parser context */
12535 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12536 mem_base = xmlMemBlocks();
12537 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12539 ret_val = xmlByteConsumed(ctxt);
12540 desret_long(ret_val);
12542 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12543 xmlResetLastError();
12544 if (mem_base != xmlMemBlocks()) {
12545 printf("Leak of %d blocks found in xmlByteConsumed",
12546 xmlMemBlocks() - mem_base);
12548 printf(" %d", n_ctxt);
12559 test_xmlClearNodeInfoSeq(void) {
12563 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12566 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12567 mem_base = xmlMemBlocks();
12568 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12570 xmlClearNodeInfoSeq(seq);
12572 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12573 xmlResetLastError();
12574 if (mem_base != xmlMemBlocks()) {
12575 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12576 xmlMemBlocks() - mem_base);
12578 printf(" %d", n_seq);
12589 test_xmlClearParserCtxt(void) {
12593 xmlParserCtxtPtr ctxt; /* an XML parser context */
12596 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12597 mem_base = xmlMemBlocks();
12598 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12600 xmlClearParserCtxt(ctxt);
12602 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12603 xmlResetLastError();
12604 if (mem_base != xmlMemBlocks()) {
12605 printf("Leak of %d blocks found in xmlClearParserCtxt",
12606 xmlMemBlocks() - mem_base);
12608 printf(" %d", n_ctxt);
12619 test_xmlCreateDocParserCtxt(void) {
12623 xmlParserCtxtPtr ret_val;
12624 xmlChar * cur; /* a pointer to an array of xmlChar */
12627 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12628 mem_base = xmlMemBlocks();
12629 cur = gen_const_xmlChar_ptr(n_cur, 0);
12631 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12632 desret_xmlParserCtxtPtr(ret_val);
12634 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12635 xmlResetLastError();
12636 if (mem_base != xmlMemBlocks()) {
12637 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12638 xmlMemBlocks() - mem_base);
12640 printf(" %d", n_cur);
12651 test_xmlCreatePushParserCtxt(void) {
12654 #if defined(LIBXML_PUSH_ENABLED)
12656 xmlParserCtxtPtr ret_val;
12657 xmlSAXHandlerPtr sax; /* a SAX handler */
12659 void * user_data; /* The user data returned on SAX callbacks */
12661 char * chunk; /* a pointer to an array of chars */
12663 int size; /* number of chars in the array */
12665 const char * filename; /* an optional file name or URI */
12668 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12669 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12670 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12671 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12672 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12673 mem_base = xmlMemBlocks();
12674 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12675 user_data = gen_userdata(n_user_data, 1);
12676 chunk = gen_const_char_ptr(n_chunk, 2);
12677 size = gen_int(n_size, 3);
12678 filename = gen_fileoutput(n_filename, 4);
12680 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12681 desret_xmlParserCtxtPtr(ret_val);
12683 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12684 des_userdata(n_user_data, user_data, 1);
12685 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12686 des_int(n_size, size, 3);
12687 des_fileoutput(n_filename, filename, 4);
12688 xmlResetLastError();
12689 if (mem_base != xmlMemBlocks()) {
12690 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12691 xmlMemBlocks() - mem_base);
12693 printf(" %d", n_sax);
12694 printf(" %d", n_user_data);
12695 printf(" %d", n_chunk);
12696 printf(" %d", n_size);
12697 printf(" %d", n_filename);
12713 test_xmlCtxtReadDoc(void) {
12718 xmlParserCtxtPtr ctxt; /* an XML parser context */
12720 xmlChar * cur; /* a pointer to a zero terminated string */
12722 const char * URL; /* the base URL to use for the document */
12724 char * encoding; /* the document encoding, or NULL */
12726 int options; /* a combination of xmlParserOption */
12729 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12730 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12731 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12732 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12733 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12734 mem_base = xmlMemBlocks();
12735 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12736 cur = gen_const_xmlChar_ptr(n_cur, 1);
12737 URL = gen_filepath(n_URL, 2);
12738 encoding = gen_const_char_ptr(n_encoding, 3);
12739 options = gen_parseroptions(n_options, 4);
12741 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12742 desret_xmlDocPtr(ret_val);
12744 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12745 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12746 des_filepath(n_URL, URL, 2);
12747 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12748 des_parseroptions(n_options, options, 4);
12749 xmlResetLastError();
12750 if (mem_base != xmlMemBlocks()) {
12751 printf("Leak of %d blocks found in xmlCtxtReadDoc",
12752 xmlMemBlocks() - mem_base);
12754 printf(" %d", n_ctxt);
12755 printf(" %d", n_cur);
12756 printf(" %d", n_URL);
12757 printf(" %d", n_encoding);
12758 printf(" %d", n_options);
12773 test_xmlCtxtReadFile(void) {
12778 xmlParserCtxtPtr ctxt; /* an XML parser context */
12780 const char * filename; /* a file or URL */
12782 char * encoding; /* the document encoding, or NULL */
12784 int options; /* a combination of xmlParserOption */
12787 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12788 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12789 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12790 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12791 mem_base = xmlMemBlocks();
12792 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12793 filename = gen_filepath(n_filename, 1);
12794 encoding = gen_const_char_ptr(n_encoding, 2);
12795 options = gen_parseroptions(n_options, 3);
12797 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12798 desret_xmlDocPtr(ret_val);
12800 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12801 des_filepath(n_filename, filename, 1);
12802 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12803 des_parseroptions(n_options, options, 3);
12804 xmlResetLastError();
12805 if (mem_base != xmlMemBlocks()) {
12806 printf("Leak of %d blocks found in xmlCtxtReadFile",
12807 xmlMemBlocks() - mem_base);
12809 printf(" %d", n_ctxt);
12810 printf(" %d", n_filename);
12811 printf(" %d", n_encoding);
12812 printf(" %d", n_options);
12826 test_xmlCtxtReadMemory(void) {
12831 xmlParserCtxtPtr ctxt; /* an XML parser context */
12833 char * buffer; /* a pointer to a char array */
12835 int size; /* the size of the array */
12837 const char * URL; /* the base URL to use for the document */
12839 char * encoding; /* the document encoding, or NULL */
12841 int options; /* a combination of xmlParserOption */
12844 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12845 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12846 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12847 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12848 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12849 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12850 mem_base = xmlMemBlocks();
12851 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12852 buffer = gen_const_char_ptr(n_buffer, 1);
12853 size = gen_int(n_size, 2);
12854 URL = gen_filepath(n_URL, 3);
12855 encoding = gen_const_char_ptr(n_encoding, 4);
12856 options = gen_parseroptions(n_options, 5);
12858 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12859 desret_xmlDocPtr(ret_val);
12861 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12862 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12863 des_int(n_size, size, 2);
12864 des_filepath(n_URL, URL, 3);
12865 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12866 des_parseroptions(n_options, options, 5);
12867 xmlResetLastError();
12868 if (mem_base != xmlMemBlocks()) {
12869 printf("Leak of %d blocks found in xmlCtxtReadMemory",
12870 xmlMemBlocks() - mem_base);
12872 printf(" %d", n_ctxt);
12873 printf(" %d", n_buffer);
12874 printf(" %d", n_size);
12875 printf(" %d", n_URL);
12876 printf(" %d", n_encoding);
12877 printf(" %d", n_options);
12893 test_xmlCtxtReset(void) {
12897 xmlParserCtxtPtr ctxt; /* an XML parser context */
12900 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12901 mem_base = xmlMemBlocks();
12902 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12904 xmlCtxtReset(ctxt);
12906 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12907 xmlResetLastError();
12908 if (mem_base != xmlMemBlocks()) {
12909 printf("Leak of %d blocks found in xmlCtxtReset",
12910 xmlMemBlocks() - mem_base);
12912 printf(" %d", n_ctxt);
12923 test_xmlCtxtResetPush(void) {
12928 xmlParserCtxtPtr ctxt; /* an XML parser context */
12930 char * chunk; /* a pointer to an array of chars */
12932 int size; /* number of chars in the array */
12934 const char * filename; /* an optional file name or URI */
12936 char * encoding; /* the document encoding, or NULL */
12939 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12940 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12941 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12942 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12943 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12944 mem_base = xmlMemBlocks();
12945 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12946 chunk = gen_const_char_ptr(n_chunk, 1);
12947 size = gen_int(n_size, 2);
12948 filename = gen_filepath(n_filename, 3);
12949 encoding = gen_const_char_ptr(n_encoding, 4);
12951 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12952 desret_int(ret_val);
12954 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12955 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12956 des_int(n_size, size, 2);
12957 des_filepath(n_filename, filename, 3);
12958 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12959 xmlResetLastError();
12960 if (mem_base != xmlMemBlocks()) {
12961 printf("Leak of %d blocks found in xmlCtxtResetPush",
12962 xmlMemBlocks() - mem_base);
12964 printf(" %d", n_ctxt);
12965 printf(" %d", n_chunk);
12966 printf(" %d", n_size);
12967 printf(" %d", n_filename);
12968 printf(" %d", n_encoding);
12983 test_xmlCtxtUseOptions(void) {
12988 xmlParserCtxtPtr ctxt; /* an XML parser context */
12990 int options; /* a combination of xmlParserOption */
12993 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12994 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12995 mem_base = xmlMemBlocks();
12996 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12997 options = gen_parseroptions(n_options, 1);
12999 ret_val = xmlCtxtUseOptions(ctxt, options);
13000 desret_int(ret_val);
13002 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13003 des_parseroptions(n_options, options, 1);
13004 xmlResetLastError();
13005 if (mem_base != xmlMemBlocks()) {
13006 printf("Leak of %d blocks found in xmlCtxtUseOptions",
13007 xmlMemBlocks() - mem_base);
13009 printf(" %d", n_ctxt);
13010 printf(" %d", n_options);
13022 test_xmlGetExternalEntityLoader(void) {
13026 /* missing type support */
13032 test_xmlGetFeature(void) {
13035 #if defined(LIBXML_LEGACY_ENABLED)
13036 #ifdef LIBXML_LEGACY_ENABLED
13039 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13041 char * name; /* the feature name */
13043 void * result; /* location to store the result */
13046 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13047 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13048 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13049 mem_base = xmlMemBlocks();
13050 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13051 name = gen_const_char_ptr(n_name, 1);
13052 result = gen_void_ptr(n_result, 2);
13054 ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13055 desret_int(ret_val);
13057 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13058 des_const_char_ptr(n_name, (const char *)name, 1);
13059 des_void_ptr(n_result, result, 2);
13060 xmlResetLastError();
13061 if (mem_base != xmlMemBlocks()) {
13062 printf("Leak of %d blocks found in xmlGetFeature",
13063 xmlMemBlocks() - mem_base);
13065 printf(" %d", n_ctxt);
13066 printf(" %d", n_name);
13067 printf(" %d", n_result);
13081 #define gen_nb_const_char_ptr_ptr 1
13082 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13085 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13089 test_xmlGetFeaturesList(void) {
13092 #if defined(LIBXML_LEGACY_ENABLED)
13093 #ifdef LIBXML_LEGACY_ENABLED
13096 int * len; /* the length of the features name array (input/output) */
13098 char ** result; /* an array of string to be filled with the features name. */
13101 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13102 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13103 mem_base = xmlMemBlocks();
13104 len = gen_int_ptr(n_len, 0);
13105 result = gen_const_char_ptr_ptr(n_result, 1);
13107 ret_val = xmlGetFeaturesList(len, (const char **)result);
13108 desret_int(ret_val);
13110 des_int_ptr(n_len, len, 0);
13111 des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13112 xmlResetLastError();
13113 if (mem_base != xmlMemBlocks()) {
13114 printf("Leak of %d blocks found in xmlGetFeaturesList",
13115 xmlMemBlocks() - mem_base);
13117 printf(" %d", n_len);
13118 printf(" %d", n_result);
13132 test_xmlHasFeature(void) {
13137 xmlFeature feature; /* the feature to be examined */
13140 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13141 mem_base = xmlMemBlocks();
13142 feature = gen_xmlFeature(n_feature, 0);
13144 ret_val = xmlHasFeature(feature);
13145 desret_int(ret_val);
13147 des_xmlFeature(n_feature, feature, 0);
13148 xmlResetLastError();
13149 if (mem_base != xmlMemBlocks()) {
13150 printf("Leak of %d blocks found in xmlHasFeature",
13151 xmlMemBlocks() - mem_base);
13153 printf(" %d", n_feature);
13164 test_xmlIOParseDTD(void) {
13167 #if defined(LIBXML_VALID_ENABLED)
13168 #ifdef LIBXML_VALID_ENABLED
13170 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13172 xmlParserInputBufferPtr input; /* an Input Buffer */
13174 xmlCharEncoding enc; /* the charset encoding if known */
13177 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13178 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13179 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13180 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13181 input = gen_xmlParserInputBufferPtr(n_input, 1);
13182 enc = gen_xmlCharEncoding(n_enc, 2);
13184 ret_val = xmlIOParseDTD(sax, input, enc);
13186 desret_xmlDtdPtr(ret_val);
13188 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13189 des_xmlParserInputBufferPtr(n_input, input, 1);
13190 des_xmlCharEncoding(n_enc, enc, 2);
13191 xmlResetLastError();
13204 test_xmlInitNodeInfoSeq(void) {
13208 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13211 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13212 mem_base = xmlMemBlocks();
13213 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13215 xmlInitNodeInfoSeq(seq);
13217 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13218 xmlResetLastError();
13219 if (mem_base != xmlMemBlocks()) {
13220 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13221 xmlMemBlocks() - mem_base);
13223 printf(" %d", n_seq);
13234 test_xmlInitParser(void) {
13239 mem_base = xmlMemBlocks();
13243 xmlResetLastError();
13244 if (mem_base != xmlMemBlocks()) {
13245 printf("Leak of %d blocks found in xmlInitParser",
13246 xmlMemBlocks() - mem_base);
13257 test_xmlInitParserCtxt(void) {
13262 xmlParserCtxtPtr ctxt; /* an XML parser context */
13265 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13266 mem_base = xmlMemBlocks();
13267 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13269 ret_val = xmlInitParserCtxt(ctxt);
13270 desret_int(ret_val);
13272 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13273 xmlResetLastError();
13274 if (mem_base != xmlMemBlocks()) {
13275 printf("Leak of %d blocks found in xmlInitParserCtxt",
13276 xmlMemBlocks() - mem_base);
13278 printf(" %d", n_ctxt);
13289 test_xmlKeepBlanksDefault(void) {
13294 int val; /* int 0 or 1 */
13297 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13298 mem_base = xmlMemBlocks();
13299 val = gen_int(n_val, 0);
13301 ret_val = xmlKeepBlanksDefault(val);
13302 desret_int(ret_val);
13304 des_int(n_val, val, 0);
13305 xmlResetLastError();
13306 if (mem_base != xmlMemBlocks()) {
13307 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13308 xmlMemBlocks() - mem_base);
13310 printf(" %d", n_val);
13321 test_xmlLineNumbersDefault(void) {
13326 int val; /* int 0 or 1 */
13329 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13330 mem_base = xmlMemBlocks();
13331 val = gen_int(n_val, 0);
13333 ret_val = xmlLineNumbersDefault(val);
13334 desret_int(ret_val);
13336 des_int(n_val, val, 0);
13337 xmlResetLastError();
13338 if (mem_base != xmlMemBlocks()) {
13339 printf("Leak of %d blocks found in xmlLineNumbersDefault",
13340 xmlMemBlocks() - mem_base);
13342 printf(" %d", n_val);
13353 test_xmlLoadExternalEntity(void) {
13357 xmlParserInputPtr ret_val;
13358 const char * URL; /* the URL for the entity to load */
13360 char * ID; /* the Public ID for the entity to load */
13362 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13365 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13366 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13367 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13368 mem_base = xmlMemBlocks();
13369 URL = gen_filepath(n_URL, 0);
13370 ID = gen_const_char_ptr(n_ID, 1);
13371 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13373 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13374 desret_xmlParserInputPtr(ret_val);
13376 des_filepath(n_URL, URL, 0);
13377 des_const_char_ptr(n_ID, (const char *)ID, 1);
13378 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13379 xmlResetLastError();
13380 if (mem_base != xmlMemBlocks()) {
13381 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13382 xmlMemBlocks() - mem_base);
13384 printf(" %d", n_URL);
13385 printf(" %d", n_ID);
13386 printf(" %d", n_ctxt);
13399 test_xmlNewIOInputStream(void) {
13403 xmlParserInputPtr ret_val;
13404 xmlParserCtxtPtr ctxt; /* an XML parser context */
13406 xmlParserInputBufferPtr input; /* an I/O Input */
13408 xmlCharEncoding enc; /* the charset encoding if known */
13411 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13412 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13413 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13414 mem_base = xmlMemBlocks();
13415 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13416 input = gen_xmlParserInputBufferPtr(n_input, 1);
13417 enc = gen_xmlCharEncoding(n_enc, 2);
13419 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13420 if (ret_val != NULL) input = NULL;
13421 desret_xmlParserInputPtr(ret_val);
13423 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13424 des_xmlParserInputBufferPtr(n_input, input, 1);
13425 des_xmlCharEncoding(n_enc, enc, 2);
13426 xmlResetLastError();
13427 if (mem_base != xmlMemBlocks()) {
13428 printf("Leak of %d blocks found in xmlNewIOInputStream",
13429 xmlMemBlocks() - mem_base);
13431 printf(" %d", n_ctxt);
13432 printf(" %d", n_input);
13433 printf(" %d", n_enc);
13446 test_xmlNewParserCtxt(void) {
13450 xmlParserCtxtPtr ret_val;
13452 mem_base = xmlMemBlocks();
13454 ret_val = xmlNewParserCtxt();
13455 desret_xmlParserCtxtPtr(ret_val);
13457 xmlResetLastError();
13458 if (mem_base != xmlMemBlocks()) {
13459 printf("Leak of %d blocks found in xmlNewParserCtxt",
13460 xmlMemBlocks() - mem_base);
13470 #define gen_nb_xmlNodePtr_ptr 1
13471 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13474 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13478 test_xmlParseBalancedChunkMemory(void) {
13481 #if defined(LIBXML_SAX1_ENABLED)
13482 #ifdef LIBXML_SAX1_ENABLED
13485 xmlDocPtr doc; /* the document the chunk pertains to */
13487 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13489 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13491 int depth; /* Used for loop detection, use 0 */
13493 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13495 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13498 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13499 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13500 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13501 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13502 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13503 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13504 mem_base = xmlMemBlocks();
13505 doc = gen_xmlDocPtr(n_doc, 0);
13506 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13507 user_data = gen_userdata(n_user_data, 2);
13508 depth = gen_int(n_depth, 3);
13509 string = gen_const_xmlChar_ptr(n_string, 4);
13510 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13512 #ifdef LIBXML_SAX1_ENABLED
13513 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13517 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13518 desret_int(ret_val);
13520 des_xmlDocPtr(n_doc, doc, 0);
13521 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13522 des_userdata(n_user_data, user_data, 2);
13523 des_int(n_depth, depth, 3);
13524 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13525 des_xmlNodePtr_ptr(n_lst, lst, 5);
13526 xmlResetLastError();
13527 if (mem_base != xmlMemBlocks()) {
13528 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13529 xmlMemBlocks() - mem_base);
13531 printf(" %d", n_doc);
13532 printf(" %d", n_sax);
13533 printf(" %d", n_user_data);
13534 printf(" %d", n_depth);
13535 printf(" %d", n_string);
13536 printf(" %d", n_lst);
13554 test_xmlParseBalancedChunkMemoryRecover(void) {
13557 #if defined(LIBXML_SAX1_ENABLED)
13558 #ifdef LIBXML_SAX1_ENABLED
13561 xmlDocPtr doc; /* the document the chunk pertains to */
13563 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13565 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13567 int depth; /* Used for loop detection, use 0 */
13569 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13571 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13573 int recover; /* return nodes even if the data is broken (use 0) */
13576 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13577 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13578 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13579 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13580 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13581 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13582 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13583 mem_base = xmlMemBlocks();
13584 doc = gen_xmlDocPtr(n_doc, 0);
13585 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13586 user_data = gen_userdata(n_user_data, 2);
13587 depth = gen_int(n_depth, 3);
13588 string = gen_const_xmlChar_ptr(n_string, 4);
13589 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13590 recover = gen_int(n_recover, 6);
13592 #ifdef LIBXML_SAX1_ENABLED
13593 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13597 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13598 desret_int(ret_val);
13600 des_xmlDocPtr(n_doc, doc, 0);
13601 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13602 des_userdata(n_user_data, user_data, 2);
13603 des_int(n_depth, depth, 3);
13604 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13605 des_xmlNodePtr_ptr(n_lst, lst, 5);
13606 des_int(n_recover, recover, 6);
13607 xmlResetLastError();
13608 if (mem_base != xmlMemBlocks()) {
13609 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13610 xmlMemBlocks() - mem_base);
13612 printf(" %d", n_doc);
13613 printf(" %d", n_sax);
13614 printf(" %d", n_user_data);
13615 printf(" %d", n_depth);
13616 printf(" %d", n_string);
13617 printf(" %d", n_lst);
13618 printf(" %d", n_recover);
13637 test_xmlParseChunk(void) {
13640 #if defined(LIBXML_PUSH_ENABLED)
13643 xmlParserCtxtPtr ctxt; /* an XML parser context */
13645 char * chunk; /* an char array */
13647 int size; /* the size in byte of the chunk */
13649 int terminate; /* last chunk indicator */
13652 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13653 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13654 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13655 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13656 mem_base = xmlMemBlocks();
13657 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13658 chunk = gen_const_char_ptr(n_chunk, 1);
13659 size = gen_int(n_size, 2);
13660 terminate = gen_int(n_terminate, 3);
13662 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13663 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13664 desret_int(ret_val);
13666 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13667 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13668 des_int(n_size, size, 2);
13669 des_int(n_terminate, terminate, 3);
13670 xmlResetLastError();
13671 if (mem_base != xmlMemBlocks()) {
13672 printf("Leak of %d blocks found in xmlParseChunk",
13673 xmlMemBlocks() - mem_base);
13675 printf(" %d", n_ctxt);
13676 printf(" %d", n_chunk);
13677 printf(" %d", n_size);
13678 printf(" %d", n_terminate);
13693 test_xmlParseCtxtExternalEntity(void) {
13698 xmlParserCtxtPtr ctx; /* the existing parsing context */
13700 xmlChar * URL; /* the URL for the entity to load */
13702 xmlChar * ID; /* the System ID for the entity to load */
13704 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13707 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13708 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13709 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13710 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13711 mem_base = xmlMemBlocks();
13712 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13713 URL = gen_const_xmlChar_ptr(n_URL, 1);
13714 ID = gen_const_xmlChar_ptr(n_ID, 2);
13715 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13717 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13718 desret_int(ret_val);
13720 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13721 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13722 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13723 des_xmlNodePtr_ptr(n_lst, lst, 3);
13724 xmlResetLastError();
13725 if (mem_base != xmlMemBlocks()) {
13726 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13727 xmlMemBlocks() - mem_base);
13729 printf(" %d", n_ctx);
13730 printf(" %d", n_URL);
13731 printf(" %d", n_ID);
13732 printf(" %d", n_lst);
13746 test_xmlParseDTD(void) {
13749 #if defined(LIBXML_VALID_ENABLED)
13750 #ifdef LIBXML_VALID_ENABLED
13753 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13755 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13758 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13759 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13760 mem_base = xmlMemBlocks();
13761 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13762 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13764 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13765 desret_xmlDtdPtr(ret_val);
13767 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13768 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13769 xmlResetLastError();
13770 if (mem_base != xmlMemBlocks()) {
13771 printf("Leak of %d blocks found in xmlParseDTD",
13772 xmlMemBlocks() - mem_base);
13774 printf(" %d", n_ExternalID);
13775 printf(" %d", n_SystemID);
13789 test_xmlParseDoc(void) {
13792 #if defined(LIBXML_SAX1_ENABLED)
13793 #ifdef LIBXML_SAX1_ENABLED
13796 xmlChar * cur; /* a pointer to an array of xmlChar */
13799 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13800 mem_base = xmlMemBlocks();
13801 cur = gen_const_xmlChar_ptr(n_cur, 0);
13803 ret_val = xmlParseDoc((const xmlChar *)cur);
13804 desret_xmlDocPtr(ret_val);
13806 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13807 xmlResetLastError();
13808 if (mem_base != xmlMemBlocks()) {
13809 printf("Leak of %d blocks found in xmlParseDoc",
13810 xmlMemBlocks() - mem_base);
13812 printf(" %d", n_cur);
13825 test_xmlParseDocument(void) {
13830 xmlParserCtxtPtr ctxt; /* an XML parser context */
13833 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13834 mem_base = xmlMemBlocks();
13835 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13837 ret_val = xmlParseDocument(ctxt);
13838 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13839 desret_int(ret_val);
13841 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13842 xmlResetLastError();
13843 if (mem_base != xmlMemBlocks()) {
13844 printf("Leak of %d blocks found in xmlParseDocument",
13845 xmlMemBlocks() - mem_base);
13847 printf(" %d", n_ctxt);
13858 test_xmlParseEntity(void) {
13861 #if defined(LIBXML_SAX1_ENABLED)
13862 #ifdef LIBXML_SAX1_ENABLED
13865 const char * filename; /* the filename */
13868 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13869 mem_base = xmlMemBlocks();
13870 filename = gen_filepath(n_filename, 0);
13872 ret_val = xmlParseEntity(filename);
13873 desret_xmlDocPtr(ret_val);
13875 des_filepath(n_filename, filename, 0);
13876 xmlResetLastError();
13877 if (mem_base != xmlMemBlocks()) {
13878 printf("Leak of %d blocks found in xmlParseEntity",
13879 xmlMemBlocks() - mem_base);
13881 printf(" %d", n_filename);
13894 test_xmlParseExtParsedEnt(void) {
13899 xmlParserCtxtPtr ctxt; /* an XML parser context */
13902 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13903 mem_base = xmlMemBlocks();
13904 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13906 ret_val = xmlParseExtParsedEnt(ctxt);
13907 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13908 desret_int(ret_val);
13910 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13911 xmlResetLastError();
13912 if (mem_base != xmlMemBlocks()) {
13913 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13914 xmlMemBlocks() - mem_base);
13916 printf(" %d", n_ctxt);
13927 test_xmlParseExternalEntity(void) {
13930 #if defined(LIBXML_SAX1_ENABLED)
13931 #ifdef LIBXML_SAX1_ENABLED
13934 xmlDocPtr doc; /* the document the chunk pertains to */
13936 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13938 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13940 int depth; /* Used for loop detection, use 0 */
13942 xmlChar * URL; /* the URL for the entity to load */
13944 xmlChar * ID; /* the System ID for the entity to load */
13946 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13949 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13950 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13951 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13952 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13953 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13954 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13955 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13956 mem_base = xmlMemBlocks();
13957 doc = gen_xmlDocPtr(n_doc, 0);
13958 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13959 user_data = gen_userdata(n_user_data, 2);
13960 depth = gen_int(n_depth, 3);
13961 URL = gen_const_xmlChar_ptr(n_URL, 4);
13962 ID = gen_const_xmlChar_ptr(n_ID, 5);
13963 lst = gen_xmlNodePtr_ptr(n_lst, 6);
13965 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13966 desret_int(ret_val);
13968 des_xmlDocPtr(n_doc, doc, 0);
13969 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13970 des_userdata(n_user_data, user_data, 2);
13971 des_int(n_depth, depth, 3);
13972 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13973 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13974 des_xmlNodePtr_ptr(n_lst, lst, 6);
13975 xmlResetLastError();
13976 if (mem_base != xmlMemBlocks()) {
13977 printf("Leak of %d blocks found in xmlParseExternalEntity",
13978 xmlMemBlocks() - mem_base);
13980 printf(" %d", n_doc);
13981 printf(" %d", n_sax);
13982 printf(" %d", n_user_data);
13983 printf(" %d", n_depth);
13984 printf(" %d", n_URL);
13985 printf(" %d", n_ID);
13986 printf(" %d", n_lst);
14005 test_xmlParseFile(void) {
14008 #if defined(LIBXML_SAX1_ENABLED)
14009 #ifdef LIBXML_SAX1_ENABLED
14012 const char * filename; /* the filename */
14015 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14016 mem_base = xmlMemBlocks();
14017 filename = gen_filepath(n_filename, 0);
14019 ret_val = xmlParseFile(filename);
14020 desret_xmlDocPtr(ret_val);
14022 des_filepath(n_filename, filename, 0);
14023 xmlResetLastError();
14024 if (mem_base != xmlMemBlocks()) {
14025 printf("Leak of %d blocks found in xmlParseFile",
14026 xmlMemBlocks() - mem_base);
14028 printf(" %d", n_filename);
14041 test_xmlParseInNodeContext(void) {
14045 xmlParserErrors ret_val;
14046 xmlNodePtr node; /* the context node */
14048 char * data; /* the input string */
14050 int datalen; /* the input string length in bytes */
14052 int options; /* a combination of xmlParserOption */
14054 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14057 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14058 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14059 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14060 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14061 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14062 mem_base = xmlMemBlocks();
14063 node = gen_xmlNodePtr(n_node, 0);
14064 data = gen_const_char_ptr(n_data, 1);
14065 datalen = gen_int(n_datalen, 2);
14066 options = gen_parseroptions(n_options, 3);
14067 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14069 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14070 desret_xmlParserErrors(ret_val);
14072 des_xmlNodePtr(n_node, node, 0);
14073 des_const_char_ptr(n_data, (const char *)data, 1);
14074 des_int(n_datalen, datalen, 2);
14075 des_parseroptions(n_options, options, 3);
14076 des_xmlNodePtr_ptr(n_lst, lst, 4);
14077 xmlResetLastError();
14078 if (mem_base != xmlMemBlocks()) {
14079 printf("Leak of %d blocks found in xmlParseInNodeContext",
14080 xmlMemBlocks() - mem_base);
14082 printf(" %d", n_node);
14083 printf(" %d", n_data);
14084 printf(" %d", n_datalen);
14085 printf(" %d", n_options);
14086 printf(" %d", n_lst);
14101 test_xmlParseMemory(void) {
14104 #if defined(LIBXML_SAX1_ENABLED)
14105 #ifdef LIBXML_SAX1_ENABLED
14108 char * buffer; /* an pointer to a char array */
14110 int size; /* the size of the array */
14113 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14114 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14115 mem_base = xmlMemBlocks();
14116 buffer = gen_const_char_ptr(n_buffer, 0);
14117 size = gen_int(n_size, 1);
14119 ret_val = xmlParseMemory((const char *)buffer, size);
14120 desret_xmlDocPtr(ret_val);
14122 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14123 des_int(n_size, size, 1);
14124 xmlResetLastError();
14125 if (mem_base != xmlMemBlocks()) {
14126 printf("Leak of %d blocks found in xmlParseMemory",
14127 xmlMemBlocks() - mem_base);
14129 printf(" %d", n_buffer);
14130 printf(" %d", n_size);
14143 #define gen_nb_const_xmlParserNodeInfoPtr 1
14144 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14147 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14151 test_xmlParserAddNodeInfo(void) {
14155 xmlParserCtxtPtr ctxt; /* an XML parser context */
14157 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14160 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14161 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14162 mem_base = xmlMemBlocks();
14163 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14164 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14166 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14168 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14169 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14170 xmlResetLastError();
14171 if (mem_base != xmlMemBlocks()) {
14172 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14173 xmlMemBlocks() - mem_base);
14175 printf(" %d", n_ctxt);
14176 printf(" %d", n_info);
14187 #define gen_nb_const_xmlParserCtxtPtr 1
14188 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14191 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14194 #define gen_nb_const_xmlNodePtr 1
14195 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14198 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14202 test_xmlParserFindNodeInfo(void) {
14206 const xmlParserNodeInfo * ret_val;
14207 xmlParserCtxtPtr ctx; /* an XML parser context */
14209 xmlNodePtr node; /* an XML node within the tree */
14212 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14213 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14214 mem_base = xmlMemBlocks();
14215 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14216 node = gen_const_xmlNodePtr(n_node, 1);
14218 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14219 desret_const_xmlParserNodeInfo_ptr(ret_val);
14221 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14222 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14223 xmlResetLastError();
14224 if (mem_base != xmlMemBlocks()) {
14225 printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14226 xmlMemBlocks() - mem_base);
14228 printf(" %d", n_ctx);
14229 printf(" %d", n_node);
14240 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14241 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14244 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14248 test_xmlParserFindNodeInfoIndex(void) {
14252 unsigned long ret_val;
14253 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14255 xmlNodePtr node; /* an XML node pointer */
14258 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14259 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14260 mem_base = xmlMemBlocks();
14261 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14262 node = gen_const_xmlNodePtr(n_node, 1);
14264 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14265 desret_unsigned_long(ret_val);
14267 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14268 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14269 xmlResetLastError();
14270 if (mem_base != xmlMemBlocks()) {
14271 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14272 xmlMemBlocks() - mem_base);
14274 printf(" %d", n_seq);
14275 printf(" %d", n_node);
14286 #define gen_nb_xmlParserInputPtr 1
14287 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14290 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14294 test_xmlParserInputGrow(void) {
14299 xmlParserInputPtr in; /* an XML parser input */
14301 int len; /* an indicative size for the lookahead */
14304 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14305 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14306 mem_base = xmlMemBlocks();
14307 in = gen_xmlParserInputPtr(n_in, 0);
14308 len = gen_int(n_len, 1);
14310 ret_val = xmlParserInputGrow(in, len);
14311 desret_int(ret_val);
14313 des_xmlParserInputPtr(n_in, in, 0);
14314 des_int(n_len, len, 1);
14315 xmlResetLastError();
14316 if (mem_base != xmlMemBlocks()) {
14317 printf("Leak of %d blocks found in xmlParserInputGrow",
14318 xmlMemBlocks() - mem_base);
14320 printf(" %d", n_in);
14321 printf(" %d", n_len);
14333 test_xmlParserInputRead(void) {
14338 xmlParserInputPtr in; /* an XML parser input */
14340 int len; /* an indicative size for the lookahead */
14343 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14344 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14345 mem_base = xmlMemBlocks();
14346 in = gen_xmlParserInputPtr(n_in, 0);
14347 len = gen_int(n_len, 1);
14349 ret_val = xmlParserInputRead(in, len);
14350 desret_int(ret_val);
14352 des_xmlParserInputPtr(n_in, in, 0);
14353 des_int(n_len, len, 1);
14354 xmlResetLastError();
14355 if (mem_base != xmlMemBlocks()) {
14356 printf("Leak of %d blocks found in xmlParserInputRead",
14357 xmlMemBlocks() - mem_base);
14359 printf(" %d", n_in);
14360 printf(" %d", n_len);
14372 test_xmlPedanticParserDefault(void) {
14377 int val; /* int 0 or 1 */
14380 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14381 mem_base = xmlMemBlocks();
14382 val = gen_int(n_val, 0);
14384 ret_val = xmlPedanticParserDefault(val);
14385 desret_int(ret_val);
14387 des_int(n_val, val, 0);
14388 xmlResetLastError();
14389 if (mem_base != xmlMemBlocks()) {
14390 printf("Leak of %d blocks found in xmlPedanticParserDefault",
14391 xmlMemBlocks() - mem_base);
14393 printf(" %d", n_val);
14404 test_xmlReadDoc(void) {
14409 xmlChar * cur; /* a pointer to a zero terminated string */
14411 const char * URL; /* the base URL to use for the document */
14413 char * encoding; /* the document encoding, or NULL */
14415 int options; /* a combination of xmlParserOption */
14418 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14419 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14420 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14421 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14422 mem_base = xmlMemBlocks();
14423 cur = gen_const_xmlChar_ptr(n_cur, 0);
14424 URL = gen_filepath(n_URL, 1);
14425 encoding = gen_const_char_ptr(n_encoding, 2);
14426 options = gen_parseroptions(n_options, 3);
14428 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14429 desret_xmlDocPtr(ret_val);
14431 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14432 des_filepath(n_URL, URL, 1);
14433 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14434 des_parseroptions(n_options, options, 3);
14435 xmlResetLastError();
14436 if (mem_base != xmlMemBlocks()) {
14437 printf("Leak of %d blocks found in xmlReadDoc",
14438 xmlMemBlocks() - mem_base);
14440 printf(" %d", n_cur);
14441 printf(" %d", n_URL);
14442 printf(" %d", n_encoding);
14443 printf(" %d", n_options);
14457 test_xmlReadFile(void) {
14462 const char * filename; /* a file or URL */
14464 char * encoding; /* the document encoding, or NULL */
14466 int options; /* a combination of xmlParserOption */
14469 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14470 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14471 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14472 mem_base = xmlMemBlocks();
14473 filename = gen_filepath(n_filename, 0);
14474 encoding = gen_const_char_ptr(n_encoding, 1);
14475 options = gen_parseroptions(n_options, 2);
14477 ret_val = xmlReadFile(filename, (const char *)encoding, options);
14478 desret_xmlDocPtr(ret_val);
14480 des_filepath(n_filename, filename, 0);
14481 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14482 des_parseroptions(n_options, options, 2);
14483 xmlResetLastError();
14484 if (mem_base != xmlMemBlocks()) {
14485 printf("Leak of %d blocks found in xmlReadFile",
14486 xmlMemBlocks() - mem_base);
14488 printf(" %d", n_filename);
14489 printf(" %d", n_encoding);
14490 printf(" %d", n_options);
14503 test_xmlReadMemory(void) {
14508 char * buffer; /* a pointer to a char array */
14510 int size; /* the size of the array */
14512 const char * URL; /* the base URL to use for the document */
14514 char * encoding; /* the document encoding, or NULL */
14516 int options; /* a combination of xmlParserOption */
14519 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14520 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14521 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14522 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14523 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14524 mem_base = xmlMemBlocks();
14525 buffer = gen_const_char_ptr(n_buffer, 0);
14526 size = gen_int(n_size, 1);
14527 URL = gen_filepath(n_URL, 2);
14528 encoding = gen_const_char_ptr(n_encoding, 3);
14529 options = gen_parseroptions(n_options, 4);
14531 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14532 desret_xmlDocPtr(ret_val);
14534 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14535 des_int(n_size, size, 1);
14536 des_filepath(n_URL, URL, 2);
14537 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14538 des_parseroptions(n_options, options, 4);
14539 xmlResetLastError();
14540 if (mem_base != xmlMemBlocks()) {
14541 printf("Leak of %d blocks found in xmlReadMemory",
14542 xmlMemBlocks() - mem_base);
14544 printf(" %d", n_buffer);
14545 printf(" %d", n_size);
14546 printf(" %d", n_URL);
14547 printf(" %d", n_encoding);
14548 printf(" %d", n_options);
14563 test_xmlRecoverDoc(void) {
14566 #if defined(LIBXML_SAX1_ENABLED)
14567 #ifdef LIBXML_SAX1_ENABLED
14570 xmlChar * cur; /* a pointer to an array of xmlChar */
14573 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14574 mem_base = xmlMemBlocks();
14575 cur = gen_const_xmlChar_ptr(n_cur, 0);
14577 ret_val = xmlRecoverDoc((const xmlChar *)cur);
14578 desret_xmlDocPtr(ret_val);
14580 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14581 xmlResetLastError();
14582 if (mem_base != xmlMemBlocks()) {
14583 printf("Leak of %d blocks found in xmlRecoverDoc",
14584 xmlMemBlocks() - mem_base);
14586 printf(" %d", n_cur);
14599 test_xmlRecoverFile(void) {
14602 #if defined(LIBXML_SAX1_ENABLED)
14603 #ifdef LIBXML_SAX1_ENABLED
14606 const char * filename; /* the filename */
14609 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14610 mem_base = xmlMemBlocks();
14611 filename = gen_filepath(n_filename, 0);
14613 ret_val = xmlRecoverFile(filename);
14614 desret_xmlDocPtr(ret_val);
14616 des_filepath(n_filename, filename, 0);
14617 xmlResetLastError();
14618 if (mem_base != xmlMemBlocks()) {
14619 printf("Leak of %d blocks found in xmlRecoverFile",
14620 xmlMemBlocks() - mem_base);
14622 printf(" %d", n_filename);
14635 test_xmlRecoverMemory(void) {
14638 #if defined(LIBXML_SAX1_ENABLED)
14639 #ifdef LIBXML_SAX1_ENABLED
14642 char * buffer; /* an pointer to a char array */
14644 int size; /* the size of the array */
14647 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14648 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14649 mem_base = xmlMemBlocks();
14650 buffer = gen_const_char_ptr(n_buffer, 0);
14651 size = gen_int(n_size, 1);
14653 ret_val = xmlRecoverMemory((const char *)buffer, size);
14654 desret_xmlDocPtr(ret_val);
14656 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14657 des_int(n_size, size, 1);
14658 xmlResetLastError();
14659 if (mem_base != xmlMemBlocks()) {
14660 printf("Leak of %d blocks found in xmlRecoverMemory",
14661 xmlMemBlocks() - mem_base);
14663 printf(" %d", n_buffer);
14664 printf(" %d", n_size);
14678 test_xmlSAXParseDTD(void) {
14681 #if defined(LIBXML_VALID_ENABLED)
14682 #ifdef LIBXML_SAX1_ENABLED
14685 xmlSAXHandlerPtr sax; /* the SAX handler block */
14687 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14689 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14692 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14693 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14694 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14695 mem_base = xmlMemBlocks();
14696 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14697 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14698 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14700 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14701 desret_xmlDtdPtr(ret_val);
14703 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14704 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14705 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14706 xmlResetLastError();
14707 if (mem_base != xmlMemBlocks()) {
14708 printf("Leak of %d blocks found in xmlSAXParseDTD",
14709 xmlMemBlocks() - mem_base);
14711 printf(" %d", n_sax);
14712 printf(" %d", n_ExternalID);
14713 printf(" %d", n_SystemID);
14728 test_xmlSAXParseDoc(void) {
14731 #if defined(LIBXML_SAX1_ENABLED)
14732 #ifdef LIBXML_SAX1_ENABLED
14735 xmlSAXHandlerPtr sax; /* the SAX handler block */
14737 xmlChar * cur; /* a pointer to an array of xmlChar */
14739 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14742 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14743 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14744 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14745 mem_base = xmlMemBlocks();
14746 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14747 cur = gen_const_xmlChar_ptr(n_cur, 1);
14748 recovery = gen_int(n_recovery, 2);
14750 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14751 desret_xmlDocPtr(ret_val);
14753 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14754 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14755 des_int(n_recovery, recovery, 2);
14756 xmlResetLastError();
14757 if (mem_base != xmlMemBlocks()) {
14758 printf("Leak of %d blocks found in xmlSAXParseDoc",
14759 xmlMemBlocks() - mem_base);
14761 printf(" %d", n_sax);
14762 printf(" %d", n_cur);
14763 printf(" %d", n_recovery);
14778 test_xmlSAXParseEntity(void) {
14781 #if defined(LIBXML_SAX1_ENABLED)
14782 #ifdef LIBXML_SAX1_ENABLED
14785 xmlSAXHandlerPtr sax; /* the SAX handler block */
14787 const char * filename; /* the filename */
14790 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14791 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14792 mem_base = xmlMemBlocks();
14793 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14794 filename = gen_filepath(n_filename, 1);
14796 ret_val = xmlSAXParseEntity(sax, filename);
14797 desret_xmlDocPtr(ret_val);
14799 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14800 des_filepath(n_filename, filename, 1);
14801 xmlResetLastError();
14802 if (mem_base != xmlMemBlocks()) {
14803 printf("Leak of %d blocks found in xmlSAXParseEntity",
14804 xmlMemBlocks() - mem_base);
14806 printf(" %d", n_sax);
14807 printf(" %d", n_filename);
14821 test_xmlSAXParseFile(void) {
14824 #if defined(LIBXML_SAX1_ENABLED)
14825 #ifdef LIBXML_SAX1_ENABLED
14828 xmlSAXHandlerPtr sax; /* the SAX handler block */
14830 const char * filename; /* the filename */
14832 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14835 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14836 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14837 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14838 mem_base = xmlMemBlocks();
14839 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14840 filename = gen_filepath(n_filename, 1);
14841 recovery = gen_int(n_recovery, 2);
14843 ret_val = xmlSAXParseFile(sax, filename, recovery);
14844 desret_xmlDocPtr(ret_val);
14846 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14847 des_filepath(n_filename, filename, 1);
14848 des_int(n_recovery, recovery, 2);
14849 xmlResetLastError();
14850 if (mem_base != xmlMemBlocks()) {
14851 printf("Leak of %d blocks found in xmlSAXParseFile",
14852 xmlMemBlocks() - mem_base);
14854 printf(" %d", n_sax);
14855 printf(" %d", n_filename);
14856 printf(" %d", n_recovery);
14871 test_xmlSAXParseFileWithData(void) {
14874 #if defined(LIBXML_SAX1_ENABLED)
14875 #ifdef LIBXML_SAX1_ENABLED
14878 xmlSAXHandlerPtr sax; /* the SAX handler block */
14880 const char * filename; /* the filename */
14882 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14884 void * data; /* the userdata */
14887 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14888 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14889 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14890 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14891 mem_base = xmlMemBlocks();
14892 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14893 filename = gen_filepath(n_filename, 1);
14894 recovery = gen_int(n_recovery, 2);
14895 data = gen_userdata(n_data, 3);
14897 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14898 desret_xmlDocPtr(ret_val);
14900 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14901 des_filepath(n_filename, filename, 1);
14902 des_int(n_recovery, recovery, 2);
14903 des_userdata(n_data, data, 3);
14904 xmlResetLastError();
14905 if (mem_base != xmlMemBlocks()) {
14906 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14907 xmlMemBlocks() - mem_base);
14909 printf(" %d", n_sax);
14910 printf(" %d", n_filename);
14911 printf(" %d", n_recovery);
14912 printf(" %d", n_data);
14928 test_xmlSAXParseMemory(void) {
14931 #if defined(LIBXML_SAX1_ENABLED)
14932 #ifdef LIBXML_SAX1_ENABLED
14935 xmlSAXHandlerPtr sax; /* the SAX handler block */
14937 char * buffer; /* an pointer to a char array */
14939 int size; /* the size of the array */
14941 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14944 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14945 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14946 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14947 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14948 mem_base = xmlMemBlocks();
14949 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14950 buffer = gen_const_char_ptr(n_buffer, 1);
14951 size = gen_int(n_size, 2);
14952 recovery = gen_int(n_recovery, 3);
14954 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14955 desret_xmlDocPtr(ret_val);
14957 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14958 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14959 des_int(n_size, size, 2);
14960 des_int(n_recovery, recovery, 3);
14961 xmlResetLastError();
14962 if (mem_base != xmlMemBlocks()) {
14963 printf("Leak of %d blocks found in xmlSAXParseMemory",
14964 xmlMemBlocks() - mem_base);
14966 printf(" %d", n_sax);
14967 printf(" %d", n_buffer);
14968 printf(" %d", n_size);
14969 printf(" %d", n_recovery);
14985 test_xmlSAXParseMemoryWithData(void) {
14988 #if defined(LIBXML_SAX1_ENABLED)
14989 #ifdef LIBXML_SAX1_ENABLED
14992 xmlSAXHandlerPtr sax; /* the SAX handler block */
14994 char * buffer; /* an pointer to a char array */
14996 int size; /* the size of the array */
14998 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15000 void * data; /* the userdata */
15003 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15004 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15005 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15006 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15007 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15008 mem_base = xmlMemBlocks();
15009 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15010 buffer = gen_const_char_ptr(n_buffer, 1);
15011 size = gen_int(n_size, 2);
15012 recovery = gen_int(n_recovery, 3);
15013 data = gen_userdata(n_data, 4);
15015 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15016 desret_xmlDocPtr(ret_val);
15018 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15019 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15020 des_int(n_size, size, 2);
15021 des_int(n_recovery, recovery, 3);
15022 des_userdata(n_data, data, 4);
15023 xmlResetLastError();
15024 if (mem_base != xmlMemBlocks()) {
15025 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15026 xmlMemBlocks() - mem_base);
15028 printf(" %d", n_sax);
15029 printf(" %d", n_buffer);
15030 printf(" %d", n_size);
15031 printf(" %d", n_recovery);
15032 printf(" %d", n_data);
15049 test_xmlSAXUserParseFile(void) {
15052 #if defined(LIBXML_SAX1_ENABLED)
15053 #ifdef LIBXML_SAX1_ENABLED
15056 xmlSAXHandlerPtr sax; /* a SAX handler */
15058 void * user_data; /* The user data returned on SAX callbacks */
15060 const char * filename; /* a file name */
15063 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15064 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15065 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15066 mem_base = xmlMemBlocks();
15067 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15068 user_data = gen_userdata(n_user_data, 1);
15069 filename = gen_filepath(n_filename, 2);
15071 #ifdef LIBXML_SAX1_ENABLED
15072 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15076 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15077 desret_int(ret_val);
15079 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15080 des_userdata(n_user_data, user_data, 1);
15081 des_filepath(n_filename, filename, 2);
15082 xmlResetLastError();
15083 if (mem_base != xmlMemBlocks()) {
15084 printf("Leak of %d blocks found in xmlSAXUserParseFile",
15085 xmlMemBlocks() - mem_base);
15087 printf(" %d", n_sax);
15088 printf(" %d", n_user_data);
15089 printf(" %d", n_filename);
15104 test_xmlSAXUserParseMemory(void) {
15107 #if defined(LIBXML_SAX1_ENABLED)
15108 #ifdef LIBXML_SAX1_ENABLED
15111 xmlSAXHandlerPtr sax; /* a SAX handler */
15113 void * user_data; /* The user data returned on SAX callbacks */
15115 char * buffer; /* an in-memory XML document input */
15117 int size; /* the length of the XML document in bytes */
15120 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15121 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15122 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15123 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15124 mem_base = xmlMemBlocks();
15125 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15126 user_data = gen_userdata(n_user_data, 1);
15127 buffer = gen_const_char_ptr(n_buffer, 2);
15128 size = gen_int(n_size, 3);
15130 #ifdef LIBXML_SAX1_ENABLED
15131 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15135 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15136 desret_int(ret_val);
15138 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15139 des_userdata(n_user_data, user_data, 1);
15140 des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15141 des_int(n_size, size, 3);
15142 xmlResetLastError();
15143 if (mem_base != xmlMemBlocks()) {
15144 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15145 xmlMemBlocks() - mem_base);
15147 printf(" %d", n_sax);
15148 printf(" %d", n_user_data);
15149 printf(" %d", n_buffer);
15150 printf(" %d", n_size);
15166 test_xmlSetExternalEntityLoader(void) {
15170 /* missing type support */
15176 test_xmlSetFeature(void) {
15179 #if defined(LIBXML_LEGACY_ENABLED)
15180 #ifdef LIBXML_LEGACY_ENABLED
15183 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15185 char * name; /* the feature name */
15187 void * value; /* pointer to the location of the new value */
15190 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15191 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15192 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15193 mem_base = xmlMemBlocks();
15194 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15195 name = gen_const_char_ptr(n_name, 1);
15196 value = gen_void_ptr(n_value, 2);
15198 ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15199 desret_int(ret_val);
15201 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15202 des_const_char_ptr(n_name, (const char *)name, 1);
15203 des_void_ptr(n_value, value, 2);
15204 xmlResetLastError();
15205 if (mem_base != xmlMemBlocks()) {
15206 printf("Leak of %d blocks found in xmlSetFeature",
15207 xmlMemBlocks() - mem_base);
15209 printf(" %d", n_ctxt);
15210 printf(" %d", n_name);
15211 printf(" %d", n_value);
15226 test_xmlSetupParserForBuffer(void) {
15229 #if defined(LIBXML_SAX1_ENABLED)
15230 #ifdef LIBXML_SAX1_ENABLED
15232 xmlParserCtxtPtr ctxt; /* an XML parser context */
15234 xmlChar * buffer; /* a xmlChar * buffer */
15236 const char * filename; /* a file name */
15239 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15240 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15241 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15242 mem_base = xmlMemBlocks();
15243 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15244 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15245 filename = gen_filepath(n_filename, 2);
15247 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15249 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15250 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15251 des_filepath(n_filename, filename, 2);
15252 xmlResetLastError();
15253 if (mem_base != xmlMemBlocks()) {
15254 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15255 xmlMemBlocks() - mem_base);
15257 printf(" %d", n_ctxt);
15258 printf(" %d", n_buffer);
15259 printf(" %d", n_filename);
15274 test_xmlStopParser(void) {
15277 #ifdef LIBXML_PUSH_ENABLED
15279 xmlParserCtxtPtr ctxt; /* an XML parser context */
15282 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15283 mem_base = xmlMemBlocks();
15284 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15286 xmlStopParser(ctxt);
15288 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15289 xmlResetLastError();
15290 if (mem_base != xmlMemBlocks()) {
15291 printf("Leak of %d blocks found in xmlStopParser",
15292 xmlMemBlocks() - mem_base);
15294 printf(" %d", n_ctxt);
15306 test_xmlSubstituteEntitiesDefault(void) {
15311 int val; /* int 0 or 1 */
15314 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15315 mem_base = xmlMemBlocks();
15316 val = gen_int(n_val, 0);
15318 ret_val = xmlSubstituteEntitiesDefault(val);
15319 desret_int(ret_val);
15321 des_int(n_val, val, 0);
15322 xmlResetLastError();
15323 if (mem_base != xmlMemBlocks()) {
15324 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15325 xmlMemBlocks() - mem_base);
15327 printf(" %d", n_val);
15337 test_parser(void) {
15340 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15341 test_ret += test_xmlByteConsumed();
15342 test_ret += test_xmlClearNodeInfoSeq();
15343 test_ret += test_xmlClearParserCtxt();
15344 test_ret += test_xmlCreateDocParserCtxt();
15345 test_ret += test_xmlCreatePushParserCtxt();
15346 test_ret += test_xmlCtxtReadDoc();
15347 test_ret += test_xmlCtxtReadFile();
15348 test_ret += test_xmlCtxtReadMemory();
15349 test_ret += test_xmlCtxtReset();
15350 test_ret += test_xmlCtxtResetPush();
15351 test_ret += test_xmlCtxtUseOptions();
15352 test_ret += test_xmlGetExternalEntityLoader();
15353 test_ret += test_xmlGetFeature();
15354 test_ret += test_xmlGetFeaturesList();
15355 test_ret += test_xmlHasFeature();
15356 test_ret += test_xmlIOParseDTD();
15357 test_ret += test_xmlInitNodeInfoSeq();
15358 test_ret += test_xmlInitParser();
15359 test_ret += test_xmlInitParserCtxt();
15360 test_ret += test_xmlKeepBlanksDefault();
15361 test_ret += test_xmlLineNumbersDefault();
15362 test_ret += test_xmlLoadExternalEntity();
15363 test_ret += test_xmlNewIOInputStream();
15364 test_ret += test_xmlNewParserCtxt();
15365 test_ret += test_xmlParseBalancedChunkMemory();
15366 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15367 test_ret += test_xmlParseChunk();
15368 test_ret += test_xmlParseCtxtExternalEntity();
15369 test_ret += test_xmlParseDTD();
15370 test_ret += test_xmlParseDoc();
15371 test_ret += test_xmlParseDocument();
15372 test_ret += test_xmlParseEntity();
15373 test_ret += test_xmlParseExtParsedEnt();
15374 test_ret += test_xmlParseExternalEntity();
15375 test_ret += test_xmlParseFile();
15376 test_ret += test_xmlParseInNodeContext();
15377 test_ret += test_xmlParseMemory();
15378 test_ret += test_xmlParserAddNodeInfo();
15379 test_ret += test_xmlParserFindNodeInfo();
15380 test_ret += test_xmlParserFindNodeInfoIndex();
15381 test_ret += test_xmlParserInputGrow();
15382 test_ret += test_xmlParserInputRead();
15383 test_ret += test_xmlPedanticParserDefault();
15384 test_ret += test_xmlReadDoc();
15385 test_ret += test_xmlReadFile();
15386 test_ret += test_xmlReadMemory();
15387 test_ret += test_xmlRecoverDoc();
15388 test_ret += test_xmlRecoverFile();
15389 test_ret += test_xmlRecoverMemory();
15390 test_ret += test_xmlSAXParseDTD();
15391 test_ret += test_xmlSAXParseDoc();
15392 test_ret += test_xmlSAXParseEntity();
15393 test_ret += test_xmlSAXParseFile();
15394 test_ret += test_xmlSAXParseFileWithData();
15395 test_ret += test_xmlSAXParseMemory();
15396 test_ret += test_xmlSAXParseMemoryWithData();
15397 test_ret += test_xmlSAXUserParseFile();
15398 test_ret += test_xmlSAXUserParseMemory();
15399 test_ret += test_xmlSetExternalEntityLoader();
15400 test_ret += test_xmlSetFeature();
15401 test_ret += test_xmlSetupParserForBuffer();
15402 test_ret += test_xmlStopParser();
15403 test_ret += test_xmlSubstituteEntitiesDefault();
15406 printf("Module parser: %d errors\n", test_ret);
15411 test_htmlCreateFileParserCtxt(void) {
15414 #if defined(LIBXML_HTML_ENABLED)
15416 htmlParserCtxtPtr ret_val;
15417 const char * filename; /* the filename */
15419 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15422 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15423 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15424 mem_base = xmlMemBlocks();
15425 filename = gen_fileoutput(n_filename, 0);
15426 encoding = gen_const_char_ptr(n_encoding, 1);
15428 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15429 desret_htmlParserCtxtPtr(ret_val);
15431 des_fileoutput(n_filename, filename, 0);
15432 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15433 xmlResetLastError();
15434 if (mem_base != xmlMemBlocks()) {
15435 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15436 xmlMemBlocks() - mem_base);
15438 printf(" %d", n_filename);
15439 printf(" %d", n_encoding);
15452 test_htmlInitAutoClose(void) {
15455 #if defined(LIBXML_HTML_ENABLED)
15458 mem_base = xmlMemBlocks();
15460 htmlInitAutoClose();
15462 xmlResetLastError();
15463 if (mem_base != xmlMemBlocks()) {
15464 printf("Leak of %d blocks found in htmlInitAutoClose",
15465 xmlMemBlocks() - mem_base);
15477 test_inputPop(void) {
15481 xmlParserInputPtr ret_val;
15482 xmlParserCtxtPtr ctxt; /* an XML parser context */
15485 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15486 mem_base = xmlMemBlocks();
15487 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15489 ret_val = inputPop(ctxt);
15490 desret_xmlParserInputPtr(ret_val);
15492 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15493 xmlResetLastError();
15494 if (mem_base != xmlMemBlocks()) {
15495 printf("Leak of %d blocks found in inputPop",
15496 xmlMemBlocks() - mem_base);
15498 printf(" %d", n_ctxt);
15509 test_inputPush(void) {
15514 xmlParserCtxtPtr ctxt; /* an XML parser context */
15516 xmlParserInputPtr value; /* the parser input */
15519 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15520 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15521 mem_base = xmlMemBlocks();
15522 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15523 value = gen_xmlParserInputPtr(n_value, 1);
15525 ret_val = inputPush(ctxt, value);
15526 desret_int(ret_val);
15528 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15529 des_xmlParserInputPtr(n_value, value, 1);
15530 xmlResetLastError();
15531 if (mem_base != xmlMemBlocks()) {
15532 printf("Leak of %d blocks found in inputPush",
15533 xmlMemBlocks() - mem_base);
15535 printf(" %d", n_ctxt);
15536 printf(" %d", n_value);
15548 test_namePop(void) {
15552 const xmlChar * ret_val;
15553 xmlParserCtxtPtr ctxt; /* an XML parser context */
15556 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15557 mem_base = xmlMemBlocks();
15558 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15560 ret_val = namePop(ctxt);
15561 desret_const_xmlChar_ptr(ret_val);
15563 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15564 xmlResetLastError();
15565 if (mem_base != xmlMemBlocks()) {
15566 printf("Leak of %d blocks found in namePop",
15567 xmlMemBlocks() - mem_base);
15569 printf(" %d", n_ctxt);
15580 test_namePush(void) {
15585 xmlParserCtxtPtr ctxt; /* an XML parser context */
15587 xmlChar * value; /* the element name */
15590 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15591 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15592 mem_base = xmlMemBlocks();
15593 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15594 value = gen_const_xmlChar_ptr(n_value, 1);
15596 ret_val = namePush(ctxt, (const xmlChar *)value);
15597 desret_int(ret_val);
15599 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15600 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15601 xmlResetLastError();
15602 if (mem_base != xmlMemBlocks()) {
15603 printf("Leak of %d blocks found in namePush",
15604 xmlMemBlocks() - mem_base);
15606 printf(" %d", n_ctxt);
15607 printf(" %d", n_value);
15619 test_nodePop(void) {
15623 xmlNodePtr ret_val;
15624 xmlParserCtxtPtr ctxt; /* an XML parser context */
15627 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15628 mem_base = xmlMemBlocks();
15629 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15631 ret_val = nodePop(ctxt);
15632 desret_xmlNodePtr(ret_val);
15634 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15635 xmlResetLastError();
15636 if (mem_base != xmlMemBlocks()) {
15637 printf("Leak of %d blocks found in nodePop",
15638 xmlMemBlocks() - mem_base);
15640 printf(" %d", n_ctxt);
15651 test_nodePush(void) {
15656 xmlParserCtxtPtr ctxt; /* an XML parser context */
15658 xmlNodePtr value; /* the element node */
15661 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15662 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15663 mem_base = xmlMemBlocks();
15664 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15665 value = gen_xmlNodePtr(n_value, 1);
15667 ret_val = nodePush(ctxt, value);
15668 desret_int(ret_val);
15670 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15671 des_xmlNodePtr(n_value, value, 1);
15672 xmlResetLastError();
15673 if (mem_base != xmlMemBlocks()) {
15674 printf("Leak of %d blocks found in nodePush",
15675 xmlMemBlocks() - mem_base);
15677 printf(" %d", n_ctxt);
15678 printf(" %d", n_value);
15690 test_xmlCheckLanguageID(void) {
15695 xmlChar * lang; /* pointer to the string value */
15698 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15699 mem_base = xmlMemBlocks();
15700 lang = gen_const_xmlChar_ptr(n_lang, 0);
15702 ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15703 desret_int(ret_val);
15705 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15706 xmlResetLastError();
15707 if (mem_base != xmlMemBlocks()) {
15708 printf("Leak of %d blocks found in xmlCheckLanguageID",
15709 xmlMemBlocks() - mem_base);
15711 printf(" %d", n_lang);
15722 test_xmlCopyChar(void) {
15727 int len; /* Ignored, compatibility */
15729 xmlChar * out; /* pointer to an array of xmlChar */
15731 int val; /* the char value */
15734 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15735 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15736 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15737 mem_base = xmlMemBlocks();
15738 len = gen_int(n_len, 0);
15739 out = gen_xmlChar_ptr(n_out, 1);
15740 val = gen_int(n_val, 2);
15742 ret_val = xmlCopyChar(len, out, val);
15743 desret_int(ret_val);
15745 des_int(n_len, len, 0);
15746 des_xmlChar_ptr(n_out, out, 1);
15747 des_int(n_val, val, 2);
15748 xmlResetLastError();
15749 if (mem_base != xmlMemBlocks()) {
15750 printf("Leak of %d blocks found in xmlCopyChar",
15751 xmlMemBlocks() - mem_base);
15753 printf(" %d", n_len);
15754 printf(" %d", n_out);
15755 printf(" %d", n_val);
15768 test_xmlCopyCharMultiByte(void) {
15773 xmlChar * out; /* pointer to an array of xmlChar */
15775 int val; /* the char value */
15778 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15779 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15780 mem_base = xmlMemBlocks();
15781 out = gen_xmlChar_ptr(n_out, 0);
15782 val = gen_int(n_val, 1);
15784 ret_val = xmlCopyCharMultiByte(out, val);
15785 desret_int(ret_val);
15787 des_xmlChar_ptr(n_out, out, 0);
15788 des_int(n_val, val, 1);
15789 xmlResetLastError();
15790 if (mem_base != xmlMemBlocks()) {
15791 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15792 xmlMemBlocks() - mem_base);
15794 printf(" %d", n_out);
15795 printf(" %d", n_val);
15807 test_xmlCreateEntityParserCtxt(void) {
15811 xmlParserCtxtPtr ret_val;
15812 xmlChar * URL; /* the entity URL */
15814 xmlChar * ID; /* the entity PUBLIC ID */
15816 xmlChar * base; /* a possible base for the target URI */
15819 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15820 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15821 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15822 mem_base = xmlMemBlocks();
15823 URL = gen_const_xmlChar_ptr(n_URL, 0);
15824 ID = gen_const_xmlChar_ptr(n_ID, 1);
15825 base = gen_const_xmlChar_ptr(n_base, 2);
15827 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15828 desret_xmlParserCtxtPtr(ret_val);
15830 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15831 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15832 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15833 xmlResetLastError();
15834 if (mem_base != xmlMemBlocks()) {
15835 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15836 xmlMemBlocks() - mem_base);
15838 printf(" %d", n_URL);
15839 printf(" %d", n_ID);
15840 printf(" %d", n_base);
15853 test_xmlCreateFileParserCtxt(void) {
15857 xmlParserCtxtPtr ret_val;
15858 const char * filename; /* the filename */
15861 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15862 mem_base = xmlMemBlocks();
15863 filename = gen_fileoutput(n_filename, 0);
15865 ret_val = xmlCreateFileParserCtxt(filename);
15866 desret_xmlParserCtxtPtr(ret_val);
15868 des_fileoutput(n_filename, filename, 0);
15869 xmlResetLastError();
15870 if (mem_base != xmlMemBlocks()) {
15871 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15872 xmlMemBlocks() - mem_base);
15874 printf(" %d", n_filename);
15885 test_xmlCreateMemoryParserCtxt(void) {
15889 xmlParserCtxtPtr ret_val;
15890 char * buffer; /* a pointer to a char array */
15892 int size; /* the size of the array */
15895 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15896 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15897 mem_base = xmlMemBlocks();
15898 buffer = gen_const_char_ptr(n_buffer, 0);
15899 size = gen_int(n_size, 1);
15901 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15902 desret_xmlParserCtxtPtr(ret_val);
15904 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15905 des_int(n_size, size, 1);
15906 xmlResetLastError();
15907 if (mem_base != xmlMemBlocks()) {
15908 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15909 xmlMemBlocks() - mem_base);
15911 printf(" %d", n_buffer);
15912 printf(" %d", n_size);
15924 test_xmlCreateURLParserCtxt(void) {
15928 xmlParserCtxtPtr ret_val;
15929 const char * filename; /* the filename or URL */
15931 int options; /* a combination of xmlParserOption */
15934 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15935 for (n_options = 0;n_options < gen_nb_int;n_options++) {
15936 mem_base = xmlMemBlocks();
15937 filename = gen_fileoutput(n_filename, 0);
15938 options = gen_int(n_options, 1);
15940 ret_val = xmlCreateURLParserCtxt(filename, options);
15941 desret_xmlParserCtxtPtr(ret_val);
15943 des_fileoutput(n_filename, filename, 0);
15944 des_int(n_options, options, 1);
15945 xmlResetLastError();
15946 if (mem_base != xmlMemBlocks()) {
15947 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15948 xmlMemBlocks() - mem_base);
15950 printf(" %d", n_filename);
15951 printf(" %d", n_options);
15963 test_xmlCurrentChar(void) {
15968 xmlParserCtxtPtr ctxt; /* the XML parser context */
15970 int * len; /* pointer to the length of the char read */
15973 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15974 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15975 mem_base = xmlMemBlocks();
15976 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15977 len = gen_int_ptr(n_len, 1);
15979 ret_val = xmlCurrentChar(ctxt, len);
15980 desret_int(ret_val);
15982 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15983 des_int_ptr(n_len, len, 1);
15984 xmlResetLastError();
15985 if (mem_base != xmlMemBlocks()) {
15986 printf("Leak of %d blocks found in xmlCurrentChar",
15987 xmlMemBlocks() - mem_base);
15989 printf(" %d", n_ctxt);
15990 printf(" %d", n_len);
16002 test_xmlErrMemory(void) {
16006 xmlParserCtxtPtr ctxt; /* an XML parser context */
16008 char * extra; /* extra informations */
16011 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16012 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16013 mem_base = xmlMemBlocks();
16014 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16015 extra = gen_const_char_ptr(n_extra, 1);
16017 xmlErrMemory(ctxt, (const char *)extra);
16019 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16020 des_const_char_ptr(n_extra, (const char *)extra, 1);
16021 xmlResetLastError();
16022 if (mem_base != xmlMemBlocks()) {
16023 printf("Leak of %d blocks found in xmlErrMemory",
16024 xmlMemBlocks() - mem_base);
16026 printf(" %d", n_ctxt);
16027 printf(" %d", n_extra);
16039 test_xmlIsLetter(void) {
16044 int c; /* an unicode character (int) */
16047 for (n_c = 0;n_c < gen_nb_int;n_c++) {
16048 mem_base = xmlMemBlocks();
16049 c = gen_int(n_c, 0);
16051 ret_val = xmlIsLetter(c);
16052 desret_int(ret_val);
16054 des_int(n_c, c, 0);
16055 xmlResetLastError();
16056 if (mem_base != xmlMemBlocks()) {
16057 printf("Leak of %d blocks found in xmlIsLetter",
16058 xmlMemBlocks() - mem_base);
16060 printf(" %d", n_c);
16071 test_xmlNewEntityInputStream(void) {
16075 xmlParserInputPtr ret_val;
16076 xmlParserCtxtPtr ctxt; /* an XML parser context */
16078 xmlEntityPtr entity; /* an Entity pointer */
16081 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16082 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16083 mem_base = xmlMemBlocks();
16084 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16085 entity = gen_xmlEntityPtr(n_entity, 1);
16087 ret_val = xmlNewEntityInputStream(ctxt, entity);
16088 desret_xmlParserInputPtr(ret_val);
16090 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16091 des_xmlEntityPtr(n_entity, entity, 1);
16092 xmlResetLastError();
16093 if (mem_base != xmlMemBlocks()) {
16094 printf("Leak of %d blocks found in xmlNewEntityInputStream",
16095 xmlMemBlocks() - mem_base);
16097 printf(" %d", n_ctxt);
16098 printf(" %d", n_entity);
16110 test_xmlNewInputFromFile(void) {
16114 xmlParserInputPtr ret_val;
16115 xmlParserCtxtPtr ctxt; /* an XML parser context */
16117 const char * filename; /* the filename to use as entity */
16120 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16121 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16122 mem_base = xmlMemBlocks();
16123 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16124 filename = gen_filepath(n_filename, 1);
16126 ret_val = xmlNewInputFromFile(ctxt, filename);
16127 desret_xmlParserInputPtr(ret_val);
16129 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16130 des_filepath(n_filename, filename, 1);
16131 xmlResetLastError();
16132 if (mem_base != xmlMemBlocks()) {
16133 printf("Leak of %d blocks found in xmlNewInputFromFile",
16134 xmlMemBlocks() - mem_base);
16136 printf(" %d", n_ctxt);
16137 printf(" %d", n_filename);
16149 test_xmlNewInputStream(void) {
16153 xmlParserInputPtr ret_val;
16154 xmlParserCtxtPtr ctxt; /* an XML parser context */
16157 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16158 mem_base = xmlMemBlocks();
16159 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16161 ret_val = xmlNewInputStream(ctxt);
16162 desret_xmlParserInputPtr(ret_val);
16164 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16165 xmlResetLastError();
16166 if (mem_base != xmlMemBlocks()) {
16167 printf("Leak of %d blocks found in xmlNewInputStream",
16168 xmlMemBlocks() - mem_base);
16170 printf(" %d", n_ctxt);
16181 test_xmlNewStringInputStream(void) {
16185 xmlParserInputPtr ret_val;
16186 xmlParserCtxtPtr ctxt; /* an XML parser context */
16188 xmlChar * buffer; /* an memory buffer */
16191 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16192 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16193 mem_base = xmlMemBlocks();
16194 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16195 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16197 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16198 desret_xmlParserInputPtr(ret_val);
16200 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16201 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16202 xmlResetLastError();
16203 if (mem_base != xmlMemBlocks()) {
16204 printf("Leak of %d blocks found in xmlNewStringInputStream",
16205 xmlMemBlocks() - mem_base);
16207 printf(" %d", n_ctxt);
16208 printf(" %d", n_buffer);
16220 test_xmlNextChar(void) {
16224 xmlParserCtxtPtr ctxt; /* the XML parser context */
16227 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16228 mem_base = xmlMemBlocks();
16229 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16233 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16234 xmlResetLastError();
16235 if (mem_base != xmlMemBlocks()) {
16236 printf("Leak of %d blocks found in xmlNextChar",
16237 xmlMemBlocks() - mem_base);
16239 printf(" %d", n_ctxt);
16250 test_xmlParserInputShrink(void) {
16254 xmlParserInputPtr in; /* an XML parser input */
16257 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16258 mem_base = xmlMemBlocks();
16259 in = gen_xmlParserInputPtr(n_in, 0);
16261 xmlParserInputShrink(in);
16263 des_xmlParserInputPtr(n_in, in, 0);
16264 xmlResetLastError();
16265 if (mem_base != xmlMemBlocks()) {
16266 printf("Leak of %d blocks found in xmlParserInputShrink",
16267 xmlMemBlocks() - mem_base);
16269 printf(" %d", n_in);
16280 test_xmlPopInput(void) {
16285 xmlParserCtxtPtr ctxt; /* an XML parser context */
16288 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16289 mem_base = xmlMemBlocks();
16290 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16292 ret_val = xmlPopInput(ctxt);
16293 desret_xmlChar(ret_val);
16295 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16296 xmlResetLastError();
16297 if (mem_base != xmlMemBlocks()) {
16298 printf("Leak of %d blocks found in xmlPopInput",
16299 xmlMemBlocks() - mem_base);
16301 printf(" %d", n_ctxt);
16312 test_xmlPushInput(void) {
16317 xmlParserCtxtPtr ctxt; /* an XML parser context */
16319 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16322 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16323 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16324 mem_base = xmlMemBlocks();
16325 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16326 input = gen_xmlParserInputPtr(n_input, 1);
16328 ret_val = xmlPushInput(ctxt, input);
16329 desret_int(ret_val);
16331 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16332 des_xmlParserInputPtr(n_input, input, 1);
16333 xmlResetLastError();
16334 if (mem_base != xmlMemBlocks()) {
16335 printf("Leak of %d blocks found in xmlPushInput",
16336 xmlMemBlocks() - mem_base);
16338 printf(" %d", n_ctxt);
16339 printf(" %d", n_input);
16351 test_xmlSetEntityReferenceFunc(void) {
16355 /* missing type support */
16361 test_xmlSplitQName(void) {
16366 xmlParserCtxtPtr ctxt; /* an XML parser context */
16368 xmlChar * name; /* an XML parser context */
16370 xmlChar ** prefix; /* a xmlChar ** */
16373 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16374 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16375 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16376 mem_base = xmlMemBlocks();
16377 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16378 name = gen_const_xmlChar_ptr(n_name, 1);
16379 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16381 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16382 desret_xmlChar_ptr(ret_val);
16384 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16385 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16386 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16387 xmlResetLastError();
16388 if (mem_base != xmlMemBlocks()) {
16389 printf("Leak of %d blocks found in xmlSplitQName",
16390 xmlMemBlocks() - mem_base);
16392 printf(" %d", n_ctxt);
16393 printf(" %d", n_name);
16394 printf(" %d", n_prefix);
16407 test_xmlStringCurrentChar(void) {
16412 xmlParserCtxtPtr ctxt; /* the XML parser context */
16414 xmlChar * cur; /* pointer to the beginning of the char */
16416 int * len; /* pointer to the length of the char read */
16419 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16420 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16421 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16422 mem_base = xmlMemBlocks();
16423 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16424 cur = gen_const_xmlChar_ptr(n_cur, 1);
16425 len = gen_int_ptr(n_len, 2);
16427 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16428 desret_int(ret_val);
16430 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16431 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16432 des_int_ptr(n_len, len, 2);
16433 xmlResetLastError();
16434 if (mem_base != xmlMemBlocks()) {
16435 printf("Leak of %d blocks found in xmlStringCurrentChar",
16436 xmlMemBlocks() - mem_base);
16438 printf(" %d", n_ctxt);
16439 printf(" %d", n_cur);
16440 printf(" %d", n_len);
16453 test_xmlStringDecodeEntities(void) {
16458 xmlParserCtxtPtr ctxt; /* the parser context */
16460 xmlChar * str; /* the input string */
16462 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16464 xmlChar end; /* an end marker xmlChar, 0 if none */
16466 xmlChar end2; /* an end marker xmlChar, 0 if none */
16468 xmlChar end3; /* an end marker xmlChar, 0 if none */
16471 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16472 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16473 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16474 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16475 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16476 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16477 mem_base = xmlMemBlocks();
16478 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16479 str = gen_const_xmlChar_ptr(n_str, 1);
16480 what = gen_int(n_what, 2);
16481 end = gen_xmlChar(n_end, 3);
16482 end2 = gen_xmlChar(n_end2, 4);
16483 end3 = gen_xmlChar(n_end3, 5);
16485 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16486 desret_xmlChar_ptr(ret_val);
16488 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16489 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16490 des_int(n_what, what, 2);
16491 des_xmlChar(n_end, end, 3);
16492 des_xmlChar(n_end2, end2, 4);
16493 des_xmlChar(n_end3, end3, 5);
16494 xmlResetLastError();
16495 if (mem_base != xmlMemBlocks()) {
16496 printf("Leak of %d blocks found in xmlStringDecodeEntities",
16497 xmlMemBlocks() - mem_base);
16499 printf(" %d", n_ctxt);
16500 printf(" %d", n_str);
16501 printf(" %d", n_what);
16502 printf(" %d", n_end);
16503 printf(" %d", n_end2);
16504 printf(" %d", n_end3);
16520 test_xmlStringLenDecodeEntities(void) {
16525 xmlParserCtxtPtr ctxt; /* the parser context */
16527 xmlChar * str; /* the input string */
16529 int len; /* the string length */
16531 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16533 xmlChar end; /* an end marker xmlChar, 0 if none */
16535 xmlChar end2; /* an end marker xmlChar, 0 if none */
16537 xmlChar end3; /* an end marker xmlChar, 0 if none */
16540 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16541 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16542 for (n_len = 0;n_len < gen_nb_int;n_len++) {
16543 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16544 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16545 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16546 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16547 mem_base = xmlMemBlocks();
16548 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16549 str = gen_const_xmlChar_ptr(n_str, 1);
16550 len = gen_int(n_len, 2);
16551 what = gen_int(n_what, 3);
16552 end = gen_xmlChar(n_end, 4);
16553 end2 = gen_xmlChar(n_end2, 5);
16554 end3 = gen_xmlChar(n_end3, 6);
16556 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16557 desret_xmlChar_ptr(ret_val);
16559 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16560 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16561 des_int(n_len, len, 2);
16562 des_int(n_what, what, 3);
16563 des_xmlChar(n_end, end, 4);
16564 des_xmlChar(n_end2, end2, 5);
16565 des_xmlChar(n_end3, end3, 6);
16566 xmlResetLastError();
16567 if (mem_base != xmlMemBlocks()) {
16568 printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16569 xmlMemBlocks() - mem_base);
16571 printf(" %d", n_ctxt);
16572 printf(" %d", n_str);
16573 printf(" %d", n_len);
16574 printf(" %d", n_what);
16575 printf(" %d", n_end);
16576 printf(" %d", n_end2);
16577 printf(" %d", n_end3);
16594 test_xmlSwitchEncoding(void) {
16599 xmlParserCtxtPtr ctxt; /* the parser context */
16601 xmlCharEncoding enc; /* the encoding value (number) */
16604 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16605 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16606 mem_base = xmlMemBlocks();
16607 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16608 enc = gen_xmlCharEncoding(n_enc, 1);
16610 ret_val = xmlSwitchEncoding(ctxt, enc);
16611 desret_int(ret_val);
16613 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16614 des_xmlCharEncoding(n_enc, enc, 1);
16615 xmlResetLastError();
16616 if (mem_base != xmlMemBlocks()) {
16617 printf("Leak of %d blocks found in xmlSwitchEncoding",
16618 xmlMemBlocks() - mem_base);
16620 printf(" %d", n_ctxt);
16621 printf(" %d", n_enc);
16633 test_xmlSwitchInputEncoding(void) {
16638 xmlParserCtxtPtr ctxt; /* the parser context */
16640 xmlParserInputPtr input; /* the input stream */
16642 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16645 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16646 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16647 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16648 mem_base = xmlMemBlocks();
16649 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16650 input = gen_xmlParserInputPtr(n_input, 1);
16651 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16653 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16654 desret_int(ret_val);
16656 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16657 des_xmlParserInputPtr(n_input, input, 1);
16658 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16659 xmlResetLastError();
16660 if (mem_base != xmlMemBlocks()) {
16661 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16662 xmlMemBlocks() - mem_base);
16664 printf(" %d", n_ctxt);
16665 printf(" %d", n_input);
16666 printf(" %d", n_handler);
16679 test_xmlSwitchToEncoding(void) {
16684 xmlParserCtxtPtr ctxt; /* the parser context */
16686 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16689 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16690 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16691 mem_base = xmlMemBlocks();
16692 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16693 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16695 ret_val = xmlSwitchToEncoding(ctxt, handler);
16696 desret_int(ret_val);
16698 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16699 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16700 xmlResetLastError();
16701 if (mem_base != xmlMemBlocks()) {
16702 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16703 xmlMemBlocks() - mem_base);
16705 printf(" %d", n_ctxt);
16706 printf(" %d", n_handler);
16717 test_parserInternals(void) {
16720 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16721 test_ret += test_htmlCreateFileParserCtxt();
16722 test_ret += test_htmlInitAutoClose();
16723 test_ret += test_inputPop();
16724 test_ret += test_inputPush();
16725 test_ret += test_namePop();
16726 test_ret += test_namePush();
16727 test_ret += test_nodePop();
16728 test_ret += test_nodePush();
16729 test_ret += test_xmlCheckLanguageID();
16730 test_ret += test_xmlCopyChar();
16731 test_ret += test_xmlCopyCharMultiByte();
16732 test_ret += test_xmlCreateEntityParserCtxt();
16733 test_ret += test_xmlCreateFileParserCtxt();
16734 test_ret += test_xmlCreateMemoryParserCtxt();
16735 test_ret += test_xmlCreateURLParserCtxt();
16736 test_ret += test_xmlCurrentChar();
16737 test_ret += test_xmlErrMemory();
16738 test_ret += test_xmlIsLetter();
16739 test_ret += test_xmlNewEntityInputStream();
16740 test_ret += test_xmlNewInputFromFile();
16741 test_ret += test_xmlNewInputStream();
16742 test_ret += test_xmlNewStringInputStream();
16743 test_ret += test_xmlNextChar();
16744 test_ret += test_xmlParserInputShrink();
16745 test_ret += test_xmlPopInput();
16746 test_ret += test_xmlPushInput();
16747 test_ret += test_xmlSetEntityReferenceFunc();
16748 test_ret += test_xmlSplitQName();
16749 test_ret += test_xmlStringCurrentChar();
16750 test_ret += test_xmlStringDecodeEntities();
16751 test_ret += test_xmlStringLenDecodeEntities();
16752 test_ret += test_xmlSwitchEncoding();
16753 test_ret += test_xmlSwitchInputEncoding();
16754 test_ret += test_xmlSwitchToEncoding();
16757 printf("Module parserInternals: %d errors\n", test_ret);
16762 test_xmlPatternFromRoot(void) {
16765 #if defined(LIBXML_PATTERN_ENABLED)
16768 xmlPatternPtr comp; /* the precompiled pattern */
16771 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16772 mem_base = xmlMemBlocks();
16773 comp = gen_xmlPatternPtr(n_comp, 0);
16775 ret_val = xmlPatternFromRoot(comp);
16776 desret_int(ret_val);
16778 des_xmlPatternPtr(n_comp, comp, 0);
16779 xmlResetLastError();
16780 if (mem_base != xmlMemBlocks()) {
16781 printf("Leak of %d blocks found in xmlPatternFromRoot",
16782 xmlMemBlocks() - mem_base);
16784 printf(" %d", n_comp);
16796 test_xmlPatternGetStreamCtxt(void) {
16800 /* missing type support */
16806 test_xmlPatternMatch(void) {
16809 #if defined(LIBXML_PATTERN_ENABLED)
16812 xmlPatternPtr comp; /* the precompiled pattern */
16814 xmlNodePtr node; /* a node */
16817 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16818 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16819 mem_base = xmlMemBlocks();
16820 comp = gen_xmlPatternPtr(n_comp, 0);
16821 node = gen_xmlNodePtr(n_node, 1);
16823 ret_val = xmlPatternMatch(comp, node);
16824 desret_int(ret_val);
16826 des_xmlPatternPtr(n_comp, comp, 0);
16827 des_xmlNodePtr(n_node, node, 1);
16828 xmlResetLastError();
16829 if (mem_base != xmlMemBlocks()) {
16830 printf("Leak of %d blocks found in xmlPatternMatch",
16831 xmlMemBlocks() - mem_base);
16833 printf(" %d", n_comp);
16834 printf(" %d", n_node);
16847 test_xmlPatternMaxDepth(void) {
16850 #if defined(LIBXML_PATTERN_ENABLED)
16853 xmlPatternPtr comp; /* the precompiled pattern */
16856 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16857 mem_base = xmlMemBlocks();
16858 comp = gen_xmlPatternPtr(n_comp, 0);
16860 ret_val = xmlPatternMaxDepth(comp);
16861 desret_int(ret_val);
16863 des_xmlPatternPtr(n_comp, comp, 0);
16864 xmlResetLastError();
16865 if (mem_base != xmlMemBlocks()) {
16866 printf("Leak of %d blocks found in xmlPatternMaxDepth",
16867 xmlMemBlocks() - mem_base);
16869 printf(" %d", n_comp);
16881 test_xmlPatternMinDepth(void) {
16884 #if defined(LIBXML_PATTERN_ENABLED)
16887 xmlPatternPtr comp; /* the precompiled pattern */
16890 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16891 mem_base = xmlMemBlocks();
16892 comp = gen_xmlPatternPtr(n_comp, 0);
16894 ret_val = xmlPatternMinDepth(comp);
16895 desret_int(ret_val);
16897 des_xmlPatternPtr(n_comp, comp, 0);
16898 xmlResetLastError();
16899 if (mem_base != xmlMemBlocks()) {
16900 printf("Leak of %d blocks found in xmlPatternMinDepth",
16901 xmlMemBlocks() - mem_base);
16903 printf(" %d", n_comp);
16915 test_xmlPatternStreamable(void) {
16918 #if defined(LIBXML_PATTERN_ENABLED)
16921 xmlPatternPtr comp; /* the precompiled pattern */
16924 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16925 mem_base = xmlMemBlocks();
16926 comp = gen_xmlPatternPtr(n_comp, 0);
16928 ret_val = xmlPatternStreamable(comp);
16929 desret_int(ret_val);
16931 des_xmlPatternPtr(n_comp, comp, 0);
16932 xmlResetLastError();
16933 if (mem_base != xmlMemBlocks()) {
16934 printf("Leak of %d blocks found in xmlPatternStreamable",
16935 xmlMemBlocks() - mem_base);
16937 printf(" %d", n_comp);
16949 test_xmlPatterncompile(void) {
16953 /* missing type support */
16957 #ifdef LIBXML_PATTERN_ENABLED
16959 #define gen_nb_xmlStreamCtxtPtr 1
16960 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16963 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16969 test_xmlStreamPop(void) {
16972 #if defined(LIBXML_PATTERN_ENABLED)
16975 xmlStreamCtxtPtr stream; /* the stream context */
16978 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16979 mem_base = xmlMemBlocks();
16980 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16982 ret_val = xmlStreamPop(stream);
16983 desret_int(ret_val);
16985 des_xmlStreamCtxtPtr(n_stream, stream, 0);
16986 xmlResetLastError();
16987 if (mem_base != xmlMemBlocks()) {
16988 printf("Leak of %d blocks found in xmlStreamPop",
16989 xmlMemBlocks() - mem_base);
16991 printf(" %d", n_stream);
17003 test_xmlStreamPush(void) {
17006 #if defined(LIBXML_PATTERN_ENABLED)
17009 xmlStreamCtxtPtr stream; /* the stream context */
17011 xmlChar * name; /* the current name */
17013 xmlChar * ns; /* the namespace name */
17016 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17017 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17018 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17019 mem_base = xmlMemBlocks();
17020 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17021 name = gen_const_xmlChar_ptr(n_name, 1);
17022 ns = gen_const_xmlChar_ptr(n_ns, 2);
17024 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17025 desret_int(ret_val);
17027 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17028 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17029 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17030 xmlResetLastError();
17031 if (mem_base != xmlMemBlocks()) {
17032 printf("Leak of %d blocks found in xmlStreamPush",
17033 xmlMemBlocks() - mem_base);
17035 printf(" %d", n_stream);
17036 printf(" %d", n_name);
17037 printf(" %d", n_ns);
17051 test_xmlStreamPushAttr(void) {
17054 #if defined(LIBXML_PATTERN_ENABLED)
17057 xmlStreamCtxtPtr stream; /* the stream context */
17059 xmlChar * name; /* the current name */
17061 xmlChar * ns; /* the namespace name */
17064 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17065 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17066 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17067 mem_base = xmlMemBlocks();
17068 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17069 name = gen_const_xmlChar_ptr(n_name, 1);
17070 ns = gen_const_xmlChar_ptr(n_ns, 2);
17072 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17073 desret_int(ret_val);
17075 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17076 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17077 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17078 xmlResetLastError();
17079 if (mem_base != xmlMemBlocks()) {
17080 printf("Leak of %d blocks found in xmlStreamPushAttr",
17081 xmlMemBlocks() - mem_base);
17083 printf(" %d", n_stream);
17084 printf(" %d", n_name);
17085 printf(" %d", n_ns);
17099 test_xmlStreamPushNode(void) {
17102 #if defined(LIBXML_PATTERN_ENABLED)
17105 xmlStreamCtxtPtr stream; /* the stream context */
17107 xmlChar * name; /* the current name */
17109 xmlChar * ns; /* the namespace name */
17111 int nodeType; /* the type of the node being pushed */
17114 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17115 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17116 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17117 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17118 mem_base = xmlMemBlocks();
17119 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17120 name = gen_const_xmlChar_ptr(n_name, 1);
17121 ns = gen_const_xmlChar_ptr(n_ns, 2);
17122 nodeType = gen_int(n_nodeType, 3);
17124 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17125 desret_int(ret_val);
17127 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17128 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17129 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17130 des_int(n_nodeType, nodeType, 3);
17131 xmlResetLastError();
17132 if (mem_base != xmlMemBlocks()) {
17133 printf("Leak of %d blocks found in xmlStreamPushNode",
17134 xmlMemBlocks() - mem_base);
17136 printf(" %d", n_stream);
17137 printf(" %d", n_name);
17138 printf(" %d", n_ns);
17139 printf(" %d", n_nodeType);
17154 test_xmlStreamWantsAnyNode(void) {
17157 #if defined(LIBXML_PATTERN_ENABLED)
17160 xmlStreamCtxtPtr streamCtxt; /* the stream context */
17163 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17164 mem_base = xmlMemBlocks();
17165 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17167 ret_val = xmlStreamWantsAnyNode(streamCtxt);
17168 desret_int(ret_val);
17170 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17171 xmlResetLastError();
17172 if (mem_base != xmlMemBlocks()) {
17173 printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17174 xmlMemBlocks() - mem_base);
17176 printf(" %d", n_streamCtxt);
17187 test_pattern(void) {
17190 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17191 test_ret += test_xmlPatternFromRoot();
17192 test_ret += test_xmlPatternGetStreamCtxt();
17193 test_ret += test_xmlPatternMatch();
17194 test_ret += test_xmlPatternMaxDepth();
17195 test_ret += test_xmlPatternMinDepth();
17196 test_ret += test_xmlPatternStreamable();
17197 test_ret += test_xmlPatterncompile();
17198 test_ret += test_xmlStreamPop();
17199 test_ret += test_xmlStreamPush();
17200 test_ret += test_xmlStreamPushAttr();
17201 test_ret += test_xmlStreamPushNode();
17202 test_ret += test_xmlStreamWantsAnyNode();
17205 printf("Module pattern: %d errors\n", test_ret);
17208 #ifdef LIBXML_SCHEMAS_ENABLED
17210 #define gen_nb_xmlRelaxNGPtr 1
17211 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17214 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17220 test_xmlRelaxNGDump(void) {
17223 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17225 FILE * output; /* the file output */
17227 xmlRelaxNGPtr schema; /* a schema structure */
17230 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17231 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17232 mem_base = xmlMemBlocks();
17233 output = gen_FILE_ptr(n_output, 0);
17234 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17236 xmlRelaxNGDump(output, schema);
17238 des_FILE_ptr(n_output, output, 0);
17239 des_xmlRelaxNGPtr(n_schema, schema, 1);
17240 xmlResetLastError();
17241 if (mem_base != xmlMemBlocks()) {
17242 printf("Leak of %d blocks found in xmlRelaxNGDump",
17243 xmlMemBlocks() - mem_base);
17245 printf(" %d", n_output);
17246 printf(" %d", n_schema);
17259 test_xmlRelaxNGDumpTree(void) {
17262 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17264 FILE * output; /* the file output */
17266 xmlRelaxNGPtr schema; /* a schema structure */
17269 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17270 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17271 mem_base = xmlMemBlocks();
17272 output = gen_FILE_ptr(n_output, 0);
17273 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17275 xmlRelaxNGDumpTree(output, schema);
17277 des_FILE_ptr(n_output, output, 0);
17278 des_xmlRelaxNGPtr(n_schema, schema, 1);
17279 xmlResetLastError();
17280 if (mem_base != xmlMemBlocks()) {
17281 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17282 xmlMemBlocks() - mem_base);
17284 printf(" %d", n_output);
17285 printf(" %d", n_schema);
17296 #ifdef LIBXML_SCHEMAS_ENABLED
17298 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17299 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17302 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17306 #ifdef LIBXML_SCHEMAS_ENABLED
17308 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17309 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17312 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17316 #ifdef LIBXML_SCHEMAS_ENABLED
17318 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17319 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17322 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17328 test_xmlRelaxNGGetParserErrors(void) {
17331 #if defined(LIBXML_SCHEMAS_ENABLED)
17334 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17336 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17338 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17340 void ** ctx; /* contextual data for the callbacks result */
17343 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17344 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17345 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17346 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17347 mem_base = xmlMemBlocks();
17348 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17349 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17350 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17351 ctx = gen_void_ptr_ptr(n_ctx, 3);
17353 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17354 desret_int(ret_val);
17356 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17357 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17358 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17359 des_void_ptr_ptr(n_ctx, ctx, 3);
17360 xmlResetLastError();
17361 if (mem_base != xmlMemBlocks()) {
17362 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17363 xmlMemBlocks() - mem_base);
17365 printf(" %d", n_ctxt);
17366 printf(" %d", n_err);
17367 printf(" %d", n_warn);
17368 printf(" %d", n_ctx);
17381 #ifdef LIBXML_SCHEMAS_ENABLED
17383 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17384 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17387 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17393 test_xmlRelaxNGGetValidErrors(void) {
17396 #if defined(LIBXML_SCHEMAS_ENABLED)
17399 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17401 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17403 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17405 void ** ctx; /* the functions context result */
17408 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17409 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17410 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17411 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17412 mem_base = xmlMemBlocks();
17413 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17414 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17415 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17416 ctx = gen_void_ptr_ptr(n_ctx, 3);
17418 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17419 desret_int(ret_val);
17421 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17422 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17423 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17424 des_void_ptr_ptr(n_ctx, ctx, 3);
17425 xmlResetLastError();
17426 if (mem_base != xmlMemBlocks()) {
17427 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17428 xmlMemBlocks() - mem_base);
17430 printf(" %d", n_ctxt);
17431 printf(" %d", n_err);
17432 printf(" %d", n_warn);
17433 printf(" %d", n_ctx);
17448 test_xmlRelaxNGInitTypes(void) {
17451 #if defined(LIBXML_SCHEMAS_ENABLED)
17455 mem_base = xmlMemBlocks();
17457 ret_val = xmlRelaxNGInitTypes();
17458 desret_int(ret_val);
17460 xmlResetLastError();
17461 if (mem_base != xmlMemBlocks()) {
17462 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17463 xmlMemBlocks() - mem_base);
17475 test_xmlRelaxNGNewDocParserCtxt(void) {
17478 #if defined(LIBXML_SCHEMAS_ENABLED)
17480 xmlRelaxNGParserCtxtPtr ret_val;
17481 xmlDocPtr doc; /* a preparsed document tree */
17484 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17485 mem_base = xmlMemBlocks();
17486 doc = gen_xmlDocPtr(n_doc, 0);
17488 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17489 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17491 des_xmlDocPtr(n_doc, doc, 0);
17492 xmlResetLastError();
17493 if (mem_base != xmlMemBlocks()) {
17494 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17495 xmlMemBlocks() - mem_base);
17497 printf(" %d", n_doc);
17509 test_xmlRelaxNGNewMemParserCtxt(void) {
17512 #if defined(LIBXML_SCHEMAS_ENABLED)
17514 xmlRelaxNGParserCtxtPtr ret_val;
17515 char * buffer; /* a pointer to a char array containing the schemas */
17517 int size; /* the size of the array */
17520 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17521 for (n_size = 0;n_size < gen_nb_int;n_size++) {
17522 mem_base = xmlMemBlocks();
17523 buffer = gen_const_char_ptr(n_buffer, 0);
17524 size = gen_int(n_size, 1);
17526 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17527 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17529 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17530 des_int(n_size, size, 1);
17531 xmlResetLastError();
17532 if (mem_base != xmlMemBlocks()) {
17533 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17534 xmlMemBlocks() - mem_base);
17536 printf(" %d", n_buffer);
17537 printf(" %d", n_size);
17550 test_xmlRelaxNGNewParserCtxt(void) {
17553 #if defined(LIBXML_SCHEMAS_ENABLED)
17555 xmlRelaxNGParserCtxtPtr ret_val;
17556 char * URL; /* the location of the schema */
17559 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17560 mem_base = xmlMemBlocks();
17561 URL = gen_const_char_ptr(n_URL, 0);
17563 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17564 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17566 des_const_char_ptr(n_URL, (const char *)URL, 0);
17567 xmlResetLastError();
17568 if (mem_base != xmlMemBlocks()) {
17569 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17570 xmlMemBlocks() - mem_base);
17572 printf(" %d", n_URL);
17584 test_xmlRelaxNGNewValidCtxt(void) {
17588 /* missing type support */
17594 test_xmlRelaxNGParse(void) {
17598 /* missing type support */
17604 test_xmlRelaxNGSetParserErrors(void) {
17608 /* missing type support */
17614 test_xmlRelaxNGSetParserStructuredErrors(void) {
17618 /* missing type support */
17624 test_xmlRelaxNGSetValidErrors(void) {
17628 /* missing type support */
17634 test_xmlRelaxNGSetValidStructuredErrors(void) {
17638 /* missing type support */
17644 test_xmlRelaxNGValidateDoc(void) {
17647 #if defined(LIBXML_SCHEMAS_ENABLED)
17650 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17652 xmlDocPtr doc; /* a parsed document tree */
17655 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17656 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17657 mem_base = xmlMemBlocks();
17658 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17659 doc = gen_xmlDocPtr(n_doc, 1);
17661 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17662 desret_int(ret_val);
17664 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17665 des_xmlDocPtr(n_doc, doc, 1);
17666 xmlResetLastError();
17667 if (mem_base != xmlMemBlocks()) {
17668 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17669 xmlMemBlocks() - mem_base);
17671 printf(" %d", n_ctxt);
17672 printf(" %d", n_doc);
17685 test_xmlRelaxNGValidateFullElement(void) {
17688 #if defined(LIBXML_SCHEMAS_ENABLED)
17691 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17693 xmlDocPtr doc; /* a document instance */
17695 xmlNodePtr elem; /* an element instance */
17698 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17699 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17700 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17701 mem_base = xmlMemBlocks();
17702 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17703 doc = gen_xmlDocPtr(n_doc, 1);
17704 elem = gen_xmlNodePtr(n_elem, 2);
17706 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17707 desret_int(ret_val);
17709 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17710 des_xmlDocPtr(n_doc, doc, 1);
17711 des_xmlNodePtr(n_elem, elem, 2);
17712 xmlResetLastError();
17713 if (mem_base != xmlMemBlocks()) {
17714 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17715 xmlMemBlocks() - mem_base);
17717 printf(" %d", n_ctxt);
17718 printf(" %d", n_doc);
17719 printf(" %d", n_elem);
17733 test_xmlRelaxNGValidatePopElement(void) {
17736 #if defined(LIBXML_SCHEMAS_ENABLED)
17739 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17741 xmlDocPtr doc; /* a document instance */
17743 xmlNodePtr elem; /* an element instance */
17746 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17747 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17748 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17749 mem_base = xmlMemBlocks();
17750 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17751 doc = gen_xmlDocPtr(n_doc, 1);
17752 elem = gen_xmlNodePtr(n_elem, 2);
17754 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17755 desret_int(ret_val);
17757 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17758 des_xmlDocPtr(n_doc, doc, 1);
17759 des_xmlNodePtr(n_elem, elem, 2);
17760 xmlResetLastError();
17761 if (mem_base != xmlMemBlocks()) {
17762 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17763 xmlMemBlocks() - mem_base);
17765 printf(" %d", n_ctxt);
17766 printf(" %d", n_doc);
17767 printf(" %d", n_elem);
17781 test_xmlRelaxNGValidatePushCData(void) {
17784 #if defined(LIBXML_SCHEMAS_ENABLED)
17787 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17789 xmlChar * data; /* some character data read */
17791 int len; /* the lenght of the data */
17794 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17795 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17796 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17797 mem_base = xmlMemBlocks();
17798 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17799 data = gen_const_xmlChar_ptr(n_data, 1);
17800 len = gen_int(n_len, 2);
17802 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17803 desret_int(ret_val);
17805 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17806 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17807 des_int(n_len, len, 2);
17808 xmlResetLastError();
17809 if (mem_base != xmlMemBlocks()) {
17810 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17811 xmlMemBlocks() - mem_base);
17813 printf(" %d", n_ctxt);
17814 printf(" %d", n_data);
17815 printf(" %d", n_len);
17829 test_xmlRelaxNGValidatePushElement(void) {
17832 #if defined(LIBXML_SCHEMAS_ENABLED)
17835 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17837 xmlDocPtr doc; /* a document instance */
17839 xmlNodePtr elem; /* an element instance */
17842 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17843 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17844 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17845 mem_base = xmlMemBlocks();
17846 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17847 doc = gen_xmlDocPtr(n_doc, 1);
17848 elem = gen_xmlNodePtr(n_elem, 2);
17850 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17851 desret_int(ret_val);
17853 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17854 des_xmlDocPtr(n_doc, doc, 1);
17855 des_xmlNodePtr(n_elem, elem, 2);
17856 xmlResetLastError();
17857 if (mem_base != xmlMemBlocks()) {
17858 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17859 xmlMemBlocks() - mem_base);
17861 printf(" %d", n_ctxt);
17862 printf(" %d", n_doc);
17863 printf(" %d", n_elem);
17877 test_xmlRelaxParserSetFlag(void) {
17880 #if defined(LIBXML_SCHEMAS_ENABLED)
17883 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17885 int flags; /* a set of flags values */
17888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17889 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17890 mem_base = xmlMemBlocks();
17891 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17892 flags = gen_int(n_flags, 1);
17894 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17895 desret_int(ret_val);
17897 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17898 des_int(n_flags, flags, 1);
17899 xmlResetLastError();
17900 if (mem_base != xmlMemBlocks()) {
17901 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17902 xmlMemBlocks() - mem_base);
17904 printf(" %d", n_ctxt);
17905 printf(" %d", n_flags);
17917 test_relaxng(void) {
17920 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17921 test_ret += test_xmlRelaxNGDump();
17922 test_ret += test_xmlRelaxNGDumpTree();
17923 test_ret += test_xmlRelaxNGGetParserErrors();
17924 test_ret += test_xmlRelaxNGGetValidErrors();
17925 test_ret += test_xmlRelaxNGInitTypes();
17926 test_ret += test_xmlRelaxNGNewDocParserCtxt();
17927 test_ret += test_xmlRelaxNGNewMemParserCtxt();
17928 test_ret += test_xmlRelaxNGNewParserCtxt();
17929 test_ret += test_xmlRelaxNGNewValidCtxt();
17930 test_ret += test_xmlRelaxNGParse();
17931 test_ret += test_xmlRelaxNGSetParserErrors();
17932 test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17933 test_ret += test_xmlRelaxNGSetValidErrors();
17934 test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17935 test_ret += test_xmlRelaxNGValidateDoc();
17936 test_ret += test_xmlRelaxNGValidateFullElement();
17937 test_ret += test_xmlRelaxNGValidatePopElement();
17938 test_ret += test_xmlRelaxNGValidatePushCData();
17939 test_ret += test_xmlRelaxNGValidatePushElement();
17940 test_ret += test_xmlRelaxParserSetFlag();
17943 printf("Module relaxng: %d errors\n", test_ret);
17947 test_schemasInternals(void) {
17950 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17953 printf("Module schemasInternals: %d errors\n", test_ret);
17958 test_xmlSchematronNewDocParserCtxt(void) {
17962 /* missing type support */
17968 test_xmlSchematronNewMemParserCtxt(void) {
17972 /* missing type support */
17978 test_xmlSchematronNewParserCtxt(void) {
17982 /* missing type support */
17986 #ifdef LIBXML_SCHEMATRON_ENABLED
17988 #define gen_nb_xmlSchematronPtr 1
17989 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17992 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17998 test_xmlSchematronNewValidCtxt(void) {
18002 /* missing type support */
18006 #ifdef LIBXML_SCHEMATRON_ENABLED
18008 #define gen_nb_xmlSchematronParserCtxtPtr 1
18009 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18012 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18018 test_xmlSchematronParse(void) {
18022 /* missing type support */
18026 #ifdef LIBXML_SCHEMATRON_ENABLED
18028 #define gen_nb_xmlSchematronValidCtxtPtr 1
18029 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18032 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18038 test_xmlSchematronSetValidStructuredErrors(void) {
18042 /* missing type support */
18048 test_xmlSchematronValidateDoc(void) {
18051 #if defined(LIBXML_SCHEMATRON_ENABLED)
18054 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18056 xmlDocPtr instance; /* the document instace tree */
18059 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18060 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18061 mem_base = xmlMemBlocks();
18062 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18063 instance = gen_xmlDocPtr(n_instance, 1);
18065 ret_val = xmlSchematronValidateDoc(ctxt, instance);
18066 desret_int(ret_val);
18068 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18069 des_xmlDocPtr(n_instance, instance, 1);
18070 xmlResetLastError();
18071 if (mem_base != xmlMemBlocks()) {
18072 printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18073 xmlMemBlocks() - mem_base);
18075 printf(" %d", n_ctxt);
18076 printf(" %d", n_instance);
18088 test_schematron(void) {
18091 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18092 test_ret += test_xmlSchematronNewDocParserCtxt();
18093 test_ret += test_xmlSchematronNewMemParserCtxt();
18094 test_ret += test_xmlSchematronNewParserCtxt();
18095 test_ret += test_xmlSchematronNewValidCtxt();
18096 test_ret += test_xmlSchematronParse();
18097 test_ret += test_xmlSchematronSetValidStructuredErrors();
18098 test_ret += test_xmlSchematronValidateDoc();
18101 printf("Module schematron: %d errors\n", test_ret);
18106 test_xmlAddChild(void) {
18110 xmlNodePtr ret_val;
18111 xmlNodePtr parent; /* the parent node */
18113 xmlNodePtr cur; /* the child node */
18116 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18117 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18118 mem_base = xmlMemBlocks();
18119 parent = gen_xmlNodePtr(n_parent, 0);
18120 cur = gen_xmlNodePtr_in(n_cur, 1);
18122 ret_val = xmlAddChild(parent, cur);
18123 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18124 desret_xmlNodePtr(ret_val);
18126 des_xmlNodePtr(n_parent, parent, 0);
18127 des_xmlNodePtr_in(n_cur, cur, 1);
18128 xmlResetLastError();
18129 if (mem_base != xmlMemBlocks()) {
18130 printf("Leak of %d blocks found in xmlAddChild",
18131 xmlMemBlocks() - mem_base);
18133 printf(" %d", n_parent);
18134 printf(" %d", n_cur);
18146 test_xmlAddChildList(void) {
18150 xmlNodePtr ret_val;
18151 xmlNodePtr parent; /* the parent node */
18153 xmlNodePtr cur; /* the first node in the list */
18156 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18157 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18158 mem_base = xmlMemBlocks();
18159 parent = gen_xmlNodePtr(n_parent, 0);
18160 cur = gen_xmlNodePtr_in(n_cur, 1);
18162 ret_val = xmlAddChildList(parent, cur);
18163 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18164 desret_xmlNodePtr(ret_val);
18166 des_xmlNodePtr(n_parent, parent, 0);
18167 des_xmlNodePtr_in(n_cur, cur, 1);
18168 xmlResetLastError();
18169 if (mem_base != xmlMemBlocks()) {
18170 printf("Leak of %d blocks found in xmlAddChildList",
18171 xmlMemBlocks() - mem_base);
18173 printf(" %d", n_parent);
18174 printf(" %d", n_cur);
18186 test_xmlAddNextSibling(void) {
18190 xmlNodePtr ret_val;
18191 xmlNodePtr cur; /* the child node */
18193 xmlNodePtr elem; /* the new node */
18196 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18197 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18198 mem_base = xmlMemBlocks();
18199 cur = gen_xmlNodePtr(n_cur, 0);
18200 elem = gen_xmlNodePtr_in(n_elem, 1);
18202 ret_val = xmlAddNextSibling(cur, elem);
18203 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18204 desret_xmlNodePtr(ret_val);
18206 des_xmlNodePtr(n_cur, cur, 0);
18207 des_xmlNodePtr_in(n_elem, elem, 1);
18208 xmlResetLastError();
18209 if (mem_base != xmlMemBlocks()) {
18210 printf("Leak of %d blocks found in xmlAddNextSibling",
18211 xmlMemBlocks() - mem_base);
18213 printf(" %d", n_cur);
18214 printf(" %d", n_elem);
18226 test_xmlAddPrevSibling(void) {
18229 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18231 xmlNodePtr ret_val;
18232 xmlNodePtr cur; /* the child node */
18234 xmlNodePtr elem; /* the new node */
18237 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18238 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18239 mem_base = xmlMemBlocks();
18240 cur = gen_xmlNodePtr(n_cur, 0);
18241 elem = gen_xmlNodePtr_in(n_elem, 1);
18243 ret_val = xmlAddPrevSibling(cur, elem);
18244 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18245 desret_xmlNodePtr(ret_val);
18247 des_xmlNodePtr(n_cur, cur, 0);
18248 des_xmlNodePtr_in(n_elem, elem, 1);
18249 xmlResetLastError();
18250 if (mem_base != xmlMemBlocks()) {
18251 printf("Leak of %d blocks found in xmlAddPrevSibling",
18252 xmlMemBlocks() - mem_base);
18254 printf(" %d", n_cur);
18255 printf(" %d", n_elem);
18268 test_xmlAddSibling(void) {
18272 xmlNodePtr ret_val;
18273 xmlNodePtr cur; /* the child node */
18275 xmlNodePtr elem; /* the new node */
18278 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18279 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18280 mem_base = xmlMemBlocks();
18281 cur = gen_xmlNodePtr(n_cur, 0);
18282 elem = gen_xmlNodePtr_in(n_elem, 1);
18284 ret_val = xmlAddSibling(cur, elem);
18285 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18286 desret_xmlNodePtr(ret_val);
18288 des_xmlNodePtr(n_cur, cur, 0);
18289 des_xmlNodePtr_in(n_elem, elem, 1);
18290 xmlResetLastError();
18291 if (mem_base != xmlMemBlocks()) {
18292 printf("Leak of %d blocks found in xmlAddSibling",
18293 xmlMemBlocks() - mem_base);
18295 printf(" %d", n_cur);
18296 printf(" %d", n_elem);
18308 test_xmlAttrSerializeTxtContent(void) {
18311 #if defined(LIBXML_OUTPUT_ENABLED)
18312 #ifdef LIBXML_OUTPUT_ENABLED
18314 xmlBufferPtr buf; /* the XML buffer output */
18316 xmlDocPtr doc; /* the document */
18318 xmlAttrPtr attr; /* the attribute node */
18320 xmlChar * string; /* the text content */
18323 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18324 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18325 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18326 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18327 mem_base = xmlMemBlocks();
18328 buf = gen_xmlBufferPtr(n_buf, 0);
18329 doc = gen_xmlDocPtr(n_doc, 1);
18330 attr = gen_xmlAttrPtr(n_attr, 2);
18331 string = gen_const_xmlChar_ptr(n_string, 3);
18333 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18335 des_xmlBufferPtr(n_buf, buf, 0);
18336 des_xmlDocPtr(n_doc, doc, 1);
18337 des_xmlAttrPtr(n_attr, attr, 2);
18338 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18339 xmlResetLastError();
18340 if (mem_base != xmlMemBlocks()) {
18341 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18342 xmlMemBlocks() - mem_base);
18344 printf(" %d", n_buf);
18345 printf(" %d", n_doc);
18346 printf(" %d", n_attr);
18347 printf(" %d", n_string);
18363 test_xmlBufferAdd(void) {
18368 xmlBufferPtr buf; /* the buffer to dump */
18370 xmlChar * str; /* the #xmlChar string */
18372 int len; /* the number of #xmlChar to add */
18375 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18376 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18377 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18378 mem_base = xmlMemBlocks();
18379 buf = gen_xmlBufferPtr(n_buf, 0);
18380 str = gen_const_xmlChar_ptr(n_str, 1);
18381 len = gen_int(n_len, 2);
18383 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18384 desret_int(ret_val);
18386 des_xmlBufferPtr(n_buf, buf, 0);
18387 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18388 des_int(n_len, len, 2);
18389 xmlResetLastError();
18390 if (mem_base != xmlMemBlocks()) {
18391 printf("Leak of %d blocks found in xmlBufferAdd",
18392 xmlMemBlocks() - mem_base);
18394 printf(" %d", n_buf);
18395 printf(" %d", n_str);
18396 printf(" %d", n_len);
18409 test_xmlBufferAddHead(void) {
18414 xmlBufferPtr buf; /* the buffer */
18416 xmlChar * str; /* the #xmlChar string */
18418 int len; /* the number of #xmlChar to add */
18421 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18422 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18423 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18424 mem_base = xmlMemBlocks();
18425 buf = gen_xmlBufferPtr(n_buf, 0);
18426 str = gen_const_xmlChar_ptr(n_str, 1);
18427 len = gen_int(n_len, 2);
18429 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18430 desret_int(ret_val);
18432 des_xmlBufferPtr(n_buf, buf, 0);
18433 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18434 des_int(n_len, len, 2);
18435 xmlResetLastError();
18436 if (mem_base != xmlMemBlocks()) {
18437 printf("Leak of %d blocks found in xmlBufferAddHead",
18438 xmlMemBlocks() - mem_base);
18440 printf(" %d", n_buf);
18441 printf(" %d", n_str);
18442 printf(" %d", n_len);
18455 test_xmlBufferCCat(void) {
18460 xmlBufferPtr buf; /* the buffer to dump */
18462 char * str; /* the C char string */
18465 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18466 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18467 mem_base = xmlMemBlocks();
18468 buf = gen_xmlBufferPtr(n_buf, 0);
18469 str = gen_const_char_ptr(n_str, 1);
18471 ret_val = xmlBufferCCat(buf, (const char *)str);
18472 desret_int(ret_val);
18474 des_xmlBufferPtr(n_buf, buf, 0);
18475 des_const_char_ptr(n_str, (const char *)str, 1);
18476 xmlResetLastError();
18477 if (mem_base != xmlMemBlocks()) {
18478 printf("Leak of %d blocks found in xmlBufferCCat",
18479 xmlMemBlocks() - mem_base);
18481 printf(" %d", n_buf);
18482 printf(" %d", n_str);
18494 test_xmlBufferCat(void) {
18499 xmlBufferPtr buf; /* the buffer to add to */
18501 xmlChar * str; /* the #xmlChar string */
18504 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18505 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18506 mem_base = xmlMemBlocks();
18507 buf = gen_xmlBufferPtr(n_buf, 0);
18508 str = gen_const_xmlChar_ptr(n_str, 1);
18510 ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18511 desret_int(ret_val);
18513 des_xmlBufferPtr(n_buf, buf, 0);
18514 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18515 xmlResetLastError();
18516 if (mem_base != xmlMemBlocks()) {
18517 printf("Leak of %d blocks found in xmlBufferCat",
18518 xmlMemBlocks() - mem_base);
18520 printf(" %d", n_buf);
18521 printf(" %d", n_str);
18532 #define gen_nb_const_xmlBufferPtr 1
18533 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18536 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18540 test_xmlBufferContent(void) {
18544 const xmlChar * ret_val;
18545 xmlBufferPtr buf; /* the buffer */
18548 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18549 mem_base = xmlMemBlocks();
18550 buf = gen_const_xmlBufferPtr(n_buf, 0);
18552 ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18553 desret_const_xmlChar_ptr(ret_val);
18555 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18556 xmlResetLastError();
18557 if (mem_base != xmlMemBlocks()) {
18558 printf("Leak of %d blocks found in xmlBufferContent",
18559 xmlMemBlocks() - mem_base);
18561 printf(" %d", n_buf);
18572 test_xmlBufferCreate(void) {
18576 xmlBufferPtr ret_val;
18578 mem_base = xmlMemBlocks();
18580 ret_val = xmlBufferCreate();
18581 desret_xmlBufferPtr(ret_val);
18583 xmlResetLastError();
18584 if (mem_base != xmlMemBlocks()) {
18585 printf("Leak of %d blocks found in xmlBufferCreate",
18586 xmlMemBlocks() - mem_base);
18597 test_xmlBufferCreateSize(void) {
18601 /* missing type support */
18607 test_xmlBufferCreateStatic(void) {
18611 /* missing type support */
18617 test_xmlBufferEmpty(void) {
18621 xmlBufferPtr buf; /* the buffer */
18624 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18625 mem_base = xmlMemBlocks();
18626 buf = gen_xmlBufferPtr(n_buf, 0);
18628 xmlBufferEmpty(buf);
18630 des_xmlBufferPtr(n_buf, buf, 0);
18631 xmlResetLastError();
18632 if (mem_base != xmlMemBlocks()) {
18633 printf("Leak of %d blocks found in xmlBufferEmpty",
18634 xmlMemBlocks() - mem_base);
18636 printf(" %d", n_buf);
18647 test_xmlBufferGrow(void) {
18652 xmlBufferPtr buf; /* the buffer */
18654 unsigned int len; /* the minimum free size to allocate */
18657 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18658 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18659 mem_base = xmlMemBlocks();
18660 buf = gen_xmlBufferPtr(n_buf, 0);
18661 len = gen_unsigned_int(n_len, 1);
18663 ret_val = xmlBufferGrow(buf, len);
18664 desret_int(ret_val);
18666 des_xmlBufferPtr(n_buf, buf, 0);
18667 des_unsigned_int(n_len, len, 1);
18668 xmlResetLastError();
18669 if (mem_base != xmlMemBlocks()) {
18670 printf("Leak of %d blocks found in xmlBufferGrow",
18671 xmlMemBlocks() - mem_base);
18673 printf(" %d", n_buf);
18674 printf(" %d", n_len);
18686 test_xmlBufferLength(void) {
18691 xmlBufferPtr buf; /* the buffer */
18694 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18695 mem_base = xmlMemBlocks();
18696 buf = gen_const_xmlBufferPtr(n_buf, 0);
18698 ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18699 desret_int(ret_val);
18701 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18702 xmlResetLastError();
18703 if (mem_base != xmlMemBlocks()) {
18704 printf("Leak of %d blocks found in xmlBufferLength",
18705 xmlMemBlocks() - mem_base);
18707 printf(" %d", n_buf);
18718 test_xmlBufferResize(void) {
18723 xmlBufferPtr buf; /* the buffer to resize */
18725 unsigned int size; /* the desired size */
18728 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18729 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18730 mem_base = xmlMemBlocks();
18731 buf = gen_xmlBufferPtr(n_buf, 0);
18732 size = gen_unsigned_int(n_size, 1);
18734 ret_val = xmlBufferResize(buf, size);
18735 desret_int(ret_val);
18737 des_xmlBufferPtr(n_buf, buf, 0);
18738 des_unsigned_int(n_size, size, 1);
18739 xmlResetLastError();
18740 if (mem_base != xmlMemBlocks()) {
18741 printf("Leak of %d blocks found in xmlBufferResize",
18742 xmlMemBlocks() - mem_base);
18744 printf(" %d", n_buf);
18745 printf(" %d", n_size);
18757 test_xmlBufferSetAllocationScheme(void) {
18761 xmlBufferPtr buf; /* the buffer to tune */
18763 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18766 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18767 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18768 mem_base = xmlMemBlocks();
18769 buf = gen_xmlBufferPtr(n_buf, 0);
18770 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18772 xmlBufferSetAllocationScheme(buf, scheme);
18773 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18775 des_xmlBufferPtr(n_buf, buf, 0);
18776 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18777 xmlResetLastError();
18778 if (mem_base != xmlMemBlocks()) {
18779 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18780 xmlMemBlocks() - mem_base);
18782 printf(" %d", n_buf);
18783 printf(" %d", n_scheme);
18795 test_xmlBufferShrink(void) {
18800 xmlBufferPtr buf; /* the buffer to dump */
18802 unsigned int len; /* the number of xmlChar to remove */
18805 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18806 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18807 mem_base = xmlMemBlocks();
18808 buf = gen_xmlBufferPtr(n_buf, 0);
18809 len = gen_unsigned_int(n_len, 1);
18811 ret_val = xmlBufferShrink(buf, len);
18812 desret_int(ret_val);
18814 des_xmlBufferPtr(n_buf, buf, 0);
18815 des_unsigned_int(n_len, len, 1);
18816 xmlResetLastError();
18817 if (mem_base != xmlMemBlocks()) {
18818 printf("Leak of %d blocks found in xmlBufferShrink",
18819 xmlMemBlocks() - mem_base);
18821 printf(" %d", n_buf);
18822 printf(" %d", n_len);
18834 test_xmlBufferWriteCHAR(void) {
18838 xmlBufferPtr buf; /* the XML buffer */
18840 xmlChar * string; /* the string to add */
18843 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18844 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18845 mem_base = xmlMemBlocks();
18846 buf = gen_xmlBufferPtr(n_buf, 0);
18847 string = gen_const_xmlChar_ptr(n_string, 1);
18849 xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18851 des_xmlBufferPtr(n_buf, buf, 0);
18852 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18853 xmlResetLastError();
18854 if (mem_base != xmlMemBlocks()) {
18855 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18856 xmlMemBlocks() - mem_base);
18858 printf(" %d", n_buf);
18859 printf(" %d", n_string);
18871 test_xmlBufferWriteChar(void) {
18875 xmlBufferPtr buf; /* the XML buffer output */
18877 char * string; /* the string to add */
18880 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18881 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18882 mem_base = xmlMemBlocks();
18883 buf = gen_xmlBufferPtr(n_buf, 0);
18884 string = gen_const_char_ptr(n_string, 1);
18886 xmlBufferWriteChar(buf, (const char *)string);
18888 des_xmlBufferPtr(n_buf, buf, 0);
18889 des_const_char_ptr(n_string, (const char *)string, 1);
18890 xmlResetLastError();
18891 if (mem_base != xmlMemBlocks()) {
18892 printf("Leak of %d blocks found in xmlBufferWriteChar",
18893 xmlMemBlocks() - mem_base);
18895 printf(" %d", n_buf);
18896 printf(" %d", n_string);
18908 test_xmlBufferWriteQuotedString(void) {
18912 xmlBufferPtr buf; /* the XML buffer output */
18914 xmlChar * string; /* the string to add */
18917 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18918 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18919 mem_base = xmlMemBlocks();
18920 buf = gen_xmlBufferPtr(n_buf, 0);
18921 string = gen_const_xmlChar_ptr(n_string, 1);
18923 xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18925 des_xmlBufferPtr(n_buf, buf, 0);
18926 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18927 xmlResetLastError();
18928 if (mem_base != xmlMemBlocks()) {
18929 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18930 xmlMemBlocks() - mem_base);
18932 printf(" %d", n_buf);
18933 printf(" %d", n_string);
18945 test_xmlBuildQName(void) {
18950 xmlChar * ncname; /* the Name */
18952 xmlChar * prefix; /* the prefix */
18954 xmlChar * memory; /* preallocated memory */
18956 int len; /* preallocated memory length */
18959 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18960 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18961 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18962 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18963 mem_base = xmlMemBlocks();
18964 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18965 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18966 memory = gen_xmlChar_ptr(n_memory, 2);
18967 len = gen_int(n_len, 3);
18969 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18970 if ((ret_val != NULL) && (ret_val != ncname) &&
18971 (ret_val != prefix) && (ret_val != memory))
18974 desret_xmlChar_ptr(ret_val);
18976 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18977 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18978 des_xmlChar_ptr(n_memory, memory, 2);
18979 des_int(n_len, len, 3);
18980 xmlResetLastError();
18981 if (mem_base != xmlMemBlocks()) {
18982 printf("Leak of %d blocks found in xmlBuildQName",
18983 xmlMemBlocks() - mem_base);
18985 printf(" %d", n_ncname);
18986 printf(" %d", n_prefix);
18987 printf(" %d", n_memory);
18988 printf(" %d", n_len);
19002 test_xmlChildElementCount(void) {
19005 #if defined(LIBXML_TREE_ENABLED)
19007 unsigned long ret_val;
19008 xmlNodePtr parent; /* the parent node */
19011 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19012 mem_base = xmlMemBlocks();
19013 parent = gen_xmlNodePtr(n_parent, 0);
19015 ret_val = xmlChildElementCount(parent);
19016 desret_unsigned_long(ret_val);
19018 des_xmlNodePtr(n_parent, parent, 0);
19019 xmlResetLastError();
19020 if (mem_base != xmlMemBlocks()) {
19021 printf("Leak of %d blocks found in xmlChildElementCount",
19022 xmlMemBlocks() - mem_base);
19024 printf(" %d", n_parent);
19036 test_xmlCopyDoc(void) {
19039 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19042 xmlDocPtr doc; /* the document */
19044 int recursive; /* if not zero do a recursive copy. */
19047 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19048 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19049 mem_base = xmlMemBlocks();
19050 doc = gen_xmlDocPtr(n_doc, 0);
19051 recursive = gen_int(n_recursive, 1);
19053 ret_val = xmlCopyDoc(doc, recursive);
19054 desret_xmlDocPtr(ret_val);
19056 des_xmlDocPtr(n_doc, doc, 0);
19057 des_int(n_recursive, recursive, 1);
19058 xmlResetLastError();
19059 if (mem_base != xmlMemBlocks()) {
19060 printf("Leak of %d blocks found in xmlCopyDoc",
19061 xmlMemBlocks() - mem_base);
19063 printf(" %d", n_doc);
19064 printf(" %d", n_recursive);
19077 test_xmlCopyDtd(void) {
19080 #if defined(LIBXML_TREE_ENABLED)
19083 xmlDtdPtr dtd; /* the dtd */
19086 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19087 mem_base = xmlMemBlocks();
19088 dtd = gen_xmlDtdPtr(n_dtd, 0);
19090 ret_val = xmlCopyDtd(dtd);
19091 desret_xmlDtdPtr(ret_val);
19093 des_xmlDtdPtr(n_dtd, dtd, 0);
19094 xmlResetLastError();
19095 if (mem_base != xmlMemBlocks()) {
19096 printf("Leak of %d blocks found in xmlCopyDtd",
19097 xmlMemBlocks() - mem_base);
19099 printf(" %d", n_dtd);
19111 test_xmlCopyNamespace(void) {
19116 xmlNsPtr cur; /* the namespace */
19119 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19120 mem_base = xmlMemBlocks();
19121 cur = gen_xmlNsPtr(n_cur, 0);
19123 ret_val = xmlCopyNamespace(cur);
19124 if (ret_val != NULL) xmlFreeNs(ret_val);
19125 desret_xmlNsPtr(ret_val);
19127 des_xmlNsPtr(n_cur, cur, 0);
19128 xmlResetLastError();
19129 if (mem_base != xmlMemBlocks()) {
19130 printf("Leak of %d blocks found in xmlCopyNamespace",
19131 xmlMemBlocks() - mem_base);
19133 printf(" %d", n_cur);
19144 test_xmlCopyNamespaceList(void) {
19149 xmlNsPtr cur; /* the first namespace */
19152 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19153 mem_base = xmlMemBlocks();
19154 cur = gen_xmlNsPtr(n_cur, 0);
19156 ret_val = xmlCopyNamespaceList(cur);
19157 if (ret_val != NULL) xmlFreeNsList(ret_val);
19158 desret_xmlNsPtr(ret_val);
19160 des_xmlNsPtr(n_cur, cur, 0);
19161 xmlResetLastError();
19162 if (mem_base != xmlMemBlocks()) {
19163 printf("Leak of %d blocks found in xmlCopyNamespaceList",
19164 xmlMemBlocks() - mem_base);
19166 printf(" %d", n_cur);
19177 test_xmlCopyNode(void) {
19181 xmlNodePtr ret_val;
19182 xmlNodePtr node; /* the node */
19184 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19187 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19188 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19189 mem_base = xmlMemBlocks();
19190 node = gen_const_xmlNodePtr(n_node, 0);
19191 extended = gen_int(n_extended, 1);
19193 ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19194 desret_xmlNodePtr(ret_val);
19196 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19197 des_int(n_extended, extended, 1);
19198 xmlResetLastError();
19199 if (mem_base != xmlMemBlocks()) {
19200 printf("Leak of %d blocks found in xmlCopyNode",
19201 xmlMemBlocks() - mem_base);
19203 printf(" %d", n_node);
19204 printf(" %d", n_extended);
19216 test_xmlCopyNodeList(void) {
19220 xmlNodePtr ret_val;
19221 xmlNodePtr node; /* the first node in the list. */
19224 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19225 mem_base = xmlMemBlocks();
19226 node = gen_const_xmlNodePtr(n_node, 0);
19228 ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19229 desret_xmlNodePtr(ret_val);
19231 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19232 xmlResetLastError();
19233 if (mem_base != xmlMemBlocks()) {
19234 printf("Leak of %d blocks found in xmlCopyNodeList",
19235 xmlMemBlocks() - mem_base);
19237 printf(" %d", n_node);
19248 test_xmlCopyProp(void) {
19252 xmlAttrPtr ret_val;
19253 xmlNodePtr target; /* the element where the attribute will be grafted */
19255 xmlAttrPtr cur; /* the attribute */
19258 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19259 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19260 mem_base = xmlMemBlocks();
19261 target = gen_xmlNodePtr(n_target, 0);
19262 cur = gen_xmlAttrPtr(n_cur, 1);
19264 ret_val = xmlCopyProp(target, cur);
19265 desret_xmlAttrPtr(ret_val);
19267 des_xmlNodePtr(n_target, target, 0);
19268 des_xmlAttrPtr(n_cur, cur, 1);
19269 xmlResetLastError();
19270 if (mem_base != xmlMemBlocks()) {
19271 printf("Leak of %d blocks found in xmlCopyProp",
19272 xmlMemBlocks() - mem_base);
19274 printf(" %d", n_target);
19275 printf(" %d", n_cur);
19287 test_xmlCopyPropList(void) {
19291 xmlAttrPtr ret_val;
19292 xmlNodePtr target; /* the element where the attributes will be grafted */
19294 xmlAttrPtr cur; /* the first attribute */
19297 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19298 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19299 mem_base = xmlMemBlocks();
19300 target = gen_xmlNodePtr(n_target, 0);
19301 cur = gen_xmlAttrPtr(n_cur, 1);
19303 ret_val = xmlCopyPropList(target, cur);
19304 desret_xmlAttrPtr(ret_val);
19306 des_xmlNodePtr(n_target, target, 0);
19307 des_xmlAttrPtr(n_cur, cur, 1);
19308 xmlResetLastError();
19309 if (mem_base != xmlMemBlocks()) {
19310 printf("Leak of %d blocks found in xmlCopyPropList",
19311 xmlMemBlocks() - mem_base);
19313 printf(" %d", n_target);
19314 printf(" %d", n_cur);
19326 test_xmlCreateIntSubset(void) {
19331 xmlDocPtr doc; /* the document pointer */
19333 xmlChar * name; /* the DTD name */
19335 xmlChar * ExternalID; /* the external (PUBLIC) ID */
19337 xmlChar * SystemID; /* the system ID */
19340 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19341 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19342 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19343 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19344 mem_base = xmlMemBlocks();
19345 doc = gen_xmlDocPtr(n_doc, 0);
19346 name = gen_const_xmlChar_ptr(n_name, 1);
19347 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19348 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19350 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19351 desret_xmlDtdPtr(ret_val);
19353 des_xmlDocPtr(n_doc, doc, 0);
19354 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19355 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19356 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19357 xmlResetLastError();
19358 if (mem_base != xmlMemBlocks()) {
19359 printf("Leak of %d blocks found in xmlCreateIntSubset",
19360 xmlMemBlocks() - mem_base);
19362 printf(" %d", n_doc);
19363 printf(" %d", n_name);
19364 printf(" %d", n_ExternalID);
19365 printf(" %d", n_SystemID);
19378 #define gen_nb_xmlDOMWrapCtxtPtr 1
19379 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19382 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19386 test_xmlDOMWrapAdoptNode(void) {
19391 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19393 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19395 xmlNodePtr node; /* the node to start with */
19397 xmlDocPtr destDoc; /* the destination doc */
19399 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19401 int options; /* option flags */
19404 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19405 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19406 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19407 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19408 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19409 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19410 mem_base = xmlMemBlocks();
19411 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19412 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19413 node = gen_xmlNodePtr(n_node, 2);
19414 destDoc = gen_xmlDocPtr(n_destDoc, 3);
19415 destParent = gen_xmlNodePtr(n_destParent, 4);
19416 options = gen_int(n_options, 5);
19418 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19419 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19420 desret_int(ret_val);
19422 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19423 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19424 des_xmlNodePtr(n_node, node, 2);
19425 des_xmlDocPtr(n_destDoc, destDoc, 3);
19426 des_xmlNodePtr(n_destParent, destParent, 4);
19427 des_int(n_options, options, 5);
19428 xmlResetLastError();
19429 if (mem_base != xmlMemBlocks()) {
19430 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19431 xmlMemBlocks() - mem_base);
19433 printf(" %d", n_ctxt);
19434 printf(" %d", n_sourceDoc);
19435 printf(" %d", n_node);
19436 printf(" %d", n_destDoc);
19437 printf(" %d", n_destParent);
19438 printf(" %d", n_options);
19454 test_xmlDOMWrapCloneNode(void) {
19459 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19461 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19463 xmlNodePtr node; /* the node to start with */
19465 xmlNodePtr * resNode; /* the clone of the given @node */
19467 xmlDocPtr destDoc; /* the destination doc */
19469 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19471 int deep; /* descend into child if set */
19473 int options; /* option flags */
19476 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19477 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19478 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19479 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19480 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19481 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19482 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19483 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19484 mem_base = xmlMemBlocks();
19485 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19486 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19487 node = gen_xmlNodePtr(n_node, 2);
19488 resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19489 destDoc = gen_xmlDocPtr(n_destDoc, 4);
19490 destParent = gen_xmlNodePtr(n_destParent, 5);
19491 deep = gen_int(n_deep, 6);
19492 options = gen_int(n_options, 7);
19494 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19495 desret_int(ret_val);
19497 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19498 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19499 des_xmlNodePtr(n_node, node, 2);
19500 des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19501 des_xmlDocPtr(n_destDoc, destDoc, 4);
19502 des_xmlNodePtr(n_destParent, destParent, 5);
19503 des_int(n_deep, deep, 6);
19504 des_int(n_options, options, 7);
19505 xmlResetLastError();
19506 if (mem_base != xmlMemBlocks()) {
19507 printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19508 xmlMemBlocks() - mem_base);
19510 printf(" %d", n_ctxt);
19511 printf(" %d", n_sourceDoc);
19512 printf(" %d", n_node);
19513 printf(" %d", n_resNode);
19514 printf(" %d", n_destDoc);
19515 printf(" %d", n_destParent);
19516 printf(" %d", n_deep);
19517 printf(" %d", n_options);
19535 test_xmlDOMWrapNewCtxt(void) {
19539 /* missing type support */
19545 test_xmlDOMWrapReconcileNamespaces(void) {
19550 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19552 xmlNodePtr elem; /* the element-node */
19554 int options; /* option flags */
19557 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19558 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19559 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19560 mem_base = xmlMemBlocks();
19561 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19562 elem = gen_xmlNodePtr(n_elem, 1);
19563 options = gen_int(n_options, 2);
19565 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19566 desret_int(ret_val);
19568 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19569 des_xmlNodePtr(n_elem, elem, 1);
19570 des_int(n_options, options, 2);
19571 xmlResetLastError();
19572 if (mem_base != xmlMemBlocks()) {
19573 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19574 xmlMemBlocks() - mem_base);
19576 printf(" %d", n_ctxt);
19577 printf(" %d", n_elem);
19578 printf(" %d", n_options);
19591 test_xmlDOMWrapRemoveNode(void) {
19596 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19598 xmlDocPtr doc; /* the doc */
19600 xmlNodePtr node; /* the node to be removed. */
19602 int options; /* set of options, unused at the moment */
19605 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19606 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19607 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19608 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19609 mem_base = xmlMemBlocks();
19610 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19611 doc = gen_xmlDocPtr(n_doc, 1);
19612 node = gen_xmlNodePtr(n_node, 2);
19613 options = gen_int(n_options, 3);
19615 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19616 desret_int(ret_val);
19618 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19619 des_xmlDocPtr(n_doc, doc, 1);
19620 des_xmlNodePtr(n_node, node, 2);
19621 des_int(n_options, options, 3);
19622 xmlResetLastError();
19623 if (mem_base != xmlMemBlocks()) {
19624 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19625 xmlMemBlocks() - mem_base);
19627 printf(" %d", n_ctxt);
19628 printf(" %d", n_doc);
19629 printf(" %d", n_node);
19630 printf(" %d", n_options);
19644 test_xmlDocCopyNode(void) {
19648 xmlNodePtr ret_val;
19649 xmlNodePtr node; /* the node */
19651 xmlDocPtr doc; /* the document */
19653 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19656 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19657 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19658 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19659 mem_base = xmlMemBlocks();
19660 node = gen_const_xmlNodePtr(n_node, 0);
19661 doc = gen_xmlDocPtr(n_doc, 1);
19662 extended = gen_int(n_extended, 2);
19664 ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19665 desret_xmlNodePtr(ret_val);
19667 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19668 des_xmlDocPtr(n_doc, doc, 1);
19669 des_int(n_extended, extended, 2);
19670 xmlResetLastError();
19671 if (mem_base != xmlMemBlocks()) {
19672 printf("Leak of %d blocks found in xmlDocCopyNode",
19673 xmlMemBlocks() - mem_base);
19675 printf(" %d", n_node);
19676 printf(" %d", n_doc);
19677 printf(" %d", n_extended);
19690 test_xmlDocCopyNodeList(void) {
19694 xmlNodePtr ret_val;
19695 xmlDocPtr doc; /* the target document */
19697 xmlNodePtr node; /* the first node in the list. */
19700 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19701 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19702 mem_base = xmlMemBlocks();
19703 doc = gen_xmlDocPtr(n_doc, 0);
19704 node = gen_const_xmlNodePtr(n_node, 1);
19706 ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19707 desret_xmlNodePtr(ret_val);
19709 des_xmlDocPtr(n_doc, doc, 0);
19710 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19711 xmlResetLastError();
19712 if (mem_base != xmlMemBlocks()) {
19713 printf("Leak of %d blocks found in xmlDocCopyNodeList",
19714 xmlMemBlocks() - mem_base);
19716 printf(" %d", n_doc);
19717 printf(" %d", n_node);
19729 test_xmlDocDump(void) {
19732 #if defined(LIBXML_OUTPUT_ENABLED)
19735 FILE * f; /* the FILE* */
19737 xmlDocPtr cur; /* the document */
19740 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19741 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19742 mem_base = xmlMemBlocks();
19743 f = gen_FILE_ptr(n_f, 0);
19744 cur = gen_xmlDocPtr(n_cur, 1);
19746 ret_val = xmlDocDump(f, cur);
19747 desret_int(ret_val);
19749 des_FILE_ptr(n_f, f, 0);
19750 des_xmlDocPtr(n_cur, cur, 1);
19751 xmlResetLastError();
19752 if (mem_base != xmlMemBlocks()) {
19753 printf("Leak of %d blocks found in xmlDocDump",
19754 xmlMemBlocks() - mem_base);
19756 printf(" %d", n_f);
19757 printf(" %d", n_cur);
19770 test_xmlDocDumpFormatMemory(void) {
19773 #if defined(LIBXML_OUTPUT_ENABLED)
19775 xmlDocPtr cur; /* the document */
19777 xmlChar ** mem; /* OUT: the memory pointer */
19779 int * size; /* OUT: the memory length */
19781 int format; /* should formatting spaces been added */
19784 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19785 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19786 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19787 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19788 mem_base = xmlMemBlocks();
19789 cur = gen_xmlDocPtr(n_cur, 0);
19790 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19791 size = gen_int_ptr(n_size, 2);
19792 format = gen_int(n_format, 3);
19794 xmlDocDumpFormatMemory(cur, mem, size, format);
19796 des_xmlDocPtr(n_cur, cur, 0);
19797 des_xmlChar_ptr_ptr(n_mem, mem, 1);
19798 des_int_ptr(n_size, size, 2);
19799 des_int(n_format, format, 3);
19800 xmlResetLastError();
19801 if (mem_base != xmlMemBlocks()) {
19802 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19803 xmlMemBlocks() - mem_base);
19805 printf(" %d", n_cur);
19806 printf(" %d", n_mem);
19807 printf(" %d", n_size);
19808 printf(" %d", n_format);
19823 test_xmlDocDumpFormatMemoryEnc(void) {
19826 #if defined(LIBXML_OUTPUT_ENABLED)
19828 xmlDocPtr out_doc; /* Document to generate XML text from */
19830 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19832 int * doc_txt_len; /* Length of the generated XML text */
19834 char * txt_encoding; /* Character encoding to use when generating XML text */
19835 int n_txt_encoding;
19836 int format; /* should formatting spaces been added */
19839 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19840 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19841 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19842 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19843 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19844 mem_base = xmlMemBlocks();
19845 out_doc = gen_xmlDocPtr(n_out_doc, 0);
19846 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19847 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19848 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19849 format = gen_int(n_format, 4);
19851 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19853 des_xmlDocPtr(n_out_doc, out_doc, 0);
19854 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19855 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19856 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19857 des_int(n_format, format, 4);
19858 xmlResetLastError();
19859 if (mem_base != xmlMemBlocks()) {
19860 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19861 xmlMemBlocks() - mem_base);
19863 printf(" %d", n_out_doc);
19864 printf(" %d", n_doc_txt_ptr);
19865 printf(" %d", n_doc_txt_len);
19866 printf(" %d", n_txt_encoding);
19867 printf(" %d", n_format);
19883 test_xmlDocDumpMemory(void) {
19886 #if defined(LIBXML_OUTPUT_ENABLED)
19888 xmlDocPtr cur; /* the document */
19890 xmlChar ** mem; /* OUT: the memory pointer */
19892 int * size; /* OUT: the memory length */
19895 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19896 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19897 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19898 mem_base = xmlMemBlocks();
19899 cur = gen_xmlDocPtr(n_cur, 0);
19900 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19901 size = gen_int_ptr(n_size, 2);
19903 xmlDocDumpMemory(cur, mem, size);
19905 des_xmlDocPtr(n_cur, cur, 0);
19906 des_xmlChar_ptr_ptr(n_mem, mem, 1);
19907 des_int_ptr(n_size, size, 2);
19908 xmlResetLastError();
19909 if (mem_base != xmlMemBlocks()) {
19910 printf("Leak of %d blocks found in xmlDocDumpMemory",
19911 xmlMemBlocks() - mem_base);
19913 printf(" %d", n_cur);
19914 printf(" %d", n_mem);
19915 printf(" %d", n_size);
19929 test_xmlDocDumpMemoryEnc(void) {
19932 #if defined(LIBXML_OUTPUT_ENABLED)
19934 xmlDocPtr out_doc; /* Document to generate XML text from */
19936 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19938 int * doc_txt_len; /* Length of the generated XML text */
19940 char * txt_encoding; /* Character encoding to use when generating XML text */
19941 int n_txt_encoding;
19943 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19944 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19945 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19946 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19947 mem_base = xmlMemBlocks();
19948 out_doc = gen_xmlDocPtr(n_out_doc, 0);
19949 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19950 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19951 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19953 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19955 des_xmlDocPtr(n_out_doc, out_doc, 0);
19956 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19957 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19958 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19959 xmlResetLastError();
19960 if (mem_base != xmlMemBlocks()) {
19961 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19962 xmlMemBlocks() - mem_base);
19964 printf(" %d", n_out_doc);
19965 printf(" %d", n_doc_txt_ptr);
19966 printf(" %d", n_doc_txt_len);
19967 printf(" %d", n_txt_encoding);
19982 test_xmlDocFormatDump(void) {
19985 #if defined(LIBXML_OUTPUT_ENABLED)
19988 FILE * f; /* the FILE* */
19990 xmlDocPtr cur; /* the document */
19992 int format; /* should formatting spaces been added */
19995 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19996 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19997 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19998 mem_base = xmlMemBlocks();
19999 f = gen_FILE_ptr(n_f, 0);
20000 cur = gen_xmlDocPtr(n_cur, 1);
20001 format = gen_int(n_format, 2);
20003 ret_val = xmlDocFormatDump(f, cur, format);
20004 desret_int(ret_val);
20006 des_FILE_ptr(n_f, f, 0);
20007 des_xmlDocPtr(n_cur, cur, 1);
20008 des_int(n_format, format, 2);
20009 xmlResetLastError();
20010 if (mem_base != xmlMemBlocks()) {
20011 printf("Leak of %d blocks found in xmlDocFormatDump",
20012 xmlMemBlocks() - mem_base);
20014 printf(" %d", n_f);
20015 printf(" %d", n_cur);
20016 printf(" %d", n_format);
20030 test_xmlDocGetRootElement(void) {
20034 xmlNodePtr ret_val;
20035 xmlDocPtr doc; /* the document */
20038 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20039 mem_base = xmlMemBlocks();
20040 doc = gen_xmlDocPtr(n_doc, 0);
20042 ret_val = xmlDocGetRootElement(doc);
20043 desret_xmlNodePtr(ret_val);
20045 des_xmlDocPtr(n_doc, doc, 0);
20046 xmlResetLastError();
20047 if (mem_base != xmlMemBlocks()) {
20048 printf("Leak of %d blocks found in xmlDocGetRootElement",
20049 xmlMemBlocks() - mem_base);
20051 printf(" %d", n_doc);
20062 test_xmlDocSetRootElement(void) {
20065 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20067 xmlNodePtr ret_val;
20068 xmlDocPtr doc; /* the document */
20070 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. */
20073 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20074 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20075 mem_base = xmlMemBlocks();
20076 doc = gen_xmlDocPtr(n_doc, 0);
20077 root = gen_xmlNodePtr_in(n_root, 1);
20079 ret_val = xmlDocSetRootElement(doc, root);
20080 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20081 desret_xmlNodePtr(ret_val);
20083 des_xmlDocPtr(n_doc, doc, 0);
20084 des_xmlNodePtr_in(n_root, root, 1);
20085 xmlResetLastError();
20086 if (mem_base != xmlMemBlocks()) {
20087 printf("Leak of %d blocks found in xmlDocSetRootElement",
20088 xmlMemBlocks() - mem_base);
20090 printf(" %d", n_doc);
20091 printf(" %d", n_root);
20104 test_xmlElemDump(void) {
20107 #if defined(LIBXML_OUTPUT_ENABLED)
20109 FILE * f; /* the FILE * for the output */
20111 xmlDocPtr doc; /* the document */
20113 xmlNodePtr cur; /* the current node */
20116 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20117 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20118 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20119 mem_base = xmlMemBlocks();
20120 f = gen_FILE_ptr(n_f, 0);
20121 doc = gen_xmlDocPtr(n_doc, 1);
20122 cur = gen_xmlNodePtr(n_cur, 2);
20124 xmlElemDump(f, doc, cur);
20126 des_FILE_ptr(n_f, f, 0);
20127 des_xmlDocPtr(n_doc, doc, 1);
20128 des_xmlNodePtr(n_cur, cur, 2);
20129 xmlResetLastError();
20130 if (mem_base != xmlMemBlocks()) {
20131 printf("Leak of %d blocks found in xmlElemDump",
20132 xmlMemBlocks() - mem_base);
20134 printf(" %d", n_f);
20135 printf(" %d", n_doc);
20136 printf(" %d", n_cur);
20150 test_xmlFirstElementChild(void) {
20153 #if defined(LIBXML_TREE_ENABLED)
20155 xmlNodePtr ret_val;
20156 xmlNodePtr parent; /* the parent node */
20159 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20160 mem_base = xmlMemBlocks();
20161 parent = gen_xmlNodePtr(n_parent, 0);
20163 ret_val = xmlFirstElementChild(parent);
20164 desret_xmlNodePtr(ret_val);
20166 des_xmlNodePtr(n_parent, parent, 0);
20167 xmlResetLastError();
20168 if (mem_base != xmlMemBlocks()) {
20169 printf("Leak of %d blocks found in xmlFirstElementChild",
20170 xmlMemBlocks() - mem_base);
20172 printf(" %d", n_parent);
20184 test_xmlGetBufferAllocationScheme(void) {
20188 xmlBufferAllocationScheme ret_val;
20190 mem_base = xmlMemBlocks();
20192 ret_val = xmlGetBufferAllocationScheme();
20193 desret_xmlBufferAllocationScheme(ret_val);
20195 xmlResetLastError();
20196 if (mem_base != xmlMemBlocks()) {
20197 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20198 xmlMemBlocks() - mem_base);
20209 test_xmlGetCompressMode(void) {
20215 mem_base = xmlMemBlocks();
20217 ret_val = xmlGetCompressMode();
20218 desret_int(ret_val);
20220 xmlResetLastError();
20221 if (mem_base != xmlMemBlocks()) {
20222 printf("Leak of %d blocks found in xmlGetCompressMode",
20223 xmlMemBlocks() - mem_base);
20234 test_xmlGetDocCompressMode(void) {
20239 xmlDocPtr doc; /* the document */
20242 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20243 mem_base = xmlMemBlocks();
20244 doc = gen_xmlDocPtr(n_doc, 0);
20246 ret_val = xmlGetDocCompressMode(doc);
20247 desret_int(ret_val);
20249 des_xmlDocPtr(n_doc, doc, 0);
20250 xmlResetLastError();
20251 if (mem_base != xmlMemBlocks()) {
20252 printf("Leak of %d blocks found in xmlGetDocCompressMode",
20253 xmlMemBlocks() - mem_base);
20255 printf(" %d", n_doc);
20266 test_xmlGetIntSubset(void) {
20271 xmlDocPtr doc; /* the document pointer */
20274 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20275 mem_base = xmlMemBlocks();
20276 doc = gen_xmlDocPtr(n_doc, 0);
20278 ret_val = xmlGetIntSubset(doc);
20279 desret_xmlDtdPtr(ret_val);
20281 des_xmlDocPtr(n_doc, doc, 0);
20282 xmlResetLastError();
20283 if (mem_base != xmlMemBlocks()) {
20284 printf("Leak of %d blocks found in xmlGetIntSubset",
20285 xmlMemBlocks() - mem_base);
20287 printf(" %d", n_doc);
20298 test_xmlGetLastChild(void) {
20302 xmlNodePtr ret_val;
20303 xmlNodePtr parent; /* the parent node */
20306 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20307 mem_base = xmlMemBlocks();
20308 parent = gen_xmlNodePtr(n_parent, 0);
20310 ret_val = xmlGetLastChild(parent);
20311 desret_xmlNodePtr(ret_val);
20313 des_xmlNodePtr(n_parent, parent, 0);
20314 xmlResetLastError();
20315 if (mem_base != xmlMemBlocks()) {
20316 printf("Leak of %d blocks found in xmlGetLastChild",
20317 xmlMemBlocks() - mem_base);
20319 printf(" %d", n_parent);
20330 test_xmlGetLineNo(void) {
20335 xmlNodePtr node; /* valid node */
20338 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20339 mem_base = xmlMemBlocks();
20340 node = gen_xmlNodePtr(n_node, 0);
20342 ret_val = xmlGetLineNo(node);
20343 desret_long(ret_val);
20345 des_xmlNodePtr(n_node, node, 0);
20346 xmlResetLastError();
20347 if (mem_base != xmlMemBlocks()) {
20348 printf("Leak of %d blocks found in xmlGetLineNo",
20349 xmlMemBlocks() - mem_base);
20351 printf(" %d", n_node);
20362 test_xmlGetNoNsProp(void) {
20367 xmlNodePtr node; /* the node */
20369 xmlChar * name; /* the attribute name */
20372 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20373 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20374 mem_base = xmlMemBlocks();
20375 node = gen_xmlNodePtr(n_node, 0);
20376 name = gen_const_xmlChar_ptr(n_name, 1);
20378 ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20379 desret_xmlChar_ptr(ret_val);
20381 des_xmlNodePtr(n_node, node, 0);
20382 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20383 xmlResetLastError();
20384 if (mem_base != xmlMemBlocks()) {
20385 printf("Leak of %d blocks found in xmlGetNoNsProp",
20386 xmlMemBlocks() - mem_base);
20388 printf(" %d", n_node);
20389 printf(" %d", n_name);
20401 test_xmlGetNodePath(void) {
20404 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20407 xmlNodePtr node; /* a node */
20410 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20411 mem_base = xmlMemBlocks();
20412 node = gen_xmlNodePtr(n_node, 0);
20414 ret_val = xmlGetNodePath(node);
20415 desret_xmlChar_ptr(ret_val);
20417 des_xmlNodePtr(n_node, node, 0);
20418 xmlResetLastError();
20419 if (mem_base != xmlMemBlocks()) {
20420 printf("Leak of %d blocks found in xmlGetNodePath",
20421 xmlMemBlocks() - mem_base);
20423 printf(" %d", n_node);
20435 test_xmlGetNsList(void) {
20439 /* missing type support */
20445 test_xmlGetNsProp(void) {
20450 xmlNodePtr node; /* the node */
20452 xmlChar * name; /* the attribute name */
20454 xmlChar * nameSpace; /* the URI of the namespace */
20457 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20458 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20459 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20460 mem_base = xmlMemBlocks();
20461 node = gen_xmlNodePtr(n_node, 0);
20462 name = gen_const_xmlChar_ptr(n_name, 1);
20463 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20465 ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20466 desret_xmlChar_ptr(ret_val);
20468 des_xmlNodePtr(n_node, node, 0);
20469 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20470 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20471 xmlResetLastError();
20472 if (mem_base != xmlMemBlocks()) {
20473 printf("Leak of %d blocks found in xmlGetNsProp",
20474 xmlMemBlocks() - mem_base);
20476 printf(" %d", n_node);
20477 printf(" %d", n_name);
20478 printf(" %d", n_nameSpace);
20491 test_xmlGetProp(void) {
20496 xmlNodePtr node; /* the node */
20498 xmlChar * name; /* the attribute name */
20501 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20502 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20503 mem_base = xmlMemBlocks();
20504 node = gen_xmlNodePtr(n_node, 0);
20505 name = gen_const_xmlChar_ptr(n_name, 1);
20507 ret_val = xmlGetProp(node, (const xmlChar *)name);
20508 desret_xmlChar_ptr(ret_val);
20510 des_xmlNodePtr(n_node, node, 0);
20511 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20512 xmlResetLastError();
20513 if (mem_base != xmlMemBlocks()) {
20514 printf("Leak of %d blocks found in xmlGetProp",
20515 xmlMemBlocks() - mem_base);
20517 printf(" %d", n_node);
20518 printf(" %d", n_name);
20530 test_xmlHasNsProp(void) {
20534 xmlAttrPtr ret_val;
20535 xmlNodePtr node; /* the node */
20537 xmlChar * name; /* the attribute name */
20539 xmlChar * nameSpace; /* the URI of the namespace */
20542 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20543 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20544 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20545 mem_base = xmlMemBlocks();
20546 node = gen_xmlNodePtr(n_node, 0);
20547 name = gen_const_xmlChar_ptr(n_name, 1);
20548 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20550 ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20551 desret_xmlAttrPtr(ret_val);
20553 des_xmlNodePtr(n_node, node, 0);
20554 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20555 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20556 xmlResetLastError();
20557 if (mem_base != xmlMemBlocks()) {
20558 printf("Leak of %d blocks found in xmlHasNsProp",
20559 xmlMemBlocks() - mem_base);
20561 printf(" %d", n_node);
20562 printf(" %d", n_name);
20563 printf(" %d", n_nameSpace);
20576 test_xmlHasProp(void) {
20580 xmlAttrPtr ret_val;
20581 xmlNodePtr node; /* the node */
20583 xmlChar * name; /* the attribute name */
20586 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20587 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20588 mem_base = xmlMemBlocks();
20589 node = gen_xmlNodePtr(n_node, 0);
20590 name = gen_const_xmlChar_ptr(n_name, 1);
20592 ret_val = xmlHasProp(node, (const xmlChar *)name);
20593 desret_xmlAttrPtr(ret_val);
20595 des_xmlNodePtr(n_node, node, 0);
20596 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20597 xmlResetLastError();
20598 if (mem_base != xmlMemBlocks()) {
20599 printf("Leak of %d blocks found in xmlHasProp",
20600 xmlMemBlocks() - mem_base);
20602 printf(" %d", n_node);
20603 printf(" %d", n_name);
20615 test_xmlIsBlankNode(void) {
20620 xmlNodePtr node; /* the node */
20623 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20624 mem_base = xmlMemBlocks();
20625 node = gen_xmlNodePtr(n_node, 0);
20627 ret_val = xmlIsBlankNode(node);
20628 desret_int(ret_val);
20630 des_xmlNodePtr(n_node, node, 0);
20631 xmlResetLastError();
20632 if (mem_base != xmlMemBlocks()) {
20633 printf("Leak of %d blocks found in xmlIsBlankNode",
20634 xmlMemBlocks() - mem_base);
20636 printf(" %d", n_node);
20647 test_xmlIsXHTML(void) {
20652 xmlChar * systemID; /* the system identifier */
20654 xmlChar * publicID; /* the public identifier */
20657 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20658 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20659 mem_base = xmlMemBlocks();
20660 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20661 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20663 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20664 desret_int(ret_val);
20666 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20667 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20668 xmlResetLastError();
20669 if (mem_base != xmlMemBlocks()) {
20670 printf("Leak of %d blocks found in xmlIsXHTML",
20671 xmlMemBlocks() - mem_base);
20673 printf(" %d", n_systemID);
20674 printf(" %d", n_publicID);
20686 test_xmlLastElementChild(void) {
20689 #if defined(LIBXML_TREE_ENABLED)
20691 xmlNodePtr ret_val;
20692 xmlNodePtr parent; /* the parent node */
20695 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20696 mem_base = xmlMemBlocks();
20697 parent = gen_xmlNodePtr(n_parent, 0);
20699 ret_val = xmlLastElementChild(parent);
20700 desret_xmlNodePtr(ret_val);
20702 des_xmlNodePtr(n_parent, parent, 0);
20703 xmlResetLastError();
20704 if (mem_base != xmlMemBlocks()) {
20705 printf("Leak of %d blocks found in xmlLastElementChild",
20706 xmlMemBlocks() - mem_base);
20708 printf(" %d", n_parent);
20720 test_xmlNewCDataBlock(void) {
20724 xmlNodePtr ret_val;
20725 xmlDocPtr doc; /* the document */
20727 xmlChar * content; /* the CDATA block content content */
20729 int len; /* the length of the block */
20732 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20733 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20734 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20735 mem_base = xmlMemBlocks();
20736 doc = gen_xmlDocPtr(n_doc, 0);
20737 content = gen_const_xmlChar_ptr(n_content, 1);
20738 len = gen_int(n_len, 2);
20740 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20741 desret_xmlNodePtr(ret_val);
20743 des_xmlDocPtr(n_doc, doc, 0);
20744 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20745 des_int(n_len, len, 2);
20746 xmlResetLastError();
20747 if (mem_base != xmlMemBlocks()) {
20748 printf("Leak of %d blocks found in xmlNewCDataBlock",
20749 xmlMemBlocks() - mem_base);
20751 printf(" %d", n_doc);
20752 printf(" %d", n_content);
20753 printf(" %d", n_len);
20766 test_xmlNewCharRef(void) {
20770 xmlNodePtr ret_val;
20771 xmlDocPtr doc; /* the document */
20773 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20776 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20777 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20778 mem_base = xmlMemBlocks();
20779 doc = gen_xmlDocPtr(n_doc, 0);
20780 name = gen_const_xmlChar_ptr(n_name, 1);
20782 ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20783 desret_xmlNodePtr(ret_val);
20785 des_xmlDocPtr(n_doc, doc, 0);
20786 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20787 xmlResetLastError();
20788 if (mem_base != xmlMemBlocks()) {
20789 printf("Leak of %d blocks found in xmlNewCharRef",
20790 xmlMemBlocks() - mem_base);
20792 printf(" %d", n_doc);
20793 printf(" %d", n_name);
20805 test_xmlNewChild(void) {
20808 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20809 #ifdef LIBXML_TREE_ENABLED
20811 xmlNodePtr ret_val;
20812 xmlNodePtr parent; /* the parent node */
20814 xmlNsPtr ns; /* a namespace if any */
20816 xmlChar * name; /* the name of the child */
20818 xmlChar * content; /* the XML content of the child if any. */
20821 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20822 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20823 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20824 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20825 mem_base = xmlMemBlocks();
20826 parent = gen_xmlNodePtr(n_parent, 0);
20827 ns = gen_xmlNsPtr(n_ns, 1);
20828 name = gen_const_xmlChar_ptr(n_name, 2);
20829 content = gen_const_xmlChar_ptr(n_content, 3);
20831 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20832 desret_xmlNodePtr(ret_val);
20834 des_xmlNodePtr(n_parent, parent, 0);
20835 des_xmlNsPtr(n_ns, ns, 1);
20836 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20837 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20838 xmlResetLastError();
20839 if (mem_base != xmlMemBlocks()) {
20840 printf("Leak of %d blocks found in xmlNewChild",
20841 xmlMemBlocks() - mem_base);
20843 printf(" %d", n_parent);
20844 printf(" %d", n_ns);
20845 printf(" %d", n_name);
20846 printf(" %d", n_content);
20862 test_xmlNewComment(void) {
20866 xmlNodePtr ret_val;
20867 xmlChar * content; /* the comment content */
20870 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20871 mem_base = xmlMemBlocks();
20872 content = gen_const_xmlChar_ptr(n_content, 0);
20874 ret_val = xmlNewComment((const xmlChar *)content);
20875 desret_xmlNodePtr(ret_val);
20877 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20878 xmlResetLastError();
20879 if (mem_base != xmlMemBlocks()) {
20880 printf("Leak of %d blocks found in xmlNewComment",
20881 xmlMemBlocks() - mem_base);
20883 printf(" %d", n_content);
20894 test_xmlNewDoc(void) {
20899 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20902 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20903 mem_base = xmlMemBlocks();
20904 version = gen_const_xmlChar_ptr(n_version, 0);
20906 ret_val = xmlNewDoc((const xmlChar *)version);
20907 desret_xmlDocPtr(ret_val);
20909 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20910 xmlResetLastError();
20911 if (mem_base != xmlMemBlocks()) {
20912 printf("Leak of %d blocks found in xmlNewDoc",
20913 xmlMemBlocks() - mem_base);
20915 printf(" %d", n_version);
20926 test_xmlNewDocComment(void) {
20930 xmlNodePtr ret_val;
20931 xmlDocPtr doc; /* the document */
20933 xmlChar * content; /* the comment content */
20936 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20937 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20938 mem_base = xmlMemBlocks();
20939 doc = gen_xmlDocPtr(n_doc, 0);
20940 content = gen_const_xmlChar_ptr(n_content, 1);
20942 ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20943 desret_xmlNodePtr(ret_val);
20945 des_xmlDocPtr(n_doc, doc, 0);
20946 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20947 xmlResetLastError();
20948 if (mem_base != xmlMemBlocks()) {
20949 printf("Leak of %d blocks found in xmlNewDocComment",
20950 xmlMemBlocks() - mem_base);
20952 printf(" %d", n_doc);
20953 printf(" %d", n_content);
20965 test_xmlNewDocFragment(void) {
20968 #if defined(LIBXML_TREE_ENABLED)
20970 xmlNodePtr ret_val;
20971 xmlDocPtr doc; /* the document owning the fragment */
20974 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20975 mem_base = xmlMemBlocks();
20976 doc = gen_xmlDocPtr(n_doc, 0);
20978 ret_val = xmlNewDocFragment(doc);
20979 desret_xmlNodePtr(ret_val);
20981 des_xmlDocPtr(n_doc, doc, 0);
20982 xmlResetLastError();
20983 if (mem_base != xmlMemBlocks()) {
20984 printf("Leak of %d blocks found in xmlNewDocFragment",
20985 xmlMemBlocks() - mem_base);
20987 printf(" %d", n_doc);
20999 test_xmlNewDocNode(void) {
21003 xmlNodePtr ret_val;
21004 xmlDocPtr doc; /* the document */
21006 xmlNsPtr ns; /* namespace if any */
21008 xmlChar * name; /* the node name */
21010 xmlChar * content; /* the XML text content if any */
21013 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21014 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21015 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21016 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21017 mem_base = xmlMemBlocks();
21018 doc = gen_xmlDocPtr(n_doc, 0);
21019 ns = gen_xmlNsPtr(n_ns, 1);
21020 name = gen_const_xmlChar_ptr(n_name, 2);
21021 content = gen_const_xmlChar_ptr(n_content, 3);
21023 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21024 desret_xmlNodePtr(ret_val);
21026 des_xmlDocPtr(n_doc, doc, 0);
21027 des_xmlNsPtr(n_ns, ns, 1);
21028 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21029 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21030 xmlResetLastError();
21031 if (mem_base != xmlMemBlocks()) {
21032 printf("Leak of %d blocks found in xmlNewDocNode",
21033 xmlMemBlocks() - mem_base);
21035 printf(" %d", n_doc);
21036 printf(" %d", n_ns);
21037 printf(" %d", n_name);
21038 printf(" %d", n_content);
21052 test_xmlNewDocNodeEatName(void) {
21056 xmlNodePtr ret_val;
21057 xmlDocPtr doc; /* the document */
21059 xmlNsPtr ns; /* namespace if any */
21061 xmlChar * name; /* the node name */
21063 xmlChar * content; /* the XML text content if any */
21066 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21067 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21068 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21069 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21070 mem_base = xmlMemBlocks();
21071 doc = gen_xmlDocPtr(n_doc, 0);
21072 ns = gen_xmlNsPtr(n_ns, 1);
21073 name = gen_eaten_name(n_name, 2);
21074 content = gen_const_xmlChar_ptr(n_content, 3);
21076 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21077 desret_xmlNodePtr(ret_val);
21079 des_xmlDocPtr(n_doc, doc, 0);
21080 des_xmlNsPtr(n_ns, ns, 1);
21081 des_eaten_name(n_name, name, 2);
21082 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21083 xmlResetLastError();
21084 if (mem_base != xmlMemBlocks()) {
21085 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21086 xmlMemBlocks() - mem_base);
21088 printf(" %d", n_doc);
21089 printf(" %d", n_ns);
21090 printf(" %d", n_name);
21091 printf(" %d", n_content);
21105 test_xmlNewDocPI(void) {
21109 xmlNodePtr ret_val;
21110 xmlDocPtr doc; /* the target document */
21112 xmlChar * name; /* the processing instruction name */
21114 xmlChar * content; /* the PI content */
21117 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21118 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21119 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21120 mem_base = xmlMemBlocks();
21121 doc = gen_xmlDocPtr(n_doc, 0);
21122 name = gen_const_xmlChar_ptr(n_name, 1);
21123 content = gen_const_xmlChar_ptr(n_content, 2);
21125 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21126 desret_xmlNodePtr(ret_val);
21128 des_xmlDocPtr(n_doc, doc, 0);
21129 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21130 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21131 xmlResetLastError();
21132 if (mem_base != xmlMemBlocks()) {
21133 printf("Leak of %d blocks found in xmlNewDocPI",
21134 xmlMemBlocks() - mem_base);
21136 printf(" %d", n_doc);
21137 printf(" %d", n_name);
21138 printf(" %d", n_content);
21151 test_xmlNewDocProp(void) {
21155 xmlAttrPtr ret_val;
21156 xmlDocPtr doc; /* the document */
21158 xmlChar * name; /* the name of the attribute */
21160 xmlChar * value; /* the value of the attribute */
21163 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21164 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21165 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21166 mem_base = xmlMemBlocks();
21167 doc = gen_xmlDocPtr(n_doc, 0);
21168 name = gen_const_xmlChar_ptr(n_name, 1);
21169 value = gen_const_xmlChar_ptr(n_value, 2);
21171 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21172 desret_xmlAttrPtr(ret_val);
21174 des_xmlDocPtr(n_doc, doc, 0);
21175 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21176 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21177 xmlResetLastError();
21178 if (mem_base != xmlMemBlocks()) {
21179 printf("Leak of %d blocks found in xmlNewDocProp",
21180 xmlMemBlocks() - mem_base);
21182 printf(" %d", n_doc);
21183 printf(" %d", n_name);
21184 printf(" %d", n_value);
21197 test_xmlNewDocRawNode(void) {
21200 #if defined(LIBXML_TREE_ENABLED)
21201 #ifdef LIBXML_TREE_ENABLED
21203 xmlNodePtr ret_val;
21204 xmlDocPtr doc; /* the document */
21206 xmlNsPtr ns; /* namespace if any */
21208 xmlChar * name; /* the node name */
21210 xmlChar * content; /* the text content if any */
21213 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21214 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21215 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21216 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21217 mem_base = xmlMemBlocks();
21218 doc = gen_xmlDocPtr(n_doc, 0);
21219 ns = gen_xmlNsPtr(n_ns, 1);
21220 name = gen_const_xmlChar_ptr(n_name, 2);
21221 content = gen_const_xmlChar_ptr(n_content, 3);
21223 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21224 desret_xmlNodePtr(ret_val);
21226 des_xmlDocPtr(n_doc, doc, 0);
21227 des_xmlNsPtr(n_ns, ns, 1);
21228 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21229 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21230 xmlResetLastError();
21231 if (mem_base != xmlMemBlocks()) {
21232 printf("Leak of %d blocks found in xmlNewDocRawNode",
21233 xmlMemBlocks() - mem_base);
21235 printf(" %d", n_doc);
21236 printf(" %d", n_ns);
21237 printf(" %d", n_name);
21238 printf(" %d", n_content);
21254 test_xmlNewDocText(void) {
21258 xmlNodePtr ret_val;
21259 xmlDocPtr doc; /* the document */
21261 xmlChar * content; /* the text 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 = xmlNewDocText(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 xmlNewDocText",
21278 xmlMemBlocks() - mem_base);
21280 printf(" %d", n_doc);
21281 printf(" %d", n_content);
21293 test_xmlNewDocTextLen(void) {
21297 xmlNodePtr ret_val;
21298 xmlDocPtr doc; /* the document */
21300 xmlChar * content; /* the text content */
21302 int len; /* the text len. */
21305 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21306 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21307 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21308 mem_base = xmlMemBlocks();
21309 doc = gen_xmlDocPtr(n_doc, 0);
21310 content = gen_const_xmlChar_ptr(n_content, 1);
21311 len = gen_int(n_len, 2);
21313 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21314 desret_xmlNodePtr(ret_val);
21316 des_xmlDocPtr(n_doc, doc, 0);
21317 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21318 des_int(n_len, len, 2);
21319 xmlResetLastError();
21320 if (mem_base != xmlMemBlocks()) {
21321 printf("Leak of %d blocks found in xmlNewDocTextLen",
21322 xmlMemBlocks() - mem_base);
21324 printf(" %d", n_doc);
21325 printf(" %d", n_content);
21326 printf(" %d", n_len);
21339 test_xmlNewDtd(void) {
21344 xmlDocPtr doc; /* the document pointer */
21346 xmlChar * name; /* the DTD name */
21348 xmlChar * ExternalID; /* the external ID */
21350 xmlChar * SystemID; /* the system ID */
21353 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21354 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21355 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21356 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21357 mem_base = xmlMemBlocks();
21358 doc = gen_xmlDocPtr(n_doc, 0);
21359 name = gen_const_xmlChar_ptr(n_name, 1);
21360 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21361 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21363 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21364 desret_xmlDtdPtr(ret_val);
21366 des_xmlDocPtr(n_doc, doc, 0);
21367 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21368 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21369 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21370 xmlResetLastError();
21371 if (mem_base != xmlMemBlocks()) {
21372 printf("Leak of %d blocks found in xmlNewDtd",
21373 xmlMemBlocks() - mem_base);
21375 printf(" %d", n_doc);
21376 printf(" %d", n_name);
21377 printf(" %d", n_ExternalID);
21378 printf(" %d", n_SystemID);
21392 test_xmlNewNode(void) {
21396 xmlNodePtr ret_val;
21397 xmlNsPtr ns; /* namespace if any */
21399 xmlChar * name; /* the node name */
21402 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21403 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21404 mem_base = xmlMemBlocks();
21405 ns = gen_xmlNsPtr(n_ns, 0);
21406 name = gen_const_xmlChar_ptr(n_name, 1);
21408 ret_val = xmlNewNode(ns, (const xmlChar *)name);
21409 desret_xmlNodePtr(ret_val);
21411 des_xmlNsPtr(n_ns, ns, 0);
21412 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21413 xmlResetLastError();
21414 if (mem_base != xmlMemBlocks()) {
21415 printf("Leak of %d blocks found in xmlNewNode",
21416 xmlMemBlocks() - mem_base);
21418 printf(" %d", n_ns);
21419 printf(" %d", n_name);
21431 test_xmlNewNodeEatName(void) {
21435 xmlNodePtr ret_val;
21436 xmlNsPtr ns; /* namespace if any */
21438 xmlChar * name; /* the node name */
21441 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21442 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21443 mem_base = xmlMemBlocks();
21444 ns = gen_xmlNsPtr(n_ns, 0);
21445 name = gen_eaten_name(n_name, 1);
21447 ret_val = xmlNewNodeEatName(ns, name);
21448 desret_xmlNodePtr(ret_val);
21450 des_xmlNsPtr(n_ns, ns, 0);
21451 des_eaten_name(n_name, name, 1);
21452 xmlResetLastError();
21453 if (mem_base != xmlMemBlocks()) {
21454 printf("Leak of %d blocks found in xmlNewNodeEatName",
21455 xmlMemBlocks() - mem_base);
21457 printf(" %d", n_ns);
21458 printf(" %d", n_name);
21470 test_xmlNewNs(void) {
21475 xmlNodePtr node; /* the element carrying the namespace */
21477 xmlChar * href; /* the URI associated */
21479 xmlChar * prefix; /* the prefix for the namespace */
21482 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21483 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21484 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21485 mem_base = xmlMemBlocks();
21486 node = gen_xmlNodePtr(n_node, 0);
21487 href = gen_const_xmlChar_ptr(n_href, 1);
21488 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21490 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21491 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21492 desret_xmlNsPtr(ret_val);
21494 des_xmlNodePtr(n_node, node, 0);
21495 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21496 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21497 xmlResetLastError();
21498 if (mem_base != xmlMemBlocks()) {
21499 printf("Leak of %d blocks found in xmlNewNs",
21500 xmlMemBlocks() - mem_base);
21502 printf(" %d", n_node);
21503 printf(" %d", n_href);
21504 printf(" %d", n_prefix);
21517 test_xmlNewNsProp(void) {
21521 xmlAttrPtr ret_val;
21522 xmlNodePtr node; /* the holding node */
21524 xmlNsPtr ns; /* the namespace */
21526 xmlChar * name; /* the name of the attribute */
21528 xmlChar * value; /* the value of the attribute */
21531 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21532 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21533 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21534 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21535 mem_base = xmlMemBlocks();
21536 node = gen_xmlNodePtr(n_node, 0);
21537 ns = gen_xmlNsPtr(n_ns, 1);
21538 name = gen_const_xmlChar_ptr(n_name, 2);
21539 value = gen_const_xmlChar_ptr(n_value, 3);
21541 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21542 desret_xmlAttrPtr(ret_val);
21544 des_xmlNodePtr(n_node, node, 0);
21545 des_xmlNsPtr(n_ns, ns, 1);
21546 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21547 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21548 xmlResetLastError();
21549 if (mem_base != xmlMemBlocks()) {
21550 printf("Leak of %d blocks found in xmlNewNsProp",
21551 xmlMemBlocks() - mem_base);
21553 printf(" %d", n_node);
21554 printf(" %d", n_ns);
21555 printf(" %d", n_name);
21556 printf(" %d", n_value);
21570 test_xmlNewNsPropEatName(void) {
21574 xmlAttrPtr ret_val;
21575 xmlNodePtr node; /* the holding node */
21577 xmlNsPtr ns; /* the namespace */
21579 xmlChar * name; /* the name of the attribute */
21581 xmlChar * value; /* the value of the attribute */
21584 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21585 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21586 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21587 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21588 mem_base = xmlMemBlocks();
21589 node = gen_xmlNodePtr(n_node, 0);
21590 ns = gen_xmlNsPtr(n_ns, 1);
21591 name = gen_eaten_name(n_name, 2);
21592 value = gen_const_xmlChar_ptr(n_value, 3);
21594 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21595 desret_xmlAttrPtr(ret_val);
21597 des_xmlNodePtr(n_node, node, 0);
21598 des_xmlNsPtr(n_ns, ns, 1);
21599 des_eaten_name(n_name, name, 2);
21600 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21601 xmlResetLastError();
21602 if (mem_base != xmlMemBlocks()) {
21603 printf("Leak of %d blocks found in xmlNewNsPropEatName",
21604 xmlMemBlocks() - mem_base);
21606 printf(" %d", n_node);
21607 printf(" %d", n_ns);
21608 printf(" %d", n_name);
21609 printf(" %d", n_value);
21623 test_xmlNewPI(void) {
21627 xmlNodePtr ret_val;
21628 xmlChar * name; /* the processing instruction name */
21630 xmlChar * content; /* the PI content */
21633 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21634 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21635 mem_base = xmlMemBlocks();
21636 name = gen_const_xmlChar_ptr(n_name, 0);
21637 content = gen_const_xmlChar_ptr(n_content, 1);
21639 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21640 desret_xmlNodePtr(ret_val);
21642 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21643 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21644 xmlResetLastError();
21645 if (mem_base != xmlMemBlocks()) {
21646 printf("Leak of %d blocks found in xmlNewPI",
21647 xmlMemBlocks() - mem_base);
21649 printf(" %d", n_name);
21650 printf(" %d", n_content);
21662 test_xmlNewProp(void) {
21665 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21666 #ifdef LIBXML_TREE_ENABLED
21668 xmlAttrPtr ret_val;
21669 xmlNodePtr node; /* the holding node */
21671 xmlChar * name; /* the name of the attribute */
21673 xmlChar * value; /* the value of the attribute */
21676 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21677 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21678 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21679 mem_base = xmlMemBlocks();
21680 node = gen_xmlNodePtr(n_node, 0);
21681 name = gen_const_xmlChar_ptr(n_name, 1);
21682 value = gen_const_xmlChar_ptr(n_value, 2);
21684 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21685 desret_xmlAttrPtr(ret_val);
21687 des_xmlNodePtr(n_node, node, 0);
21688 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21689 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21690 xmlResetLastError();
21691 if (mem_base != xmlMemBlocks()) {
21692 printf("Leak of %d blocks found in xmlNewProp",
21693 xmlMemBlocks() - mem_base);
21695 printf(" %d", n_node);
21696 printf(" %d", n_name);
21697 printf(" %d", n_value);
21712 test_xmlNewReference(void) {
21716 xmlNodePtr ret_val;
21717 xmlDocPtr doc; /* the document */
21719 xmlChar * name; /* the reference name, or the reference string with & and ; */
21722 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21723 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21724 mem_base = xmlMemBlocks();
21725 doc = gen_xmlDocPtr(n_doc, 0);
21726 name = gen_const_xmlChar_ptr(n_name, 1);
21728 ret_val = xmlNewReference(doc, (const xmlChar *)name);
21729 desret_xmlNodePtr(ret_val);
21731 des_xmlDocPtr(n_doc, doc, 0);
21732 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21733 xmlResetLastError();
21734 if (mem_base != xmlMemBlocks()) {
21735 printf("Leak of %d blocks found in xmlNewReference",
21736 xmlMemBlocks() - mem_base);
21738 printf(" %d", n_doc);
21739 printf(" %d", n_name);
21751 test_xmlNewText(void) {
21755 xmlNodePtr ret_val;
21756 xmlChar * content; /* the text content */
21759 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21760 mem_base = xmlMemBlocks();
21761 content = gen_const_xmlChar_ptr(n_content, 0);
21763 ret_val = xmlNewText((const xmlChar *)content);
21764 desret_xmlNodePtr(ret_val);
21766 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21767 xmlResetLastError();
21768 if (mem_base != xmlMemBlocks()) {
21769 printf("Leak of %d blocks found in xmlNewText",
21770 xmlMemBlocks() - mem_base);
21772 printf(" %d", n_content);
21783 test_xmlNewTextChild(void) {
21786 #if defined(LIBXML_TREE_ENABLED)
21787 #ifdef LIBXML_TREE_ENABLED
21789 xmlNodePtr ret_val;
21790 xmlNodePtr parent; /* the parent node */
21792 xmlNsPtr ns; /* a namespace if any */
21794 xmlChar * name; /* the name of the child */
21796 xmlChar * content; /* the text content of the child if any. */
21799 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21800 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21801 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21802 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21803 mem_base = xmlMemBlocks();
21804 parent = gen_xmlNodePtr(n_parent, 0);
21805 ns = gen_xmlNsPtr(n_ns, 1);
21806 name = gen_const_xmlChar_ptr(n_name, 2);
21807 content = gen_const_xmlChar_ptr(n_content, 3);
21809 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21810 desret_xmlNodePtr(ret_val);
21812 des_xmlNodePtr(n_parent, parent, 0);
21813 des_xmlNsPtr(n_ns, ns, 1);
21814 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21815 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21816 xmlResetLastError();
21817 if (mem_base != xmlMemBlocks()) {
21818 printf("Leak of %d blocks found in xmlNewTextChild",
21819 xmlMemBlocks() - mem_base);
21821 printf(" %d", n_parent);
21822 printf(" %d", n_ns);
21823 printf(" %d", n_name);
21824 printf(" %d", n_content);
21840 test_xmlNewTextLen(void) {
21844 xmlNodePtr ret_val;
21845 xmlChar * content; /* the text content */
21847 int len; /* the text len. */
21850 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21851 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21852 mem_base = xmlMemBlocks();
21853 content = gen_const_xmlChar_ptr(n_content, 0);
21854 len = gen_int(n_len, 1);
21856 ret_val = xmlNewTextLen((const xmlChar *)content, len);
21857 desret_xmlNodePtr(ret_val);
21859 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21860 des_int(n_len, len, 1);
21861 xmlResetLastError();
21862 if (mem_base != xmlMemBlocks()) {
21863 printf("Leak of %d blocks found in xmlNewTextLen",
21864 xmlMemBlocks() - mem_base);
21866 printf(" %d", n_content);
21867 printf(" %d", n_len);
21879 test_xmlNextElementSibling(void) {
21882 #if defined(LIBXML_TREE_ENABLED)
21884 xmlNodePtr ret_val;
21885 xmlNodePtr node; /* the current node */
21888 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21889 mem_base = xmlMemBlocks();
21890 node = gen_xmlNodePtr(n_node, 0);
21892 ret_val = xmlNextElementSibling(node);
21893 desret_xmlNodePtr(ret_val);
21895 des_xmlNodePtr(n_node, node, 0);
21896 xmlResetLastError();
21897 if (mem_base != xmlMemBlocks()) {
21898 printf("Leak of %d blocks found in xmlNextElementSibling",
21899 xmlMemBlocks() - mem_base);
21901 printf(" %d", n_node);
21913 test_xmlNodeAddContent(void) {
21917 xmlNodePtr cur; /* the node being modified */
21919 xmlChar * content; /* extra content */
21922 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21923 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21924 mem_base = xmlMemBlocks();
21925 cur = gen_xmlNodePtr(n_cur, 0);
21926 content = gen_const_xmlChar_ptr(n_content, 1);
21928 xmlNodeAddContent(cur, (const xmlChar *)content);
21930 des_xmlNodePtr(n_cur, cur, 0);
21931 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21932 xmlResetLastError();
21933 if (mem_base != xmlMemBlocks()) {
21934 printf("Leak of %d blocks found in xmlNodeAddContent",
21935 xmlMemBlocks() - mem_base);
21937 printf(" %d", n_cur);
21938 printf(" %d", n_content);
21950 test_xmlNodeAddContentLen(void) {
21954 xmlNodePtr cur; /* the node being modified */
21956 xmlChar * content; /* extra content */
21958 int len; /* the size of @content */
21961 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21962 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21963 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21964 mem_base = xmlMemBlocks();
21965 cur = gen_xmlNodePtr(n_cur, 0);
21966 content = gen_const_xmlChar_ptr(n_content, 1);
21967 len = gen_int(n_len, 2);
21969 xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21971 des_xmlNodePtr(n_cur, cur, 0);
21972 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21973 des_int(n_len, len, 2);
21974 xmlResetLastError();
21975 if (mem_base != xmlMemBlocks()) {
21976 printf("Leak of %d blocks found in xmlNodeAddContentLen",
21977 xmlMemBlocks() - mem_base);
21979 printf(" %d", n_cur);
21980 printf(" %d", n_content);
21981 printf(" %d", n_len);
21994 test_xmlNodeBufGetContent(void) {
21999 xmlBufferPtr buffer; /* a buffer */
22001 xmlNodePtr cur; /* the node being read */
22004 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22005 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22006 mem_base = xmlMemBlocks();
22007 buffer = gen_xmlBufferPtr(n_buffer, 0);
22008 cur = gen_xmlNodePtr(n_cur, 1);
22010 ret_val = xmlNodeBufGetContent(buffer, cur);
22011 desret_int(ret_val);
22013 des_xmlBufferPtr(n_buffer, buffer, 0);
22014 des_xmlNodePtr(n_cur, cur, 1);
22015 xmlResetLastError();
22016 if (mem_base != xmlMemBlocks()) {
22017 printf("Leak of %d blocks found in xmlNodeBufGetContent",
22018 xmlMemBlocks() - mem_base);
22020 printf(" %d", n_buffer);
22021 printf(" %d", n_cur);
22033 test_xmlNodeDump(void) {
22036 #if defined(LIBXML_OUTPUT_ENABLED)
22039 xmlBufferPtr buf; /* the XML buffer output */
22041 xmlDocPtr doc; /* the document */
22043 xmlNodePtr cur; /* the current node */
22045 int level; /* the imbrication level for indenting */
22047 int format; /* is formatting allowed */
22050 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22051 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22052 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22053 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22054 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22055 mem_base = xmlMemBlocks();
22056 buf = gen_xmlBufferPtr(n_buf, 0);
22057 doc = gen_xmlDocPtr(n_doc, 1);
22058 cur = gen_xmlNodePtr(n_cur, 2);
22059 level = gen_int(n_level, 3);
22060 format = gen_int(n_format, 4);
22062 ret_val = xmlNodeDump(buf, doc, cur, level, format);
22063 desret_int(ret_val);
22065 des_xmlBufferPtr(n_buf, buf, 0);
22066 des_xmlDocPtr(n_doc, doc, 1);
22067 des_xmlNodePtr(n_cur, cur, 2);
22068 des_int(n_level, level, 3);
22069 des_int(n_format, format, 4);
22070 xmlResetLastError();
22071 if (mem_base != xmlMemBlocks()) {
22072 printf("Leak of %d blocks found in xmlNodeDump",
22073 xmlMemBlocks() - mem_base);
22075 printf(" %d", n_buf);
22076 printf(" %d", n_doc);
22077 printf(" %d", n_cur);
22078 printf(" %d", n_level);
22079 printf(" %d", n_format);
22095 test_xmlNodeDumpOutput(void) {
22098 #if defined(LIBXML_OUTPUT_ENABLED)
22100 xmlOutputBufferPtr buf; /* the XML buffer output */
22102 xmlDocPtr doc; /* the document */
22104 xmlNodePtr cur; /* the current node */
22106 int level; /* the imbrication level for indenting */
22108 int format; /* is formatting allowed */
22110 char * encoding; /* an optional encoding string */
22113 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22114 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22115 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22116 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22117 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22118 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22119 mem_base = xmlMemBlocks();
22120 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22121 doc = gen_xmlDocPtr(n_doc, 1);
22122 cur = gen_xmlNodePtr(n_cur, 2);
22123 level = gen_int(n_level, 3);
22124 format = gen_int(n_format, 4);
22125 encoding = gen_const_char_ptr(n_encoding, 5);
22127 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22129 des_xmlOutputBufferPtr(n_buf, buf, 0);
22130 des_xmlDocPtr(n_doc, doc, 1);
22131 des_xmlNodePtr(n_cur, cur, 2);
22132 des_int(n_level, level, 3);
22133 des_int(n_format, format, 4);
22134 des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22135 xmlResetLastError();
22136 if (mem_base != xmlMemBlocks()) {
22137 printf("Leak of %d blocks found in xmlNodeDumpOutput",
22138 xmlMemBlocks() - mem_base);
22140 printf(" %d", n_buf);
22141 printf(" %d", n_doc);
22142 printf(" %d", n_cur);
22143 printf(" %d", n_level);
22144 printf(" %d", n_format);
22145 printf(" %d", n_encoding);
22162 test_xmlNodeGetBase(void) {
22167 xmlDocPtr doc; /* the document the node pertains to */
22169 xmlNodePtr cur; /* the node being checked */
22172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22173 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22174 mem_base = xmlMemBlocks();
22175 doc = gen_xmlDocPtr(n_doc, 0);
22176 cur = gen_xmlNodePtr(n_cur, 1);
22178 ret_val = xmlNodeGetBase(doc, cur);
22179 desret_xmlChar_ptr(ret_val);
22181 des_xmlDocPtr(n_doc, doc, 0);
22182 des_xmlNodePtr(n_cur, cur, 1);
22183 xmlResetLastError();
22184 if (mem_base != xmlMemBlocks()) {
22185 printf("Leak of %d blocks found in xmlNodeGetBase",
22186 xmlMemBlocks() - mem_base);
22188 printf(" %d", n_doc);
22189 printf(" %d", n_cur);
22201 test_xmlNodeGetContent(void) {
22206 xmlNodePtr cur; /* the node being read */
22209 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22210 mem_base = xmlMemBlocks();
22211 cur = gen_xmlNodePtr(n_cur, 0);
22213 ret_val = xmlNodeGetContent(cur);
22214 desret_xmlChar_ptr(ret_val);
22216 des_xmlNodePtr(n_cur, cur, 0);
22217 xmlResetLastError();
22218 if (mem_base != xmlMemBlocks()) {
22219 printf("Leak of %d blocks found in xmlNodeGetContent",
22220 xmlMemBlocks() - mem_base);
22222 printf(" %d", n_cur);
22233 test_xmlNodeGetLang(void) {
22238 xmlNodePtr cur; /* the node being checked */
22241 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22242 mem_base = xmlMemBlocks();
22243 cur = gen_xmlNodePtr(n_cur, 0);
22245 ret_val = xmlNodeGetLang(cur);
22246 desret_xmlChar_ptr(ret_val);
22248 des_xmlNodePtr(n_cur, cur, 0);
22249 xmlResetLastError();
22250 if (mem_base != xmlMemBlocks()) {
22251 printf("Leak of %d blocks found in xmlNodeGetLang",
22252 xmlMemBlocks() - mem_base);
22254 printf(" %d", n_cur);
22265 test_xmlNodeGetSpacePreserve(void) {
22270 xmlNodePtr cur; /* the node being checked */
22273 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22274 mem_base = xmlMemBlocks();
22275 cur = gen_xmlNodePtr(n_cur, 0);
22277 ret_val = xmlNodeGetSpacePreserve(cur);
22278 desret_int(ret_val);
22280 des_xmlNodePtr(n_cur, cur, 0);
22281 xmlResetLastError();
22282 if (mem_base != xmlMemBlocks()) {
22283 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22284 xmlMemBlocks() - mem_base);
22286 printf(" %d", n_cur);
22297 test_xmlNodeIsText(void) {
22302 xmlNodePtr node; /* the node */
22305 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22306 mem_base = xmlMemBlocks();
22307 node = gen_xmlNodePtr(n_node, 0);
22309 ret_val = xmlNodeIsText(node);
22310 desret_int(ret_val);
22312 des_xmlNodePtr(n_node, node, 0);
22313 xmlResetLastError();
22314 if (mem_base != xmlMemBlocks()) {
22315 printf("Leak of %d blocks found in xmlNodeIsText",
22316 xmlMemBlocks() - mem_base);
22318 printf(" %d", n_node);
22329 test_xmlNodeListGetRawString(void) {
22332 #if defined(LIBXML_TREE_ENABLED)
22335 xmlDocPtr doc; /* the document */
22337 xmlNodePtr list; /* a Node list */
22339 int inLine; /* should we replace entity contents or show their external form */
22342 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22343 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22344 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22345 mem_base = xmlMemBlocks();
22346 doc = gen_xmlDocPtr(n_doc, 0);
22347 list = gen_xmlNodePtr(n_list, 1);
22348 inLine = gen_int(n_inLine, 2);
22350 ret_val = xmlNodeListGetRawString(doc, list, inLine);
22351 desret_xmlChar_ptr(ret_val);
22353 des_xmlDocPtr(n_doc, doc, 0);
22354 des_xmlNodePtr(n_list, list, 1);
22355 des_int(n_inLine, inLine, 2);
22356 xmlResetLastError();
22357 if (mem_base != xmlMemBlocks()) {
22358 printf("Leak of %d blocks found in xmlNodeListGetRawString",
22359 xmlMemBlocks() - mem_base);
22361 printf(" %d", n_doc);
22362 printf(" %d", n_list);
22363 printf(" %d", n_inLine);
22377 test_xmlNodeListGetString(void) {
22382 xmlDocPtr doc; /* the document */
22384 xmlNodePtr list; /* a Node list */
22386 int inLine; /* should we replace entity contents or show their external form */
22389 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22390 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22391 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22392 mem_base = xmlMemBlocks();
22393 doc = gen_xmlDocPtr(n_doc, 0);
22394 list = gen_xmlNodePtr(n_list, 1);
22395 inLine = gen_int(n_inLine, 2);
22397 ret_val = xmlNodeListGetString(doc, list, inLine);
22398 desret_xmlChar_ptr(ret_val);
22400 des_xmlDocPtr(n_doc, doc, 0);
22401 des_xmlNodePtr(n_list, list, 1);
22402 des_int(n_inLine, inLine, 2);
22403 xmlResetLastError();
22404 if (mem_base != xmlMemBlocks()) {
22405 printf("Leak of %d blocks found in xmlNodeListGetString",
22406 xmlMemBlocks() - mem_base);
22408 printf(" %d", n_doc);
22409 printf(" %d", n_list);
22410 printf(" %d", n_inLine);
22423 test_xmlNodeSetBase(void) {
22426 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22428 xmlNodePtr cur; /* the node being changed */
22430 xmlChar * uri; /* the new base URI */
22433 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22434 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22435 mem_base = xmlMemBlocks();
22436 cur = gen_xmlNodePtr(n_cur, 0);
22437 uri = gen_const_xmlChar_ptr(n_uri, 1);
22439 xmlNodeSetBase(cur, (const xmlChar *)uri);
22441 des_xmlNodePtr(n_cur, cur, 0);
22442 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22443 xmlResetLastError();
22444 if (mem_base != xmlMemBlocks()) {
22445 printf("Leak of %d blocks found in xmlNodeSetBase",
22446 xmlMemBlocks() - mem_base);
22448 printf(" %d", n_cur);
22449 printf(" %d", n_uri);
22462 test_xmlNodeSetContent(void) {
22466 xmlNodePtr cur; /* the node being modified */
22468 xmlChar * content; /* the new value of the content */
22471 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22472 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22473 mem_base = xmlMemBlocks();
22474 cur = gen_xmlNodePtr(n_cur, 0);
22475 content = gen_const_xmlChar_ptr(n_content, 1);
22477 xmlNodeSetContent(cur, (const xmlChar *)content);
22479 des_xmlNodePtr(n_cur, cur, 0);
22480 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22481 xmlResetLastError();
22482 if (mem_base != xmlMemBlocks()) {
22483 printf("Leak of %d blocks found in xmlNodeSetContent",
22484 xmlMemBlocks() - mem_base);
22486 printf(" %d", n_cur);
22487 printf(" %d", n_content);
22499 test_xmlNodeSetContentLen(void) {
22502 #if defined(LIBXML_TREE_ENABLED)
22504 xmlNodePtr cur; /* the node being modified */
22506 xmlChar * content; /* the new value of the content */
22508 int len; /* the size of @content */
22511 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22512 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22513 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22514 mem_base = xmlMemBlocks();
22515 cur = gen_xmlNodePtr(n_cur, 0);
22516 content = gen_const_xmlChar_ptr(n_content, 1);
22517 len = gen_int(n_len, 2);
22519 xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22521 des_xmlNodePtr(n_cur, cur, 0);
22522 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22523 des_int(n_len, len, 2);
22524 xmlResetLastError();
22525 if (mem_base != xmlMemBlocks()) {
22526 printf("Leak of %d blocks found in xmlNodeSetContentLen",
22527 xmlMemBlocks() - mem_base);
22529 printf(" %d", n_cur);
22530 printf(" %d", n_content);
22531 printf(" %d", n_len);
22545 test_xmlNodeSetLang(void) {
22548 #if defined(LIBXML_TREE_ENABLED)
22550 xmlNodePtr cur; /* the node being changed */
22552 xmlChar * lang; /* the language description */
22555 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22556 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22557 mem_base = xmlMemBlocks();
22558 cur = gen_xmlNodePtr(n_cur, 0);
22559 lang = gen_const_xmlChar_ptr(n_lang, 1);
22561 xmlNodeSetLang(cur, (const xmlChar *)lang);
22563 des_xmlNodePtr(n_cur, cur, 0);
22564 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22565 xmlResetLastError();
22566 if (mem_base != xmlMemBlocks()) {
22567 printf("Leak of %d blocks found in xmlNodeSetLang",
22568 xmlMemBlocks() - mem_base);
22570 printf(" %d", n_cur);
22571 printf(" %d", n_lang);
22584 test_xmlNodeSetName(void) {
22587 #if defined(LIBXML_TREE_ENABLED)
22589 xmlNodePtr cur; /* the node being changed */
22591 xmlChar * name; /* the new tag name */
22594 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22595 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22596 mem_base = xmlMemBlocks();
22597 cur = gen_xmlNodePtr(n_cur, 0);
22598 name = gen_const_xmlChar_ptr(n_name, 1);
22600 xmlNodeSetName(cur, (const xmlChar *)name);
22602 des_xmlNodePtr(n_cur, cur, 0);
22603 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22604 xmlResetLastError();
22605 if (mem_base != xmlMemBlocks()) {
22606 printf("Leak of %d blocks found in xmlNodeSetName",
22607 xmlMemBlocks() - mem_base);
22609 printf(" %d", n_cur);
22610 printf(" %d", n_name);
22623 test_xmlNodeSetSpacePreserve(void) {
22626 #if defined(LIBXML_TREE_ENABLED)
22628 xmlNodePtr cur; /* the node being changed */
22630 int val; /* the xml:space value ("0": default, 1: "preserve") */
22633 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22634 for (n_val = 0;n_val < gen_nb_int;n_val++) {
22635 mem_base = xmlMemBlocks();
22636 cur = gen_xmlNodePtr(n_cur, 0);
22637 val = gen_int(n_val, 1);
22639 xmlNodeSetSpacePreserve(cur, val);
22641 des_xmlNodePtr(n_cur, cur, 0);
22642 des_int(n_val, val, 1);
22643 xmlResetLastError();
22644 if (mem_base != xmlMemBlocks()) {
22645 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22646 xmlMemBlocks() - mem_base);
22648 printf(" %d", n_cur);
22649 printf(" %d", n_val);
22662 test_xmlPreviousElementSibling(void) {
22665 #if defined(LIBXML_TREE_ENABLED)
22667 xmlNodePtr ret_val;
22668 xmlNodePtr node; /* the current node */
22671 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22672 mem_base = xmlMemBlocks();
22673 node = gen_xmlNodePtr(n_node, 0);
22675 ret_val = xmlPreviousElementSibling(node);
22676 desret_xmlNodePtr(ret_val);
22678 des_xmlNodePtr(n_node, node, 0);
22679 xmlResetLastError();
22680 if (mem_base != xmlMemBlocks()) {
22681 printf("Leak of %d blocks found in xmlPreviousElementSibling",
22682 xmlMemBlocks() - mem_base);
22684 printf(" %d", n_node);
22696 test_xmlReconciliateNs(void) {
22699 #if defined(LIBXML_TREE_ENABLED)
22700 #ifdef LIBXML_TREE_ENABLED
22703 xmlDocPtr doc; /* the document */
22705 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22708 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22709 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22710 mem_base = xmlMemBlocks();
22711 doc = gen_xmlDocPtr(n_doc, 0);
22712 tree = gen_xmlNodePtr(n_tree, 1);
22714 ret_val = xmlReconciliateNs(doc, tree);
22715 desret_int(ret_val);
22717 des_xmlDocPtr(n_doc, doc, 0);
22718 des_xmlNodePtr(n_tree, tree, 1);
22719 xmlResetLastError();
22720 if (mem_base != xmlMemBlocks()) {
22721 printf("Leak of %d blocks found in xmlReconciliateNs",
22722 xmlMemBlocks() - mem_base);
22724 printf(" %d", n_doc);
22725 printf(" %d", n_tree);
22739 test_xmlRemoveProp(void) {
22744 xmlAttrPtr cur; /* an attribute */
22747 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22748 mem_base = xmlMemBlocks();
22749 cur = gen_xmlAttrPtr(n_cur, 0);
22751 ret_val = xmlRemoveProp(cur);
22753 desret_int(ret_val);
22755 des_xmlAttrPtr(n_cur, cur, 0);
22756 xmlResetLastError();
22757 if (mem_base != xmlMemBlocks()) {
22758 printf("Leak of %d blocks found in xmlRemoveProp",
22759 xmlMemBlocks() - mem_base);
22761 printf(" %d", n_cur);
22772 test_xmlReplaceNode(void) {
22775 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22777 xmlNodePtr ret_val;
22778 xmlNodePtr old; /* the old node */
22780 xmlNodePtr cur; /* the node */
22783 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22784 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22785 mem_base = xmlMemBlocks();
22786 old = gen_xmlNodePtr(n_old, 0);
22787 cur = gen_xmlNodePtr_in(n_cur, 1);
22789 ret_val = xmlReplaceNode(old, cur);
22791 xmlUnlinkNode(cur);
22792 xmlFreeNode(cur) ; cur = NULL ; }
22794 xmlUnlinkNode(old);
22795 xmlFreeNode(old) ; old = NULL ; }
22797 desret_xmlNodePtr(ret_val);
22799 des_xmlNodePtr(n_old, old, 0);
22800 des_xmlNodePtr_in(n_cur, cur, 1);
22801 xmlResetLastError();
22802 if (mem_base != xmlMemBlocks()) {
22803 printf("Leak of %d blocks found in xmlReplaceNode",
22804 xmlMemBlocks() - mem_base);
22806 printf(" %d", n_old);
22807 printf(" %d", n_cur);
22820 test_xmlSaveFile(void) {
22823 #if defined(LIBXML_OUTPUT_ENABLED)
22826 const char * filename; /* the filename (or URL) */
22828 xmlDocPtr cur; /* the document */
22831 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22832 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22833 mem_base = xmlMemBlocks();
22834 filename = gen_fileoutput(n_filename, 0);
22835 cur = gen_xmlDocPtr(n_cur, 1);
22837 ret_val = xmlSaveFile(filename, cur);
22838 desret_int(ret_val);
22840 des_fileoutput(n_filename, filename, 0);
22841 des_xmlDocPtr(n_cur, cur, 1);
22842 xmlResetLastError();
22843 if (mem_base != xmlMemBlocks()) {
22844 printf("Leak of %d blocks found in xmlSaveFile",
22845 xmlMemBlocks() - mem_base);
22847 printf(" %d", n_filename);
22848 printf(" %d", n_cur);
22861 test_xmlSaveFileEnc(void) {
22864 #if defined(LIBXML_OUTPUT_ENABLED)
22867 const char * filename; /* the filename (or URL) */
22869 xmlDocPtr cur; /* the document */
22871 char * encoding; /* the name of an encoding (or NULL) */
22874 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22875 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22876 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22877 mem_base = xmlMemBlocks();
22878 filename = gen_fileoutput(n_filename, 0);
22879 cur = gen_xmlDocPtr(n_cur, 1);
22880 encoding = gen_const_char_ptr(n_encoding, 2);
22882 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22883 desret_int(ret_val);
22885 des_fileoutput(n_filename, filename, 0);
22886 des_xmlDocPtr(n_cur, cur, 1);
22887 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22888 xmlResetLastError();
22889 if (mem_base != xmlMemBlocks()) {
22890 printf("Leak of %d blocks found in xmlSaveFileEnc",
22891 xmlMemBlocks() - mem_base);
22893 printf(" %d", n_filename);
22894 printf(" %d", n_cur);
22895 printf(" %d", n_encoding);
22909 test_xmlSaveFileTo(void) {
22912 #if defined(LIBXML_OUTPUT_ENABLED)
22915 xmlOutputBufferPtr buf; /* an output I/O buffer */
22917 xmlDocPtr cur; /* the document */
22919 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22922 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22923 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22924 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22925 mem_base = xmlMemBlocks();
22926 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22927 cur = gen_xmlDocPtr(n_cur, 1);
22928 encoding = gen_const_char_ptr(n_encoding, 2);
22930 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22932 desret_int(ret_val);
22934 des_xmlOutputBufferPtr(n_buf, buf, 0);
22935 des_xmlDocPtr(n_cur, cur, 1);
22936 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22937 xmlResetLastError();
22938 if (mem_base != xmlMemBlocks()) {
22939 printf("Leak of %d blocks found in xmlSaveFileTo",
22940 xmlMemBlocks() - mem_base);
22942 printf(" %d", n_buf);
22943 printf(" %d", n_cur);
22944 printf(" %d", n_encoding);
22958 test_xmlSaveFormatFile(void) {
22961 #if defined(LIBXML_OUTPUT_ENABLED)
22964 const char * filename; /* the filename (or URL) */
22966 xmlDocPtr cur; /* the document */
22968 int format; /* should formatting spaces been added */
22971 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22972 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22973 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22974 mem_base = xmlMemBlocks();
22975 filename = gen_fileoutput(n_filename, 0);
22976 cur = gen_xmlDocPtr(n_cur, 1);
22977 format = gen_int(n_format, 2);
22979 ret_val = xmlSaveFormatFile(filename, cur, format);
22980 desret_int(ret_val);
22982 des_fileoutput(n_filename, filename, 0);
22983 des_xmlDocPtr(n_cur, cur, 1);
22984 des_int(n_format, format, 2);
22985 xmlResetLastError();
22986 if (mem_base != xmlMemBlocks()) {
22987 printf("Leak of %d blocks found in xmlSaveFormatFile",
22988 xmlMemBlocks() - mem_base);
22990 printf(" %d", n_filename);
22991 printf(" %d", n_cur);
22992 printf(" %d", n_format);
23006 test_xmlSaveFormatFileEnc(void) {
23009 #if defined(LIBXML_OUTPUT_ENABLED)
23012 const char * filename; /* the filename or URL to output */
23014 xmlDocPtr cur; /* the document being saved */
23016 char * encoding; /* the name of the encoding to use or NULL. */
23018 int format; /* should formatting spaces be added. */
23021 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23022 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23023 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23024 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23025 mem_base = xmlMemBlocks();
23026 filename = gen_fileoutput(n_filename, 0);
23027 cur = gen_xmlDocPtr(n_cur, 1);
23028 encoding = gen_const_char_ptr(n_encoding, 2);
23029 format = gen_int(n_format, 3);
23031 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23032 desret_int(ret_val);
23034 des_fileoutput(n_filename, filename, 0);
23035 des_xmlDocPtr(n_cur, cur, 1);
23036 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23037 des_int(n_format, format, 3);
23038 xmlResetLastError();
23039 if (mem_base != xmlMemBlocks()) {
23040 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23041 xmlMemBlocks() - mem_base);
23043 printf(" %d", n_filename);
23044 printf(" %d", n_cur);
23045 printf(" %d", n_encoding);
23046 printf(" %d", n_format);
23061 test_xmlSaveFormatFileTo(void) {
23064 #if defined(LIBXML_OUTPUT_ENABLED)
23067 xmlOutputBufferPtr buf; /* an output I/O buffer */
23069 xmlDocPtr cur; /* the document */
23071 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23073 int format; /* should formatting spaces been added */
23076 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23077 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23078 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23079 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23080 mem_base = xmlMemBlocks();
23081 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23082 cur = gen_xmlDocPtr(n_cur, 1);
23083 encoding = gen_const_char_ptr(n_encoding, 2);
23084 format = gen_int(n_format, 3);
23086 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23088 desret_int(ret_val);
23090 des_xmlOutputBufferPtr(n_buf, buf, 0);
23091 des_xmlDocPtr(n_cur, cur, 1);
23092 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23093 des_int(n_format, format, 3);
23094 xmlResetLastError();
23095 if (mem_base != xmlMemBlocks()) {
23096 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23097 xmlMemBlocks() - mem_base);
23099 printf(" %d", n_buf);
23100 printf(" %d", n_cur);
23101 printf(" %d", n_encoding);
23102 printf(" %d", n_format);
23117 test_xmlSearchNs(void) {
23122 xmlDocPtr doc; /* the document */
23124 xmlNodePtr node; /* the current node */
23126 xmlChar * nameSpace; /* the namespace prefix */
23129 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23130 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23131 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23132 mem_base = xmlMemBlocks();
23133 doc = gen_xmlDocPtr(n_doc, 0);
23134 node = gen_xmlNodePtr(n_node, 1);
23135 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23137 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23138 desret_xmlNsPtr(ret_val);
23140 des_xmlDocPtr(n_doc, doc, 0);
23141 des_xmlNodePtr(n_node, node, 1);
23142 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23143 xmlResetLastError();
23144 if (mem_base != xmlMemBlocks()) {
23145 printf("Leak of %d blocks found in xmlSearchNs",
23146 xmlMemBlocks() - mem_base);
23148 printf(" %d", n_doc);
23149 printf(" %d", n_node);
23150 printf(" %d", n_nameSpace);
23163 test_xmlSearchNsByHref(void) {
23168 xmlDocPtr doc; /* the document */
23170 xmlNodePtr node; /* the current node */
23172 xmlChar * href; /* the namespace value */
23175 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23176 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23177 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23178 mem_base = xmlMemBlocks();
23179 doc = gen_xmlDocPtr(n_doc, 0);
23180 node = gen_xmlNodePtr(n_node, 1);
23181 href = gen_const_xmlChar_ptr(n_href, 2);
23183 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23184 desret_xmlNsPtr(ret_val);
23186 des_xmlDocPtr(n_doc, doc, 0);
23187 des_xmlNodePtr(n_node, node, 1);
23188 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23189 xmlResetLastError();
23190 if (mem_base != xmlMemBlocks()) {
23191 printf("Leak of %d blocks found in xmlSearchNsByHref",
23192 xmlMemBlocks() - mem_base);
23194 printf(" %d", n_doc);
23195 printf(" %d", n_node);
23196 printf(" %d", n_href);
23209 test_xmlSetBufferAllocationScheme(void) {
23213 xmlBufferAllocationScheme scheme; /* allocation method to use */
23216 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23217 mem_base = xmlMemBlocks();
23218 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23220 xmlSetBufferAllocationScheme(scheme);
23222 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23223 xmlResetLastError();
23224 if (mem_base != xmlMemBlocks()) {
23225 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23226 xmlMemBlocks() - mem_base);
23228 printf(" %d", n_scheme);
23239 test_xmlSetCompressMode(void) {
23243 int mode; /* the compression ratio */
23246 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23247 mem_base = xmlMemBlocks();
23248 mode = gen_int(n_mode, 0);
23250 xmlSetCompressMode(mode);
23252 des_int(n_mode, mode, 0);
23253 xmlResetLastError();
23254 if (mem_base != xmlMemBlocks()) {
23255 printf("Leak of %d blocks found in xmlSetCompressMode",
23256 xmlMemBlocks() - mem_base);
23258 printf(" %d", n_mode);
23269 test_xmlSetDocCompressMode(void) {
23273 xmlDocPtr doc; /* the document */
23275 int mode; /* the compression ratio */
23278 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23279 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23280 mem_base = xmlMemBlocks();
23281 doc = gen_xmlDocPtr(n_doc, 0);
23282 mode = gen_int(n_mode, 1);
23284 xmlSetDocCompressMode(doc, mode);
23286 des_xmlDocPtr(n_doc, doc, 0);
23287 des_int(n_mode, mode, 1);
23288 xmlResetLastError();
23289 if (mem_base != xmlMemBlocks()) {
23290 printf("Leak of %d blocks found in xmlSetDocCompressMode",
23291 xmlMemBlocks() - mem_base);
23293 printf(" %d", n_doc);
23294 printf(" %d", n_mode);
23306 test_xmlSetNs(void) {
23310 xmlNodePtr node; /* a node in the document */
23312 xmlNsPtr ns; /* a namespace pointer */
23315 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23316 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23317 mem_base = xmlMemBlocks();
23318 node = gen_xmlNodePtr(n_node, 0);
23319 ns = gen_xmlNsPtr(n_ns, 1);
23321 xmlSetNs(node, ns);
23323 des_xmlNodePtr(n_node, node, 0);
23324 des_xmlNsPtr(n_ns, ns, 1);
23325 xmlResetLastError();
23326 if (mem_base != xmlMemBlocks()) {
23327 printf("Leak of %d blocks found in xmlSetNs",
23328 xmlMemBlocks() - mem_base);
23330 printf(" %d", n_node);
23331 printf(" %d", n_ns);
23343 test_xmlSetNsProp(void) {
23346 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23348 xmlAttrPtr ret_val;
23349 xmlNodePtr node; /* the node */
23351 xmlNsPtr ns; /* the namespace definition */
23353 xmlChar * name; /* the attribute name */
23355 xmlChar * value; /* the attribute value */
23358 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23359 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23360 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23361 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23362 mem_base = xmlMemBlocks();
23363 node = gen_xmlNodePtr(n_node, 0);
23364 ns = gen_xmlNsPtr(n_ns, 1);
23365 name = gen_const_xmlChar_ptr(n_name, 2);
23366 value = gen_const_xmlChar_ptr(n_value, 3);
23368 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23369 desret_xmlAttrPtr(ret_val);
23371 des_xmlNodePtr(n_node, node, 0);
23372 des_xmlNsPtr(n_ns, ns, 1);
23373 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23374 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23375 xmlResetLastError();
23376 if (mem_base != xmlMemBlocks()) {
23377 printf("Leak of %d blocks found in xmlSetNsProp",
23378 xmlMemBlocks() - mem_base);
23380 printf(" %d", n_node);
23381 printf(" %d", n_ns);
23382 printf(" %d", n_name);
23383 printf(" %d", n_value);
23398 test_xmlSetProp(void) {
23401 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23403 xmlAttrPtr ret_val;
23404 xmlNodePtr node; /* the node */
23406 xmlChar * name; /* the attribute name (a QName) */
23408 xmlChar * value; /* the attribute value */
23411 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23412 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23413 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23414 mem_base = xmlMemBlocks();
23415 node = gen_xmlNodePtr(n_node, 0);
23416 name = gen_const_xmlChar_ptr(n_name, 1);
23417 value = gen_const_xmlChar_ptr(n_value, 2);
23419 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23420 desret_xmlAttrPtr(ret_val);
23422 des_xmlNodePtr(n_node, node, 0);
23423 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23424 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23425 xmlResetLastError();
23426 if (mem_base != xmlMemBlocks()) {
23427 printf("Leak of %d blocks found in xmlSetProp",
23428 xmlMemBlocks() - mem_base);
23430 printf(" %d", n_node);
23431 printf(" %d", n_name);
23432 printf(" %d", n_value);
23446 test_xmlSplitQName2(void) {
23451 xmlChar * name; /* the full QName */
23453 xmlChar ** prefix; /* a xmlChar ** */
23456 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23457 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23458 mem_base = xmlMemBlocks();
23459 name = gen_const_xmlChar_ptr(n_name, 0);
23460 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23462 ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23463 desret_xmlChar_ptr(ret_val);
23465 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23466 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23467 xmlResetLastError();
23468 if (mem_base != xmlMemBlocks()) {
23469 printf("Leak of %d blocks found in xmlSplitQName2",
23470 xmlMemBlocks() - mem_base);
23472 printf(" %d", n_name);
23473 printf(" %d", n_prefix);
23485 test_xmlSplitQName3(void) {
23489 const xmlChar * ret_val;
23490 xmlChar * name; /* the full QName */
23492 int * len; /* an int * */
23495 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23496 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23497 mem_base = xmlMemBlocks();
23498 name = gen_const_xmlChar_ptr(n_name, 0);
23499 len = gen_int_ptr(n_len, 1);
23501 ret_val = xmlSplitQName3((const xmlChar *)name, len);
23502 desret_const_xmlChar_ptr(ret_val);
23504 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23505 des_int_ptr(n_len, len, 1);
23506 xmlResetLastError();
23507 if (mem_base != xmlMemBlocks()) {
23508 printf("Leak of %d blocks found in xmlSplitQName3",
23509 xmlMemBlocks() - mem_base);
23511 printf(" %d", n_name);
23512 printf(" %d", n_len);
23524 test_xmlStringGetNodeList(void) {
23528 xmlNodePtr ret_val;
23529 xmlDocPtr doc; /* the document */
23531 xmlChar * value; /* the value of the attribute */
23534 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23535 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23536 mem_base = xmlMemBlocks();
23537 doc = gen_xmlDocPtr(n_doc, 0);
23538 value = gen_const_xmlChar_ptr(n_value, 1);
23540 ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23541 desret_xmlNodePtr(ret_val);
23543 des_xmlDocPtr(n_doc, doc, 0);
23544 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23545 xmlResetLastError();
23546 if (mem_base != xmlMemBlocks()) {
23547 printf("Leak of %d blocks found in xmlStringGetNodeList",
23548 xmlMemBlocks() - mem_base);
23550 printf(" %d", n_doc);
23551 printf(" %d", n_value);
23563 test_xmlStringLenGetNodeList(void) {
23567 xmlNodePtr ret_val;
23568 xmlDocPtr doc; /* the document */
23570 xmlChar * value; /* the value of the text */
23572 int len; /* the length of the string value */
23575 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23576 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23577 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23578 mem_base = xmlMemBlocks();
23579 doc = gen_xmlDocPtr(n_doc, 0);
23580 value = gen_const_xmlChar_ptr(n_value, 1);
23581 len = gen_int(n_len, 2);
23583 ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23584 desret_xmlNodePtr(ret_val);
23586 des_xmlDocPtr(n_doc, doc, 0);
23587 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23588 des_int(n_len, len, 2);
23589 xmlResetLastError();
23590 if (mem_base != xmlMemBlocks()) {
23591 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23592 xmlMemBlocks() - mem_base);
23594 printf(" %d", n_doc);
23595 printf(" %d", n_value);
23596 printf(" %d", n_len);
23609 test_xmlTextConcat(void) {
23614 xmlNodePtr node; /* the node */
23616 xmlChar * content; /* the content */
23618 int len; /* @content length */
23621 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23622 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23623 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23624 mem_base = xmlMemBlocks();
23625 node = gen_xmlNodePtr(n_node, 0);
23626 content = gen_const_xmlChar_ptr(n_content, 1);
23627 len = gen_int(n_len, 2);
23629 ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23630 desret_int(ret_val);
23632 des_xmlNodePtr(n_node, node, 0);
23633 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23634 des_int(n_len, len, 2);
23635 xmlResetLastError();
23636 if (mem_base != xmlMemBlocks()) {
23637 printf("Leak of %d blocks found in xmlTextConcat",
23638 xmlMemBlocks() - mem_base);
23640 printf(" %d", n_node);
23641 printf(" %d", n_content);
23642 printf(" %d", n_len);
23655 test_xmlTextMerge(void) {
23659 xmlNodePtr ret_val;
23660 xmlNodePtr first; /* the first text node */
23662 xmlNodePtr second; /* the second text node being merged */
23665 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23666 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23667 mem_base = xmlMemBlocks();
23668 first = gen_xmlNodePtr_in(n_first, 0);
23669 second = gen_xmlNodePtr_in(n_second, 1);
23671 ret_val = xmlTextMerge(first, second);
23672 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23673 xmlUnlinkNode(second);
23674 xmlFreeNode(second) ; second = NULL ; }
23675 desret_xmlNodePtr(ret_val);
23677 des_xmlNodePtr_in(n_first, first, 0);
23678 des_xmlNodePtr_in(n_second, second, 1);
23679 xmlResetLastError();
23680 if (mem_base != xmlMemBlocks()) {
23681 printf("Leak of %d blocks found in xmlTextMerge",
23682 xmlMemBlocks() - mem_base);
23684 printf(" %d", n_first);
23685 printf(" %d", n_second);
23697 test_xmlUnsetNsProp(void) {
23700 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23703 xmlNodePtr node; /* the node */
23705 xmlNsPtr ns; /* the namespace definition */
23707 xmlChar * name; /* the attribute name */
23710 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23711 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23712 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23713 mem_base = xmlMemBlocks();
23714 node = gen_xmlNodePtr(n_node, 0);
23715 ns = gen_xmlNsPtr(n_ns, 1);
23716 name = gen_const_xmlChar_ptr(n_name, 2);
23718 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23719 desret_int(ret_val);
23721 des_xmlNodePtr(n_node, node, 0);
23722 des_xmlNsPtr(n_ns, ns, 1);
23723 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23724 xmlResetLastError();
23725 if (mem_base != xmlMemBlocks()) {
23726 printf("Leak of %d blocks found in xmlUnsetNsProp",
23727 xmlMemBlocks() - mem_base);
23729 printf(" %d", n_node);
23730 printf(" %d", n_ns);
23731 printf(" %d", n_name);
23745 test_xmlUnsetProp(void) {
23748 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23751 xmlNodePtr node; /* the node */
23753 xmlChar * name; /* the attribute name */
23756 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23757 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23758 mem_base = xmlMemBlocks();
23759 node = gen_xmlNodePtr(n_node, 0);
23760 name = gen_const_xmlChar_ptr(n_name, 1);
23762 ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23763 desret_int(ret_val);
23765 des_xmlNodePtr(n_node, node, 0);
23766 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23767 xmlResetLastError();
23768 if (mem_base != xmlMemBlocks()) {
23769 printf("Leak of %d blocks found in xmlUnsetProp",
23770 xmlMemBlocks() - mem_base);
23772 printf(" %d", n_node);
23773 printf(" %d", n_name);
23786 test_xmlValidateNCName(void) {
23789 #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)
23790 #ifdef LIBXML_TREE_ENABLED
23793 xmlChar * value; /* the value to check */
23795 int space; /* allow spaces in front and end of the string */
23798 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23799 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23800 mem_base = xmlMemBlocks();
23801 value = gen_const_xmlChar_ptr(n_value, 0);
23802 space = gen_int(n_space, 1);
23804 ret_val = xmlValidateNCName((const xmlChar *)value, space);
23805 desret_int(ret_val);
23807 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23808 des_int(n_space, space, 1);
23809 xmlResetLastError();
23810 if (mem_base != xmlMemBlocks()) {
23811 printf("Leak of %d blocks found in xmlValidateNCName",
23812 xmlMemBlocks() - mem_base);
23814 printf(" %d", n_value);
23815 printf(" %d", n_space);
23829 test_xmlValidateNMToken(void) {
23832 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23833 #ifdef LIBXML_TREE_ENABLED
23836 xmlChar * value; /* the value to check */
23838 int space; /* allow spaces in front and end of the string */
23841 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23842 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23843 mem_base = xmlMemBlocks();
23844 value = gen_const_xmlChar_ptr(n_value, 0);
23845 space = gen_int(n_space, 1);
23847 ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23848 desret_int(ret_val);
23850 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23851 des_int(n_space, space, 1);
23852 xmlResetLastError();
23853 if (mem_base != xmlMemBlocks()) {
23854 printf("Leak of %d blocks found in xmlValidateNMToken",
23855 xmlMemBlocks() - mem_base);
23857 printf(" %d", n_value);
23858 printf(" %d", n_space);
23872 test_xmlValidateName(void) {
23875 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23876 #ifdef LIBXML_TREE_ENABLED
23879 xmlChar * value; /* the value to check */
23881 int space; /* allow spaces in front and end of the string */
23884 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23885 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23886 mem_base = xmlMemBlocks();
23887 value = gen_const_xmlChar_ptr(n_value, 0);
23888 space = gen_int(n_space, 1);
23890 ret_val = xmlValidateName((const xmlChar *)value, space);
23891 desret_int(ret_val);
23893 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23894 des_int(n_space, space, 1);
23895 xmlResetLastError();
23896 if (mem_base != xmlMemBlocks()) {
23897 printf("Leak of %d blocks found in xmlValidateName",
23898 xmlMemBlocks() - mem_base);
23900 printf(" %d", n_value);
23901 printf(" %d", n_space);
23915 test_xmlValidateQName(void) {
23918 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23919 #ifdef LIBXML_TREE_ENABLED
23922 xmlChar * value; /* the value to check */
23924 int space; /* allow spaces in front and end of the string */
23927 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23928 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23929 mem_base = xmlMemBlocks();
23930 value = gen_const_xmlChar_ptr(n_value, 0);
23931 space = gen_int(n_space, 1);
23933 ret_val = xmlValidateQName((const xmlChar *)value, space);
23934 desret_int(ret_val);
23936 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23937 des_int(n_space, space, 1);
23938 xmlResetLastError();
23939 if (mem_base != xmlMemBlocks()) {
23940 printf("Leak of %d blocks found in xmlValidateQName",
23941 xmlMemBlocks() - mem_base);
23943 printf(" %d", n_value);
23944 printf(" %d", n_space);
23960 if (quiet == 0) printf("Testing tree : 138 of 157 functions ...\n");
23961 test_ret += test_xmlAddChild();
23962 test_ret += test_xmlAddChildList();
23963 test_ret += test_xmlAddNextSibling();
23964 test_ret += test_xmlAddPrevSibling();
23965 test_ret += test_xmlAddSibling();
23966 test_ret += test_xmlAttrSerializeTxtContent();
23967 test_ret += test_xmlBufferAdd();
23968 test_ret += test_xmlBufferAddHead();
23969 test_ret += test_xmlBufferCCat();
23970 test_ret += test_xmlBufferCat();
23971 test_ret += test_xmlBufferContent();
23972 test_ret += test_xmlBufferCreate();
23973 test_ret += test_xmlBufferCreateSize();
23974 test_ret += test_xmlBufferCreateStatic();
23975 test_ret += test_xmlBufferEmpty();
23976 test_ret += test_xmlBufferGrow();
23977 test_ret += test_xmlBufferLength();
23978 test_ret += test_xmlBufferResize();
23979 test_ret += test_xmlBufferSetAllocationScheme();
23980 test_ret += test_xmlBufferShrink();
23981 test_ret += test_xmlBufferWriteCHAR();
23982 test_ret += test_xmlBufferWriteChar();
23983 test_ret += test_xmlBufferWriteQuotedString();
23984 test_ret += test_xmlBuildQName();
23985 test_ret += test_xmlChildElementCount();
23986 test_ret += test_xmlCopyDoc();
23987 test_ret += test_xmlCopyDtd();
23988 test_ret += test_xmlCopyNamespace();
23989 test_ret += test_xmlCopyNamespaceList();
23990 test_ret += test_xmlCopyNode();
23991 test_ret += test_xmlCopyNodeList();
23992 test_ret += test_xmlCopyProp();
23993 test_ret += test_xmlCopyPropList();
23994 test_ret += test_xmlCreateIntSubset();
23995 test_ret += test_xmlDOMWrapAdoptNode();
23996 test_ret += test_xmlDOMWrapCloneNode();
23997 test_ret += test_xmlDOMWrapNewCtxt();
23998 test_ret += test_xmlDOMWrapReconcileNamespaces();
23999 test_ret += test_xmlDOMWrapRemoveNode();
24000 test_ret += test_xmlDocCopyNode();
24001 test_ret += test_xmlDocCopyNodeList();
24002 test_ret += test_xmlDocDump();
24003 test_ret += test_xmlDocDumpFormatMemory();
24004 test_ret += test_xmlDocDumpFormatMemoryEnc();
24005 test_ret += test_xmlDocDumpMemory();
24006 test_ret += test_xmlDocDumpMemoryEnc();
24007 test_ret += test_xmlDocFormatDump();
24008 test_ret += test_xmlDocGetRootElement();
24009 test_ret += test_xmlDocSetRootElement();
24010 test_ret += test_xmlElemDump();
24011 test_ret += test_xmlFirstElementChild();
24012 test_ret += test_xmlGetBufferAllocationScheme();
24013 test_ret += test_xmlGetCompressMode();
24014 test_ret += test_xmlGetDocCompressMode();
24015 test_ret += test_xmlGetIntSubset();
24016 test_ret += test_xmlGetLastChild();
24017 test_ret += test_xmlGetLineNo();
24018 test_ret += test_xmlGetNoNsProp();
24019 test_ret += test_xmlGetNodePath();
24020 test_ret += test_xmlGetNsList();
24021 test_ret += test_xmlGetNsProp();
24022 test_ret += test_xmlGetProp();
24023 test_ret += test_xmlHasNsProp();
24024 test_ret += test_xmlHasProp();
24025 test_ret += test_xmlIsBlankNode();
24026 test_ret += test_xmlIsXHTML();
24027 test_ret += test_xmlLastElementChild();
24028 test_ret += test_xmlNewCDataBlock();
24029 test_ret += test_xmlNewCharRef();
24030 test_ret += test_xmlNewChild();
24031 test_ret += test_xmlNewComment();
24032 test_ret += test_xmlNewDoc();
24033 test_ret += test_xmlNewDocComment();
24034 test_ret += test_xmlNewDocFragment();
24035 test_ret += test_xmlNewDocNode();
24036 test_ret += test_xmlNewDocNodeEatName();
24037 test_ret += test_xmlNewDocPI();
24038 test_ret += test_xmlNewDocProp();
24039 test_ret += test_xmlNewDocRawNode();
24040 test_ret += test_xmlNewDocText();
24041 test_ret += test_xmlNewDocTextLen();
24042 test_ret += test_xmlNewDtd();
24043 test_ret += test_xmlNewNode();
24044 test_ret += test_xmlNewNodeEatName();
24045 test_ret += test_xmlNewNs();
24046 test_ret += test_xmlNewNsProp();
24047 test_ret += test_xmlNewNsPropEatName();
24048 test_ret += test_xmlNewPI();
24049 test_ret += test_xmlNewProp();
24050 test_ret += test_xmlNewReference();
24051 test_ret += test_xmlNewText();
24052 test_ret += test_xmlNewTextChild();
24053 test_ret += test_xmlNewTextLen();
24054 test_ret += test_xmlNextElementSibling();
24055 test_ret += test_xmlNodeAddContent();
24056 test_ret += test_xmlNodeAddContentLen();
24057 test_ret += test_xmlNodeBufGetContent();
24058 test_ret += test_xmlNodeDump();
24059 test_ret += test_xmlNodeDumpOutput();
24060 test_ret += test_xmlNodeGetBase();
24061 test_ret += test_xmlNodeGetContent();
24062 test_ret += test_xmlNodeGetLang();
24063 test_ret += test_xmlNodeGetSpacePreserve();
24064 test_ret += test_xmlNodeIsText();
24065 test_ret += test_xmlNodeListGetRawString();
24066 test_ret += test_xmlNodeListGetString();
24067 test_ret += test_xmlNodeSetBase();
24068 test_ret += test_xmlNodeSetContent();
24069 test_ret += test_xmlNodeSetContentLen();
24070 test_ret += test_xmlNodeSetLang();
24071 test_ret += test_xmlNodeSetName();
24072 test_ret += test_xmlNodeSetSpacePreserve();
24073 test_ret += test_xmlPreviousElementSibling();
24074 test_ret += test_xmlReconciliateNs();
24075 test_ret += test_xmlRemoveProp();
24076 test_ret += test_xmlReplaceNode();
24077 test_ret += test_xmlSaveFile();
24078 test_ret += test_xmlSaveFileEnc();
24079 test_ret += test_xmlSaveFileTo();
24080 test_ret += test_xmlSaveFormatFile();
24081 test_ret += test_xmlSaveFormatFileEnc();
24082 test_ret += test_xmlSaveFormatFileTo();
24083 test_ret += test_xmlSearchNs();
24084 test_ret += test_xmlSearchNsByHref();
24085 test_ret += test_xmlSetBufferAllocationScheme();
24086 test_ret += test_xmlSetCompressMode();
24087 test_ret += test_xmlSetDocCompressMode();
24088 test_ret += test_xmlSetNs();
24089 test_ret += test_xmlSetNsProp();
24090 test_ret += test_xmlSetProp();
24091 test_ret += test_xmlSplitQName2();
24092 test_ret += test_xmlSplitQName3();
24093 test_ret += test_xmlStringGetNodeList();
24094 test_ret += test_xmlStringLenGetNodeList();
24095 test_ret += test_xmlTextConcat();
24096 test_ret += test_xmlTextMerge();
24097 test_ret += test_xmlUnsetNsProp();
24098 test_ret += test_xmlUnsetProp();
24099 test_ret += test_xmlValidateNCName();
24100 test_ret += test_xmlValidateNMToken();
24101 test_ret += test_xmlValidateName();
24102 test_ret += test_xmlValidateQName();
24105 printf("Module tree: %d errors\n", test_ret);
24110 test_xmlBuildRelativeURI(void) {
24115 xmlChar * URI; /* the URI reference under consideration */
24117 xmlChar * base; /* the base value */
24120 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24121 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24122 mem_base = xmlMemBlocks();
24123 URI = gen_const_xmlChar_ptr(n_URI, 0);
24124 base = gen_const_xmlChar_ptr(n_base, 1);
24126 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24127 desret_xmlChar_ptr(ret_val);
24129 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24130 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24131 xmlResetLastError();
24132 if (mem_base != xmlMemBlocks()) {
24133 printf("Leak of %d blocks found in xmlBuildRelativeURI",
24134 xmlMemBlocks() - mem_base);
24136 printf(" %d", n_URI);
24137 printf(" %d", n_base);
24149 test_xmlBuildURI(void) {
24154 xmlChar * URI; /* the URI instance found in the document */
24156 xmlChar * base; /* the base value */
24159 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24160 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24161 mem_base = xmlMemBlocks();
24162 URI = gen_const_xmlChar_ptr(n_URI, 0);
24163 base = gen_const_xmlChar_ptr(n_base, 1);
24165 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24166 desret_xmlChar_ptr(ret_val);
24168 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24169 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24170 xmlResetLastError();
24171 if (mem_base != xmlMemBlocks()) {
24172 printf("Leak of %d blocks found in xmlBuildURI",
24173 xmlMemBlocks() - mem_base);
24175 printf(" %d", n_URI);
24176 printf(" %d", n_base);
24188 test_xmlCanonicPath(void) {
24193 xmlChar * path; /* the resource locator in a filesystem notation */
24196 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24197 mem_base = xmlMemBlocks();
24198 path = gen_const_xmlChar_ptr(n_path, 0);
24200 ret_val = xmlCanonicPath((const xmlChar *)path);
24201 desret_xmlChar_ptr(ret_val);
24203 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24204 xmlResetLastError();
24205 if (mem_base != xmlMemBlocks()) {
24206 printf("Leak of %d blocks found in xmlCanonicPath",
24207 xmlMemBlocks() - mem_base);
24209 printf(" %d", n_path);
24220 test_xmlCreateURI(void) {
24224 /* missing type support */
24230 test_xmlNormalizeURIPath(void) {
24235 char * path; /* pointer to the path string */
24238 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24239 mem_base = xmlMemBlocks();
24240 path = gen_char_ptr(n_path, 0);
24242 ret_val = xmlNormalizeURIPath(path);
24243 desret_int(ret_val);
24245 des_char_ptr(n_path, path, 0);
24246 xmlResetLastError();
24247 if (mem_base != xmlMemBlocks()) {
24248 printf("Leak of %d blocks found in xmlNormalizeURIPath",
24249 xmlMemBlocks() - mem_base);
24251 printf(" %d", n_path);
24262 test_xmlParseURI(void) {
24266 /* missing type support */
24272 test_xmlParseURIRaw(void) {
24276 /* missing type support */
24281 #define gen_nb_xmlURIPtr 1
24282 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24285 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24289 test_xmlParseURIReference(void) {
24294 xmlURIPtr uri; /* pointer to an URI structure */
24296 char * str; /* the string to analyze */
24299 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24300 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24301 mem_base = xmlMemBlocks();
24302 uri = gen_xmlURIPtr(n_uri, 0);
24303 str = gen_const_char_ptr(n_str, 1);
24305 ret_val = xmlParseURIReference(uri, (const char *)str);
24306 desret_int(ret_val);
24308 des_xmlURIPtr(n_uri, uri, 0);
24309 des_const_char_ptr(n_str, (const char *)str, 1);
24310 xmlResetLastError();
24311 if (mem_base != xmlMemBlocks()) {
24312 printf("Leak of %d blocks found in xmlParseURIReference",
24313 xmlMemBlocks() - mem_base);
24315 printf(" %d", n_uri);
24316 printf(" %d", n_str);
24328 test_xmlPathToURI(void) {
24333 xmlChar * path; /* the resource locator in a filesystem notation */
24336 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24337 mem_base = xmlMemBlocks();
24338 path = gen_const_xmlChar_ptr(n_path, 0);
24340 ret_val = xmlPathToURI((const xmlChar *)path);
24341 desret_xmlChar_ptr(ret_val);
24343 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24344 xmlResetLastError();
24345 if (mem_base != xmlMemBlocks()) {
24346 printf("Leak of %d blocks found in xmlPathToURI",
24347 xmlMemBlocks() - mem_base);
24349 printf(" %d", n_path);
24360 test_xmlPrintURI(void) {
24364 FILE * stream; /* a FILE* for the output */
24366 xmlURIPtr uri; /* pointer to an xmlURI */
24369 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24370 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24371 mem_base = xmlMemBlocks();
24372 stream = gen_FILE_ptr(n_stream, 0);
24373 uri = gen_xmlURIPtr(n_uri, 1);
24375 xmlPrintURI(stream, uri);
24377 des_FILE_ptr(n_stream, stream, 0);
24378 des_xmlURIPtr(n_uri, uri, 1);
24379 xmlResetLastError();
24380 if (mem_base != xmlMemBlocks()) {
24381 printf("Leak of %d blocks found in xmlPrintURI",
24382 xmlMemBlocks() - mem_base);
24384 printf(" %d", n_stream);
24385 printf(" %d", n_uri);
24397 test_xmlSaveUri(void) {
24402 xmlURIPtr uri; /* pointer to an xmlURI */
24405 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24406 mem_base = xmlMemBlocks();
24407 uri = gen_xmlURIPtr(n_uri, 0);
24409 ret_val = xmlSaveUri(uri);
24410 desret_xmlChar_ptr(ret_val);
24412 des_xmlURIPtr(n_uri, uri, 0);
24413 xmlResetLastError();
24414 if (mem_base != xmlMemBlocks()) {
24415 printf("Leak of %d blocks found in xmlSaveUri",
24416 xmlMemBlocks() - mem_base);
24418 printf(" %d", n_uri);
24429 test_xmlURIEscape(void) {
24434 xmlChar * str; /* the string of the URI to escape */
24437 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24438 mem_base = xmlMemBlocks();
24439 str = gen_const_xmlChar_ptr(n_str, 0);
24441 ret_val = xmlURIEscape((const xmlChar *)str);
24442 desret_xmlChar_ptr(ret_val);
24444 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24445 xmlResetLastError();
24446 if (mem_base != xmlMemBlocks()) {
24447 printf("Leak of %d blocks found in xmlURIEscape",
24448 xmlMemBlocks() - mem_base);
24450 printf(" %d", n_str);
24461 test_xmlURIEscapeStr(void) {
24466 xmlChar * str; /* string to escape */
24468 xmlChar * list; /* exception list string of chars not to escape */
24471 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24472 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24473 mem_base = xmlMemBlocks();
24474 str = gen_const_xmlChar_ptr(n_str, 0);
24475 list = gen_const_xmlChar_ptr(n_list, 1);
24477 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24478 desret_xmlChar_ptr(ret_val);
24480 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24481 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24482 xmlResetLastError();
24483 if (mem_base != xmlMemBlocks()) {
24484 printf("Leak of %d blocks found in xmlURIEscapeStr",
24485 xmlMemBlocks() - mem_base);
24487 printf(" %d", n_str);
24488 printf(" %d", n_list);
24500 test_xmlURIUnescapeString(void) {
24504 /* missing type support */
24512 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24513 test_ret += test_xmlBuildRelativeURI();
24514 test_ret += test_xmlBuildURI();
24515 test_ret += test_xmlCanonicPath();
24516 test_ret += test_xmlCreateURI();
24517 test_ret += test_xmlNormalizeURIPath();
24518 test_ret += test_xmlParseURI();
24519 test_ret += test_xmlParseURIRaw();
24520 test_ret += test_xmlParseURIReference();
24521 test_ret += test_xmlPathToURI();
24522 test_ret += test_xmlPrintURI();
24523 test_ret += test_xmlSaveUri();
24524 test_ret += test_xmlURIEscape();
24525 test_ret += test_xmlURIEscapeStr();
24526 test_ret += test_xmlURIUnescapeString();
24529 printf("Module uri: %d errors\n", test_ret);
24534 test_xmlAddAttributeDecl(void) {
24538 xmlAttributePtr ret_val;
24539 xmlValidCtxtPtr ctxt; /* the validation context */
24541 xmlDtdPtr dtd; /* pointer to the DTD */
24543 xmlChar * elem; /* the element name */
24545 xmlChar * name; /* the attribute name */
24547 xmlChar * ns; /* the attribute namespace prefix */
24549 xmlAttributeType type; /* the attribute type */
24551 xmlAttributeDefault def; /* the attribute default type */
24553 xmlChar * defaultValue; /* the attribute default value */
24554 int n_defaultValue;
24555 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24558 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24559 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24560 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24561 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24562 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24563 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24564 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24565 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24566 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24567 mem_base = xmlMemBlocks();
24568 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24569 dtd = gen_xmlDtdPtr(n_dtd, 1);
24570 elem = gen_const_xmlChar_ptr(n_elem, 2);
24571 name = gen_const_xmlChar_ptr(n_name, 3);
24572 ns = gen_const_xmlChar_ptr(n_ns, 4);
24573 type = gen_xmlAttributeType(n_type, 5);
24574 def = gen_xmlAttributeDefault(n_def, 6);
24575 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24576 tree = gen_xmlEnumerationPtr(n_tree, 8);
24578 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24579 desret_xmlAttributePtr(ret_val);
24581 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24582 des_xmlDtdPtr(n_dtd, dtd, 1);
24583 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24584 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24585 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24586 des_xmlAttributeType(n_type, type, 5);
24587 des_xmlAttributeDefault(n_def, def, 6);
24588 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24589 des_xmlEnumerationPtr(n_tree, tree, 8);
24590 xmlResetLastError();
24591 if (mem_base != xmlMemBlocks()) {
24592 printf("Leak of %d blocks found in xmlAddAttributeDecl",
24593 xmlMemBlocks() - mem_base);
24595 printf(" %d", n_ctxt);
24596 printf(" %d", n_dtd);
24597 printf(" %d", n_elem);
24598 printf(" %d", n_name);
24599 printf(" %d", n_ns);
24600 printf(" %d", n_type);
24601 printf(" %d", n_def);
24602 printf(" %d", n_defaultValue);
24603 printf(" %d", n_tree);
24622 test_xmlAddElementDecl(void) {
24626 xmlElementPtr ret_val;
24627 xmlValidCtxtPtr ctxt; /* the validation context */
24629 xmlDtdPtr dtd; /* pointer to the DTD */
24631 xmlChar * name; /* the entity name */
24633 xmlElementTypeVal type; /* the element type */
24635 xmlElementContentPtr content; /* the element content tree or NULL */
24638 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24639 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24640 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24641 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24642 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24643 mem_base = xmlMemBlocks();
24644 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24645 dtd = gen_xmlDtdPtr(n_dtd, 1);
24646 name = gen_const_xmlChar_ptr(n_name, 2);
24647 type = gen_xmlElementTypeVal(n_type, 3);
24648 content = gen_xmlElementContentPtr(n_content, 4);
24650 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24651 desret_xmlElementPtr(ret_val);
24653 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24654 des_xmlDtdPtr(n_dtd, dtd, 1);
24655 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24656 des_xmlElementTypeVal(n_type, type, 3);
24657 des_xmlElementContentPtr(n_content, content, 4);
24658 xmlResetLastError();
24659 if (mem_base != xmlMemBlocks()) {
24660 printf("Leak of %d blocks found in xmlAddElementDecl",
24661 xmlMemBlocks() - mem_base);
24663 printf(" %d", n_ctxt);
24664 printf(" %d", n_dtd);
24665 printf(" %d", n_name);
24666 printf(" %d", n_type);
24667 printf(" %d", n_content);
24682 test_xmlAddID(void) {
24686 /* missing type support */
24692 test_xmlAddNotationDecl(void) {
24696 /* missing type support */
24702 test_xmlAddRef(void) {
24706 /* missing type support */
24711 #define gen_nb_xmlAttributeTablePtr 1
24712 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24715 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24719 test_xmlCopyAttributeTable(void) {
24723 /* missing type support */
24729 test_xmlCopyDocElementContent(void) {
24733 xmlElementContentPtr ret_val;
24734 xmlDocPtr doc; /* the document owning the element declaration */
24736 xmlElementContentPtr cur; /* An element content pointer. */
24739 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24740 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24741 mem_base = xmlMemBlocks();
24742 doc = gen_xmlDocPtr(n_doc, 0);
24743 cur = gen_xmlElementContentPtr(n_cur, 1);
24745 ret_val = xmlCopyDocElementContent(doc, cur);
24746 desret_xmlElementContentPtr(ret_val);
24748 des_xmlDocPtr(n_doc, doc, 0);
24749 des_xmlElementContentPtr(n_cur, cur, 1);
24750 xmlResetLastError();
24751 if (mem_base != xmlMemBlocks()) {
24752 printf("Leak of %d blocks found in xmlCopyDocElementContent",
24753 xmlMemBlocks() - mem_base);
24755 printf(" %d", n_doc);
24756 printf(" %d", n_cur);
24768 test_xmlCopyElementContent(void) {
24772 xmlElementContentPtr ret_val;
24773 xmlElementContentPtr cur; /* An element content pointer. */
24776 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24777 mem_base = xmlMemBlocks();
24778 cur = gen_xmlElementContentPtr(n_cur, 0);
24780 ret_val = xmlCopyElementContent(cur);
24781 desret_xmlElementContentPtr(ret_val);
24783 des_xmlElementContentPtr(n_cur, cur, 0);
24784 xmlResetLastError();
24785 if (mem_base != xmlMemBlocks()) {
24786 printf("Leak of %d blocks found in xmlCopyElementContent",
24787 xmlMemBlocks() - mem_base);
24789 printf(" %d", n_cur);
24799 #define gen_nb_xmlElementTablePtr 1
24800 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24803 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24807 test_xmlCopyElementTable(void) {
24811 /* missing type support */
24817 test_xmlCopyEnumeration(void) {
24821 /* missing type support */
24826 #define gen_nb_xmlNotationTablePtr 1
24827 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24830 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24834 test_xmlCopyNotationTable(void) {
24838 /* missing type support */
24844 test_xmlCreateEnumeration(void) {
24848 /* missing type support */
24853 #define gen_nb_xmlAttributePtr 1
24854 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24857 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24861 test_xmlDumpAttributeDecl(void) {
24864 #if defined(LIBXML_OUTPUT_ENABLED)
24866 xmlBufferPtr buf; /* the XML buffer output */
24868 xmlAttributePtr attr; /* An attribute declaration */
24871 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24872 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24873 mem_base = xmlMemBlocks();
24874 buf = gen_xmlBufferPtr(n_buf, 0);
24875 attr = gen_xmlAttributePtr(n_attr, 1);
24877 xmlDumpAttributeDecl(buf, attr);
24879 des_xmlBufferPtr(n_buf, buf, 0);
24880 des_xmlAttributePtr(n_attr, attr, 1);
24881 xmlResetLastError();
24882 if (mem_base != xmlMemBlocks()) {
24883 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24884 xmlMemBlocks() - mem_base);
24886 printf(" %d", n_buf);
24887 printf(" %d", n_attr);
24900 test_xmlDumpAttributeTable(void) {
24903 #if defined(LIBXML_OUTPUT_ENABLED)
24905 xmlBufferPtr buf; /* the XML buffer output */
24907 xmlAttributeTablePtr table; /* An attribute table */
24910 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24911 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24912 mem_base = xmlMemBlocks();
24913 buf = gen_xmlBufferPtr(n_buf, 0);
24914 table = gen_xmlAttributeTablePtr(n_table, 1);
24916 xmlDumpAttributeTable(buf, table);
24918 des_xmlBufferPtr(n_buf, buf, 0);
24919 des_xmlAttributeTablePtr(n_table, table, 1);
24920 xmlResetLastError();
24921 if (mem_base != xmlMemBlocks()) {
24922 printf("Leak of %d blocks found in xmlDumpAttributeTable",
24923 xmlMemBlocks() - mem_base);
24925 printf(" %d", n_buf);
24926 printf(" %d", n_table);
24938 #define gen_nb_xmlElementPtr 1
24939 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24942 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24946 test_xmlDumpElementDecl(void) {
24949 #if defined(LIBXML_OUTPUT_ENABLED)
24951 xmlBufferPtr buf; /* the XML buffer output */
24953 xmlElementPtr elem; /* An element table */
24956 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24957 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24958 mem_base = xmlMemBlocks();
24959 buf = gen_xmlBufferPtr(n_buf, 0);
24960 elem = gen_xmlElementPtr(n_elem, 1);
24962 xmlDumpElementDecl(buf, elem);
24964 des_xmlBufferPtr(n_buf, buf, 0);
24965 des_xmlElementPtr(n_elem, elem, 1);
24966 xmlResetLastError();
24967 if (mem_base != xmlMemBlocks()) {
24968 printf("Leak of %d blocks found in xmlDumpElementDecl",
24969 xmlMemBlocks() - mem_base);
24971 printf(" %d", n_buf);
24972 printf(" %d", n_elem);
24985 test_xmlDumpElementTable(void) {
24988 #if defined(LIBXML_OUTPUT_ENABLED)
24990 xmlBufferPtr buf; /* the XML buffer output */
24992 xmlElementTablePtr table; /* An element table */
24995 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24996 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24997 mem_base = xmlMemBlocks();
24998 buf = gen_xmlBufferPtr(n_buf, 0);
24999 table = gen_xmlElementTablePtr(n_table, 1);
25001 xmlDumpElementTable(buf, table);
25003 des_xmlBufferPtr(n_buf, buf, 0);
25004 des_xmlElementTablePtr(n_table, table, 1);
25005 xmlResetLastError();
25006 if (mem_base != xmlMemBlocks()) {
25007 printf("Leak of %d blocks found in xmlDumpElementTable",
25008 xmlMemBlocks() - mem_base);
25010 printf(" %d", n_buf);
25011 printf(" %d", n_table);
25023 #define gen_nb_xmlNotationPtr 1
25024 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25027 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25031 test_xmlDumpNotationDecl(void) {
25034 #if defined(LIBXML_OUTPUT_ENABLED)
25036 xmlBufferPtr buf; /* the XML buffer output */
25038 xmlNotationPtr nota; /* A notation declaration */
25041 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25042 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25043 mem_base = xmlMemBlocks();
25044 buf = gen_xmlBufferPtr(n_buf, 0);
25045 nota = gen_xmlNotationPtr(n_nota, 1);
25047 xmlDumpNotationDecl(buf, nota);
25049 des_xmlBufferPtr(n_buf, buf, 0);
25050 des_xmlNotationPtr(n_nota, nota, 1);
25051 xmlResetLastError();
25052 if (mem_base != xmlMemBlocks()) {
25053 printf("Leak of %d blocks found in xmlDumpNotationDecl",
25054 xmlMemBlocks() - mem_base);
25056 printf(" %d", n_buf);
25057 printf(" %d", n_nota);
25070 test_xmlDumpNotationTable(void) {
25073 #if defined(LIBXML_OUTPUT_ENABLED)
25075 xmlBufferPtr buf; /* the XML buffer output */
25077 xmlNotationTablePtr table; /* A notation table */
25080 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25081 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25082 mem_base = xmlMemBlocks();
25083 buf = gen_xmlBufferPtr(n_buf, 0);
25084 table = gen_xmlNotationTablePtr(n_table, 1);
25086 xmlDumpNotationTable(buf, table);
25088 des_xmlBufferPtr(n_buf, buf, 0);
25089 des_xmlNotationTablePtr(n_table, table, 1);
25090 xmlResetLastError();
25091 if (mem_base != xmlMemBlocks()) {
25092 printf("Leak of %d blocks found in xmlDumpNotationTable",
25093 xmlMemBlocks() - mem_base);
25095 printf(" %d", n_buf);
25096 printf(" %d", n_table);
25109 test_xmlGetDtdAttrDesc(void) {
25113 xmlAttributePtr ret_val;
25114 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25116 xmlChar * elem; /* the element name */
25118 xmlChar * name; /* the attribute name */
25121 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25122 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25123 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25124 mem_base = xmlMemBlocks();
25125 dtd = gen_xmlDtdPtr(n_dtd, 0);
25126 elem = gen_const_xmlChar_ptr(n_elem, 1);
25127 name = gen_const_xmlChar_ptr(n_name, 2);
25129 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25130 desret_xmlAttributePtr(ret_val);
25132 des_xmlDtdPtr(n_dtd, dtd, 0);
25133 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25134 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25135 xmlResetLastError();
25136 if (mem_base != xmlMemBlocks()) {
25137 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25138 xmlMemBlocks() - mem_base);
25140 printf(" %d", n_dtd);
25141 printf(" %d", n_elem);
25142 printf(" %d", n_name);
25155 test_xmlGetDtdElementDesc(void) {
25159 xmlElementPtr ret_val;
25160 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25162 xmlChar * name; /* the element name */
25165 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25166 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25167 mem_base = xmlMemBlocks();
25168 dtd = gen_xmlDtdPtr(n_dtd, 0);
25169 name = gen_const_xmlChar_ptr(n_name, 1);
25171 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25172 desret_xmlElementPtr(ret_val);
25174 des_xmlDtdPtr(n_dtd, dtd, 0);
25175 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25176 xmlResetLastError();
25177 if (mem_base != xmlMemBlocks()) {
25178 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25179 xmlMemBlocks() - mem_base);
25181 printf(" %d", n_dtd);
25182 printf(" %d", n_name);
25194 test_xmlGetDtdNotationDesc(void) {
25198 /* missing type support */
25204 test_xmlGetDtdQAttrDesc(void) {
25208 xmlAttributePtr ret_val;
25209 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25211 xmlChar * elem; /* the element name */
25213 xmlChar * name; /* the attribute name */
25215 xmlChar * prefix; /* the attribute namespace prefix */
25218 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25219 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25220 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25221 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25222 mem_base = xmlMemBlocks();
25223 dtd = gen_xmlDtdPtr(n_dtd, 0);
25224 elem = gen_const_xmlChar_ptr(n_elem, 1);
25225 name = gen_const_xmlChar_ptr(n_name, 2);
25226 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25228 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25229 desret_xmlAttributePtr(ret_val);
25231 des_xmlDtdPtr(n_dtd, dtd, 0);
25232 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25233 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25234 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25235 xmlResetLastError();
25236 if (mem_base != xmlMemBlocks()) {
25237 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25238 xmlMemBlocks() - mem_base);
25240 printf(" %d", n_dtd);
25241 printf(" %d", n_elem);
25242 printf(" %d", n_name);
25243 printf(" %d", n_prefix);
25257 test_xmlGetDtdQElementDesc(void) {
25261 xmlElementPtr ret_val;
25262 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25264 xmlChar * name; /* the element name */
25266 xmlChar * prefix; /* the element namespace prefix */
25269 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25270 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25271 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25272 mem_base = xmlMemBlocks();
25273 dtd = gen_xmlDtdPtr(n_dtd, 0);
25274 name = gen_const_xmlChar_ptr(n_name, 1);
25275 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25277 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25278 desret_xmlElementPtr(ret_val);
25280 des_xmlDtdPtr(n_dtd, dtd, 0);
25281 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25282 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25283 xmlResetLastError();
25284 if (mem_base != xmlMemBlocks()) {
25285 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25286 xmlMemBlocks() - mem_base);
25288 printf(" %d", n_dtd);
25289 printf(" %d", n_name);
25290 printf(" %d", n_prefix);
25303 test_xmlGetID(void) {
25307 xmlAttrPtr ret_val;
25308 xmlDocPtr doc; /* pointer to the document */
25310 xmlChar * ID; /* the ID value */
25313 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25314 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25315 mem_base = xmlMemBlocks();
25316 doc = gen_xmlDocPtr(n_doc, 0);
25317 ID = gen_const_xmlChar_ptr(n_ID, 1);
25319 ret_val = xmlGetID(doc, (const xmlChar *)ID);
25320 desret_xmlAttrPtr(ret_val);
25322 des_xmlDocPtr(n_doc, doc, 0);
25323 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25324 xmlResetLastError();
25325 if (mem_base != xmlMemBlocks()) {
25326 printf("Leak of %d blocks found in xmlGetID",
25327 xmlMemBlocks() - mem_base);
25329 printf(" %d", n_doc);
25330 printf(" %d", n_ID);
25342 test_xmlGetRefs(void) {
25346 /* missing type support */
25352 test_xmlIsID(void) {
25357 xmlDocPtr doc; /* the document */
25359 xmlNodePtr elem; /* the element carrying the attribute */
25361 xmlAttrPtr attr; /* the attribute */
25364 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25365 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25366 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25367 mem_base = xmlMemBlocks();
25368 doc = gen_xmlDocPtr(n_doc, 0);
25369 elem = gen_xmlNodePtr(n_elem, 1);
25370 attr = gen_xmlAttrPtr(n_attr, 2);
25372 ret_val = xmlIsID(doc, elem, attr);
25373 desret_int(ret_val);
25375 des_xmlDocPtr(n_doc, doc, 0);
25376 des_xmlNodePtr(n_elem, elem, 1);
25377 des_xmlAttrPtr(n_attr, attr, 2);
25378 xmlResetLastError();
25379 if (mem_base != xmlMemBlocks()) {
25380 printf("Leak of %d blocks found in xmlIsID",
25381 xmlMemBlocks() - mem_base);
25383 printf(" %d", n_doc);
25384 printf(" %d", n_elem);
25385 printf(" %d", n_attr);
25398 test_xmlIsMixedElement(void) {
25403 xmlDocPtr doc; /* the document */
25405 xmlChar * name; /* the element name */
25408 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25409 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25410 mem_base = xmlMemBlocks();
25411 doc = gen_xmlDocPtr(n_doc, 0);
25412 name = gen_const_xmlChar_ptr(n_name, 1);
25414 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25415 desret_int(ret_val);
25417 des_xmlDocPtr(n_doc, doc, 0);
25418 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25419 xmlResetLastError();
25420 if (mem_base != xmlMemBlocks()) {
25421 printf("Leak of %d blocks found in xmlIsMixedElement",
25422 xmlMemBlocks() - mem_base);
25424 printf(" %d", n_doc);
25425 printf(" %d", n_name);
25437 test_xmlIsRef(void) {
25442 xmlDocPtr doc; /* the document */
25444 xmlNodePtr elem; /* the element carrying the attribute */
25446 xmlAttrPtr attr; /* the attribute */
25449 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25450 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25451 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25452 mem_base = xmlMemBlocks();
25453 doc = gen_xmlDocPtr(n_doc, 0);
25454 elem = gen_xmlNodePtr(n_elem, 1);
25455 attr = gen_xmlAttrPtr(n_attr, 2);
25457 ret_val = xmlIsRef(doc, elem, attr);
25458 desret_int(ret_val);
25460 des_xmlDocPtr(n_doc, doc, 0);
25461 des_xmlNodePtr(n_elem, elem, 1);
25462 des_xmlAttrPtr(n_attr, attr, 2);
25463 xmlResetLastError();
25464 if (mem_base != xmlMemBlocks()) {
25465 printf("Leak of %d blocks found in xmlIsRef",
25466 xmlMemBlocks() - mem_base);
25468 printf(" %d", n_doc);
25469 printf(" %d", n_elem);
25470 printf(" %d", n_attr);
25483 test_xmlNewDocElementContent(void) {
25487 xmlElementContentPtr ret_val;
25488 xmlDocPtr doc; /* the document */
25490 xmlChar * name; /* the subelement name or NULL */
25492 xmlElementContentType type; /* the type of element content decl */
25495 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25496 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25497 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25498 mem_base = xmlMemBlocks();
25499 doc = gen_xmlDocPtr(n_doc, 0);
25500 name = gen_const_xmlChar_ptr(n_name, 1);
25501 type = gen_xmlElementContentType(n_type, 2);
25503 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25504 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25505 desret_xmlElementContentPtr(ret_val);
25507 des_xmlDocPtr(n_doc, doc, 0);
25508 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25509 des_xmlElementContentType(n_type, type, 2);
25510 xmlResetLastError();
25511 if (mem_base != xmlMemBlocks()) {
25512 printf("Leak of %d blocks found in xmlNewDocElementContent",
25513 xmlMemBlocks() - mem_base);
25515 printf(" %d", n_doc);
25516 printf(" %d", n_name);
25517 printf(" %d", n_type);
25530 test_xmlNewElementContent(void) {
25534 xmlElementContentPtr ret_val;
25535 xmlChar * name; /* the subelement name or NULL */
25537 xmlElementContentType type; /* the type of element content decl */
25540 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25541 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25542 mem_base = xmlMemBlocks();
25543 name = gen_const_xmlChar_ptr(n_name, 0);
25544 type = gen_xmlElementContentType(n_type, 1);
25546 ret_val = xmlNewElementContent((const xmlChar *)name, type);
25547 desret_xmlElementContentPtr(ret_val);
25549 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25550 des_xmlElementContentType(n_type, type, 1);
25551 xmlResetLastError();
25552 if (mem_base != xmlMemBlocks()) {
25553 printf("Leak of %d blocks found in xmlNewElementContent",
25554 xmlMemBlocks() - mem_base);
25556 printf(" %d", n_name);
25557 printf(" %d", n_type);
25569 test_xmlNewValidCtxt(void) {
25573 /* missing type support */
25579 test_xmlRemoveID(void) {
25584 xmlDocPtr doc; /* the document */
25586 xmlAttrPtr attr; /* the attribute */
25589 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25590 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25591 mem_base = xmlMemBlocks();
25592 doc = gen_xmlDocPtr(n_doc, 0);
25593 attr = gen_xmlAttrPtr(n_attr, 1);
25595 ret_val = xmlRemoveID(doc, attr);
25596 desret_int(ret_val);
25598 des_xmlDocPtr(n_doc, doc, 0);
25599 des_xmlAttrPtr(n_attr, attr, 1);
25600 xmlResetLastError();
25601 if (mem_base != xmlMemBlocks()) {
25602 printf("Leak of %d blocks found in xmlRemoveID",
25603 xmlMemBlocks() - mem_base);
25605 printf(" %d", n_doc);
25606 printf(" %d", n_attr);
25618 test_xmlRemoveRef(void) {
25623 xmlDocPtr doc; /* the document */
25625 xmlAttrPtr attr; /* the attribute */
25628 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25629 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25630 mem_base = xmlMemBlocks();
25631 doc = gen_xmlDocPtr(n_doc, 0);
25632 attr = gen_xmlAttrPtr(n_attr, 1);
25634 ret_val = xmlRemoveRef(doc, attr);
25635 desret_int(ret_val);
25637 des_xmlDocPtr(n_doc, doc, 0);
25638 des_xmlAttrPtr(n_attr, attr, 1);
25639 xmlResetLastError();
25640 if (mem_base != xmlMemBlocks()) {
25641 printf("Leak of %d blocks found in xmlRemoveRef",
25642 xmlMemBlocks() - mem_base);
25644 printf(" %d", n_doc);
25645 printf(" %d", n_attr);
25657 test_xmlSnprintfElementContent(void) {
25661 char * buf; /* an output buffer */
25663 int size; /* the buffer size */
25665 xmlElementContentPtr content; /* An element table */
25667 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25670 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25671 for (n_size = 0;n_size < gen_nb_int;n_size++) {
25672 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25673 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25674 mem_base = xmlMemBlocks();
25675 buf = gen_char_ptr(n_buf, 0);
25676 size = gen_int(n_size, 1);
25677 content = gen_xmlElementContentPtr(n_content, 2);
25678 englob = gen_int(n_englob, 3);
25680 xmlSnprintfElementContent(buf, size, content, englob);
25682 des_char_ptr(n_buf, buf, 0);
25683 des_int(n_size, size, 1);
25684 des_xmlElementContentPtr(n_content, content, 2);
25685 des_int(n_englob, englob, 3);
25686 xmlResetLastError();
25687 if (mem_base != xmlMemBlocks()) {
25688 printf("Leak of %d blocks found in xmlSnprintfElementContent",
25689 xmlMemBlocks() - mem_base);
25691 printf(" %d", n_buf);
25692 printf(" %d", n_size);
25693 printf(" %d", n_content);
25694 printf(" %d", n_englob);
25708 test_xmlSprintfElementContent(void) {
25711 #if defined(LIBXML_OUTPUT_ENABLED)
25712 #ifdef LIBXML_OUTPUT_ENABLED
25714 char * buf; /* an output buffer */
25716 xmlElementContentPtr content; /* An element table */
25718 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25721 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25722 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25723 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25724 mem_base = xmlMemBlocks();
25725 buf = gen_char_ptr(n_buf, 0);
25726 content = gen_xmlElementContentPtr(n_content, 1);
25727 englob = gen_int(n_englob, 2);
25729 xmlSprintfElementContent(buf, content, englob);
25731 des_char_ptr(n_buf, buf, 0);
25732 des_xmlElementContentPtr(n_content, content, 1);
25733 des_int(n_englob, englob, 2);
25734 xmlResetLastError();
25735 if (mem_base != xmlMemBlocks()) {
25736 printf("Leak of %d blocks found in xmlSprintfElementContent",
25737 xmlMemBlocks() - mem_base);
25739 printf(" %d", n_buf);
25740 printf(" %d", n_content);
25741 printf(" %d", n_englob);
25756 test_xmlValidBuildContentModel(void) {
25759 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25762 xmlValidCtxtPtr ctxt; /* a validation context */
25764 xmlElementPtr elem; /* an element declaration node */
25767 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25768 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25769 mem_base = xmlMemBlocks();
25770 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25771 elem = gen_xmlElementPtr(n_elem, 1);
25773 ret_val = xmlValidBuildContentModel(ctxt, elem);
25774 desret_int(ret_val);
25776 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25777 des_xmlElementPtr(n_elem, elem, 1);
25778 xmlResetLastError();
25779 if (mem_base != xmlMemBlocks()) {
25780 printf("Leak of %d blocks found in xmlValidBuildContentModel",
25781 xmlMemBlocks() - mem_base);
25783 printf(" %d", n_ctxt);
25784 printf(" %d", n_elem);
25797 test_xmlValidCtxtNormalizeAttributeValue(void) {
25800 #if defined(LIBXML_VALID_ENABLED)
25803 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25805 xmlDocPtr doc; /* the document */
25807 xmlNodePtr elem; /* the parent */
25809 xmlChar * name; /* the attribute name */
25811 xmlChar * value; /* the attribute value */
25814 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25815 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25816 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25817 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25818 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25819 mem_base = xmlMemBlocks();
25820 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25821 doc = gen_xmlDocPtr(n_doc, 1);
25822 elem = gen_xmlNodePtr(n_elem, 2);
25823 name = gen_const_xmlChar_ptr(n_name, 3);
25824 value = gen_const_xmlChar_ptr(n_value, 4);
25826 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25827 desret_xmlChar_ptr(ret_val);
25829 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25830 des_xmlDocPtr(n_doc, doc, 1);
25831 des_xmlNodePtr(n_elem, elem, 2);
25832 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25833 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25834 xmlResetLastError();
25835 if (mem_base != xmlMemBlocks()) {
25836 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25837 xmlMemBlocks() - mem_base);
25839 printf(" %d", n_ctxt);
25840 printf(" %d", n_doc);
25841 printf(" %d", n_elem);
25842 printf(" %d", n_name);
25843 printf(" %d", n_value);
25858 #define gen_nb_xmlElementContent_ptr 1
25859 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25862 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25866 test_xmlValidGetPotentialChildren(void) {
25869 #if defined(LIBXML_VALID_ENABLED)
25870 #ifdef LIBXML_VALID_ENABLED
25873 xmlElementContent * ctree; /* an element content tree */
25875 xmlChar ** names; /* an array to store the list of child names */
25877 int * len; /* a pointer to the number of element in the list */
25879 int max; /* the size of the array */
25882 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25883 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25884 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25885 for (n_max = 0;n_max < gen_nb_int;n_max++) {
25886 mem_base = xmlMemBlocks();
25887 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25888 names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25889 len = gen_int_ptr(n_len, 2);
25890 max = gen_int(n_max, 3);
25892 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25893 desret_int(ret_val);
25895 des_xmlElementContent_ptr(n_ctree, ctree, 0);
25896 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25897 des_int_ptr(n_len, len, 2);
25898 des_int(n_max, max, 3);
25899 xmlResetLastError();
25900 if (mem_base != xmlMemBlocks()) {
25901 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25902 xmlMemBlocks() - mem_base);
25904 printf(" %d", n_ctree);
25905 printf(" %d", n_names);
25906 printf(" %d", n_len);
25907 printf(" %d", n_max);
25923 test_xmlValidGetValidElements(void) {
25926 #if defined(LIBXML_VALID_ENABLED)
25927 #ifdef LIBXML_VALID_ENABLED
25930 xmlNode * prev; /* an element to insert after */
25932 xmlNode * next; /* an element to insert next */
25934 xmlChar ** names; /* an array to store the list of child names */
25936 int max; /* the size of the array */
25939 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25940 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25941 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25942 for (n_max = 0;n_max < gen_nb_int;n_max++) {
25943 mem_base = xmlMemBlocks();
25944 prev = gen_xmlNodePtr(n_prev, 0);
25945 next = gen_xmlNodePtr(n_next, 1);
25946 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25947 max = gen_int(n_max, 3);
25949 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25950 desret_int(ret_val);
25952 des_xmlNodePtr(n_prev, prev, 0);
25953 des_xmlNodePtr(n_next, next, 1);
25954 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25955 des_int(n_max, max, 3);
25956 xmlResetLastError();
25957 if (mem_base != xmlMemBlocks()) {
25958 printf("Leak of %d blocks found in xmlValidGetValidElements",
25959 xmlMemBlocks() - mem_base);
25961 printf(" %d", n_prev);
25962 printf(" %d", n_next);
25963 printf(" %d", n_names);
25964 printf(" %d", n_max);
25980 test_xmlValidNormalizeAttributeValue(void) {
25983 #if defined(LIBXML_VALID_ENABLED)
25986 xmlDocPtr doc; /* the document */
25988 xmlNodePtr elem; /* the parent */
25990 xmlChar * name; /* the attribute name */
25992 xmlChar * value; /* the attribute value */
25995 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25996 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25997 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25998 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25999 mem_base = xmlMemBlocks();
26000 doc = gen_xmlDocPtr(n_doc, 0);
26001 elem = gen_xmlNodePtr(n_elem, 1);
26002 name = gen_const_xmlChar_ptr(n_name, 2);
26003 value = gen_const_xmlChar_ptr(n_value, 3);
26005 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26006 desret_xmlChar_ptr(ret_val);
26008 des_xmlDocPtr(n_doc, doc, 0);
26009 des_xmlNodePtr(n_elem, elem, 1);
26010 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26011 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26012 xmlResetLastError();
26013 if (mem_base != xmlMemBlocks()) {
26014 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26015 xmlMemBlocks() - mem_base);
26017 printf(" %d", n_doc);
26018 printf(" %d", n_elem);
26019 printf(" %d", n_name);
26020 printf(" %d", n_value);
26035 test_xmlValidateAttributeDecl(void) {
26038 #if defined(LIBXML_VALID_ENABLED)
26041 xmlValidCtxtPtr ctxt; /* the validation context */
26043 xmlDocPtr doc; /* a document instance */
26045 xmlAttributePtr attr; /* an attribute definition */
26048 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26049 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26050 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26051 mem_base = xmlMemBlocks();
26052 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26053 doc = gen_xmlDocPtr(n_doc, 1);
26054 attr = gen_xmlAttributePtr(n_attr, 2);
26056 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26057 desret_int(ret_val);
26059 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26060 des_xmlDocPtr(n_doc, doc, 1);
26061 des_xmlAttributePtr(n_attr, attr, 2);
26062 xmlResetLastError();
26063 if (mem_base != xmlMemBlocks()) {
26064 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26065 xmlMemBlocks() - mem_base);
26067 printf(" %d", n_ctxt);
26068 printf(" %d", n_doc);
26069 printf(" %d", n_attr);
26083 test_xmlValidateAttributeValue(void) {
26086 #if defined(LIBXML_VALID_ENABLED)
26089 xmlAttributeType type; /* an attribute type */
26091 xmlChar * value; /* an attribute value */
26094 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26095 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26096 mem_base = xmlMemBlocks();
26097 type = gen_xmlAttributeType(n_type, 0);
26098 value = gen_const_xmlChar_ptr(n_value, 1);
26100 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26101 desret_int(ret_val);
26103 des_xmlAttributeType(n_type, type, 0);
26104 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26105 xmlResetLastError();
26106 if (mem_base != xmlMemBlocks()) {
26107 printf("Leak of %d blocks found in xmlValidateAttributeValue",
26108 xmlMemBlocks() - mem_base);
26110 printf(" %d", n_type);
26111 printf(" %d", n_value);
26124 test_xmlValidateDocument(void) {
26127 #if defined(LIBXML_VALID_ENABLED)
26130 xmlValidCtxtPtr ctxt; /* the validation context */
26132 xmlDocPtr doc; /* a document instance */
26135 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26136 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26137 mem_base = xmlMemBlocks();
26138 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26139 doc = gen_xmlDocPtr(n_doc, 1);
26141 ret_val = xmlValidateDocument(ctxt, doc);
26142 desret_int(ret_val);
26144 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26145 des_xmlDocPtr(n_doc, doc, 1);
26146 xmlResetLastError();
26147 if (mem_base != xmlMemBlocks()) {
26148 printf("Leak of %d blocks found in xmlValidateDocument",
26149 xmlMemBlocks() - mem_base);
26151 printf(" %d", n_ctxt);
26152 printf(" %d", n_doc);
26165 test_xmlValidateDocumentFinal(void) {
26168 #if defined(LIBXML_VALID_ENABLED)
26171 xmlValidCtxtPtr ctxt; /* the validation context */
26173 xmlDocPtr doc; /* a document instance */
26176 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26177 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26178 mem_base = xmlMemBlocks();
26179 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26180 doc = gen_xmlDocPtr(n_doc, 1);
26182 ret_val = xmlValidateDocumentFinal(ctxt, doc);
26183 desret_int(ret_val);
26185 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26186 des_xmlDocPtr(n_doc, doc, 1);
26187 xmlResetLastError();
26188 if (mem_base != xmlMemBlocks()) {
26189 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26190 xmlMemBlocks() - mem_base);
26192 printf(" %d", n_ctxt);
26193 printf(" %d", n_doc);
26206 test_xmlValidateDtd(void) {
26209 #if defined(LIBXML_VALID_ENABLED)
26212 xmlValidCtxtPtr ctxt; /* the validation context */
26214 xmlDocPtr doc; /* a document instance */
26216 xmlDtdPtr dtd; /* a dtd instance */
26219 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26220 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26221 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26222 mem_base = xmlMemBlocks();
26223 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26224 doc = gen_xmlDocPtr(n_doc, 1);
26225 dtd = gen_xmlDtdPtr(n_dtd, 2);
26227 ret_val = xmlValidateDtd(ctxt, doc, dtd);
26228 desret_int(ret_val);
26230 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26231 des_xmlDocPtr(n_doc, doc, 1);
26232 des_xmlDtdPtr(n_dtd, dtd, 2);
26233 xmlResetLastError();
26234 if (mem_base != xmlMemBlocks()) {
26235 printf("Leak of %d blocks found in xmlValidateDtd",
26236 xmlMemBlocks() - mem_base);
26238 printf(" %d", n_ctxt);
26239 printf(" %d", n_doc);
26240 printf(" %d", n_dtd);
26254 test_xmlValidateDtdFinal(void) {
26257 #if defined(LIBXML_VALID_ENABLED)
26260 xmlValidCtxtPtr ctxt; /* the validation context */
26262 xmlDocPtr doc; /* a document instance */
26265 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26266 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26267 mem_base = xmlMemBlocks();
26268 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26269 doc = gen_xmlDocPtr(n_doc, 1);
26271 ret_val = xmlValidateDtdFinal(ctxt, doc);
26272 desret_int(ret_val);
26274 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26275 des_xmlDocPtr(n_doc, doc, 1);
26276 xmlResetLastError();
26277 if (mem_base != xmlMemBlocks()) {
26278 printf("Leak of %d blocks found in xmlValidateDtdFinal",
26279 xmlMemBlocks() - mem_base);
26281 printf(" %d", n_ctxt);
26282 printf(" %d", n_doc);
26295 test_xmlValidateElement(void) {
26298 #if defined(LIBXML_VALID_ENABLED)
26301 xmlValidCtxtPtr ctxt; /* the validation context */
26303 xmlDocPtr doc; /* a document instance */
26305 xmlNodePtr elem; /* an element instance */
26308 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26309 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26310 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26311 mem_base = xmlMemBlocks();
26312 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26313 doc = gen_xmlDocPtr(n_doc, 1);
26314 elem = gen_xmlNodePtr(n_elem, 2);
26316 ret_val = xmlValidateElement(ctxt, doc, elem);
26317 desret_int(ret_val);
26319 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26320 des_xmlDocPtr(n_doc, doc, 1);
26321 des_xmlNodePtr(n_elem, elem, 2);
26322 xmlResetLastError();
26323 if (mem_base != xmlMemBlocks()) {
26324 printf("Leak of %d blocks found in xmlValidateElement",
26325 xmlMemBlocks() - mem_base);
26327 printf(" %d", n_ctxt);
26328 printf(" %d", n_doc);
26329 printf(" %d", n_elem);
26343 test_xmlValidateElementDecl(void) {
26346 #if defined(LIBXML_VALID_ENABLED)
26349 xmlValidCtxtPtr ctxt; /* the validation context */
26351 xmlDocPtr doc; /* a document instance */
26353 xmlElementPtr elem; /* an element definition */
26356 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26357 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26358 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26359 mem_base = xmlMemBlocks();
26360 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26361 doc = gen_xmlDocPtr(n_doc, 1);
26362 elem = gen_xmlElementPtr(n_elem, 2);
26364 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26365 desret_int(ret_val);
26367 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26368 des_xmlDocPtr(n_doc, doc, 1);
26369 des_xmlElementPtr(n_elem, elem, 2);
26370 xmlResetLastError();
26371 if (mem_base != xmlMemBlocks()) {
26372 printf("Leak of %d blocks found in xmlValidateElementDecl",
26373 xmlMemBlocks() - mem_base);
26375 printf(" %d", n_ctxt);
26376 printf(" %d", n_doc);
26377 printf(" %d", n_elem);
26391 test_xmlValidateNameValue(void) {
26394 #if defined(LIBXML_VALID_ENABLED)
26397 xmlChar * value; /* an Name value */
26400 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26401 mem_base = xmlMemBlocks();
26402 value = gen_const_xmlChar_ptr(n_value, 0);
26404 ret_val = xmlValidateNameValue((const xmlChar *)value);
26405 desret_int(ret_val);
26407 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26408 xmlResetLastError();
26409 if (mem_base != xmlMemBlocks()) {
26410 printf("Leak of %d blocks found in xmlValidateNameValue",
26411 xmlMemBlocks() - mem_base);
26413 printf(" %d", n_value);
26425 test_xmlValidateNamesValue(void) {
26428 #if defined(LIBXML_VALID_ENABLED)
26431 xmlChar * value; /* an Names value */
26434 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26435 mem_base = xmlMemBlocks();
26436 value = gen_const_xmlChar_ptr(n_value, 0);
26438 ret_val = xmlValidateNamesValue((const xmlChar *)value);
26439 desret_int(ret_val);
26441 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26442 xmlResetLastError();
26443 if (mem_base != xmlMemBlocks()) {
26444 printf("Leak of %d blocks found in xmlValidateNamesValue",
26445 xmlMemBlocks() - mem_base);
26447 printf(" %d", n_value);
26459 test_xmlValidateNmtokenValue(void) {
26462 #if defined(LIBXML_VALID_ENABLED)
26465 xmlChar * value; /* an Nmtoken value */
26468 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26469 mem_base = xmlMemBlocks();
26470 value = gen_const_xmlChar_ptr(n_value, 0);
26472 ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26473 desret_int(ret_val);
26475 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26476 xmlResetLastError();
26477 if (mem_base != xmlMemBlocks()) {
26478 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26479 xmlMemBlocks() - mem_base);
26481 printf(" %d", n_value);
26493 test_xmlValidateNmtokensValue(void) {
26496 #if defined(LIBXML_VALID_ENABLED)
26499 xmlChar * value; /* an Nmtokens value */
26502 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26503 mem_base = xmlMemBlocks();
26504 value = gen_const_xmlChar_ptr(n_value, 0);
26506 ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26507 desret_int(ret_val);
26509 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26510 xmlResetLastError();
26511 if (mem_base != xmlMemBlocks()) {
26512 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26513 xmlMemBlocks() - mem_base);
26515 printf(" %d", n_value);
26527 test_xmlValidateNotationDecl(void) {
26530 #if defined(LIBXML_VALID_ENABLED)
26533 xmlValidCtxtPtr ctxt; /* the validation context */
26535 xmlDocPtr doc; /* a document instance */
26537 xmlNotationPtr nota; /* a notation definition */
26540 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26541 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26542 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26543 mem_base = xmlMemBlocks();
26544 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26545 doc = gen_xmlDocPtr(n_doc, 1);
26546 nota = gen_xmlNotationPtr(n_nota, 2);
26548 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26549 desret_int(ret_val);
26551 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26552 des_xmlDocPtr(n_doc, doc, 1);
26553 des_xmlNotationPtr(n_nota, nota, 2);
26554 xmlResetLastError();
26555 if (mem_base != xmlMemBlocks()) {
26556 printf("Leak of %d blocks found in xmlValidateNotationDecl",
26557 xmlMemBlocks() - mem_base);
26559 printf(" %d", n_ctxt);
26560 printf(" %d", n_doc);
26561 printf(" %d", n_nota);
26575 test_xmlValidateNotationUse(void) {
26578 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26581 xmlValidCtxtPtr ctxt; /* the validation context */
26583 xmlDocPtr doc; /* the document */
26585 xmlChar * notationName; /* the notation name to check */
26586 int n_notationName;
26588 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26589 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26590 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26591 mem_base = xmlMemBlocks();
26592 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26593 doc = gen_xmlDocPtr(n_doc, 1);
26594 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26596 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26597 desret_int(ret_val);
26599 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26600 des_xmlDocPtr(n_doc, doc, 1);
26601 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26602 xmlResetLastError();
26603 if (mem_base != xmlMemBlocks()) {
26604 printf("Leak of %d blocks found in xmlValidateNotationUse",
26605 xmlMemBlocks() - mem_base);
26607 printf(" %d", n_ctxt);
26608 printf(" %d", n_doc);
26609 printf(" %d", n_notationName);
26623 test_xmlValidateOneAttribute(void) {
26626 #if defined(LIBXML_VALID_ENABLED)
26629 xmlValidCtxtPtr ctxt; /* the validation context */
26631 xmlDocPtr doc; /* a document instance */
26633 xmlNodePtr elem; /* an element instance */
26635 xmlAttrPtr attr; /* an attribute instance */
26637 xmlChar * value; /* the attribute value (without entities processing) */
26640 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26641 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26642 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26643 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26644 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26645 mem_base = xmlMemBlocks();
26646 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26647 doc = gen_xmlDocPtr(n_doc, 1);
26648 elem = gen_xmlNodePtr(n_elem, 2);
26649 attr = gen_xmlAttrPtr(n_attr, 3);
26650 value = gen_const_xmlChar_ptr(n_value, 4);
26652 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26653 desret_int(ret_val);
26655 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26656 des_xmlDocPtr(n_doc, doc, 1);
26657 des_xmlNodePtr(n_elem, elem, 2);
26658 des_xmlAttrPtr(n_attr, attr, 3);
26659 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26660 xmlResetLastError();
26661 if (mem_base != xmlMemBlocks()) {
26662 printf("Leak of %d blocks found in xmlValidateOneAttribute",
26663 xmlMemBlocks() - mem_base);
26665 printf(" %d", n_ctxt);
26666 printf(" %d", n_doc);
26667 printf(" %d", n_elem);
26668 printf(" %d", n_attr);
26669 printf(" %d", n_value);
26685 test_xmlValidateOneElement(void) {
26688 #if defined(LIBXML_VALID_ENABLED)
26691 xmlValidCtxtPtr ctxt; /* the validation context */
26693 xmlDocPtr doc; /* a document instance */
26695 xmlNodePtr elem; /* an element instance */
26698 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26699 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26700 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26701 mem_base = xmlMemBlocks();
26702 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26703 doc = gen_xmlDocPtr(n_doc, 1);
26704 elem = gen_xmlNodePtr(n_elem, 2);
26706 ret_val = xmlValidateOneElement(ctxt, doc, elem);
26707 desret_int(ret_val);
26709 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26710 des_xmlDocPtr(n_doc, doc, 1);
26711 des_xmlNodePtr(n_elem, elem, 2);
26712 xmlResetLastError();
26713 if (mem_base != xmlMemBlocks()) {
26714 printf("Leak of %d blocks found in xmlValidateOneElement",
26715 xmlMemBlocks() - mem_base);
26717 printf(" %d", n_ctxt);
26718 printf(" %d", n_doc);
26719 printf(" %d", n_elem);
26733 test_xmlValidateOneNamespace(void) {
26736 #if defined(LIBXML_VALID_ENABLED)
26739 xmlValidCtxtPtr ctxt; /* the validation context */
26741 xmlDocPtr doc; /* a document instance */
26743 xmlNodePtr elem; /* an element instance */
26745 xmlChar * prefix; /* the namespace prefix */
26747 xmlNsPtr ns; /* an namespace declaration instance */
26749 xmlChar * value; /* the attribute value (without entities processing) */
26752 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26753 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26754 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26755 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26756 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26757 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26758 mem_base = xmlMemBlocks();
26759 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26760 doc = gen_xmlDocPtr(n_doc, 1);
26761 elem = gen_xmlNodePtr(n_elem, 2);
26762 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26763 ns = gen_xmlNsPtr(n_ns, 4);
26764 value = gen_const_xmlChar_ptr(n_value, 5);
26766 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26767 desret_int(ret_val);
26769 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26770 des_xmlDocPtr(n_doc, doc, 1);
26771 des_xmlNodePtr(n_elem, elem, 2);
26772 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26773 des_xmlNsPtr(n_ns, ns, 4);
26774 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26775 xmlResetLastError();
26776 if (mem_base != xmlMemBlocks()) {
26777 printf("Leak of %d blocks found in xmlValidateOneNamespace",
26778 xmlMemBlocks() - mem_base);
26780 printf(" %d", n_ctxt);
26781 printf(" %d", n_doc);
26782 printf(" %d", n_elem);
26783 printf(" %d", n_prefix);
26784 printf(" %d", n_ns);
26785 printf(" %d", n_value);
26802 test_xmlValidatePopElement(void) {
26805 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26808 xmlValidCtxtPtr ctxt; /* the validation context */
26810 xmlDocPtr doc; /* a document instance */
26812 xmlNodePtr elem; /* an element instance */
26814 xmlChar * qname; /* the qualified name as appearing in the serialization */
26817 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26818 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26819 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26820 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26821 mem_base = xmlMemBlocks();
26822 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26823 doc = gen_xmlDocPtr(n_doc, 1);
26824 elem = gen_xmlNodePtr(n_elem, 2);
26825 qname = gen_const_xmlChar_ptr(n_qname, 3);
26827 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26828 desret_int(ret_val);
26830 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26831 des_xmlDocPtr(n_doc, doc, 1);
26832 des_xmlNodePtr(n_elem, elem, 2);
26833 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26834 xmlResetLastError();
26835 if (mem_base != xmlMemBlocks()) {
26836 printf("Leak of %d blocks found in xmlValidatePopElement",
26837 xmlMemBlocks() - mem_base);
26839 printf(" %d", n_ctxt);
26840 printf(" %d", n_doc);
26841 printf(" %d", n_elem);
26842 printf(" %d", n_qname);
26857 test_xmlValidatePushCData(void) {
26860 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26863 xmlValidCtxtPtr ctxt; /* the validation context */
26865 xmlChar * data; /* some character data read */
26867 int len; /* the lenght of the data */
26870 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26871 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26872 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26873 mem_base = xmlMemBlocks();
26874 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26875 data = gen_const_xmlChar_ptr(n_data, 1);
26876 len = gen_int(n_len, 2);
26878 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26879 desret_int(ret_val);
26881 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26882 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26883 des_int(n_len, len, 2);
26884 xmlResetLastError();
26885 if (mem_base != xmlMemBlocks()) {
26886 printf("Leak of %d blocks found in xmlValidatePushCData",
26887 xmlMemBlocks() - mem_base);
26889 printf(" %d", n_ctxt);
26890 printf(" %d", n_data);
26891 printf(" %d", n_len);
26905 test_xmlValidatePushElement(void) {
26908 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26911 xmlValidCtxtPtr ctxt; /* the validation context */
26913 xmlDocPtr doc; /* a document instance */
26915 xmlNodePtr elem; /* an element instance */
26917 xmlChar * qname; /* the qualified name as appearing in the serialization */
26920 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26921 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26922 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26923 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26924 mem_base = xmlMemBlocks();
26925 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26926 doc = gen_xmlDocPtr(n_doc, 1);
26927 elem = gen_xmlNodePtr(n_elem, 2);
26928 qname = gen_const_xmlChar_ptr(n_qname, 3);
26930 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26931 desret_int(ret_val);
26933 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26934 des_xmlDocPtr(n_doc, doc, 1);
26935 des_xmlNodePtr(n_elem, elem, 2);
26936 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26937 xmlResetLastError();
26938 if (mem_base != xmlMemBlocks()) {
26939 printf("Leak of %d blocks found in xmlValidatePushElement",
26940 xmlMemBlocks() - mem_base);
26942 printf(" %d", n_ctxt);
26943 printf(" %d", n_doc);
26944 printf(" %d", n_elem);
26945 printf(" %d", n_qname);
26960 test_xmlValidateRoot(void) {
26963 #if defined(LIBXML_VALID_ENABLED)
26966 xmlValidCtxtPtr ctxt; /* the validation context */
26968 xmlDocPtr doc; /* a document instance */
26971 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26972 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26973 mem_base = xmlMemBlocks();
26974 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26975 doc = gen_xmlDocPtr(n_doc, 1);
26977 ret_val = xmlValidateRoot(ctxt, doc);
26978 desret_int(ret_val);
26980 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26981 des_xmlDocPtr(n_doc, doc, 1);
26982 xmlResetLastError();
26983 if (mem_base != xmlMemBlocks()) {
26984 printf("Leak of %d blocks found in xmlValidateRoot",
26985 xmlMemBlocks() - mem_base);
26987 printf(" %d", n_ctxt);
26988 printf(" %d", n_doc);
27003 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27004 test_ret += test_xmlAddAttributeDecl();
27005 test_ret += test_xmlAddElementDecl();
27006 test_ret += test_xmlAddID();
27007 test_ret += test_xmlAddNotationDecl();
27008 test_ret += test_xmlAddRef();
27009 test_ret += test_xmlCopyAttributeTable();
27010 test_ret += test_xmlCopyDocElementContent();
27011 test_ret += test_xmlCopyElementContent();
27012 test_ret += test_xmlCopyElementTable();
27013 test_ret += test_xmlCopyEnumeration();
27014 test_ret += test_xmlCopyNotationTable();
27015 test_ret += test_xmlCreateEnumeration();
27016 test_ret += test_xmlDumpAttributeDecl();
27017 test_ret += test_xmlDumpAttributeTable();
27018 test_ret += test_xmlDumpElementDecl();
27019 test_ret += test_xmlDumpElementTable();
27020 test_ret += test_xmlDumpNotationDecl();
27021 test_ret += test_xmlDumpNotationTable();
27022 test_ret += test_xmlGetDtdAttrDesc();
27023 test_ret += test_xmlGetDtdElementDesc();
27024 test_ret += test_xmlGetDtdNotationDesc();
27025 test_ret += test_xmlGetDtdQAttrDesc();
27026 test_ret += test_xmlGetDtdQElementDesc();
27027 test_ret += test_xmlGetID();
27028 test_ret += test_xmlGetRefs();
27029 test_ret += test_xmlIsID();
27030 test_ret += test_xmlIsMixedElement();
27031 test_ret += test_xmlIsRef();
27032 test_ret += test_xmlNewDocElementContent();
27033 test_ret += test_xmlNewElementContent();
27034 test_ret += test_xmlNewValidCtxt();
27035 test_ret += test_xmlRemoveID();
27036 test_ret += test_xmlRemoveRef();
27037 test_ret += test_xmlSnprintfElementContent();
27038 test_ret += test_xmlSprintfElementContent();
27039 test_ret += test_xmlValidBuildContentModel();
27040 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27041 test_ret += test_xmlValidGetPotentialChildren();
27042 test_ret += test_xmlValidGetValidElements();
27043 test_ret += test_xmlValidNormalizeAttributeValue();
27044 test_ret += test_xmlValidateAttributeDecl();
27045 test_ret += test_xmlValidateAttributeValue();
27046 test_ret += test_xmlValidateDocument();
27047 test_ret += test_xmlValidateDocumentFinal();
27048 test_ret += test_xmlValidateDtd();
27049 test_ret += test_xmlValidateDtdFinal();
27050 test_ret += test_xmlValidateElement();
27051 test_ret += test_xmlValidateElementDecl();
27052 test_ret += test_xmlValidateNameValue();
27053 test_ret += test_xmlValidateNamesValue();
27054 test_ret += test_xmlValidateNmtokenValue();
27055 test_ret += test_xmlValidateNmtokensValue();
27056 test_ret += test_xmlValidateNotationDecl();
27057 test_ret += test_xmlValidateNotationUse();
27058 test_ret += test_xmlValidateOneAttribute();
27059 test_ret += test_xmlValidateOneElement();
27060 test_ret += test_xmlValidateOneNamespace();
27061 test_ret += test_xmlValidatePopElement();
27062 test_ret += test_xmlValidatePushCData();
27063 test_ret += test_xmlValidatePushElement();
27064 test_ret += test_xmlValidateRoot();
27067 printf("Module valid: %d errors\n", test_ret);
27072 test_xmlXIncludeNewContext(void) {
27076 /* missing type support */
27082 test_xmlXIncludeProcess(void) {
27085 #if defined(LIBXML_XINCLUDE_ENABLED)
27088 xmlDocPtr doc; /* an XML document */
27091 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27092 mem_base = xmlMemBlocks();
27093 doc = gen_xmlDocPtr(n_doc, 0);
27095 ret_val = xmlXIncludeProcess(doc);
27096 desret_int(ret_val);
27098 des_xmlDocPtr(n_doc, doc, 0);
27099 xmlResetLastError();
27100 if (mem_base != xmlMemBlocks()) {
27101 printf("Leak of %d blocks found in xmlXIncludeProcess",
27102 xmlMemBlocks() - mem_base);
27104 printf(" %d", n_doc);
27116 test_xmlXIncludeProcessFlags(void) {
27119 #if defined(LIBXML_XINCLUDE_ENABLED)
27122 xmlDocPtr doc; /* an XML document */
27124 int flags; /* a set of xmlParserOption used for parsing XML includes */
27127 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27128 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27129 mem_base = xmlMemBlocks();
27130 doc = gen_xmlDocPtr(n_doc, 0);
27131 flags = gen_int(n_flags, 1);
27133 ret_val = xmlXIncludeProcessFlags(doc, flags);
27134 desret_int(ret_val);
27136 des_xmlDocPtr(n_doc, doc, 0);
27137 des_int(n_flags, flags, 1);
27138 xmlResetLastError();
27139 if (mem_base != xmlMemBlocks()) {
27140 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27141 xmlMemBlocks() - mem_base);
27143 printf(" %d", n_doc);
27144 printf(" %d", n_flags);
27157 test_xmlXIncludeProcessFlagsData(void) {
27160 #if defined(LIBXML_XINCLUDE_ENABLED)
27163 xmlDocPtr doc; /* an XML document */
27165 int flags; /* a set of xmlParserOption used for parsing XML includes */
27167 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27170 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27171 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27172 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27173 mem_base = xmlMemBlocks();
27174 doc = gen_xmlDocPtr(n_doc, 0);
27175 flags = gen_int(n_flags, 1);
27176 data = gen_userdata(n_data, 2);
27178 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27179 desret_int(ret_val);
27181 des_xmlDocPtr(n_doc, doc, 0);
27182 des_int(n_flags, flags, 1);
27183 des_userdata(n_data, data, 2);
27184 xmlResetLastError();
27185 if (mem_base != xmlMemBlocks()) {
27186 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27187 xmlMemBlocks() - mem_base);
27189 printf(" %d", n_doc);
27190 printf(" %d", n_flags);
27191 printf(" %d", n_data);
27203 #ifdef LIBXML_XINCLUDE_ENABLED
27205 #define gen_nb_xmlXIncludeCtxtPtr 1
27206 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27209 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27215 test_xmlXIncludeProcessNode(void) {
27218 #if defined(LIBXML_XINCLUDE_ENABLED)
27221 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27223 xmlNodePtr node; /* a node in an XML document */
27226 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27227 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27228 mem_base = xmlMemBlocks();
27229 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27230 node = gen_xmlNodePtr(n_node, 1);
27232 ret_val = xmlXIncludeProcessNode(ctxt, node);
27233 desret_int(ret_val);
27235 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27236 des_xmlNodePtr(n_node, node, 1);
27237 xmlResetLastError();
27238 if (mem_base != xmlMemBlocks()) {
27239 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27240 xmlMemBlocks() - mem_base);
27242 printf(" %d", n_ctxt);
27243 printf(" %d", n_node);
27256 test_xmlXIncludeProcessTree(void) {
27259 #if defined(LIBXML_XINCLUDE_ENABLED)
27262 xmlNodePtr tree; /* a node in an XML document */
27265 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27266 mem_base = xmlMemBlocks();
27267 tree = gen_xmlNodePtr(n_tree, 0);
27269 ret_val = xmlXIncludeProcessTree(tree);
27270 desret_int(ret_val);
27272 des_xmlNodePtr(n_tree, tree, 0);
27273 xmlResetLastError();
27274 if (mem_base != xmlMemBlocks()) {
27275 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27276 xmlMemBlocks() - mem_base);
27278 printf(" %d", n_tree);
27290 test_xmlXIncludeProcessTreeFlags(void) {
27293 #if defined(LIBXML_XINCLUDE_ENABLED)
27296 xmlNodePtr tree; /* a node in an XML document */
27298 int flags; /* a set of xmlParserOption used for parsing XML includes */
27301 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27302 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27303 mem_base = xmlMemBlocks();
27304 tree = gen_xmlNodePtr(n_tree, 0);
27305 flags = gen_int(n_flags, 1);
27307 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27308 desret_int(ret_val);
27310 des_xmlNodePtr(n_tree, tree, 0);
27311 des_int(n_flags, flags, 1);
27312 xmlResetLastError();
27313 if (mem_base != xmlMemBlocks()) {
27314 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27315 xmlMemBlocks() - mem_base);
27317 printf(" %d", n_tree);
27318 printf(" %d", n_flags);
27331 test_xmlXIncludeProcessTreeFlagsData(void) {
27334 #if defined(LIBXML_XINCLUDE_ENABLED)
27337 xmlNodePtr tree; /* an XML node */
27339 int flags; /* a set of xmlParserOption used for parsing XML includes */
27341 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27344 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27345 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27346 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27347 mem_base = xmlMemBlocks();
27348 tree = gen_xmlNodePtr(n_tree, 0);
27349 flags = gen_int(n_flags, 1);
27350 data = gen_userdata(n_data, 2);
27352 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27353 desret_int(ret_val);
27355 des_xmlNodePtr(n_tree, tree, 0);
27356 des_int(n_flags, flags, 1);
27357 des_userdata(n_data, data, 2);
27358 xmlResetLastError();
27359 if (mem_base != xmlMemBlocks()) {
27360 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27361 xmlMemBlocks() - mem_base);
27363 printf(" %d", n_tree);
27364 printf(" %d", n_flags);
27365 printf(" %d", n_data);
27379 test_xmlXIncludeSetFlags(void) {
27382 #if defined(LIBXML_XINCLUDE_ENABLED)
27385 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27387 int flags; /* a set of xmlParserOption used for parsing XML includes */
27390 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27391 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27392 mem_base = xmlMemBlocks();
27393 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27394 flags = gen_int(n_flags, 1);
27396 ret_val = xmlXIncludeSetFlags(ctxt, flags);
27397 desret_int(ret_val);
27399 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27400 des_int(n_flags, flags, 1);
27401 xmlResetLastError();
27402 if (mem_base != xmlMemBlocks()) {
27403 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27404 xmlMemBlocks() - mem_base);
27406 printf(" %d", n_ctxt);
27407 printf(" %d", n_flags);
27419 test_xinclude(void) {
27422 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27423 test_ret += test_xmlXIncludeNewContext();
27424 test_ret += test_xmlXIncludeProcess();
27425 test_ret += test_xmlXIncludeProcessFlags();
27426 test_ret += test_xmlXIncludeProcessFlagsData();
27427 test_ret += test_xmlXIncludeProcessNode();
27428 test_ret += test_xmlXIncludeProcessTree();
27429 test_ret += test_xmlXIncludeProcessTreeFlags();
27430 test_ret += test_xmlXIncludeProcessTreeFlagsData();
27431 test_ret += test_xmlXIncludeSetFlags();
27434 printf("Module xinclude: %d errors\n", test_ret);
27439 test_xmlAllocOutputBuffer(void) {
27442 #if defined(LIBXML_OUTPUT_ENABLED)
27444 xmlOutputBufferPtr ret_val;
27445 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27448 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27449 mem_base = xmlMemBlocks();
27450 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27452 ret_val = xmlAllocOutputBuffer(encoder);
27453 desret_xmlOutputBufferPtr(ret_val);
27455 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27456 xmlResetLastError();
27457 if (mem_base != xmlMemBlocks()) {
27458 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27459 xmlMemBlocks() - mem_base);
27461 printf(" %d", n_encoder);
27473 test_xmlAllocParserInputBuffer(void) {
27477 xmlParserInputBufferPtr ret_val;
27478 xmlCharEncoding enc; /* the charset encoding if known */
27481 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27482 mem_base = xmlMemBlocks();
27483 enc = gen_xmlCharEncoding(n_enc, 0);
27485 ret_val = xmlAllocParserInputBuffer(enc);
27486 desret_xmlParserInputBufferPtr(ret_val);
27488 des_xmlCharEncoding(n_enc, enc, 0);
27489 xmlResetLastError();
27490 if (mem_base != xmlMemBlocks()) {
27491 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27492 xmlMemBlocks() - mem_base);
27494 printf(" %d", n_enc);
27505 test_xmlCheckFilename(void) {
27510 char * path; /* the path to check */
27513 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27514 mem_base = xmlMemBlocks();
27515 path = gen_const_char_ptr(n_path, 0);
27517 ret_val = xmlCheckFilename((const char *)path);
27518 desret_int(ret_val);
27520 des_const_char_ptr(n_path, (const char *)path, 0);
27521 xmlResetLastError();
27522 if (mem_base != xmlMemBlocks()) {
27523 printf("Leak of %d blocks found in xmlCheckFilename",
27524 xmlMemBlocks() - mem_base);
27526 printf(" %d", n_path);
27537 test_xmlCheckHTTPInput(void) {
27541 xmlParserInputPtr ret_val;
27542 xmlParserCtxtPtr ctxt; /* an XML parser context */
27544 xmlParserInputPtr ret; /* an XML parser input */
27547 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27548 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27549 mem_base = xmlMemBlocks();
27550 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27551 ret = gen_xmlParserInputPtr(n_ret, 1);
27553 ret_val = xmlCheckHTTPInput(ctxt, ret);
27554 desret_xmlParserInputPtr(ret_val);
27556 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27557 des_xmlParserInputPtr(n_ret, ret, 1);
27558 xmlResetLastError();
27559 if (mem_base != xmlMemBlocks()) {
27560 printf("Leak of %d blocks found in xmlCheckHTTPInput",
27561 xmlMemBlocks() - mem_base);
27563 printf(" %d", n_ctxt);
27564 printf(" %d", n_ret);
27576 test_xmlCleanupInputCallbacks(void) {
27581 mem_base = xmlMemBlocks();
27583 xmlCleanupInputCallbacks();
27585 xmlResetLastError();
27586 if (mem_base != xmlMemBlocks()) {
27587 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27588 xmlMemBlocks() - mem_base);
27599 test_xmlCleanupOutputCallbacks(void) {
27602 #if defined(LIBXML_OUTPUT_ENABLED)
27605 mem_base = xmlMemBlocks();
27607 xmlCleanupOutputCallbacks();
27609 xmlResetLastError();
27610 if (mem_base != xmlMemBlocks()) {
27611 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27612 xmlMemBlocks() - mem_base);
27624 test_xmlFileClose(void) {
27629 void * context; /* the I/O context */
27632 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27633 mem_base = xmlMemBlocks();
27634 context = gen_void_ptr(n_context, 0);
27636 ret_val = xmlFileClose(context);
27637 desret_int(ret_val);
27639 des_void_ptr(n_context, context, 0);
27640 xmlResetLastError();
27641 if (mem_base != xmlMemBlocks()) {
27642 printf("Leak of %d blocks found in xmlFileClose",
27643 xmlMemBlocks() - mem_base);
27645 printf(" %d", n_context);
27656 test_xmlFileMatch(void) {
27661 const char * filename; /* the URI for matching */
27664 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27665 mem_base = xmlMemBlocks();
27666 filename = gen_filepath(n_filename, 0);
27668 ret_val = xmlFileMatch(filename);
27669 desret_int(ret_val);
27671 des_filepath(n_filename, filename, 0);
27672 xmlResetLastError();
27673 if (mem_base != xmlMemBlocks()) {
27674 printf("Leak of %d blocks found in xmlFileMatch",
27675 xmlMemBlocks() - mem_base);
27677 printf(" %d", n_filename);
27688 test_xmlFileOpen(void) {
27693 const char * filename; /* the URI for matching */
27696 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27697 mem_base = xmlMemBlocks();
27698 filename = gen_filepath(n_filename, 0);
27700 ret_val = xmlFileOpen(filename);
27701 desret_void_ptr(ret_val);
27703 des_filepath(n_filename, filename, 0);
27704 xmlResetLastError();
27705 if (mem_base != xmlMemBlocks()) {
27706 printf("Leak of %d blocks found in xmlFileOpen",
27707 xmlMemBlocks() - mem_base);
27709 printf(" %d", n_filename);
27720 test_xmlFileRead(void) {
27725 void * context; /* the I/O context */
27727 char * buffer; /* where to drop data */
27729 int len; /* number of bytes to write */
27732 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27733 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27734 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27735 mem_base = xmlMemBlocks();
27736 context = gen_void_ptr(n_context, 0);
27737 buffer = gen_char_ptr(n_buffer, 1);
27738 len = gen_int(n_len, 2);
27740 ret_val = xmlFileRead(context, buffer, len);
27741 desret_int(ret_val);
27743 des_void_ptr(n_context, context, 0);
27744 des_char_ptr(n_buffer, buffer, 1);
27745 des_int(n_len, len, 2);
27746 xmlResetLastError();
27747 if (mem_base != xmlMemBlocks()) {
27748 printf("Leak of %d blocks found in xmlFileRead",
27749 xmlMemBlocks() - mem_base);
27751 printf(" %d", n_context);
27752 printf(" %d", n_buffer);
27753 printf(" %d", n_len);
27766 test_xmlIOFTPClose(void) {
27769 #if defined(LIBXML_FTP_ENABLED)
27772 void * context; /* the I/O context */
27775 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27776 mem_base = xmlMemBlocks();
27777 context = gen_void_ptr(n_context, 0);
27779 ret_val = xmlIOFTPClose(context);
27780 desret_int(ret_val);
27782 des_void_ptr(n_context, context, 0);
27783 xmlResetLastError();
27784 if (mem_base != xmlMemBlocks()) {
27785 printf("Leak of %d blocks found in xmlIOFTPClose",
27786 xmlMemBlocks() - mem_base);
27788 printf(" %d", n_context);
27800 test_xmlIOFTPMatch(void) {
27803 #if defined(LIBXML_FTP_ENABLED)
27806 const char * filename; /* the URI for matching */
27809 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27810 mem_base = xmlMemBlocks();
27811 filename = gen_filepath(n_filename, 0);
27813 ret_val = xmlIOFTPMatch(filename);
27814 desret_int(ret_val);
27816 des_filepath(n_filename, filename, 0);
27817 xmlResetLastError();
27818 if (mem_base != xmlMemBlocks()) {
27819 printf("Leak of %d blocks found in xmlIOFTPMatch",
27820 xmlMemBlocks() - mem_base);
27822 printf(" %d", n_filename);
27834 test_xmlIOFTPOpen(void) {
27837 #if defined(LIBXML_FTP_ENABLED)
27840 const char * filename; /* the URI for matching */
27843 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27844 mem_base = xmlMemBlocks();
27845 filename = gen_filepath(n_filename, 0);
27847 ret_val = xmlIOFTPOpen(filename);
27848 desret_void_ptr(ret_val);
27850 des_filepath(n_filename, filename, 0);
27851 xmlResetLastError();
27852 if (mem_base != xmlMemBlocks()) {
27853 printf("Leak of %d blocks found in xmlIOFTPOpen",
27854 xmlMemBlocks() - mem_base);
27856 printf(" %d", n_filename);
27868 test_xmlIOFTPRead(void) {
27871 #if defined(LIBXML_FTP_ENABLED)
27874 void * context; /* the I/O context */
27876 char * buffer; /* where to drop data */
27878 int len; /* number of bytes to write */
27881 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27882 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27883 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27884 mem_base = xmlMemBlocks();
27885 context = gen_void_ptr(n_context, 0);
27886 buffer = gen_char_ptr(n_buffer, 1);
27887 len = gen_int(n_len, 2);
27889 ret_val = xmlIOFTPRead(context, buffer, len);
27890 desret_int(ret_val);
27892 des_void_ptr(n_context, context, 0);
27893 des_char_ptr(n_buffer, buffer, 1);
27894 des_int(n_len, len, 2);
27895 xmlResetLastError();
27896 if (mem_base != xmlMemBlocks()) {
27897 printf("Leak of %d blocks found in xmlIOFTPRead",
27898 xmlMemBlocks() - mem_base);
27900 printf(" %d", n_context);
27901 printf(" %d", n_buffer);
27902 printf(" %d", n_len);
27916 test_xmlIOHTTPClose(void) {
27919 #if defined(LIBXML_HTTP_ENABLED)
27922 void * context; /* the I/O context */
27925 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27926 mem_base = xmlMemBlocks();
27927 context = gen_void_ptr(n_context, 0);
27929 ret_val = xmlIOHTTPClose(context);
27930 desret_int(ret_val);
27932 des_void_ptr(n_context, context, 0);
27933 xmlResetLastError();
27934 if (mem_base != xmlMemBlocks()) {
27935 printf("Leak of %d blocks found in xmlIOHTTPClose",
27936 xmlMemBlocks() - mem_base);
27938 printf(" %d", n_context);
27950 test_xmlIOHTTPMatch(void) {
27953 #if defined(LIBXML_HTTP_ENABLED)
27956 const char * filename; /* the URI for matching */
27959 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27960 mem_base = xmlMemBlocks();
27961 filename = gen_filepath(n_filename, 0);
27963 ret_val = xmlIOHTTPMatch(filename);
27964 desret_int(ret_val);
27966 des_filepath(n_filename, filename, 0);
27967 xmlResetLastError();
27968 if (mem_base != xmlMemBlocks()) {
27969 printf("Leak of %d blocks found in xmlIOHTTPMatch",
27970 xmlMemBlocks() - mem_base);
27972 printf(" %d", n_filename);
27984 test_xmlIOHTTPOpen(void) {
27987 #if defined(LIBXML_HTTP_ENABLED)
27990 const char * filename; /* the URI for matching */
27993 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27994 mem_base = xmlMemBlocks();
27995 filename = gen_filepath(n_filename, 0);
27997 ret_val = xmlIOHTTPOpen(filename);
27998 desret_xmlNanoHTTPCtxtPtr(ret_val);
28000 des_filepath(n_filename, filename, 0);
28001 xmlResetLastError();
28002 if (mem_base != xmlMemBlocks()) {
28003 printf("Leak of %d blocks found in xmlIOHTTPOpen",
28004 xmlMemBlocks() - mem_base);
28006 printf(" %d", n_filename);
28018 test_xmlIOHTTPRead(void) {
28021 #if defined(LIBXML_HTTP_ENABLED)
28024 void * context; /* the I/O context */
28026 char * buffer; /* where to drop data */
28028 int len; /* number of bytes to write */
28031 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28032 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28033 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28034 mem_base = xmlMemBlocks();
28035 context = gen_void_ptr(n_context, 0);
28036 buffer = gen_char_ptr(n_buffer, 1);
28037 len = gen_int(n_len, 2);
28039 ret_val = xmlIOHTTPRead(context, buffer, len);
28040 desret_int(ret_val);
28042 des_void_ptr(n_context, context, 0);
28043 des_char_ptr(n_buffer, buffer, 1);
28044 des_int(n_len, len, 2);
28045 xmlResetLastError();
28046 if (mem_base != xmlMemBlocks()) {
28047 printf("Leak of %d blocks found in xmlIOHTTPRead",
28048 xmlMemBlocks() - mem_base);
28050 printf(" %d", n_context);
28051 printf(" %d", n_buffer);
28052 printf(" %d", n_len);
28066 test_xmlNoNetExternalEntityLoader(void) {
28070 xmlParserInputPtr ret_val;
28071 const char * URL; /* the URL for the entity to load */
28073 char * ID; /* the System ID for the entity to load */
28075 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28078 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28079 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28080 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28081 mem_base = xmlMemBlocks();
28082 URL = gen_filepath(n_URL, 0);
28083 ID = gen_const_char_ptr(n_ID, 1);
28084 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28086 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28087 desret_xmlParserInputPtr(ret_val);
28089 des_filepath(n_URL, URL, 0);
28090 des_const_char_ptr(n_ID, (const char *)ID, 1);
28091 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28092 xmlResetLastError();
28093 if (mem_base != xmlMemBlocks()) {
28094 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28095 xmlMemBlocks() - mem_base);
28097 printf(" %d", n_URL);
28098 printf(" %d", n_ID);
28099 printf(" %d", n_ctxt);
28112 test_xmlNormalizeWindowsPath(void) {
28117 xmlChar * path; /* the input file path */
28120 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28121 mem_base = xmlMemBlocks();
28122 path = gen_const_xmlChar_ptr(n_path, 0);
28124 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28125 desret_xmlChar_ptr(ret_val);
28127 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28128 xmlResetLastError();
28129 if (mem_base != xmlMemBlocks()) {
28130 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28131 xmlMemBlocks() - mem_base);
28133 printf(" %d", n_path);
28144 test_xmlOutputBufferCreateBuffer(void) {
28147 #if defined(LIBXML_OUTPUT_ENABLED)
28149 xmlOutputBufferPtr ret_val;
28150 xmlBufferPtr buffer; /* a xmlBufferPtr */
28152 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28155 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28156 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28157 mem_base = xmlMemBlocks();
28158 buffer = gen_xmlBufferPtr(n_buffer, 0);
28159 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28161 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28162 desret_xmlOutputBufferPtr(ret_val);
28164 des_xmlBufferPtr(n_buffer, buffer, 0);
28165 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28166 xmlResetLastError();
28167 if (mem_base != xmlMemBlocks()) {
28168 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28169 xmlMemBlocks() - mem_base);
28171 printf(" %d", n_buffer);
28172 printf(" %d", n_encoder);
28185 test_xmlOutputBufferCreateFd(void) {
28188 #if defined(LIBXML_OUTPUT_ENABLED)
28190 xmlOutputBufferPtr ret_val;
28191 int fd; /* a file descriptor number */
28193 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28196 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28197 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28198 mem_base = xmlMemBlocks();
28199 fd = gen_int(n_fd, 0);
28200 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28202 ret_val = xmlOutputBufferCreateFd(fd, encoder);
28203 desret_xmlOutputBufferPtr(ret_val);
28205 des_int(n_fd, fd, 0);
28206 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28207 xmlResetLastError();
28208 if (mem_base != xmlMemBlocks()) {
28209 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28210 xmlMemBlocks() - mem_base);
28212 printf(" %d", n_fd);
28213 printf(" %d", n_encoder);
28226 test_xmlOutputBufferCreateFile(void) {
28229 #if defined(LIBXML_OUTPUT_ENABLED)
28231 xmlOutputBufferPtr ret_val;
28232 FILE * file; /* a FILE* */
28234 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28237 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28238 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28239 mem_base = xmlMemBlocks();
28240 file = gen_FILE_ptr(n_file, 0);
28241 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28243 ret_val = xmlOutputBufferCreateFile(file, encoder);
28244 desret_xmlOutputBufferPtr(ret_val);
28246 des_FILE_ptr(n_file, file, 0);
28247 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28248 xmlResetLastError();
28249 if (mem_base != xmlMemBlocks()) {
28250 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28251 xmlMemBlocks() - mem_base);
28253 printf(" %d", n_file);
28254 printf(" %d", n_encoder);
28267 test_xmlOutputBufferCreateFilename(void) {
28270 #if defined(LIBXML_OUTPUT_ENABLED)
28272 xmlOutputBufferPtr ret_val;
28273 const char * URI; /* a C string containing the URI or filename */
28275 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28277 int compression; /* the compression ration (0 none, 9 max). */
28280 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28281 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28282 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28283 mem_base = xmlMemBlocks();
28284 URI = gen_fileoutput(n_URI, 0);
28285 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28286 compression = gen_int(n_compression, 2);
28288 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28289 desret_xmlOutputBufferPtr(ret_val);
28291 des_fileoutput(n_URI, URI, 0);
28292 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28293 des_int(n_compression, compression, 2);
28294 xmlResetLastError();
28295 if (mem_base != xmlMemBlocks()) {
28296 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28297 xmlMemBlocks() - mem_base);
28299 printf(" %d", n_URI);
28300 printf(" %d", n_encoder);
28301 printf(" %d", n_compression);
28315 test_xmlOutputBufferFlush(void) {
28318 #if defined(LIBXML_OUTPUT_ENABLED)
28321 xmlOutputBufferPtr out; /* a buffered output */
28324 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28325 mem_base = xmlMemBlocks();
28326 out = gen_xmlOutputBufferPtr(n_out, 0);
28328 ret_val = xmlOutputBufferFlush(out);
28329 desret_int(ret_val);
28331 des_xmlOutputBufferPtr(n_out, out, 0);
28332 xmlResetLastError();
28333 if (mem_base != xmlMemBlocks()) {
28334 printf("Leak of %d blocks found in xmlOutputBufferFlush",
28335 xmlMemBlocks() - mem_base);
28337 printf(" %d", n_out);
28349 test_xmlOutputBufferWrite(void) {
28352 #if defined(LIBXML_OUTPUT_ENABLED)
28355 xmlOutputBufferPtr out; /* a buffered parser output */
28357 int len; /* the size in bytes of the array. */
28359 char * buf; /* an char array */
28362 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28363 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28364 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28365 mem_base = xmlMemBlocks();
28366 out = gen_xmlOutputBufferPtr(n_out, 0);
28367 len = gen_int(n_len, 1);
28368 buf = gen_const_char_ptr(n_buf, 2);
28370 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28371 desret_int(ret_val);
28373 des_xmlOutputBufferPtr(n_out, out, 0);
28374 des_int(n_len, len, 1);
28375 des_const_char_ptr(n_buf, (const char *)buf, 2);
28376 xmlResetLastError();
28377 if (mem_base != xmlMemBlocks()) {
28378 printf("Leak of %d blocks found in xmlOutputBufferWrite",
28379 xmlMemBlocks() - mem_base);
28381 printf(" %d", n_out);
28382 printf(" %d", n_len);
28383 printf(" %d", n_buf);
28397 test_xmlOutputBufferWriteEscape(void) {
28401 /* missing type support */
28407 test_xmlOutputBufferWriteString(void) {
28410 #if defined(LIBXML_OUTPUT_ENABLED)
28413 xmlOutputBufferPtr out; /* a buffered parser output */
28415 char * str; /* a zero terminated C string */
28418 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28419 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28420 mem_base = xmlMemBlocks();
28421 out = gen_xmlOutputBufferPtr(n_out, 0);
28422 str = gen_const_char_ptr(n_str, 1);
28424 ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28425 desret_int(ret_val);
28427 des_xmlOutputBufferPtr(n_out, out, 0);
28428 des_const_char_ptr(n_str, (const char *)str, 1);
28429 xmlResetLastError();
28430 if (mem_base != xmlMemBlocks()) {
28431 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28432 xmlMemBlocks() - mem_base);
28434 printf(" %d", n_out);
28435 printf(" %d", n_str);
28448 test_xmlParserGetDirectory(void) {
28452 /* missing type support */
28458 test_xmlParserInputBufferCreateFd(void) {
28462 xmlParserInputBufferPtr ret_val;
28463 int fd; /* a file descriptor number */
28465 xmlCharEncoding enc; /* the charset encoding if known */
28468 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28469 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28470 mem_base = xmlMemBlocks();
28471 fd = gen_int(n_fd, 0);
28472 enc = gen_xmlCharEncoding(n_enc, 1);
28473 if (fd >= 0) fd = -1;
28475 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28476 desret_xmlParserInputBufferPtr(ret_val);
28478 des_int(n_fd, fd, 0);
28479 des_xmlCharEncoding(n_enc, enc, 1);
28480 xmlResetLastError();
28481 if (mem_base != xmlMemBlocks()) {
28482 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28483 xmlMemBlocks() - mem_base);
28485 printf(" %d", n_fd);
28486 printf(" %d", n_enc);
28498 test_xmlParserInputBufferCreateFile(void) {
28502 xmlParserInputBufferPtr ret_val;
28503 FILE * file; /* a FILE* */
28505 xmlCharEncoding enc; /* the charset encoding if known */
28508 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28509 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28510 mem_base = xmlMemBlocks();
28511 file = gen_FILE_ptr(n_file, 0);
28512 enc = gen_xmlCharEncoding(n_enc, 1);
28514 ret_val = xmlParserInputBufferCreateFile(file, enc);
28515 desret_xmlParserInputBufferPtr(ret_val);
28517 des_FILE_ptr(n_file, file, 0);
28518 des_xmlCharEncoding(n_enc, enc, 1);
28519 xmlResetLastError();
28520 if (mem_base != xmlMemBlocks()) {
28521 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28522 xmlMemBlocks() - mem_base);
28524 printf(" %d", n_file);
28525 printf(" %d", n_enc);
28537 test_xmlParserInputBufferCreateFilename(void) {
28541 xmlParserInputBufferPtr ret_val;
28542 const char * URI; /* a C string containing the URI or filename */
28544 xmlCharEncoding enc; /* the charset encoding if known */
28547 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28548 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28549 mem_base = xmlMemBlocks();
28550 URI = gen_fileoutput(n_URI, 0);
28551 enc = gen_xmlCharEncoding(n_enc, 1);
28553 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28554 desret_xmlParserInputBufferPtr(ret_val);
28556 des_fileoutput(n_URI, URI, 0);
28557 des_xmlCharEncoding(n_enc, enc, 1);
28558 xmlResetLastError();
28559 if (mem_base != xmlMemBlocks()) {
28560 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28561 xmlMemBlocks() - mem_base);
28563 printf(" %d", n_URI);
28564 printf(" %d", n_enc);
28576 test_xmlParserInputBufferCreateMem(void) {
28580 xmlParserInputBufferPtr ret_val;
28581 char * mem; /* the memory input */
28583 int size; /* the length of the memory block */
28585 xmlCharEncoding enc; /* the charset encoding if known */
28588 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28589 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28590 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28591 mem_base = xmlMemBlocks();
28592 mem = gen_const_char_ptr(n_mem, 0);
28593 size = gen_int(n_size, 1);
28594 enc = gen_xmlCharEncoding(n_enc, 2);
28596 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28597 desret_xmlParserInputBufferPtr(ret_val);
28599 des_const_char_ptr(n_mem, (const char *)mem, 0);
28600 des_int(n_size, size, 1);
28601 des_xmlCharEncoding(n_enc, enc, 2);
28602 xmlResetLastError();
28603 if (mem_base != xmlMemBlocks()) {
28604 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28605 xmlMemBlocks() - mem_base);
28607 printf(" %d", n_mem);
28608 printf(" %d", n_size);
28609 printf(" %d", n_enc);
28622 test_xmlParserInputBufferCreateStatic(void) {
28626 xmlParserInputBufferPtr ret_val;
28627 char * mem; /* the memory input */
28629 int size; /* the length of the memory block */
28631 xmlCharEncoding enc; /* the charset encoding if known */
28634 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28635 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28636 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28637 mem_base = xmlMemBlocks();
28638 mem = gen_const_char_ptr(n_mem, 0);
28639 size = gen_int(n_size, 1);
28640 enc = gen_xmlCharEncoding(n_enc, 2);
28642 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28643 desret_xmlParserInputBufferPtr(ret_val);
28645 des_const_char_ptr(n_mem, (const char *)mem, 0);
28646 des_int(n_size, size, 1);
28647 des_xmlCharEncoding(n_enc, enc, 2);
28648 xmlResetLastError();
28649 if (mem_base != xmlMemBlocks()) {
28650 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28651 xmlMemBlocks() - mem_base);
28653 printf(" %d", n_mem);
28654 printf(" %d", n_size);
28655 printf(" %d", n_enc);
28668 test_xmlParserInputBufferGrow(void) {
28673 xmlParserInputBufferPtr in; /* a buffered parser input */
28675 int len; /* indicative value of the amount of chars to read */
28678 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28679 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28680 mem_base = xmlMemBlocks();
28681 in = gen_xmlParserInputBufferPtr(n_in, 0);
28682 len = gen_int(n_len, 1);
28684 ret_val = xmlParserInputBufferGrow(in, len);
28685 desret_int(ret_val);
28687 des_xmlParserInputBufferPtr(n_in, in, 0);
28688 des_int(n_len, len, 1);
28689 xmlResetLastError();
28690 if (mem_base != xmlMemBlocks()) {
28691 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28692 xmlMemBlocks() - mem_base);
28694 printf(" %d", n_in);
28695 printf(" %d", n_len);
28707 test_xmlParserInputBufferPush(void) {
28712 xmlParserInputBufferPtr in; /* a buffered parser input */
28714 int len; /* the size in bytes of the array. */
28716 char * buf; /* an char array */
28719 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28720 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28721 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28722 mem_base = xmlMemBlocks();
28723 in = gen_xmlParserInputBufferPtr(n_in, 0);
28724 len = gen_int(n_len, 1);
28725 buf = gen_const_char_ptr(n_buf, 2);
28727 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28728 desret_int(ret_val);
28730 des_xmlParserInputBufferPtr(n_in, in, 0);
28731 des_int(n_len, len, 1);
28732 des_const_char_ptr(n_buf, (const char *)buf, 2);
28733 xmlResetLastError();
28734 if (mem_base != xmlMemBlocks()) {
28735 printf("Leak of %d blocks found in xmlParserInputBufferPush",
28736 xmlMemBlocks() - mem_base);
28738 printf(" %d", n_in);
28739 printf(" %d", n_len);
28740 printf(" %d", n_buf);
28753 test_xmlParserInputBufferRead(void) {
28758 xmlParserInputBufferPtr in; /* a buffered parser input */
28760 int len; /* indicative value of the amount of chars to read */
28763 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28764 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28765 mem_base = xmlMemBlocks();
28766 in = gen_xmlParserInputBufferPtr(n_in, 0);
28767 len = gen_int(n_len, 1);
28769 ret_val = xmlParserInputBufferRead(in, len);
28770 desret_int(ret_val);
28772 des_xmlParserInputBufferPtr(n_in, in, 0);
28773 des_int(n_len, len, 1);
28774 xmlResetLastError();
28775 if (mem_base != xmlMemBlocks()) {
28776 printf("Leak of %d blocks found in xmlParserInputBufferRead",
28777 xmlMemBlocks() - mem_base);
28779 printf(" %d", n_in);
28780 printf(" %d", n_len);
28792 test_xmlPopInputCallbacks(void) {
28798 mem_base = xmlMemBlocks();
28800 ret_val = xmlPopInputCallbacks();
28801 desret_int(ret_val);
28803 xmlResetLastError();
28804 if (mem_base != xmlMemBlocks()) {
28805 printf("Leak of %d blocks found in xmlPopInputCallbacks",
28806 xmlMemBlocks() - mem_base);
28817 test_xmlRegisterDefaultInputCallbacks(void) {
28822 mem_base = xmlMemBlocks();
28824 xmlRegisterDefaultInputCallbacks();
28826 xmlResetLastError();
28827 if (mem_base != xmlMemBlocks()) {
28828 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28829 xmlMemBlocks() - mem_base);
28840 test_xmlRegisterDefaultOutputCallbacks(void) {
28843 #if defined(LIBXML_OUTPUT_ENABLED)
28846 mem_base = xmlMemBlocks();
28848 xmlRegisterDefaultOutputCallbacks();
28850 xmlResetLastError();
28851 if (mem_base != xmlMemBlocks()) {
28852 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28853 xmlMemBlocks() - mem_base);
28865 test_xmlRegisterHTTPPostCallbacks(void) {
28868 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28871 mem_base = xmlMemBlocks();
28873 xmlRegisterHTTPPostCallbacks();
28875 xmlResetLastError();
28876 if (mem_base != xmlMemBlocks()) {
28877 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28878 xmlMemBlocks() - mem_base);
28892 if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28893 test_ret += test_xmlAllocOutputBuffer();
28894 test_ret += test_xmlAllocParserInputBuffer();
28895 test_ret += test_xmlCheckFilename();
28896 test_ret += test_xmlCheckHTTPInput();
28897 test_ret += test_xmlCleanupInputCallbacks();
28898 test_ret += test_xmlCleanupOutputCallbacks();
28899 test_ret += test_xmlFileClose();
28900 test_ret += test_xmlFileMatch();
28901 test_ret += test_xmlFileOpen();
28902 test_ret += test_xmlFileRead();
28903 test_ret += test_xmlIOFTPClose();
28904 test_ret += test_xmlIOFTPMatch();
28905 test_ret += test_xmlIOFTPOpen();
28906 test_ret += test_xmlIOFTPRead();
28907 test_ret += test_xmlIOHTTPClose();
28908 test_ret += test_xmlIOHTTPMatch();
28909 test_ret += test_xmlIOHTTPOpen();
28910 test_ret += test_xmlIOHTTPRead();
28911 test_ret += test_xmlNoNetExternalEntityLoader();
28912 test_ret += test_xmlNormalizeWindowsPath();
28913 test_ret += test_xmlOutputBufferCreateBuffer();
28914 test_ret += test_xmlOutputBufferCreateFd();
28915 test_ret += test_xmlOutputBufferCreateFile();
28916 test_ret += test_xmlOutputBufferCreateFilename();
28917 test_ret += test_xmlOutputBufferFlush();
28918 test_ret += test_xmlOutputBufferWrite();
28919 test_ret += test_xmlOutputBufferWriteEscape();
28920 test_ret += test_xmlOutputBufferWriteString();
28921 test_ret += test_xmlParserGetDirectory();
28922 test_ret += test_xmlParserInputBufferCreateFd();
28923 test_ret += test_xmlParserInputBufferCreateFile();
28924 test_ret += test_xmlParserInputBufferCreateFilename();
28925 test_ret += test_xmlParserInputBufferCreateMem();
28926 test_ret += test_xmlParserInputBufferCreateStatic();
28927 test_ret += test_xmlParserInputBufferGrow();
28928 test_ret += test_xmlParserInputBufferPush();
28929 test_ret += test_xmlParserInputBufferRead();
28930 test_ret += test_xmlPopInputCallbacks();
28931 test_ret += test_xmlRegisterDefaultInputCallbacks();
28932 test_ret += test_xmlRegisterDefaultOutputCallbacks();
28933 test_ret += test_xmlRegisterHTTPPostCallbacks();
28936 printf("Module xmlIO: %d errors\n", test_ret);
28939 #ifdef LIBXML_AUTOMATA_ENABLED
28941 #define gen_nb_xmlAutomataPtr 1
28942 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28945 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28951 test_xmlAutomataCompile(void) {
28955 /* missing type support */
28961 test_xmlAutomataGetInitState(void) {
28965 /* missing type support */
28971 test_xmlAutomataIsDeterminist(void) {
28974 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28977 xmlAutomataPtr am; /* an automata */
28980 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28981 mem_base = xmlMemBlocks();
28982 am = gen_xmlAutomataPtr(n_am, 0);
28984 ret_val = xmlAutomataIsDeterminist(am);
28985 desret_int(ret_val);
28987 des_xmlAutomataPtr(n_am, am, 0);
28988 xmlResetLastError();
28989 if (mem_base != xmlMemBlocks()) {
28990 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28991 xmlMemBlocks() - mem_base);
28993 printf(" %d", n_am);
29003 #ifdef LIBXML_AUTOMATA_ENABLED
29005 #define gen_nb_xmlAutomataStatePtr 1
29006 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29009 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29015 test_xmlAutomataNewAllTrans(void) {
29019 /* missing type support */
29025 test_xmlAutomataNewCountTrans(void) {
29029 /* missing type support */
29035 test_xmlAutomataNewCountTrans2(void) {
29039 /* missing type support */
29045 test_xmlAutomataNewCountedTrans(void) {
29049 /* missing type support */
29055 test_xmlAutomataNewCounter(void) {
29058 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29061 xmlAutomataPtr am; /* an automata */
29063 int min; /* the minimal value on the counter */
29065 int max; /* the maximal value on the counter */
29068 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29069 for (n_min = 0;n_min < gen_nb_int;n_min++) {
29070 for (n_max = 0;n_max < gen_nb_int;n_max++) {
29071 mem_base = xmlMemBlocks();
29072 am = gen_xmlAutomataPtr(n_am, 0);
29073 min = gen_int(n_min, 1);
29074 max = gen_int(n_max, 2);
29076 ret_val = xmlAutomataNewCounter(am, min, max);
29077 desret_int(ret_val);
29079 des_xmlAutomataPtr(n_am, am, 0);
29080 des_int(n_min, min, 1);
29081 des_int(n_max, max, 2);
29082 xmlResetLastError();
29083 if (mem_base != xmlMemBlocks()) {
29084 printf("Leak of %d blocks found in xmlAutomataNewCounter",
29085 xmlMemBlocks() - mem_base);
29087 printf(" %d", n_am);
29088 printf(" %d", n_min);
29089 printf(" %d", n_max);
29103 test_xmlAutomataNewCounterTrans(void) {
29107 /* missing type support */
29113 test_xmlAutomataNewEpsilon(void) {
29117 /* missing type support */
29123 test_xmlAutomataNewNegTrans(void) {
29127 /* missing type support */
29133 test_xmlAutomataNewOnceTrans(void) {
29137 /* missing type support */
29143 test_xmlAutomataNewOnceTrans2(void) {
29147 /* missing type support */
29153 test_xmlAutomataNewState(void) {
29157 /* missing type support */
29163 test_xmlAutomataNewTransition(void) {
29167 /* missing type support */
29173 test_xmlAutomataNewTransition2(void) {
29177 /* missing type support */
29183 test_xmlAutomataSetFinalState(void) {
29186 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29189 xmlAutomataPtr am; /* an automata */
29191 xmlAutomataStatePtr state; /* a state in this automata */
29194 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29195 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29196 mem_base = xmlMemBlocks();
29197 am = gen_xmlAutomataPtr(n_am, 0);
29198 state = gen_xmlAutomataStatePtr(n_state, 1);
29200 ret_val = xmlAutomataSetFinalState(am, state);
29201 desret_int(ret_val);
29203 des_xmlAutomataPtr(n_am, am, 0);
29204 des_xmlAutomataStatePtr(n_state, state, 1);
29205 xmlResetLastError();
29206 if (mem_base != xmlMemBlocks()) {
29207 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29208 xmlMemBlocks() - mem_base);
29210 printf(" %d", n_am);
29211 printf(" %d", n_state);
29224 test_xmlNewAutomata(void) {
29228 /* missing type support */
29233 test_xmlautomata(void) {
29236 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29237 test_ret += test_xmlAutomataCompile();
29238 test_ret += test_xmlAutomataGetInitState();
29239 test_ret += test_xmlAutomataIsDeterminist();
29240 test_ret += test_xmlAutomataNewAllTrans();
29241 test_ret += test_xmlAutomataNewCountTrans();
29242 test_ret += test_xmlAutomataNewCountTrans2();
29243 test_ret += test_xmlAutomataNewCountedTrans();
29244 test_ret += test_xmlAutomataNewCounter();
29245 test_ret += test_xmlAutomataNewCounterTrans();
29246 test_ret += test_xmlAutomataNewEpsilon();
29247 test_ret += test_xmlAutomataNewNegTrans();
29248 test_ret += test_xmlAutomataNewOnceTrans();
29249 test_ret += test_xmlAutomataNewOnceTrans2();
29250 test_ret += test_xmlAutomataNewState();
29251 test_ret += test_xmlAutomataNewTransition();
29252 test_ret += test_xmlAutomataNewTransition2();
29253 test_ret += test_xmlAutomataSetFinalState();
29254 test_ret += test_xmlNewAutomata();
29257 printf("Module xmlautomata: %d errors\n", test_ret);
29261 #define gen_nb_xmlGenericErrorFunc_ptr 1
29262 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29265 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29269 test_initGenericErrorDefaultFunc(void) {
29273 xmlGenericErrorFunc * handler; /* the handler */
29276 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29277 mem_base = xmlMemBlocks();
29278 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29280 initGenericErrorDefaultFunc(handler);
29282 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29283 xmlResetLastError();
29284 if (mem_base != xmlMemBlocks()) {
29285 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29286 xmlMemBlocks() - mem_base);
29288 printf(" %d", n_handler);
29298 #define gen_nb_xmlErrorPtr 1
29299 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29302 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29306 test_xmlCopyError(void) {
29311 xmlErrorPtr from; /* a source error */
29313 xmlErrorPtr to; /* a target error */
29316 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29317 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29318 mem_base = xmlMemBlocks();
29319 from = gen_xmlErrorPtr(n_from, 0);
29320 to = gen_xmlErrorPtr(n_to, 1);
29322 ret_val = xmlCopyError(from, to);
29323 desret_int(ret_val);
29325 des_xmlErrorPtr(n_from, from, 0);
29326 des_xmlErrorPtr(n_to, to, 1);
29327 xmlResetLastError();
29328 if (mem_base != xmlMemBlocks()) {
29329 printf("Leak of %d blocks found in xmlCopyError",
29330 xmlMemBlocks() - mem_base);
29332 printf(" %d", n_from);
29333 printf(" %d", n_to);
29345 test_xmlCtxtGetLastError(void) {
29349 /* missing type support */
29355 test_xmlCtxtResetLastError(void) {
29359 void * ctx; /* an XML parser context */
29362 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29363 mem_base = xmlMemBlocks();
29364 ctx = gen_void_ptr(n_ctx, 0);
29366 xmlCtxtResetLastError(ctx);
29368 des_void_ptr(n_ctx, ctx, 0);
29369 xmlResetLastError();
29370 if (mem_base != xmlMemBlocks()) {
29371 printf("Leak of %d blocks found in xmlCtxtResetLastError",
29372 xmlMemBlocks() - mem_base);
29374 printf(" %d", n_ctx);
29385 test_xmlGetLastError(void) {
29389 /* missing type support */
29395 test_xmlParserError(void) {
29399 /* missing type support */
29405 test_xmlParserPrintFileContext(void) {
29409 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29412 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29413 mem_base = xmlMemBlocks();
29414 input = gen_xmlParserInputPtr(n_input, 0);
29416 xmlParserPrintFileContext(input);
29418 des_xmlParserInputPtr(n_input, input, 0);
29419 xmlResetLastError();
29420 if (mem_base != xmlMemBlocks()) {
29421 printf("Leak of %d blocks found in xmlParserPrintFileContext",
29422 xmlMemBlocks() - mem_base);
29424 printf(" %d", n_input);
29435 test_xmlParserPrintFileInfo(void) {
29439 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29442 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29443 mem_base = xmlMemBlocks();
29444 input = gen_xmlParserInputPtr(n_input, 0);
29446 xmlParserPrintFileInfo(input);
29448 des_xmlParserInputPtr(n_input, input, 0);
29449 xmlResetLastError();
29450 if (mem_base != xmlMemBlocks()) {
29451 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29452 xmlMemBlocks() - mem_base);
29454 printf(" %d", n_input);
29465 test_xmlParserValidityError(void) {
29469 /* missing type support */
29475 test_xmlParserValidityWarning(void) {
29479 /* missing type support */
29485 test_xmlParserWarning(void) {
29489 /* missing type support */
29495 test_xmlResetError(void) {
29499 xmlErrorPtr err; /* pointer to the error. */
29502 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29503 mem_base = xmlMemBlocks();
29504 err = gen_xmlErrorPtr(n_err, 0);
29506 xmlResetError(err);
29508 des_xmlErrorPtr(n_err, err, 0);
29509 xmlResetLastError();
29510 if (mem_base != xmlMemBlocks()) {
29511 printf("Leak of %d blocks found in xmlResetError",
29512 xmlMemBlocks() - mem_base);
29514 printf(" %d", n_err);
29525 test_xmlResetLastError(void) {
29530 xmlResetLastError();
29532 xmlResetLastError();
29540 test_xmlSetGenericErrorFunc(void) {
29544 /* missing type support */
29550 test_xmlSetStructuredErrorFunc(void) {
29554 /* missing type support */
29559 test_xmlerror(void) {
29562 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29563 test_ret += test_initGenericErrorDefaultFunc();
29564 test_ret += test_xmlCopyError();
29565 test_ret += test_xmlCtxtGetLastError();
29566 test_ret += test_xmlCtxtResetLastError();
29567 test_ret += test_xmlGetLastError();
29568 test_ret += test_xmlParserError();
29569 test_ret += test_xmlParserPrintFileContext();
29570 test_ret += test_xmlParserPrintFileInfo();
29571 test_ret += test_xmlParserValidityError();
29572 test_ret += test_xmlParserValidityWarning();
29573 test_ret += test_xmlParserWarning();
29574 test_ret += test_xmlResetError();
29575 test_ret += test_xmlResetLastError();
29576 test_ret += test_xmlSetGenericErrorFunc();
29577 test_ret += test_xmlSetStructuredErrorFunc();
29580 printf("Module xmlerror: %d errors\n", test_ret);
29583 #ifdef LIBXML_MODULES_ENABLED
29585 #define gen_nb_xmlModulePtr 1
29586 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29589 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29595 test_xmlModuleClose(void) {
29598 #if defined(LIBXML_MODULES_ENABLED)
29601 xmlModulePtr module; /* the module handle */
29604 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29605 mem_base = xmlMemBlocks();
29606 module = gen_xmlModulePtr(n_module, 0);
29608 ret_val = xmlModuleClose(module);
29609 desret_int(ret_val);
29611 des_xmlModulePtr(n_module, module, 0);
29612 xmlResetLastError();
29613 if (mem_base != xmlMemBlocks()) {
29614 printf("Leak of %d blocks found in xmlModuleClose",
29615 xmlMemBlocks() - mem_base);
29617 printf(" %d", n_module);
29629 test_xmlModuleOpen(void) {
29633 /* missing type support */
29639 test_xmlModuleSymbol(void) {
29642 #if defined(LIBXML_MODULES_ENABLED)
29645 xmlModulePtr module; /* the module */
29647 char * name; /* the name of the symbol */
29649 void ** symbol; /* the resulting symbol address */
29652 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29653 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29654 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29655 mem_base = xmlMemBlocks();
29656 module = gen_xmlModulePtr(n_module, 0);
29657 name = gen_const_char_ptr(n_name, 1);
29658 symbol = gen_void_ptr_ptr(n_symbol, 2);
29660 ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29661 desret_int(ret_val);
29663 des_xmlModulePtr(n_module, module, 0);
29664 des_const_char_ptr(n_name, (const char *)name, 1);
29665 des_void_ptr_ptr(n_symbol, symbol, 2);
29666 xmlResetLastError();
29667 if (mem_base != xmlMemBlocks()) {
29668 printf("Leak of %d blocks found in xmlModuleSymbol",
29669 xmlMemBlocks() - mem_base);
29671 printf(" %d", n_module);
29672 printf(" %d", n_name);
29673 printf(" %d", n_symbol);
29686 test_xmlmodule(void) {
29689 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29690 test_ret += test_xmlModuleClose();
29691 test_ret += test_xmlModuleOpen();
29692 test_ret += test_xmlModuleSymbol();
29695 printf("Module xmlmodule: %d errors\n", test_ret);
29700 test_xmlNewTextReader(void) {
29703 #if defined(LIBXML_READER_ENABLED)
29705 xmlTextReaderPtr ret_val;
29706 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29708 const char * URI; /* the URI information for the source if available */
29711 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29712 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29713 mem_base = xmlMemBlocks();
29714 input = gen_xmlParserInputBufferPtr(n_input, 0);
29715 URI = gen_filepath(n_URI, 1);
29717 ret_val = xmlNewTextReader(input, URI);
29718 desret_xmlTextReaderPtr(ret_val);
29720 des_xmlParserInputBufferPtr(n_input, input, 0);
29721 des_filepath(n_URI, URI, 1);
29722 xmlResetLastError();
29723 if (mem_base != xmlMemBlocks()) {
29724 printf("Leak of %d blocks found in xmlNewTextReader",
29725 xmlMemBlocks() - mem_base);
29727 printf(" %d", n_input);
29728 printf(" %d", n_URI);
29741 test_xmlNewTextReaderFilename(void) {
29744 #if defined(LIBXML_READER_ENABLED)
29746 xmlTextReaderPtr ret_val;
29747 const char * URI; /* the URI of the resource to process */
29750 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29751 mem_base = xmlMemBlocks();
29752 URI = gen_filepath(n_URI, 0);
29754 ret_val = xmlNewTextReaderFilename(URI);
29755 desret_xmlTextReaderPtr(ret_val);
29757 des_filepath(n_URI, URI, 0);
29758 xmlResetLastError();
29759 if (mem_base != xmlMemBlocks()) {
29760 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29761 xmlMemBlocks() - mem_base);
29763 printf(" %d", n_URI);
29775 test_xmlReaderForDoc(void) {
29778 #if defined(LIBXML_READER_ENABLED)
29780 xmlTextReaderPtr ret_val;
29781 xmlChar * cur; /* a pointer to a zero terminated string */
29783 const char * URL; /* the base URL to use for the document */
29785 char * encoding; /* the document encoding, or NULL */
29787 int options; /* a combination of xmlParserOption */
29790 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29791 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29792 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29793 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29794 mem_base = xmlMemBlocks();
29795 cur = gen_const_xmlChar_ptr(n_cur, 0);
29796 URL = gen_filepath(n_URL, 1);
29797 encoding = gen_const_char_ptr(n_encoding, 2);
29798 options = gen_parseroptions(n_options, 3);
29800 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29801 desret_xmlTextReaderPtr(ret_val);
29803 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29804 des_filepath(n_URL, URL, 1);
29805 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29806 des_parseroptions(n_options, options, 3);
29807 xmlResetLastError();
29808 if (mem_base != xmlMemBlocks()) {
29809 printf("Leak of %d blocks found in xmlReaderForDoc",
29810 xmlMemBlocks() - mem_base);
29812 printf(" %d", n_cur);
29813 printf(" %d", n_URL);
29814 printf(" %d", n_encoding);
29815 printf(" %d", n_options);
29830 test_xmlReaderForFile(void) {
29833 #if defined(LIBXML_READER_ENABLED)
29835 xmlTextReaderPtr ret_val;
29836 const char * filename; /* a file or URL */
29838 char * encoding; /* the document encoding, or NULL */
29840 int options; /* a combination of xmlParserOption */
29843 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29844 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29845 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29846 mem_base = xmlMemBlocks();
29847 filename = gen_filepath(n_filename, 0);
29848 encoding = gen_const_char_ptr(n_encoding, 1);
29849 options = gen_parseroptions(n_options, 2);
29851 ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29852 desret_xmlTextReaderPtr(ret_val);
29854 des_filepath(n_filename, filename, 0);
29855 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29856 des_parseroptions(n_options, options, 2);
29857 xmlResetLastError();
29858 if (mem_base != xmlMemBlocks()) {
29859 printf("Leak of %d blocks found in xmlReaderForFile",
29860 xmlMemBlocks() - mem_base);
29862 printf(" %d", n_filename);
29863 printf(" %d", n_encoding);
29864 printf(" %d", n_options);
29878 test_xmlReaderForMemory(void) {
29881 #if defined(LIBXML_READER_ENABLED)
29883 xmlTextReaderPtr ret_val;
29884 char * buffer; /* a pointer to a char array */
29886 int size; /* the size of the array */
29888 const char * URL; /* the base URL to use for the document */
29890 char * encoding; /* the document encoding, or NULL */
29892 int options; /* a combination of xmlParserOption */
29895 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29896 for (n_size = 0;n_size < gen_nb_int;n_size++) {
29897 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29898 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29899 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29900 mem_base = xmlMemBlocks();
29901 buffer = gen_const_char_ptr(n_buffer, 0);
29902 size = gen_int(n_size, 1);
29903 URL = gen_filepath(n_URL, 2);
29904 encoding = gen_const_char_ptr(n_encoding, 3);
29905 options = gen_parseroptions(n_options, 4);
29907 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29908 desret_xmlTextReaderPtr(ret_val);
29910 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29911 des_int(n_size, size, 1);
29912 des_filepath(n_URL, URL, 2);
29913 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29914 des_parseroptions(n_options, options, 4);
29915 xmlResetLastError();
29916 if (mem_base != xmlMemBlocks()) {
29917 printf("Leak of %d blocks found in xmlReaderForMemory",
29918 xmlMemBlocks() - mem_base);
29920 printf(" %d", n_buffer);
29921 printf(" %d", n_size);
29922 printf(" %d", n_URL);
29923 printf(" %d", n_encoding);
29924 printf(" %d", n_options);
29940 test_xmlReaderNewDoc(void) {
29943 #if defined(LIBXML_READER_ENABLED)
29946 xmlTextReaderPtr reader; /* an XML reader */
29948 xmlChar * cur; /* a pointer to a zero terminated string */
29950 const char * URL; /* the base URL to use for the document */
29952 char * encoding; /* the document encoding, or NULL */
29954 int options; /* a combination of xmlParserOption */
29957 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29958 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29959 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29960 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29961 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29962 mem_base = xmlMemBlocks();
29963 reader = gen_xmlTextReaderPtr(n_reader, 0);
29964 cur = gen_const_xmlChar_ptr(n_cur, 1);
29965 URL = gen_filepath(n_URL, 2);
29966 encoding = gen_const_char_ptr(n_encoding, 3);
29967 options = gen_parseroptions(n_options, 4);
29969 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29970 desret_int(ret_val);
29972 des_xmlTextReaderPtr(n_reader, reader, 0);
29973 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29974 des_filepath(n_URL, URL, 2);
29975 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29976 des_parseroptions(n_options, options, 4);
29977 xmlResetLastError();
29978 if (mem_base != xmlMemBlocks()) {
29979 printf("Leak of %d blocks found in xmlReaderNewDoc",
29980 xmlMemBlocks() - mem_base);
29982 printf(" %d", n_reader);
29983 printf(" %d", n_cur);
29984 printf(" %d", n_URL);
29985 printf(" %d", n_encoding);
29986 printf(" %d", n_options);
30002 test_xmlReaderNewFile(void) {
30005 #if defined(LIBXML_READER_ENABLED)
30008 xmlTextReaderPtr reader; /* an XML reader */
30010 const char * filename; /* a file or URL */
30012 char * encoding; /* the document encoding, or NULL */
30014 int options; /* a combination of xmlParserOption */
30017 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30018 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30019 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30020 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30021 mem_base = xmlMemBlocks();
30022 reader = gen_xmlTextReaderPtr(n_reader, 0);
30023 filename = gen_filepath(n_filename, 1);
30024 encoding = gen_const_char_ptr(n_encoding, 2);
30025 options = gen_parseroptions(n_options, 3);
30027 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30028 desret_int(ret_val);
30030 des_xmlTextReaderPtr(n_reader, reader, 0);
30031 des_filepath(n_filename, filename, 1);
30032 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30033 des_parseroptions(n_options, options, 3);
30034 xmlResetLastError();
30035 if (mem_base != xmlMemBlocks()) {
30036 printf("Leak of %d blocks found in xmlReaderNewFile",
30037 xmlMemBlocks() - mem_base);
30039 printf(" %d", n_reader);
30040 printf(" %d", n_filename);
30041 printf(" %d", n_encoding);
30042 printf(" %d", n_options);
30057 test_xmlReaderNewMemory(void) {
30060 #if defined(LIBXML_READER_ENABLED)
30063 xmlTextReaderPtr reader; /* an XML reader */
30065 char * buffer; /* a pointer to a char array */
30067 int size; /* the size of the array */
30069 const char * URL; /* the base URL to use for the document */
30071 char * encoding; /* the document encoding, or NULL */
30073 int options; /* a combination of xmlParserOption */
30076 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30077 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30078 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30079 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30080 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30081 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30082 mem_base = xmlMemBlocks();
30083 reader = gen_xmlTextReaderPtr(n_reader, 0);
30084 buffer = gen_const_char_ptr(n_buffer, 1);
30085 size = gen_int(n_size, 2);
30086 URL = gen_filepath(n_URL, 3);
30087 encoding = gen_const_char_ptr(n_encoding, 4);
30088 options = gen_parseroptions(n_options, 5);
30090 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30091 desret_int(ret_val);
30093 des_xmlTextReaderPtr(n_reader, reader, 0);
30094 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30095 des_int(n_size, size, 2);
30096 des_filepath(n_URL, URL, 3);
30097 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30098 des_parseroptions(n_options, options, 5);
30099 xmlResetLastError();
30100 if (mem_base != xmlMemBlocks()) {
30101 printf("Leak of %d blocks found in xmlReaderNewMemory",
30102 xmlMemBlocks() - mem_base);
30104 printf(" %d", n_reader);
30105 printf(" %d", n_buffer);
30106 printf(" %d", n_size);
30107 printf(" %d", n_URL);
30108 printf(" %d", n_encoding);
30109 printf(" %d", n_options);
30126 test_xmlReaderNewWalker(void) {
30129 #if defined(LIBXML_READER_ENABLED)
30132 xmlTextReaderPtr reader; /* an XML reader */
30134 xmlDocPtr doc; /* a preparsed document */
30137 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30138 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30139 mem_base = xmlMemBlocks();
30140 reader = gen_xmlTextReaderPtr(n_reader, 0);
30141 doc = gen_xmlDocPtr(n_doc, 1);
30143 ret_val = xmlReaderNewWalker(reader, doc);
30144 desret_int(ret_val);
30146 des_xmlTextReaderPtr(n_reader, reader, 0);
30147 des_xmlDocPtr(n_doc, doc, 1);
30148 xmlResetLastError();
30149 if (mem_base != xmlMemBlocks()) {
30150 printf("Leak of %d blocks found in xmlReaderNewWalker",
30151 xmlMemBlocks() - mem_base);
30153 printf(" %d", n_reader);
30154 printf(" %d", n_doc);
30167 test_xmlReaderWalker(void) {
30170 #if defined(LIBXML_READER_ENABLED)
30172 xmlTextReaderPtr ret_val;
30173 xmlDocPtr doc; /* a preparsed document */
30176 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30177 mem_base = xmlMemBlocks();
30178 doc = gen_xmlDocPtr(n_doc, 0);
30180 ret_val = xmlReaderWalker(doc);
30181 desret_xmlTextReaderPtr(ret_val);
30183 des_xmlDocPtr(n_doc, doc, 0);
30184 xmlResetLastError();
30185 if (mem_base != xmlMemBlocks()) {
30186 printf("Leak of %d blocks found in xmlReaderWalker",
30187 xmlMemBlocks() - mem_base);
30189 printf(" %d", n_doc);
30201 test_xmlTextReaderAttributeCount(void) {
30204 #if defined(LIBXML_READER_ENABLED)
30207 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30210 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30211 mem_base = xmlMemBlocks();
30212 reader = gen_xmlTextReaderPtr(n_reader, 0);
30214 ret_val = xmlTextReaderAttributeCount(reader);
30215 desret_int(ret_val);
30217 des_xmlTextReaderPtr(n_reader, reader, 0);
30218 xmlResetLastError();
30219 if (mem_base != xmlMemBlocks()) {
30220 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30221 xmlMemBlocks() - mem_base);
30223 printf(" %d", n_reader);
30235 test_xmlTextReaderBaseUri(void) {
30238 #if defined(LIBXML_READER_ENABLED)
30241 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30244 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30245 mem_base = xmlMemBlocks();
30246 reader = gen_xmlTextReaderPtr(n_reader, 0);
30248 ret_val = xmlTextReaderBaseUri(reader);
30249 desret_xmlChar_ptr(ret_val);
30251 des_xmlTextReaderPtr(n_reader, reader, 0);
30252 xmlResetLastError();
30253 if (mem_base != xmlMemBlocks()) {
30254 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30255 xmlMemBlocks() - mem_base);
30257 printf(" %d", n_reader);
30269 test_xmlTextReaderByteConsumed(void) {
30272 #if defined(LIBXML_READER_ENABLED)
30275 xmlTextReaderPtr reader; /* an XML reader */
30278 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30279 mem_base = xmlMemBlocks();
30280 reader = gen_xmlTextReaderPtr(n_reader, 0);
30282 ret_val = xmlTextReaderByteConsumed(reader);
30283 desret_long(ret_val);
30285 des_xmlTextReaderPtr(n_reader, reader, 0);
30286 xmlResetLastError();
30287 if (mem_base != xmlMemBlocks()) {
30288 printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30289 xmlMemBlocks() - mem_base);
30291 printf(" %d", n_reader);
30303 test_xmlTextReaderClose(void) {
30306 #if defined(LIBXML_READER_ENABLED)
30309 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30312 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30313 mem_base = xmlMemBlocks();
30314 reader = gen_xmlTextReaderPtr(n_reader, 0);
30316 ret_val = xmlTextReaderClose(reader);
30317 desret_int(ret_val);
30319 des_xmlTextReaderPtr(n_reader, reader, 0);
30320 xmlResetLastError();
30321 if (mem_base != xmlMemBlocks()) {
30322 printf("Leak of %d blocks found in xmlTextReaderClose",
30323 xmlMemBlocks() - mem_base);
30325 printf(" %d", n_reader);
30337 test_xmlTextReaderConstBaseUri(void) {
30340 #if defined(LIBXML_READER_ENABLED)
30342 const xmlChar * ret_val;
30343 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30346 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30347 mem_base = xmlMemBlocks();
30348 reader = gen_xmlTextReaderPtr(n_reader, 0);
30350 ret_val = xmlTextReaderConstBaseUri(reader);
30351 desret_const_xmlChar_ptr(ret_val);
30353 des_xmlTextReaderPtr(n_reader, reader, 0);
30354 xmlResetLastError();
30355 if (mem_base != xmlMemBlocks()) {
30356 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30357 xmlMemBlocks() - mem_base);
30359 printf(" %d", n_reader);
30371 test_xmlTextReaderConstEncoding(void) {
30374 #if defined(LIBXML_READER_ENABLED)
30376 const xmlChar * ret_val;
30377 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30380 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30381 mem_base = xmlMemBlocks();
30382 reader = gen_xmlTextReaderPtr(n_reader, 0);
30384 ret_val = xmlTextReaderConstEncoding(reader);
30385 desret_const_xmlChar_ptr(ret_val);
30387 des_xmlTextReaderPtr(n_reader, reader, 0);
30388 xmlResetLastError();
30389 if (mem_base != xmlMemBlocks()) {
30390 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30391 xmlMemBlocks() - mem_base);
30393 printf(" %d", n_reader);
30405 test_xmlTextReaderConstLocalName(void) {
30408 #if defined(LIBXML_READER_ENABLED)
30410 const xmlChar * ret_val;
30411 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30414 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30415 mem_base = xmlMemBlocks();
30416 reader = gen_xmlTextReaderPtr(n_reader, 0);
30418 ret_val = xmlTextReaderConstLocalName(reader);
30419 desret_const_xmlChar_ptr(ret_val);
30421 des_xmlTextReaderPtr(n_reader, reader, 0);
30422 xmlResetLastError();
30423 if (mem_base != xmlMemBlocks()) {
30424 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30425 xmlMemBlocks() - mem_base);
30427 printf(" %d", n_reader);
30439 test_xmlTextReaderConstName(void) {
30442 #if defined(LIBXML_READER_ENABLED)
30444 const xmlChar * ret_val;
30445 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30448 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30449 mem_base = xmlMemBlocks();
30450 reader = gen_xmlTextReaderPtr(n_reader, 0);
30452 ret_val = xmlTextReaderConstName(reader);
30453 desret_const_xmlChar_ptr(ret_val);
30455 des_xmlTextReaderPtr(n_reader, reader, 0);
30456 xmlResetLastError();
30457 if (mem_base != xmlMemBlocks()) {
30458 printf("Leak of %d blocks found in xmlTextReaderConstName",
30459 xmlMemBlocks() - mem_base);
30461 printf(" %d", n_reader);
30473 test_xmlTextReaderConstNamespaceUri(void) {
30476 #if defined(LIBXML_READER_ENABLED)
30478 const xmlChar * ret_val;
30479 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30482 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30483 mem_base = xmlMemBlocks();
30484 reader = gen_xmlTextReaderPtr(n_reader, 0);
30486 ret_val = xmlTextReaderConstNamespaceUri(reader);
30487 desret_const_xmlChar_ptr(ret_val);
30489 des_xmlTextReaderPtr(n_reader, reader, 0);
30490 xmlResetLastError();
30491 if (mem_base != xmlMemBlocks()) {
30492 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30493 xmlMemBlocks() - mem_base);
30495 printf(" %d", n_reader);
30507 test_xmlTextReaderConstPrefix(void) {
30510 #if defined(LIBXML_READER_ENABLED)
30512 const xmlChar * ret_val;
30513 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30516 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30517 mem_base = xmlMemBlocks();
30518 reader = gen_xmlTextReaderPtr(n_reader, 0);
30520 ret_val = xmlTextReaderConstPrefix(reader);
30521 desret_const_xmlChar_ptr(ret_val);
30523 des_xmlTextReaderPtr(n_reader, reader, 0);
30524 xmlResetLastError();
30525 if (mem_base != xmlMemBlocks()) {
30526 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30527 xmlMemBlocks() - mem_base);
30529 printf(" %d", n_reader);
30541 test_xmlTextReaderConstString(void) {
30544 #if defined(LIBXML_READER_ENABLED)
30546 const xmlChar * ret_val;
30547 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30549 xmlChar * str; /* the string to intern. */
30552 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30553 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30554 mem_base = xmlMemBlocks();
30555 reader = gen_xmlTextReaderPtr(n_reader, 0);
30556 str = gen_const_xmlChar_ptr(n_str, 1);
30558 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30559 desret_const_xmlChar_ptr(ret_val);
30561 des_xmlTextReaderPtr(n_reader, reader, 0);
30562 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30563 xmlResetLastError();
30564 if (mem_base != xmlMemBlocks()) {
30565 printf("Leak of %d blocks found in xmlTextReaderConstString",
30566 xmlMemBlocks() - mem_base);
30568 printf(" %d", n_reader);
30569 printf(" %d", n_str);
30582 test_xmlTextReaderConstValue(void) {
30585 #if defined(LIBXML_READER_ENABLED)
30587 const xmlChar * ret_val;
30588 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30591 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30592 mem_base = xmlMemBlocks();
30593 reader = gen_xmlTextReaderPtr(n_reader, 0);
30595 ret_val = xmlTextReaderConstValue(reader);
30596 desret_const_xmlChar_ptr(ret_val);
30598 des_xmlTextReaderPtr(n_reader, reader, 0);
30599 xmlResetLastError();
30600 if (mem_base != xmlMemBlocks()) {
30601 printf("Leak of %d blocks found in xmlTextReaderConstValue",
30602 xmlMemBlocks() - mem_base);
30604 printf(" %d", n_reader);
30616 test_xmlTextReaderConstXmlLang(void) {
30619 #if defined(LIBXML_READER_ENABLED)
30621 const xmlChar * ret_val;
30622 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30625 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30626 mem_base = xmlMemBlocks();
30627 reader = gen_xmlTextReaderPtr(n_reader, 0);
30629 ret_val = xmlTextReaderConstXmlLang(reader);
30630 desret_const_xmlChar_ptr(ret_val);
30632 des_xmlTextReaderPtr(n_reader, reader, 0);
30633 xmlResetLastError();
30634 if (mem_base != xmlMemBlocks()) {
30635 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30636 xmlMemBlocks() - mem_base);
30638 printf(" %d", n_reader);
30650 test_xmlTextReaderConstXmlVersion(void) {
30653 #if defined(LIBXML_READER_ENABLED)
30655 const xmlChar * ret_val;
30656 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30659 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30660 mem_base = xmlMemBlocks();
30661 reader = gen_xmlTextReaderPtr(n_reader, 0);
30663 ret_val = xmlTextReaderConstXmlVersion(reader);
30664 desret_const_xmlChar_ptr(ret_val);
30666 des_xmlTextReaderPtr(n_reader, reader, 0);
30667 xmlResetLastError();
30668 if (mem_base != xmlMemBlocks()) {
30669 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30670 xmlMemBlocks() - mem_base);
30672 printf(" %d", n_reader);
30684 test_xmlTextReaderCurrentDoc(void) {
30687 #if defined(LIBXML_READER_ENABLED)
30690 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30693 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30694 mem_base = xmlMemBlocks();
30695 reader = gen_xmlTextReaderPtr(n_reader, 0);
30697 ret_val = xmlTextReaderCurrentDoc(reader);
30698 desret_xmlDocPtr(ret_val);
30700 des_xmlTextReaderPtr(n_reader, reader, 0);
30701 xmlResetLastError();
30702 if (mem_base != xmlMemBlocks()) {
30703 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30704 xmlMemBlocks() - mem_base);
30706 printf(" %d", n_reader);
30718 test_xmlTextReaderCurrentNode(void) {
30721 #if defined(LIBXML_READER_ENABLED)
30723 xmlNodePtr ret_val;
30724 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30727 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30728 mem_base = xmlMemBlocks();
30729 reader = gen_xmlTextReaderPtr(n_reader, 0);
30731 ret_val = xmlTextReaderCurrentNode(reader);
30732 desret_xmlNodePtr(ret_val);
30734 des_xmlTextReaderPtr(n_reader, reader, 0);
30735 xmlResetLastError();
30736 if (mem_base != xmlMemBlocks()) {
30737 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30738 xmlMemBlocks() - mem_base);
30740 printf(" %d", n_reader);
30752 test_xmlTextReaderDepth(void) {
30755 #if defined(LIBXML_READER_ENABLED)
30758 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30761 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30762 mem_base = xmlMemBlocks();
30763 reader = gen_xmlTextReaderPtr(n_reader, 0);
30765 ret_val = xmlTextReaderDepth(reader);
30766 desret_int(ret_val);
30768 des_xmlTextReaderPtr(n_reader, reader, 0);
30769 xmlResetLastError();
30770 if (mem_base != xmlMemBlocks()) {
30771 printf("Leak of %d blocks found in xmlTextReaderDepth",
30772 xmlMemBlocks() - mem_base);
30774 printf(" %d", n_reader);
30786 test_xmlTextReaderExpand(void) {
30789 #if defined(LIBXML_READER_ENABLED)
30791 xmlNodePtr ret_val;
30792 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30795 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30796 mem_base = xmlMemBlocks();
30797 reader = gen_xmlTextReaderPtr(n_reader, 0);
30799 ret_val = xmlTextReaderExpand(reader);
30800 desret_xmlNodePtr(ret_val);
30802 des_xmlTextReaderPtr(n_reader, reader, 0);
30803 xmlResetLastError();
30804 if (mem_base != xmlMemBlocks()) {
30805 printf("Leak of %d blocks found in xmlTextReaderExpand",
30806 xmlMemBlocks() - mem_base);
30808 printf(" %d", n_reader);
30820 test_xmlTextReaderGetAttribute(void) {
30823 #if defined(LIBXML_READER_ENABLED)
30826 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30828 xmlChar * name; /* the qualified name of the attribute. */
30831 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30832 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30833 mem_base = xmlMemBlocks();
30834 reader = gen_xmlTextReaderPtr(n_reader, 0);
30835 name = gen_const_xmlChar_ptr(n_name, 1);
30837 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30838 desret_xmlChar_ptr(ret_val);
30840 des_xmlTextReaderPtr(n_reader, reader, 0);
30841 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30842 xmlResetLastError();
30843 if (mem_base != xmlMemBlocks()) {
30844 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30845 xmlMemBlocks() - mem_base);
30847 printf(" %d", n_reader);
30848 printf(" %d", n_name);
30861 test_xmlTextReaderGetAttributeNo(void) {
30864 #if defined(LIBXML_READER_ENABLED)
30867 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30869 int no; /* the zero-based index of the attribute relative to the containing element */
30872 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30873 for (n_no = 0;n_no < gen_nb_int;n_no++) {
30874 mem_base = xmlMemBlocks();
30875 reader = gen_xmlTextReaderPtr(n_reader, 0);
30876 no = gen_int(n_no, 1);
30878 ret_val = xmlTextReaderGetAttributeNo(reader, no);
30879 desret_xmlChar_ptr(ret_val);
30881 des_xmlTextReaderPtr(n_reader, reader, 0);
30882 des_int(n_no, no, 1);
30883 xmlResetLastError();
30884 if (mem_base != xmlMemBlocks()) {
30885 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30886 xmlMemBlocks() - mem_base);
30888 printf(" %d", n_reader);
30889 printf(" %d", n_no);
30902 test_xmlTextReaderGetAttributeNs(void) {
30905 #if defined(LIBXML_READER_ENABLED)
30908 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30910 xmlChar * localName; /* the local name of the attribute. */
30912 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30913 int n_namespaceURI;
30915 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30916 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30917 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30918 mem_base = xmlMemBlocks();
30919 reader = gen_xmlTextReaderPtr(n_reader, 0);
30920 localName = gen_const_xmlChar_ptr(n_localName, 1);
30921 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30923 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30924 desret_xmlChar_ptr(ret_val);
30926 des_xmlTextReaderPtr(n_reader, reader, 0);
30927 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30928 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30929 xmlResetLastError();
30930 if (mem_base != xmlMemBlocks()) {
30931 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30932 xmlMemBlocks() - mem_base);
30934 printf(" %d", n_reader);
30935 printf(" %d", n_localName);
30936 printf(" %d", n_namespaceURI);
30948 #ifdef LIBXML_READER_ENABLED
30950 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
30951 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30954 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30960 test_xmlTextReaderGetErrorHandler(void) {
30963 #if defined(LIBXML_READER_ENABLED)
30965 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30967 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30969 void ** arg; /* a user argument */
30972 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30973 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30974 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30975 mem_base = xmlMemBlocks();
30976 reader = gen_xmlTextReaderPtr(n_reader, 0);
30977 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30978 arg = gen_void_ptr_ptr(n_arg, 2);
30980 xmlTextReaderGetErrorHandler(reader, f, arg);
30982 des_xmlTextReaderPtr(n_reader, reader, 0);
30983 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30984 des_void_ptr_ptr(n_arg, arg, 2);
30985 xmlResetLastError();
30986 if (mem_base != xmlMemBlocks()) {
30987 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30988 xmlMemBlocks() - mem_base);
30990 printf(" %d", n_reader);
30991 printf(" %d", n_f);
30992 printf(" %d", n_arg);
31006 test_xmlTextReaderGetParserColumnNumber(void) {
31009 #if defined(LIBXML_READER_ENABLED)
31012 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31015 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31016 mem_base = xmlMemBlocks();
31017 reader = gen_xmlTextReaderPtr(n_reader, 0);
31019 ret_val = xmlTextReaderGetParserColumnNumber(reader);
31020 desret_int(ret_val);
31022 des_xmlTextReaderPtr(n_reader, reader, 0);
31023 xmlResetLastError();
31024 if (mem_base != xmlMemBlocks()) {
31025 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31026 xmlMemBlocks() - mem_base);
31028 printf(" %d", n_reader);
31040 test_xmlTextReaderGetParserLineNumber(void) {
31043 #if defined(LIBXML_READER_ENABLED)
31046 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31049 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31050 mem_base = xmlMemBlocks();
31051 reader = gen_xmlTextReaderPtr(n_reader, 0);
31053 ret_val = xmlTextReaderGetParserLineNumber(reader);
31054 desret_int(ret_val);
31056 des_xmlTextReaderPtr(n_reader, reader, 0);
31057 xmlResetLastError();
31058 if (mem_base != xmlMemBlocks()) {
31059 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31060 xmlMemBlocks() - mem_base);
31062 printf(" %d", n_reader);
31074 test_xmlTextReaderGetParserProp(void) {
31077 #if defined(LIBXML_READER_ENABLED)
31080 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31082 int prop; /* the xmlParserProperties to get */
31085 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31086 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31087 mem_base = xmlMemBlocks();
31088 reader = gen_xmlTextReaderPtr(n_reader, 0);
31089 prop = gen_int(n_prop, 1);
31091 ret_val = xmlTextReaderGetParserProp(reader, prop);
31092 desret_int(ret_val);
31094 des_xmlTextReaderPtr(n_reader, reader, 0);
31095 des_int(n_prop, prop, 1);
31096 xmlResetLastError();
31097 if (mem_base != xmlMemBlocks()) {
31098 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31099 xmlMemBlocks() - mem_base);
31101 printf(" %d", n_reader);
31102 printf(" %d", n_prop);
31115 test_xmlTextReaderGetRemainder(void) {
31118 #if defined(LIBXML_READER_ENABLED)
31120 xmlParserInputBufferPtr ret_val;
31121 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31124 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31125 mem_base = xmlMemBlocks();
31126 reader = gen_xmlTextReaderPtr(n_reader, 0);
31128 ret_val = xmlTextReaderGetRemainder(reader);
31129 desret_xmlParserInputBufferPtr(ret_val);
31131 des_xmlTextReaderPtr(n_reader, reader, 0);
31132 xmlResetLastError();
31133 if (mem_base != xmlMemBlocks()) {
31134 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31135 xmlMemBlocks() - mem_base);
31137 printf(" %d", n_reader);
31149 test_xmlTextReaderHasAttributes(void) {
31152 #if defined(LIBXML_READER_ENABLED)
31155 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31158 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31159 mem_base = xmlMemBlocks();
31160 reader = gen_xmlTextReaderPtr(n_reader, 0);
31162 ret_val = xmlTextReaderHasAttributes(reader);
31163 desret_int(ret_val);
31165 des_xmlTextReaderPtr(n_reader, reader, 0);
31166 xmlResetLastError();
31167 if (mem_base != xmlMemBlocks()) {
31168 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31169 xmlMemBlocks() - mem_base);
31171 printf(" %d", n_reader);
31183 test_xmlTextReaderHasValue(void) {
31186 #if defined(LIBXML_READER_ENABLED)
31189 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31192 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31193 mem_base = xmlMemBlocks();
31194 reader = gen_xmlTextReaderPtr(n_reader, 0);
31196 ret_val = xmlTextReaderHasValue(reader);
31197 desret_int(ret_val);
31199 des_xmlTextReaderPtr(n_reader, reader, 0);
31200 xmlResetLastError();
31201 if (mem_base != xmlMemBlocks()) {
31202 printf("Leak of %d blocks found in xmlTextReaderHasValue",
31203 xmlMemBlocks() - mem_base);
31205 printf(" %d", n_reader);
31217 test_xmlTextReaderIsDefault(void) {
31220 #if defined(LIBXML_READER_ENABLED)
31223 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31226 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31227 mem_base = xmlMemBlocks();
31228 reader = gen_xmlTextReaderPtr(n_reader, 0);
31230 ret_val = xmlTextReaderIsDefault(reader);
31231 desret_int(ret_val);
31233 des_xmlTextReaderPtr(n_reader, reader, 0);
31234 xmlResetLastError();
31235 if (mem_base != xmlMemBlocks()) {
31236 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31237 xmlMemBlocks() - mem_base);
31239 printf(" %d", n_reader);
31251 test_xmlTextReaderIsEmptyElement(void) {
31254 #if defined(LIBXML_READER_ENABLED)
31257 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31260 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31261 mem_base = xmlMemBlocks();
31262 reader = gen_xmlTextReaderPtr(n_reader, 0);
31264 ret_val = xmlTextReaderIsEmptyElement(reader);
31265 desret_int(ret_val);
31267 des_xmlTextReaderPtr(n_reader, reader, 0);
31268 xmlResetLastError();
31269 if (mem_base != xmlMemBlocks()) {
31270 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31271 xmlMemBlocks() - mem_base);
31273 printf(" %d", n_reader);
31285 test_xmlTextReaderIsNamespaceDecl(void) {
31288 #if defined(LIBXML_READER_ENABLED)
31291 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31294 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31295 mem_base = xmlMemBlocks();
31296 reader = gen_xmlTextReaderPtr(n_reader, 0);
31298 ret_val = xmlTextReaderIsNamespaceDecl(reader);
31299 desret_int(ret_val);
31301 des_xmlTextReaderPtr(n_reader, reader, 0);
31302 xmlResetLastError();
31303 if (mem_base != xmlMemBlocks()) {
31304 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31305 xmlMemBlocks() - mem_base);
31307 printf(" %d", n_reader);
31319 test_xmlTextReaderIsValid(void) {
31322 #if defined(LIBXML_READER_ENABLED)
31325 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31328 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31329 mem_base = xmlMemBlocks();
31330 reader = gen_xmlTextReaderPtr(n_reader, 0);
31332 ret_val = xmlTextReaderIsValid(reader);
31333 desret_int(ret_val);
31335 des_xmlTextReaderPtr(n_reader, reader, 0);
31336 xmlResetLastError();
31337 if (mem_base != xmlMemBlocks()) {
31338 printf("Leak of %d blocks found in xmlTextReaderIsValid",
31339 xmlMemBlocks() - mem_base);
31341 printf(" %d", n_reader);
31353 test_xmlTextReaderLocalName(void) {
31356 #if defined(LIBXML_READER_ENABLED)
31359 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31362 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31363 mem_base = xmlMemBlocks();
31364 reader = gen_xmlTextReaderPtr(n_reader, 0);
31366 ret_val = xmlTextReaderLocalName(reader);
31367 desret_xmlChar_ptr(ret_val);
31369 des_xmlTextReaderPtr(n_reader, reader, 0);
31370 xmlResetLastError();
31371 if (mem_base != xmlMemBlocks()) {
31372 printf("Leak of %d blocks found in xmlTextReaderLocalName",
31373 xmlMemBlocks() - mem_base);
31375 printf(" %d", n_reader);
31385 #ifdef LIBXML_READER_ENABLED
31387 #define gen_nb_xmlTextReaderLocatorPtr 1
31388 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31391 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31397 test_xmlTextReaderLocatorBaseURI(void) {
31400 #if defined(LIBXML_READER_ENABLED)
31403 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31406 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31407 mem_base = xmlMemBlocks();
31408 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31410 ret_val = xmlTextReaderLocatorBaseURI(locator);
31411 desret_xmlChar_ptr(ret_val);
31413 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31414 xmlResetLastError();
31415 if (mem_base != xmlMemBlocks()) {
31416 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31417 xmlMemBlocks() - mem_base);
31419 printf(" %d", n_locator);
31431 test_xmlTextReaderLocatorLineNumber(void) {
31434 #if defined(LIBXML_READER_ENABLED)
31437 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31440 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31441 mem_base = xmlMemBlocks();
31442 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31444 ret_val = xmlTextReaderLocatorLineNumber(locator);
31445 desret_int(ret_val);
31447 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31448 xmlResetLastError();
31449 if (mem_base != xmlMemBlocks()) {
31450 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31451 xmlMemBlocks() - mem_base);
31453 printf(" %d", n_locator);
31465 test_xmlTextReaderLookupNamespace(void) {
31468 #if defined(LIBXML_READER_ENABLED)
31471 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31473 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31476 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31477 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31478 mem_base = xmlMemBlocks();
31479 reader = gen_xmlTextReaderPtr(n_reader, 0);
31480 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31482 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31483 desret_xmlChar_ptr(ret_val);
31485 des_xmlTextReaderPtr(n_reader, reader, 0);
31486 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31487 xmlResetLastError();
31488 if (mem_base != xmlMemBlocks()) {
31489 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31490 xmlMemBlocks() - mem_base);
31492 printf(" %d", n_reader);
31493 printf(" %d", n_prefix);
31506 test_xmlTextReaderMoveToAttribute(void) {
31509 #if defined(LIBXML_READER_ENABLED)
31512 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31514 xmlChar * name; /* the qualified name of the attribute. */
31517 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31518 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31519 mem_base = xmlMemBlocks();
31520 reader = gen_xmlTextReaderPtr(n_reader, 0);
31521 name = gen_const_xmlChar_ptr(n_name, 1);
31523 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31524 desret_int(ret_val);
31526 des_xmlTextReaderPtr(n_reader, reader, 0);
31527 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31528 xmlResetLastError();
31529 if (mem_base != xmlMemBlocks()) {
31530 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31531 xmlMemBlocks() - mem_base);
31533 printf(" %d", n_reader);
31534 printf(" %d", n_name);
31547 test_xmlTextReaderMoveToAttributeNo(void) {
31550 #if defined(LIBXML_READER_ENABLED)
31553 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31555 int no; /* the zero-based index of the attribute relative to the containing element. */
31558 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31559 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31560 mem_base = xmlMemBlocks();
31561 reader = gen_xmlTextReaderPtr(n_reader, 0);
31562 no = gen_int(n_no, 1);
31564 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31565 desret_int(ret_val);
31567 des_xmlTextReaderPtr(n_reader, reader, 0);
31568 des_int(n_no, no, 1);
31569 xmlResetLastError();
31570 if (mem_base != xmlMemBlocks()) {
31571 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31572 xmlMemBlocks() - mem_base);
31574 printf(" %d", n_reader);
31575 printf(" %d", n_no);
31588 test_xmlTextReaderMoveToAttributeNs(void) {
31591 #if defined(LIBXML_READER_ENABLED)
31594 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31596 xmlChar * localName; /* the local name of the attribute. */
31598 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31599 int n_namespaceURI;
31601 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31602 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31603 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31604 mem_base = xmlMemBlocks();
31605 reader = gen_xmlTextReaderPtr(n_reader, 0);
31606 localName = gen_const_xmlChar_ptr(n_localName, 1);
31607 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31609 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31610 desret_int(ret_val);
31612 des_xmlTextReaderPtr(n_reader, reader, 0);
31613 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31614 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31615 xmlResetLastError();
31616 if (mem_base != xmlMemBlocks()) {
31617 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31618 xmlMemBlocks() - mem_base);
31620 printf(" %d", n_reader);
31621 printf(" %d", n_localName);
31622 printf(" %d", n_namespaceURI);
31636 test_xmlTextReaderMoveToElement(void) {
31639 #if defined(LIBXML_READER_ENABLED)
31642 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31645 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31646 mem_base = xmlMemBlocks();
31647 reader = gen_xmlTextReaderPtr(n_reader, 0);
31649 ret_val = xmlTextReaderMoveToElement(reader);
31650 desret_int(ret_val);
31652 des_xmlTextReaderPtr(n_reader, reader, 0);
31653 xmlResetLastError();
31654 if (mem_base != xmlMemBlocks()) {
31655 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31656 xmlMemBlocks() - mem_base);
31658 printf(" %d", n_reader);
31670 test_xmlTextReaderMoveToFirstAttribute(void) {
31673 #if defined(LIBXML_READER_ENABLED)
31676 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31679 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31680 mem_base = xmlMemBlocks();
31681 reader = gen_xmlTextReaderPtr(n_reader, 0);
31683 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31684 desret_int(ret_val);
31686 des_xmlTextReaderPtr(n_reader, reader, 0);
31687 xmlResetLastError();
31688 if (mem_base != xmlMemBlocks()) {
31689 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31690 xmlMemBlocks() - mem_base);
31692 printf(" %d", n_reader);
31704 test_xmlTextReaderMoveToNextAttribute(void) {
31707 #if defined(LIBXML_READER_ENABLED)
31710 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31713 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31714 mem_base = xmlMemBlocks();
31715 reader = gen_xmlTextReaderPtr(n_reader, 0);
31717 ret_val = xmlTextReaderMoveToNextAttribute(reader);
31718 desret_int(ret_val);
31720 des_xmlTextReaderPtr(n_reader, reader, 0);
31721 xmlResetLastError();
31722 if (mem_base != xmlMemBlocks()) {
31723 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31724 xmlMemBlocks() - mem_base);
31726 printf(" %d", n_reader);
31738 test_xmlTextReaderName(void) {
31741 #if defined(LIBXML_READER_ENABLED)
31744 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31747 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31748 mem_base = xmlMemBlocks();
31749 reader = gen_xmlTextReaderPtr(n_reader, 0);
31751 ret_val = xmlTextReaderName(reader);
31752 desret_xmlChar_ptr(ret_val);
31754 des_xmlTextReaderPtr(n_reader, reader, 0);
31755 xmlResetLastError();
31756 if (mem_base != xmlMemBlocks()) {
31757 printf("Leak of %d blocks found in xmlTextReaderName",
31758 xmlMemBlocks() - mem_base);
31760 printf(" %d", n_reader);
31772 test_xmlTextReaderNamespaceUri(void) {
31775 #if defined(LIBXML_READER_ENABLED)
31778 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31781 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31782 mem_base = xmlMemBlocks();
31783 reader = gen_xmlTextReaderPtr(n_reader, 0);
31785 ret_val = xmlTextReaderNamespaceUri(reader);
31786 desret_xmlChar_ptr(ret_val);
31788 des_xmlTextReaderPtr(n_reader, reader, 0);
31789 xmlResetLastError();
31790 if (mem_base != xmlMemBlocks()) {
31791 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31792 xmlMemBlocks() - mem_base);
31794 printf(" %d", n_reader);
31806 test_xmlTextReaderNext(void) {
31809 #if defined(LIBXML_READER_ENABLED)
31812 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31815 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31816 mem_base = xmlMemBlocks();
31817 reader = gen_xmlTextReaderPtr(n_reader, 0);
31819 ret_val = xmlTextReaderNext(reader);
31820 desret_int(ret_val);
31822 des_xmlTextReaderPtr(n_reader, reader, 0);
31823 xmlResetLastError();
31824 if (mem_base != xmlMemBlocks()) {
31825 printf("Leak of %d blocks found in xmlTextReaderNext",
31826 xmlMemBlocks() - mem_base);
31828 printf(" %d", n_reader);
31840 test_xmlTextReaderNextSibling(void) {
31843 #if defined(LIBXML_READER_ENABLED)
31846 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31849 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31850 mem_base = xmlMemBlocks();
31851 reader = gen_xmlTextReaderPtr(n_reader, 0);
31853 ret_val = xmlTextReaderNextSibling(reader);
31854 desret_int(ret_val);
31856 des_xmlTextReaderPtr(n_reader, reader, 0);
31857 xmlResetLastError();
31858 if (mem_base != xmlMemBlocks()) {
31859 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31860 xmlMemBlocks() - mem_base);
31862 printf(" %d", n_reader);
31874 test_xmlTextReaderNodeType(void) {
31877 #if defined(LIBXML_READER_ENABLED)
31880 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31883 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31884 mem_base = xmlMemBlocks();
31885 reader = gen_xmlTextReaderPtr(n_reader, 0);
31887 ret_val = xmlTextReaderNodeType(reader);
31888 desret_int(ret_val);
31890 des_xmlTextReaderPtr(n_reader, reader, 0);
31891 xmlResetLastError();
31892 if (mem_base != xmlMemBlocks()) {
31893 printf("Leak of %d blocks found in xmlTextReaderNodeType",
31894 xmlMemBlocks() - mem_base);
31896 printf(" %d", n_reader);
31908 test_xmlTextReaderNormalization(void) {
31911 #if defined(LIBXML_READER_ENABLED)
31914 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31917 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31918 mem_base = xmlMemBlocks();
31919 reader = gen_xmlTextReaderPtr(n_reader, 0);
31921 ret_val = xmlTextReaderNormalization(reader);
31922 desret_int(ret_val);
31924 des_xmlTextReaderPtr(n_reader, reader, 0);
31925 xmlResetLastError();
31926 if (mem_base != xmlMemBlocks()) {
31927 printf("Leak of %d blocks found in xmlTextReaderNormalization",
31928 xmlMemBlocks() - mem_base);
31930 printf(" %d", n_reader);
31942 test_xmlTextReaderPrefix(void) {
31945 #if defined(LIBXML_READER_ENABLED)
31948 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31951 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31952 mem_base = xmlMemBlocks();
31953 reader = gen_xmlTextReaderPtr(n_reader, 0);
31955 ret_val = xmlTextReaderPrefix(reader);
31956 desret_xmlChar_ptr(ret_val);
31958 des_xmlTextReaderPtr(n_reader, reader, 0);
31959 xmlResetLastError();
31960 if (mem_base != xmlMemBlocks()) {
31961 printf("Leak of %d blocks found in xmlTextReaderPrefix",
31962 xmlMemBlocks() - mem_base);
31964 printf(" %d", n_reader);
31976 test_xmlTextReaderPreserve(void) {
31979 #if defined(LIBXML_READER_ENABLED)
31981 xmlNodePtr ret_val;
31982 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31985 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31986 mem_base = xmlMemBlocks();
31987 reader = gen_xmlTextReaderPtr(n_reader, 0);
31989 ret_val = xmlTextReaderPreserve(reader);
31990 desret_xmlNodePtr(ret_val);
31992 des_xmlTextReaderPtr(n_reader, reader, 0);
31993 xmlResetLastError();
31994 if (mem_base != xmlMemBlocks()) {
31995 printf("Leak of %d blocks found in xmlTextReaderPreserve",
31996 xmlMemBlocks() - mem_base);
31998 printf(" %d", n_reader);
32010 test_xmlTextReaderPreservePattern(void) {
32013 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32014 #ifdef LIBXML_PATTERN_ENABLED
32017 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32019 xmlChar * pattern; /* an XPath subset pattern */
32021 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32024 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32025 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32026 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32027 mem_base = xmlMemBlocks();
32028 reader = gen_xmlTextReaderPtr(n_reader, 0);
32029 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32030 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32032 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32033 desret_int(ret_val);
32035 des_xmlTextReaderPtr(n_reader, reader, 0);
32036 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32037 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32038 xmlResetLastError();
32039 if (mem_base != xmlMemBlocks()) {
32040 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32041 xmlMemBlocks() - mem_base);
32043 printf(" %d", n_reader);
32044 printf(" %d", n_pattern);
32045 printf(" %d", n_namespaces);
32060 test_xmlTextReaderQuoteChar(void) {
32063 #if defined(LIBXML_READER_ENABLED)
32066 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32069 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32070 mem_base = xmlMemBlocks();
32071 reader = gen_xmlTextReaderPtr(n_reader, 0);
32073 ret_val = xmlTextReaderQuoteChar(reader);
32074 desret_int(ret_val);
32076 des_xmlTextReaderPtr(n_reader, reader, 0);
32077 xmlResetLastError();
32078 if (mem_base != xmlMemBlocks()) {
32079 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32080 xmlMemBlocks() - mem_base);
32082 printf(" %d", n_reader);
32094 test_xmlTextReaderRead(void) {
32097 #if defined(LIBXML_READER_ENABLED)
32100 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32103 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32104 mem_base = xmlMemBlocks();
32105 reader = gen_xmlTextReaderPtr(n_reader, 0);
32107 ret_val = xmlTextReaderRead(reader);
32108 desret_int(ret_val);
32110 des_xmlTextReaderPtr(n_reader, reader, 0);
32111 xmlResetLastError();
32112 if (mem_base != xmlMemBlocks()) {
32113 printf("Leak of %d blocks found in xmlTextReaderRead",
32114 xmlMemBlocks() - mem_base);
32116 printf(" %d", n_reader);
32128 test_xmlTextReaderReadAttributeValue(void) {
32131 #if defined(LIBXML_READER_ENABLED)
32134 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32137 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32138 mem_base = xmlMemBlocks();
32139 reader = gen_xmlTextReaderPtr(n_reader, 0);
32141 ret_val = xmlTextReaderReadAttributeValue(reader);
32142 desret_int(ret_val);
32144 des_xmlTextReaderPtr(n_reader, reader, 0);
32145 xmlResetLastError();
32146 if (mem_base != xmlMemBlocks()) {
32147 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32148 xmlMemBlocks() - mem_base);
32150 printf(" %d", n_reader);
32162 test_xmlTextReaderReadState(void) {
32165 #if defined(LIBXML_READER_ENABLED)
32168 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32171 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32172 mem_base = xmlMemBlocks();
32173 reader = gen_xmlTextReaderPtr(n_reader, 0);
32175 ret_val = xmlTextReaderReadState(reader);
32176 desret_int(ret_val);
32178 des_xmlTextReaderPtr(n_reader, reader, 0);
32179 xmlResetLastError();
32180 if (mem_base != xmlMemBlocks()) {
32181 printf("Leak of %d blocks found in xmlTextReaderReadState",
32182 xmlMemBlocks() - mem_base);
32184 printf(" %d", n_reader);
32196 test_xmlTextReaderRelaxNGSetSchema(void) {
32199 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32202 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32204 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32207 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32208 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32209 mem_base = xmlMemBlocks();
32210 reader = gen_xmlTextReaderPtr(n_reader, 0);
32211 schema = gen_xmlRelaxNGPtr(n_schema, 1);
32213 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32214 desret_int(ret_val);
32216 des_xmlTextReaderPtr(n_reader, reader, 0);
32217 des_xmlRelaxNGPtr(n_schema, schema, 1);
32218 xmlResetLastError();
32219 if (mem_base != xmlMemBlocks()) {
32220 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32221 xmlMemBlocks() - mem_base);
32223 printf(" %d", n_reader);
32224 printf(" %d", n_schema);
32237 test_xmlTextReaderRelaxNGValidate(void) {
32240 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32243 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32245 char * rng; /* the path to a RelaxNG schema or NULL */
32248 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32249 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32250 mem_base = xmlMemBlocks();
32251 reader = gen_xmlTextReaderPtr(n_reader, 0);
32252 rng = gen_const_char_ptr(n_rng, 1);
32254 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32255 desret_int(ret_val);
32257 des_xmlTextReaderPtr(n_reader, reader, 0);
32258 des_const_char_ptr(n_rng, (const char *)rng, 1);
32259 xmlResetLastError();
32260 if (mem_base != xmlMemBlocks()) {
32261 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32262 xmlMemBlocks() - mem_base);
32264 printf(" %d", n_reader);
32265 printf(" %d", n_rng);
32278 test_xmlTextReaderSchemaValidate(void) {
32281 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32283 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32285 char * xsd; /* the path to a W3C XSD schema or NULL */
32288 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32289 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32290 reader = gen_xmlTextReaderPtr(n_reader, 0);
32291 xsd = gen_const_char_ptr(n_xsd, 1);
32293 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32294 desret_int(ret_val);
32296 des_xmlTextReaderPtr(n_reader, reader, 0);
32297 des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32298 xmlResetLastError();
32309 test_xmlTextReaderSchemaValidateCtxt(void) {
32312 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32315 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32317 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32319 int options; /* options (not used yet) */
32322 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32323 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32324 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32325 mem_base = xmlMemBlocks();
32326 reader = gen_xmlTextReaderPtr(n_reader, 0);
32327 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32328 options = gen_parseroptions(n_options, 2);
32330 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32331 desret_int(ret_val);
32333 des_xmlTextReaderPtr(n_reader, reader, 0);
32334 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32335 des_parseroptions(n_options, options, 2);
32336 xmlResetLastError();
32337 if (mem_base != xmlMemBlocks()) {
32338 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32339 xmlMemBlocks() - mem_base);
32341 printf(" %d", n_reader);
32342 printf(" %d", n_ctxt);
32343 printf(" %d", n_options);
32357 test_xmlTextReaderSetErrorHandler(void) {
32361 /* missing type support */
32367 test_xmlTextReaderSetParserProp(void) {
32370 #if defined(LIBXML_READER_ENABLED)
32373 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32375 int prop; /* the xmlParserProperties to set */
32377 int value; /* usually 0 or 1 to (de)activate it */
32380 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32381 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32382 for (n_value = 0;n_value < gen_nb_int;n_value++) {
32383 mem_base = xmlMemBlocks();
32384 reader = gen_xmlTextReaderPtr(n_reader, 0);
32385 prop = gen_int(n_prop, 1);
32386 value = gen_int(n_value, 2);
32388 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32389 desret_int(ret_val);
32391 des_xmlTextReaderPtr(n_reader, reader, 0);
32392 des_int(n_prop, prop, 1);
32393 des_int(n_value, value, 2);
32394 xmlResetLastError();
32395 if (mem_base != xmlMemBlocks()) {
32396 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32397 xmlMemBlocks() - mem_base);
32399 printf(" %d", n_reader);
32400 printf(" %d", n_prop);
32401 printf(" %d", n_value);
32415 test_xmlTextReaderSetSchema(void) {
32418 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32421 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32423 xmlSchemaPtr schema; /* a precompiled Schema schema */
32426 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32427 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32428 mem_base = xmlMemBlocks();
32429 reader = gen_xmlTextReaderPtr(n_reader, 0);
32430 schema = gen_xmlSchemaPtr(n_schema, 1);
32432 ret_val = xmlTextReaderSetSchema(reader, schema);
32433 desret_int(ret_val);
32435 des_xmlTextReaderPtr(n_reader, reader, 0);
32436 des_xmlSchemaPtr(n_schema, schema, 1);
32437 xmlResetLastError();
32438 if (mem_base != xmlMemBlocks()) {
32439 printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32440 xmlMemBlocks() - mem_base);
32442 printf(" %d", n_reader);
32443 printf(" %d", n_schema);
32456 test_xmlTextReaderSetStructuredErrorHandler(void) {
32460 /* missing type support */
32466 test_xmlTextReaderSetup(void) {
32469 #if defined(LIBXML_READER_ENABLED)
32472 xmlTextReaderPtr reader; /* an XML reader */
32474 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32476 const char * URL; /* the base URL to use for the document */
32478 char * encoding; /* the document encoding, or NULL */
32480 int options; /* a combination of xmlParserOption */
32483 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32484 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32485 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32486 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32487 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32488 mem_base = xmlMemBlocks();
32489 reader = gen_xmlTextReaderPtr(n_reader, 0);
32490 input = gen_xmlParserInputBufferPtr(n_input, 1);
32491 URL = gen_filepath(n_URL, 2);
32492 encoding = gen_const_char_ptr(n_encoding, 3);
32493 options = gen_parseroptions(n_options, 4);
32495 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32496 desret_int(ret_val);
32498 des_xmlTextReaderPtr(n_reader, reader, 0);
32499 des_filepath(n_URL, URL, 2);
32500 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32501 des_parseroptions(n_options, options, 4);
32502 xmlResetLastError();
32503 if (mem_base != xmlMemBlocks()) {
32504 printf("Leak of %d blocks found in xmlTextReaderSetup",
32505 xmlMemBlocks() - mem_base);
32507 printf(" %d", n_reader);
32508 printf(" %d", n_input);
32509 printf(" %d", n_URL);
32510 printf(" %d", n_encoding);
32511 printf(" %d", n_options);
32527 test_xmlTextReaderStandalone(void) {
32530 #if defined(LIBXML_READER_ENABLED)
32533 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32536 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32537 mem_base = xmlMemBlocks();
32538 reader = gen_xmlTextReaderPtr(n_reader, 0);
32540 ret_val = xmlTextReaderStandalone(reader);
32541 desret_int(ret_val);
32543 des_xmlTextReaderPtr(n_reader, reader, 0);
32544 xmlResetLastError();
32545 if (mem_base != xmlMemBlocks()) {
32546 printf("Leak of %d blocks found in xmlTextReaderStandalone",
32547 xmlMemBlocks() - mem_base);
32549 printf(" %d", n_reader);
32561 test_xmlTextReaderValue(void) {
32564 #if defined(LIBXML_READER_ENABLED)
32567 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32570 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32571 mem_base = xmlMemBlocks();
32572 reader = gen_xmlTextReaderPtr(n_reader, 0);
32574 ret_val = xmlTextReaderValue(reader);
32575 desret_xmlChar_ptr(ret_val);
32577 des_xmlTextReaderPtr(n_reader, reader, 0);
32578 xmlResetLastError();
32579 if (mem_base != xmlMemBlocks()) {
32580 printf("Leak of %d blocks found in xmlTextReaderValue",
32581 xmlMemBlocks() - mem_base);
32583 printf(" %d", n_reader);
32595 test_xmlTextReaderXmlLang(void) {
32598 #if defined(LIBXML_READER_ENABLED)
32601 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32604 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32605 mem_base = xmlMemBlocks();
32606 reader = gen_xmlTextReaderPtr(n_reader, 0);
32608 ret_val = xmlTextReaderXmlLang(reader);
32609 desret_xmlChar_ptr(ret_val);
32611 des_xmlTextReaderPtr(n_reader, reader, 0);
32612 xmlResetLastError();
32613 if (mem_base != xmlMemBlocks()) {
32614 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32615 xmlMemBlocks() - mem_base);
32617 printf(" %d", n_reader);
32628 test_xmlreader(void) {
32631 if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32632 test_ret += test_xmlNewTextReader();
32633 test_ret += test_xmlNewTextReaderFilename();
32634 test_ret += test_xmlReaderForDoc();
32635 test_ret += test_xmlReaderForFile();
32636 test_ret += test_xmlReaderForMemory();
32637 test_ret += test_xmlReaderNewDoc();
32638 test_ret += test_xmlReaderNewFile();
32639 test_ret += test_xmlReaderNewMemory();
32640 test_ret += test_xmlReaderNewWalker();
32641 test_ret += test_xmlReaderWalker();
32642 test_ret += test_xmlTextReaderAttributeCount();
32643 test_ret += test_xmlTextReaderBaseUri();
32644 test_ret += test_xmlTextReaderByteConsumed();
32645 test_ret += test_xmlTextReaderClose();
32646 test_ret += test_xmlTextReaderConstBaseUri();
32647 test_ret += test_xmlTextReaderConstEncoding();
32648 test_ret += test_xmlTextReaderConstLocalName();
32649 test_ret += test_xmlTextReaderConstName();
32650 test_ret += test_xmlTextReaderConstNamespaceUri();
32651 test_ret += test_xmlTextReaderConstPrefix();
32652 test_ret += test_xmlTextReaderConstString();
32653 test_ret += test_xmlTextReaderConstValue();
32654 test_ret += test_xmlTextReaderConstXmlLang();
32655 test_ret += test_xmlTextReaderConstXmlVersion();
32656 test_ret += test_xmlTextReaderCurrentDoc();
32657 test_ret += test_xmlTextReaderCurrentNode();
32658 test_ret += test_xmlTextReaderDepth();
32659 test_ret += test_xmlTextReaderExpand();
32660 test_ret += test_xmlTextReaderGetAttribute();
32661 test_ret += test_xmlTextReaderGetAttributeNo();
32662 test_ret += test_xmlTextReaderGetAttributeNs();
32663 test_ret += test_xmlTextReaderGetErrorHandler();
32664 test_ret += test_xmlTextReaderGetParserColumnNumber();
32665 test_ret += test_xmlTextReaderGetParserLineNumber();
32666 test_ret += test_xmlTextReaderGetParserProp();
32667 test_ret += test_xmlTextReaderGetRemainder();
32668 test_ret += test_xmlTextReaderHasAttributes();
32669 test_ret += test_xmlTextReaderHasValue();
32670 test_ret += test_xmlTextReaderIsDefault();
32671 test_ret += test_xmlTextReaderIsEmptyElement();
32672 test_ret += test_xmlTextReaderIsNamespaceDecl();
32673 test_ret += test_xmlTextReaderIsValid();
32674 test_ret += test_xmlTextReaderLocalName();
32675 test_ret += test_xmlTextReaderLocatorBaseURI();
32676 test_ret += test_xmlTextReaderLocatorLineNumber();
32677 test_ret += test_xmlTextReaderLookupNamespace();
32678 test_ret += test_xmlTextReaderMoveToAttribute();
32679 test_ret += test_xmlTextReaderMoveToAttributeNo();
32680 test_ret += test_xmlTextReaderMoveToAttributeNs();
32681 test_ret += test_xmlTextReaderMoveToElement();
32682 test_ret += test_xmlTextReaderMoveToFirstAttribute();
32683 test_ret += test_xmlTextReaderMoveToNextAttribute();
32684 test_ret += test_xmlTextReaderName();
32685 test_ret += test_xmlTextReaderNamespaceUri();
32686 test_ret += test_xmlTextReaderNext();
32687 test_ret += test_xmlTextReaderNextSibling();
32688 test_ret += test_xmlTextReaderNodeType();
32689 test_ret += test_xmlTextReaderNormalization();
32690 test_ret += test_xmlTextReaderPrefix();
32691 test_ret += test_xmlTextReaderPreserve();
32692 test_ret += test_xmlTextReaderPreservePattern();
32693 test_ret += test_xmlTextReaderQuoteChar();
32694 test_ret += test_xmlTextReaderRead();
32695 test_ret += test_xmlTextReaderReadAttributeValue();
32696 test_ret += test_xmlTextReaderReadState();
32697 test_ret += test_xmlTextReaderRelaxNGSetSchema();
32698 test_ret += test_xmlTextReaderRelaxNGValidate();
32699 test_ret += test_xmlTextReaderSchemaValidate();
32700 test_ret += test_xmlTextReaderSchemaValidateCtxt();
32701 test_ret += test_xmlTextReaderSetErrorHandler();
32702 test_ret += test_xmlTextReaderSetParserProp();
32703 test_ret += test_xmlTextReaderSetSchema();
32704 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32705 test_ret += test_xmlTextReaderSetup();
32706 test_ret += test_xmlTextReaderStandalone();
32707 test_ret += test_xmlTextReaderValue();
32708 test_ret += test_xmlTextReaderXmlLang();
32711 printf("Module xmlreader: %d errors\n", test_ret);
32716 test_xmlExpCtxtNbCons(void) {
32719 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32722 xmlExpCtxtPtr ctxt; /* an expression context */
32725 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32726 mem_base = xmlMemBlocks();
32727 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32729 ret_val = xmlExpCtxtNbCons(ctxt);
32730 desret_int(ret_val);
32732 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32733 xmlResetLastError();
32734 if (mem_base != xmlMemBlocks()) {
32735 printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32736 xmlMemBlocks() - mem_base);
32738 printf(" %d", n_ctxt);
32750 test_xmlExpCtxtNbNodes(void) {
32753 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32756 xmlExpCtxtPtr ctxt; /* an expression context */
32759 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32760 mem_base = xmlMemBlocks();
32761 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32763 ret_val = xmlExpCtxtNbNodes(ctxt);
32764 desret_int(ret_val);
32766 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32767 xmlResetLastError();
32768 if (mem_base != xmlMemBlocks()) {
32769 printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32770 xmlMemBlocks() - mem_base);
32772 printf(" %d", n_ctxt);
32784 test_xmlExpDump(void) {
32787 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32789 xmlBufferPtr buf; /* a buffer to receive the output */
32791 xmlExpNodePtr expr; /* the compiled expression */
32794 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32795 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32796 mem_base = xmlMemBlocks();
32797 buf = gen_xmlBufferPtr(n_buf, 0);
32798 expr = gen_xmlExpNodePtr(n_expr, 1);
32800 xmlExpDump(buf, expr);
32802 des_xmlBufferPtr(n_buf, buf, 0);
32803 des_xmlExpNodePtr(n_expr, expr, 1);
32804 xmlResetLastError();
32805 if (mem_base != xmlMemBlocks()) {
32806 printf("Leak of %d blocks found in xmlExpDump",
32807 xmlMemBlocks() - mem_base);
32809 printf(" %d", n_buf);
32810 printf(" %d", n_expr);
32823 test_xmlExpExpDerive(void) {
32827 /* missing type support */
32833 test_xmlExpGetLanguage(void) {
32836 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32839 xmlExpCtxtPtr ctxt; /* the expression context */
32841 xmlExpNodePtr exp; /* the expression */
32843 xmlChar ** langList; /* where to store the tokens */
32845 int len; /* the allocated lenght of @list */
32848 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32849 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32850 for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32851 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32852 mem_base = xmlMemBlocks();
32853 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32854 exp = gen_xmlExpNodePtr(n_exp, 1);
32855 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32856 len = gen_int(n_len, 3);
32858 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32859 desret_int(ret_val);
32861 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32862 des_xmlExpNodePtr(n_exp, exp, 1);
32863 des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32864 des_int(n_len, len, 3);
32865 xmlResetLastError();
32866 if (mem_base != xmlMemBlocks()) {
32867 printf("Leak of %d blocks found in xmlExpGetLanguage",
32868 xmlMemBlocks() - mem_base);
32870 printf(" %d", n_ctxt);
32871 printf(" %d", n_exp);
32872 printf(" %d", n_langList);
32873 printf(" %d", n_len);
32888 test_xmlExpGetStart(void) {
32891 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32894 xmlExpCtxtPtr ctxt; /* the expression context */
32896 xmlExpNodePtr exp; /* the expression */
32898 xmlChar ** tokList; /* where to store the tokens */
32900 int len; /* the allocated lenght of @list */
32903 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32904 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32905 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32906 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32907 mem_base = xmlMemBlocks();
32908 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32909 exp = gen_xmlExpNodePtr(n_exp, 1);
32910 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32911 len = gen_int(n_len, 3);
32913 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32914 desret_int(ret_val);
32916 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32917 des_xmlExpNodePtr(n_exp, exp, 1);
32918 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32919 des_int(n_len, len, 3);
32920 xmlResetLastError();
32921 if (mem_base != xmlMemBlocks()) {
32922 printf("Leak of %d blocks found in xmlExpGetStart",
32923 xmlMemBlocks() - mem_base);
32925 printf(" %d", n_ctxt);
32926 printf(" %d", n_exp);
32927 printf(" %d", n_tokList);
32928 printf(" %d", n_len);
32943 test_xmlExpIsNillable(void) {
32946 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32949 xmlExpNodePtr exp; /* the expression */
32952 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32953 mem_base = xmlMemBlocks();
32954 exp = gen_xmlExpNodePtr(n_exp, 0);
32956 ret_val = xmlExpIsNillable(exp);
32957 desret_int(ret_val);
32959 des_xmlExpNodePtr(n_exp, exp, 0);
32960 xmlResetLastError();
32961 if (mem_base != xmlMemBlocks()) {
32962 printf("Leak of %d blocks found in xmlExpIsNillable",
32963 xmlMemBlocks() - mem_base);
32965 printf(" %d", n_exp);
32977 test_xmlExpMaxToken(void) {
32980 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32983 xmlExpNodePtr expr; /* a compiled expression */
32986 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32987 mem_base = xmlMemBlocks();
32988 expr = gen_xmlExpNodePtr(n_expr, 0);
32990 ret_val = xmlExpMaxToken(expr);
32991 desret_int(ret_val);
32993 des_xmlExpNodePtr(n_expr, expr, 0);
32994 xmlResetLastError();
32995 if (mem_base != xmlMemBlocks()) {
32996 printf("Leak of %d blocks found in xmlExpMaxToken",
32997 xmlMemBlocks() - mem_base);
32999 printf(" %d", n_expr);
33011 test_xmlExpNewAtom(void) {
33015 /* missing type support */
33021 test_xmlExpNewCtxt(void) {
33025 /* missing type support */
33031 test_xmlExpNewOr(void) {
33035 /* missing type support */
33041 test_xmlExpNewRange(void) {
33045 /* missing type support */
33051 test_xmlExpNewSeq(void) {
33055 /* missing type support */
33061 test_xmlExpParse(void) {
33065 /* missing type support */
33071 test_xmlExpRef(void) {
33074 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33076 xmlExpNodePtr exp; /* the expression */
33079 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33080 mem_base = xmlMemBlocks();
33081 exp = gen_xmlExpNodePtr(n_exp, 0);
33085 des_xmlExpNodePtr(n_exp, exp, 0);
33086 xmlResetLastError();
33087 if (mem_base != xmlMemBlocks()) {
33088 printf("Leak of %d blocks found in xmlExpRef",
33089 xmlMemBlocks() - mem_base);
33091 printf(" %d", n_exp);
33103 test_xmlExpStringDerive(void) {
33107 /* missing type support */
33113 test_xmlExpSubsume(void) {
33116 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33119 xmlExpCtxtPtr ctxt; /* the expressions context */
33121 xmlExpNodePtr exp; /* the englobing expression */
33123 xmlExpNodePtr sub; /* the subexpression */
33126 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33127 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33128 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33129 mem_base = xmlMemBlocks();
33130 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33131 exp = gen_xmlExpNodePtr(n_exp, 1);
33132 sub = gen_xmlExpNodePtr(n_sub, 2);
33134 ret_val = xmlExpSubsume(ctxt, exp, sub);
33135 desret_int(ret_val);
33137 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33138 des_xmlExpNodePtr(n_exp, exp, 1);
33139 des_xmlExpNodePtr(n_sub, sub, 2);
33140 xmlResetLastError();
33141 if (mem_base != xmlMemBlocks()) {
33142 printf("Leak of %d blocks found in xmlExpSubsume",
33143 xmlMemBlocks() - mem_base);
33145 printf(" %d", n_ctxt);
33146 printf(" %d", n_exp);
33147 printf(" %d", n_sub);
33159 #ifdef LIBXML_REGEXP_ENABLED
33161 #define gen_nb_xmlRegExecCtxtPtr 1
33162 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33165 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33171 test_xmlRegExecErrInfo(void) {
33174 #if defined(LIBXML_REGEXP_ENABLED)
33177 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33179 xmlChar ** string; /* return value for the error string */
33181 int * nbval; /* pointer to the number of accepted values IN/OUT */
33183 int * nbneg; /* return number of negative transitions */
33185 xmlChar ** values; /* pointer to the array of acceptable values */
33187 int * terminal; /* return value if this was a terminal state */
33190 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33191 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33192 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33193 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33194 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33195 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33196 mem_base = xmlMemBlocks();
33197 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33198 string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33199 nbval = gen_int_ptr(n_nbval, 2);
33200 nbneg = gen_int_ptr(n_nbneg, 3);
33201 values = gen_xmlChar_ptr_ptr(n_values, 4);
33202 terminal = gen_int_ptr(n_terminal, 5);
33204 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33205 desret_int(ret_val);
33207 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33208 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33209 des_int_ptr(n_nbval, nbval, 2);
33210 des_int_ptr(n_nbneg, nbneg, 3);
33211 des_xmlChar_ptr_ptr(n_values, values, 4);
33212 des_int_ptr(n_terminal, terminal, 5);
33213 xmlResetLastError();
33214 if (mem_base != xmlMemBlocks()) {
33215 printf("Leak of %d blocks found in xmlRegExecErrInfo",
33216 xmlMemBlocks() - mem_base);
33218 printf(" %d", n_exec);
33219 printf(" %d", n_string);
33220 printf(" %d", n_nbval);
33221 printf(" %d", n_nbneg);
33222 printf(" %d", n_values);
33223 printf(" %d", n_terminal);
33240 test_xmlRegExecNextValues(void) {
33243 #if defined(LIBXML_REGEXP_ENABLED)
33246 xmlRegExecCtxtPtr exec; /* a regexp execution context */
33248 int * nbval; /* pointer to the number of accepted values IN/OUT */
33250 int * nbneg; /* return number of negative transitions */
33252 xmlChar ** values; /* pointer to the array of acceptable values */
33254 int * terminal; /* return value if this was a terminal state */
33257 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33258 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33259 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33260 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33261 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33262 mem_base = xmlMemBlocks();
33263 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33264 nbval = gen_int_ptr(n_nbval, 1);
33265 nbneg = gen_int_ptr(n_nbneg, 2);
33266 values = gen_xmlChar_ptr_ptr(n_values, 3);
33267 terminal = gen_int_ptr(n_terminal, 4);
33269 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33270 desret_int(ret_val);
33272 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33273 des_int_ptr(n_nbval, nbval, 1);
33274 des_int_ptr(n_nbneg, nbneg, 2);
33275 des_xmlChar_ptr_ptr(n_values, values, 3);
33276 des_int_ptr(n_terminal, terminal, 4);
33277 xmlResetLastError();
33278 if (mem_base != xmlMemBlocks()) {
33279 printf("Leak of %d blocks found in xmlRegExecNextValues",
33280 xmlMemBlocks() - mem_base);
33282 printf(" %d", n_exec);
33283 printf(" %d", n_nbval);
33284 printf(" %d", n_nbneg);
33285 printf(" %d", n_values);
33286 printf(" %d", n_terminal);
33302 test_xmlRegExecPushString(void) {
33305 #if defined(LIBXML_REGEXP_ENABLED)
33308 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33310 xmlChar * value; /* a string token input */
33312 void * data; /* data associated to the token to reuse in callbacks */
33315 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33316 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33317 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33318 mem_base = xmlMemBlocks();
33319 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33320 value = gen_const_xmlChar_ptr(n_value, 1);
33321 data = gen_userdata(n_data, 2);
33323 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33324 desret_int(ret_val);
33326 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33327 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33328 des_userdata(n_data, data, 2);
33329 xmlResetLastError();
33330 if (mem_base != xmlMemBlocks()) {
33331 printf("Leak of %d blocks found in xmlRegExecPushString",
33332 xmlMemBlocks() - mem_base);
33334 printf(" %d", n_exec);
33335 printf(" %d", n_value);
33336 printf(" %d", n_data);
33350 test_xmlRegExecPushString2(void) {
33353 #if defined(LIBXML_REGEXP_ENABLED)
33356 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33358 xmlChar * value; /* the first string token input */
33360 xmlChar * value2; /* the second string token input */
33362 void * data; /* data associated to the token to reuse in callbacks */
33365 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33366 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33367 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33368 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33369 mem_base = xmlMemBlocks();
33370 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33371 value = gen_const_xmlChar_ptr(n_value, 1);
33372 value2 = gen_const_xmlChar_ptr(n_value2, 2);
33373 data = gen_userdata(n_data, 3);
33375 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33376 desret_int(ret_val);
33378 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33379 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33380 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33381 des_userdata(n_data, data, 3);
33382 xmlResetLastError();
33383 if (mem_base != xmlMemBlocks()) {
33384 printf("Leak of %d blocks found in xmlRegExecPushString2",
33385 xmlMemBlocks() - mem_base);
33387 printf(" %d", n_exec);
33388 printf(" %d", n_value);
33389 printf(" %d", n_value2);
33390 printf(" %d", n_data);
33403 #ifdef LIBXML_REGEXP_ENABLED
33405 #define gen_nb_xmlRegexpPtr 1
33406 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33409 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33415 test_xmlRegNewExecCtxt(void) {
33419 /* missing type support */
33425 test_xmlRegexpCompile(void) {
33429 /* missing type support */
33435 test_xmlRegexpExec(void) {
33438 #if defined(LIBXML_REGEXP_ENABLED)
33441 xmlRegexpPtr comp; /* the compiled regular expression */
33443 xmlChar * content; /* the value to check against the regular expression */
33446 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33447 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33448 mem_base = xmlMemBlocks();
33449 comp = gen_xmlRegexpPtr(n_comp, 0);
33450 content = gen_const_xmlChar_ptr(n_content, 1);
33452 ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33453 desret_int(ret_val);
33455 des_xmlRegexpPtr(n_comp, comp, 0);
33456 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33457 xmlResetLastError();
33458 if (mem_base != xmlMemBlocks()) {
33459 printf("Leak of %d blocks found in xmlRegexpExec",
33460 xmlMemBlocks() - mem_base);
33462 printf(" %d", n_comp);
33463 printf(" %d", n_content);
33476 test_xmlRegexpIsDeterminist(void) {
33479 #if defined(LIBXML_REGEXP_ENABLED)
33482 xmlRegexpPtr comp; /* the compiled regular expression */
33485 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33486 mem_base = xmlMemBlocks();
33487 comp = gen_xmlRegexpPtr(n_comp, 0);
33489 ret_val = xmlRegexpIsDeterminist(comp);
33490 desret_int(ret_val);
33492 des_xmlRegexpPtr(n_comp, comp, 0);
33493 xmlResetLastError();
33494 if (mem_base != xmlMemBlocks()) {
33495 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33496 xmlMemBlocks() - mem_base);
33498 printf(" %d", n_comp);
33510 test_xmlRegexpPrint(void) {
33513 #if defined(LIBXML_REGEXP_ENABLED)
33515 FILE * output; /* the file for the output debug */
33517 xmlRegexpPtr regexp; /* the compiled regexp */
33520 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33521 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33522 mem_base = xmlMemBlocks();
33523 output = gen_FILE_ptr(n_output, 0);
33524 regexp = gen_xmlRegexpPtr(n_regexp, 1);
33526 xmlRegexpPrint(output, regexp);
33528 des_FILE_ptr(n_output, output, 0);
33529 des_xmlRegexpPtr(n_regexp, regexp, 1);
33530 xmlResetLastError();
33531 if (mem_base != xmlMemBlocks()) {
33532 printf("Leak of %d blocks found in xmlRegexpPrint",
33533 xmlMemBlocks() - mem_base);
33535 printf(" %d", n_output);
33536 printf(" %d", n_regexp);
33548 test_xmlregexp(void) {
33551 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33552 test_ret += test_xmlExpCtxtNbCons();
33553 test_ret += test_xmlExpCtxtNbNodes();
33554 test_ret += test_xmlExpDump();
33555 test_ret += test_xmlExpExpDerive();
33556 test_ret += test_xmlExpGetLanguage();
33557 test_ret += test_xmlExpGetStart();
33558 test_ret += test_xmlExpIsNillable();
33559 test_ret += test_xmlExpMaxToken();
33560 test_ret += test_xmlExpNewAtom();
33561 test_ret += test_xmlExpNewCtxt();
33562 test_ret += test_xmlExpNewOr();
33563 test_ret += test_xmlExpNewRange();
33564 test_ret += test_xmlExpNewSeq();
33565 test_ret += test_xmlExpParse();
33566 test_ret += test_xmlExpRef();
33567 test_ret += test_xmlExpStringDerive();
33568 test_ret += test_xmlExpSubsume();
33569 test_ret += test_xmlRegExecErrInfo();
33570 test_ret += test_xmlRegExecNextValues();
33571 test_ret += test_xmlRegExecPushString();
33572 test_ret += test_xmlRegExecPushString2();
33573 test_ret += test_xmlRegNewExecCtxt();
33574 test_ret += test_xmlRegexpCompile();
33575 test_ret += test_xmlRegexpExec();
33576 test_ret += test_xmlRegexpIsDeterminist();
33577 test_ret += test_xmlRegexpPrint();
33580 printf("Module xmlregexp: %d errors\n", test_ret);
33583 #ifdef LIBXML_OUTPUT_ENABLED
33585 #define gen_nb_xmlSaveCtxtPtr 1
33586 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33589 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33595 test_xmlSaveClose(void) {
33598 #if defined(LIBXML_OUTPUT_ENABLED)
33601 xmlSaveCtxtPtr ctxt; /* a document saving context */
33604 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33605 mem_base = xmlMemBlocks();
33606 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33608 ret_val = xmlSaveClose(ctxt);
33609 desret_int(ret_val);
33611 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33612 xmlResetLastError();
33613 if (mem_base != xmlMemBlocks()) {
33614 printf("Leak of %d blocks found in xmlSaveClose",
33615 xmlMemBlocks() - mem_base);
33617 printf(" %d", n_ctxt);
33629 test_xmlSaveDoc(void) {
33632 #if defined(LIBXML_OUTPUT_ENABLED)
33635 xmlSaveCtxtPtr ctxt; /* a document saving context */
33637 xmlDocPtr doc; /* a document */
33640 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33641 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33642 mem_base = xmlMemBlocks();
33643 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33644 doc = gen_xmlDocPtr(n_doc, 1);
33646 ret_val = xmlSaveDoc(ctxt, doc);
33647 desret_long(ret_val);
33649 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33650 des_xmlDocPtr(n_doc, doc, 1);
33651 xmlResetLastError();
33652 if (mem_base != xmlMemBlocks()) {
33653 printf("Leak of %d blocks found in xmlSaveDoc",
33654 xmlMemBlocks() - mem_base);
33656 printf(" %d", n_ctxt);
33657 printf(" %d", n_doc);
33670 test_xmlSaveFlush(void) {
33673 #if defined(LIBXML_OUTPUT_ENABLED)
33676 xmlSaveCtxtPtr ctxt; /* a document saving context */
33679 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33680 mem_base = xmlMemBlocks();
33681 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33683 ret_val = xmlSaveFlush(ctxt);
33684 desret_int(ret_val);
33686 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33687 xmlResetLastError();
33688 if (mem_base != xmlMemBlocks()) {
33689 printf("Leak of %d blocks found in xmlSaveFlush",
33690 xmlMemBlocks() - mem_base);
33692 printf(" %d", n_ctxt);
33704 test_xmlSaveSetAttrEscape(void) {
33708 /* missing type support */
33714 test_xmlSaveSetEscape(void) {
33718 /* missing type support */
33724 test_xmlSaveToBuffer(void) {
33728 /* missing type support */
33734 test_xmlSaveToFd(void) {
33738 /* missing type support */
33744 test_xmlSaveToFilename(void) {
33748 /* missing type support */
33754 test_xmlSaveTree(void) {
33757 #if defined(LIBXML_OUTPUT_ENABLED)
33760 xmlSaveCtxtPtr ctxt; /* a document saving context */
33762 xmlNodePtr node; /* the top node of the subtree to save */
33765 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33766 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33767 mem_base = xmlMemBlocks();
33768 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33769 node = gen_xmlNodePtr(n_node, 1);
33771 ret_val = xmlSaveTree(ctxt, node);
33772 desret_long(ret_val);
33774 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33775 des_xmlNodePtr(n_node, node, 1);
33776 xmlResetLastError();
33777 if (mem_base != xmlMemBlocks()) {
33778 printf("Leak of %d blocks found in xmlSaveTree",
33779 xmlMemBlocks() - mem_base);
33781 printf(" %d", n_ctxt);
33782 printf(" %d", n_node);
33794 test_xmlsave(void) {
33797 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33798 test_ret += test_xmlSaveClose();
33799 test_ret += test_xmlSaveDoc();
33800 test_ret += test_xmlSaveFlush();
33801 test_ret += test_xmlSaveSetAttrEscape();
33802 test_ret += test_xmlSaveSetEscape();
33803 test_ret += test_xmlSaveToBuffer();
33804 test_ret += test_xmlSaveToFd();
33805 test_ret += test_xmlSaveToFilename();
33806 test_ret += test_xmlSaveTree();
33809 printf("Module xmlsave: %d errors\n", test_ret);
33814 test_xmlSchemaDump(void) {
33817 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33819 FILE * output; /* the file output */
33821 xmlSchemaPtr schema; /* a schema structure */
33824 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33825 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33826 mem_base = xmlMemBlocks();
33827 output = gen_FILE_ptr(n_output, 0);
33828 schema = gen_xmlSchemaPtr(n_schema, 1);
33830 xmlSchemaDump(output, schema);
33832 des_FILE_ptr(n_output, output, 0);
33833 des_xmlSchemaPtr(n_schema, schema, 1);
33834 xmlResetLastError();
33835 if (mem_base != xmlMemBlocks()) {
33836 printf("Leak of %d blocks found in xmlSchemaDump",
33837 xmlMemBlocks() - mem_base);
33839 printf(" %d", n_output);
33840 printf(" %d", n_schema);
33851 #ifdef LIBXML_SCHEMAS_ENABLED
33853 #define gen_nb_xmlSchemaParserCtxtPtr 1
33854 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33857 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33861 #ifdef LIBXML_SCHEMAS_ENABLED
33863 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33864 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33867 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33871 #ifdef LIBXML_SCHEMAS_ENABLED
33873 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33874 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33877 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33883 test_xmlSchemaGetParserErrors(void) {
33886 #if defined(LIBXML_SCHEMAS_ENABLED)
33889 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33891 xmlSchemaValidityErrorFunc * err; /* the error callback result */
33893 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33895 void ** ctx; /* contextual data for the callbacks result */
33898 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33899 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33900 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33901 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33902 mem_base = xmlMemBlocks();
33903 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33904 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33905 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33906 ctx = gen_void_ptr_ptr(n_ctx, 3);
33908 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33909 desret_int(ret_val);
33911 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33912 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33913 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33914 des_void_ptr_ptr(n_ctx, ctx, 3);
33915 xmlResetLastError();
33916 if (mem_base != xmlMemBlocks()) {
33917 printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33918 xmlMemBlocks() - mem_base);
33920 printf(" %d", n_ctxt);
33921 printf(" %d", n_err);
33922 printf(" %d", n_warn);
33923 printf(" %d", n_ctx);
33938 test_xmlSchemaGetValidErrors(void) {
33941 #if defined(LIBXML_SCHEMAS_ENABLED)
33944 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33946 xmlSchemaValidityErrorFunc * err; /* the error function result */
33948 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33950 void ** ctx; /* the functions context result */
33953 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33954 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33955 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33956 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33957 mem_base = xmlMemBlocks();
33958 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33959 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33960 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33961 ctx = gen_void_ptr_ptr(n_ctx, 3);
33963 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33964 desret_int(ret_val);
33966 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33967 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33968 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33969 des_void_ptr_ptr(n_ctx, ctx, 3);
33970 xmlResetLastError();
33971 if (mem_base != xmlMemBlocks()) {
33972 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33973 xmlMemBlocks() - mem_base);
33975 printf(" %d", n_ctxt);
33976 printf(" %d", n_err);
33977 printf(" %d", n_warn);
33978 printf(" %d", n_ctx);
33993 test_xmlSchemaIsValid(void) {
33996 #if defined(LIBXML_SCHEMAS_ENABLED)
33999 xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34002 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34003 mem_base = xmlMemBlocks();
34004 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34006 ret_val = xmlSchemaIsValid(ctxt);
34007 desret_int(ret_val);
34009 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34010 xmlResetLastError();
34011 if (mem_base != xmlMemBlocks()) {
34012 printf("Leak of %d blocks found in xmlSchemaIsValid",
34013 xmlMemBlocks() - mem_base);
34015 printf(" %d", n_ctxt);
34027 test_xmlSchemaNewDocParserCtxt(void) {
34030 #if defined(LIBXML_SCHEMAS_ENABLED)
34032 xmlSchemaParserCtxtPtr ret_val;
34033 xmlDocPtr doc; /* a preparsed document tree */
34036 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34037 mem_base = xmlMemBlocks();
34038 doc = gen_xmlDocPtr(n_doc, 0);
34040 ret_val = xmlSchemaNewDocParserCtxt(doc);
34041 desret_xmlSchemaParserCtxtPtr(ret_val);
34043 des_xmlDocPtr(n_doc, doc, 0);
34044 xmlResetLastError();
34045 if (mem_base != xmlMemBlocks()) {
34046 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34047 xmlMemBlocks() - mem_base);
34049 printf(" %d", n_doc);
34061 test_xmlSchemaNewMemParserCtxt(void) {
34064 #if defined(LIBXML_SCHEMAS_ENABLED)
34066 xmlSchemaParserCtxtPtr ret_val;
34067 char * buffer; /* a pointer to a char array containing the schemas */
34069 int size; /* the size of the array */
34072 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34073 for (n_size = 0;n_size < gen_nb_int;n_size++) {
34074 mem_base = xmlMemBlocks();
34075 buffer = gen_const_char_ptr(n_buffer, 0);
34076 size = gen_int(n_size, 1);
34078 ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34079 desret_xmlSchemaParserCtxtPtr(ret_val);
34081 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34082 des_int(n_size, size, 1);
34083 xmlResetLastError();
34084 if (mem_base != xmlMemBlocks()) {
34085 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34086 xmlMemBlocks() - mem_base);
34088 printf(" %d", n_buffer);
34089 printf(" %d", n_size);
34102 test_xmlSchemaNewParserCtxt(void) {
34105 #if defined(LIBXML_SCHEMAS_ENABLED)
34107 xmlSchemaParserCtxtPtr ret_val;
34108 char * URL; /* the location of the schema */
34111 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34112 mem_base = xmlMemBlocks();
34113 URL = gen_const_char_ptr(n_URL, 0);
34115 ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34116 desret_xmlSchemaParserCtxtPtr(ret_val);
34118 des_const_char_ptr(n_URL, (const char *)URL, 0);
34119 xmlResetLastError();
34120 if (mem_base != xmlMemBlocks()) {
34121 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34122 xmlMemBlocks() - mem_base);
34124 printf(" %d", n_URL);
34136 test_xmlSchemaNewValidCtxt(void) {
34140 /* missing type support */
34146 test_xmlSchemaParse(void) {
34150 /* missing type support */
34154 #ifdef LIBXML_SCHEMAS_ENABLED
34156 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34157 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34160 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34166 test_xmlSchemaSAXPlug(void) {
34170 /* missing type support */
34174 #ifdef LIBXML_SCHEMAS_ENABLED
34176 #define gen_nb_xmlSchemaSAXPlugPtr 1
34177 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34180 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34186 test_xmlSchemaSAXUnplug(void) {
34189 #if defined(LIBXML_SCHEMAS_ENABLED)
34192 xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34195 for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34196 mem_base = xmlMemBlocks();
34197 plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34199 ret_val = xmlSchemaSAXUnplug(plug);
34200 desret_int(ret_val);
34202 des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34203 xmlResetLastError();
34204 if (mem_base != xmlMemBlocks()) {
34205 printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34206 xmlMemBlocks() - mem_base);
34208 printf(" %d", n_plug);
34220 test_xmlSchemaSetParserErrors(void) {
34224 /* missing type support */
34230 test_xmlSchemaSetParserStructuredErrors(void) {
34234 /* missing type support */
34240 test_xmlSchemaSetValidErrors(void) {
34244 /* missing type support */
34250 test_xmlSchemaSetValidOptions(void) {
34253 #if defined(LIBXML_SCHEMAS_ENABLED)
34256 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34258 int options; /* a combination of xmlSchemaValidOption */
34261 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34262 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34263 mem_base = xmlMemBlocks();
34264 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34265 options = gen_int(n_options, 1);
34267 ret_val = xmlSchemaSetValidOptions(ctxt, options);
34268 desret_int(ret_val);
34270 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34271 des_int(n_options, options, 1);
34272 xmlResetLastError();
34273 if (mem_base != xmlMemBlocks()) {
34274 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34275 xmlMemBlocks() - mem_base);
34277 printf(" %d", n_ctxt);
34278 printf(" %d", n_options);
34291 test_xmlSchemaSetValidStructuredErrors(void) {
34295 /* missing type support */
34301 test_xmlSchemaValidCtxtGetOptions(void) {
34304 #if defined(LIBXML_SCHEMAS_ENABLED)
34307 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34310 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34311 mem_base = xmlMemBlocks();
34312 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34314 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34315 desret_int(ret_val);
34317 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34318 xmlResetLastError();
34319 if (mem_base != xmlMemBlocks()) {
34320 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34321 xmlMemBlocks() - mem_base);
34323 printf(" %d", n_ctxt);
34335 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34338 #if defined(LIBXML_SCHEMAS_ENABLED)
34340 xmlParserCtxtPtr ret_val;
34341 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34344 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34345 mem_base = xmlMemBlocks();
34346 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34348 ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34349 desret_xmlParserCtxtPtr(ret_val);
34351 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34352 xmlResetLastError();
34353 if (mem_base != xmlMemBlocks()) {
34354 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34355 xmlMemBlocks() - mem_base);
34357 printf(" %d", n_ctxt);
34369 test_xmlSchemaValidateDoc(void) {
34372 #if defined(LIBXML_SCHEMAS_ENABLED)
34375 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34377 xmlDocPtr doc; /* a parsed document tree */
34380 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34381 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34382 mem_base = xmlMemBlocks();
34383 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34384 doc = gen_xmlDocPtr(n_doc, 1);
34386 ret_val = xmlSchemaValidateDoc(ctxt, doc);
34387 desret_int(ret_val);
34389 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34390 des_xmlDocPtr(n_doc, doc, 1);
34391 xmlResetLastError();
34392 if (mem_base != xmlMemBlocks()) {
34393 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34394 xmlMemBlocks() - mem_base);
34396 printf(" %d", n_ctxt);
34397 printf(" %d", n_doc);
34410 test_xmlSchemaValidateFile(void) {
34413 #if defined(LIBXML_SCHEMAS_ENABLED)
34416 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34418 const char * filename; /* the URI of the instance */
34420 int options; /* a future set of options, currently unused */
34423 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34424 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34425 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34426 mem_base = xmlMemBlocks();
34427 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34428 filename = gen_filepath(n_filename, 1);
34429 options = gen_int(n_options, 2);
34431 ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34432 desret_int(ret_val);
34434 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34435 des_filepath(n_filename, filename, 1);
34436 des_int(n_options, options, 2);
34437 xmlResetLastError();
34438 if (mem_base != xmlMemBlocks()) {
34439 printf("Leak of %d blocks found in xmlSchemaValidateFile",
34440 xmlMemBlocks() - mem_base);
34442 printf(" %d", n_ctxt);
34443 printf(" %d", n_filename);
34444 printf(" %d", n_options);
34458 test_xmlSchemaValidateOneElement(void) {
34461 #if defined(LIBXML_SCHEMAS_ENABLED)
34464 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34466 xmlNodePtr elem; /* an element node */
34469 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34470 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34471 mem_base = xmlMemBlocks();
34472 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34473 elem = gen_xmlNodePtr(n_elem, 1);
34475 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34476 desret_int(ret_val);
34478 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34479 des_xmlNodePtr(n_elem, elem, 1);
34480 xmlResetLastError();
34481 if (mem_base != xmlMemBlocks()) {
34482 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34483 xmlMemBlocks() - mem_base);
34485 printf(" %d", n_ctxt);
34486 printf(" %d", n_elem);
34499 test_xmlSchemaValidateStream(void) {
34502 #if defined(LIBXML_SCHEMAS_ENABLED)
34505 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34507 xmlParserInputBufferPtr input; /* the input to use for reading the data */
34509 xmlCharEncoding enc; /* an optional encoding information */
34511 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34513 void * user_data; /* the context to provide to the SAX handler. */
34516 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34517 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34518 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34519 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34520 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34521 mem_base = xmlMemBlocks();
34522 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34523 input = gen_xmlParserInputBufferPtr(n_input, 1);
34524 enc = gen_xmlCharEncoding(n_enc, 2);
34525 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34526 user_data = gen_userdata(n_user_data, 4);
34528 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34529 desret_int(ret_val);
34531 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34532 des_xmlParserInputBufferPtr(n_input, input, 1);
34533 des_xmlCharEncoding(n_enc, enc, 2);
34534 des_xmlSAXHandlerPtr(n_sax, sax, 3);
34535 des_userdata(n_user_data, user_data, 4);
34536 xmlResetLastError();
34537 if (mem_base != xmlMemBlocks()) {
34538 printf("Leak of %d blocks found in xmlSchemaValidateStream",
34539 xmlMemBlocks() - mem_base);
34541 printf(" %d", n_ctxt);
34542 printf(" %d", n_input);
34543 printf(" %d", n_enc);
34544 printf(" %d", n_sax);
34545 printf(" %d", n_user_data);
34560 test_xmlschemas(void) {
34563 if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34564 test_ret += test_xmlSchemaDump();
34565 test_ret += test_xmlSchemaGetParserErrors();
34566 test_ret += test_xmlSchemaGetValidErrors();
34567 test_ret += test_xmlSchemaIsValid();
34568 test_ret += test_xmlSchemaNewDocParserCtxt();
34569 test_ret += test_xmlSchemaNewMemParserCtxt();
34570 test_ret += test_xmlSchemaNewParserCtxt();
34571 test_ret += test_xmlSchemaNewValidCtxt();
34572 test_ret += test_xmlSchemaParse();
34573 test_ret += test_xmlSchemaSAXPlug();
34574 test_ret += test_xmlSchemaSAXUnplug();
34575 test_ret += test_xmlSchemaSetParserErrors();
34576 test_ret += test_xmlSchemaSetParserStructuredErrors();
34577 test_ret += test_xmlSchemaSetValidErrors();
34578 test_ret += test_xmlSchemaSetValidOptions();
34579 test_ret += test_xmlSchemaSetValidStructuredErrors();
34580 test_ret += test_xmlSchemaValidCtxtGetOptions();
34581 test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34582 test_ret += test_xmlSchemaValidateDoc();
34583 test_ret += test_xmlSchemaValidateFile();
34584 test_ret += test_xmlSchemaValidateOneElement();
34585 test_ret += test_xmlSchemaValidateStream();
34588 printf("Module xmlschemas: %d errors\n", test_ret);
34591 #ifdef LIBXML_SCHEMAS_ENABLED
34593 #define gen_nb_xmlSchemaFacetPtr 1
34594 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34597 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34601 #ifdef LIBXML_SCHEMAS_ENABLED
34603 #define gen_nb_xmlSchemaTypePtr 1
34604 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34607 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34613 test_xmlSchemaCheckFacet(void) {
34616 #if defined(LIBXML_SCHEMAS_ENABLED)
34619 xmlSchemaFacetPtr facet; /* the facet */
34621 xmlSchemaTypePtr typeDecl; /* the schema type definition */
34623 xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34625 xmlChar * name; /* the optional name of the type */
34628 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34629 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34630 for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34631 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34632 mem_base = xmlMemBlocks();
34633 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34634 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34635 pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34636 name = gen_const_xmlChar_ptr(n_name, 3);
34638 ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34639 desret_int(ret_val);
34641 des_xmlSchemaFacetPtr(n_facet, facet, 0);
34642 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34643 des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34644 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34645 xmlResetLastError();
34646 if (mem_base != xmlMemBlocks()) {
34647 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34648 xmlMemBlocks() - mem_base);
34650 printf(" %d", n_facet);
34651 printf(" %d", n_typeDecl);
34652 printf(" %d", n_pctxt);
34653 printf(" %d", n_name);
34668 test_xmlSchemaCleanupTypes(void) {
34671 #if defined(LIBXML_SCHEMAS_ENABLED)
34674 xmlSchemaCleanupTypes();
34676 xmlResetLastError();
34685 test_xmlSchemaCollapseString(void) {
34688 #if defined(LIBXML_SCHEMAS_ENABLED)
34691 xmlChar * value; /* a value */
34694 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34695 mem_base = xmlMemBlocks();
34696 value = gen_const_xmlChar_ptr(n_value, 0);
34698 ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34699 desret_xmlChar_ptr(ret_val);
34701 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34702 xmlResetLastError();
34703 if (mem_base != xmlMemBlocks()) {
34704 printf("Leak of %d blocks found in xmlSchemaCollapseString",
34705 xmlMemBlocks() - mem_base);
34707 printf(" %d", n_value);
34717 #ifdef LIBXML_SCHEMAS_ENABLED
34719 #define gen_nb_xmlSchemaValPtr 1
34720 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34723 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34729 test_xmlSchemaCompareValues(void) {
34732 #if defined(LIBXML_SCHEMAS_ENABLED)
34735 xmlSchemaValPtr x; /* a first value */
34737 xmlSchemaValPtr y; /* a second value */
34740 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34741 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34742 mem_base = xmlMemBlocks();
34743 x = gen_xmlSchemaValPtr(n_x, 0);
34744 y = gen_xmlSchemaValPtr(n_y, 1);
34746 ret_val = xmlSchemaCompareValues(x, y);
34747 desret_int(ret_val);
34749 des_xmlSchemaValPtr(n_x, x, 0);
34750 des_xmlSchemaValPtr(n_y, y, 1);
34751 xmlResetLastError();
34752 if (mem_base != xmlMemBlocks()) {
34753 printf("Leak of %d blocks found in xmlSchemaCompareValues",
34754 xmlMemBlocks() - mem_base);
34756 printf(" %d", n_x);
34757 printf(" %d", n_y);
34770 test_xmlSchemaCompareValuesWhtsp(void) {
34773 #if defined(LIBXML_SCHEMAS_ENABLED)
34776 xmlSchemaValPtr x; /* a first value */
34778 xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34780 xmlSchemaValPtr y; /* a second value */
34782 xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34785 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34786 for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34787 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34788 for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34789 mem_base = xmlMemBlocks();
34790 x = gen_xmlSchemaValPtr(n_x, 0);
34791 xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34792 y = gen_xmlSchemaValPtr(n_y, 2);
34793 yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34795 ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34796 desret_int(ret_val);
34798 des_xmlSchemaValPtr(n_x, x, 0);
34799 des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34800 des_xmlSchemaValPtr(n_y, y, 2);
34801 des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34802 xmlResetLastError();
34803 if (mem_base != xmlMemBlocks()) {
34804 printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34805 xmlMemBlocks() - mem_base);
34807 printf(" %d", n_x);
34808 printf(" %d", n_xws);
34809 printf(" %d", n_y);
34810 printf(" %d", n_yws);
34825 test_xmlSchemaCopyValue(void) {
34829 /* missing type support */
34835 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34838 #if defined(LIBXML_SCHEMAS_ENABLED)
34840 xmlSchemaTypePtr ret_val;
34841 xmlSchemaTypePtr type; /* the built-in simple type. */
34844 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34845 mem_base = xmlMemBlocks();
34846 type = gen_xmlSchemaTypePtr(n_type, 0);
34848 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34849 desret_xmlSchemaTypePtr(ret_val);
34851 des_xmlSchemaTypePtr(n_type, type, 0);
34852 xmlResetLastError();
34853 if (mem_base != xmlMemBlocks()) {
34854 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34855 xmlMemBlocks() - mem_base);
34857 printf(" %d", n_type);
34869 test_xmlSchemaGetBuiltInType(void) {
34872 #if defined(LIBXML_SCHEMAS_ENABLED)
34873 xmlSchemaTypePtr ret_val;
34874 xmlSchemaValType type; /* the type of the built in type */
34877 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34878 type = gen_xmlSchemaValType(n_type, 0);
34880 ret_val = xmlSchemaGetBuiltInType(type);
34881 desret_xmlSchemaTypePtr(ret_val);
34883 des_xmlSchemaValType(n_type, type, 0);
34884 xmlResetLastError();
34894 test_xmlSchemaGetCanonValue(void) {
34897 #if defined(LIBXML_SCHEMAS_ENABLED)
34900 xmlSchemaValPtr val; /* the precomputed value */
34902 xmlChar ** retValue; /* the returned value */
34905 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34906 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34907 mem_base = xmlMemBlocks();
34908 val = gen_xmlSchemaValPtr(n_val, 0);
34909 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34911 ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34912 desret_int(ret_val);
34914 des_xmlSchemaValPtr(n_val, val, 0);
34915 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34916 xmlResetLastError();
34917 if (mem_base != xmlMemBlocks()) {
34918 printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34919 xmlMemBlocks() - mem_base);
34921 printf(" %d", n_val);
34922 printf(" %d", n_retValue);
34935 test_xmlSchemaGetCanonValueWhtsp(void) {
34938 #if defined(LIBXML_SCHEMAS_ENABLED)
34941 xmlSchemaValPtr val; /* the precomputed value */
34943 xmlChar ** retValue; /* the returned value */
34945 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34948 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34949 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34950 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34951 mem_base = xmlMemBlocks();
34952 val = gen_xmlSchemaValPtr(n_val, 0);
34953 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34954 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34956 ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34957 desret_int(ret_val);
34959 des_xmlSchemaValPtr(n_val, val, 0);
34960 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34961 des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34962 xmlResetLastError();
34963 if (mem_base != xmlMemBlocks()) {
34964 printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34965 xmlMemBlocks() - mem_base);
34967 printf(" %d", n_val);
34968 printf(" %d", n_retValue);
34969 printf(" %d", n_ws);
34983 test_xmlSchemaGetFacetValueAsULong(void) {
34986 #if defined(LIBXML_SCHEMAS_ENABLED)
34988 unsigned long ret_val;
34989 xmlSchemaFacetPtr facet; /* an schemas type facet */
34992 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34993 mem_base = xmlMemBlocks();
34994 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34996 ret_val = xmlSchemaGetFacetValueAsULong(facet);
34997 desret_unsigned_long(ret_val);
34999 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35000 xmlResetLastError();
35001 if (mem_base != xmlMemBlocks()) {
35002 printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35003 xmlMemBlocks() - mem_base);
35005 printf(" %d", n_facet);
35017 test_xmlSchemaGetPredefinedType(void) {
35020 #if defined(LIBXML_SCHEMAS_ENABLED)
35022 xmlSchemaTypePtr ret_val;
35023 xmlChar * name; /* the type name */
35025 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35028 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35029 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35030 mem_base = xmlMemBlocks();
35031 name = gen_const_xmlChar_ptr(n_name, 0);
35032 ns = gen_const_xmlChar_ptr(n_ns, 1);
35034 ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35035 desret_xmlSchemaTypePtr(ret_val);
35037 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35038 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35039 xmlResetLastError();
35040 if (mem_base != xmlMemBlocks()) {
35041 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35042 xmlMemBlocks() - mem_base);
35044 printf(" %d", n_name);
35045 printf(" %d", n_ns);
35058 test_xmlSchemaGetValType(void) {
35061 #if defined(LIBXML_SCHEMAS_ENABLED)
35063 xmlSchemaValType ret_val;
35064 xmlSchemaValPtr val; /* a schemas value */
35067 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35068 mem_base = xmlMemBlocks();
35069 val = gen_xmlSchemaValPtr(n_val, 0);
35071 ret_val = xmlSchemaGetValType(val);
35072 desret_xmlSchemaValType(ret_val);
35074 des_xmlSchemaValPtr(n_val, val, 0);
35075 xmlResetLastError();
35076 if (mem_base != xmlMemBlocks()) {
35077 printf("Leak of %d blocks found in xmlSchemaGetValType",
35078 xmlMemBlocks() - mem_base);
35080 printf(" %d", n_val);
35092 test_xmlSchemaInitTypes(void) {
35095 #if defined(LIBXML_SCHEMAS_ENABLED)
35098 xmlSchemaInitTypes();
35100 xmlResetLastError();
35109 test_xmlSchemaIsBuiltInTypeFacet(void) {
35112 #if defined(LIBXML_SCHEMAS_ENABLED)
35115 xmlSchemaTypePtr type; /* the built-in type */
35117 int facetType; /* the facet type */
35120 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35121 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35122 mem_base = xmlMemBlocks();
35123 type = gen_xmlSchemaTypePtr(n_type, 0);
35124 facetType = gen_int(n_facetType, 1);
35126 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35127 desret_int(ret_val);
35129 des_xmlSchemaTypePtr(n_type, type, 0);
35130 des_int(n_facetType, facetType, 1);
35131 xmlResetLastError();
35132 if (mem_base != xmlMemBlocks()) {
35133 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35134 xmlMemBlocks() - mem_base);
35136 printf(" %d", n_type);
35137 printf(" %d", n_facetType);
35150 test_xmlSchemaNewFacet(void) {
35154 /* missing type support */
35160 test_xmlSchemaNewNOTATIONValue(void) {
35164 /* missing type support */
35170 test_xmlSchemaNewQNameValue(void) {
35174 /* missing type support */
35180 test_xmlSchemaNewStringValue(void) {
35184 /* missing type support */
35188 #ifdef LIBXML_SCHEMAS_ENABLED
35190 #define gen_nb_xmlSchemaValPtr_ptr 1
35191 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35194 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35200 test_xmlSchemaValPredefTypeNode(void) {
35203 #if defined(LIBXML_SCHEMAS_ENABLED)
35206 xmlSchemaTypePtr type; /* the predefined type */
35208 xmlChar * value; /* the value to check */
35210 xmlSchemaValPtr * val; /* the return computed value */
35212 xmlNodePtr node; /* the node containing the value */
35215 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35216 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35217 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35218 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35219 mem_base = xmlMemBlocks();
35220 type = gen_xmlSchemaTypePtr(n_type, 0);
35221 value = gen_const_xmlChar_ptr(n_value, 1);
35222 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35223 node = gen_xmlNodePtr(n_node, 3);
35225 ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35226 desret_int(ret_val);
35228 des_xmlSchemaTypePtr(n_type, type, 0);
35229 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35230 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35231 des_xmlNodePtr(n_node, node, 3);
35232 xmlResetLastError();
35233 if (mem_base != xmlMemBlocks()) {
35234 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35235 xmlMemBlocks() - mem_base);
35237 printf(" %d", n_type);
35238 printf(" %d", n_value);
35239 printf(" %d", n_val);
35240 printf(" %d", n_node);
35255 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35258 #if defined(LIBXML_SCHEMAS_ENABLED)
35261 xmlSchemaTypePtr type; /* the predefined type */
35263 xmlChar * value; /* the value to check */
35265 xmlSchemaValPtr * val; /* the return computed value */
35267 xmlNodePtr node; /* the node containing the value */
35270 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35271 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35272 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35273 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35274 mem_base = xmlMemBlocks();
35275 type = gen_xmlSchemaTypePtr(n_type, 0);
35276 value = gen_const_xmlChar_ptr(n_value, 1);
35277 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35278 node = gen_xmlNodePtr(n_node, 3);
35280 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35281 desret_int(ret_val);
35283 des_xmlSchemaTypePtr(n_type, type, 0);
35284 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35285 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35286 des_xmlNodePtr(n_node, node, 3);
35287 xmlResetLastError();
35288 if (mem_base != xmlMemBlocks()) {
35289 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35290 xmlMemBlocks() - mem_base);
35292 printf(" %d", n_type);
35293 printf(" %d", n_value);
35294 printf(" %d", n_val);
35295 printf(" %d", n_node);
35310 test_xmlSchemaValidateFacet(void) {
35313 #if defined(LIBXML_SCHEMAS_ENABLED)
35316 xmlSchemaTypePtr base; /* the base type */
35318 xmlSchemaFacetPtr facet; /* the facet to check */
35320 xmlChar * value; /* the lexical repr of the value to validate */
35322 xmlSchemaValPtr val; /* the precomputed value */
35325 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35326 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35327 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35328 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35329 mem_base = xmlMemBlocks();
35330 base = gen_xmlSchemaTypePtr(n_base, 0);
35331 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35332 value = gen_const_xmlChar_ptr(n_value, 2);
35333 val = gen_xmlSchemaValPtr(n_val, 3);
35335 ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35336 desret_int(ret_val);
35338 des_xmlSchemaTypePtr(n_base, base, 0);
35339 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35340 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35341 des_xmlSchemaValPtr(n_val, val, 3);
35342 xmlResetLastError();
35343 if (mem_base != xmlMemBlocks()) {
35344 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35345 xmlMemBlocks() - mem_base);
35347 printf(" %d", n_base);
35348 printf(" %d", n_facet);
35349 printf(" %d", n_value);
35350 printf(" %d", n_val);
35365 test_xmlSchemaValidateFacetWhtsp(void) {
35368 #if defined(LIBXML_SCHEMAS_ENABLED)
35371 xmlSchemaFacetPtr facet; /* the facet to check */
35373 xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35375 xmlSchemaValType valType; /* the built-in type of the value */
35377 xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35379 xmlSchemaValPtr val; /* the precomputed value */
35381 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35384 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35385 for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35386 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35387 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35388 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35389 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35390 mem_base = xmlMemBlocks();
35391 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35392 fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35393 valType = gen_xmlSchemaValType(n_valType, 2);
35394 value = gen_const_xmlChar_ptr(n_value, 3);
35395 val = gen_xmlSchemaValPtr(n_val, 4);
35396 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35398 ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35399 desret_int(ret_val);
35401 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35402 des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35403 des_xmlSchemaValType(n_valType, valType, 2);
35404 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35405 des_xmlSchemaValPtr(n_val, val, 4);
35406 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35407 xmlResetLastError();
35408 if (mem_base != xmlMemBlocks()) {
35409 printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35410 xmlMemBlocks() - mem_base);
35412 printf(" %d", n_facet);
35413 printf(" %d", n_fws);
35414 printf(" %d", n_valType);
35415 printf(" %d", n_value);
35416 printf(" %d", n_val);
35417 printf(" %d", n_ws);
35434 test_xmlSchemaValidateLengthFacet(void) {
35437 #if defined(LIBXML_SCHEMAS_ENABLED)
35440 xmlSchemaTypePtr type; /* the built-in type */
35442 xmlSchemaFacetPtr facet; /* the facet to check */
35444 xmlChar * value; /* the lexical repr. of the value to be validated */
35446 xmlSchemaValPtr val; /* the precomputed value */
35448 unsigned long * length; /* the actual length of the value */
35451 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35452 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35453 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35454 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35455 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35456 mem_base = xmlMemBlocks();
35457 type = gen_xmlSchemaTypePtr(n_type, 0);
35458 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35459 value = gen_const_xmlChar_ptr(n_value, 2);
35460 val = gen_xmlSchemaValPtr(n_val, 3);
35461 length = gen_unsigned_long_ptr(n_length, 4);
35463 ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35464 desret_int(ret_val);
35466 des_xmlSchemaTypePtr(n_type, type, 0);
35467 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35468 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35469 des_xmlSchemaValPtr(n_val, val, 3);
35470 des_unsigned_long_ptr(n_length, length, 4);
35471 xmlResetLastError();
35472 if (mem_base != xmlMemBlocks()) {
35473 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35474 xmlMemBlocks() - mem_base);
35476 printf(" %d", n_type);
35477 printf(" %d", n_facet);
35478 printf(" %d", n_value);
35479 printf(" %d", n_val);
35480 printf(" %d", n_length);
35496 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35499 #if defined(LIBXML_SCHEMAS_ENABLED)
35502 xmlSchemaFacetPtr facet; /* the facet to check */
35504 xmlSchemaValType valType; /* the built-in type */
35506 xmlChar * value; /* the lexical repr. of the value to be validated */
35508 xmlSchemaValPtr val; /* the precomputed value */
35510 unsigned long * length; /* the actual length of the value */
35512 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35515 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35516 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35517 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35518 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35519 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35520 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35521 mem_base = xmlMemBlocks();
35522 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35523 valType = gen_xmlSchemaValType(n_valType, 1);
35524 value = gen_const_xmlChar_ptr(n_value, 2);
35525 val = gen_xmlSchemaValPtr(n_val, 3);
35526 length = gen_unsigned_long_ptr(n_length, 4);
35527 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35529 ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35530 desret_int(ret_val);
35532 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35533 des_xmlSchemaValType(n_valType, valType, 1);
35534 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35535 des_xmlSchemaValPtr(n_val, val, 3);
35536 des_unsigned_long_ptr(n_length, length, 4);
35537 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35538 xmlResetLastError();
35539 if (mem_base != xmlMemBlocks()) {
35540 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35541 xmlMemBlocks() - mem_base);
35543 printf(" %d", n_facet);
35544 printf(" %d", n_valType);
35545 printf(" %d", n_value);
35546 printf(" %d", n_val);
35547 printf(" %d", n_length);
35548 printf(" %d", n_ws);
35565 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35568 #if defined(LIBXML_SCHEMAS_ENABLED)
35571 xmlSchemaFacetPtr facet; /* the facet to check */
35573 xmlChar * value; /* the lexical repr of the value to validate */
35575 unsigned long actualLen; /* the number of list items */
35577 unsigned long * expectedLen; /* the resulting expected number of list items */
35580 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35581 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35582 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35583 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35584 mem_base = xmlMemBlocks();
35585 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35586 value = gen_const_xmlChar_ptr(n_value, 1);
35587 actualLen = gen_unsigned_long(n_actualLen, 2);
35588 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35590 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35591 desret_int(ret_val);
35593 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35594 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35595 des_unsigned_long(n_actualLen, actualLen, 2);
35596 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35597 xmlResetLastError();
35598 if (mem_base != xmlMemBlocks()) {
35599 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35600 xmlMemBlocks() - mem_base);
35602 printf(" %d", n_facet);
35603 printf(" %d", n_value);
35604 printf(" %d", n_actualLen);
35605 printf(" %d", n_expectedLen);
35620 test_xmlSchemaValidatePredefinedType(void) {
35623 #if defined(LIBXML_SCHEMAS_ENABLED)
35626 xmlSchemaTypePtr type; /* the predefined type */
35628 xmlChar * value; /* the value to check */
35630 xmlSchemaValPtr * val; /* the return computed value */
35633 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35634 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35635 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35636 mem_base = xmlMemBlocks();
35637 type = gen_xmlSchemaTypePtr(n_type, 0);
35638 value = gen_const_xmlChar_ptr(n_value, 1);
35639 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35641 ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35642 desret_int(ret_val);
35644 des_xmlSchemaTypePtr(n_type, type, 0);
35645 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35646 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35647 xmlResetLastError();
35648 if (mem_base != xmlMemBlocks()) {
35649 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35650 xmlMemBlocks() - mem_base);
35652 printf(" %d", n_type);
35653 printf(" %d", n_value);
35654 printf(" %d", n_val);
35668 test_xmlSchemaValueAppend(void) {
35671 #if defined(LIBXML_SCHEMAS_ENABLED)
35674 xmlSchemaValPtr prev; /* the value */
35676 xmlSchemaValPtr cur; /* the value to be appended */
35679 for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35680 for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35681 mem_base = xmlMemBlocks();
35682 prev = gen_xmlSchemaValPtr(n_prev, 0);
35683 cur = gen_xmlSchemaValPtr(n_cur, 1);
35685 ret_val = xmlSchemaValueAppend(prev, cur);
35686 desret_int(ret_val);
35688 des_xmlSchemaValPtr(n_prev, prev, 0);
35689 des_xmlSchemaValPtr(n_cur, cur, 1);
35690 xmlResetLastError();
35691 if (mem_base != xmlMemBlocks()) {
35692 printf("Leak of %d blocks found in xmlSchemaValueAppend",
35693 xmlMemBlocks() - mem_base);
35695 printf(" %d", n_prev);
35696 printf(" %d", n_cur);
35709 test_xmlSchemaValueGetAsBoolean(void) {
35712 #if defined(LIBXML_SCHEMAS_ENABLED)
35715 xmlSchemaValPtr val; /* the value */
35718 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35719 mem_base = xmlMemBlocks();
35720 val = gen_xmlSchemaValPtr(n_val, 0);
35722 ret_val = xmlSchemaValueGetAsBoolean(val);
35723 desret_int(ret_val);
35725 des_xmlSchemaValPtr(n_val, val, 0);
35726 xmlResetLastError();
35727 if (mem_base != xmlMemBlocks()) {
35728 printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35729 xmlMemBlocks() - mem_base);
35731 printf(" %d", n_val);
35743 test_xmlSchemaValueGetAsString(void) {
35746 #if defined(LIBXML_SCHEMAS_ENABLED)
35748 const xmlChar * ret_val;
35749 xmlSchemaValPtr val; /* the value */
35752 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35753 mem_base = xmlMemBlocks();
35754 val = gen_xmlSchemaValPtr(n_val, 0);
35756 ret_val = xmlSchemaValueGetAsString(val);
35757 desret_const_xmlChar_ptr(ret_val);
35759 des_xmlSchemaValPtr(n_val, val, 0);
35760 xmlResetLastError();
35761 if (mem_base != xmlMemBlocks()) {
35762 printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35763 xmlMemBlocks() - mem_base);
35765 printf(" %d", n_val);
35777 test_xmlSchemaValueGetNext(void) {
35781 /* missing type support */
35787 test_xmlSchemaWhiteSpaceReplace(void) {
35790 #if defined(LIBXML_SCHEMAS_ENABLED)
35793 xmlChar * value; /* a value */
35796 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35797 mem_base = xmlMemBlocks();
35798 value = gen_const_xmlChar_ptr(n_value, 0);
35800 ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35801 desret_xmlChar_ptr(ret_val);
35803 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35804 xmlResetLastError();
35805 if (mem_base != xmlMemBlocks()) {
35806 printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35807 xmlMemBlocks() - mem_base);
35809 printf(" %d", n_value);
35820 test_xmlschemastypes(void) {
35823 if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35824 test_ret += test_xmlSchemaCheckFacet();
35825 test_ret += test_xmlSchemaCleanupTypes();
35826 test_ret += test_xmlSchemaCollapseString();
35827 test_ret += test_xmlSchemaCompareValues();
35828 test_ret += test_xmlSchemaCompareValuesWhtsp();
35829 test_ret += test_xmlSchemaCopyValue();
35830 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35831 test_ret += test_xmlSchemaGetBuiltInType();
35832 test_ret += test_xmlSchemaGetCanonValue();
35833 test_ret += test_xmlSchemaGetCanonValueWhtsp();
35834 test_ret += test_xmlSchemaGetFacetValueAsULong();
35835 test_ret += test_xmlSchemaGetPredefinedType();
35836 test_ret += test_xmlSchemaGetValType();
35837 test_ret += test_xmlSchemaInitTypes();
35838 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35839 test_ret += test_xmlSchemaNewFacet();
35840 test_ret += test_xmlSchemaNewNOTATIONValue();
35841 test_ret += test_xmlSchemaNewQNameValue();
35842 test_ret += test_xmlSchemaNewStringValue();
35843 test_ret += test_xmlSchemaValPredefTypeNode();
35844 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35845 test_ret += test_xmlSchemaValidateFacet();
35846 test_ret += test_xmlSchemaValidateFacetWhtsp();
35847 test_ret += test_xmlSchemaValidateLengthFacet();
35848 test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35849 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35850 test_ret += test_xmlSchemaValidatePredefinedType();
35851 test_ret += test_xmlSchemaValueAppend();
35852 test_ret += test_xmlSchemaValueGetAsBoolean();
35853 test_ret += test_xmlSchemaValueGetAsString();
35854 test_ret += test_xmlSchemaValueGetNext();
35855 test_ret += test_xmlSchemaWhiteSpaceReplace();
35858 printf("Module xmlschemastypes: %d errors\n", test_ret);
35863 test_xmlCharStrdup(void) {
35868 char * cur; /* the input char * */
35871 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35872 mem_base = xmlMemBlocks();
35873 cur = gen_const_char_ptr(n_cur, 0);
35875 ret_val = xmlCharStrdup((const char *)cur);
35876 desret_xmlChar_ptr(ret_val);
35878 des_const_char_ptr(n_cur, (const char *)cur, 0);
35879 xmlResetLastError();
35880 if (mem_base != xmlMemBlocks()) {
35881 printf("Leak of %d blocks found in xmlCharStrdup",
35882 xmlMemBlocks() - mem_base);
35884 printf(" %d", n_cur);
35895 test_xmlCharStrndup(void) {
35900 char * cur; /* the input char * */
35902 int len; /* the len of @cur */
35905 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35906 for (n_len = 0;n_len < gen_nb_int;n_len++) {
35907 mem_base = xmlMemBlocks();
35908 cur = gen_const_char_ptr(n_cur, 0);
35909 len = gen_int(n_len, 1);
35911 ret_val = xmlCharStrndup((const char *)cur, len);
35912 desret_xmlChar_ptr(ret_val);
35914 des_const_char_ptr(n_cur, (const char *)cur, 0);
35915 des_int(n_len, len, 1);
35916 xmlResetLastError();
35917 if (mem_base != xmlMemBlocks()) {
35918 printf("Leak of %d blocks found in xmlCharStrndup",
35919 xmlMemBlocks() - mem_base);
35921 printf(" %d", n_cur);
35922 printf(" %d", n_len);
35934 test_xmlCheckUTF8(void) {
35939 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35942 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35943 mem_base = xmlMemBlocks();
35944 utf = gen_const_unsigned_char_ptr(n_utf, 0);
35946 ret_val = xmlCheckUTF8((const unsigned char *)utf);
35947 desret_int(ret_val);
35949 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35950 xmlResetLastError();
35951 if (mem_base != xmlMemBlocks()) {
35952 printf("Leak of %d blocks found in xmlCheckUTF8",
35953 xmlMemBlocks() - mem_base);
35955 printf(" %d", n_utf);
35966 test_xmlGetUTF8Char(void) {
35971 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35973 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. */
35976 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35977 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35978 mem_base = xmlMemBlocks();
35979 utf = gen_const_unsigned_char_ptr(n_utf, 0);
35980 len = gen_int_ptr(n_len, 1);
35982 ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35983 desret_int(ret_val);
35985 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35986 des_int_ptr(n_len, len, 1);
35987 xmlResetLastError();
35988 if (mem_base != xmlMemBlocks()) {
35989 printf("Leak of %d blocks found in xmlGetUTF8Char",
35990 xmlMemBlocks() - mem_base);
35992 printf(" %d", n_utf);
35993 printf(" %d", n_len);
36005 test_xmlStrEqual(void) {
36010 xmlChar * str1; /* the first xmlChar * */
36012 xmlChar * str2; /* the second xmlChar * */
36015 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36016 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36017 mem_base = xmlMemBlocks();
36018 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36019 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36021 ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36022 desret_int(ret_val);
36024 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36025 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36026 xmlResetLastError();
36027 if (mem_base != xmlMemBlocks()) {
36028 printf("Leak of %d blocks found in xmlStrEqual",
36029 xmlMemBlocks() - mem_base);
36031 printf(" %d", n_str1);
36032 printf(" %d", n_str2);
36044 test_xmlStrPrintf(void) {
36048 /* missing type support */
36054 test_xmlStrQEqual(void) {
36059 xmlChar * pref; /* the prefix of the QName */
36061 xmlChar * name; /* the localname of the QName */
36063 xmlChar * str; /* the second xmlChar * */
36066 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36067 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36068 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36069 mem_base = xmlMemBlocks();
36070 pref = gen_const_xmlChar_ptr(n_pref, 0);
36071 name = gen_const_xmlChar_ptr(n_name, 1);
36072 str = gen_const_xmlChar_ptr(n_str, 2);
36074 ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36075 desret_int(ret_val);
36077 des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36078 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36079 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36080 xmlResetLastError();
36081 if (mem_base != xmlMemBlocks()) {
36082 printf("Leak of %d blocks found in xmlStrQEqual",
36083 xmlMemBlocks() - mem_base);
36085 printf(" %d", n_pref);
36086 printf(" %d", n_name);
36087 printf(" %d", n_str);
36100 test_xmlStrVPrintf(void) {
36104 /* missing type support */
36110 test_xmlStrcasecmp(void) {
36115 xmlChar * str1; /* the first xmlChar * */
36117 xmlChar * str2; /* the second xmlChar * */
36120 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36121 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36122 mem_base = xmlMemBlocks();
36123 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36124 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36126 ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36127 desret_int(ret_val);
36129 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36130 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36131 xmlResetLastError();
36132 if (mem_base != xmlMemBlocks()) {
36133 printf("Leak of %d blocks found in xmlStrcasecmp",
36134 xmlMemBlocks() - mem_base);
36136 printf(" %d", n_str1);
36137 printf(" %d", n_str2);
36149 test_xmlStrcasestr(void) {
36153 const xmlChar * ret_val;
36154 xmlChar * str; /* the xmlChar * array (haystack) */
36156 xmlChar * val; /* the xmlChar to search (needle) */
36159 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36160 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36161 mem_base = xmlMemBlocks();
36162 str = gen_const_xmlChar_ptr(n_str, 0);
36163 val = gen_const_xmlChar_ptr(n_val, 1);
36165 ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36166 desret_const_xmlChar_ptr(ret_val);
36168 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36169 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36170 xmlResetLastError();
36171 if (mem_base != xmlMemBlocks()) {
36172 printf("Leak of %d blocks found in xmlStrcasestr",
36173 xmlMemBlocks() - mem_base);
36175 printf(" %d", n_str);
36176 printf(" %d", n_val);
36188 test_xmlStrchr(void) {
36192 const xmlChar * ret_val;
36193 xmlChar * str; /* the xmlChar * array */
36195 xmlChar val; /* the xmlChar to search */
36198 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36199 for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36200 mem_base = xmlMemBlocks();
36201 str = gen_const_xmlChar_ptr(n_str, 0);
36202 val = gen_xmlChar(n_val, 1);
36204 ret_val = xmlStrchr((const xmlChar *)str, val);
36205 desret_const_xmlChar_ptr(ret_val);
36207 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36208 des_xmlChar(n_val, val, 1);
36209 xmlResetLastError();
36210 if (mem_base != xmlMemBlocks()) {
36211 printf("Leak of %d blocks found in xmlStrchr",
36212 xmlMemBlocks() - mem_base);
36214 printf(" %d", n_str);
36215 printf(" %d", n_val);
36227 test_xmlStrcmp(void) {
36232 xmlChar * str1; /* the first xmlChar * */
36234 xmlChar * str2; /* the second xmlChar * */
36237 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36238 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36239 mem_base = xmlMemBlocks();
36240 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36241 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36243 ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36244 desret_int(ret_val);
36246 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36247 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36248 xmlResetLastError();
36249 if (mem_base != xmlMemBlocks()) {
36250 printf("Leak of %d blocks found in xmlStrcmp",
36251 xmlMemBlocks() - mem_base);
36253 printf(" %d", n_str1);
36254 printf(" %d", n_str2);
36266 test_xmlStrdup(void) {
36271 xmlChar * cur; /* the input xmlChar * */
36274 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36275 mem_base = xmlMemBlocks();
36276 cur = gen_const_xmlChar_ptr(n_cur, 0);
36278 ret_val = xmlStrdup((const xmlChar *)cur);
36279 desret_xmlChar_ptr(ret_val);
36281 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36282 xmlResetLastError();
36283 if (mem_base != xmlMemBlocks()) {
36284 printf("Leak of %d blocks found in xmlStrdup",
36285 xmlMemBlocks() - mem_base);
36287 printf(" %d", n_cur);
36298 test_xmlStrlen(void) {
36303 xmlChar * str; /* the xmlChar * array */
36306 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36307 mem_base = xmlMemBlocks();
36308 str = gen_const_xmlChar_ptr(n_str, 0);
36310 ret_val = xmlStrlen((const xmlChar *)str);
36311 desret_int(ret_val);
36313 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36314 xmlResetLastError();
36315 if (mem_base != xmlMemBlocks()) {
36316 printf("Leak of %d blocks found in xmlStrlen",
36317 xmlMemBlocks() - mem_base);
36319 printf(" %d", n_str);
36330 test_xmlStrncasecmp(void) {
36335 xmlChar * str1; /* the first xmlChar * */
36337 xmlChar * str2; /* the second xmlChar * */
36339 int len; /* the max comparison length */
36342 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36343 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36344 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36345 mem_base = xmlMemBlocks();
36346 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36347 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36348 len = gen_int(n_len, 2);
36350 ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36351 desret_int(ret_val);
36353 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36354 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36355 des_int(n_len, len, 2);
36356 xmlResetLastError();
36357 if (mem_base != xmlMemBlocks()) {
36358 printf("Leak of %d blocks found in xmlStrncasecmp",
36359 xmlMemBlocks() - mem_base);
36361 printf(" %d", n_str1);
36362 printf(" %d", n_str2);
36363 printf(" %d", n_len);
36376 test_xmlStrncatNew(void) {
36381 xmlChar * str1; /* first xmlChar string */
36383 xmlChar * str2; /* second xmlChar string */
36385 int len; /* the len of @str2 or < 0 */
36388 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36389 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36390 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36391 mem_base = xmlMemBlocks();
36392 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36393 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36394 len = gen_int(n_len, 2);
36396 ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36397 desret_xmlChar_ptr(ret_val);
36399 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36400 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36401 des_int(n_len, len, 2);
36402 xmlResetLastError();
36403 if (mem_base != xmlMemBlocks()) {
36404 printf("Leak of %d blocks found in xmlStrncatNew",
36405 xmlMemBlocks() - mem_base);
36407 printf(" %d", n_str1);
36408 printf(" %d", n_str2);
36409 printf(" %d", n_len);
36422 test_xmlStrncmp(void) {
36427 xmlChar * str1; /* the first xmlChar * */
36429 xmlChar * str2; /* the second xmlChar * */
36431 int len; /* the max comparison length */
36434 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36435 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36436 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36437 mem_base = xmlMemBlocks();
36438 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36439 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36440 len = gen_int(n_len, 2);
36442 ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36443 desret_int(ret_val);
36445 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36446 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36447 des_int(n_len, len, 2);
36448 xmlResetLastError();
36449 if (mem_base != xmlMemBlocks()) {
36450 printf("Leak of %d blocks found in xmlStrncmp",
36451 xmlMemBlocks() - mem_base);
36453 printf(" %d", n_str1);
36454 printf(" %d", n_str2);
36455 printf(" %d", n_len);
36468 test_xmlStrndup(void) {
36473 xmlChar * cur; /* the input xmlChar * */
36475 int len; /* the len of @cur */
36478 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36479 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36480 mem_base = xmlMemBlocks();
36481 cur = gen_const_xmlChar_ptr(n_cur, 0);
36482 len = gen_int(n_len, 1);
36484 ret_val = xmlStrndup((const xmlChar *)cur, len);
36485 desret_xmlChar_ptr(ret_val);
36487 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36488 des_int(n_len, len, 1);
36489 xmlResetLastError();
36490 if (mem_base != xmlMemBlocks()) {
36491 printf("Leak of %d blocks found in xmlStrndup",
36492 xmlMemBlocks() - mem_base);
36494 printf(" %d", n_cur);
36495 printf(" %d", n_len);
36507 test_xmlStrstr(void) {
36511 const xmlChar * ret_val;
36512 xmlChar * str; /* the xmlChar * array (haystack) */
36514 xmlChar * val; /* the xmlChar to search (needle) */
36517 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36518 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36519 mem_base = xmlMemBlocks();
36520 str = gen_const_xmlChar_ptr(n_str, 0);
36521 val = gen_const_xmlChar_ptr(n_val, 1);
36523 ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36524 desret_const_xmlChar_ptr(ret_val);
36526 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36527 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36528 xmlResetLastError();
36529 if (mem_base != xmlMemBlocks()) {
36530 printf("Leak of %d blocks found in xmlStrstr",
36531 xmlMemBlocks() - mem_base);
36533 printf(" %d", n_str);
36534 printf(" %d", n_val);
36546 test_xmlStrsub(void) {
36551 xmlChar * str; /* the xmlChar * array (haystack) */
36553 int start; /* the index of the first char (zero based) */
36555 int len; /* the length of the substring */
36558 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36559 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36560 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36561 mem_base = xmlMemBlocks();
36562 str = gen_const_xmlChar_ptr(n_str, 0);
36563 start = gen_int(n_start, 1);
36564 len = gen_int(n_len, 2);
36566 ret_val = xmlStrsub((const xmlChar *)str, start, len);
36567 desret_xmlChar_ptr(ret_val);
36569 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36570 des_int(n_start, start, 1);
36571 des_int(n_len, len, 2);
36572 xmlResetLastError();
36573 if (mem_base != xmlMemBlocks()) {
36574 printf("Leak of %d blocks found in xmlStrsub",
36575 xmlMemBlocks() - mem_base);
36577 printf(" %d", n_str);
36578 printf(" %d", n_start);
36579 printf(" %d", n_len);
36592 test_xmlUTF8Charcmp(void) {
36597 xmlChar * utf1; /* pointer to first UTF8 char */
36599 xmlChar * utf2; /* pointer to second UTF8 char */
36602 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36603 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36604 mem_base = xmlMemBlocks();
36605 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36606 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36608 ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36609 desret_int(ret_val);
36611 des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36612 des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36613 xmlResetLastError();
36614 if (mem_base != xmlMemBlocks()) {
36615 printf("Leak of %d blocks found in xmlUTF8Charcmp",
36616 xmlMemBlocks() - mem_base);
36618 printf(" %d", n_utf1);
36619 printf(" %d", n_utf2);
36631 test_xmlUTF8Size(void) {
36636 xmlChar * utf; /* pointer to the UTF8 character */
36639 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36640 mem_base = xmlMemBlocks();
36641 utf = gen_const_xmlChar_ptr(n_utf, 0);
36643 ret_val = xmlUTF8Size((const xmlChar *)utf);
36644 desret_int(ret_val);
36646 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36647 xmlResetLastError();
36648 if (mem_base != xmlMemBlocks()) {
36649 printf("Leak of %d blocks found in xmlUTF8Size",
36650 xmlMemBlocks() - mem_base);
36652 printf(" %d", n_utf);
36663 test_xmlUTF8Strlen(void) {
36668 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36671 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36672 mem_base = xmlMemBlocks();
36673 utf = gen_const_xmlChar_ptr(n_utf, 0);
36675 ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36676 desret_int(ret_val);
36678 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36679 xmlResetLastError();
36680 if (mem_base != xmlMemBlocks()) {
36681 printf("Leak of %d blocks found in xmlUTF8Strlen",
36682 xmlMemBlocks() - mem_base);
36684 printf(" %d", n_utf);
36695 test_xmlUTF8Strloc(void) {
36700 xmlChar * utf; /* the input UTF8 * */
36702 xmlChar * utfchar; /* the UTF8 character to be found */
36705 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36706 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36707 mem_base = xmlMemBlocks();
36708 utf = gen_const_xmlChar_ptr(n_utf, 0);
36709 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36711 ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36712 desret_int(ret_val);
36714 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36715 des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36716 xmlResetLastError();
36717 if (mem_base != xmlMemBlocks()) {
36718 printf("Leak of %d blocks found in xmlUTF8Strloc",
36719 xmlMemBlocks() - mem_base);
36721 printf(" %d", n_utf);
36722 printf(" %d", n_utfchar);
36734 test_xmlUTF8Strndup(void) {
36739 xmlChar * utf; /* the input UTF8 * */
36741 int len; /* the len of @utf (in chars) */
36744 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36745 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36746 mem_base = xmlMemBlocks();
36747 utf = gen_const_xmlChar_ptr(n_utf, 0);
36748 len = gen_int(n_len, 1);
36750 ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36751 desret_xmlChar_ptr(ret_val);
36753 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36754 des_int(n_len, len, 1);
36755 xmlResetLastError();
36756 if (mem_base != xmlMemBlocks()) {
36757 printf("Leak of %d blocks found in xmlUTF8Strndup",
36758 xmlMemBlocks() - mem_base);
36760 printf(" %d", n_utf);
36761 printf(" %d", n_len);
36773 test_xmlUTF8Strpos(void) {
36777 const xmlChar * ret_val;
36778 xmlChar * utf; /* the input UTF8 * */
36780 int pos; /* the position of the desired UTF8 char (in chars) */
36783 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36784 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36785 mem_base = xmlMemBlocks();
36786 utf = gen_const_xmlChar_ptr(n_utf, 0);
36787 pos = gen_int(n_pos, 1);
36789 ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36790 desret_const_xmlChar_ptr(ret_val);
36792 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36793 des_int(n_pos, pos, 1);
36794 xmlResetLastError();
36795 if (mem_base != xmlMemBlocks()) {
36796 printf("Leak of %d blocks found in xmlUTF8Strpos",
36797 xmlMemBlocks() - mem_base);
36799 printf(" %d", n_utf);
36800 printf(" %d", n_pos);
36812 test_xmlUTF8Strsize(void) {
36817 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36819 int len; /* the number of characters in the array */
36822 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36823 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36824 mem_base = xmlMemBlocks();
36825 utf = gen_const_xmlChar_ptr(n_utf, 0);
36826 len = gen_int(n_len, 1);
36828 ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36829 desret_int(ret_val);
36831 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36832 des_int(n_len, len, 1);
36833 xmlResetLastError();
36834 if (mem_base != xmlMemBlocks()) {
36835 printf("Leak of %d blocks found in xmlUTF8Strsize",
36836 xmlMemBlocks() - mem_base);
36838 printf(" %d", n_utf);
36839 printf(" %d", n_len);
36851 test_xmlUTF8Strsub(void) {
36856 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36858 int start; /* relative pos of first char */
36860 int len; /* total number to copy */
36863 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36864 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36865 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36866 mem_base = xmlMemBlocks();
36867 utf = gen_const_xmlChar_ptr(n_utf, 0);
36868 start = gen_int(n_start, 1);
36869 len = gen_int(n_len, 2);
36871 ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36872 desret_xmlChar_ptr(ret_val);
36874 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36875 des_int(n_start, start, 1);
36876 des_int(n_len, len, 2);
36877 xmlResetLastError();
36878 if (mem_base != xmlMemBlocks()) {
36879 printf("Leak of %d blocks found in xmlUTF8Strsub",
36880 xmlMemBlocks() - mem_base);
36882 printf(" %d", n_utf);
36883 printf(" %d", n_start);
36884 printf(" %d", n_len);
36896 test_xmlstring(void) {
36899 if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36900 test_ret += test_xmlCharStrdup();
36901 test_ret += test_xmlCharStrndup();
36902 test_ret += test_xmlCheckUTF8();
36903 test_ret += test_xmlGetUTF8Char();
36904 test_ret += test_xmlStrEqual();
36905 test_ret += test_xmlStrPrintf();
36906 test_ret += test_xmlStrQEqual();
36907 test_ret += test_xmlStrVPrintf();
36908 test_ret += test_xmlStrcasecmp();
36909 test_ret += test_xmlStrcasestr();
36910 test_ret += test_xmlStrchr();
36911 test_ret += test_xmlStrcmp();
36912 test_ret += test_xmlStrdup();
36913 test_ret += test_xmlStrlen();
36914 test_ret += test_xmlStrncasecmp();
36915 test_ret += test_xmlStrncatNew();
36916 test_ret += test_xmlStrncmp();
36917 test_ret += test_xmlStrndup();
36918 test_ret += test_xmlStrstr();
36919 test_ret += test_xmlStrsub();
36920 test_ret += test_xmlUTF8Charcmp();
36921 test_ret += test_xmlUTF8Size();
36922 test_ret += test_xmlUTF8Strlen();
36923 test_ret += test_xmlUTF8Strloc();
36924 test_ret += test_xmlUTF8Strndup();
36925 test_ret += test_xmlUTF8Strpos();
36926 test_ret += test_xmlUTF8Strsize();
36927 test_ret += test_xmlUTF8Strsub();
36930 printf("Module xmlstring: %d errors\n", test_ret);
36935 test_xmlUCSIsAegeanNumbers(void) {
36938 #if defined(LIBXML_UNICODE_ENABLED)
36941 int code; /* UCS code point */
36944 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36945 mem_base = xmlMemBlocks();
36946 code = gen_int(n_code, 0);
36948 ret_val = xmlUCSIsAegeanNumbers(code);
36949 desret_int(ret_val);
36951 des_int(n_code, code, 0);
36952 xmlResetLastError();
36953 if (mem_base != xmlMemBlocks()) {
36954 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36955 xmlMemBlocks() - mem_base);
36957 printf(" %d", n_code);
36969 test_xmlUCSIsAlphabeticPresentationForms(void) {
36972 #if defined(LIBXML_UNICODE_ENABLED)
36975 int code; /* UCS code point */
36978 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36979 mem_base = xmlMemBlocks();
36980 code = gen_int(n_code, 0);
36982 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36983 desret_int(ret_val);
36985 des_int(n_code, code, 0);
36986 xmlResetLastError();
36987 if (mem_base != xmlMemBlocks()) {
36988 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36989 xmlMemBlocks() - mem_base);
36991 printf(" %d", n_code);
37003 test_xmlUCSIsArabic(void) {
37006 #if defined(LIBXML_UNICODE_ENABLED)
37009 int code; /* UCS code point */
37012 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37013 mem_base = xmlMemBlocks();
37014 code = gen_int(n_code, 0);
37016 ret_val = xmlUCSIsArabic(code);
37017 desret_int(ret_val);
37019 des_int(n_code, code, 0);
37020 xmlResetLastError();
37021 if (mem_base != xmlMemBlocks()) {
37022 printf("Leak of %d blocks found in xmlUCSIsArabic",
37023 xmlMemBlocks() - mem_base);
37025 printf(" %d", n_code);
37037 test_xmlUCSIsArabicPresentationFormsA(void) {
37040 #if defined(LIBXML_UNICODE_ENABLED)
37043 int code; /* UCS code point */
37046 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37047 mem_base = xmlMemBlocks();
37048 code = gen_int(n_code, 0);
37050 ret_val = xmlUCSIsArabicPresentationFormsA(code);
37051 desret_int(ret_val);
37053 des_int(n_code, code, 0);
37054 xmlResetLastError();
37055 if (mem_base != xmlMemBlocks()) {
37056 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37057 xmlMemBlocks() - mem_base);
37059 printf(" %d", n_code);
37071 test_xmlUCSIsArabicPresentationFormsB(void) {
37074 #if defined(LIBXML_UNICODE_ENABLED)
37077 int code; /* UCS code point */
37080 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37081 mem_base = xmlMemBlocks();
37082 code = gen_int(n_code, 0);
37084 ret_val = xmlUCSIsArabicPresentationFormsB(code);
37085 desret_int(ret_val);
37087 des_int(n_code, code, 0);
37088 xmlResetLastError();
37089 if (mem_base != xmlMemBlocks()) {
37090 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37091 xmlMemBlocks() - mem_base);
37093 printf(" %d", n_code);
37105 test_xmlUCSIsArmenian(void) {
37108 #if defined(LIBXML_UNICODE_ENABLED)
37111 int code; /* UCS code point */
37114 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37115 mem_base = xmlMemBlocks();
37116 code = gen_int(n_code, 0);
37118 ret_val = xmlUCSIsArmenian(code);
37119 desret_int(ret_val);
37121 des_int(n_code, code, 0);
37122 xmlResetLastError();
37123 if (mem_base != xmlMemBlocks()) {
37124 printf("Leak of %d blocks found in xmlUCSIsArmenian",
37125 xmlMemBlocks() - mem_base);
37127 printf(" %d", n_code);
37139 test_xmlUCSIsArrows(void) {
37142 #if defined(LIBXML_UNICODE_ENABLED)
37145 int code; /* UCS code point */
37148 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37149 mem_base = xmlMemBlocks();
37150 code = gen_int(n_code, 0);
37152 ret_val = xmlUCSIsArrows(code);
37153 desret_int(ret_val);
37155 des_int(n_code, code, 0);
37156 xmlResetLastError();
37157 if (mem_base != xmlMemBlocks()) {
37158 printf("Leak of %d blocks found in xmlUCSIsArrows",
37159 xmlMemBlocks() - mem_base);
37161 printf(" %d", n_code);
37173 test_xmlUCSIsBasicLatin(void) {
37176 #if defined(LIBXML_UNICODE_ENABLED)
37179 int code; /* UCS code point */
37182 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37183 mem_base = xmlMemBlocks();
37184 code = gen_int(n_code, 0);
37186 ret_val = xmlUCSIsBasicLatin(code);
37187 desret_int(ret_val);
37189 des_int(n_code, code, 0);
37190 xmlResetLastError();
37191 if (mem_base != xmlMemBlocks()) {
37192 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37193 xmlMemBlocks() - mem_base);
37195 printf(" %d", n_code);
37207 test_xmlUCSIsBengali(void) {
37210 #if defined(LIBXML_UNICODE_ENABLED)
37213 int code; /* UCS code point */
37216 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37217 mem_base = xmlMemBlocks();
37218 code = gen_int(n_code, 0);
37220 ret_val = xmlUCSIsBengali(code);
37221 desret_int(ret_val);
37223 des_int(n_code, code, 0);
37224 xmlResetLastError();
37225 if (mem_base != xmlMemBlocks()) {
37226 printf("Leak of %d blocks found in xmlUCSIsBengali",
37227 xmlMemBlocks() - mem_base);
37229 printf(" %d", n_code);
37241 test_xmlUCSIsBlock(void) {
37244 #if defined(LIBXML_UNICODE_ENABLED)
37247 int code; /* UCS code point */
37249 char * block; /* UCS block name */
37252 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37253 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37254 mem_base = xmlMemBlocks();
37255 code = gen_int(n_code, 0);
37256 block = gen_const_char_ptr(n_block, 1);
37258 ret_val = xmlUCSIsBlock(code, (const char *)block);
37259 desret_int(ret_val);
37261 des_int(n_code, code, 0);
37262 des_const_char_ptr(n_block, (const char *)block, 1);
37263 xmlResetLastError();
37264 if (mem_base != xmlMemBlocks()) {
37265 printf("Leak of %d blocks found in xmlUCSIsBlock",
37266 xmlMemBlocks() - mem_base);
37268 printf(" %d", n_code);
37269 printf(" %d", n_block);
37282 test_xmlUCSIsBlockElements(void) {
37285 #if defined(LIBXML_UNICODE_ENABLED)
37288 int code; /* UCS code point */
37291 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37292 mem_base = xmlMemBlocks();
37293 code = gen_int(n_code, 0);
37295 ret_val = xmlUCSIsBlockElements(code);
37296 desret_int(ret_val);
37298 des_int(n_code, code, 0);
37299 xmlResetLastError();
37300 if (mem_base != xmlMemBlocks()) {
37301 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37302 xmlMemBlocks() - mem_base);
37304 printf(" %d", n_code);
37316 test_xmlUCSIsBopomofo(void) {
37319 #if defined(LIBXML_UNICODE_ENABLED)
37322 int code; /* UCS code point */
37325 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37326 mem_base = xmlMemBlocks();
37327 code = gen_int(n_code, 0);
37329 ret_val = xmlUCSIsBopomofo(code);
37330 desret_int(ret_val);
37332 des_int(n_code, code, 0);
37333 xmlResetLastError();
37334 if (mem_base != xmlMemBlocks()) {
37335 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37336 xmlMemBlocks() - mem_base);
37338 printf(" %d", n_code);
37350 test_xmlUCSIsBopomofoExtended(void) {
37353 #if defined(LIBXML_UNICODE_ENABLED)
37356 int code; /* UCS code point */
37359 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37360 mem_base = xmlMemBlocks();
37361 code = gen_int(n_code, 0);
37363 ret_val = xmlUCSIsBopomofoExtended(code);
37364 desret_int(ret_val);
37366 des_int(n_code, code, 0);
37367 xmlResetLastError();
37368 if (mem_base != xmlMemBlocks()) {
37369 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37370 xmlMemBlocks() - mem_base);
37372 printf(" %d", n_code);
37384 test_xmlUCSIsBoxDrawing(void) {
37387 #if defined(LIBXML_UNICODE_ENABLED)
37390 int code; /* UCS code point */
37393 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37394 mem_base = xmlMemBlocks();
37395 code = gen_int(n_code, 0);
37397 ret_val = xmlUCSIsBoxDrawing(code);
37398 desret_int(ret_val);
37400 des_int(n_code, code, 0);
37401 xmlResetLastError();
37402 if (mem_base != xmlMemBlocks()) {
37403 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37404 xmlMemBlocks() - mem_base);
37406 printf(" %d", n_code);
37418 test_xmlUCSIsBraillePatterns(void) {
37421 #if defined(LIBXML_UNICODE_ENABLED)
37424 int code; /* UCS code point */
37427 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37428 mem_base = xmlMemBlocks();
37429 code = gen_int(n_code, 0);
37431 ret_val = xmlUCSIsBraillePatterns(code);
37432 desret_int(ret_val);
37434 des_int(n_code, code, 0);
37435 xmlResetLastError();
37436 if (mem_base != xmlMemBlocks()) {
37437 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37438 xmlMemBlocks() - mem_base);
37440 printf(" %d", n_code);
37452 test_xmlUCSIsBuhid(void) {
37455 #if defined(LIBXML_UNICODE_ENABLED)
37458 int code; /* UCS code point */
37461 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37462 mem_base = xmlMemBlocks();
37463 code = gen_int(n_code, 0);
37465 ret_val = xmlUCSIsBuhid(code);
37466 desret_int(ret_val);
37468 des_int(n_code, code, 0);
37469 xmlResetLastError();
37470 if (mem_base != xmlMemBlocks()) {
37471 printf("Leak of %d blocks found in xmlUCSIsBuhid",
37472 xmlMemBlocks() - mem_base);
37474 printf(" %d", n_code);
37486 test_xmlUCSIsByzantineMusicalSymbols(void) {
37489 #if defined(LIBXML_UNICODE_ENABLED)
37492 int code; /* UCS code point */
37495 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37496 mem_base = xmlMemBlocks();
37497 code = gen_int(n_code, 0);
37499 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37500 desret_int(ret_val);
37502 des_int(n_code, code, 0);
37503 xmlResetLastError();
37504 if (mem_base != xmlMemBlocks()) {
37505 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37506 xmlMemBlocks() - mem_base);
37508 printf(" %d", n_code);
37520 test_xmlUCSIsCJKCompatibility(void) {
37523 #if defined(LIBXML_UNICODE_ENABLED)
37526 int code; /* UCS code point */
37529 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37530 mem_base = xmlMemBlocks();
37531 code = gen_int(n_code, 0);
37533 ret_val = xmlUCSIsCJKCompatibility(code);
37534 desret_int(ret_val);
37536 des_int(n_code, code, 0);
37537 xmlResetLastError();
37538 if (mem_base != xmlMemBlocks()) {
37539 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37540 xmlMemBlocks() - mem_base);
37542 printf(" %d", n_code);
37554 test_xmlUCSIsCJKCompatibilityForms(void) {
37557 #if defined(LIBXML_UNICODE_ENABLED)
37560 int code; /* UCS code point */
37563 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37564 mem_base = xmlMemBlocks();
37565 code = gen_int(n_code, 0);
37567 ret_val = xmlUCSIsCJKCompatibilityForms(code);
37568 desret_int(ret_val);
37570 des_int(n_code, code, 0);
37571 xmlResetLastError();
37572 if (mem_base != xmlMemBlocks()) {
37573 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37574 xmlMemBlocks() - mem_base);
37576 printf(" %d", n_code);
37588 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37591 #if defined(LIBXML_UNICODE_ENABLED)
37594 int code; /* UCS code point */
37597 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37598 mem_base = xmlMemBlocks();
37599 code = gen_int(n_code, 0);
37601 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37602 desret_int(ret_val);
37604 des_int(n_code, code, 0);
37605 xmlResetLastError();
37606 if (mem_base != xmlMemBlocks()) {
37607 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37608 xmlMemBlocks() - mem_base);
37610 printf(" %d", n_code);
37622 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37625 #if defined(LIBXML_UNICODE_ENABLED)
37628 int code; /* UCS code point */
37631 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37632 mem_base = xmlMemBlocks();
37633 code = gen_int(n_code, 0);
37635 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37636 desret_int(ret_val);
37638 des_int(n_code, code, 0);
37639 xmlResetLastError();
37640 if (mem_base != xmlMemBlocks()) {
37641 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37642 xmlMemBlocks() - mem_base);
37644 printf(" %d", n_code);
37656 test_xmlUCSIsCJKRadicalsSupplement(void) {
37659 #if defined(LIBXML_UNICODE_ENABLED)
37662 int code; /* UCS code point */
37665 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37666 mem_base = xmlMemBlocks();
37667 code = gen_int(n_code, 0);
37669 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37670 desret_int(ret_val);
37672 des_int(n_code, code, 0);
37673 xmlResetLastError();
37674 if (mem_base != xmlMemBlocks()) {
37675 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37676 xmlMemBlocks() - mem_base);
37678 printf(" %d", n_code);
37690 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37693 #if defined(LIBXML_UNICODE_ENABLED)
37696 int code; /* UCS code point */
37699 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37700 mem_base = xmlMemBlocks();
37701 code = gen_int(n_code, 0);
37703 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37704 desret_int(ret_val);
37706 des_int(n_code, code, 0);
37707 xmlResetLastError();
37708 if (mem_base != xmlMemBlocks()) {
37709 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37710 xmlMemBlocks() - mem_base);
37712 printf(" %d", n_code);
37724 test_xmlUCSIsCJKUnifiedIdeographs(void) {
37727 #if defined(LIBXML_UNICODE_ENABLED)
37730 int code; /* UCS code point */
37733 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37734 mem_base = xmlMemBlocks();
37735 code = gen_int(n_code, 0);
37737 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37738 desret_int(ret_val);
37740 des_int(n_code, code, 0);
37741 xmlResetLastError();
37742 if (mem_base != xmlMemBlocks()) {
37743 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37744 xmlMemBlocks() - mem_base);
37746 printf(" %d", n_code);
37758 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37761 #if defined(LIBXML_UNICODE_ENABLED)
37764 int code; /* UCS code point */
37767 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37768 mem_base = xmlMemBlocks();
37769 code = gen_int(n_code, 0);
37771 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37772 desret_int(ret_val);
37774 des_int(n_code, code, 0);
37775 xmlResetLastError();
37776 if (mem_base != xmlMemBlocks()) {
37777 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37778 xmlMemBlocks() - mem_base);
37780 printf(" %d", n_code);
37792 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37795 #if defined(LIBXML_UNICODE_ENABLED)
37798 int code; /* UCS code point */
37801 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37802 mem_base = xmlMemBlocks();
37803 code = gen_int(n_code, 0);
37805 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37806 desret_int(ret_val);
37808 des_int(n_code, code, 0);
37809 xmlResetLastError();
37810 if (mem_base != xmlMemBlocks()) {
37811 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37812 xmlMemBlocks() - mem_base);
37814 printf(" %d", n_code);
37826 test_xmlUCSIsCat(void) {
37829 #if defined(LIBXML_UNICODE_ENABLED)
37832 int code; /* UCS code point */
37834 char * cat; /* UCS Category name */
37837 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37838 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37839 mem_base = xmlMemBlocks();
37840 code = gen_int(n_code, 0);
37841 cat = gen_const_char_ptr(n_cat, 1);
37843 ret_val = xmlUCSIsCat(code, (const char *)cat);
37844 desret_int(ret_val);
37846 des_int(n_code, code, 0);
37847 des_const_char_ptr(n_cat, (const char *)cat, 1);
37848 xmlResetLastError();
37849 if (mem_base != xmlMemBlocks()) {
37850 printf("Leak of %d blocks found in xmlUCSIsCat",
37851 xmlMemBlocks() - mem_base);
37853 printf(" %d", n_code);
37854 printf(" %d", n_cat);
37867 test_xmlUCSIsCatC(void) {
37870 #if defined(LIBXML_UNICODE_ENABLED)
37873 int code; /* UCS code point */
37876 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37877 mem_base = xmlMemBlocks();
37878 code = gen_int(n_code, 0);
37880 ret_val = xmlUCSIsCatC(code);
37881 desret_int(ret_val);
37883 des_int(n_code, code, 0);
37884 xmlResetLastError();
37885 if (mem_base != xmlMemBlocks()) {
37886 printf("Leak of %d blocks found in xmlUCSIsCatC",
37887 xmlMemBlocks() - mem_base);
37889 printf(" %d", n_code);
37901 test_xmlUCSIsCatCc(void) {
37904 #if defined(LIBXML_UNICODE_ENABLED)
37907 int code; /* UCS code point */
37910 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37911 mem_base = xmlMemBlocks();
37912 code = gen_int(n_code, 0);
37914 ret_val = xmlUCSIsCatCc(code);
37915 desret_int(ret_val);
37917 des_int(n_code, code, 0);
37918 xmlResetLastError();
37919 if (mem_base != xmlMemBlocks()) {
37920 printf("Leak of %d blocks found in xmlUCSIsCatCc",
37921 xmlMemBlocks() - mem_base);
37923 printf(" %d", n_code);
37935 test_xmlUCSIsCatCf(void) {
37938 #if defined(LIBXML_UNICODE_ENABLED)
37941 int code; /* UCS code point */
37944 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37945 mem_base = xmlMemBlocks();
37946 code = gen_int(n_code, 0);
37948 ret_val = xmlUCSIsCatCf(code);
37949 desret_int(ret_val);
37951 des_int(n_code, code, 0);
37952 xmlResetLastError();
37953 if (mem_base != xmlMemBlocks()) {
37954 printf("Leak of %d blocks found in xmlUCSIsCatCf",
37955 xmlMemBlocks() - mem_base);
37957 printf(" %d", n_code);
37969 test_xmlUCSIsCatCo(void) {
37972 #if defined(LIBXML_UNICODE_ENABLED)
37975 int code; /* UCS code point */
37978 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37979 mem_base = xmlMemBlocks();
37980 code = gen_int(n_code, 0);
37982 ret_val = xmlUCSIsCatCo(code);
37983 desret_int(ret_val);
37985 des_int(n_code, code, 0);
37986 xmlResetLastError();
37987 if (mem_base != xmlMemBlocks()) {
37988 printf("Leak of %d blocks found in xmlUCSIsCatCo",
37989 xmlMemBlocks() - mem_base);
37991 printf(" %d", n_code);
38003 test_xmlUCSIsCatCs(void) {
38006 #if defined(LIBXML_UNICODE_ENABLED)
38009 int code; /* UCS code point */
38012 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38013 mem_base = xmlMemBlocks();
38014 code = gen_int(n_code, 0);
38016 ret_val = xmlUCSIsCatCs(code);
38017 desret_int(ret_val);
38019 des_int(n_code, code, 0);
38020 xmlResetLastError();
38021 if (mem_base != xmlMemBlocks()) {
38022 printf("Leak of %d blocks found in xmlUCSIsCatCs",
38023 xmlMemBlocks() - mem_base);
38025 printf(" %d", n_code);
38037 test_xmlUCSIsCatL(void) {
38040 #if defined(LIBXML_UNICODE_ENABLED)
38043 int code; /* UCS code point */
38046 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38047 mem_base = xmlMemBlocks();
38048 code = gen_int(n_code, 0);
38050 ret_val = xmlUCSIsCatL(code);
38051 desret_int(ret_val);
38053 des_int(n_code, code, 0);
38054 xmlResetLastError();
38055 if (mem_base != xmlMemBlocks()) {
38056 printf("Leak of %d blocks found in xmlUCSIsCatL",
38057 xmlMemBlocks() - mem_base);
38059 printf(" %d", n_code);
38071 test_xmlUCSIsCatLl(void) {
38074 #if defined(LIBXML_UNICODE_ENABLED)
38077 int code; /* UCS code point */
38080 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38081 mem_base = xmlMemBlocks();
38082 code = gen_int(n_code, 0);
38084 ret_val = xmlUCSIsCatLl(code);
38085 desret_int(ret_val);
38087 des_int(n_code, code, 0);
38088 xmlResetLastError();
38089 if (mem_base != xmlMemBlocks()) {
38090 printf("Leak of %d blocks found in xmlUCSIsCatLl",
38091 xmlMemBlocks() - mem_base);
38093 printf(" %d", n_code);
38105 test_xmlUCSIsCatLm(void) {
38108 #if defined(LIBXML_UNICODE_ENABLED)
38111 int code; /* UCS code point */
38114 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38115 mem_base = xmlMemBlocks();
38116 code = gen_int(n_code, 0);
38118 ret_val = xmlUCSIsCatLm(code);
38119 desret_int(ret_val);
38121 des_int(n_code, code, 0);
38122 xmlResetLastError();
38123 if (mem_base != xmlMemBlocks()) {
38124 printf("Leak of %d blocks found in xmlUCSIsCatLm",
38125 xmlMemBlocks() - mem_base);
38127 printf(" %d", n_code);
38139 test_xmlUCSIsCatLo(void) {
38142 #if defined(LIBXML_UNICODE_ENABLED)
38145 int code; /* UCS code point */
38148 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38149 mem_base = xmlMemBlocks();
38150 code = gen_int(n_code, 0);
38152 ret_val = xmlUCSIsCatLo(code);
38153 desret_int(ret_val);
38155 des_int(n_code, code, 0);
38156 xmlResetLastError();
38157 if (mem_base != xmlMemBlocks()) {
38158 printf("Leak of %d blocks found in xmlUCSIsCatLo",
38159 xmlMemBlocks() - mem_base);
38161 printf(" %d", n_code);
38173 test_xmlUCSIsCatLt(void) {
38176 #if defined(LIBXML_UNICODE_ENABLED)
38179 int code; /* UCS code point */
38182 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38183 mem_base = xmlMemBlocks();
38184 code = gen_int(n_code, 0);
38186 ret_val = xmlUCSIsCatLt(code);
38187 desret_int(ret_val);
38189 des_int(n_code, code, 0);
38190 xmlResetLastError();
38191 if (mem_base != xmlMemBlocks()) {
38192 printf("Leak of %d blocks found in xmlUCSIsCatLt",
38193 xmlMemBlocks() - mem_base);
38195 printf(" %d", n_code);
38207 test_xmlUCSIsCatLu(void) {
38210 #if defined(LIBXML_UNICODE_ENABLED)
38213 int code; /* UCS code point */
38216 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38217 mem_base = xmlMemBlocks();
38218 code = gen_int(n_code, 0);
38220 ret_val = xmlUCSIsCatLu(code);
38221 desret_int(ret_val);
38223 des_int(n_code, code, 0);
38224 xmlResetLastError();
38225 if (mem_base != xmlMemBlocks()) {
38226 printf("Leak of %d blocks found in xmlUCSIsCatLu",
38227 xmlMemBlocks() - mem_base);
38229 printf(" %d", n_code);
38241 test_xmlUCSIsCatM(void) {
38244 #if defined(LIBXML_UNICODE_ENABLED)
38247 int code; /* UCS code point */
38250 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38251 mem_base = xmlMemBlocks();
38252 code = gen_int(n_code, 0);
38254 ret_val = xmlUCSIsCatM(code);
38255 desret_int(ret_val);
38257 des_int(n_code, code, 0);
38258 xmlResetLastError();
38259 if (mem_base != xmlMemBlocks()) {
38260 printf("Leak of %d blocks found in xmlUCSIsCatM",
38261 xmlMemBlocks() - mem_base);
38263 printf(" %d", n_code);
38275 test_xmlUCSIsCatMc(void) {
38278 #if defined(LIBXML_UNICODE_ENABLED)
38281 int code; /* UCS code point */
38284 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38285 mem_base = xmlMemBlocks();
38286 code = gen_int(n_code, 0);
38288 ret_val = xmlUCSIsCatMc(code);
38289 desret_int(ret_val);
38291 des_int(n_code, code, 0);
38292 xmlResetLastError();
38293 if (mem_base != xmlMemBlocks()) {
38294 printf("Leak of %d blocks found in xmlUCSIsCatMc",
38295 xmlMemBlocks() - mem_base);
38297 printf(" %d", n_code);
38309 test_xmlUCSIsCatMe(void) {
38312 #if defined(LIBXML_UNICODE_ENABLED)
38315 int code; /* UCS code point */
38318 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38319 mem_base = xmlMemBlocks();
38320 code = gen_int(n_code, 0);
38322 ret_val = xmlUCSIsCatMe(code);
38323 desret_int(ret_val);
38325 des_int(n_code, code, 0);
38326 xmlResetLastError();
38327 if (mem_base != xmlMemBlocks()) {
38328 printf("Leak of %d blocks found in xmlUCSIsCatMe",
38329 xmlMemBlocks() - mem_base);
38331 printf(" %d", n_code);
38343 test_xmlUCSIsCatMn(void) {
38346 #if defined(LIBXML_UNICODE_ENABLED)
38349 int code; /* UCS code point */
38352 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38353 mem_base = xmlMemBlocks();
38354 code = gen_int(n_code, 0);
38356 ret_val = xmlUCSIsCatMn(code);
38357 desret_int(ret_val);
38359 des_int(n_code, code, 0);
38360 xmlResetLastError();
38361 if (mem_base != xmlMemBlocks()) {
38362 printf("Leak of %d blocks found in xmlUCSIsCatMn",
38363 xmlMemBlocks() - mem_base);
38365 printf(" %d", n_code);
38377 test_xmlUCSIsCatN(void) {
38380 #if defined(LIBXML_UNICODE_ENABLED)
38383 int code; /* UCS code point */
38386 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38387 mem_base = xmlMemBlocks();
38388 code = gen_int(n_code, 0);
38390 ret_val = xmlUCSIsCatN(code);
38391 desret_int(ret_val);
38393 des_int(n_code, code, 0);
38394 xmlResetLastError();
38395 if (mem_base != xmlMemBlocks()) {
38396 printf("Leak of %d blocks found in xmlUCSIsCatN",
38397 xmlMemBlocks() - mem_base);
38399 printf(" %d", n_code);
38411 test_xmlUCSIsCatNd(void) {
38414 #if defined(LIBXML_UNICODE_ENABLED)
38417 int code; /* UCS code point */
38420 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38421 mem_base = xmlMemBlocks();
38422 code = gen_int(n_code, 0);
38424 ret_val = xmlUCSIsCatNd(code);
38425 desret_int(ret_val);
38427 des_int(n_code, code, 0);
38428 xmlResetLastError();
38429 if (mem_base != xmlMemBlocks()) {
38430 printf("Leak of %d blocks found in xmlUCSIsCatNd",
38431 xmlMemBlocks() - mem_base);
38433 printf(" %d", n_code);
38445 test_xmlUCSIsCatNl(void) {
38448 #if defined(LIBXML_UNICODE_ENABLED)
38451 int code; /* UCS code point */
38454 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38455 mem_base = xmlMemBlocks();
38456 code = gen_int(n_code, 0);
38458 ret_val = xmlUCSIsCatNl(code);
38459 desret_int(ret_val);
38461 des_int(n_code, code, 0);
38462 xmlResetLastError();
38463 if (mem_base != xmlMemBlocks()) {
38464 printf("Leak of %d blocks found in xmlUCSIsCatNl",
38465 xmlMemBlocks() - mem_base);
38467 printf(" %d", n_code);
38479 test_xmlUCSIsCatNo(void) {
38482 #if defined(LIBXML_UNICODE_ENABLED)
38485 int code; /* UCS code point */
38488 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38489 mem_base = xmlMemBlocks();
38490 code = gen_int(n_code, 0);
38492 ret_val = xmlUCSIsCatNo(code);
38493 desret_int(ret_val);
38495 des_int(n_code, code, 0);
38496 xmlResetLastError();
38497 if (mem_base != xmlMemBlocks()) {
38498 printf("Leak of %d blocks found in xmlUCSIsCatNo",
38499 xmlMemBlocks() - mem_base);
38501 printf(" %d", n_code);
38513 test_xmlUCSIsCatP(void) {
38516 #if defined(LIBXML_UNICODE_ENABLED)
38519 int code; /* UCS code point */
38522 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38523 mem_base = xmlMemBlocks();
38524 code = gen_int(n_code, 0);
38526 ret_val = xmlUCSIsCatP(code);
38527 desret_int(ret_val);
38529 des_int(n_code, code, 0);
38530 xmlResetLastError();
38531 if (mem_base != xmlMemBlocks()) {
38532 printf("Leak of %d blocks found in xmlUCSIsCatP",
38533 xmlMemBlocks() - mem_base);
38535 printf(" %d", n_code);
38547 test_xmlUCSIsCatPc(void) {
38550 #if defined(LIBXML_UNICODE_ENABLED)
38553 int code; /* UCS code point */
38556 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38557 mem_base = xmlMemBlocks();
38558 code = gen_int(n_code, 0);
38560 ret_val = xmlUCSIsCatPc(code);
38561 desret_int(ret_val);
38563 des_int(n_code, code, 0);
38564 xmlResetLastError();
38565 if (mem_base != xmlMemBlocks()) {
38566 printf("Leak of %d blocks found in xmlUCSIsCatPc",
38567 xmlMemBlocks() - mem_base);
38569 printf(" %d", n_code);
38581 test_xmlUCSIsCatPd(void) {
38584 #if defined(LIBXML_UNICODE_ENABLED)
38587 int code; /* UCS code point */
38590 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38591 mem_base = xmlMemBlocks();
38592 code = gen_int(n_code, 0);
38594 ret_val = xmlUCSIsCatPd(code);
38595 desret_int(ret_val);
38597 des_int(n_code, code, 0);
38598 xmlResetLastError();
38599 if (mem_base != xmlMemBlocks()) {
38600 printf("Leak of %d blocks found in xmlUCSIsCatPd",
38601 xmlMemBlocks() - mem_base);
38603 printf(" %d", n_code);
38615 test_xmlUCSIsCatPe(void) {
38618 #if defined(LIBXML_UNICODE_ENABLED)
38621 int code; /* UCS code point */
38624 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38625 mem_base = xmlMemBlocks();
38626 code = gen_int(n_code, 0);
38628 ret_val = xmlUCSIsCatPe(code);
38629 desret_int(ret_val);
38631 des_int(n_code, code, 0);
38632 xmlResetLastError();
38633 if (mem_base != xmlMemBlocks()) {
38634 printf("Leak of %d blocks found in xmlUCSIsCatPe",
38635 xmlMemBlocks() - mem_base);
38637 printf(" %d", n_code);
38649 test_xmlUCSIsCatPf(void) {
38652 #if defined(LIBXML_UNICODE_ENABLED)
38655 int code; /* UCS code point */
38658 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38659 mem_base = xmlMemBlocks();
38660 code = gen_int(n_code, 0);
38662 ret_val = xmlUCSIsCatPf(code);
38663 desret_int(ret_val);
38665 des_int(n_code, code, 0);
38666 xmlResetLastError();
38667 if (mem_base != xmlMemBlocks()) {
38668 printf("Leak of %d blocks found in xmlUCSIsCatPf",
38669 xmlMemBlocks() - mem_base);
38671 printf(" %d", n_code);
38683 test_xmlUCSIsCatPi(void) {
38686 #if defined(LIBXML_UNICODE_ENABLED)
38689 int code; /* UCS code point */
38692 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38693 mem_base = xmlMemBlocks();
38694 code = gen_int(n_code, 0);
38696 ret_val = xmlUCSIsCatPi(code);
38697 desret_int(ret_val);
38699 des_int(n_code, code, 0);
38700 xmlResetLastError();
38701 if (mem_base != xmlMemBlocks()) {
38702 printf("Leak of %d blocks found in xmlUCSIsCatPi",
38703 xmlMemBlocks() - mem_base);
38705 printf(" %d", n_code);
38717 test_xmlUCSIsCatPo(void) {
38720 #if defined(LIBXML_UNICODE_ENABLED)
38723 int code; /* UCS code point */
38726 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38727 mem_base = xmlMemBlocks();
38728 code = gen_int(n_code, 0);
38730 ret_val = xmlUCSIsCatPo(code);
38731 desret_int(ret_val);
38733 des_int(n_code, code, 0);
38734 xmlResetLastError();
38735 if (mem_base != xmlMemBlocks()) {
38736 printf("Leak of %d blocks found in xmlUCSIsCatPo",
38737 xmlMemBlocks() - mem_base);
38739 printf(" %d", n_code);
38751 test_xmlUCSIsCatPs(void) {
38754 #if defined(LIBXML_UNICODE_ENABLED)
38757 int code; /* UCS code point */
38760 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38761 mem_base = xmlMemBlocks();
38762 code = gen_int(n_code, 0);
38764 ret_val = xmlUCSIsCatPs(code);
38765 desret_int(ret_val);
38767 des_int(n_code, code, 0);
38768 xmlResetLastError();
38769 if (mem_base != xmlMemBlocks()) {
38770 printf("Leak of %d blocks found in xmlUCSIsCatPs",
38771 xmlMemBlocks() - mem_base);
38773 printf(" %d", n_code);
38785 test_xmlUCSIsCatS(void) {
38788 #if defined(LIBXML_UNICODE_ENABLED)
38791 int code; /* UCS code point */
38794 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38795 mem_base = xmlMemBlocks();
38796 code = gen_int(n_code, 0);
38798 ret_val = xmlUCSIsCatS(code);
38799 desret_int(ret_val);
38801 des_int(n_code, code, 0);
38802 xmlResetLastError();
38803 if (mem_base != xmlMemBlocks()) {
38804 printf("Leak of %d blocks found in xmlUCSIsCatS",
38805 xmlMemBlocks() - mem_base);
38807 printf(" %d", n_code);
38819 test_xmlUCSIsCatSc(void) {
38822 #if defined(LIBXML_UNICODE_ENABLED)
38825 int code; /* UCS code point */
38828 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38829 mem_base = xmlMemBlocks();
38830 code = gen_int(n_code, 0);
38832 ret_val = xmlUCSIsCatSc(code);
38833 desret_int(ret_val);
38835 des_int(n_code, code, 0);
38836 xmlResetLastError();
38837 if (mem_base != xmlMemBlocks()) {
38838 printf("Leak of %d blocks found in xmlUCSIsCatSc",
38839 xmlMemBlocks() - mem_base);
38841 printf(" %d", n_code);
38853 test_xmlUCSIsCatSk(void) {
38856 #if defined(LIBXML_UNICODE_ENABLED)
38859 int code; /* UCS code point */
38862 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38863 mem_base = xmlMemBlocks();
38864 code = gen_int(n_code, 0);
38866 ret_val = xmlUCSIsCatSk(code);
38867 desret_int(ret_val);
38869 des_int(n_code, code, 0);
38870 xmlResetLastError();
38871 if (mem_base != xmlMemBlocks()) {
38872 printf("Leak of %d blocks found in xmlUCSIsCatSk",
38873 xmlMemBlocks() - mem_base);
38875 printf(" %d", n_code);
38887 test_xmlUCSIsCatSm(void) {
38890 #if defined(LIBXML_UNICODE_ENABLED)
38893 int code; /* UCS code point */
38896 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38897 mem_base = xmlMemBlocks();
38898 code = gen_int(n_code, 0);
38900 ret_val = xmlUCSIsCatSm(code);
38901 desret_int(ret_val);
38903 des_int(n_code, code, 0);
38904 xmlResetLastError();
38905 if (mem_base != xmlMemBlocks()) {
38906 printf("Leak of %d blocks found in xmlUCSIsCatSm",
38907 xmlMemBlocks() - mem_base);
38909 printf(" %d", n_code);
38921 test_xmlUCSIsCatSo(void) {
38924 #if defined(LIBXML_UNICODE_ENABLED)
38927 int code; /* UCS code point */
38930 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38931 mem_base = xmlMemBlocks();
38932 code = gen_int(n_code, 0);
38934 ret_val = xmlUCSIsCatSo(code);
38935 desret_int(ret_val);
38937 des_int(n_code, code, 0);
38938 xmlResetLastError();
38939 if (mem_base != xmlMemBlocks()) {
38940 printf("Leak of %d blocks found in xmlUCSIsCatSo",
38941 xmlMemBlocks() - mem_base);
38943 printf(" %d", n_code);
38955 test_xmlUCSIsCatZ(void) {
38958 #if defined(LIBXML_UNICODE_ENABLED)
38961 int code; /* UCS code point */
38964 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38965 mem_base = xmlMemBlocks();
38966 code = gen_int(n_code, 0);
38968 ret_val = xmlUCSIsCatZ(code);
38969 desret_int(ret_val);
38971 des_int(n_code, code, 0);
38972 xmlResetLastError();
38973 if (mem_base != xmlMemBlocks()) {
38974 printf("Leak of %d blocks found in xmlUCSIsCatZ",
38975 xmlMemBlocks() - mem_base);
38977 printf(" %d", n_code);
38989 test_xmlUCSIsCatZl(void) {
38992 #if defined(LIBXML_UNICODE_ENABLED)
38995 int code; /* UCS code point */
38998 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38999 mem_base = xmlMemBlocks();
39000 code = gen_int(n_code, 0);
39002 ret_val = xmlUCSIsCatZl(code);
39003 desret_int(ret_val);
39005 des_int(n_code, code, 0);
39006 xmlResetLastError();
39007 if (mem_base != xmlMemBlocks()) {
39008 printf("Leak of %d blocks found in xmlUCSIsCatZl",
39009 xmlMemBlocks() - mem_base);
39011 printf(" %d", n_code);
39023 test_xmlUCSIsCatZp(void) {
39026 #if defined(LIBXML_UNICODE_ENABLED)
39029 int code; /* UCS code point */
39032 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39033 mem_base = xmlMemBlocks();
39034 code = gen_int(n_code, 0);
39036 ret_val = xmlUCSIsCatZp(code);
39037 desret_int(ret_val);
39039 des_int(n_code, code, 0);
39040 xmlResetLastError();
39041 if (mem_base != xmlMemBlocks()) {
39042 printf("Leak of %d blocks found in xmlUCSIsCatZp",
39043 xmlMemBlocks() - mem_base);
39045 printf(" %d", n_code);
39057 test_xmlUCSIsCatZs(void) {
39060 #if defined(LIBXML_UNICODE_ENABLED)
39063 int code; /* UCS code point */
39066 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39067 mem_base = xmlMemBlocks();
39068 code = gen_int(n_code, 0);
39070 ret_val = xmlUCSIsCatZs(code);
39071 desret_int(ret_val);
39073 des_int(n_code, code, 0);
39074 xmlResetLastError();
39075 if (mem_base != xmlMemBlocks()) {
39076 printf("Leak of %d blocks found in xmlUCSIsCatZs",
39077 xmlMemBlocks() - mem_base);
39079 printf(" %d", n_code);
39091 test_xmlUCSIsCherokee(void) {
39094 #if defined(LIBXML_UNICODE_ENABLED)
39097 int code; /* UCS code point */
39100 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39101 mem_base = xmlMemBlocks();
39102 code = gen_int(n_code, 0);
39104 ret_val = xmlUCSIsCherokee(code);
39105 desret_int(ret_val);
39107 des_int(n_code, code, 0);
39108 xmlResetLastError();
39109 if (mem_base != xmlMemBlocks()) {
39110 printf("Leak of %d blocks found in xmlUCSIsCherokee",
39111 xmlMemBlocks() - mem_base);
39113 printf(" %d", n_code);
39125 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39128 #if defined(LIBXML_UNICODE_ENABLED)
39131 int code; /* UCS code point */
39134 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39135 mem_base = xmlMemBlocks();
39136 code = gen_int(n_code, 0);
39138 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39139 desret_int(ret_val);
39141 des_int(n_code, code, 0);
39142 xmlResetLastError();
39143 if (mem_base != xmlMemBlocks()) {
39144 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39145 xmlMemBlocks() - mem_base);
39147 printf(" %d", n_code);
39159 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39162 #if defined(LIBXML_UNICODE_ENABLED)
39165 int code; /* UCS code point */
39168 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39169 mem_base = xmlMemBlocks();
39170 code = gen_int(n_code, 0);
39172 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39173 desret_int(ret_val);
39175 des_int(n_code, code, 0);
39176 xmlResetLastError();
39177 if (mem_base != xmlMemBlocks()) {
39178 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39179 xmlMemBlocks() - mem_base);
39181 printf(" %d", n_code);
39193 test_xmlUCSIsCombiningHalfMarks(void) {
39196 #if defined(LIBXML_UNICODE_ENABLED)
39199 int code; /* UCS code point */
39202 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39203 mem_base = xmlMemBlocks();
39204 code = gen_int(n_code, 0);
39206 ret_val = xmlUCSIsCombiningHalfMarks(code);
39207 desret_int(ret_val);
39209 des_int(n_code, code, 0);
39210 xmlResetLastError();
39211 if (mem_base != xmlMemBlocks()) {
39212 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39213 xmlMemBlocks() - mem_base);
39215 printf(" %d", n_code);
39227 test_xmlUCSIsCombiningMarksforSymbols(void) {
39230 #if defined(LIBXML_UNICODE_ENABLED)
39233 int code; /* UCS code point */
39236 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39237 mem_base = xmlMemBlocks();
39238 code = gen_int(n_code, 0);
39240 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39241 desret_int(ret_val);
39243 des_int(n_code, code, 0);
39244 xmlResetLastError();
39245 if (mem_base != xmlMemBlocks()) {
39246 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39247 xmlMemBlocks() - mem_base);
39249 printf(" %d", n_code);
39261 test_xmlUCSIsControlPictures(void) {
39264 #if defined(LIBXML_UNICODE_ENABLED)
39267 int code; /* UCS code point */
39270 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39271 mem_base = xmlMemBlocks();
39272 code = gen_int(n_code, 0);
39274 ret_val = xmlUCSIsControlPictures(code);
39275 desret_int(ret_val);
39277 des_int(n_code, code, 0);
39278 xmlResetLastError();
39279 if (mem_base != xmlMemBlocks()) {
39280 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39281 xmlMemBlocks() - mem_base);
39283 printf(" %d", n_code);
39295 test_xmlUCSIsCurrencySymbols(void) {
39298 #if defined(LIBXML_UNICODE_ENABLED)
39301 int code; /* UCS code point */
39304 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39305 mem_base = xmlMemBlocks();
39306 code = gen_int(n_code, 0);
39308 ret_val = xmlUCSIsCurrencySymbols(code);
39309 desret_int(ret_val);
39311 des_int(n_code, code, 0);
39312 xmlResetLastError();
39313 if (mem_base != xmlMemBlocks()) {
39314 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39315 xmlMemBlocks() - mem_base);
39317 printf(" %d", n_code);
39329 test_xmlUCSIsCypriotSyllabary(void) {
39332 #if defined(LIBXML_UNICODE_ENABLED)
39335 int code; /* UCS code point */
39338 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39339 mem_base = xmlMemBlocks();
39340 code = gen_int(n_code, 0);
39342 ret_val = xmlUCSIsCypriotSyllabary(code);
39343 desret_int(ret_val);
39345 des_int(n_code, code, 0);
39346 xmlResetLastError();
39347 if (mem_base != xmlMemBlocks()) {
39348 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39349 xmlMemBlocks() - mem_base);
39351 printf(" %d", n_code);
39363 test_xmlUCSIsCyrillic(void) {
39366 #if defined(LIBXML_UNICODE_ENABLED)
39369 int code; /* UCS code point */
39372 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39373 mem_base = xmlMemBlocks();
39374 code = gen_int(n_code, 0);
39376 ret_val = xmlUCSIsCyrillic(code);
39377 desret_int(ret_val);
39379 des_int(n_code, code, 0);
39380 xmlResetLastError();
39381 if (mem_base != xmlMemBlocks()) {
39382 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39383 xmlMemBlocks() - mem_base);
39385 printf(" %d", n_code);
39397 test_xmlUCSIsCyrillicSupplement(void) {
39400 #if defined(LIBXML_UNICODE_ENABLED)
39403 int code; /* UCS code point */
39406 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39407 mem_base = xmlMemBlocks();
39408 code = gen_int(n_code, 0);
39410 ret_val = xmlUCSIsCyrillicSupplement(code);
39411 desret_int(ret_val);
39413 des_int(n_code, code, 0);
39414 xmlResetLastError();
39415 if (mem_base != xmlMemBlocks()) {
39416 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39417 xmlMemBlocks() - mem_base);
39419 printf(" %d", n_code);
39431 test_xmlUCSIsDeseret(void) {
39434 #if defined(LIBXML_UNICODE_ENABLED)
39437 int code; /* UCS code point */
39440 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39441 mem_base = xmlMemBlocks();
39442 code = gen_int(n_code, 0);
39444 ret_val = xmlUCSIsDeseret(code);
39445 desret_int(ret_val);
39447 des_int(n_code, code, 0);
39448 xmlResetLastError();
39449 if (mem_base != xmlMemBlocks()) {
39450 printf("Leak of %d blocks found in xmlUCSIsDeseret",
39451 xmlMemBlocks() - mem_base);
39453 printf(" %d", n_code);
39465 test_xmlUCSIsDevanagari(void) {
39468 #if defined(LIBXML_UNICODE_ENABLED)
39471 int code; /* UCS code point */
39474 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39475 mem_base = xmlMemBlocks();
39476 code = gen_int(n_code, 0);
39478 ret_val = xmlUCSIsDevanagari(code);
39479 desret_int(ret_val);
39481 des_int(n_code, code, 0);
39482 xmlResetLastError();
39483 if (mem_base != xmlMemBlocks()) {
39484 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39485 xmlMemBlocks() - mem_base);
39487 printf(" %d", n_code);
39499 test_xmlUCSIsDingbats(void) {
39502 #if defined(LIBXML_UNICODE_ENABLED)
39505 int code; /* UCS code point */
39508 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39509 mem_base = xmlMemBlocks();
39510 code = gen_int(n_code, 0);
39512 ret_val = xmlUCSIsDingbats(code);
39513 desret_int(ret_val);
39515 des_int(n_code, code, 0);
39516 xmlResetLastError();
39517 if (mem_base != xmlMemBlocks()) {
39518 printf("Leak of %d blocks found in xmlUCSIsDingbats",
39519 xmlMemBlocks() - mem_base);
39521 printf(" %d", n_code);
39533 test_xmlUCSIsEnclosedAlphanumerics(void) {
39536 #if defined(LIBXML_UNICODE_ENABLED)
39539 int code; /* UCS code point */
39542 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39543 mem_base = xmlMemBlocks();
39544 code = gen_int(n_code, 0);
39546 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39547 desret_int(ret_val);
39549 des_int(n_code, code, 0);
39550 xmlResetLastError();
39551 if (mem_base != xmlMemBlocks()) {
39552 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39553 xmlMemBlocks() - mem_base);
39555 printf(" %d", n_code);
39567 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39570 #if defined(LIBXML_UNICODE_ENABLED)
39573 int code; /* UCS code point */
39576 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39577 mem_base = xmlMemBlocks();
39578 code = gen_int(n_code, 0);
39580 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39581 desret_int(ret_val);
39583 des_int(n_code, code, 0);
39584 xmlResetLastError();
39585 if (mem_base != xmlMemBlocks()) {
39586 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39587 xmlMemBlocks() - mem_base);
39589 printf(" %d", n_code);
39601 test_xmlUCSIsEthiopic(void) {
39604 #if defined(LIBXML_UNICODE_ENABLED)
39607 int code; /* UCS code point */
39610 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39611 mem_base = xmlMemBlocks();
39612 code = gen_int(n_code, 0);
39614 ret_val = xmlUCSIsEthiopic(code);
39615 desret_int(ret_val);
39617 des_int(n_code, code, 0);
39618 xmlResetLastError();
39619 if (mem_base != xmlMemBlocks()) {
39620 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39621 xmlMemBlocks() - mem_base);
39623 printf(" %d", n_code);
39635 test_xmlUCSIsGeneralPunctuation(void) {
39638 #if defined(LIBXML_UNICODE_ENABLED)
39641 int code; /* UCS code point */
39644 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39645 mem_base = xmlMemBlocks();
39646 code = gen_int(n_code, 0);
39648 ret_val = xmlUCSIsGeneralPunctuation(code);
39649 desret_int(ret_val);
39651 des_int(n_code, code, 0);
39652 xmlResetLastError();
39653 if (mem_base != xmlMemBlocks()) {
39654 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39655 xmlMemBlocks() - mem_base);
39657 printf(" %d", n_code);
39669 test_xmlUCSIsGeometricShapes(void) {
39672 #if defined(LIBXML_UNICODE_ENABLED)
39675 int code; /* UCS code point */
39678 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39679 mem_base = xmlMemBlocks();
39680 code = gen_int(n_code, 0);
39682 ret_val = xmlUCSIsGeometricShapes(code);
39683 desret_int(ret_val);
39685 des_int(n_code, code, 0);
39686 xmlResetLastError();
39687 if (mem_base != xmlMemBlocks()) {
39688 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39689 xmlMemBlocks() - mem_base);
39691 printf(" %d", n_code);
39703 test_xmlUCSIsGeorgian(void) {
39706 #if defined(LIBXML_UNICODE_ENABLED)
39709 int code; /* UCS code point */
39712 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39713 mem_base = xmlMemBlocks();
39714 code = gen_int(n_code, 0);
39716 ret_val = xmlUCSIsGeorgian(code);
39717 desret_int(ret_val);
39719 des_int(n_code, code, 0);
39720 xmlResetLastError();
39721 if (mem_base != xmlMemBlocks()) {
39722 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39723 xmlMemBlocks() - mem_base);
39725 printf(" %d", n_code);
39737 test_xmlUCSIsGothic(void) {
39740 #if defined(LIBXML_UNICODE_ENABLED)
39743 int code; /* UCS code point */
39746 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39747 mem_base = xmlMemBlocks();
39748 code = gen_int(n_code, 0);
39750 ret_val = xmlUCSIsGothic(code);
39751 desret_int(ret_val);
39753 des_int(n_code, code, 0);
39754 xmlResetLastError();
39755 if (mem_base != xmlMemBlocks()) {
39756 printf("Leak of %d blocks found in xmlUCSIsGothic",
39757 xmlMemBlocks() - mem_base);
39759 printf(" %d", n_code);
39771 test_xmlUCSIsGreek(void) {
39774 #if defined(LIBXML_UNICODE_ENABLED)
39777 int code; /* UCS code point */
39780 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39781 mem_base = xmlMemBlocks();
39782 code = gen_int(n_code, 0);
39784 ret_val = xmlUCSIsGreek(code);
39785 desret_int(ret_val);
39787 des_int(n_code, code, 0);
39788 xmlResetLastError();
39789 if (mem_base != xmlMemBlocks()) {
39790 printf("Leak of %d blocks found in xmlUCSIsGreek",
39791 xmlMemBlocks() - mem_base);
39793 printf(" %d", n_code);
39805 test_xmlUCSIsGreekExtended(void) {
39808 #if defined(LIBXML_UNICODE_ENABLED)
39811 int code; /* UCS code point */
39814 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39815 mem_base = xmlMemBlocks();
39816 code = gen_int(n_code, 0);
39818 ret_val = xmlUCSIsGreekExtended(code);
39819 desret_int(ret_val);
39821 des_int(n_code, code, 0);
39822 xmlResetLastError();
39823 if (mem_base != xmlMemBlocks()) {
39824 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39825 xmlMemBlocks() - mem_base);
39827 printf(" %d", n_code);
39839 test_xmlUCSIsGreekandCoptic(void) {
39842 #if defined(LIBXML_UNICODE_ENABLED)
39845 int code; /* UCS code point */
39848 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39849 mem_base = xmlMemBlocks();
39850 code = gen_int(n_code, 0);
39852 ret_val = xmlUCSIsGreekandCoptic(code);
39853 desret_int(ret_val);
39855 des_int(n_code, code, 0);
39856 xmlResetLastError();
39857 if (mem_base != xmlMemBlocks()) {
39858 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39859 xmlMemBlocks() - mem_base);
39861 printf(" %d", n_code);
39873 test_xmlUCSIsGujarati(void) {
39876 #if defined(LIBXML_UNICODE_ENABLED)
39879 int code; /* UCS code point */
39882 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39883 mem_base = xmlMemBlocks();
39884 code = gen_int(n_code, 0);
39886 ret_val = xmlUCSIsGujarati(code);
39887 desret_int(ret_val);
39889 des_int(n_code, code, 0);
39890 xmlResetLastError();
39891 if (mem_base != xmlMemBlocks()) {
39892 printf("Leak of %d blocks found in xmlUCSIsGujarati",
39893 xmlMemBlocks() - mem_base);
39895 printf(" %d", n_code);
39907 test_xmlUCSIsGurmukhi(void) {
39910 #if defined(LIBXML_UNICODE_ENABLED)
39913 int code; /* UCS code point */
39916 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39917 mem_base = xmlMemBlocks();
39918 code = gen_int(n_code, 0);
39920 ret_val = xmlUCSIsGurmukhi(code);
39921 desret_int(ret_val);
39923 des_int(n_code, code, 0);
39924 xmlResetLastError();
39925 if (mem_base != xmlMemBlocks()) {
39926 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39927 xmlMemBlocks() - mem_base);
39929 printf(" %d", n_code);
39941 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39944 #if defined(LIBXML_UNICODE_ENABLED)
39947 int code; /* UCS code point */
39950 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39951 mem_base = xmlMemBlocks();
39952 code = gen_int(n_code, 0);
39954 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39955 desret_int(ret_val);
39957 des_int(n_code, code, 0);
39958 xmlResetLastError();
39959 if (mem_base != xmlMemBlocks()) {
39960 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39961 xmlMemBlocks() - mem_base);
39963 printf(" %d", n_code);
39975 test_xmlUCSIsHangulCompatibilityJamo(void) {
39978 #if defined(LIBXML_UNICODE_ENABLED)
39981 int code; /* UCS code point */
39984 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39985 mem_base = xmlMemBlocks();
39986 code = gen_int(n_code, 0);
39988 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39989 desret_int(ret_val);
39991 des_int(n_code, code, 0);
39992 xmlResetLastError();
39993 if (mem_base != xmlMemBlocks()) {
39994 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39995 xmlMemBlocks() - mem_base);
39997 printf(" %d", n_code);
40009 test_xmlUCSIsHangulJamo(void) {
40012 #if defined(LIBXML_UNICODE_ENABLED)
40015 int code; /* UCS code point */
40018 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40019 mem_base = xmlMemBlocks();
40020 code = gen_int(n_code, 0);
40022 ret_val = xmlUCSIsHangulJamo(code);
40023 desret_int(ret_val);
40025 des_int(n_code, code, 0);
40026 xmlResetLastError();
40027 if (mem_base != xmlMemBlocks()) {
40028 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40029 xmlMemBlocks() - mem_base);
40031 printf(" %d", n_code);
40043 test_xmlUCSIsHangulSyllables(void) {
40046 #if defined(LIBXML_UNICODE_ENABLED)
40049 int code; /* UCS code point */
40052 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40053 mem_base = xmlMemBlocks();
40054 code = gen_int(n_code, 0);
40056 ret_val = xmlUCSIsHangulSyllables(code);
40057 desret_int(ret_val);
40059 des_int(n_code, code, 0);
40060 xmlResetLastError();
40061 if (mem_base != xmlMemBlocks()) {
40062 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40063 xmlMemBlocks() - mem_base);
40065 printf(" %d", n_code);
40077 test_xmlUCSIsHanunoo(void) {
40080 #if defined(LIBXML_UNICODE_ENABLED)
40083 int code; /* UCS code point */
40086 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40087 mem_base = xmlMemBlocks();
40088 code = gen_int(n_code, 0);
40090 ret_val = xmlUCSIsHanunoo(code);
40091 desret_int(ret_val);
40093 des_int(n_code, code, 0);
40094 xmlResetLastError();
40095 if (mem_base != xmlMemBlocks()) {
40096 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40097 xmlMemBlocks() - mem_base);
40099 printf(" %d", n_code);
40111 test_xmlUCSIsHebrew(void) {
40114 #if defined(LIBXML_UNICODE_ENABLED)
40117 int code; /* UCS code point */
40120 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40121 mem_base = xmlMemBlocks();
40122 code = gen_int(n_code, 0);
40124 ret_val = xmlUCSIsHebrew(code);
40125 desret_int(ret_val);
40127 des_int(n_code, code, 0);
40128 xmlResetLastError();
40129 if (mem_base != xmlMemBlocks()) {
40130 printf("Leak of %d blocks found in xmlUCSIsHebrew",
40131 xmlMemBlocks() - mem_base);
40133 printf(" %d", n_code);
40145 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40148 #if defined(LIBXML_UNICODE_ENABLED)
40151 int code; /* UCS code point */
40154 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40155 mem_base = xmlMemBlocks();
40156 code = gen_int(n_code, 0);
40158 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40159 desret_int(ret_val);
40161 des_int(n_code, code, 0);
40162 xmlResetLastError();
40163 if (mem_base != xmlMemBlocks()) {
40164 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40165 xmlMemBlocks() - mem_base);
40167 printf(" %d", n_code);
40179 test_xmlUCSIsHighSurrogates(void) {
40182 #if defined(LIBXML_UNICODE_ENABLED)
40185 int code; /* UCS code point */
40188 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40189 mem_base = xmlMemBlocks();
40190 code = gen_int(n_code, 0);
40192 ret_val = xmlUCSIsHighSurrogates(code);
40193 desret_int(ret_val);
40195 des_int(n_code, code, 0);
40196 xmlResetLastError();
40197 if (mem_base != xmlMemBlocks()) {
40198 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40199 xmlMemBlocks() - mem_base);
40201 printf(" %d", n_code);
40213 test_xmlUCSIsHiragana(void) {
40216 #if defined(LIBXML_UNICODE_ENABLED)
40219 int code; /* UCS code point */
40222 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40223 mem_base = xmlMemBlocks();
40224 code = gen_int(n_code, 0);
40226 ret_val = xmlUCSIsHiragana(code);
40227 desret_int(ret_val);
40229 des_int(n_code, code, 0);
40230 xmlResetLastError();
40231 if (mem_base != xmlMemBlocks()) {
40232 printf("Leak of %d blocks found in xmlUCSIsHiragana",
40233 xmlMemBlocks() - mem_base);
40235 printf(" %d", n_code);
40247 test_xmlUCSIsIPAExtensions(void) {
40250 #if defined(LIBXML_UNICODE_ENABLED)
40253 int code; /* UCS code point */
40256 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40257 mem_base = xmlMemBlocks();
40258 code = gen_int(n_code, 0);
40260 ret_val = xmlUCSIsIPAExtensions(code);
40261 desret_int(ret_val);
40263 des_int(n_code, code, 0);
40264 xmlResetLastError();
40265 if (mem_base != xmlMemBlocks()) {
40266 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40267 xmlMemBlocks() - mem_base);
40269 printf(" %d", n_code);
40281 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40284 #if defined(LIBXML_UNICODE_ENABLED)
40287 int code; /* UCS code point */
40290 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40291 mem_base = xmlMemBlocks();
40292 code = gen_int(n_code, 0);
40294 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40295 desret_int(ret_val);
40297 des_int(n_code, code, 0);
40298 xmlResetLastError();
40299 if (mem_base != xmlMemBlocks()) {
40300 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40301 xmlMemBlocks() - mem_base);
40303 printf(" %d", n_code);
40315 test_xmlUCSIsKanbun(void) {
40318 #if defined(LIBXML_UNICODE_ENABLED)
40321 int code; /* UCS code point */
40324 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40325 mem_base = xmlMemBlocks();
40326 code = gen_int(n_code, 0);
40328 ret_val = xmlUCSIsKanbun(code);
40329 desret_int(ret_val);
40331 des_int(n_code, code, 0);
40332 xmlResetLastError();
40333 if (mem_base != xmlMemBlocks()) {
40334 printf("Leak of %d blocks found in xmlUCSIsKanbun",
40335 xmlMemBlocks() - mem_base);
40337 printf(" %d", n_code);
40349 test_xmlUCSIsKangxiRadicals(void) {
40352 #if defined(LIBXML_UNICODE_ENABLED)
40355 int code; /* UCS code point */
40358 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40359 mem_base = xmlMemBlocks();
40360 code = gen_int(n_code, 0);
40362 ret_val = xmlUCSIsKangxiRadicals(code);
40363 desret_int(ret_val);
40365 des_int(n_code, code, 0);
40366 xmlResetLastError();
40367 if (mem_base != xmlMemBlocks()) {
40368 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40369 xmlMemBlocks() - mem_base);
40371 printf(" %d", n_code);
40383 test_xmlUCSIsKannada(void) {
40386 #if defined(LIBXML_UNICODE_ENABLED)
40389 int code; /* UCS code point */
40392 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40393 mem_base = xmlMemBlocks();
40394 code = gen_int(n_code, 0);
40396 ret_val = xmlUCSIsKannada(code);
40397 desret_int(ret_val);
40399 des_int(n_code, code, 0);
40400 xmlResetLastError();
40401 if (mem_base != xmlMemBlocks()) {
40402 printf("Leak of %d blocks found in xmlUCSIsKannada",
40403 xmlMemBlocks() - mem_base);
40405 printf(" %d", n_code);
40417 test_xmlUCSIsKatakana(void) {
40420 #if defined(LIBXML_UNICODE_ENABLED)
40423 int code; /* UCS code point */
40426 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40427 mem_base = xmlMemBlocks();
40428 code = gen_int(n_code, 0);
40430 ret_val = xmlUCSIsKatakana(code);
40431 desret_int(ret_val);
40433 des_int(n_code, code, 0);
40434 xmlResetLastError();
40435 if (mem_base != xmlMemBlocks()) {
40436 printf("Leak of %d blocks found in xmlUCSIsKatakana",
40437 xmlMemBlocks() - mem_base);
40439 printf(" %d", n_code);
40451 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40454 #if defined(LIBXML_UNICODE_ENABLED)
40457 int code; /* UCS code point */
40460 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40461 mem_base = xmlMemBlocks();
40462 code = gen_int(n_code, 0);
40464 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40465 desret_int(ret_val);
40467 des_int(n_code, code, 0);
40468 xmlResetLastError();
40469 if (mem_base != xmlMemBlocks()) {
40470 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40471 xmlMemBlocks() - mem_base);
40473 printf(" %d", n_code);
40485 test_xmlUCSIsKhmer(void) {
40488 #if defined(LIBXML_UNICODE_ENABLED)
40491 int code; /* UCS code point */
40494 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40495 mem_base = xmlMemBlocks();
40496 code = gen_int(n_code, 0);
40498 ret_val = xmlUCSIsKhmer(code);
40499 desret_int(ret_val);
40501 des_int(n_code, code, 0);
40502 xmlResetLastError();
40503 if (mem_base != xmlMemBlocks()) {
40504 printf("Leak of %d blocks found in xmlUCSIsKhmer",
40505 xmlMemBlocks() - mem_base);
40507 printf(" %d", n_code);
40519 test_xmlUCSIsKhmerSymbols(void) {
40522 #if defined(LIBXML_UNICODE_ENABLED)
40525 int code; /* UCS code point */
40528 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40529 mem_base = xmlMemBlocks();
40530 code = gen_int(n_code, 0);
40532 ret_val = xmlUCSIsKhmerSymbols(code);
40533 desret_int(ret_val);
40535 des_int(n_code, code, 0);
40536 xmlResetLastError();
40537 if (mem_base != xmlMemBlocks()) {
40538 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40539 xmlMemBlocks() - mem_base);
40541 printf(" %d", n_code);
40553 test_xmlUCSIsLao(void) {
40556 #if defined(LIBXML_UNICODE_ENABLED)
40559 int code; /* UCS code point */
40562 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40563 mem_base = xmlMemBlocks();
40564 code = gen_int(n_code, 0);
40566 ret_val = xmlUCSIsLao(code);
40567 desret_int(ret_val);
40569 des_int(n_code, code, 0);
40570 xmlResetLastError();
40571 if (mem_base != xmlMemBlocks()) {
40572 printf("Leak of %d blocks found in xmlUCSIsLao",
40573 xmlMemBlocks() - mem_base);
40575 printf(" %d", n_code);
40587 test_xmlUCSIsLatin1Supplement(void) {
40590 #if defined(LIBXML_UNICODE_ENABLED)
40593 int code; /* UCS code point */
40596 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40597 mem_base = xmlMemBlocks();
40598 code = gen_int(n_code, 0);
40600 ret_val = xmlUCSIsLatin1Supplement(code);
40601 desret_int(ret_val);
40603 des_int(n_code, code, 0);
40604 xmlResetLastError();
40605 if (mem_base != xmlMemBlocks()) {
40606 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40607 xmlMemBlocks() - mem_base);
40609 printf(" %d", n_code);
40621 test_xmlUCSIsLatinExtendedA(void) {
40624 #if defined(LIBXML_UNICODE_ENABLED)
40627 int code; /* UCS code point */
40630 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40631 mem_base = xmlMemBlocks();
40632 code = gen_int(n_code, 0);
40634 ret_val = xmlUCSIsLatinExtendedA(code);
40635 desret_int(ret_val);
40637 des_int(n_code, code, 0);
40638 xmlResetLastError();
40639 if (mem_base != xmlMemBlocks()) {
40640 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40641 xmlMemBlocks() - mem_base);
40643 printf(" %d", n_code);
40655 test_xmlUCSIsLatinExtendedAdditional(void) {
40658 #if defined(LIBXML_UNICODE_ENABLED)
40661 int code; /* UCS code point */
40664 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40665 mem_base = xmlMemBlocks();
40666 code = gen_int(n_code, 0);
40668 ret_val = xmlUCSIsLatinExtendedAdditional(code);
40669 desret_int(ret_val);
40671 des_int(n_code, code, 0);
40672 xmlResetLastError();
40673 if (mem_base != xmlMemBlocks()) {
40674 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40675 xmlMemBlocks() - mem_base);
40677 printf(" %d", n_code);
40689 test_xmlUCSIsLatinExtendedB(void) {
40692 #if defined(LIBXML_UNICODE_ENABLED)
40695 int code; /* UCS code point */
40698 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40699 mem_base = xmlMemBlocks();
40700 code = gen_int(n_code, 0);
40702 ret_val = xmlUCSIsLatinExtendedB(code);
40703 desret_int(ret_val);
40705 des_int(n_code, code, 0);
40706 xmlResetLastError();
40707 if (mem_base != xmlMemBlocks()) {
40708 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40709 xmlMemBlocks() - mem_base);
40711 printf(" %d", n_code);
40723 test_xmlUCSIsLetterlikeSymbols(void) {
40726 #if defined(LIBXML_UNICODE_ENABLED)
40729 int code; /* UCS code point */
40732 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40733 mem_base = xmlMemBlocks();
40734 code = gen_int(n_code, 0);
40736 ret_val = xmlUCSIsLetterlikeSymbols(code);
40737 desret_int(ret_val);
40739 des_int(n_code, code, 0);
40740 xmlResetLastError();
40741 if (mem_base != xmlMemBlocks()) {
40742 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40743 xmlMemBlocks() - mem_base);
40745 printf(" %d", n_code);
40757 test_xmlUCSIsLimbu(void) {
40760 #if defined(LIBXML_UNICODE_ENABLED)
40763 int code; /* UCS code point */
40766 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40767 mem_base = xmlMemBlocks();
40768 code = gen_int(n_code, 0);
40770 ret_val = xmlUCSIsLimbu(code);
40771 desret_int(ret_val);
40773 des_int(n_code, code, 0);
40774 xmlResetLastError();
40775 if (mem_base != xmlMemBlocks()) {
40776 printf("Leak of %d blocks found in xmlUCSIsLimbu",
40777 xmlMemBlocks() - mem_base);
40779 printf(" %d", n_code);
40791 test_xmlUCSIsLinearBIdeograms(void) {
40794 #if defined(LIBXML_UNICODE_ENABLED)
40797 int code; /* UCS code point */
40800 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40801 mem_base = xmlMemBlocks();
40802 code = gen_int(n_code, 0);
40804 ret_val = xmlUCSIsLinearBIdeograms(code);
40805 desret_int(ret_val);
40807 des_int(n_code, code, 0);
40808 xmlResetLastError();
40809 if (mem_base != xmlMemBlocks()) {
40810 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40811 xmlMemBlocks() - mem_base);
40813 printf(" %d", n_code);
40825 test_xmlUCSIsLinearBSyllabary(void) {
40828 #if defined(LIBXML_UNICODE_ENABLED)
40831 int code; /* UCS code point */
40834 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40835 mem_base = xmlMemBlocks();
40836 code = gen_int(n_code, 0);
40838 ret_val = xmlUCSIsLinearBSyllabary(code);
40839 desret_int(ret_val);
40841 des_int(n_code, code, 0);
40842 xmlResetLastError();
40843 if (mem_base != xmlMemBlocks()) {
40844 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40845 xmlMemBlocks() - mem_base);
40847 printf(" %d", n_code);
40859 test_xmlUCSIsLowSurrogates(void) {
40862 #if defined(LIBXML_UNICODE_ENABLED)
40865 int code; /* UCS code point */
40868 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40869 mem_base = xmlMemBlocks();
40870 code = gen_int(n_code, 0);
40872 ret_val = xmlUCSIsLowSurrogates(code);
40873 desret_int(ret_val);
40875 des_int(n_code, code, 0);
40876 xmlResetLastError();
40877 if (mem_base != xmlMemBlocks()) {
40878 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40879 xmlMemBlocks() - mem_base);
40881 printf(" %d", n_code);
40893 test_xmlUCSIsMalayalam(void) {
40896 #if defined(LIBXML_UNICODE_ENABLED)
40899 int code; /* UCS code point */
40902 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40903 mem_base = xmlMemBlocks();
40904 code = gen_int(n_code, 0);
40906 ret_val = xmlUCSIsMalayalam(code);
40907 desret_int(ret_val);
40909 des_int(n_code, code, 0);
40910 xmlResetLastError();
40911 if (mem_base != xmlMemBlocks()) {
40912 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40913 xmlMemBlocks() - mem_base);
40915 printf(" %d", n_code);
40927 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40930 #if defined(LIBXML_UNICODE_ENABLED)
40933 int code; /* UCS code point */
40936 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40937 mem_base = xmlMemBlocks();
40938 code = gen_int(n_code, 0);
40940 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40941 desret_int(ret_val);
40943 des_int(n_code, code, 0);
40944 xmlResetLastError();
40945 if (mem_base != xmlMemBlocks()) {
40946 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40947 xmlMemBlocks() - mem_base);
40949 printf(" %d", n_code);
40961 test_xmlUCSIsMathematicalOperators(void) {
40964 #if defined(LIBXML_UNICODE_ENABLED)
40967 int code; /* UCS code point */
40970 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40971 mem_base = xmlMemBlocks();
40972 code = gen_int(n_code, 0);
40974 ret_val = xmlUCSIsMathematicalOperators(code);
40975 desret_int(ret_val);
40977 des_int(n_code, code, 0);
40978 xmlResetLastError();
40979 if (mem_base != xmlMemBlocks()) {
40980 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40981 xmlMemBlocks() - mem_base);
40983 printf(" %d", n_code);
40995 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40998 #if defined(LIBXML_UNICODE_ENABLED)
41001 int code; /* UCS code point */
41004 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41005 mem_base = xmlMemBlocks();
41006 code = gen_int(n_code, 0);
41008 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41009 desret_int(ret_val);
41011 des_int(n_code, code, 0);
41012 xmlResetLastError();
41013 if (mem_base != xmlMemBlocks()) {
41014 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41015 xmlMemBlocks() - mem_base);
41017 printf(" %d", n_code);
41029 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41032 #if defined(LIBXML_UNICODE_ENABLED)
41035 int code; /* UCS code point */
41038 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41039 mem_base = xmlMemBlocks();
41040 code = gen_int(n_code, 0);
41042 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41043 desret_int(ret_val);
41045 des_int(n_code, code, 0);
41046 xmlResetLastError();
41047 if (mem_base != xmlMemBlocks()) {
41048 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41049 xmlMemBlocks() - mem_base);
41051 printf(" %d", n_code);
41063 test_xmlUCSIsMiscellaneousSymbols(void) {
41066 #if defined(LIBXML_UNICODE_ENABLED)
41069 int code; /* UCS code point */
41072 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41073 mem_base = xmlMemBlocks();
41074 code = gen_int(n_code, 0);
41076 ret_val = xmlUCSIsMiscellaneousSymbols(code);
41077 desret_int(ret_val);
41079 des_int(n_code, code, 0);
41080 xmlResetLastError();
41081 if (mem_base != xmlMemBlocks()) {
41082 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41083 xmlMemBlocks() - mem_base);
41085 printf(" %d", n_code);
41097 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41100 #if defined(LIBXML_UNICODE_ENABLED)
41103 int code; /* UCS code point */
41106 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41107 mem_base = xmlMemBlocks();
41108 code = gen_int(n_code, 0);
41110 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41111 desret_int(ret_val);
41113 des_int(n_code, code, 0);
41114 xmlResetLastError();
41115 if (mem_base != xmlMemBlocks()) {
41116 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41117 xmlMemBlocks() - mem_base);
41119 printf(" %d", n_code);
41131 test_xmlUCSIsMiscellaneousTechnical(void) {
41134 #if defined(LIBXML_UNICODE_ENABLED)
41137 int code; /* UCS code point */
41140 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41141 mem_base = xmlMemBlocks();
41142 code = gen_int(n_code, 0);
41144 ret_val = xmlUCSIsMiscellaneousTechnical(code);
41145 desret_int(ret_val);
41147 des_int(n_code, code, 0);
41148 xmlResetLastError();
41149 if (mem_base != xmlMemBlocks()) {
41150 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41151 xmlMemBlocks() - mem_base);
41153 printf(" %d", n_code);
41165 test_xmlUCSIsMongolian(void) {
41168 #if defined(LIBXML_UNICODE_ENABLED)
41171 int code; /* UCS code point */
41174 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41175 mem_base = xmlMemBlocks();
41176 code = gen_int(n_code, 0);
41178 ret_val = xmlUCSIsMongolian(code);
41179 desret_int(ret_val);
41181 des_int(n_code, code, 0);
41182 xmlResetLastError();
41183 if (mem_base != xmlMemBlocks()) {
41184 printf("Leak of %d blocks found in xmlUCSIsMongolian",
41185 xmlMemBlocks() - mem_base);
41187 printf(" %d", n_code);
41199 test_xmlUCSIsMusicalSymbols(void) {
41202 #if defined(LIBXML_UNICODE_ENABLED)
41205 int code; /* UCS code point */
41208 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41209 mem_base = xmlMemBlocks();
41210 code = gen_int(n_code, 0);
41212 ret_val = xmlUCSIsMusicalSymbols(code);
41213 desret_int(ret_val);
41215 des_int(n_code, code, 0);
41216 xmlResetLastError();
41217 if (mem_base != xmlMemBlocks()) {
41218 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41219 xmlMemBlocks() - mem_base);
41221 printf(" %d", n_code);
41233 test_xmlUCSIsMyanmar(void) {
41236 #if defined(LIBXML_UNICODE_ENABLED)
41239 int code; /* UCS code point */
41242 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41243 mem_base = xmlMemBlocks();
41244 code = gen_int(n_code, 0);
41246 ret_val = xmlUCSIsMyanmar(code);
41247 desret_int(ret_val);
41249 des_int(n_code, code, 0);
41250 xmlResetLastError();
41251 if (mem_base != xmlMemBlocks()) {
41252 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41253 xmlMemBlocks() - mem_base);
41255 printf(" %d", n_code);
41267 test_xmlUCSIsNumberForms(void) {
41270 #if defined(LIBXML_UNICODE_ENABLED)
41273 int code; /* UCS code point */
41276 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41277 mem_base = xmlMemBlocks();
41278 code = gen_int(n_code, 0);
41280 ret_val = xmlUCSIsNumberForms(code);
41281 desret_int(ret_val);
41283 des_int(n_code, code, 0);
41284 xmlResetLastError();
41285 if (mem_base != xmlMemBlocks()) {
41286 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41287 xmlMemBlocks() - mem_base);
41289 printf(" %d", n_code);
41301 test_xmlUCSIsOgham(void) {
41304 #if defined(LIBXML_UNICODE_ENABLED)
41307 int code; /* UCS code point */
41310 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41311 mem_base = xmlMemBlocks();
41312 code = gen_int(n_code, 0);
41314 ret_val = xmlUCSIsOgham(code);
41315 desret_int(ret_val);
41317 des_int(n_code, code, 0);
41318 xmlResetLastError();
41319 if (mem_base != xmlMemBlocks()) {
41320 printf("Leak of %d blocks found in xmlUCSIsOgham",
41321 xmlMemBlocks() - mem_base);
41323 printf(" %d", n_code);
41335 test_xmlUCSIsOldItalic(void) {
41338 #if defined(LIBXML_UNICODE_ENABLED)
41341 int code; /* UCS code point */
41344 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41345 mem_base = xmlMemBlocks();
41346 code = gen_int(n_code, 0);
41348 ret_val = xmlUCSIsOldItalic(code);
41349 desret_int(ret_val);
41351 des_int(n_code, code, 0);
41352 xmlResetLastError();
41353 if (mem_base != xmlMemBlocks()) {
41354 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41355 xmlMemBlocks() - mem_base);
41357 printf(" %d", n_code);
41369 test_xmlUCSIsOpticalCharacterRecognition(void) {
41372 #if defined(LIBXML_UNICODE_ENABLED)
41375 int code; /* UCS code point */
41378 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41379 mem_base = xmlMemBlocks();
41380 code = gen_int(n_code, 0);
41382 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41383 desret_int(ret_val);
41385 des_int(n_code, code, 0);
41386 xmlResetLastError();
41387 if (mem_base != xmlMemBlocks()) {
41388 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41389 xmlMemBlocks() - mem_base);
41391 printf(" %d", n_code);
41403 test_xmlUCSIsOriya(void) {
41406 #if defined(LIBXML_UNICODE_ENABLED)
41409 int code; /* UCS code point */
41412 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41413 mem_base = xmlMemBlocks();
41414 code = gen_int(n_code, 0);
41416 ret_val = xmlUCSIsOriya(code);
41417 desret_int(ret_val);
41419 des_int(n_code, code, 0);
41420 xmlResetLastError();
41421 if (mem_base != xmlMemBlocks()) {
41422 printf("Leak of %d blocks found in xmlUCSIsOriya",
41423 xmlMemBlocks() - mem_base);
41425 printf(" %d", n_code);
41437 test_xmlUCSIsOsmanya(void) {
41440 #if defined(LIBXML_UNICODE_ENABLED)
41443 int code; /* UCS code point */
41446 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41447 mem_base = xmlMemBlocks();
41448 code = gen_int(n_code, 0);
41450 ret_val = xmlUCSIsOsmanya(code);
41451 desret_int(ret_val);
41453 des_int(n_code, code, 0);
41454 xmlResetLastError();
41455 if (mem_base != xmlMemBlocks()) {
41456 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41457 xmlMemBlocks() - mem_base);
41459 printf(" %d", n_code);
41471 test_xmlUCSIsPhoneticExtensions(void) {
41474 #if defined(LIBXML_UNICODE_ENABLED)
41477 int code; /* UCS code point */
41480 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41481 mem_base = xmlMemBlocks();
41482 code = gen_int(n_code, 0);
41484 ret_val = xmlUCSIsPhoneticExtensions(code);
41485 desret_int(ret_val);
41487 des_int(n_code, code, 0);
41488 xmlResetLastError();
41489 if (mem_base != xmlMemBlocks()) {
41490 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41491 xmlMemBlocks() - mem_base);
41493 printf(" %d", n_code);
41505 test_xmlUCSIsPrivateUse(void) {
41508 #if defined(LIBXML_UNICODE_ENABLED)
41511 int code; /* UCS code point */
41514 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41515 mem_base = xmlMemBlocks();
41516 code = gen_int(n_code, 0);
41518 ret_val = xmlUCSIsPrivateUse(code);
41519 desret_int(ret_val);
41521 des_int(n_code, code, 0);
41522 xmlResetLastError();
41523 if (mem_base != xmlMemBlocks()) {
41524 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41525 xmlMemBlocks() - mem_base);
41527 printf(" %d", n_code);
41539 test_xmlUCSIsPrivateUseArea(void) {
41542 #if defined(LIBXML_UNICODE_ENABLED)
41545 int code; /* UCS code point */
41548 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41549 mem_base = xmlMemBlocks();
41550 code = gen_int(n_code, 0);
41552 ret_val = xmlUCSIsPrivateUseArea(code);
41553 desret_int(ret_val);
41555 des_int(n_code, code, 0);
41556 xmlResetLastError();
41557 if (mem_base != xmlMemBlocks()) {
41558 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41559 xmlMemBlocks() - mem_base);
41561 printf(" %d", n_code);
41573 test_xmlUCSIsRunic(void) {
41576 #if defined(LIBXML_UNICODE_ENABLED)
41579 int code; /* UCS code point */
41582 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41583 mem_base = xmlMemBlocks();
41584 code = gen_int(n_code, 0);
41586 ret_val = xmlUCSIsRunic(code);
41587 desret_int(ret_val);
41589 des_int(n_code, code, 0);
41590 xmlResetLastError();
41591 if (mem_base != xmlMemBlocks()) {
41592 printf("Leak of %d blocks found in xmlUCSIsRunic",
41593 xmlMemBlocks() - mem_base);
41595 printf(" %d", n_code);
41607 test_xmlUCSIsShavian(void) {
41610 #if defined(LIBXML_UNICODE_ENABLED)
41613 int code; /* UCS code point */
41616 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41617 mem_base = xmlMemBlocks();
41618 code = gen_int(n_code, 0);
41620 ret_val = xmlUCSIsShavian(code);
41621 desret_int(ret_val);
41623 des_int(n_code, code, 0);
41624 xmlResetLastError();
41625 if (mem_base != xmlMemBlocks()) {
41626 printf("Leak of %d blocks found in xmlUCSIsShavian",
41627 xmlMemBlocks() - mem_base);
41629 printf(" %d", n_code);
41641 test_xmlUCSIsSinhala(void) {
41644 #if defined(LIBXML_UNICODE_ENABLED)
41647 int code; /* UCS code point */
41650 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41651 mem_base = xmlMemBlocks();
41652 code = gen_int(n_code, 0);
41654 ret_val = xmlUCSIsSinhala(code);
41655 desret_int(ret_val);
41657 des_int(n_code, code, 0);
41658 xmlResetLastError();
41659 if (mem_base != xmlMemBlocks()) {
41660 printf("Leak of %d blocks found in xmlUCSIsSinhala",
41661 xmlMemBlocks() - mem_base);
41663 printf(" %d", n_code);
41675 test_xmlUCSIsSmallFormVariants(void) {
41678 #if defined(LIBXML_UNICODE_ENABLED)
41681 int code; /* UCS code point */
41684 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41685 mem_base = xmlMemBlocks();
41686 code = gen_int(n_code, 0);
41688 ret_val = xmlUCSIsSmallFormVariants(code);
41689 desret_int(ret_val);
41691 des_int(n_code, code, 0);
41692 xmlResetLastError();
41693 if (mem_base != xmlMemBlocks()) {
41694 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41695 xmlMemBlocks() - mem_base);
41697 printf(" %d", n_code);
41709 test_xmlUCSIsSpacingModifierLetters(void) {
41712 #if defined(LIBXML_UNICODE_ENABLED)
41715 int code; /* UCS code point */
41718 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41719 mem_base = xmlMemBlocks();
41720 code = gen_int(n_code, 0);
41722 ret_val = xmlUCSIsSpacingModifierLetters(code);
41723 desret_int(ret_val);
41725 des_int(n_code, code, 0);
41726 xmlResetLastError();
41727 if (mem_base != xmlMemBlocks()) {
41728 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41729 xmlMemBlocks() - mem_base);
41731 printf(" %d", n_code);
41743 test_xmlUCSIsSpecials(void) {
41746 #if defined(LIBXML_UNICODE_ENABLED)
41749 int code; /* UCS code point */
41752 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41753 mem_base = xmlMemBlocks();
41754 code = gen_int(n_code, 0);
41756 ret_val = xmlUCSIsSpecials(code);
41757 desret_int(ret_val);
41759 des_int(n_code, code, 0);
41760 xmlResetLastError();
41761 if (mem_base != xmlMemBlocks()) {
41762 printf("Leak of %d blocks found in xmlUCSIsSpecials",
41763 xmlMemBlocks() - mem_base);
41765 printf(" %d", n_code);
41777 test_xmlUCSIsSuperscriptsandSubscripts(void) {
41780 #if defined(LIBXML_UNICODE_ENABLED)
41783 int code; /* UCS code point */
41786 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41787 mem_base = xmlMemBlocks();
41788 code = gen_int(n_code, 0);
41790 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41791 desret_int(ret_val);
41793 des_int(n_code, code, 0);
41794 xmlResetLastError();
41795 if (mem_base != xmlMemBlocks()) {
41796 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41797 xmlMemBlocks() - mem_base);
41799 printf(" %d", n_code);
41811 test_xmlUCSIsSupplementalArrowsA(void) {
41814 #if defined(LIBXML_UNICODE_ENABLED)
41817 int code; /* UCS code point */
41820 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41821 mem_base = xmlMemBlocks();
41822 code = gen_int(n_code, 0);
41824 ret_val = xmlUCSIsSupplementalArrowsA(code);
41825 desret_int(ret_val);
41827 des_int(n_code, code, 0);
41828 xmlResetLastError();
41829 if (mem_base != xmlMemBlocks()) {
41830 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41831 xmlMemBlocks() - mem_base);
41833 printf(" %d", n_code);
41845 test_xmlUCSIsSupplementalArrowsB(void) {
41848 #if defined(LIBXML_UNICODE_ENABLED)
41851 int code; /* UCS code point */
41854 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41855 mem_base = xmlMemBlocks();
41856 code = gen_int(n_code, 0);
41858 ret_val = xmlUCSIsSupplementalArrowsB(code);
41859 desret_int(ret_val);
41861 des_int(n_code, code, 0);
41862 xmlResetLastError();
41863 if (mem_base != xmlMemBlocks()) {
41864 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41865 xmlMemBlocks() - mem_base);
41867 printf(" %d", n_code);
41879 test_xmlUCSIsSupplementalMathematicalOperators(void) {
41882 #if defined(LIBXML_UNICODE_ENABLED)
41885 int code; /* UCS code point */
41888 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41889 mem_base = xmlMemBlocks();
41890 code = gen_int(n_code, 0);
41892 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41893 desret_int(ret_val);
41895 des_int(n_code, code, 0);
41896 xmlResetLastError();
41897 if (mem_base != xmlMemBlocks()) {
41898 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41899 xmlMemBlocks() - mem_base);
41901 printf(" %d", n_code);
41913 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41916 #if defined(LIBXML_UNICODE_ENABLED)
41919 int code; /* UCS code point */
41922 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41923 mem_base = xmlMemBlocks();
41924 code = gen_int(n_code, 0);
41926 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41927 desret_int(ret_val);
41929 des_int(n_code, code, 0);
41930 xmlResetLastError();
41931 if (mem_base != xmlMemBlocks()) {
41932 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41933 xmlMemBlocks() - mem_base);
41935 printf(" %d", n_code);
41947 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41950 #if defined(LIBXML_UNICODE_ENABLED)
41953 int code; /* UCS code point */
41956 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41957 mem_base = xmlMemBlocks();
41958 code = gen_int(n_code, 0);
41960 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41961 desret_int(ret_val);
41963 des_int(n_code, code, 0);
41964 xmlResetLastError();
41965 if (mem_base != xmlMemBlocks()) {
41966 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41967 xmlMemBlocks() - mem_base);
41969 printf(" %d", n_code);
41981 test_xmlUCSIsSyriac(void) {
41984 #if defined(LIBXML_UNICODE_ENABLED)
41987 int code; /* UCS code point */
41990 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41991 mem_base = xmlMemBlocks();
41992 code = gen_int(n_code, 0);
41994 ret_val = xmlUCSIsSyriac(code);
41995 desret_int(ret_val);
41997 des_int(n_code, code, 0);
41998 xmlResetLastError();
41999 if (mem_base != xmlMemBlocks()) {
42000 printf("Leak of %d blocks found in xmlUCSIsSyriac",
42001 xmlMemBlocks() - mem_base);
42003 printf(" %d", n_code);
42015 test_xmlUCSIsTagalog(void) {
42018 #if defined(LIBXML_UNICODE_ENABLED)
42021 int code; /* UCS code point */
42024 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42025 mem_base = xmlMemBlocks();
42026 code = gen_int(n_code, 0);
42028 ret_val = xmlUCSIsTagalog(code);
42029 desret_int(ret_val);
42031 des_int(n_code, code, 0);
42032 xmlResetLastError();
42033 if (mem_base != xmlMemBlocks()) {
42034 printf("Leak of %d blocks found in xmlUCSIsTagalog",
42035 xmlMemBlocks() - mem_base);
42037 printf(" %d", n_code);
42049 test_xmlUCSIsTagbanwa(void) {
42052 #if defined(LIBXML_UNICODE_ENABLED)
42055 int code; /* UCS code point */
42058 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42059 mem_base = xmlMemBlocks();
42060 code = gen_int(n_code, 0);
42062 ret_val = xmlUCSIsTagbanwa(code);
42063 desret_int(ret_val);
42065 des_int(n_code, code, 0);
42066 xmlResetLastError();
42067 if (mem_base != xmlMemBlocks()) {
42068 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42069 xmlMemBlocks() - mem_base);
42071 printf(" %d", n_code);
42083 test_xmlUCSIsTags(void) {
42086 #if defined(LIBXML_UNICODE_ENABLED)
42089 int code; /* UCS code point */
42092 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42093 mem_base = xmlMemBlocks();
42094 code = gen_int(n_code, 0);
42096 ret_val = xmlUCSIsTags(code);
42097 desret_int(ret_val);
42099 des_int(n_code, code, 0);
42100 xmlResetLastError();
42101 if (mem_base != xmlMemBlocks()) {
42102 printf("Leak of %d blocks found in xmlUCSIsTags",
42103 xmlMemBlocks() - mem_base);
42105 printf(" %d", n_code);
42117 test_xmlUCSIsTaiLe(void) {
42120 #if defined(LIBXML_UNICODE_ENABLED)
42123 int code; /* UCS code point */
42126 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42127 mem_base = xmlMemBlocks();
42128 code = gen_int(n_code, 0);
42130 ret_val = xmlUCSIsTaiLe(code);
42131 desret_int(ret_val);
42133 des_int(n_code, code, 0);
42134 xmlResetLastError();
42135 if (mem_base != xmlMemBlocks()) {
42136 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42137 xmlMemBlocks() - mem_base);
42139 printf(" %d", n_code);
42151 test_xmlUCSIsTaiXuanJingSymbols(void) {
42154 #if defined(LIBXML_UNICODE_ENABLED)
42157 int code; /* UCS code point */
42160 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42161 mem_base = xmlMemBlocks();
42162 code = gen_int(n_code, 0);
42164 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42165 desret_int(ret_val);
42167 des_int(n_code, code, 0);
42168 xmlResetLastError();
42169 if (mem_base != xmlMemBlocks()) {
42170 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42171 xmlMemBlocks() - mem_base);
42173 printf(" %d", n_code);
42185 test_xmlUCSIsTamil(void) {
42188 #if defined(LIBXML_UNICODE_ENABLED)
42191 int code; /* UCS code point */
42194 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42195 mem_base = xmlMemBlocks();
42196 code = gen_int(n_code, 0);
42198 ret_val = xmlUCSIsTamil(code);
42199 desret_int(ret_val);
42201 des_int(n_code, code, 0);
42202 xmlResetLastError();
42203 if (mem_base != xmlMemBlocks()) {
42204 printf("Leak of %d blocks found in xmlUCSIsTamil",
42205 xmlMemBlocks() - mem_base);
42207 printf(" %d", n_code);
42219 test_xmlUCSIsTelugu(void) {
42222 #if defined(LIBXML_UNICODE_ENABLED)
42225 int code; /* UCS code point */
42228 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42229 mem_base = xmlMemBlocks();
42230 code = gen_int(n_code, 0);
42232 ret_val = xmlUCSIsTelugu(code);
42233 desret_int(ret_val);
42235 des_int(n_code, code, 0);
42236 xmlResetLastError();
42237 if (mem_base != xmlMemBlocks()) {
42238 printf("Leak of %d blocks found in xmlUCSIsTelugu",
42239 xmlMemBlocks() - mem_base);
42241 printf(" %d", n_code);
42253 test_xmlUCSIsThaana(void) {
42256 #if defined(LIBXML_UNICODE_ENABLED)
42259 int code; /* UCS code point */
42262 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42263 mem_base = xmlMemBlocks();
42264 code = gen_int(n_code, 0);
42266 ret_val = xmlUCSIsThaana(code);
42267 desret_int(ret_val);
42269 des_int(n_code, code, 0);
42270 xmlResetLastError();
42271 if (mem_base != xmlMemBlocks()) {
42272 printf("Leak of %d blocks found in xmlUCSIsThaana",
42273 xmlMemBlocks() - mem_base);
42275 printf(" %d", n_code);
42287 test_xmlUCSIsThai(void) {
42290 #if defined(LIBXML_UNICODE_ENABLED)
42293 int code; /* UCS code point */
42296 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42297 mem_base = xmlMemBlocks();
42298 code = gen_int(n_code, 0);
42300 ret_val = xmlUCSIsThai(code);
42301 desret_int(ret_val);
42303 des_int(n_code, code, 0);
42304 xmlResetLastError();
42305 if (mem_base != xmlMemBlocks()) {
42306 printf("Leak of %d blocks found in xmlUCSIsThai",
42307 xmlMemBlocks() - mem_base);
42309 printf(" %d", n_code);
42321 test_xmlUCSIsTibetan(void) {
42324 #if defined(LIBXML_UNICODE_ENABLED)
42327 int code; /* UCS code point */
42330 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42331 mem_base = xmlMemBlocks();
42332 code = gen_int(n_code, 0);
42334 ret_val = xmlUCSIsTibetan(code);
42335 desret_int(ret_val);
42337 des_int(n_code, code, 0);
42338 xmlResetLastError();
42339 if (mem_base != xmlMemBlocks()) {
42340 printf("Leak of %d blocks found in xmlUCSIsTibetan",
42341 xmlMemBlocks() - mem_base);
42343 printf(" %d", n_code);
42355 test_xmlUCSIsUgaritic(void) {
42358 #if defined(LIBXML_UNICODE_ENABLED)
42361 int code; /* UCS code point */
42364 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42365 mem_base = xmlMemBlocks();
42366 code = gen_int(n_code, 0);
42368 ret_val = xmlUCSIsUgaritic(code);
42369 desret_int(ret_val);
42371 des_int(n_code, code, 0);
42372 xmlResetLastError();
42373 if (mem_base != xmlMemBlocks()) {
42374 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42375 xmlMemBlocks() - mem_base);
42377 printf(" %d", n_code);
42389 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42392 #if defined(LIBXML_UNICODE_ENABLED)
42395 int code; /* UCS code point */
42398 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42399 mem_base = xmlMemBlocks();
42400 code = gen_int(n_code, 0);
42402 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42403 desret_int(ret_val);
42405 des_int(n_code, code, 0);
42406 xmlResetLastError();
42407 if (mem_base != xmlMemBlocks()) {
42408 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42409 xmlMemBlocks() - mem_base);
42411 printf(" %d", n_code);
42423 test_xmlUCSIsVariationSelectors(void) {
42426 #if defined(LIBXML_UNICODE_ENABLED)
42429 int code; /* UCS code point */
42432 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42433 mem_base = xmlMemBlocks();
42434 code = gen_int(n_code, 0);
42436 ret_val = xmlUCSIsVariationSelectors(code);
42437 desret_int(ret_val);
42439 des_int(n_code, code, 0);
42440 xmlResetLastError();
42441 if (mem_base != xmlMemBlocks()) {
42442 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42443 xmlMemBlocks() - mem_base);
42445 printf(" %d", n_code);
42457 test_xmlUCSIsVariationSelectorsSupplement(void) {
42460 #if defined(LIBXML_UNICODE_ENABLED)
42463 int code; /* UCS code point */
42466 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42467 mem_base = xmlMemBlocks();
42468 code = gen_int(n_code, 0);
42470 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42471 desret_int(ret_val);
42473 des_int(n_code, code, 0);
42474 xmlResetLastError();
42475 if (mem_base != xmlMemBlocks()) {
42476 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42477 xmlMemBlocks() - mem_base);
42479 printf(" %d", n_code);
42491 test_xmlUCSIsYiRadicals(void) {
42494 #if defined(LIBXML_UNICODE_ENABLED)
42497 int code; /* UCS code point */
42500 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42501 mem_base = xmlMemBlocks();
42502 code = gen_int(n_code, 0);
42504 ret_val = xmlUCSIsYiRadicals(code);
42505 desret_int(ret_val);
42507 des_int(n_code, code, 0);
42508 xmlResetLastError();
42509 if (mem_base != xmlMemBlocks()) {
42510 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42511 xmlMemBlocks() - mem_base);
42513 printf(" %d", n_code);
42525 test_xmlUCSIsYiSyllables(void) {
42528 #if defined(LIBXML_UNICODE_ENABLED)
42531 int code; /* UCS code point */
42534 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42535 mem_base = xmlMemBlocks();
42536 code = gen_int(n_code, 0);
42538 ret_val = xmlUCSIsYiSyllables(code);
42539 desret_int(ret_val);
42541 des_int(n_code, code, 0);
42542 xmlResetLastError();
42543 if (mem_base != xmlMemBlocks()) {
42544 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42545 xmlMemBlocks() - mem_base);
42547 printf(" %d", n_code);
42559 test_xmlUCSIsYijingHexagramSymbols(void) {
42562 #if defined(LIBXML_UNICODE_ENABLED)
42565 int code; /* UCS code point */
42568 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42569 mem_base = xmlMemBlocks();
42570 code = gen_int(n_code, 0);
42572 ret_val = xmlUCSIsYijingHexagramSymbols(code);
42573 desret_int(ret_val);
42575 des_int(n_code, code, 0);
42576 xmlResetLastError();
42577 if (mem_base != xmlMemBlocks()) {
42578 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42579 xmlMemBlocks() - mem_base);
42581 printf(" %d", n_code);
42592 test_xmlunicode(void) {
42595 if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42596 test_ret += test_xmlUCSIsAegeanNumbers();
42597 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42598 test_ret += test_xmlUCSIsArabic();
42599 test_ret += test_xmlUCSIsArabicPresentationFormsA();
42600 test_ret += test_xmlUCSIsArabicPresentationFormsB();
42601 test_ret += test_xmlUCSIsArmenian();
42602 test_ret += test_xmlUCSIsArrows();
42603 test_ret += test_xmlUCSIsBasicLatin();
42604 test_ret += test_xmlUCSIsBengali();
42605 test_ret += test_xmlUCSIsBlock();
42606 test_ret += test_xmlUCSIsBlockElements();
42607 test_ret += test_xmlUCSIsBopomofo();
42608 test_ret += test_xmlUCSIsBopomofoExtended();
42609 test_ret += test_xmlUCSIsBoxDrawing();
42610 test_ret += test_xmlUCSIsBraillePatterns();
42611 test_ret += test_xmlUCSIsBuhid();
42612 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42613 test_ret += test_xmlUCSIsCJKCompatibility();
42614 test_ret += test_xmlUCSIsCJKCompatibilityForms();
42615 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42616 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42617 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42618 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42619 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42620 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42621 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42622 test_ret += test_xmlUCSIsCat();
42623 test_ret += test_xmlUCSIsCatC();
42624 test_ret += test_xmlUCSIsCatCc();
42625 test_ret += test_xmlUCSIsCatCf();
42626 test_ret += test_xmlUCSIsCatCo();
42627 test_ret += test_xmlUCSIsCatCs();
42628 test_ret += test_xmlUCSIsCatL();
42629 test_ret += test_xmlUCSIsCatLl();
42630 test_ret += test_xmlUCSIsCatLm();
42631 test_ret += test_xmlUCSIsCatLo();
42632 test_ret += test_xmlUCSIsCatLt();
42633 test_ret += test_xmlUCSIsCatLu();
42634 test_ret += test_xmlUCSIsCatM();
42635 test_ret += test_xmlUCSIsCatMc();
42636 test_ret += test_xmlUCSIsCatMe();
42637 test_ret += test_xmlUCSIsCatMn();
42638 test_ret += test_xmlUCSIsCatN();
42639 test_ret += test_xmlUCSIsCatNd();
42640 test_ret += test_xmlUCSIsCatNl();
42641 test_ret += test_xmlUCSIsCatNo();
42642 test_ret += test_xmlUCSIsCatP();
42643 test_ret += test_xmlUCSIsCatPc();
42644 test_ret += test_xmlUCSIsCatPd();
42645 test_ret += test_xmlUCSIsCatPe();
42646 test_ret += test_xmlUCSIsCatPf();
42647 test_ret += test_xmlUCSIsCatPi();
42648 test_ret += test_xmlUCSIsCatPo();
42649 test_ret += test_xmlUCSIsCatPs();
42650 test_ret += test_xmlUCSIsCatS();
42651 test_ret += test_xmlUCSIsCatSc();
42652 test_ret += test_xmlUCSIsCatSk();
42653 test_ret += test_xmlUCSIsCatSm();
42654 test_ret += test_xmlUCSIsCatSo();
42655 test_ret += test_xmlUCSIsCatZ();
42656 test_ret += test_xmlUCSIsCatZl();
42657 test_ret += test_xmlUCSIsCatZp();
42658 test_ret += test_xmlUCSIsCatZs();
42659 test_ret += test_xmlUCSIsCherokee();
42660 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42661 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42662 test_ret += test_xmlUCSIsCombiningHalfMarks();
42663 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42664 test_ret += test_xmlUCSIsControlPictures();
42665 test_ret += test_xmlUCSIsCurrencySymbols();
42666 test_ret += test_xmlUCSIsCypriotSyllabary();
42667 test_ret += test_xmlUCSIsCyrillic();
42668 test_ret += test_xmlUCSIsCyrillicSupplement();
42669 test_ret += test_xmlUCSIsDeseret();
42670 test_ret += test_xmlUCSIsDevanagari();
42671 test_ret += test_xmlUCSIsDingbats();
42672 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42673 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42674 test_ret += test_xmlUCSIsEthiopic();
42675 test_ret += test_xmlUCSIsGeneralPunctuation();
42676 test_ret += test_xmlUCSIsGeometricShapes();
42677 test_ret += test_xmlUCSIsGeorgian();
42678 test_ret += test_xmlUCSIsGothic();
42679 test_ret += test_xmlUCSIsGreek();
42680 test_ret += test_xmlUCSIsGreekExtended();
42681 test_ret += test_xmlUCSIsGreekandCoptic();
42682 test_ret += test_xmlUCSIsGujarati();
42683 test_ret += test_xmlUCSIsGurmukhi();
42684 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42685 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42686 test_ret += test_xmlUCSIsHangulJamo();
42687 test_ret += test_xmlUCSIsHangulSyllables();
42688 test_ret += test_xmlUCSIsHanunoo();
42689 test_ret += test_xmlUCSIsHebrew();
42690 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42691 test_ret += test_xmlUCSIsHighSurrogates();
42692 test_ret += test_xmlUCSIsHiragana();
42693 test_ret += test_xmlUCSIsIPAExtensions();
42694 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42695 test_ret += test_xmlUCSIsKanbun();
42696 test_ret += test_xmlUCSIsKangxiRadicals();
42697 test_ret += test_xmlUCSIsKannada();
42698 test_ret += test_xmlUCSIsKatakana();
42699 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42700 test_ret += test_xmlUCSIsKhmer();
42701 test_ret += test_xmlUCSIsKhmerSymbols();
42702 test_ret += test_xmlUCSIsLao();
42703 test_ret += test_xmlUCSIsLatin1Supplement();
42704 test_ret += test_xmlUCSIsLatinExtendedA();
42705 test_ret += test_xmlUCSIsLatinExtendedAdditional();
42706 test_ret += test_xmlUCSIsLatinExtendedB();
42707 test_ret += test_xmlUCSIsLetterlikeSymbols();
42708 test_ret += test_xmlUCSIsLimbu();
42709 test_ret += test_xmlUCSIsLinearBIdeograms();
42710 test_ret += test_xmlUCSIsLinearBSyllabary();
42711 test_ret += test_xmlUCSIsLowSurrogates();
42712 test_ret += test_xmlUCSIsMalayalam();
42713 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42714 test_ret += test_xmlUCSIsMathematicalOperators();
42715 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42716 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42717 test_ret += test_xmlUCSIsMiscellaneousSymbols();
42718 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42719 test_ret += test_xmlUCSIsMiscellaneousTechnical();
42720 test_ret += test_xmlUCSIsMongolian();
42721 test_ret += test_xmlUCSIsMusicalSymbols();
42722 test_ret += test_xmlUCSIsMyanmar();
42723 test_ret += test_xmlUCSIsNumberForms();
42724 test_ret += test_xmlUCSIsOgham();
42725 test_ret += test_xmlUCSIsOldItalic();
42726 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42727 test_ret += test_xmlUCSIsOriya();
42728 test_ret += test_xmlUCSIsOsmanya();
42729 test_ret += test_xmlUCSIsPhoneticExtensions();
42730 test_ret += test_xmlUCSIsPrivateUse();
42731 test_ret += test_xmlUCSIsPrivateUseArea();
42732 test_ret += test_xmlUCSIsRunic();
42733 test_ret += test_xmlUCSIsShavian();
42734 test_ret += test_xmlUCSIsSinhala();
42735 test_ret += test_xmlUCSIsSmallFormVariants();
42736 test_ret += test_xmlUCSIsSpacingModifierLetters();
42737 test_ret += test_xmlUCSIsSpecials();
42738 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42739 test_ret += test_xmlUCSIsSupplementalArrowsA();
42740 test_ret += test_xmlUCSIsSupplementalArrowsB();
42741 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42742 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42743 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42744 test_ret += test_xmlUCSIsSyriac();
42745 test_ret += test_xmlUCSIsTagalog();
42746 test_ret += test_xmlUCSIsTagbanwa();
42747 test_ret += test_xmlUCSIsTags();
42748 test_ret += test_xmlUCSIsTaiLe();
42749 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42750 test_ret += test_xmlUCSIsTamil();
42751 test_ret += test_xmlUCSIsTelugu();
42752 test_ret += test_xmlUCSIsThaana();
42753 test_ret += test_xmlUCSIsThai();
42754 test_ret += test_xmlUCSIsTibetan();
42755 test_ret += test_xmlUCSIsUgaritic();
42756 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42757 test_ret += test_xmlUCSIsVariationSelectors();
42758 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42759 test_ret += test_xmlUCSIsYiRadicals();
42760 test_ret += test_xmlUCSIsYiSyllables();
42761 test_ret += test_xmlUCSIsYijingHexagramSymbols();
42764 printf("Module xmlunicode: %d errors\n", test_ret);
42769 test_xmlNewTextWriter(void) {
42772 #if defined(LIBXML_WRITER_ENABLED)
42774 xmlTextWriterPtr ret_val;
42775 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42778 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42779 mem_base = xmlMemBlocks();
42780 out = gen_xmlOutputBufferPtr(n_out, 0);
42782 ret_val = xmlNewTextWriter(out);
42783 if (ret_val != NULL) out = NULL;
42784 desret_xmlTextWriterPtr(ret_val);
42786 des_xmlOutputBufferPtr(n_out, out, 0);
42787 xmlResetLastError();
42788 if (mem_base != xmlMemBlocks()) {
42789 printf("Leak of %d blocks found in xmlNewTextWriter",
42790 xmlMemBlocks() - mem_base);
42792 printf(" %d", n_out);
42804 test_xmlNewTextWriterFilename(void) {
42807 #if defined(LIBXML_WRITER_ENABLED)
42809 xmlTextWriterPtr ret_val;
42810 const char * uri; /* the URI of the resource for the output */
42812 int compression; /* compress the output? */
42815 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42816 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42817 mem_base = xmlMemBlocks();
42818 uri = gen_fileoutput(n_uri, 0);
42819 compression = gen_int(n_compression, 1);
42821 ret_val = xmlNewTextWriterFilename(uri, compression);
42822 desret_xmlTextWriterPtr(ret_val);
42824 des_fileoutput(n_uri, uri, 0);
42825 des_int(n_compression, compression, 1);
42826 xmlResetLastError();
42827 if (mem_base != xmlMemBlocks()) {
42828 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42829 xmlMemBlocks() - mem_base);
42831 printf(" %d", n_uri);
42832 printf(" %d", n_compression);
42845 test_xmlNewTextWriterMemory(void) {
42848 #if defined(LIBXML_WRITER_ENABLED)
42850 xmlTextWriterPtr ret_val;
42851 xmlBufferPtr buf; /* xmlBufferPtr */
42853 int compression; /* compress the output? */
42856 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42857 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42858 mem_base = xmlMemBlocks();
42859 buf = gen_xmlBufferPtr(n_buf, 0);
42860 compression = gen_int(n_compression, 1);
42862 ret_val = xmlNewTextWriterMemory(buf, compression);
42863 desret_xmlTextWriterPtr(ret_val);
42865 des_xmlBufferPtr(n_buf, buf, 0);
42866 des_int(n_compression, compression, 1);
42867 xmlResetLastError();
42868 if (mem_base != xmlMemBlocks()) {
42869 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42870 xmlMemBlocks() - mem_base);
42872 printf(" %d", n_buf);
42873 printf(" %d", n_compression);
42886 test_xmlNewTextWriterPushParser(void) {
42889 #if defined(LIBXML_WRITER_ENABLED)
42891 xmlTextWriterPtr ret_val;
42892 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42894 int compression; /* compress the output? */
42897 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42898 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42899 mem_base = xmlMemBlocks();
42900 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42901 compression = gen_int(n_compression, 1);
42903 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42904 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42905 desret_xmlTextWriterPtr(ret_val);
42907 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42908 des_int(n_compression, compression, 1);
42909 xmlResetLastError();
42910 if (mem_base != xmlMemBlocks()) {
42911 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42912 xmlMemBlocks() - mem_base);
42914 printf(" %d", n_ctxt);
42915 printf(" %d", n_compression);
42928 test_xmlNewTextWriterTree(void) {
42931 #if defined(LIBXML_WRITER_ENABLED)
42933 xmlTextWriterPtr ret_val;
42934 xmlDocPtr doc; /* xmlDocPtr */
42936 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42938 int compression; /* compress the output? */
42941 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42942 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42943 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42944 mem_base = xmlMemBlocks();
42945 doc = gen_xmlDocPtr(n_doc, 0);
42946 node = gen_xmlNodePtr(n_node, 1);
42947 compression = gen_int(n_compression, 2);
42949 ret_val = xmlNewTextWriterTree(doc, node, compression);
42950 desret_xmlTextWriterPtr(ret_val);
42952 des_xmlDocPtr(n_doc, doc, 0);
42953 des_xmlNodePtr(n_node, node, 1);
42954 des_int(n_compression, compression, 2);
42955 xmlResetLastError();
42956 if (mem_base != xmlMemBlocks()) {
42957 printf("Leak of %d blocks found in xmlNewTextWriterTree",
42958 xmlMemBlocks() - mem_base);
42960 printf(" %d", n_doc);
42961 printf(" %d", n_node);
42962 printf(" %d", n_compression);
42976 test_xmlTextWriterEndAttribute(void) {
42979 #if defined(LIBXML_WRITER_ENABLED)
42982 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42985 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42986 mem_base = xmlMemBlocks();
42987 writer = gen_xmlTextWriterPtr(n_writer, 0);
42989 ret_val = xmlTextWriterEndAttribute(writer);
42990 desret_int(ret_val);
42992 des_xmlTextWriterPtr(n_writer, writer, 0);
42993 xmlResetLastError();
42994 if (mem_base != xmlMemBlocks()) {
42995 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42996 xmlMemBlocks() - mem_base);
42998 printf(" %d", n_writer);
43010 test_xmlTextWriterEndCDATA(void) {
43013 #if defined(LIBXML_WRITER_ENABLED)
43016 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43019 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43020 mem_base = xmlMemBlocks();
43021 writer = gen_xmlTextWriterPtr(n_writer, 0);
43023 ret_val = xmlTextWriterEndCDATA(writer);
43024 desret_int(ret_val);
43026 des_xmlTextWriterPtr(n_writer, writer, 0);
43027 xmlResetLastError();
43028 if (mem_base != xmlMemBlocks()) {
43029 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43030 xmlMemBlocks() - mem_base);
43032 printf(" %d", n_writer);
43044 test_xmlTextWriterEndComment(void) {
43047 #if defined(LIBXML_WRITER_ENABLED)
43050 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43053 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43054 mem_base = xmlMemBlocks();
43055 writer = gen_xmlTextWriterPtr(n_writer, 0);
43057 ret_val = xmlTextWriterEndComment(writer);
43058 desret_int(ret_val);
43060 des_xmlTextWriterPtr(n_writer, writer, 0);
43061 xmlResetLastError();
43062 if (mem_base != xmlMemBlocks()) {
43063 printf("Leak of %d blocks found in xmlTextWriterEndComment",
43064 xmlMemBlocks() - mem_base);
43066 printf(" %d", n_writer);
43078 test_xmlTextWriterEndDTD(void) {
43081 #if defined(LIBXML_WRITER_ENABLED)
43084 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43087 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43088 mem_base = xmlMemBlocks();
43089 writer = gen_xmlTextWriterPtr(n_writer, 0);
43091 ret_val = xmlTextWriterEndDTD(writer);
43092 desret_int(ret_val);
43094 des_xmlTextWriterPtr(n_writer, writer, 0);
43095 xmlResetLastError();
43096 if (mem_base != xmlMemBlocks()) {
43097 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43098 xmlMemBlocks() - mem_base);
43100 printf(" %d", n_writer);
43112 test_xmlTextWriterEndDTDAttlist(void) {
43115 #if defined(LIBXML_WRITER_ENABLED)
43118 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43121 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43122 mem_base = xmlMemBlocks();
43123 writer = gen_xmlTextWriterPtr(n_writer, 0);
43125 ret_val = xmlTextWriterEndDTDAttlist(writer);
43126 desret_int(ret_val);
43128 des_xmlTextWriterPtr(n_writer, writer, 0);
43129 xmlResetLastError();
43130 if (mem_base != xmlMemBlocks()) {
43131 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43132 xmlMemBlocks() - mem_base);
43134 printf(" %d", n_writer);
43146 test_xmlTextWriterEndDTDElement(void) {
43149 #if defined(LIBXML_WRITER_ENABLED)
43152 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43155 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43156 mem_base = xmlMemBlocks();
43157 writer = gen_xmlTextWriterPtr(n_writer, 0);
43159 ret_val = xmlTextWriterEndDTDElement(writer);
43160 desret_int(ret_val);
43162 des_xmlTextWriterPtr(n_writer, writer, 0);
43163 xmlResetLastError();
43164 if (mem_base != xmlMemBlocks()) {
43165 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43166 xmlMemBlocks() - mem_base);
43168 printf(" %d", n_writer);
43180 test_xmlTextWriterEndDTDEntity(void) {
43183 #if defined(LIBXML_WRITER_ENABLED)
43186 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43189 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43190 mem_base = xmlMemBlocks();
43191 writer = gen_xmlTextWriterPtr(n_writer, 0);
43193 ret_val = xmlTextWriterEndDTDEntity(writer);
43194 desret_int(ret_val);
43196 des_xmlTextWriterPtr(n_writer, writer, 0);
43197 xmlResetLastError();
43198 if (mem_base != xmlMemBlocks()) {
43199 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43200 xmlMemBlocks() - mem_base);
43202 printf(" %d", n_writer);
43214 test_xmlTextWriterEndDocument(void) {
43217 #if defined(LIBXML_WRITER_ENABLED)
43220 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43223 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43224 mem_base = xmlMemBlocks();
43225 writer = gen_xmlTextWriterPtr(n_writer, 0);
43227 ret_val = xmlTextWriterEndDocument(writer);
43228 desret_int(ret_val);
43230 des_xmlTextWriterPtr(n_writer, writer, 0);
43231 xmlResetLastError();
43232 if (mem_base != xmlMemBlocks()) {
43233 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43234 xmlMemBlocks() - mem_base);
43236 printf(" %d", n_writer);
43248 test_xmlTextWriterEndElement(void) {
43251 #if defined(LIBXML_WRITER_ENABLED)
43254 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43257 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43258 mem_base = xmlMemBlocks();
43259 writer = gen_xmlTextWriterPtr(n_writer, 0);
43261 ret_val = xmlTextWriterEndElement(writer);
43262 desret_int(ret_val);
43264 des_xmlTextWriterPtr(n_writer, writer, 0);
43265 xmlResetLastError();
43266 if (mem_base != xmlMemBlocks()) {
43267 printf("Leak of %d blocks found in xmlTextWriterEndElement",
43268 xmlMemBlocks() - mem_base);
43270 printf(" %d", n_writer);
43282 test_xmlTextWriterEndPI(void) {
43285 #if defined(LIBXML_WRITER_ENABLED)
43288 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43291 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43292 mem_base = xmlMemBlocks();
43293 writer = gen_xmlTextWriterPtr(n_writer, 0);
43295 ret_val = xmlTextWriterEndPI(writer);
43296 desret_int(ret_val);
43298 des_xmlTextWriterPtr(n_writer, writer, 0);
43299 xmlResetLastError();
43300 if (mem_base != xmlMemBlocks()) {
43301 printf("Leak of %d blocks found in xmlTextWriterEndPI",
43302 xmlMemBlocks() - mem_base);
43304 printf(" %d", n_writer);
43316 test_xmlTextWriterFlush(void) {
43319 #if defined(LIBXML_WRITER_ENABLED)
43322 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43325 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43326 mem_base = xmlMemBlocks();
43327 writer = gen_xmlTextWriterPtr(n_writer, 0);
43329 ret_val = xmlTextWriterFlush(writer);
43330 desret_int(ret_val);
43332 des_xmlTextWriterPtr(n_writer, writer, 0);
43333 xmlResetLastError();
43334 if (mem_base != xmlMemBlocks()) {
43335 printf("Leak of %d blocks found in xmlTextWriterFlush",
43336 xmlMemBlocks() - mem_base);
43338 printf(" %d", n_writer);
43350 test_xmlTextWriterFullEndElement(void) {
43353 #if defined(LIBXML_WRITER_ENABLED)
43356 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43359 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43360 mem_base = xmlMemBlocks();
43361 writer = gen_xmlTextWriterPtr(n_writer, 0);
43363 ret_val = xmlTextWriterFullEndElement(writer);
43364 desret_int(ret_val);
43366 des_xmlTextWriterPtr(n_writer, writer, 0);
43367 xmlResetLastError();
43368 if (mem_base != xmlMemBlocks()) {
43369 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43370 xmlMemBlocks() - mem_base);
43372 printf(" %d", n_writer);
43384 test_xmlTextWriterSetIndent(void) {
43387 #if defined(LIBXML_WRITER_ENABLED)
43390 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43392 int indent; /* do indentation? */
43395 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43396 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43397 mem_base = xmlMemBlocks();
43398 writer = gen_xmlTextWriterPtr(n_writer, 0);
43399 indent = gen_int(n_indent, 1);
43401 ret_val = xmlTextWriterSetIndent(writer, indent);
43402 desret_int(ret_val);
43404 des_xmlTextWriterPtr(n_writer, writer, 0);
43405 des_int(n_indent, indent, 1);
43406 xmlResetLastError();
43407 if (mem_base != xmlMemBlocks()) {
43408 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43409 xmlMemBlocks() - mem_base);
43411 printf(" %d", n_writer);
43412 printf(" %d", n_indent);
43425 test_xmlTextWriterSetIndentString(void) {
43428 #if defined(LIBXML_WRITER_ENABLED)
43431 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43433 xmlChar * str; /* the xmlChar string */
43436 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43437 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43438 mem_base = xmlMemBlocks();
43439 writer = gen_xmlTextWriterPtr(n_writer, 0);
43440 str = gen_const_xmlChar_ptr(n_str, 1);
43442 ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43443 desret_int(ret_val);
43445 des_xmlTextWriterPtr(n_writer, writer, 0);
43446 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43447 xmlResetLastError();
43448 if (mem_base != xmlMemBlocks()) {
43449 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43450 xmlMemBlocks() - mem_base);
43452 printf(" %d", n_writer);
43453 printf(" %d", n_str);
43466 test_xmlTextWriterStartAttribute(void) {
43469 #if defined(LIBXML_WRITER_ENABLED)
43472 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43474 xmlChar * name; /* element name */
43477 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43478 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43479 mem_base = xmlMemBlocks();
43480 writer = gen_xmlTextWriterPtr(n_writer, 0);
43481 name = gen_const_xmlChar_ptr(n_name, 1);
43483 ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43484 desret_int(ret_val);
43486 des_xmlTextWriterPtr(n_writer, writer, 0);
43487 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43488 xmlResetLastError();
43489 if (mem_base != xmlMemBlocks()) {
43490 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43491 xmlMemBlocks() - mem_base);
43493 printf(" %d", n_writer);
43494 printf(" %d", n_name);
43507 test_xmlTextWriterStartAttributeNS(void) {
43510 #if defined(LIBXML_WRITER_ENABLED)
43513 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43515 xmlChar * prefix; /* namespace prefix or NULL */
43517 xmlChar * name; /* element local name */
43519 xmlChar * namespaceURI; /* namespace URI or NULL */
43520 int n_namespaceURI;
43522 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43523 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43524 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43525 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43526 mem_base = xmlMemBlocks();
43527 writer = gen_xmlTextWriterPtr(n_writer, 0);
43528 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43529 name = gen_const_xmlChar_ptr(n_name, 2);
43530 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43532 ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43533 desret_int(ret_val);
43535 des_xmlTextWriterPtr(n_writer, writer, 0);
43536 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43537 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43538 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43539 xmlResetLastError();
43540 if (mem_base != xmlMemBlocks()) {
43541 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43542 xmlMemBlocks() - mem_base);
43544 printf(" %d", n_writer);
43545 printf(" %d", n_prefix);
43546 printf(" %d", n_name);
43547 printf(" %d", n_namespaceURI);
43562 test_xmlTextWriterStartCDATA(void) {
43565 #if defined(LIBXML_WRITER_ENABLED)
43568 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43571 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43572 mem_base = xmlMemBlocks();
43573 writer = gen_xmlTextWriterPtr(n_writer, 0);
43575 ret_val = xmlTextWriterStartCDATA(writer);
43576 desret_int(ret_val);
43578 des_xmlTextWriterPtr(n_writer, writer, 0);
43579 xmlResetLastError();
43580 if (mem_base != xmlMemBlocks()) {
43581 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43582 xmlMemBlocks() - mem_base);
43584 printf(" %d", n_writer);
43596 test_xmlTextWriterStartComment(void) {
43599 #if defined(LIBXML_WRITER_ENABLED)
43602 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43605 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43606 mem_base = xmlMemBlocks();
43607 writer = gen_xmlTextWriterPtr(n_writer, 0);
43609 ret_val = xmlTextWriterStartComment(writer);
43610 desret_int(ret_val);
43612 des_xmlTextWriterPtr(n_writer, writer, 0);
43613 xmlResetLastError();
43614 if (mem_base != xmlMemBlocks()) {
43615 printf("Leak of %d blocks found in xmlTextWriterStartComment",
43616 xmlMemBlocks() - mem_base);
43618 printf(" %d", n_writer);
43630 test_xmlTextWriterStartDTD(void) {
43633 #if defined(LIBXML_WRITER_ENABLED)
43636 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43638 xmlChar * name; /* the name of the DTD */
43640 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43642 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43645 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43646 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43647 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43648 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43649 mem_base = xmlMemBlocks();
43650 writer = gen_xmlTextWriterPtr(n_writer, 0);
43651 name = gen_const_xmlChar_ptr(n_name, 1);
43652 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43653 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43655 ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43656 desret_int(ret_val);
43658 des_xmlTextWriterPtr(n_writer, writer, 0);
43659 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43660 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43661 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43662 xmlResetLastError();
43663 if (mem_base != xmlMemBlocks()) {
43664 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43665 xmlMemBlocks() - mem_base);
43667 printf(" %d", n_writer);
43668 printf(" %d", n_name);
43669 printf(" %d", n_pubid);
43670 printf(" %d", n_sysid);
43685 test_xmlTextWriterStartDTDAttlist(void) {
43688 #if defined(LIBXML_WRITER_ENABLED)
43691 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43693 xmlChar * name; /* the name of the DTD ATTLIST */
43696 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43697 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43698 mem_base = xmlMemBlocks();
43699 writer = gen_xmlTextWriterPtr(n_writer, 0);
43700 name = gen_const_xmlChar_ptr(n_name, 1);
43702 ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43703 desret_int(ret_val);
43705 des_xmlTextWriterPtr(n_writer, writer, 0);
43706 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43707 xmlResetLastError();
43708 if (mem_base != xmlMemBlocks()) {
43709 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43710 xmlMemBlocks() - mem_base);
43712 printf(" %d", n_writer);
43713 printf(" %d", n_name);
43726 test_xmlTextWriterStartDTDElement(void) {
43729 #if defined(LIBXML_WRITER_ENABLED)
43732 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43734 xmlChar * name; /* the name of the DTD element */
43737 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43738 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43739 mem_base = xmlMemBlocks();
43740 writer = gen_xmlTextWriterPtr(n_writer, 0);
43741 name = gen_const_xmlChar_ptr(n_name, 1);
43743 ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43744 desret_int(ret_val);
43746 des_xmlTextWriterPtr(n_writer, writer, 0);
43747 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43748 xmlResetLastError();
43749 if (mem_base != xmlMemBlocks()) {
43750 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43751 xmlMemBlocks() - mem_base);
43753 printf(" %d", n_writer);
43754 printf(" %d", n_name);
43767 test_xmlTextWriterStartDTDEntity(void) {
43770 #if defined(LIBXML_WRITER_ENABLED)
43773 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43775 int pe; /* TRUE if this is a parameter entity, FALSE if not */
43777 xmlChar * name; /* the name of the DTD ATTLIST */
43780 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43781 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43782 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43783 mem_base = xmlMemBlocks();
43784 writer = gen_xmlTextWriterPtr(n_writer, 0);
43785 pe = gen_int(n_pe, 1);
43786 name = gen_const_xmlChar_ptr(n_name, 2);
43788 ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43789 desret_int(ret_val);
43791 des_xmlTextWriterPtr(n_writer, writer, 0);
43792 des_int(n_pe, pe, 1);
43793 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43794 xmlResetLastError();
43795 if (mem_base != xmlMemBlocks()) {
43796 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43797 xmlMemBlocks() - mem_base);
43799 printf(" %d", n_writer);
43800 printf(" %d", n_pe);
43801 printf(" %d", n_name);
43815 test_xmlTextWriterStartDocument(void) {
43818 #if defined(LIBXML_WRITER_ENABLED)
43821 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43823 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43825 char * encoding; /* the encoding or NULL for default */
43827 char * standalone; /* "yes" or "no" or NULL for default */
43830 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43831 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43832 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43833 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43834 mem_base = xmlMemBlocks();
43835 writer = gen_xmlTextWriterPtr(n_writer, 0);
43836 version = gen_const_char_ptr(n_version, 1);
43837 encoding = gen_const_char_ptr(n_encoding, 2);
43838 standalone = gen_const_char_ptr(n_standalone, 3);
43840 ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43841 desret_int(ret_val);
43843 des_xmlTextWriterPtr(n_writer, writer, 0);
43844 des_const_char_ptr(n_version, (const char *)version, 1);
43845 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43846 des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43847 xmlResetLastError();
43848 if (mem_base != xmlMemBlocks()) {
43849 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43850 xmlMemBlocks() - mem_base);
43852 printf(" %d", n_writer);
43853 printf(" %d", n_version);
43854 printf(" %d", n_encoding);
43855 printf(" %d", n_standalone);
43870 test_xmlTextWriterStartElement(void) {
43873 #if defined(LIBXML_WRITER_ENABLED)
43876 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43878 xmlChar * name; /* element name */
43881 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43882 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43883 mem_base = xmlMemBlocks();
43884 writer = gen_xmlTextWriterPtr(n_writer, 0);
43885 name = gen_const_xmlChar_ptr(n_name, 1);
43887 ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43888 desret_int(ret_val);
43890 des_xmlTextWriterPtr(n_writer, writer, 0);
43891 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43892 xmlResetLastError();
43893 if (mem_base != xmlMemBlocks()) {
43894 printf("Leak of %d blocks found in xmlTextWriterStartElement",
43895 xmlMemBlocks() - mem_base);
43897 printf(" %d", n_writer);
43898 printf(" %d", n_name);
43911 test_xmlTextWriterStartElementNS(void) {
43914 #if defined(LIBXML_WRITER_ENABLED)
43917 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43919 xmlChar * prefix; /* namespace prefix or NULL */
43921 xmlChar * name; /* element local name */
43923 xmlChar * namespaceURI; /* namespace URI or NULL */
43924 int n_namespaceURI;
43926 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43927 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43928 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43929 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43930 mem_base = xmlMemBlocks();
43931 writer = gen_xmlTextWriterPtr(n_writer, 0);
43932 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43933 name = gen_const_xmlChar_ptr(n_name, 2);
43934 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43936 ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43937 desret_int(ret_val);
43939 des_xmlTextWriterPtr(n_writer, writer, 0);
43940 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43941 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43942 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43943 xmlResetLastError();
43944 if (mem_base != xmlMemBlocks()) {
43945 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43946 xmlMemBlocks() - mem_base);
43948 printf(" %d", n_writer);
43949 printf(" %d", n_prefix);
43950 printf(" %d", n_name);
43951 printf(" %d", n_namespaceURI);
43966 test_xmlTextWriterStartPI(void) {
43969 #if defined(LIBXML_WRITER_ENABLED)
43972 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43974 xmlChar * target; /* PI target */
43977 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43978 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43979 mem_base = xmlMemBlocks();
43980 writer = gen_xmlTextWriterPtr(n_writer, 0);
43981 target = gen_const_xmlChar_ptr(n_target, 1);
43983 ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43984 desret_int(ret_val);
43986 des_xmlTextWriterPtr(n_writer, writer, 0);
43987 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43988 xmlResetLastError();
43989 if (mem_base != xmlMemBlocks()) {
43990 printf("Leak of %d blocks found in xmlTextWriterStartPI",
43991 xmlMemBlocks() - mem_base);
43993 printf(" %d", n_writer);
43994 printf(" %d", n_target);
44007 test_xmlTextWriterWriteAttribute(void) {
44010 #if defined(LIBXML_WRITER_ENABLED)
44013 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44015 xmlChar * name; /* attribute name */
44017 xmlChar * content; /* attribute content */
44020 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44021 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44022 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44023 mem_base = xmlMemBlocks();
44024 writer = gen_xmlTextWriterPtr(n_writer, 0);
44025 name = gen_const_xmlChar_ptr(n_name, 1);
44026 content = gen_const_xmlChar_ptr(n_content, 2);
44028 ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44029 desret_int(ret_val);
44031 des_xmlTextWriterPtr(n_writer, writer, 0);
44032 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44033 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44034 xmlResetLastError();
44035 if (mem_base != xmlMemBlocks()) {
44036 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44037 xmlMemBlocks() - mem_base);
44039 printf(" %d", n_writer);
44040 printf(" %d", n_name);
44041 printf(" %d", n_content);
44055 test_xmlTextWriterWriteAttributeNS(void) {
44058 #if defined(LIBXML_WRITER_ENABLED)
44061 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44063 xmlChar * prefix; /* namespace prefix */
44065 xmlChar * name; /* attribute local name */
44067 xmlChar * namespaceURI; /* namespace URI */
44068 int n_namespaceURI;
44069 xmlChar * content; /* attribute content */
44072 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44073 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44074 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44075 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44076 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44077 mem_base = xmlMemBlocks();
44078 writer = gen_xmlTextWriterPtr(n_writer, 0);
44079 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44080 name = gen_const_xmlChar_ptr(n_name, 2);
44081 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44082 content = gen_const_xmlChar_ptr(n_content, 4);
44084 ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44085 desret_int(ret_val);
44087 des_xmlTextWriterPtr(n_writer, writer, 0);
44088 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44089 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44090 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44091 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44092 xmlResetLastError();
44093 if (mem_base != xmlMemBlocks()) {
44094 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44095 xmlMemBlocks() - mem_base);
44097 printf(" %d", n_writer);
44098 printf(" %d", n_prefix);
44099 printf(" %d", n_name);
44100 printf(" %d", n_namespaceURI);
44101 printf(" %d", n_content);
44117 test_xmlTextWriterWriteBase64(void) {
44120 #if defined(LIBXML_WRITER_ENABLED)
44123 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44125 char * data; /* binary data */
44127 int start; /* the position within the data of the first byte to encode */
44129 int len; /* the number of bytes to encode */
44132 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44133 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44134 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44135 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44136 mem_base = xmlMemBlocks();
44137 writer = gen_xmlTextWriterPtr(n_writer, 0);
44138 data = gen_const_char_ptr(n_data, 1);
44139 start = gen_int(n_start, 2);
44140 len = gen_int(n_len, 3);
44142 ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44143 desret_int(ret_val);
44145 des_xmlTextWriterPtr(n_writer, writer, 0);
44146 des_const_char_ptr(n_data, (const char *)data, 1);
44147 des_int(n_start, start, 2);
44148 des_int(n_len, len, 3);
44149 xmlResetLastError();
44150 if (mem_base != xmlMemBlocks()) {
44151 printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44152 xmlMemBlocks() - mem_base);
44154 printf(" %d", n_writer);
44155 printf(" %d", n_data);
44156 printf(" %d", n_start);
44157 printf(" %d", n_len);
44172 test_xmlTextWriterWriteBinHex(void) {
44175 #if defined(LIBXML_WRITER_ENABLED)
44178 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44180 char * data; /* binary data */
44182 int start; /* the position within the data of the first byte to encode */
44184 int len; /* the number of bytes to encode */
44187 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44188 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44189 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44190 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44191 mem_base = xmlMemBlocks();
44192 writer = gen_xmlTextWriterPtr(n_writer, 0);
44193 data = gen_const_char_ptr(n_data, 1);
44194 start = gen_int(n_start, 2);
44195 len = gen_int(n_len, 3);
44197 ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44198 desret_int(ret_val);
44200 des_xmlTextWriterPtr(n_writer, writer, 0);
44201 des_const_char_ptr(n_data, (const char *)data, 1);
44202 des_int(n_start, start, 2);
44203 des_int(n_len, len, 3);
44204 xmlResetLastError();
44205 if (mem_base != xmlMemBlocks()) {
44206 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44207 xmlMemBlocks() - mem_base);
44209 printf(" %d", n_writer);
44210 printf(" %d", n_data);
44211 printf(" %d", n_start);
44212 printf(" %d", n_len);
44227 test_xmlTextWriterWriteCDATA(void) {
44230 #if defined(LIBXML_WRITER_ENABLED)
44233 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44235 xmlChar * content; /* CDATA content */
44238 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44239 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44240 mem_base = xmlMemBlocks();
44241 writer = gen_xmlTextWriterPtr(n_writer, 0);
44242 content = gen_const_xmlChar_ptr(n_content, 1);
44244 ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44245 desret_int(ret_val);
44247 des_xmlTextWriterPtr(n_writer, writer, 0);
44248 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44249 xmlResetLastError();
44250 if (mem_base != xmlMemBlocks()) {
44251 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44252 xmlMemBlocks() - mem_base);
44254 printf(" %d", n_writer);
44255 printf(" %d", n_content);
44268 test_xmlTextWriterWriteComment(void) {
44271 #if defined(LIBXML_WRITER_ENABLED)
44274 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44276 xmlChar * content; /* comment string */
44279 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44280 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44281 mem_base = xmlMemBlocks();
44282 writer = gen_xmlTextWriterPtr(n_writer, 0);
44283 content = gen_const_xmlChar_ptr(n_content, 1);
44285 ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44286 desret_int(ret_val);
44288 des_xmlTextWriterPtr(n_writer, writer, 0);
44289 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44290 xmlResetLastError();
44291 if (mem_base != xmlMemBlocks()) {
44292 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44293 xmlMemBlocks() - mem_base);
44295 printf(" %d", n_writer);
44296 printf(" %d", n_content);
44309 test_xmlTextWriterWriteDTD(void) {
44312 #if defined(LIBXML_WRITER_ENABLED)
44315 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44317 xmlChar * name; /* the name of the DTD */
44319 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44321 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44323 xmlChar * subset; /* string content of the DTD */
44326 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44327 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44328 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44329 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44330 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44331 mem_base = xmlMemBlocks();
44332 writer = gen_xmlTextWriterPtr(n_writer, 0);
44333 name = gen_const_xmlChar_ptr(n_name, 1);
44334 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44335 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44336 subset = gen_const_xmlChar_ptr(n_subset, 4);
44338 ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44339 desret_int(ret_val);
44341 des_xmlTextWriterPtr(n_writer, writer, 0);
44342 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44343 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44344 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44345 des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44346 xmlResetLastError();
44347 if (mem_base != xmlMemBlocks()) {
44348 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44349 xmlMemBlocks() - mem_base);
44351 printf(" %d", n_writer);
44352 printf(" %d", n_name);
44353 printf(" %d", n_pubid);
44354 printf(" %d", n_sysid);
44355 printf(" %d", n_subset);
44371 test_xmlTextWriterWriteDTDAttlist(void) {
44374 #if defined(LIBXML_WRITER_ENABLED)
44377 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44379 xmlChar * name; /* the name of the DTD ATTLIST */
44381 xmlChar * content; /* content of the ATTLIST */
44384 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44385 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44386 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44387 mem_base = xmlMemBlocks();
44388 writer = gen_xmlTextWriterPtr(n_writer, 0);
44389 name = gen_const_xmlChar_ptr(n_name, 1);
44390 content = gen_const_xmlChar_ptr(n_content, 2);
44392 ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44393 desret_int(ret_val);
44395 des_xmlTextWriterPtr(n_writer, writer, 0);
44396 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44397 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44398 xmlResetLastError();
44399 if (mem_base != xmlMemBlocks()) {
44400 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44401 xmlMemBlocks() - mem_base);
44403 printf(" %d", n_writer);
44404 printf(" %d", n_name);
44405 printf(" %d", n_content);
44419 test_xmlTextWriterWriteDTDElement(void) {
44422 #if defined(LIBXML_WRITER_ENABLED)
44425 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44427 xmlChar * name; /* the name of the DTD element */
44429 xmlChar * content; /* content of the element */
44432 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44433 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44434 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44435 mem_base = xmlMemBlocks();
44436 writer = gen_xmlTextWriterPtr(n_writer, 0);
44437 name = gen_const_xmlChar_ptr(n_name, 1);
44438 content = gen_const_xmlChar_ptr(n_content, 2);
44440 ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44441 desret_int(ret_val);
44443 des_xmlTextWriterPtr(n_writer, writer, 0);
44444 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44445 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44446 xmlResetLastError();
44447 if (mem_base != xmlMemBlocks()) {
44448 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44449 xmlMemBlocks() - mem_base);
44451 printf(" %d", n_writer);
44452 printf(" %d", n_name);
44453 printf(" %d", n_content);
44467 test_xmlTextWriterWriteDTDEntity(void) {
44470 #if defined(LIBXML_WRITER_ENABLED)
44473 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44475 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44477 xmlChar * name; /* the name of the DTD entity */
44479 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44481 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44483 xmlChar * ndataid; /* the xml notation name. */
44485 xmlChar * content; /* content of the entity */
44488 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44489 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44490 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44491 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44492 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44493 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44494 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44495 mem_base = xmlMemBlocks();
44496 writer = gen_xmlTextWriterPtr(n_writer, 0);
44497 pe = gen_int(n_pe, 1);
44498 name = gen_const_xmlChar_ptr(n_name, 2);
44499 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44500 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44501 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44502 content = gen_const_xmlChar_ptr(n_content, 6);
44504 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44505 desret_int(ret_val);
44507 des_xmlTextWriterPtr(n_writer, writer, 0);
44508 des_int(n_pe, pe, 1);
44509 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44510 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44511 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44512 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44513 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44514 xmlResetLastError();
44515 if (mem_base != xmlMemBlocks()) {
44516 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44517 xmlMemBlocks() - mem_base);
44519 printf(" %d", n_writer);
44520 printf(" %d", n_pe);
44521 printf(" %d", n_name);
44522 printf(" %d", n_pubid);
44523 printf(" %d", n_sysid);
44524 printf(" %d", n_ndataid);
44525 printf(" %d", n_content);
44543 test_xmlTextWriterWriteDTDExternalEntity(void) {
44546 #if defined(LIBXML_WRITER_ENABLED)
44549 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44551 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44553 xmlChar * name; /* the name of the DTD entity */
44555 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44557 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44559 xmlChar * ndataid; /* the xml notation name. */
44562 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44563 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44564 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44565 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44566 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44567 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44568 mem_base = xmlMemBlocks();
44569 writer = gen_xmlTextWriterPtr(n_writer, 0);
44570 pe = gen_int(n_pe, 1);
44571 name = gen_const_xmlChar_ptr(n_name, 2);
44572 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44573 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44574 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44576 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44577 desret_int(ret_val);
44579 des_xmlTextWriterPtr(n_writer, writer, 0);
44580 des_int(n_pe, pe, 1);
44581 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44582 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44583 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44584 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44585 xmlResetLastError();
44586 if (mem_base != xmlMemBlocks()) {
44587 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44588 xmlMemBlocks() - mem_base);
44590 printf(" %d", n_writer);
44591 printf(" %d", n_pe);
44592 printf(" %d", n_name);
44593 printf(" %d", n_pubid);
44594 printf(" %d", n_sysid);
44595 printf(" %d", n_ndataid);
44612 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44615 #if defined(LIBXML_WRITER_ENABLED)
44618 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44620 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44622 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44624 xmlChar * ndataid; /* the xml notation name. */
44627 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44628 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44629 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44630 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44631 mem_base = xmlMemBlocks();
44632 writer = gen_xmlTextWriterPtr(n_writer, 0);
44633 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44634 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44635 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44637 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44638 desret_int(ret_val);
44640 des_xmlTextWriterPtr(n_writer, writer, 0);
44641 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44642 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44643 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44644 xmlResetLastError();
44645 if (mem_base != xmlMemBlocks()) {
44646 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44647 xmlMemBlocks() - mem_base);
44649 printf(" %d", n_writer);
44650 printf(" %d", n_pubid);
44651 printf(" %d", n_sysid);
44652 printf(" %d", n_ndataid);
44667 test_xmlTextWriterWriteDTDInternalEntity(void) {
44670 #if defined(LIBXML_WRITER_ENABLED)
44673 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44675 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44677 xmlChar * name; /* the name of the DTD entity */
44679 xmlChar * content; /* content of the entity */
44682 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44683 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44684 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44685 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44686 mem_base = xmlMemBlocks();
44687 writer = gen_xmlTextWriterPtr(n_writer, 0);
44688 pe = gen_int(n_pe, 1);
44689 name = gen_const_xmlChar_ptr(n_name, 2);
44690 content = gen_const_xmlChar_ptr(n_content, 3);
44692 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44693 desret_int(ret_val);
44695 des_xmlTextWriterPtr(n_writer, writer, 0);
44696 des_int(n_pe, pe, 1);
44697 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44698 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44699 xmlResetLastError();
44700 if (mem_base != xmlMemBlocks()) {
44701 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44702 xmlMemBlocks() - mem_base);
44704 printf(" %d", n_writer);
44705 printf(" %d", n_pe);
44706 printf(" %d", n_name);
44707 printf(" %d", n_content);
44722 test_xmlTextWriterWriteDTDNotation(void) {
44725 #if defined(LIBXML_WRITER_ENABLED)
44728 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44730 xmlChar * name; /* the name of the xml notation */
44732 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44734 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44737 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44738 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44739 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44740 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44741 mem_base = xmlMemBlocks();
44742 writer = gen_xmlTextWriterPtr(n_writer, 0);
44743 name = gen_const_xmlChar_ptr(n_name, 1);
44744 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44745 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44747 ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44748 desret_int(ret_val);
44750 des_xmlTextWriterPtr(n_writer, writer, 0);
44751 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44752 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44753 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44754 xmlResetLastError();
44755 if (mem_base != xmlMemBlocks()) {
44756 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44757 xmlMemBlocks() - mem_base);
44759 printf(" %d", n_writer);
44760 printf(" %d", n_name);
44761 printf(" %d", n_pubid);
44762 printf(" %d", n_sysid);
44777 test_xmlTextWriterWriteElement(void) {
44780 #if defined(LIBXML_WRITER_ENABLED)
44783 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44785 xmlChar * name; /* element name */
44787 xmlChar * content; /* element content */
44790 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44791 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44792 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44793 mem_base = xmlMemBlocks();
44794 writer = gen_xmlTextWriterPtr(n_writer, 0);
44795 name = gen_const_xmlChar_ptr(n_name, 1);
44796 content = gen_const_xmlChar_ptr(n_content, 2);
44798 ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44799 desret_int(ret_val);
44801 des_xmlTextWriterPtr(n_writer, writer, 0);
44802 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44803 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44804 xmlResetLastError();
44805 if (mem_base != xmlMemBlocks()) {
44806 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44807 xmlMemBlocks() - mem_base);
44809 printf(" %d", n_writer);
44810 printf(" %d", n_name);
44811 printf(" %d", n_content);
44825 test_xmlTextWriterWriteElementNS(void) {
44828 #if defined(LIBXML_WRITER_ENABLED)
44831 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44833 xmlChar * prefix; /* namespace prefix */
44835 xmlChar * name; /* element local name */
44837 xmlChar * namespaceURI; /* namespace URI */
44838 int n_namespaceURI;
44839 xmlChar * content; /* element content */
44842 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44843 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44844 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44845 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44846 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44847 mem_base = xmlMemBlocks();
44848 writer = gen_xmlTextWriterPtr(n_writer, 0);
44849 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44850 name = gen_const_xmlChar_ptr(n_name, 2);
44851 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44852 content = gen_const_xmlChar_ptr(n_content, 4);
44854 ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44855 desret_int(ret_val);
44857 des_xmlTextWriterPtr(n_writer, writer, 0);
44858 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44859 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44860 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44861 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44862 xmlResetLastError();
44863 if (mem_base != xmlMemBlocks()) {
44864 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44865 xmlMemBlocks() - mem_base);
44867 printf(" %d", n_writer);
44868 printf(" %d", n_prefix);
44869 printf(" %d", n_name);
44870 printf(" %d", n_namespaceURI);
44871 printf(" %d", n_content);
44887 test_xmlTextWriterWriteFormatAttribute(void) {
44891 /* missing type support */
44897 test_xmlTextWriterWriteFormatAttributeNS(void) {
44901 /* missing type support */
44907 test_xmlTextWriterWriteFormatCDATA(void) {
44911 /* missing type support */
44917 test_xmlTextWriterWriteFormatComment(void) {
44921 /* missing type support */
44927 test_xmlTextWriterWriteFormatDTD(void) {
44931 /* missing type support */
44937 test_xmlTextWriterWriteFormatDTDAttlist(void) {
44941 /* missing type support */
44947 test_xmlTextWriterWriteFormatDTDElement(void) {
44951 /* missing type support */
44957 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44961 /* missing type support */
44967 test_xmlTextWriterWriteFormatElement(void) {
44971 /* missing type support */
44977 test_xmlTextWriterWriteFormatElementNS(void) {
44981 /* missing type support */
44987 test_xmlTextWriterWriteFormatPI(void) {
44991 /* missing type support */
44997 test_xmlTextWriterWriteFormatRaw(void) {
45001 /* missing type support */
45007 test_xmlTextWriterWriteFormatString(void) {
45011 /* missing type support */
45017 test_xmlTextWriterWritePI(void) {
45020 #if defined(LIBXML_WRITER_ENABLED)
45023 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45025 xmlChar * target; /* PI target */
45027 xmlChar * content; /* PI content */
45030 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45031 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45032 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45033 mem_base = xmlMemBlocks();
45034 writer = gen_xmlTextWriterPtr(n_writer, 0);
45035 target = gen_const_xmlChar_ptr(n_target, 1);
45036 content = gen_const_xmlChar_ptr(n_content, 2);
45038 ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45039 desret_int(ret_val);
45041 des_xmlTextWriterPtr(n_writer, writer, 0);
45042 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45043 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45044 xmlResetLastError();
45045 if (mem_base != xmlMemBlocks()) {
45046 printf("Leak of %d blocks found in xmlTextWriterWritePI",
45047 xmlMemBlocks() - mem_base);
45049 printf(" %d", n_writer);
45050 printf(" %d", n_target);
45051 printf(" %d", n_content);
45065 test_xmlTextWriterWriteRaw(void) {
45068 #if defined(LIBXML_WRITER_ENABLED)
45071 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45073 xmlChar * content; /* text string */
45076 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45077 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45078 mem_base = xmlMemBlocks();
45079 writer = gen_xmlTextWriterPtr(n_writer, 0);
45080 content = gen_const_xmlChar_ptr(n_content, 1);
45082 ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45083 desret_int(ret_val);
45085 des_xmlTextWriterPtr(n_writer, writer, 0);
45086 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45087 xmlResetLastError();
45088 if (mem_base != xmlMemBlocks()) {
45089 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45090 xmlMemBlocks() - mem_base);
45092 printf(" %d", n_writer);
45093 printf(" %d", n_content);
45106 test_xmlTextWriterWriteRawLen(void) {
45109 #if defined(LIBXML_WRITER_ENABLED)
45112 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45114 xmlChar * content; /* text string */
45116 int len; /* length of the text string */
45119 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45120 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45121 for (n_len = 0;n_len < gen_nb_int;n_len++) {
45122 mem_base = xmlMemBlocks();
45123 writer = gen_xmlTextWriterPtr(n_writer, 0);
45124 content = gen_const_xmlChar_ptr(n_content, 1);
45125 len = gen_int(n_len, 2);
45127 ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45128 desret_int(ret_val);
45130 des_xmlTextWriterPtr(n_writer, writer, 0);
45131 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45132 des_int(n_len, len, 2);
45133 xmlResetLastError();
45134 if (mem_base != xmlMemBlocks()) {
45135 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45136 xmlMemBlocks() - mem_base);
45138 printf(" %d", n_writer);
45139 printf(" %d", n_content);
45140 printf(" %d", n_len);
45154 test_xmlTextWriterWriteString(void) {
45157 #if defined(LIBXML_WRITER_ENABLED)
45160 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45162 xmlChar * content; /* text string */
45165 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45166 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45167 mem_base = xmlMemBlocks();
45168 writer = gen_xmlTextWriterPtr(n_writer, 0);
45169 content = gen_const_xmlChar_ptr(n_content, 1);
45171 ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45172 desret_int(ret_val);
45174 des_xmlTextWriterPtr(n_writer, writer, 0);
45175 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45176 xmlResetLastError();
45177 if (mem_base != xmlMemBlocks()) {
45178 printf("Leak of %d blocks found in xmlTextWriterWriteString",
45179 xmlMemBlocks() - mem_base);
45181 printf(" %d", n_writer);
45182 printf(" %d", n_content);
45195 test_xmlTextWriterWriteVFormatAttribute(void) {
45199 /* missing type support */
45205 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45209 /* missing type support */
45215 test_xmlTextWriterWriteVFormatCDATA(void) {
45219 /* missing type support */
45225 test_xmlTextWriterWriteVFormatComment(void) {
45229 /* missing type support */
45235 test_xmlTextWriterWriteVFormatDTD(void) {
45239 /* missing type support */
45245 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45249 /* missing type support */
45255 test_xmlTextWriterWriteVFormatDTDElement(void) {
45259 /* missing type support */
45265 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45269 /* missing type support */
45275 test_xmlTextWriterWriteVFormatElement(void) {
45279 /* missing type support */
45285 test_xmlTextWriterWriteVFormatElementNS(void) {
45289 /* missing type support */
45295 test_xmlTextWriterWriteVFormatPI(void) {
45299 /* missing type support */
45305 test_xmlTextWriterWriteVFormatRaw(void) {
45309 /* missing type support */
45315 test_xmlTextWriterWriteVFormatString(void) {
45319 /* missing type support */
45324 test_xmlwriter(void) {
45327 if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45328 test_ret += test_xmlNewTextWriter();
45329 test_ret += test_xmlNewTextWriterFilename();
45330 test_ret += test_xmlNewTextWriterMemory();
45331 test_ret += test_xmlNewTextWriterPushParser();
45332 test_ret += test_xmlNewTextWriterTree();
45333 test_ret += test_xmlTextWriterEndAttribute();
45334 test_ret += test_xmlTextWriterEndCDATA();
45335 test_ret += test_xmlTextWriterEndComment();
45336 test_ret += test_xmlTextWriterEndDTD();
45337 test_ret += test_xmlTextWriterEndDTDAttlist();
45338 test_ret += test_xmlTextWriterEndDTDElement();
45339 test_ret += test_xmlTextWriterEndDTDEntity();
45340 test_ret += test_xmlTextWriterEndDocument();
45341 test_ret += test_xmlTextWriterEndElement();
45342 test_ret += test_xmlTextWriterEndPI();
45343 test_ret += test_xmlTextWriterFlush();
45344 test_ret += test_xmlTextWriterFullEndElement();
45345 test_ret += test_xmlTextWriterSetIndent();
45346 test_ret += test_xmlTextWriterSetIndentString();
45347 test_ret += test_xmlTextWriterStartAttribute();
45348 test_ret += test_xmlTextWriterStartAttributeNS();
45349 test_ret += test_xmlTextWriterStartCDATA();
45350 test_ret += test_xmlTextWriterStartComment();
45351 test_ret += test_xmlTextWriterStartDTD();
45352 test_ret += test_xmlTextWriterStartDTDAttlist();
45353 test_ret += test_xmlTextWriterStartDTDElement();
45354 test_ret += test_xmlTextWriterStartDTDEntity();
45355 test_ret += test_xmlTextWriterStartDocument();
45356 test_ret += test_xmlTextWriterStartElement();
45357 test_ret += test_xmlTextWriterStartElementNS();
45358 test_ret += test_xmlTextWriterStartPI();
45359 test_ret += test_xmlTextWriterWriteAttribute();
45360 test_ret += test_xmlTextWriterWriteAttributeNS();
45361 test_ret += test_xmlTextWriterWriteBase64();
45362 test_ret += test_xmlTextWriterWriteBinHex();
45363 test_ret += test_xmlTextWriterWriteCDATA();
45364 test_ret += test_xmlTextWriterWriteComment();
45365 test_ret += test_xmlTextWriterWriteDTD();
45366 test_ret += test_xmlTextWriterWriteDTDAttlist();
45367 test_ret += test_xmlTextWriterWriteDTDElement();
45368 test_ret += test_xmlTextWriterWriteDTDEntity();
45369 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45370 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45371 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45372 test_ret += test_xmlTextWriterWriteDTDNotation();
45373 test_ret += test_xmlTextWriterWriteElement();
45374 test_ret += test_xmlTextWriterWriteElementNS();
45375 test_ret += test_xmlTextWriterWriteFormatAttribute();
45376 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45377 test_ret += test_xmlTextWriterWriteFormatCDATA();
45378 test_ret += test_xmlTextWriterWriteFormatComment();
45379 test_ret += test_xmlTextWriterWriteFormatDTD();
45380 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45381 test_ret += test_xmlTextWriterWriteFormatDTDElement();
45382 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45383 test_ret += test_xmlTextWriterWriteFormatElement();
45384 test_ret += test_xmlTextWriterWriteFormatElementNS();
45385 test_ret += test_xmlTextWriterWriteFormatPI();
45386 test_ret += test_xmlTextWriterWriteFormatRaw();
45387 test_ret += test_xmlTextWriterWriteFormatString();
45388 test_ret += test_xmlTextWriterWritePI();
45389 test_ret += test_xmlTextWriterWriteRaw();
45390 test_ret += test_xmlTextWriterWriteRawLen();
45391 test_ret += test_xmlTextWriterWriteString();
45392 test_ret += test_xmlTextWriterWriteVFormatAttribute();
45393 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45394 test_ret += test_xmlTextWriterWriteVFormatCDATA();
45395 test_ret += test_xmlTextWriterWriteVFormatComment();
45396 test_ret += test_xmlTextWriterWriteVFormatDTD();
45397 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45398 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45399 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45400 test_ret += test_xmlTextWriterWriteVFormatElement();
45401 test_ret += test_xmlTextWriterWriteVFormatElementNS();
45402 test_ret += test_xmlTextWriterWriteVFormatPI();
45403 test_ret += test_xmlTextWriterWriteVFormatRaw();
45404 test_ret += test_xmlTextWriterWriteVFormatString();
45407 printf("Module xmlwriter: %d errors\n", test_ret);
45412 test_xmlXPathCastBooleanToNumber(void) {
45415 #if defined(LIBXML_XPATH_ENABLED)
45418 int val; /* a boolean */
45421 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45422 mem_base = xmlMemBlocks();
45423 val = gen_int(n_val, 0);
45425 ret_val = xmlXPathCastBooleanToNumber(val);
45426 desret_double(ret_val);
45428 des_int(n_val, val, 0);
45429 xmlResetLastError();
45430 if (mem_base != xmlMemBlocks()) {
45431 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45432 xmlMemBlocks() - mem_base);
45434 printf(" %d", n_val);
45446 test_xmlXPathCastBooleanToString(void) {
45449 #if defined(LIBXML_XPATH_ENABLED)
45452 int val; /* a boolean */
45455 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45456 mem_base = xmlMemBlocks();
45457 val = gen_int(n_val, 0);
45459 ret_val = xmlXPathCastBooleanToString(val);
45460 desret_xmlChar_ptr(ret_val);
45462 des_int(n_val, val, 0);
45463 xmlResetLastError();
45464 if (mem_base != xmlMemBlocks()) {
45465 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45466 xmlMemBlocks() - mem_base);
45468 printf(" %d", n_val);
45480 test_xmlXPathCastNodeSetToBoolean(void) {
45483 #if defined(LIBXML_XPATH_ENABLED)
45486 xmlNodeSetPtr ns; /* a node-set */
45489 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45490 mem_base = xmlMemBlocks();
45491 ns = gen_xmlNodeSetPtr(n_ns, 0);
45493 ret_val = xmlXPathCastNodeSetToBoolean(ns);
45494 desret_int(ret_val);
45496 des_xmlNodeSetPtr(n_ns, ns, 0);
45497 xmlResetLastError();
45498 if (mem_base != xmlMemBlocks()) {
45499 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45500 xmlMemBlocks() - mem_base);
45502 printf(" %d", n_ns);
45514 test_xmlXPathCastNodeSetToNumber(void) {
45517 #if defined(LIBXML_XPATH_ENABLED)
45520 xmlNodeSetPtr ns; /* a node-set */
45523 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45524 mem_base = xmlMemBlocks();
45525 ns = gen_xmlNodeSetPtr(n_ns, 0);
45527 ret_val = xmlXPathCastNodeSetToNumber(ns);
45528 desret_double(ret_val);
45530 des_xmlNodeSetPtr(n_ns, ns, 0);
45531 xmlResetLastError();
45532 if (mem_base != xmlMemBlocks()) {
45533 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45534 xmlMemBlocks() - mem_base);
45536 printf(" %d", n_ns);
45548 test_xmlXPathCastNodeSetToString(void) {
45551 #if defined(LIBXML_XPATH_ENABLED)
45554 xmlNodeSetPtr ns; /* a node-set */
45557 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45558 mem_base = xmlMemBlocks();
45559 ns = gen_xmlNodeSetPtr(n_ns, 0);
45561 ret_val = xmlXPathCastNodeSetToString(ns);
45562 desret_xmlChar_ptr(ret_val);
45564 des_xmlNodeSetPtr(n_ns, ns, 0);
45565 xmlResetLastError();
45566 if (mem_base != xmlMemBlocks()) {
45567 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45568 xmlMemBlocks() - mem_base);
45570 printf(" %d", n_ns);
45582 test_xmlXPathCastNodeToNumber(void) {
45585 #if defined(LIBXML_XPATH_ENABLED)
45588 xmlNodePtr node; /* a node */
45591 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45592 mem_base = xmlMemBlocks();
45593 node = gen_xmlNodePtr(n_node, 0);
45595 ret_val = xmlXPathCastNodeToNumber(node);
45596 desret_double(ret_val);
45598 des_xmlNodePtr(n_node, node, 0);
45599 xmlResetLastError();
45600 if (mem_base != xmlMemBlocks()) {
45601 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45602 xmlMemBlocks() - mem_base);
45604 printf(" %d", n_node);
45616 test_xmlXPathCastNodeToString(void) {
45619 #if defined(LIBXML_XPATH_ENABLED)
45622 xmlNodePtr node; /* a node */
45625 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45626 mem_base = xmlMemBlocks();
45627 node = gen_xmlNodePtr(n_node, 0);
45629 ret_val = xmlXPathCastNodeToString(node);
45630 desret_xmlChar_ptr(ret_val);
45632 des_xmlNodePtr(n_node, node, 0);
45633 xmlResetLastError();
45634 if (mem_base != xmlMemBlocks()) {
45635 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45636 xmlMemBlocks() - mem_base);
45638 printf(" %d", n_node);
45650 test_xmlXPathCastNumberToBoolean(void) {
45653 #if defined(LIBXML_XPATH_ENABLED)
45656 double val; /* a number */
45659 for (n_val = 0;n_val < gen_nb_double;n_val++) {
45660 mem_base = xmlMemBlocks();
45661 val = gen_double(n_val, 0);
45663 ret_val = xmlXPathCastNumberToBoolean(val);
45664 desret_int(ret_val);
45666 des_double(n_val, val, 0);
45667 xmlResetLastError();
45668 if (mem_base != xmlMemBlocks()) {
45669 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45670 xmlMemBlocks() - mem_base);
45672 printf(" %d", n_val);
45684 test_xmlXPathCastNumberToString(void) {
45687 #if defined(LIBXML_XPATH_ENABLED)
45690 double val; /* a number */
45693 for (n_val = 0;n_val < gen_nb_double;n_val++) {
45694 mem_base = xmlMemBlocks();
45695 val = gen_double(n_val, 0);
45697 ret_val = xmlXPathCastNumberToString(val);
45698 desret_xmlChar_ptr(ret_val);
45700 des_double(n_val, val, 0);
45701 xmlResetLastError();
45702 if (mem_base != xmlMemBlocks()) {
45703 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45704 xmlMemBlocks() - mem_base);
45706 printf(" %d", n_val);
45718 test_xmlXPathCastStringToBoolean(void) {
45721 #if defined(LIBXML_XPATH_ENABLED)
45724 xmlChar * val; /* a string */
45727 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45728 mem_base = xmlMemBlocks();
45729 val = gen_const_xmlChar_ptr(n_val, 0);
45731 ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45732 desret_int(ret_val);
45734 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45735 xmlResetLastError();
45736 if (mem_base != xmlMemBlocks()) {
45737 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45738 xmlMemBlocks() - mem_base);
45740 printf(" %d", n_val);
45752 test_xmlXPathCastStringToNumber(void) {
45755 #if defined(LIBXML_XPATH_ENABLED)
45758 xmlChar * val; /* a string */
45761 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45762 mem_base = xmlMemBlocks();
45763 val = gen_const_xmlChar_ptr(n_val, 0);
45765 ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45766 desret_double(ret_val);
45768 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45769 xmlResetLastError();
45770 if (mem_base != xmlMemBlocks()) {
45771 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45772 xmlMemBlocks() - mem_base);
45774 printf(" %d", n_val);
45786 test_xmlXPathCastToBoolean(void) {
45789 #if defined(LIBXML_XPATH_ENABLED)
45792 xmlXPathObjectPtr val; /* an XPath object */
45795 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45796 mem_base = xmlMemBlocks();
45797 val = gen_xmlXPathObjectPtr(n_val, 0);
45799 ret_val = xmlXPathCastToBoolean(val);
45800 desret_int(ret_val);
45802 des_xmlXPathObjectPtr(n_val, val, 0);
45803 xmlResetLastError();
45804 if (mem_base != xmlMemBlocks()) {
45805 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45806 xmlMemBlocks() - mem_base);
45808 printf(" %d", n_val);
45820 test_xmlXPathCastToNumber(void) {
45823 #if defined(LIBXML_XPATH_ENABLED)
45826 xmlXPathObjectPtr val; /* an XPath object */
45829 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45830 mem_base = xmlMemBlocks();
45831 val = gen_xmlXPathObjectPtr(n_val, 0);
45833 ret_val = xmlXPathCastToNumber(val);
45834 desret_double(ret_val);
45836 des_xmlXPathObjectPtr(n_val, val, 0);
45837 xmlResetLastError();
45838 if (mem_base != xmlMemBlocks()) {
45839 printf("Leak of %d blocks found in xmlXPathCastToNumber",
45840 xmlMemBlocks() - mem_base);
45842 printf(" %d", n_val);
45854 test_xmlXPathCastToString(void) {
45857 #if defined(LIBXML_XPATH_ENABLED)
45860 xmlXPathObjectPtr val; /* an XPath object */
45863 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45864 mem_base = xmlMemBlocks();
45865 val = gen_xmlXPathObjectPtr(n_val, 0);
45867 ret_val = xmlXPathCastToString(val);
45868 desret_xmlChar_ptr(ret_val);
45870 des_xmlXPathObjectPtr(n_val, val, 0);
45871 xmlResetLastError();
45872 if (mem_base != xmlMemBlocks()) {
45873 printf("Leak of %d blocks found in xmlXPathCastToString",
45874 xmlMemBlocks() - mem_base);
45876 printf(" %d", n_val);
45888 test_xmlXPathCmpNodes(void) {
45891 #if defined(LIBXML_XPATH_ENABLED)
45894 xmlNodePtr node1; /* the first node */
45896 xmlNodePtr node2; /* the second node */
45899 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45900 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45901 mem_base = xmlMemBlocks();
45902 node1 = gen_xmlNodePtr(n_node1, 0);
45903 node2 = gen_xmlNodePtr(n_node2, 1);
45905 ret_val = xmlXPathCmpNodes(node1, node2);
45906 desret_int(ret_val);
45908 des_xmlNodePtr(n_node1, node1, 0);
45909 des_xmlNodePtr(n_node2, node2, 1);
45910 xmlResetLastError();
45911 if (mem_base != xmlMemBlocks()) {
45912 printf("Leak of %d blocks found in xmlXPathCmpNodes",
45913 xmlMemBlocks() - mem_base);
45915 printf(" %d", n_node1);
45916 printf(" %d", n_node2);
45929 test_xmlXPathCompile(void) {
45933 /* missing type support */
45937 #ifdef LIBXML_XPATH_ENABLED
45939 #define gen_nb_xmlXPathCompExprPtr 1
45940 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45943 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45947 #ifdef LIBXML_XPATH_ENABLED
45949 #define gen_nb_xmlXPathContextPtr 1
45950 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45953 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45959 test_xmlXPathCompiledEval(void) {
45962 #if defined(LIBXML_XPATH_ENABLED)
45964 xmlXPathObjectPtr ret_val;
45965 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45967 xmlXPathContextPtr ctx; /* the XPath context */
45970 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45971 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45972 mem_base = xmlMemBlocks();
45973 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45974 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45976 ret_val = xmlXPathCompiledEval(comp, ctx);
45977 desret_xmlXPathObjectPtr(ret_val);
45979 des_xmlXPathCompExprPtr(n_comp, comp, 0);
45980 des_xmlXPathContextPtr(n_ctx, ctx, 1);
45981 xmlResetLastError();
45982 if (mem_base != xmlMemBlocks()) {
45983 printf("Leak of %d blocks found in xmlXPathCompiledEval",
45984 xmlMemBlocks() - mem_base);
45986 printf(" %d", n_comp);
45987 printf(" %d", n_ctx);
46000 test_xmlXPathCompiledEvalToBoolean(void) {
46003 #if defined(LIBXML_XPATH_ENABLED)
46006 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46008 xmlXPathContextPtr ctxt; /* the XPath context */
46011 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46012 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46013 mem_base = xmlMemBlocks();
46014 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46015 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46017 ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46018 desret_int(ret_val);
46020 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46021 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46022 xmlResetLastError();
46023 if (mem_base != xmlMemBlocks()) {
46024 printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46025 xmlMemBlocks() - mem_base);
46027 printf(" %d", n_comp);
46028 printf(" %d", n_ctxt);
46041 test_xmlXPathContextSetCache(void) {
46044 #if defined(LIBXML_XPATH_ENABLED)
46047 xmlXPathContextPtr ctxt; /* the XPath context */
46049 int active; /* enables/disables (creates/frees) the cache */
46051 int value; /* a value with semantics dependant on @options */
46053 int options; /* options (currently only the value 0 is used) */
46056 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46057 for (n_active = 0;n_active < gen_nb_int;n_active++) {
46058 for (n_value = 0;n_value < gen_nb_int;n_value++) {
46059 for (n_options = 0;n_options < gen_nb_int;n_options++) {
46060 mem_base = xmlMemBlocks();
46061 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46062 active = gen_int(n_active, 1);
46063 value = gen_int(n_value, 2);
46064 options = gen_int(n_options, 3);
46066 ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46067 desret_int(ret_val);
46069 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46070 des_int(n_active, active, 1);
46071 des_int(n_value, value, 2);
46072 des_int(n_options, options, 3);
46073 xmlResetLastError();
46074 if (mem_base != xmlMemBlocks()) {
46075 printf("Leak of %d blocks found in xmlXPathContextSetCache",
46076 xmlMemBlocks() - mem_base);
46078 printf(" %d", n_ctxt);
46079 printf(" %d", n_active);
46080 printf(" %d", n_value);
46081 printf(" %d", n_options);
46096 test_xmlXPathConvertBoolean(void) {
46099 #if defined(LIBXML_XPATH_ENABLED)
46101 xmlXPathObjectPtr ret_val;
46102 xmlXPathObjectPtr val; /* an XPath object */
46105 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46106 mem_base = xmlMemBlocks();
46107 val = gen_xmlXPathObjectPtr(n_val, 0);
46109 ret_val = xmlXPathConvertBoolean(val);
46111 desret_xmlXPathObjectPtr(ret_val);
46113 des_xmlXPathObjectPtr(n_val, val, 0);
46114 xmlResetLastError();
46115 if (mem_base != xmlMemBlocks()) {
46116 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46117 xmlMemBlocks() - mem_base);
46119 printf(" %d", n_val);
46131 test_xmlXPathConvertNumber(void) {
46134 #if defined(LIBXML_XPATH_ENABLED)
46136 xmlXPathObjectPtr ret_val;
46137 xmlXPathObjectPtr val; /* an XPath object */
46140 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46141 mem_base = xmlMemBlocks();
46142 val = gen_xmlXPathObjectPtr(n_val, 0);
46144 ret_val = xmlXPathConvertNumber(val);
46146 desret_xmlXPathObjectPtr(ret_val);
46148 des_xmlXPathObjectPtr(n_val, val, 0);
46149 xmlResetLastError();
46150 if (mem_base != xmlMemBlocks()) {
46151 printf("Leak of %d blocks found in xmlXPathConvertNumber",
46152 xmlMemBlocks() - mem_base);
46154 printf(" %d", n_val);
46166 test_xmlXPathConvertString(void) {
46169 #if defined(LIBXML_XPATH_ENABLED)
46171 xmlXPathObjectPtr ret_val;
46172 xmlXPathObjectPtr val; /* an XPath object */
46175 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46176 mem_base = xmlMemBlocks();
46177 val = gen_xmlXPathObjectPtr(n_val, 0);
46179 ret_val = xmlXPathConvertString(val);
46181 desret_xmlXPathObjectPtr(ret_val);
46183 des_xmlXPathObjectPtr(n_val, val, 0);
46184 xmlResetLastError();
46185 if (mem_base != xmlMemBlocks()) {
46186 printf("Leak of %d blocks found in xmlXPathConvertString",
46187 xmlMemBlocks() - mem_base);
46189 printf(" %d", n_val);
46201 test_xmlXPathCtxtCompile(void) {
46205 /* missing type support */
46211 test_xmlXPathEval(void) {
46214 #if defined(LIBXML_XPATH_ENABLED)
46216 xmlXPathObjectPtr ret_val;
46217 xmlChar * str; /* the XPath expression */
46219 xmlXPathContextPtr ctx; /* the XPath context */
46222 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46223 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46224 mem_base = xmlMemBlocks();
46225 str = gen_const_xmlChar_ptr(n_str, 0);
46226 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46228 ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46229 desret_xmlXPathObjectPtr(ret_val);
46231 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46232 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46233 xmlResetLastError();
46234 if (mem_base != xmlMemBlocks()) {
46235 printf("Leak of %d blocks found in xmlXPathEval",
46236 xmlMemBlocks() - mem_base);
46238 printf(" %d", n_str);
46239 printf(" %d", n_ctx);
46252 test_xmlXPathEvalExpression(void) {
46255 #if defined(LIBXML_XPATH_ENABLED)
46257 xmlXPathObjectPtr ret_val;
46258 xmlChar * str; /* the XPath expression */
46260 xmlXPathContextPtr ctxt; /* the XPath context */
46263 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46264 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46265 mem_base = xmlMemBlocks();
46266 str = gen_const_xmlChar_ptr(n_str, 0);
46267 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46269 ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46270 desret_xmlXPathObjectPtr(ret_val);
46272 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46273 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46274 xmlResetLastError();
46275 if (mem_base != xmlMemBlocks()) {
46276 printf("Leak of %d blocks found in xmlXPathEvalExpression",
46277 xmlMemBlocks() - mem_base);
46279 printf(" %d", n_str);
46280 printf(" %d", n_ctxt);
46293 test_xmlXPathEvalPredicate(void) {
46296 #if defined(LIBXML_XPATH_ENABLED)
46299 xmlXPathContextPtr ctxt; /* the XPath context */
46301 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46304 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46305 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46306 mem_base = xmlMemBlocks();
46307 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46308 res = gen_xmlXPathObjectPtr(n_res, 1);
46310 ret_val = xmlXPathEvalPredicate(ctxt, res);
46311 desret_int(ret_val);
46313 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46314 des_xmlXPathObjectPtr(n_res, res, 1);
46315 xmlResetLastError();
46316 if (mem_base != xmlMemBlocks()) {
46317 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46318 xmlMemBlocks() - mem_base);
46320 printf(" %d", n_ctxt);
46321 printf(" %d", n_res);
46334 test_xmlXPathInit(void) {
46337 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46340 mem_base = xmlMemBlocks();
46344 xmlResetLastError();
46345 if (mem_base != xmlMemBlocks()) {
46346 printf("Leak of %d blocks found in xmlXPathInit",
46347 xmlMemBlocks() - mem_base);
46359 test_xmlXPathIsInf(void) {
46362 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46365 double val; /* a double value */
46368 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46369 mem_base = xmlMemBlocks();
46370 val = gen_double(n_val, 0);
46372 ret_val = xmlXPathIsInf(val);
46373 desret_int(ret_val);
46375 des_double(n_val, val, 0);
46376 xmlResetLastError();
46377 if (mem_base != xmlMemBlocks()) {
46378 printf("Leak of %d blocks found in xmlXPathIsInf",
46379 xmlMemBlocks() - mem_base);
46381 printf(" %d", n_val);
46393 test_xmlXPathIsNaN(void) {
46396 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46399 double val; /* a double value */
46402 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46403 mem_base = xmlMemBlocks();
46404 val = gen_double(n_val, 0);
46406 ret_val = xmlXPathIsNaN(val);
46407 desret_int(ret_val);
46409 des_double(n_val, val, 0);
46410 xmlResetLastError();
46411 if (mem_base != xmlMemBlocks()) {
46412 printf("Leak of %d blocks found in xmlXPathIsNaN",
46413 xmlMemBlocks() - mem_base);
46415 printf(" %d", n_val);
46427 test_xmlXPathNewContext(void) {
46431 /* missing type support */
46437 test_xmlXPathNodeSetCreate(void) {
46440 #if defined(LIBXML_XPATH_ENABLED)
46442 xmlNodeSetPtr ret_val;
46443 xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46446 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46447 mem_base = xmlMemBlocks();
46448 val = gen_xmlNodePtr(n_val, 0);
46450 ret_val = xmlXPathNodeSetCreate(val);
46451 desret_xmlNodeSetPtr(ret_val);
46453 des_xmlNodePtr(n_val, val, 0);
46454 xmlResetLastError();
46455 if (mem_base != xmlMemBlocks()) {
46456 printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46457 xmlMemBlocks() - mem_base);
46459 printf(" %d", n_val);
46471 test_xmlXPathObjectCopy(void) {
46474 #if defined(LIBXML_XPATH_ENABLED)
46476 xmlXPathObjectPtr ret_val;
46477 xmlXPathObjectPtr val; /* the original object */
46480 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46481 mem_base = xmlMemBlocks();
46482 val = gen_xmlXPathObjectPtr(n_val, 0);
46484 ret_val = xmlXPathObjectCopy(val);
46485 desret_xmlXPathObjectPtr(ret_val);
46487 des_xmlXPathObjectPtr(n_val, val, 0);
46488 xmlResetLastError();
46489 if (mem_base != xmlMemBlocks()) {
46490 printf("Leak of %d blocks found in xmlXPathObjectCopy",
46491 xmlMemBlocks() - mem_base);
46493 printf(" %d", n_val);
46505 test_xmlXPathOrderDocElems(void) {
46508 #if defined(LIBXML_XPATH_ENABLED)
46511 xmlDocPtr doc; /* an input document */
46514 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46515 mem_base = xmlMemBlocks();
46516 doc = gen_xmlDocPtr(n_doc, 0);
46518 ret_val = xmlXPathOrderDocElems(doc);
46519 desret_long(ret_val);
46521 des_xmlDocPtr(n_doc, doc, 0);
46522 xmlResetLastError();
46523 if (mem_base != xmlMemBlocks()) {
46524 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46525 xmlMemBlocks() - mem_base);
46527 printf(" %d", n_doc);
46541 if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46542 test_ret += test_xmlXPathCastBooleanToNumber();
46543 test_ret += test_xmlXPathCastBooleanToString();
46544 test_ret += test_xmlXPathCastNodeSetToBoolean();
46545 test_ret += test_xmlXPathCastNodeSetToNumber();
46546 test_ret += test_xmlXPathCastNodeSetToString();
46547 test_ret += test_xmlXPathCastNodeToNumber();
46548 test_ret += test_xmlXPathCastNodeToString();
46549 test_ret += test_xmlXPathCastNumberToBoolean();
46550 test_ret += test_xmlXPathCastNumberToString();
46551 test_ret += test_xmlXPathCastStringToBoolean();
46552 test_ret += test_xmlXPathCastStringToNumber();
46553 test_ret += test_xmlXPathCastToBoolean();
46554 test_ret += test_xmlXPathCastToNumber();
46555 test_ret += test_xmlXPathCastToString();
46556 test_ret += test_xmlXPathCmpNodes();
46557 test_ret += test_xmlXPathCompile();
46558 test_ret += test_xmlXPathCompiledEval();
46559 test_ret += test_xmlXPathCompiledEvalToBoolean();
46560 test_ret += test_xmlXPathContextSetCache();
46561 test_ret += test_xmlXPathConvertBoolean();
46562 test_ret += test_xmlXPathConvertNumber();
46563 test_ret += test_xmlXPathConvertString();
46564 test_ret += test_xmlXPathCtxtCompile();
46565 test_ret += test_xmlXPathEval();
46566 test_ret += test_xmlXPathEvalExpression();
46567 test_ret += test_xmlXPathEvalPredicate();
46568 test_ret += test_xmlXPathInit();
46569 test_ret += test_xmlXPathIsInf();
46570 test_ret += test_xmlXPathIsNaN();
46571 test_ret += test_xmlXPathNewContext();
46572 test_ret += test_xmlXPathNodeSetCreate();
46573 test_ret += test_xmlXPathObjectCopy();
46574 test_ret += test_xmlXPathOrderDocElems();
46577 printf("Module xpath: %d errors\n", test_ret);
46580 #ifdef LIBXML_XPATH_ENABLED
46582 #define gen_nb_xmlXPathParserContextPtr 1
46583 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46586 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46592 test_valuePop(void) {
46595 #if defined(LIBXML_XPATH_ENABLED)
46597 xmlXPathObjectPtr ret_val;
46598 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46601 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46602 mem_base = xmlMemBlocks();
46603 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46605 ret_val = valuePop(ctxt);
46606 desret_xmlXPathObjectPtr(ret_val);
46608 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46609 xmlResetLastError();
46610 if (mem_base != xmlMemBlocks()) {
46611 printf("Leak of %d blocks found in valuePop",
46612 xmlMemBlocks() - mem_base);
46614 printf(" %d", n_ctxt);
46626 test_valuePush(void) {
46629 #if defined(LIBXML_XPATH_ENABLED)
46632 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46634 xmlXPathObjectPtr value; /* the XPath object */
46637 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46638 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46639 mem_base = xmlMemBlocks();
46640 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46641 value = gen_xmlXPathObjectPtr(n_value, 1);
46643 ret_val = valuePush(ctxt, value);
46644 desret_int(ret_val);
46646 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46647 des_xmlXPathObjectPtr(n_value, value, 1);
46648 xmlResetLastError();
46649 if (mem_base != xmlMemBlocks()) {
46650 printf("Leak of %d blocks found in valuePush",
46651 xmlMemBlocks() - mem_base);
46653 printf(" %d", n_ctxt);
46654 printf(" %d", n_value);
46667 test_xmlXPathAddValues(void) {
46670 #if defined(LIBXML_XPATH_ENABLED)
46672 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46675 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46676 mem_base = xmlMemBlocks();
46677 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46679 xmlXPathAddValues(ctxt);
46681 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46682 xmlResetLastError();
46683 if (mem_base != xmlMemBlocks()) {
46684 printf("Leak of %d blocks found in xmlXPathAddValues",
46685 xmlMemBlocks() - mem_base);
46687 printf(" %d", n_ctxt);
46699 test_xmlXPathBooleanFunction(void) {
46702 #if defined(LIBXML_XPATH_ENABLED)
46704 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46706 int nargs; /* the number of arguments */
46709 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46710 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46711 mem_base = xmlMemBlocks();
46712 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46713 nargs = gen_int(n_nargs, 1);
46715 xmlXPathBooleanFunction(ctxt, nargs);
46717 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46718 des_int(n_nargs, nargs, 1);
46719 xmlResetLastError();
46720 if (mem_base != xmlMemBlocks()) {
46721 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46722 xmlMemBlocks() - mem_base);
46724 printf(" %d", n_ctxt);
46725 printf(" %d", n_nargs);
46738 test_xmlXPathCeilingFunction(void) {
46741 #if defined(LIBXML_XPATH_ENABLED)
46743 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46745 int nargs; /* the number of arguments */
46748 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46749 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46750 mem_base = xmlMemBlocks();
46751 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46752 nargs = gen_int(n_nargs, 1);
46754 xmlXPathCeilingFunction(ctxt, nargs);
46756 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46757 des_int(n_nargs, nargs, 1);
46758 xmlResetLastError();
46759 if (mem_base != xmlMemBlocks()) {
46760 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46761 xmlMemBlocks() - mem_base);
46763 printf(" %d", n_ctxt);
46764 printf(" %d", n_nargs);
46777 test_xmlXPathCompareValues(void) {
46780 #if defined(LIBXML_XPATH_ENABLED)
46783 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46785 int inf; /* less than (1) or greater than (0) */
46787 int strict; /* is the comparison strict */
46790 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46791 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46792 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46793 mem_base = xmlMemBlocks();
46794 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46795 inf = gen_int(n_inf, 1);
46796 strict = gen_int(n_strict, 2);
46798 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46799 desret_int(ret_val);
46801 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46802 des_int(n_inf, inf, 1);
46803 des_int(n_strict, strict, 2);
46804 xmlResetLastError();
46805 if (mem_base != xmlMemBlocks()) {
46806 printf("Leak of %d blocks found in xmlXPathCompareValues",
46807 xmlMemBlocks() - mem_base);
46809 printf(" %d", n_ctxt);
46810 printf(" %d", n_inf);
46811 printf(" %d", n_strict);
46825 test_xmlXPathConcatFunction(void) {
46828 #if defined(LIBXML_XPATH_ENABLED)
46830 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46832 int nargs; /* the number of arguments */
46835 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46836 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46837 mem_base = xmlMemBlocks();
46838 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46839 nargs = gen_int(n_nargs, 1);
46841 xmlXPathConcatFunction(ctxt, nargs);
46843 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46844 des_int(n_nargs, nargs, 1);
46845 xmlResetLastError();
46846 if (mem_base != xmlMemBlocks()) {
46847 printf("Leak of %d blocks found in xmlXPathConcatFunction",
46848 xmlMemBlocks() - mem_base);
46850 printf(" %d", n_ctxt);
46851 printf(" %d", n_nargs);
46864 test_xmlXPathContainsFunction(void) {
46867 #if defined(LIBXML_XPATH_ENABLED)
46869 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46871 int nargs; /* the number of arguments */
46874 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46875 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46876 mem_base = xmlMemBlocks();
46877 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46878 nargs = gen_int(n_nargs, 1);
46880 xmlXPathContainsFunction(ctxt, nargs);
46882 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46883 des_int(n_nargs, nargs, 1);
46884 xmlResetLastError();
46885 if (mem_base != xmlMemBlocks()) {
46886 printf("Leak of %d blocks found in xmlXPathContainsFunction",
46887 xmlMemBlocks() - mem_base);
46889 printf(" %d", n_ctxt);
46890 printf(" %d", n_nargs);
46903 test_xmlXPathCountFunction(void) {
46906 #if defined(LIBXML_XPATH_ENABLED)
46908 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46910 int nargs; /* the number of arguments */
46913 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46914 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46915 mem_base = xmlMemBlocks();
46916 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46917 nargs = gen_int(n_nargs, 1);
46919 xmlXPathCountFunction(ctxt, nargs);
46921 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46922 des_int(n_nargs, nargs, 1);
46923 xmlResetLastError();
46924 if (mem_base != xmlMemBlocks()) {
46925 printf("Leak of %d blocks found in xmlXPathCountFunction",
46926 xmlMemBlocks() - mem_base);
46928 printf(" %d", n_ctxt);
46929 printf(" %d", n_nargs);
46942 test_xmlXPathDebugDumpCompExpr(void) {
46945 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46947 FILE * output; /* the FILE * for the output */
46949 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46951 int depth; /* the indentation level. */
46954 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46955 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46956 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46957 mem_base = xmlMemBlocks();
46958 output = gen_FILE_ptr(n_output, 0);
46959 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46960 depth = gen_int(n_depth, 2);
46962 xmlXPathDebugDumpCompExpr(output, comp, depth);
46964 des_FILE_ptr(n_output, output, 0);
46965 des_xmlXPathCompExprPtr(n_comp, comp, 1);
46966 des_int(n_depth, depth, 2);
46967 xmlResetLastError();
46968 if (mem_base != xmlMemBlocks()) {
46969 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46970 xmlMemBlocks() - mem_base);
46972 printf(" %d", n_output);
46973 printf(" %d", n_comp);
46974 printf(" %d", n_depth);
46988 test_xmlXPathDebugDumpObject(void) {
46991 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46993 FILE * output; /* the FILE * to dump the output */
46995 xmlXPathObjectPtr cur; /* the object to inspect */
46997 int depth; /* indentation level */
47000 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47001 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47002 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47003 mem_base = xmlMemBlocks();
47004 output = gen_FILE_ptr(n_output, 0);
47005 cur = gen_xmlXPathObjectPtr(n_cur, 1);
47006 depth = gen_int(n_depth, 2);
47008 xmlXPathDebugDumpObject(output, cur, depth);
47010 des_FILE_ptr(n_output, output, 0);
47011 des_xmlXPathObjectPtr(n_cur, cur, 1);
47012 des_int(n_depth, depth, 2);
47013 xmlResetLastError();
47014 if (mem_base != xmlMemBlocks()) {
47015 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47016 xmlMemBlocks() - mem_base);
47018 printf(" %d", n_output);
47019 printf(" %d", n_cur);
47020 printf(" %d", n_depth);
47034 test_xmlXPathDifference(void) {
47037 #if defined(LIBXML_XPATH_ENABLED)
47039 xmlNodeSetPtr ret_val;
47040 xmlNodeSetPtr nodes1; /* a node-set */
47042 xmlNodeSetPtr nodes2; /* a node-set */
47045 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47046 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47047 mem_base = xmlMemBlocks();
47048 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47049 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47051 ret_val = xmlXPathDifference(nodes1, nodes2);
47052 desret_xmlNodeSetPtr(ret_val);
47054 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47055 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47056 xmlResetLastError();
47057 if (mem_base != xmlMemBlocks()) {
47058 printf("Leak of %d blocks found in xmlXPathDifference",
47059 xmlMemBlocks() - mem_base);
47061 printf(" %d", n_nodes1);
47062 printf(" %d", n_nodes2);
47075 test_xmlXPathDistinct(void) {
47078 #if defined(LIBXML_XPATH_ENABLED)
47080 xmlNodeSetPtr ret_val;
47081 xmlNodeSetPtr nodes; /* a node-set */
47084 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47085 mem_base = xmlMemBlocks();
47086 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47088 ret_val = xmlXPathDistinct(nodes);
47089 desret_xmlNodeSetPtr(ret_val);
47091 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47092 xmlResetLastError();
47093 if (mem_base != xmlMemBlocks()) {
47094 printf("Leak of %d blocks found in xmlXPathDistinct",
47095 xmlMemBlocks() - mem_base);
47097 printf(" %d", n_nodes);
47109 test_xmlXPathDistinctSorted(void) {
47112 #if defined(LIBXML_XPATH_ENABLED)
47114 xmlNodeSetPtr ret_val;
47115 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47118 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47119 mem_base = xmlMemBlocks();
47120 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47122 ret_val = xmlXPathDistinctSorted(nodes);
47123 desret_xmlNodeSetPtr(ret_val);
47125 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47126 xmlResetLastError();
47127 if (mem_base != xmlMemBlocks()) {
47128 printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47129 xmlMemBlocks() - mem_base);
47131 printf(" %d", n_nodes);
47143 test_xmlXPathDivValues(void) {
47146 #if defined(LIBXML_XPATH_ENABLED)
47148 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47151 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47152 mem_base = xmlMemBlocks();
47153 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47155 xmlXPathDivValues(ctxt);
47157 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47158 xmlResetLastError();
47159 if (mem_base != xmlMemBlocks()) {
47160 printf("Leak of %d blocks found in xmlXPathDivValues",
47161 xmlMemBlocks() - mem_base);
47163 printf(" %d", n_ctxt);
47175 test_xmlXPathEqualValues(void) {
47178 #if defined(LIBXML_XPATH_ENABLED)
47181 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47184 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47185 mem_base = xmlMemBlocks();
47186 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47188 ret_val = xmlXPathEqualValues(ctxt);
47189 desret_int(ret_val);
47191 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47192 xmlResetLastError();
47193 if (mem_base != xmlMemBlocks()) {
47194 printf("Leak of %d blocks found in xmlXPathEqualValues",
47195 xmlMemBlocks() - mem_base);
47197 printf(" %d", n_ctxt);
47209 test_xmlXPathErr(void) {
47212 #if defined(LIBXML_XPATH_ENABLED)
47214 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47216 int error; /* the error code */
47219 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47220 for (n_error = 0;n_error < gen_nb_int;n_error++) {
47221 mem_base = xmlMemBlocks();
47222 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47223 error = gen_int(n_error, 1);
47225 xmlXPathErr(ctxt, error);
47227 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47228 des_int(n_error, error, 1);
47229 xmlResetLastError();
47230 if (mem_base != xmlMemBlocks()) {
47231 printf("Leak of %d blocks found in xmlXPathErr",
47232 xmlMemBlocks() - mem_base);
47234 printf(" %d", n_ctxt);
47235 printf(" %d", n_error);
47248 test_xmlXPathEvalExpr(void) {
47251 #if defined(LIBXML_XPATH_ENABLED)
47253 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47256 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47257 mem_base = xmlMemBlocks();
47258 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47260 xmlXPathEvalExpr(ctxt);
47262 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47263 xmlResetLastError();
47264 if (mem_base != xmlMemBlocks()) {
47265 printf("Leak of %d blocks found in xmlXPathEvalExpr",
47266 xmlMemBlocks() - mem_base);
47268 printf(" %d", n_ctxt);
47280 test_xmlXPathEvaluatePredicateResult(void) {
47283 #if defined(LIBXML_XPATH_ENABLED)
47286 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47288 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47291 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47292 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47293 mem_base = xmlMemBlocks();
47294 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47295 res = gen_xmlXPathObjectPtr(n_res, 1);
47297 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47298 desret_int(ret_val);
47300 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47301 des_xmlXPathObjectPtr(n_res, res, 1);
47302 xmlResetLastError();
47303 if (mem_base != xmlMemBlocks()) {
47304 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47305 xmlMemBlocks() - mem_base);
47307 printf(" %d", n_ctxt);
47308 printf(" %d", n_res);
47321 test_xmlXPathFalseFunction(void) {
47324 #if defined(LIBXML_XPATH_ENABLED)
47326 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47328 int nargs; /* the number of arguments */
47331 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47332 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47333 mem_base = xmlMemBlocks();
47334 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47335 nargs = gen_int(n_nargs, 1);
47337 xmlXPathFalseFunction(ctxt, nargs);
47339 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47340 des_int(n_nargs, nargs, 1);
47341 xmlResetLastError();
47342 if (mem_base != xmlMemBlocks()) {
47343 printf("Leak of %d blocks found in xmlXPathFalseFunction",
47344 xmlMemBlocks() - mem_base);
47346 printf(" %d", n_ctxt);
47347 printf(" %d", n_nargs);
47360 test_xmlXPathFloorFunction(void) {
47363 #if defined(LIBXML_XPATH_ENABLED)
47365 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47367 int nargs; /* the number of arguments */
47370 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47371 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47372 mem_base = xmlMemBlocks();
47373 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47374 nargs = gen_int(n_nargs, 1);
47376 xmlXPathFloorFunction(ctxt, nargs);
47378 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47379 des_int(n_nargs, nargs, 1);
47380 xmlResetLastError();
47381 if (mem_base != xmlMemBlocks()) {
47382 printf("Leak of %d blocks found in xmlXPathFloorFunction",
47383 xmlMemBlocks() - mem_base);
47385 printf(" %d", n_ctxt);
47386 printf(" %d", n_nargs);
47399 test_xmlXPathFunctionLookup(void) {
47403 /* missing type support */
47409 test_xmlXPathFunctionLookupNS(void) {
47413 /* missing type support */
47419 test_xmlXPathHasSameNodes(void) {
47422 #if defined(LIBXML_XPATH_ENABLED)
47425 xmlNodeSetPtr nodes1; /* a node-set */
47427 xmlNodeSetPtr nodes2; /* a node-set */
47430 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47431 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47432 mem_base = xmlMemBlocks();
47433 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47434 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47436 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47437 desret_int(ret_val);
47439 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47440 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47441 xmlResetLastError();
47442 if (mem_base != xmlMemBlocks()) {
47443 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47444 xmlMemBlocks() - mem_base);
47446 printf(" %d", n_nodes1);
47447 printf(" %d", n_nodes2);
47460 test_xmlXPathIdFunction(void) {
47463 #if defined(LIBXML_XPATH_ENABLED)
47465 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47467 int nargs; /* the number of arguments */
47470 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47471 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47472 mem_base = xmlMemBlocks();
47473 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47474 nargs = gen_int(n_nargs, 1);
47476 xmlXPathIdFunction(ctxt, nargs);
47478 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47479 des_int(n_nargs, nargs, 1);
47480 xmlResetLastError();
47481 if (mem_base != xmlMemBlocks()) {
47482 printf("Leak of %d blocks found in xmlXPathIdFunction",
47483 xmlMemBlocks() - mem_base);
47485 printf(" %d", n_ctxt);
47486 printf(" %d", n_nargs);
47499 test_xmlXPathIntersection(void) {
47502 #if defined(LIBXML_XPATH_ENABLED)
47504 xmlNodeSetPtr ret_val;
47505 xmlNodeSetPtr nodes1; /* a node-set */
47507 xmlNodeSetPtr nodes2; /* a node-set */
47510 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47511 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47512 mem_base = xmlMemBlocks();
47513 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47514 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47516 ret_val = xmlXPathIntersection(nodes1, nodes2);
47517 desret_xmlNodeSetPtr(ret_val);
47519 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47520 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47521 xmlResetLastError();
47522 if (mem_base != xmlMemBlocks()) {
47523 printf("Leak of %d blocks found in xmlXPathIntersection",
47524 xmlMemBlocks() - mem_base);
47526 printf(" %d", n_nodes1);
47527 printf(" %d", n_nodes2);
47540 test_xmlXPathIsNodeType(void) {
47543 #if defined(LIBXML_XPATH_ENABLED)
47546 xmlChar * name; /* a name string */
47549 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47550 mem_base = xmlMemBlocks();
47551 name = gen_const_xmlChar_ptr(n_name, 0);
47553 ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47554 desret_int(ret_val);
47556 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47557 xmlResetLastError();
47558 if (mem_base != xmlMemBlocks()) {
47559 printf("Leak of %d blocks found in xmlXPathIsNodeType",
47560 xmlMemBlocks() - mem_base);
47562 printf(" %d", n_name);
47574 test_xmlXPathLangFunction(void) {
47577 #if defined(LIBXML_XPATH_ENABLED)
47579 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47581 int nargs; /* the number of arguments */
47584 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47585 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47586 mem_base = xmlMemBlocks();
47587 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47588 nargs = gen_int(n_nargs, 1);
47590 xmlXPathLangFunction(ctxt, nargs);
47592 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47593 des_int(n_nargs, nargs, 1);
47594 xmlResetLastError();
47595 if (mem_base != xmlMemBlocks()) {
47596 printf("Leak of %d blocks found in xmlXPathLangFunction",
47597 xmlMemBlocks() - mem_base);
47599 printf(" %d", n_ctxt);
47600 printf(" %d", n_nargs);
47613 test_xmlXPathLastFunction(void) {
47616 #if defined(LIBXML_XPATH_ENABLED)
47618 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47620 int nargs; /* the number of arguments */
47623 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47624 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47625 mem_base = xmlMemBlocks();
47626 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47627 nargs = gen_int(n_nargs, 1);
47629 xmlXPathLastFunction(ctxt, nargs);
47631 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47632 des_int(n_nargs, nargs, 1);
47633 xmlResetLastError();
47634 if (mem_base != xmlMemBlocks()) {
47635 printf("Leak of %d blocks found in xmlXPathLastFunction",
47636 xmlMemBlocks() - mem_base);
47638 printf(" %d", n_ctxt);
47639 printf(" %d", n_nargs);
47652 test_xmlXPathLeading(void) {
47655 #if defined(LIBXML_XPATH_ENABLED)
47657 xmlNodeSetPtr ret_val;
47658 xmlNodeSetPtr nodes1; /* a node-set */
47660 xmlNodeSetPtr nodes2; /* a node-set */
47663 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47664 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47665 mem_base = xmlMemBlocks();
47666 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47667 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47669 ret_val = xmlXPathLeading(nodes1, nodes2);
47670 desret_xmlNodeSetPtr(ret_val);
47672 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47673 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47674 xmlResetLastError();
47675 if (mem_base != xmlMemBlocks()) {
47676 printf("Leak of %d blocks found in xmlXPathLeading",
47677 xmlMemBlocks() - mem_base);
47679 printf(" %d", n_nodes1);
47680 printf(" %d", n_nodes2);
47693 test_xmlXPathLeadingSorted(void) {
47696 #if defined(LIBXML_XPATH_ENABLED)
47698 xmlNodeSetPtr ret_val;
47699 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47701 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47704 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47705 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47706 mem_base = xmlMemBlocks();
47707 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47708 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47710 ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47711 desret_xmlNodeSetPtr(ret_val);
47713 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47714 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47715 xmlResetLastError();
47716 if (mem_base != xmlMemBlocks()) {
47717 printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47718 xmlMemBlocks() - mem_base);
47720 printf(" %d", n_nodes1);
47721 printf(" %d", n_nodes2);
47734 test_xmlXPathLocalNameFunction(void) {
47737 #if defined(LIBXML_XPATH_ENABLED)
47739 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47741 int nargs; /* the number of arguments */
47744 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47745 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47746 mem_base = xmlMemBlocks();
47747 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47748 nargs = gen_int(n_nargs, 1);
47750 xmlXPathLocalNameFunction(ctxt, nargs);
47752 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47753 des_int(n_nargs, nargs, 1);
47754 xmlResetLastError();
47755 if (mem_base != xmlMemBlocks()) {
47756 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47757 xmlMemBlocks() - mem_base);
47759 printf(" %d", n_ctxt);
47760 printf(" %d", n_nargs);
47773 test_xmlXPathModValues(void) {
47776 #if defined(LIBXML_XPATH_ENABLED)
47778 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47781 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47782 mem_base = xmlMemBlocks();
47783 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47785 xmlXPathModValues(ctxt);
47787 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47788 xmlResetLastError();
47789 if (mem_base != xmlMemBlocks()) {
47790 printf("Leak of %d blocks found in xmlXPathModValues",
47791 xmlMemBlocks() - mem_base);
47793 printf(" %d", n_ctxt);
47805 test_xmlXPathMultValues(void) {
47808 #if defined(LIBXML_XPATH_ENABLED)
47810 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47813 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47814 mem_base = xmlMemBlocks();
47815 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47817 xmlXPathMultValues(ctxt);
47819 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47820 xmlResetLastError();
47821 if (mem_base != xmlMemBlocks()) {
47822 printf("Leak of %d blocks found in xmlXPathMultValues",
47823 xmlMemBlocks() - mem_base);
47825 printf(" %d", n_ctxt);
47837 test_xmlXPathNamespaceURIFunction(void) {
47840 #if defined(LIBXML_XPATH_ENABLED)
47842 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47844 int nargs; /* the number of arguments */
47847 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47848 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47849 mem_base = xmlMemBlocks();
47850 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47851 nargs = gen_int(n_nargs, 1);
47853 xmlXPathNamespaceURIFunction(ctxt, nargs);
47855 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47856 des_int(n_nargs, nargs, 1);
47857 xmlResetLastError();
47858 if (mem_base != xmlMemBlocks()) {
47859 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47860 xmlMemBlocks() - mem_base);
47862 printf(" %d", n_ctxt);
47863 printf(" %d", n_nargs);
47876 test_xmlXPathNewBoolean(void) {
47879 #if defined(LIBXML_XPATH_ENABLED)
47881 xmlXPathObjectPtr ret_val;
47882 int val; /* the boolean value */
47885 for (n_val = 0;n_val < gen_nb_int;n_val++) {
47886 mem_base = xmlMemBlocks();
47887 val = gen_int(n_val, 0);
47889 ret_val = xmlXPathNewBoolean(val);
47890 desret_xmlXPathObjectPtr(ret_val);
47892 des_int(n_val, val, 0);
47893 xmlResetLastError();
47894 if (mem_base != xmlMemBlocks()) {
47895 printf("Leak of %d blocks found in xmlXPathNewBoolean",
47896 xmlMemBlocks() - mem_base);
47898 printf(" %d", n_val);
47910 test_xmlXPathNewCString(void) {
47913 #if defined(LIBXML_XPATH_ENABLED)
47915 xmlXPathObjectPtr ret_val;
47916 char * val; /* the char * value */
47919 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47920 mem_base = xmlMemBlocks();
47921 val = gen_const_char_ptr(n_val, 0);
47923 ret_val = xmlXPathNewCString((const char *)val);
47924 desret_xmlXPathObjectPtr(ret_val);
47926 des_const_char_ptr(n_val, (const char *)val, 0);
47927 xmlResetLastError();
47928 if (mem_base != xmlMemBlocks()) {
47929 printf("Leak of %d blocks found in xmlXPathNewCString",
47930 xmlMemBlocks() - mem_base);
47932 printf(" %d", n_val);
47944 test_xmlXPathNewFloat(void) {
47947 #if defined(LIBXML_XPATH_ENABLED)
47949 xmlXPathObjectPtr ret_val;
47950 double val; /* the double value */
47953 for (n_val = 0;n_val < gen_nb_double;n_val++) {
47954 mem_base = xmlMemBlocks();
47955 val = gen_double(n_val, 0);
47957 ret_val = xmlXPathNewFloat(val);
47958 desret_xmlXPathObjectPtr(ret_val);
47960 des_double(n_val, val, 0);
47961 xmlResetLastError();
47962 if (mem_base != xmlMemBlocks()) {
47963 printf("Leak of %d blocks found in xmlXPathNewFloat",
47964 xmlMemBlocks() - mem_base);
47966 printf(" %d", n_val);
47978 test_xmlXPathNewNodeSet(void) {
47981 #if defined(LIBXML_XPATH_ENABLED)
47983 xmlXPathObjectPtr ret_val;
47984 xmlNodePtr val; /* the NodePtr value */
47987 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47988 mem_base = xmlMemBlocks();
47989 val = gen_xmlNodePtr(n_val, 0);
47991 ret_val = xmlXPathNewNodeSet(val);
47992 desret_xmlXPathObjectPtr(ret_val);
47994 des_xmlNodePtr(n_val, val, 0);
47995 xmlResetLastError();
47996 if (mem_base != xmlMemBlocks()) {
47997 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47998 xmlMemBlocks() - mem_base);
48000 printf(" %d", n_val);
48012 test_xmlXPathNewNodeSetList(void) {
48015 #if defined(LIBXML_XPATH_ENABLED)
48017 xmlXPathObjectPtr ret_val;
48018 xmlNodeSetPtr val; /* an existing NodeSet */
48021 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48022 mem_base = xmlMemBlocks();
48023 val = gen_xmlNodeSetPtr(n_val, 0);
48025 ret_val = xmlXPathNewNodeSetList(val);
48026 desret_xmlXPathObjectPtr(ret_val);
48028 des_xmlNodeSetPtr(n_val, val, 0);
48029 xmlResetLastError();
48030 if (mem_base != xmlMemBlocks()) {
48031 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48032 xmlMemBlocks() - mem_base);
48034 printf(" %d", n_val);
48046 test_xmlXPathNewParserContext(void) {
48050 /* missing type support */
48056 test_xmlXPathNewString(void) {
48059 #if defined(LIBXML_XPATH_ENABLED)
48061 xmlXPathObjectPtr ret_val;
48062 xmlChar * val; /* the xmlChar * value */
48065 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48066 mem_base = xmlMemBlocks();
48067 val = gen_const_xmlChar_ptr(n_val, 0);
48069 ret_val = xmlXPathNewString((const xmlChar *)val);
48070 desret_xmlXPathObjectPtr(ret_val);
48072 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48073 xmlResetLastError();
48074 if (mem_base != xmlMemBlocks()) {
48075 printf("Leak of %d blocks found in xmlXPathNewString",
48076 xmlMemBlocks() - mem_base);
48078 printf(" %d", n_val);
48090 test_xmlXPathNextAncestor(void) {
48093 #if defined(LIBXML_XPATH_ENABLED)
48095 xmlNodePtr ret_val;
48096 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48098 xmlNodePtr cur; /* the current node in the traversal */
48101 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48102 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48103 mem_base = xmlMemBlocks();
48104 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48105 cur = gen_xmlNodePtr(n_cur, 1);
48107 ret_val = xmlXPathNextAncestor(ctxt, cur);
48108 desret_xmlNodePtr(ret_val);
48110 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48111 des_xmlNodePtr(n_cur, cur, 1);
48112 xmlResetLastError();
48113 if (mem_base != xmlMemBlocks()) {
48114 printf("Leak of %d blocks found in xmlXPathNextAncestor",
48115 xmlMemBlocks() - mem_base);
48117 printf(" %d", n_ctxt);
48118 printf(" %d", n_cur);
48131 test_xmlXPathNextAncestorOrSelf(void) {
48134 #if defined(LIBXML_XPATH_ENABLED)
48136 xmlNodePtr ret_val;
48137 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48139 xmlNodePtr cur; /* the current node in the traversal */
48142 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48143 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48144 mem_base = xmlMemBlocks();
48145 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48146 cur = gen_xmlNodePtr(n_cur, 1);
48148 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48149 desret_xmlNodePtr(ret_val);
48151 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48152 des_xmlNodePtr(n_cur, cur, 1);
48153 xmlResetLastError();
48154 if (mem_base != xmlMemBlocks()) {
48155 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48156 xmlMemBlocks() - mem_base);
48158 printf(" %d", n_ctxt);
48159 printf(" %d", n_cur);
48172 test_xmlXPathNextAttribute(void) {
48175 #if defined(LIBXML_XPATH_ENABLED)
48177 xmlNodePtr ret_val;
48178 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48180 xmlNodePtr cur; /* the current attribute in the traversal */
48183 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48184 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48185 mem_base = xmlMemBlocks();
48186 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48187 cur = gen_xmlNodePtr(n_cur, 1);
48189 ret_val = xmlXPathNextAttribute(ctxt, cur);
48190 desret_xmlNodePtr(ret_val);
48192 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48193 des_xmlNodePtr(n_cur, cur, 1);
48194 xmlResetLastError();
48195 if (mem_base != xmlMemBlocks()) {
48196 printf("Leak of %d blocks found in xmlXPathNextAttribute",
48197 xmlMemBlocks() - mem_base);
48199 printf(" %d", n_ctxt);
48200 printf(" %d", n_cur);
48213 test_xmlXPathNextChild(void) {
48216 #if defined(LIBXML_XPATH_ENABLED)
48218 xmlNodePtr ret_val;
48219 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48221 xmlNodePtr cur; /* the current node in the traversal */
48224 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48225 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48226 mem_base = xmlMemBlocks();
48227 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48228 cur = gen_xmlNodePtr(n_cur, 1);
48230 ret_val = xmlXPathNextChild(ctxt, cur);
48231 desret_xmlNodePtr(ret_val);
48233 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48234 des_xmlNodePtr(n_cur, cur, 1);
48235 xmlResetLastError();
48236 if (mem_base != xmlMemBlocks()) {
48237 printf("Leak of %d blocks found in xmlXPathNextChild",
48238 xmlMemBlocks() - mem_base);
48240 printf(" %d", n_ctxt);
48241 printf(" %d", n_cur);
48254 test_xmlXPathNextDescendant(void) {
48257 #if defined(LIBXML_XPATH_ENABLED)
48259 xmlNodePtr ret_val;
48260 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48262 xmlNodePtr cur; /* the current node in the traversal */
48265 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48266 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48267 mem_base = xmlMemBlocks();
48268 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48269 cur = gen_xmlNodePtr(n_cur, 1);
48271 ret_val = xmlXPathNextDescendant(ctxt, cur);
48272 desret_xmlNodePtr(ret_val);
48274 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48275 des_xmlNodePtr(n_cur, cur, 1);
48276 xmlResetLastError();
48277 if (mem_base != xmlMemBlocks()) {
48278 printf("Leak of %d blocks found in xmlXPathNextDescendant",
48279 xmlMemBlocks() - mem_base);
48281 printf(" %d", n_ctxt);
48282 printf(" %d", n_cur);
48295 test_xmlXPathNextDescendantOrSelf(void) {
48298 #if defined(LIBXML_XPATH_ENABLED)
48300 xmlNodePtr ret_val;
48301 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48303 xmlNodePtr cur; /* the current node in the traversal */
48306 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48307 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48308 mem_base = xmlMemBlocks();
48309 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48310 cur = gen_xmlNodePtr(n_cur, 1);
48312 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48313 desret_xmlNodePtr(ret_val);
48315 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48316 des_xmlNodePtr(n_cur, cur, 1);
48317 xmlResetLastError();
48318 if (mem_base != xmlMemBlocks()) {
48319 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48320 xmlMemBlocks() - mem_base);
48322 printf(" %d", n_ctxt);
48323 printf(" %d", n_cur);
48336 test_xmlXPathNextFollowing(void) {
48339 #if defined(LIBXML_XPATH_ENABLED)
48341 xmlNodePtr ret_val;
48342 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48344 xmlNodePtr cur; /* the current node in the traversal */
48347 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48348 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48349 mem_base = xmlMemBlocks();
48350 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48351 cur = gen_xmlNodePtr(n_cur, 1);
48353 ret_val = xmlXPathNextFollowing(ctxt, cur);
48354 desret_xmlNodePtr(ret_val);
48356 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48357 des_xmlNodePtr(n_cur, cur, 1);
48358 xmlResetLastError();
48359 if (mem_base != xmlMemBlocks()) {
48360 printf("Leak of %d blocks found in xmlXPathNextFollowing",
48361 xmlMemBlocks() - mem_base);
48363 printf(" %d", n_ctxt);
48364 printf(" %d", n_cur);
48377 test_xmlXPathNextFollowingSibling(void) {
48380 #if defined(LIBXML_XPATH_ENABLED)
48382 xmlNodePtr ret_val;
48383 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48385 xmlNodePtr cur; /* the current node in the traversal */
48388 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48389 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48390 mem_base = xmlMemBlocks();
48391 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48392 cur = gen_xmlNodePtr(n_cur, 1);
48394 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48395 desret_xmlNodePtr(ret_val);
48397 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48398 des_xmlNodePtr(n_cur, cur, 1);
48399 xmlResetLastError();
48400 if (mem_base != xmlMemBlocks()) {
48401 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48402 xmlMemBlocks() - mem_base);
48404 printf(" %d", n_ctxt);
48405 printf(" %d", n_cur);
48418 test_xmlXPathNextNamespace(void) {
48421 #if defined(LIBXML_XPATH_ENABLED)
48423 xmlNodePtr ret_val;
48424 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48426 xmlNodePtr cur; /* the current attribute in the traversal */
48429 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48430 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48431 mem_base = xmlMemBlocks();
48432 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48433 cur = gen_xmlNodePtr(n_cur, 1);
48435 ret_val = xmlXPathNextNamespace(ctxt, cur);
48436 desret_xmlNodePtr(ret_val);
48438 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48439 des_xmlNodePtr(n_cur, cur, 1);
48440 xmlResetLastError();
48441 if (mem_base != xmlMemBlocks()) {
48442 printf("Leak of %d blocks found in xmlXPathNextNamespace",
48443 xmlMemBlocks() - mem_base);
48445 printf(" %d", n_ctxt);
48446 printf(" %d", n_cur);
48459 test_xmlXPathNextParent(void) {
48462 #if defined(LIBXML_XPATH_ENABLED)
48464 xmlNodePtr ret_val;
48465 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48467 xmlNodePtr cur; /* the current node in the traversal */
48470 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48471 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48472 mem_base = xmlMemBlocks();
48473 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48474 cur = gen_xmlNodePtr(n_cur, 1);
48476 ret_val = xmlXPathNextParent(ctxt, cur);
48477 desret_xmlNodePtr(ret_val);
48479 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48480 des_xmlNodePtr(n_cur, cur, 1);
48481 xmlResetLastError();
48482 if (mem_base != xmlMemBlocks()) {
48483 printf("Leak of %d blocks found in xmlXPathNextParent",
48484 xmlMemBlocks() - mem_base);
48486 printf(" %d", n_ctxt);
48487 printf(" %d", n_cur);
48500 test_xmlXPathNextPreceding(void) {
48503 #if defined(LIBXML_XPATH_ENABLED)
48505 xmlNodePtr ret_val;
48506 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48508 xmlNodePtr cur; /* the current node in the traversal */
48511 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48512 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48513 mem_base = xmlMemBlocks();
48514 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48515 cur = gen_xmlNodePtr(n_cur, 1);
48517 ret_val = xmlXPathNextPreceding(ctxt, cur);
48518 desret_xmlNodePtr(ret_val);
48520 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48521 des_xmlNodePtr(n_cur, cur, 1);
48522 xmlResetLastError();
48523 if (mem_base != xmlMemBlocks()) {
48524 printf("Leak of %d blocks found in xmlXPathNextPreceding",
48525 xmlMemBlocks() - mem_base);
48527 printf(" %d", n_ctxt);
48528 printf(" %d", n_cur);
48541 test_xmlXPathNextPrecedingSibling(void) {
48544 #if defined(LIBXML_XPATH_ENABLED)
48546 xmlNodePtr ret_val;
48547 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48549 xmlNodePtr cur; /* the current node in the traversal */
48552 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48553 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48554 mem_base = xmlMemBlocks();
48555 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48556 cur = gen_xmlNodePtr(n_cur, 1);
48558 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48559 desret_xmlNodePtr(ret_val);
48561 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48562 des_xmlNodePtr(n_cur, cur, 1);
48563 xmlResetLastError();
48564 if (mem_base != xmlMemBlocks()) {
48565 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48566 xmlMemBlocks() - mem_base);
48568 printf(" %d", n_ctxt);
48569 printf(" %d", n_cur);
48582 test_xmlXPathNextSelf(void) {
48585 #if defined(LIBXML_XPATH_ENABLED)
48587 xmlNodePtr ret_val;
48588 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48590 xmlNodePtr cur; /* the current node in the traversal */
48593 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48594 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48595 mem_base = xmlMemBlocks();
48596 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48597 cur = gen_xmlNodePtr(n_cur, 1);
48599 ret_val = xmlXPathNextSelf(ctxt, cur);
48600 desret_xmlNodePtr(ret_val);
48602 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48603 des_xmlNodePtr(n_cur, cur, 1);
48604 xmlResetLastError();
48605 if (mem_base != xmlMemBlocks()) {
48606 printf("Leak of %d blocks found in xmlXPathNextSelf",
48607 xmlMemBlocks() - mem_base);
48609 printf(" %d", n_ctxt);
48610 printf(" %d", n_cur);
48623 test_xmlXPathNodeLeading(void) {
48626 #if defined(LIBXML_XPATH_ENABLED)
48628 xmlNodeSetPtr ret_val;
48629 xmlNodeSetPtr nodes; /* a node-set */
48631 xmlNodePtr node; /* a node */
48634 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48635 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48636 mem_base = xmlMemBlocks();
48637 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48638 node = gen_xmlNodePtr(n_node, 1);
48640 ret_val = xmlXPathNodeLeading(nodes, node);
48641 desret_xmlNodeSetPtr(ret_val);
48643 des_xmlNodeSetPtr(n_nodes, nodes, 0);
48644 des_xmlNodePtr(n_node, node, 1);
48645 xmlResetLastError();
48646 if (mem_base != xmlMemBlocks()) {
48647 printf("Leak of %d blocks found in xmlXPathNodeLeading",
48648 xmlMemBlocks() - mem_base);
48650 printf(" %d", n_nodes);
48651 printf(" %d", n_node);
48664 test_xmlXPathNodeLeadingSorted(void) {
48667 #if defined(LIBXML_XPATH_ENABLED)
48669 xmlNodeSetPtr ret_val;
48670 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48672 xmlNodePtr node; /* a node */
48675 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48676 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48677 mem_base = xmlMemBlocks();
48678 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48679 node = gen_xmlNodePtr(n_node, 1);
48681 ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48682 desret_xmlNodeSetPtr(ret_val);
48684 des_xmlNodeSetPtr(n_nodes, nodes, 0);
48685 des_xmlNodePtr(n_node, node, 1);
48686 xmlResetLastError();
48687 if (mem_base != xmlMemBlocks()) {
48688 printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48689 xmlMemBlocks() - mem_base);
48691 printf(" %d", n_nodes);
48692 printf(" %d", n_node);
48705 test_xmlXPathNodeSetAdd(void) {
48708 #if defined(LIBXML_XPATH_ENABLED)
48710 xmlNodeSetPtr cur; /* the initial node set */
48712 xmlNodePtr val; /* a new xmlNodePtr */
48715 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48716 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48717 mem_base = xmlMemBlocks();
48718 cur = gen_xmlNodeSetPtr(n_cur, 0);
48719 val = gen_xmlNodePtr(n_val, 1);
48721 xmlXPathNodeSetAdd(cur, val);
48723 des_xmlNodeSetPtr(n_cur, cur, 0);
48724 des_xmlNodePtr(n_val, val, 1);
48725 xmlResetLastError();
48726 if (mem_base != xmlMemBlocks()) {
48727 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48728 xmlMemBlocks() - mem_base);
48730 printf(" %d", n_cur);
48731 printf(" %d", n_val);
48744 test_xmlXPathNodeSetAddNs(void) {
48747 #if defined(LIBXML_XPATH_ENABLED)
48749 xmlNodeSetPtr cur; /* the initial node set */
48751 xmlNodePtr node; /* the hosting node */
48753 xmlNsPtr ns; /* a the namespace node */
48756 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48757 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48758 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48759 mem_base = xmlMemBlocks();
48760 cur = gen_xmlNodeSetPtr(n_cur, 0);
48761 node = gen_xmlNodePtr(n_node, 1);
48762 ns = gen_xmlNsPtr(n_ns, 2);
48764 xmlXPathNodeSetAddNs(cur, node, ns);
48766 des_xmlNodeSetPtr(n_cur, cur, 0);
48767 des_xmlNodePtr(n_node, node, 1);
48768 des_xmlNsPtr(n_ns, ns, 2);
48769 xmlResetLastError();
48770 if (mem_base != xmlMemBlocks()) {
48771 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48772 xmlMemBlocks() - mem_base);
48774 printf(" %d", n_cur);
48775 printf(" %d", n_node);
48776 printf(" %d", n_ns);
48790 test_xmlXPathNodeSetAddUnique(void) {
48793 #if defined(LIBXML_XPATH_ENABLED)
48795 xmlNodeSetPtr cur; /* the initial node set */
48797 xmlNodePtr val; /* a new xmlNodePtr */
48800 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48801 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48802 mem_base = xmlMemBlocks();
48803 cur = gen_xmlNodeSetPtr(n_cur, 0);
48804 val = gen_xmlNodePtr(n_val, 1);
48806 xmlXPathNodeSetAddUnique(cur, val);
48808 des_xmlNodeSetPtr(n_cur, cur, 0);
48809 des_xmlNodePtr(n_val, val, 1);
48810 xmlResetLastError();
48811 if (mem_base != xmlMemBlocks()) {
48812 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48813 xmlMemBlocks() - mem_base);
48815 printf(" %d", n_cur);
48816 printf(" %d", n_val);
48829 test_xmlXPathNodeSetContains(void) {
48832 #if defined(LIBXML_XPATH_ENABLED)
48835 xmlNodeSetPtr cur; /* the node-set */
48837 xmlNodePtr val; /* the node */
48840 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48841 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48842 mem_base = xmlMemBlocks();
48843 cur = gen_xmlNodeSetPtr(n_cur, 0);
48844 val = gen_xmlNodePtr(n_val, 1);
48846 ret_val = xmlXPathNodeSetContains(cur, val);
48847 desret_int(ret_val);
48849 des_xmlNodeSetPtr(n_cur, cur, 0);
48850 des_xmlNodePtr(n_val, val, 1);
48851 xmlResetLastError();
48852 if (mem_base != xmlMemBlocks()) {
48853 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48854 xmlMemBlocks() - mem_base);
48856 printf(" %d", n_cur);
48857 printf(" %d", n_val);
48870 test_xmlXPathNodeSetDel(void) {
48873 #if defined(LIBXML_XPATH_ENABLED)
48875 xmlNodeSetPtr cur; /* the initial node set */
48877 xmlNodePtr val; /* an xmlNodePtr */
48880 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48881 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48882 mem_base = xmlMemBlocks();
48883 cur = gen_xmlNodeSetPtr(n_cur, 0);
48884 val = gen_xmlNodePtr(n_val, 1);
48886 xmlXPathNodeSetDel(cur, val);
48888 des_xmlNodeSetPtr(n_cur, cur, 0);
48889 des_xmlNodePtr(n_val, val, 1);
48890 xmlResetLastError();
48891 if (mem_base != xmlMemBlocks()) {
48892 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48893 xmlMemBlocks() - mem_base);
48895 printf(" %d", n_cur);
48896 printf(" %d", n_val);
48909 test_xmlXPathNodeSetMerge(void) {
48912 #if defined(LIBXML_XPATH_ENABLED)
48914 xmlNodeSetPtr ret_val;
48915 xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48917 xmlNodeSetPtr val2; /* the second NodeSet */
48920 for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48921 for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48922 mem_base = xmlMemBlocks();
48923 val1 = gen_xmlNodeSetPtr(n_val1, 0);
48924 val2 = gen_xmlNodeSetPtr(n_val2, 1);
48926 ret_val = xmlXPathNodeSetMerge(val1, val2);
48927 desret_xmlNodeSetPtr(ret_val);
48929 des_xmlNodeSetPtr(n_val1, val1, 0);
48930 des_xmlNodeSetPtr(n_val2, val2, 1);
48931 xmlResetLastError();
48932 if (mem_base != xmlMemBlocks()) {
48933 printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48934 xmlMemBlocks() - mem_base);
48936 printf(" %d", n_val1);
48937 printf(" %d", n_val2);
48950 test_xmlXPathNodeSetRemove(void) {
48953 #if defined(LIBXML_XPATH_ENABLED)
48955 xmlNodeSetPtr cur; /* the initial node set */
48957 int val; /* the index to remove */
48960 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48961 for (n_val = 0;n_val < gen_nb_int;n_val++) {
48962 mem_base = xmlMemBlocks();
48963 cur = gen_xmlNodeSetPtr(n_cur, 0);
48964 val = gen_int(n_val, 1);
48966 xmlXPathNodeSetRemove(cur, val);
48968 des_xmlNodeSetPtr(n_cur, cur, 0);
48969 des_int(n_val, val, 1);
48970 xmlResetLastError();
48971 if (mem_base != xmlMemBlocks()) {
48972 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48973 xmlMemBlocks() - mem_base);
48975 printf(" %d", n_cur);
48976 printf(" %d", n_val);
48989 test_xmlXPathNodeSetSort(void) {
48992 #if defined(LIBXML_XPATH_ENABLED)
48994 xmlNodeSetPtr set; /* the node set */
48997 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48998 mem_base = xmlMemBlocks();
48999 set = gen_xmlNodeSetPtr(n_set, 0);
49001 xmlXPathNodeSetSort(set);
49003 des_xmlNodeSetPtr(n_set, set, 0);
49004 xmlResetLastError();
49005 if (mem_base != xmlMemBlocks()) {
49006 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49007 xmlMemBlocks() - mem_base);
49009 printf(" %d", n_set);
49021 test_xmlXPathNodeTrailing(void) {
49024 #if defined(LIBXML_XPATH_ENABLED)
49026 xmlNodeSetPtr ret_val;
49027 xmlNodeSetPtr nodes; /* a node-set */
49029 xmlNodePtr node; /* a node */
49032 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49033 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49034 mem_base = xmlMemBlocks();
49035 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49036 node = gen_xmlNodePtr(n_node, 1);
49038 ret_val = xmlXPathNodeTrailing(nodes, node);
49039 desret_xmlNodeSetPtr(ret_val);
49041 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49042 des_xmlNodePtr(n_node, node, 1);
49043 xmlResetLastError();
49044 if (mem_base != xmlMemBlocks()) {
49045 printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49046 xmlMemBlocks() - mem_base);
49048 printf(" %d", n_nodes);
49049 printf(" %d", n_node);
49062 test_xmlXPathNodeTrailingSorted(void) {
49065 #if defined(LIBXML_XPATH_ENABLED)
49067 xmlNodeSetPtr ret_val;
49068 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49070 xmlNodePtr node; /* a node */
49073 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49074 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49075 mem_base = xmlMemBlocks();
49076 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49077 node = gen_xmlNodePtr(n_node, 1);
49079 ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49080 desret_xmlNodeSetPtr(ret_val);
49082 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49083 des_xmlNodePtr(n_node, node, 1);
49084 xmlResetLastError();
49085 if (mem_base != xmlMemBlocks()) {
49086 printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49087 xmlMemBlocks() - mem_base);
49089 printf(" %d", n_nodes);
49090 printf(" %d", n_node);
49103 test_xmlXPathNormalizeFunction(void) {
49106 #if defined(LIBXML_XPATH_ENABLED)
49108 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49110 int nargs; /* the number of arguments */
49113 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49114 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49115 mem_base = xmlMemBlocks();
49116 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49117 nargs = gen_int(n_nargs, 1);
49119 xmlXPathNormalizeFunction(ctxt, nargs);
49121 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49122 des_int(n_nargs, nargs, 1);
49123 xmlResetLastError();
49124 if (mem_base != xmlMemBlocks()) {
49125 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49126 xmlMemBlocks() - mem_base);
49128 printf(" %d", n_ctxt);
49129 printf(" %d", n_nargs);
49142 test_xmlXPathNotEqualValues(void) {
49145 #if defined(LIBXML_XPATH_ENABLED)
49148 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49151 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49152 mem_base = xmlMemBlocks();
49153 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49155 ret_val = xmlXPathNotEqualValues(ctxt);
49156 desret_int(ret_val);
49158 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49159 xmlResetLastError();
49160 if (mem_base != xmlMemBlocks()) {
49161 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49162 xmlMemBlocks() - mem_base);
49164 printf(" %d", n_ctxt);
49176 test_xmlXPathNotFunction(void) {
49179 #if defined(LIBXML_XPATH_ENABLED)
49181 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49183 int nargs; /* the number of arguments */
49186 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49187 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49188 mem_base = xmlMemBlocks();
49189 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49190 nargs = gen_int(n_nargs, 1);
49192 xmlXPathNotFunction(ctxt, nargs);
49194 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49195 des_int(n_nargs, nargs, 1);
49196 xmlResetLastError();
49197 if (mem_base != xmlMemBlocks()) {
49198 printf("Leak of %d blocks found in xmlXPathNotFunction",
49199 xmlMemBlocks() - mem_base);
49201 printf(" %d", n_ctxt);
49202 printf(" %d", n_nargs);
49215 test_xmlXPathNsLookup(void) {
49218 #if defined(LIBXML_XPATH_ENABLED)
49220 const xmlChar * ret_val;
49221 xmlXPathContextPtr ctxt; /* the XPath context */
49223 xmlChar * prefix; /* the namespace prefix value */
49226 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49227 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49228 mem_base = xmlMemBlocks();
49229 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49230 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49232 ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49233 desret_const_xmlChar_ptr(ret_val);
49235 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49236 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49237 xmlResetLastError();
49238 if (mem_base != xmlMemBlocks()) {
49239 printf("Leak of %d blocks found in xmlXPathNsLookup",
49240 xmlMemBlocks() - mem_base);
49242 printf(" %d", n_ctxt);
49243 printf(" %d", n_prefix);
49256 test_xmlXPathNumberFunction(void) {
49259 #if defined(LIBXML_XPATH_ENABLED)
49261 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49263 int nargs; /* the number of arguments */
49266 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49267 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49268 mem_base = xmlMemBlocks();
49269 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49270 nargs = gen_int(n_nargs, 1);
49272 xmlXPathNumberFunction(ctxt, nargs);
49274 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49275 des_int(n_nargs, nargs, 1);
49276 xmlResetLastError();
49277 if (mem_base != xmlMemBlocks()) {
49278 printf("Leak of %d blocks found in xmlXPathNumberFunction",
49279 xmlMemBlocks() - mem_base);
49281 printf(" %d", n_ctxt);
49282 printf(" %d", n_nargs);
49295 test_xmlXPathParseNCName(void) {
49298 #if defined(LIBXML_XPATH_ENABLED)
49301 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49304 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49305 mem_base = xmlMemBlocks();
49306 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49308 ret_val = xmlXPathParseNCName(ctxt);
49309 desret_xmlChar_ptr(ret_val);
49311 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49312 xmlResetLastError();
49313 if (mem_base != xmlMemBlocks()) {
49314 printf("Leak of %d blocks found in xmlXPathParseNCName",
49315 xmlMemBlocks() - mem_base);
49317 printf(" %d", n_ctxt);
49329 test_xmlXPathParseName(void) {
49332 #if defined(LIBXML_XPATH_ENABLED)
49335 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49338 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49339 mem_base = xmlMemBlocks();
49340 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49342 ret_val = xmlXPathParseName(ctxt);
49343 desret_xmlChar_ptr(ret_val);
49345 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49346 xmlResetLastError();
49347 if (mem_base != xmlMemBlocks()) {
49348 printf("Leak of %d blocks found in xmlXPathParseName",
49349 xmlMemBlocks() - mem_base);
49351 printf(" %d", n_ctxt);
49363 test_xmlXPathPopBoolean(void) {
49366 #if defined(LIBXML_XPATH_ENABLED)
49369 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49372 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49373 mem_base = xmlMemBlocks();
49374 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49376 ret_val = xmlXPathPopBoolean(ctxt);
49377 desret_int(ret_val);
49379 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49380 xmlResetLastError();
49381 if (mem_base != xmlMemBlocks()) {
49382 printf("Leak of %d blocks found in xmlXPathPopBoolean",
49383 xmlMemBlocks() - mem_base);
49385 printf(" %d", n_ctxt);
49397 test_xmlXPathPopExternal(void) {
49400 #if defined(LIBXML_XPATH_ENABLED)
49403 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49406 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49407 mem_base = xmlMemBlocks();
49408 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49410 ret_val = xmlXPathPopExternal(ctxt);
49411 desret_void_ptr(ret_val);
49413 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49414 xmlResetLastError();
49415 if (mem_base != xmlMemBlocks()) {
49416 printf("Leak of %d blocks found in xmlXPathPopExternal",
49417 xmlMemBlocks() - mem_base);
49419 printf(" %d", n_ctxt);
49431 test_xmlXPathPopNodeSet(void) {
49434 #if defined(LIBXML_XPATH_ENABLED)
49436 xmlNodeSetPtr ret_val;
49437 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49440 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49441 mem_base = xmlMemBlocks();
49442 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49444 ret_val = xmlXPathPopNodeSet(ctxt);
49445 desret_xmlNodeSetPtr(ret_val);
49447 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49448 xmlResetLastError();
49449 if (mem_base != xmlMemBlocks()) {
49450 printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49451 xmlMemBlocks() - mem_base);
49453 printf(" %d", n_ctxt);
49465 test_xmlXPathPopNumber(void) {
49468 #if defined(LIBXML_XPATH_ENABLED)
49471 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49474 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49475 mem_base = xmlMemBlocks();
49476 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49478 ret_val = xmlXPathPopNumber(ctxt);
49479 desret_double(ret_val);
49481 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49482 xmlResetLastError();
49483 if (mem_base != xmlMemBlocks()) {
49484 printf("Leak of %d blocks found in xmlXPathPopNumber",
49485 xmlMemBlocks() - mem_base);
49487 printf(" %d", n_ctxt);
49499 test_xmlXPathPopString(void) {
49502 #if defined(LIBXML_XPATH_ENABLED)
49505 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49508 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49509 mem_base = xmlMemBlocks();
49510 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49512 ret_val = xmlXPathPopString(ctxt);
49513 desret_xmlChar_ptr(ret_val);
49515 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49516 xmlResetLastError();
49517 if (mem_base != xmlMemBlocks()) {
49518 printf("Leak of %d blocks found in xmlXPathPopString",
49519 xmlMemBlocks() - mem_base);
49521 printf(" %d", n_ctxt);
49533 test_xmlXPathPositionFunction(void) {
49536 #if defined(LIBXML_XPATH_ENABLED)
49538 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49540 int nargs; /* the number of arguments */
49543 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49544 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49545 mem_base = xmlMemBlocks();
49546 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49547 nargs = gen_int(n_nargs, 1);
49549 xmlXPathPositionFunction(ctxt, nargs);
49551 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49552 des_int(n_nargs, nargs, 1);
49553 xmlResetLastError();
49554 if (mem_base != xmlMemBlocks()) {
49555 printf("Leak of %d blocks found in xmlXPathPositionFunction",
49556 xmlMemBlocks() - mem_base);
49558 printf(" %d", n_ctxt);
49559 printf(" %d", n_nargs);
49572 test_xmlXPathRegisterAllFunctions(void) {
49575 #if defined(LIBXML_XPATH_ENABLED)
49577 xmlXPathContextPtr ctxt; /* the XPath context */
49580 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49581 mem_base = xmlMemBlocks();
49582 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49584 xmlXPathRegisterAllFunctions(ctxt);
49586 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49587 xmlResetLastError();
49588 if (mem_base != xmlMemBlocks()) {
49589 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49590 xmlMemBlocks() - mem_base);
49592 printf(" %d", n_ctxt);
49604 test_xmlXPathRegisterFunc(void) {
49608 /* missing type support */
49614 test_xmlXPathRegisterFuncLookup(void) {
49618 /* missing type support */
49624 test_xmlXPathRegisterFuncNS(void) {
49628 /* missing type support */
49634 test_xmlXPathRegisterNs(void) {
49637 #if defined(LIBXML_XPATH_ENABLED)
49640 xmlXPathContextPtr ctxt; /* the XPath context */
49642 xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49644 xmlChar * ns_uri; /* the namespace name */
49647 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49648 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49649 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49650 mem_base = xmlMemBlocks();
49651 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49652 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49653 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49655 ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49656 desret_int(ret_val);
49658 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49659 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49660 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49661 xmlResetLastError();
49662 if (mem_base != xmlMemBlocks()) {
49663 printf("Leak of %d blocks found in xmlXPathRegisterNs",
49664 xmlMemBlocks() - mem_base);
49666 printf(" %d", n_ctxt);
49667 printf(" %d", n_prefix);
49668 printf(" %d", n_ns_uri);
49682 test_xmlXPathRegisterVariable(void) {
49685 #if defined(LIBXML_XPATH_ENABLED)
49688 xmlXPathContextPtr ctxt; /* the XPath context */
49690 xmlChar * name; /* the variable name */
49692 xmlXPathObjectPtr value; /* the variable value or NULL */
49695 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49696 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49697 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49698 mem_base = xmlMemBlocks();
49699 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49700 name = gen_const_xmlChar_ptr(n_name, 1);
49701 value = gen_xmlXPathObjectPtr(n_value, 2);
49703 ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49704 desret_int(ret_val);
49706 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49707 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49708 des_xmlXPathObjectPtr(n_value, value, 2);
49709 xmlResetLastError();
49710 if (mem_base != xmlMemBlocks()) {
49711 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49712 xmlMemBlocks() - mem_base);
49714 printf(" %d", n_ctxt);
49715 printf(" %d", n_name);
49716 printf(" %d", n_value);
49730 test_xmlXPathRegisterVariableLookup(void) {
49734 /* missing type support */
49740 test_xmlXPathRegisterVariableNS(void) {
49743 #if defined(LIBXML_XPATH_ENABLED)
49746 xmlXPathContextPtr ctxt; /* the XPath context */
49748 xmlChar * name; /* the variable name */
49750 xmlChar * ns_uri; /* the variable namespace URI */
49752 xmlXPathObjectPtr value; /* the variable value or NULL */
49755 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49756 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49757 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49758 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49759 mem_base = xmlMemBlocks();
49760 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49761 name = gen_const_xmlChar_ptr(n_name, 1);
49762 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49763 value = gen_xmlXPathObjectPtr(n_value, 3);
49765 ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49766 desret_int(ret_val);
49768 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49769 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49770 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49771 des_xmlXPathObjectPtr(n_value, value, 3);
49772 xmlResetLastError();
49773 if (mem_base != xmlMemBlocks()) {
49774 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49775 xmlMemBlocks() - mem_base);
49777 printf(" %d", n_ctxt);
49778 printf(" %d", n_name);
49779 printf(" %d", n_ns_uri);
49780 printf(" %d", n_value);
49795 test_xmlXPathRegisteredFuncsCleanup(void) {
49798 #if defined(LIBXML_XPATH_ENABLED)
49800 xmlXPathContextPtr ctxt; /* the XPath context */
49803 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49804 mem_base = xmlMemBlocks();
49805 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49807 xmlXPathRegisteredFuncsCleanup(ctxt);
49809 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49810 xmlResetLastError();
49811 if (mem_base != xmlMemBlocks()) {
49812 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49813 xmlMemBlocks() - mem_base);
49815 printf(" %d", n_ctxt);
49827 test_xmlXPathRegisteredNsCleanup(void) {
49830 #if defined(LIBXML_XPATH_ENABLED)
49832 xmlXPathContextPtr ctxt; /* the XPath context */
49835 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49836 mem_base = xmlMemBlocks();
49837 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49839 xmlXPathRegisteredNsCleanup(ctxt);
49841 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49842 xmlResetLastError();
49843 if (mem_base != xmlMemBlocks()) {
49844 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49845 xmlMemBlocks() - mem_base);
49847 printf(" %d", n_ctxt);
49859 test_xmlXPathRegisteredVariablesCleanup(void) {
49862 #if defined(LIBXML_XPATH_ENABLED)
49864 xmlXPathContextPtr ctxt; /* the XPath context */
49867 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49868 mem_base = xmlMemBlocks();
49869 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49871 xmlXPathRegisteredVariablesCleanup(ctxt);
49873 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49874 xmlResetLastError();
49875 if (mem_base != xmlMemBlocks()) {
49876 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49877 xmlMemBlocks() - mem_base);
49879 printf(" %d", n_ctxt);
49891 test_xmlXPathRoot(void) {
49894 #if defined(LIBXML_XPATH_ENABLED)
49896 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49899 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49900 mem_base = xmlMemBlocks();
49901 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49903 xmlXPathRoot(ctxt);
49905 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49906 xmlResetLastError();
49907 if (mem_base != xmlMemBlocks()) {
49908 printf("Leak of %d blocks found in xmlXPathRoot",
49909 xmlMemBlocks() - mem_base);
49911 printf(" %d", n_ctxt);
49923 test_xmlXPathRoundFunction(void) {
49926 #if defined(LIBXML_XPATH_ENABLED)
49928 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49930 int nargs; /* the number of arguments */
49933 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49934 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49935 mem_base = xmlMemBlocks();
49936 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49937 nargs = gen_int(n_nargs, 1);
49939 xmlXPathRoundFunction(ctxt, nargs);
49941 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49942 des_int(n_nargs, nargs, 1);
49943 xmlResetLastError();
49944 if (mem_base != xmlMemBlocks()) {
49945 printf("Leak of %d blocks found in xmlXPathRoundFunction",
49946 xmlMemBlocks() - mem_base);
49948 printf(" %d", n_ctxt);
49949 printf(" %d", n_nargs);
49962 test_xmlXPathStartsWithFunction(void) {
49965 #if defined(LIBXML_XPATH_ENABLED)
49967 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49969 int nargs; /* the number of arguments */
49972 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49973 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49974 mem_base = xmlMemBlocks();
49975 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49976 nargs = gen_int(n_nargs, 1);
49978 xmlXPathStartsWithFunction(ctxt, nargs);
49980 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49981 des_int(n_nargs, nargs, 1);
49982 xmlResetLastError();
49983 if (mem_base != xmlMemBlocks()) {
49984 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49985 xmlMemBlocks() - mem_base);
49987 printf(" %d", n_ctxt);
49988 printf(" %d", n_nargs);
50001 test_xmlXPathStringEvalNumber(void) {
50004 #if defined(LIBXML_XPATH_ENABLED)
50007 xmlChar * str; /* A string to scan */
50010 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50011 mem_base = xmlMemBlocks();
50012 str = gen_const_xmlChar_ptr(n_str, 0);
50014 ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50015 desret_double(ret_val);
50017 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50018 xmlResetLastError();
50019 if (mem_base != xmlMemBlocks()) {
50020 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50021 xmlMemBlocks() - mem_base);
50023 printf(" %d", n_str);
50035 test_xmlXPathStringFunction(void) {
50038 #if defined(LIBXML_XPATH_ENABLED)
50040 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50042 int nargs; /* the number of arguments */
50045 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50046 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50047 mem_base = xmlMemBlocks();
50048 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50049 nargs = gen_int(n_nargs, 1);
50051 xmlXPathStringFunction(ctxt, nargs);
50053 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50054 des_int(n_nargs, nargs, 1);
50055 xmlResetLastError();
50056 if (mem_base != xmlMemBlocks()) {
50057 printf("Leak of %d blocks found in xmlXPathStringFunction",
50058 xmlMemBlocks() - mem_base);
50060 printf(" %d", n_ctxt);
50061 printf(" %d", n_nargs);
50074 test_xmlXPathStringLengthFunction(void) {
50077 #if defined(LIBXML_XPATH_ENABLED)
50079 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50081 int nargs; /* the number of arguments */
50084 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50085 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50086 mem_base = xmlMemBlocks();
50087 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50088 nargs = gen_int(n_nargs, 1);
50090 xmlXPathStringLengthFunction(ctxt, nargs);
50092 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50093 des_int(n_nargs, nargs, 1);
50094 xmlResetLastError();
50095 if (mem_base != xmlMemBlocks()) {
50096 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50097 xmlMemBlocks() - mem_base);
50099 printf(" %d", n_ctxt);
50100 printf(" %d", n_nargs);
50113 test_xmlXPathSubValues(void) {
50116 #if defined(LIBXML_XPATH_ENABLED)
50118 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50121 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50122 mem_base = xmlMemBlocks();
50123 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50125 xmlXPathSubValues(ctxt);
50127 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50128 xmlResetLastError();
50129 if (mem_base != xmlMemBlocks()) {
50130 printf("Leak of %d blocks found in xmlXPathSubValues",
50131 xmlMemBlocks() - mem_base);
50133 printf(" %d", n_ctxt);
50145 test_xmlXPathSubstringAfterFunction(void) {
50148 #if defined(LIBXML_XPATH_ENABLED)
50150 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50152 int nargs; /* the number of arguments */
50155 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50156 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50157 mem_base = xmlMemBlocks();
50158 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50159 nargs = gen_int(n_nargs, 1);
50161 xmlXPathSubstringAfterFunction(ctxt, nargs);
50163 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50164 des_int(n_nargs, nargs, 1);
50165 xmlResetLastError();
50166 if (mem_base != xmlMemBlocks()) {
50167 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50168 xmlMemBlocks() - mem_base);
50170 printf(" %d", n_ctxt);
50171 printf(" %d", n_nargs);
50184 test_xmlXPathSubstringBeforeFunction(void) {
50187 #if defined(LIBXML_XPATH_ENABLED)
50189 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50191 int nargs; /* the number of arguments */
50194 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50195 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50196 mem_base = xmlMemBlocks();
50197 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50198 nargs = gen_int(n_nargs, 1);
50200 xmlXPathSubstringBeforeFunction(ctxt, nargs);
50202 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50203 des_int(n_nargs, nargs, 1);
50204 xmlResetLastError();
50205 if (mem_base != xmlMemBlocks()) {
50206 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50207 xmlMemBlocks() - mem_base);
50209 printf(" %d", n_ctxt);
50210 printf(" %d", n_nargs);
50223 test_xmlXPathSubstringFunction(void) {
50226 #if defined(LIBXML_XPATH_ENABLED)
50228 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50230 int nargs; /* the number of arguments */
50233 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50234 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50235 mem_base = xmlMemBlocks();
50236 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50237 nargs = gen_int(n_nargs, 1);
50239 xmlXPathSubstringFunction(ctxt, nargs);
50241 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50242 des_int(n_nargs, nargs, 1);
50243 xmlResetLastError();
50244 if (mem_base != xmlMemBlocks()) {
50245 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50246 xmlMemBlocks() - mem_base);
50248 printf(" %d", n_ctxt);
50249 printf(" %d", n_nargs);
50262 test_xmlXPathSumFunction(void) {
50265 #if defined(LIBXML_XPATH_ENABLED)
50267 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50269 int nargs; /* the number of arguments */
50272 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50273 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50274 mem_base = xmlMemBlocks();
50275 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50276 nargs = gen_int(n_nargs, 1);
50278 xmlXPathSumFunction(ctxt, nargs);
50280 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50281 des_int(n_nargs, nargs, 1);
50282 xmlResetLastError();
50283 if (mem_base != xmlMemBlocks()) {
50284 printf("Leak of %d blocks found in xmlXPathSumFunction",
50285 xmlMemBlocks() - mem_base);
50287 printf(" %d", n_ctxt);
50288 printf(" %d", n_nargs);
50301 test_xmlXPathTrailing(void) {
50304 #if defined(LIBXML_XPATH_ENABLED)
50306 xmlNodeSetPtr ret_val;
50307 xmlNodeSetPtr nodes1; /* a node-set */
50309 xmlNodeSetPtr nodes2; /* a node-set */
50312 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50313 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50314 mem_base = xmlMemBlocks();
50315 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50316 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50318 ret_val = xmlXPathTrailing(nodes1, nodes2);
50319 desret_xmlNodeSetPtr(ret_val);
50321 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50322 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50323 xmlResetLastError();
50324 if (mem_base != xmlMemBlocks()) {
50325 printf("Leak of %d blocks found in xmlXPathTrailing",
50326 xmlMemBlocks() - mem_base);
50328 printf(" %d", n_nodes1);
50329 printf(" %d", n_nodes2);
50342 test_xmlXPathTrailingSorted(void) {
50345 #if defined(LIBXML_XPATH_ENABLED)
50347 xmlNodeSetPtr ret_val;
50348 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50350 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50353 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50354 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50355 mem_base = xmlMemBlocks();
50356 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50357 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50359 ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50360 desret_xmlNodeSetPtr(ret_val);
50362 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50363 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50364 xmlResetLastError();
50365 if (mem_base != xmlMemBlocks()) {
50366 printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50367 xmlMemBlocks() - mem_base);
50369 printf(" %d", n_nodes1);
50370 printf(" %d", n_nodes2);
50383 test_xmlXPathTranslateFunction(void) {
50386 #if defined(LIBXML_XPATH_ENABLED)
50388 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50390 int nargs; /* the number of arguments */
50393 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50394 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50395 mem_base = xmlMemBlocks();
50396 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50397 nargs = gen_int(n_nargs, 1);
50399 xmlXPathTranslateFunction(ctxt, nargs);
50401 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50402 des_int(n_nargs, nargs, 1);
50403 xmlResetLastError();
50404 if (mem_base != xmlMemBlocks()) {
50405 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50406 xmlMemBlocks() - mem_base);
50408 printf(" %d", n_ctxt);
50409 printf(" %d", n_nargs);
50422 test_xmlXPathTrueFunction(void) {
50425 #if defined(LIBXML_XPATH_ENABLED)
50427 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50429 int nargs; /* the number of arguments */
50432 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50433 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50434 mem_base = xmlMemBlocks();
50435 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50436 nargs = gen_int(n_nargs, 1);
50438 xmlXPathTrueFunction(ctxt, nargs);
50440 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50441 des_int(n_nargs, nargs, 1);
50442 xmlResetLastError();
50443 if (mem_base != xmlMemBlocks()) {
50444 printf("Leak of %d blocks found in xmlXPathTrueFunction",
50445 xmlMemBlocks() - mem_base);
50447 printf(" %d", n_ctxt);
50448 printf(" %d", n_nargs);
50461 test_xmlXPathValueFlipSign(void) {
50464 #if defined(LIBXML_XPATH_ENABLED)
50466 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50469 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50470 mem_base = xmlMemBlocks();
50471 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50473 xmlXPathValueFlipSign(ctxt);
50475 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50476 xmlResetLastError();
50477 if (mem_base != xmlMemBlocks()) {
50478 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50479 xmlMemBlocks() - mem_base);
50481 printf(" %d", n_ctxt);
50493 test_xmlXPathVariableLookup(void) {
50496 #if defined(LIBXML_XPATH_ENABLED)
50498 xmlXPathObjectPtr ret_val;
50499 xmlXPathContextPtr ctxt; /* the XPath context */
50501 xmlChar * name; /* the variable name */
50504 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50505 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50506 mem_base = xmlMemBlocks();
50507 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50508 name = gen_const_xmlChar_ptr(n_name, 1);
50510 ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50511 desret_xmlXPathObjectPtr(ret_val);
50513 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50514 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50515 xmlResetLastError();
50516 if (mem_base != xmlMemBlocks()) {
50517 printf("Leak of %d blocks found in xmlXPathVariableLookup",
50518 xmlMemBlocks() - mem_base);
50520 printf(" %d", n_ctxt);
50521 printf(" %d", n_name);
50534 test_xmlXPathVariableLookupNS(void) {
50537 #if defined(LIBXML_XPATH_ENABLED)
50539 xmlXPathObjectPtr ret_val;
50540 xmlXPathContextPtr ctxt; /* the XPath context */
50542 xmlChar * name; /* the variable name */
50544 xmlChar * ns_uri; /* the variable namespace URI */
50547 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50548 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50549 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50550 mem_base = xmlMemBlocks();
50551 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50552 name = gen_const_xmlChar_ptr(n_name, 1);
50553 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50555 ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50556 desret_xmlXPathObjectPtr(ret_val);
50558 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50559 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50560 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50561 xmlResetLastError();
50562 if (mem_base != xmlMemBlocks()) {
50563 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50564 xmlMemBlocks() - mem_base);
50566 printf(" %d", n_ctxt);
50567 printf(" %d", n_name);
50568 printf(" %d", n_ns_uri);
50582 test_xmlXPathWrapCString(void) {
50585 #if defined(LIBXML_XPATH_ENABLED)
50587 xmlXPathObjectPtr ret_val;
50588 char * val; /* the char * value */
50591 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50592 mem_base = xmlMemBlocks();
50593 val = gen_char_ptr(n_val, 0);
50595 ret_val = xmlXPathWrapCString(val);
50596 desret_xmlXPathObjectPtr(ret_val);
50598 des_char_ptr(n_val, val, 0);
50599 xmlResetLastError();
50600 if (mem_base != xmlMemBlocks()) {
50601 printf("Leak of %d blocks found in xmlXPathWrapCString",
50602 xmlMemBlocks() - mem_base);
50604 printf(" %d", n_val);
50616 test_xmlXPathWrapExternal(void) {
50619 #if defined(LIBXML_XPATH_ENABLED)
50621 xmlXPathObjectPtr ret_val;
50622 void * val; /* the user data */
50625 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50626 mem_base = xmlMemBlocks();
50627 val = gen_void_ptr(n_val, 0);
50629 ret_val = xmlXPathWrapExternal(val);
50630 desret_xmlXPathObjectPtr(ret_val);
50632 des_void_ptr(n_val, val, 0);
50633 xmlResetLastError();
50634 if (mem_base != xmlMemBlocks()) {
50635 printf("Leak of %d blocks found in xmlXPathWrapExternal",
50636 xmlMemBlocks() - mem_base);
50638 printf(" %d", n_val);
50650 test_xmlXPathWrapNodeSet(void) {
50653 #if defined(LIBXML_XPATH_ENABLED)
50655 xmlXPathObjectPtr ret_val;
50656 xmlNodeSetPtr val; /* the NodePtr value */
50659 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50660 mem_base = xmlMemBlocks();
50661 val = gen_xmlNodeSetPtr(n_val, 0);
50663 ret_val = xmlXPathWrapNodeSet(val);
50664 desret_xmlXPathObjectPtr(ret_val);
50666 des_xmlNodeSetPtr(n_val, val, 0);
50667 xmlResetLastError();
50668 if (mem_base != xmlMemBlocks()) {
50669 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50670 xmlMemBlocks() - mem_base);
50672 printf(" %d", n_val);
50684 test_xmlXPatherror(void) {
50687 #if defined(LIBXML_XPATH_ENABLED)
50689 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50691 const char * file; /* the file name */
50693 int line; /* the line number */
50695 int no; /* the error number */
50698 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50699 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50700 for (n_line = 0;n_line < gen_nb_int;n_line++) {
50701 for (n_no = 0;n_no < gen_nb_int;n_no++) {
50702 mem_base = xmlMemBlocks();
50703 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50704 file = gen_filepath(n_file, 1);
50705 line = gen_int(n_line, 2);
50706 no = gen_int(n_no, 3);
50708 xmlXPatherror(ctxt, file, line, no);
50710 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50711 des_filepath(n_file, file, 1);
50712 des_int(n_line, line, 2);
50713 des_int(n_no, no, 3);
50714 xmlResetLastError();
50715 if (mem_base != xmlMemBlocks()) {
50716 printf("Leak of %d blocks found in xmlXPatherror",
50717 xmlMemBlocks() - mem_base);
50719 printf(" %d", n_ctxt);
50720 printf(" %d", n_file);
50721 printf(" %d", n_line);
50722 printf(" %d", n_no);
50736 test_xpathInternals(void) {
50739 if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50740 test_ret += test_valuePop();
50741 test_ret += test_valuePush();
50742 test_ret += test_xmlXPathAddValues();
50743 test_ret += test_xmlXPathBooleanFunction();
50744 test_ret += test_xmlXPathCeilingFunction();
50745 test_ret += test_xmlXPathCompareValues();
50746 test_ret += test_xmlXPathConcatFunction();
50747 test_ret += test_xmlXPathContainsFunction();
50748 test_ret += test_xmlXPathCountFunction();
50749 test_ret += test_xmlXPathDebugDumpCompExpr();
50750 test_ret += test_xmlXPathDebugDumpObject();
50751 test_ret += test_xmlXPathDifference();
50752 test_ret += test_xmlXPathDistinct();
50753 test_ret += test_xmlXPathDistinctSorted();
50754 test_ret += test_xmlXPathDivValues();
50755 test_ret += test_xmlXPathEqualValues();
50756 test_ret += test_xmlXPathErr();
50757 test_ret += test_xmlXPathEvalExpr();
50758 test_ret += test_xmlXPathEvaluatePredicateResult();
50759 test_ret += test_xmlXPathFalseFunction();
50760 test_ret += test_xmlXPathFloorFunction();
50761 test_ret += test_xmlXPathFunctionLookup();
50762 test_ret += test_xmlXPathFunctionLookupNS();
50763 test_ret += test_xmlXPathHasSameNodes();
50764 test_ret += test_xmlXPathIdFunction();
50765 test_ret += test_xmlXPathIntersection();
50766 test_ret += test_xmlXPathIsNodeType();
50767 test_ret += test_xmlXPathLangFunction();
50768 test_ret += test_xmlXPathLastFunction();
50769 test_ret += test_xmlXPathLeading();
50770 test_ret += test_xmlXPathLeadingSorted();
50771 test_ret += test_xmlXPathLocalNameFunction();
50772 test_ret += test_xmlXPathModValues();
50773 test_ret += test_xmlXPathMultValues();
50774 test_ret += test_xmlXPathNamespaceURIFunction();
50775 test_ret += test_xmlXPathNewBoolean();
50776 test_ret += test_xmlXPathNewCString();
50777 test_ret += test_xmlXPathNewFloat();
50778 test_ret += test_xmlXPathNewNodeSet();
50779 test_ret += test_xmlXPathNewNodeSetList();
50780 test_ret += test_xmlXPathNewParserContext();
50781 test_ret += test_xmlXPathNewString();
50782 test_ret += test_xmlXPathNextAncestor();
50783 test_ret += test_xmlXPathNextAncestorOrSelf();
50784 test_ret += test_xmlXPathNextAttribute();
50785 test_ret += test_xmlXPathNextChild();
50786 test_ret += test_xmlXPathNextDescendant();
50787 test_ret += test_xmlXPathNextDescendantOrSelf();
50788 test_ret += test_xmlXPathNextFollowing();
50789 test_ret += test_xmlXPathNextFollowingSibling();
50790 test_ret += test_xmlXPathNextNamespace();
50791 test_ret += test_xmlXPathNextParent();
50792 test_ret += test_xmlXPathNextPreceding();
50793 test_ret += test_xmlXPathNextPrecedingSibling();
50794 test_ret += test_xmlXPathNextSelf();
50795 test_ret += test_xmlXPathNodeLeading();
50796 test_ret += test_xmlXPathNodeLeadingSorted();
50797 test_ret += test_xmlXPathNodeSetAdd();
50798 test_ret += test_xmlXPathNodeSetAddNs();
50799 test_ret += test_xmlXPathNodeSetAddUnique();
50800 test_ret += test_xmlXPathNodeSetContains();
50801 test_ret += test_xmlXPathNodeSetDel();
50802 test_ret += test_xmlXPathNodeSetMerge();
50803 test_ret += test_xmlXPathNodeSetRemove();
50804 test_ret += test_xmlXPathNodeSetSort();
50805 test_ret += test_xmlXPathNodeTrailing();
50806 test_ret += test_xmlXPathNodeTrailingSorted();
50807 test_ret += test_xmlXPathNormalizeFunction();
50808 test_ret += test_xmlXPathNotEqualValues();
50809 test_ret += test_xmlXPathNotFunction();
50810 test_ret += test_xmlXPathNsLookup();
50811 test_ret += test_xmlXPathNumberFunction();
50812 test_ret += test_xmlXPathParseNCName();
50813 test_ret += test_xmlXPathParseName();
50814 test_ret += test_xmlXPathPopBoolean();
50815 test_ret += test_xmlXPathPopExternal();
50816 test_ret += test_xmlXPathPopNodeSet();
50817 test_ret += test_xmlXPathPopNumber();
50818 test_ret += test_xmlXPathPopString();
50819 test_ret += test_xmlXPathPositionFunction();
50820 test_ret += test_xmlXPathRegisterAllFunctions();
50821 test_ret += test_xmlXPathRegisterFunc();
50822 test_ret += test_xmlXPathRegisterFuncLookup();
50823 test_ret += test_xmlXPathRegisterFuncNS();
50824 test_ret += test_xmlXPathRegisterNs();
50825 test_ret += test_xmlXPathRegisterVariable();
50826 test_ret += test_xmlXPathRegisterVariableLookup();
50827 test_ret += test_xmlXPathRegisterVariableNS();
50828 test_ret += test_xmlXPathRegisteredFuncsCleanup();
50829 test_ret += test_xmlXPathRegisteredNsCleanup();
50830 test_ret += test_xmlXPathRegisteredVariablesCleanup();
50831 test_ret += test_xmlXPathRoot();
50832 test_ret += test_xmlXPathRoundFunction();
50833 test_ret += test_xmlXPathStartsWithFunction();
50834 test_ret += test_xmlXPathStringEvalNumber();
50835 test_ret += test_xmlXPathStringFunction();
50836 test_ret += test_xmlXPathStringLengthFunction();
50837 test_ret += test_xmlXPathSubValues();
50838 test_ret += test_xmlXPathSubstringAfterFunction();
50839 test_ret += test_xmlXPathSubstringBeforeFunction();
50840 test_ret += test_xmlXPathSubstringFunction();
50841 test_ret += test_xmlXPathSumFunction();
50842 test_ret += test_xmlXPathTrailing();
50843 test_ret += test_xmlXPathTrailingSorted();
50844 test_ret += test_xmlXPathTranslateFunction();
50845 test_ret += test_xmlXPathTrueFunction();
50846 test_ret += test_xmlXPathValueFlipSign();
50847 test_ret += test_xmlXPathVariableLookup();
50848 test_ret += test_xmlXPathVariableLookupNS();
50849 test_ret += test_xmlXPathWrapCString();
50850 test_ret += test_xmlXPathWrapExternal();
50851 test_ret += test_xmlXPathWrapNodeSet();
50852 test_ret += test_xmlXPatherror();
50855 printf("Module xpathInternals: %d errors\n", test_ret);
50860 test_xmlXPtrBuildNodeList(void) {
50863 #if defined(LIBXML_XPTR_ENABLED)
50865 xmlNodePtr ret_val;
50866 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50869 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50870 mem_base = xmlMemBlocks();
50871 obj = gen_xmlXPathObjectPtr(n_obj, 0);
50873 ret_val = xmlXPtrBuildNodeList(obj);
50874 desret_xmlNodePtr(ret_val);
50876 des_xmlXPathObjectPtr(n_obj, obj, 0);
50877 xmlResetLastError();
50878 if (mem_base != xmlMemBlocks()) {
50879 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50880 xmlMemBlocks() - mem_base);
50882 printf(" %d", n_obj);
50894 test_xmlXPtrEval(void) {
50897 #if defined(LIBXML_XPTR_ENABLED)
50899 xmlXPathObjectPtr ret_val;
50900 xmlChar * str; /* the XPointer expression */
50902 xmlXPathContextPtr ctx; /* the XPointer context */
50905 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50906 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50907 mem_base = xmlMemBlocks();
50908 str = gen_const_xmlChar_ptr(n_str, 0);
50909 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50911 ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50912 desret_xmlXPathObjectPtr(ret_val);
50914 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50915 des_xmlXPathContextPtr(n_ctx, ctx, 1);
50916 xmlResetLastError();
50917 if (mem_base != xmlMemBlocks()) {
50918 printf("Leak of %d blocks found in xmlXPtrEval",
50919 xmlMemBlocks() - mem_base);
50921 printf(" %d", n_str);
50922 printf(" %d", n_ctx);
50935 test_xmlXPtrEvalRangePredicate(void) {
50938 #if defined(LIBXML_XPTR_ENABLED)
50940 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50944 mem_base = xmlMemBlocks();
50945 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50947 xmlXPtrEvalRangePredicate(ctxt);
50949 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50950 xmlResetLastError();
50951 if (mem_base != xmlMemBlocks()) {
50952 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50953 xmlMemBlocks() - mem_base);
50955 printf(" %d", n_ctxt);
50965 #ifdef LIBXML_XPTR_ENABLED
50967 #define gen_nb_xmlLocationSetPtr 1
50968 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50971 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50977 test_xmlXPtrLocationSetAdd(void) {
50980 #if defined(LIBXML_XPTR_ENABLED)
50982 xmlLocationSetPtr cur; /* the initial range set */
50984 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50987 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50988 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50989 mem_base = xmlMemBlocks();
50990 cur = gen_xmlLocationSetPtr(n_cur, 0);
50991 val = gen_xmlXPathObjectPtr(n_val, 1);
50993 xmlXPtrLocationSetAdd(cur, val);
50995 des_xmlLocationSetPtr(n_cur, cur, 0);
50996 des_xmlXPathObjectPtr(n_val, val, 1);
50997 xmlResetLastError();
50998 if (mem_base != xmlMemBlocks()) {
50999 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51000 xmlMemBlocks() - mem_base);
51002 printf(" %d", n_cur);
51003 printf(" %d", n_val);
51016 test_xmlXPtrLocationSetCreate(void) {
51020 /* missing type support */
51026 test_xmlXPtrLocationSetDel(void) {
51029 #if defined(LIBXML_XPTR_ENABLED)
51031 xmlLocationSetPtr cur; /* the initial range set */
51033 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51036 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51037 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51038 mem_base = xmlMemBlocks();
51039 cur = gen_xmlLocationSetPtr(n_cur, 0);
51040 val = gen_xmlXPathObjectPtr(n_val, 1);
51042 xmlXPtrLocationSetDel(cur, val);
51044 des_xmlLocationSetPtr(n_cur, cur, 0);
51045 des_xmlXPathObjectPtr(n_val, val, 1);
51046 xmlResetLastError();
51047 if (mem_base != xmlMemBlocks()) {
51048 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51049 xmlMemBlocks() - mem_base);
51051 printf(" %d", n_cur);
51052 printf(" %d", n_val);
51065 test_xmlXPtrLocationSetMerge(void) {
51069 /* missing type support */
51075 test_xmlXPtrLocationSetRemove(void) {
51078 #if defined(LIBXML_XPTR_ENABLED)
51080 xmlLocationSetPtr cur; /* the initial range set */
51082 int val; /* the index to remove */
51085 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51086 for (n_val = 0;n_val < gen_nb_int;n_val++) {
51087 mem_base = xmlMemBlocks();
51088 cur = gen_xmlLocationSetPtr(n_cur, 0);
51089 val = gen_int(n_val, 1);
51091 xmlXPtrLocationSetRemove(cur, val);
51093 des_xmlLocationSetPtr(n_cur, cur, 0);
51094 des_int(n_val, val, 1);
51095 xmlResetLastError();
51096 if (mem_base != xmlMemBlocks()) {
51097 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51098 xmlMemBlocks() - mem_base);
51100 printf(" %d", n_cur);
51101 printf(" %d", n_val);
51114 test_xmlXPtrNewCollapsedRange(void) {
51117 #if defined(LIBXML_XPTR_ENABLED)
51119 xmlXPathObjectPtr ret_val;
51120 xmlNodePtr start; /* the starting and ending node */
51123 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51124 mem_base = xmlMemBlocks();
51125 start = gen_xmlNodePtr(n_start, 0);
51127 ret_val = xmlXPtrNewCollapsedRange(start);
51128 desret_xmlXPathObjectPtr(ret_val);
51130 des_xmlNodePtr(n_start, start, 0);
51131 xmlResetLastError();
51132 if (mem_base != xmlMemBlocks()) {
51133 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51134 xmlMemBlocks() - mem_base);
51136 printf(" %d", n_start);
51148 test_xmlXPtrNewContext(void) {
51152 /* missing type support */
51158 test_xmlXPtrNewLocationSetNodeSet(void) {
51161 #if defined(LIBXML_XPTR_ENABLED)
51163 xmlXPathObjectPtr ret_val;
51164 xmlNodeSetPtr set; /* a node set */
51167 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51168 mem_base = xmlMemBlocks();
51169 set = gen_xmlNodeSetPtr(n_set, 0);
51171 ret_val = xmlXPtrNewLocationSetNodeSet(set);
51172 desret_xmlXPathObjectPtr(ret_val);
51174 des_xmlNodeSetPtr(n_set, set, 0);
51175 xmlResetLastError();
51176 if (mem_base != xmlMemBlocks()) {
51177 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51178 xmlMemBlocks() - mem_base);
51180 printf(" %d", n_set);
51192 test_xmlXPtrNewLocationSetNodes(void) {
51195 #if defined(LIBXML_XPTR_ENABLED)
51197 xmlXPathObjectPtr ret_val;
51198 xmlNodePtr start; /* the start NodePtr value */
51200 xmlNodePtr end; /* the end NodePtr value or NULL */
51203 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51204 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51205 mem_base = xmlMemBlocks();
51206 start = gen_xmlNodePtr(n_start, 0);
51207 end = gen_xmlNodePtr(n_end, 1);
51209 ret_val = xmlXPtrNewLocationSetNodes(start, end);
51210 desret_xmlXPathObjectPtr(ret_val);
51212 des_xmlNodePtr(n_start, start, 0);
51213 des_xmlNodePtr(n_end, end, 1);
51214 xmlResetLastError();
51215 if (mem_base != xmlMemBlocks()) {
51216 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51217 xmlMemBlocks() - mem_base);
51219 printf(" %d", n_start);
51220 printf(" %d", n_end);
51233 test_xmlXPtrNewRange(void) {
51236 #if defined(LIBXML_XPTR_ENABLED)
51238 xmlXPathObjectPtr ret_val;
51239 xmlNodePtr start; /* the starting node */
51241 int startindex; /* the start index */
51243 xmlNodePtr end; /* the ending point */
51245 int endindex; /* the ending index */
51248 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51249 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51250 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51251 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51252 mem_base = xmlMemBlocks();
51253 start = gen_xmlNodePtr(n_start, 0);
51254 startindex = gen_int(n_startindex, 1);
51255 end = gen_xmlNodePtr(n_end, 2);
51256 endindex = gen_int(n_endindex, 3);
51258 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51259 desret_xmlXPathObjectPtr(ret_val);
51261 des_xmlNodePtr(n_start, start, 0);
51262 des_int(n_startindex, startindex, 1);
51263 des_xmlNodePtr(n_end, end, 2);
51264 des_int(n_endindex, endindex, 3);
51265 xmlResetLastError();
51266 if (mem_base != xmlMemBlocks()) {
51267 printf("Leak of %d blocks found in xmlXPtrNewRange",
51268 xmlMemBlocks() - mem_base);
51270 printf(" %d", n_start);
51271 printf(" %d", n_startindex);
51272 printf(" %d", n_end);
51273 printf(" %d", n_endindex);
51288 test_xmlXPtrNewRangeNodeObject(void) {
51291 #if defined(LIBXML_XPTR_ENABLED)
51293 xmlXPathObjectPtr ret_val;
51294 xmlNodePtr start; /* the starting node */
51296 xmlXPathObjectPtr end; /* the ending object */
51299 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51300 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51301 mem_base = xmlMemBlocks();
51302 start = gen_xmlNodePtr(n_start, 0);
51303 end = gen_xmlXPathObjectPtr(n_end, 1);
51305 ret_val = xmlXPtrNewRangeNodeObject(start, end);
51306 desret_xmlXPathObjectPtr(ret_val);
51308 des_xmlNodePtr(n_start, start, 0);
51309 des_xmlXPathObjectPtr(n_end, end, 1);
51310 xmlResetLastError();
51311 if (mem_base != xmlMemBlocks()) {
51312 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51313 xmlMemBlocks() - mem_base);
51315 printf(" %d", n_start);
51316 printf(" %d", n_end);
51329 test_xmlXPtrNewRangeNodePoint(void) {
51332 #if defined(LIBXML_XPTR_ENABLED)
51334 xmlXPathObjectPtr ret_val;
51335 xmlNodePtr start; /* the starting node */
51337 xmlXPathObjectPtr end; /* the ending point */
51340 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51341 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51342 mem_base = xmlMemBlocks();
51343 start = gen_xmlNodePtr(n_start, 0);
51344 end = gen_xmlXPathObjectPtr(n_end, 1);
51346 ret_val = xmlXPtrNewRangeNodePoint(start, end);
51347 desret_xmlXPathObjectPtr(ret_val);
51349 des_xmlNodePtr(n_start, start, 0);
51350 des_xmlXPathObjectPtr(n_end, end, 1);
51351 xmlResetLastError();
51352 if (mem_base != xmlMemBlocks()) {
51353 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51354 xmlMemBlocks() - mem_base);
51356 printf(" %d", n_start);
51357 printf(" %d", n_end);
51370 test_xmlXPtrNewRangeNodes(void) {
51373 #if defined(LIBXML_XPTR_ENABLED)
51375 xmlXPathObjectPtr ret_val;
51376 xmlNodePtr start; /* the starting node */
51378 xmlNodePtr end; /* the ending node */
51381 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51382 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51383 mem_base = xmlMemBlocks();
51384 start = gen_xmlNodePtr(n_start, 0);
51385 end = gen_xmlNodePtr(n_end, 1);
51387 ret_val = xmlXPtrNewRangeNodes(start, end);
51388 desret_xmlXPathObjectPtr(ret_val);
51390 des_xmlNodePtr(n_start, start, 0);
51391 des_xmlNodePtr(n_end, end, 1);
51392 xmlResetLastError();
51393 if (mem_base != xmlMemBlocks()) {
51394 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51395 xmlMemBlocks() - mem_base);
51397 printf(" %d", n_start);
51398 printf(" %d", n_end);
51411 test_xmlXPtrNewRangePointNode(void) {
51414 #if defined(LIBXML_XPTR_ENABLED)
51416 xmlXPathObjectPtr ret_val;
51417 xmlXPathObjectPtr start; /* the starting point */
51419 xmlNodePtr end; /* the ending node */
51422 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51423 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51424 mem_base = xmlMemBlocks();
51425 start = gen_xmlXPathObjectPtr(n_start, 0);
51426 end = gen_xmlNodePtr(n_end, 1);
51428 ret_val = xmlXPtrNewRangePointNode(start, end);
51429 desret_xmlXPathObjectPtr(ret_val);
51431 des_xmlXPathObjectPtr(n_start, start, 0);
51432 des_xmlNodePtr(n_end, end, 1);
51433 xmlResetLastError();
51434 if (mem_base != xmlMemBlocks()) {
51435 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51436 xmlMemBlocks() - mem_base);
51438 printf(" %d", n_start);
51439 printf(" %d", n_end);
51452 test_xmlXPtrNewRangePoints(void) {
51455 #if defined(LIBXML_XPTR_ENABLED)
51457 xmlXPathObjectPtr ret_val;
51458 xmlXPathObjectPtr start; /* the starting point */
51460 xmlXPathObjectPtr end; /* the ending point */
51463 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51464 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51465 mem_base = xmlMemBlocks();
51466 start = gen_xmlXPathObjectPtr(n_start, 0);
51467 end = gen_xmlXPathObjectPtr(n_end, 1);
51469 ret_val = xmlXPtrNewRangePoints(start, end);
51470 desret_xmlXPathObjectPtr(ret_val);
51472 des_xmlXPathObjectPtr(n_start, start, 0);
51473 des_xmlXPathObjectPtr(n_end, end, 1);
51474 xmlResetLastError();
51475 if (mem_base != xmlMemBlocks()) {
51476 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51477 xmlMemBlocks() - mem_base);
51479 printf(" %d", n_start);
51480 printf(" %d", n_end);
51493 test_xmlXPtrRangeToFunction(void) {
51496 #if defined(LIBXML_XPTR_ENABLED)
51498 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51500 int nargs; /* the number of args */
51503 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51504 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51505 mem_base = xmlMemBlocks();
51506 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51507 nargs = gen_int(n_nargs, 1);
51509 xmlXPtrRangeToFunction(ctxt, nargs);
51511 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51512 des_int(n_nargs, nargs, 1);
51513 xmlResetLastError();
51514 if (mem_base != xmlMemBlocks()) {
51515 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51516 xmlMemBlocks() - mem_base);
51518 printf(" %d", n_ctxt);
51519 printf(" %d", n_nargs);
51532 test_xmlXPtrWrapLocationSet(void) {
51535 #if defined(LIBXML_XPTR_ENABLED)
51537 xmlXPathObjectPtr ret_val;
51538 xmlLocationSetPtr val; /* the LocationSet value */
51541 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51542 mem_base = xmlMemBlocks();
51543 val = gen_xmlLocationSetPtr(n_val, 0);
51545 ret_val = xmlXPtrWrapLocationSet(val);
51546 desret_xmlXPathObjectPtr(ret_val);
51548 des_xmlLocationSetPtr(n_val, val, 0);
51549 xmlResetLastError();
51550 if (mem_base != xmlMemBlocks()) {
51551 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51552 xmlMemBlocks() - mem_base);
51554 printf(" %d", n_val);
51565 test_xpointer(void) {
51568 if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51569 test_ret += test_xmlXPtrBuildNodeList();
51570 test_ret += test_xmlXPtrEval();
51571 test_ret += test_xmlXPtrEvalRangePredicate();
51572 test_ret += test_xmlXPtrLocationSetAdd();
51573 test_ret += test_xmlXPtrLocationSetCreate();
51574 test_ret += test_xmlXPtrLocationSetDel();
51575 test_ret += test_xmlXPtrLocationSetMerge();
51576 test_ret += test_xmlXPtrLocationSetRemove();
51577 test_ret += test_xmlXPtrNewCollapsedRange();
51578 test_ret += test_xmlXPtrNewContext();
51579 test_ret += test_xmlXPtrNewLocationSetNodeSet();
51580 test_ret += test_xmlXPtrNewLocationSetNodes();
51581 test_ret += test_xmlXPtrNewRange();
51582 test_ret += test_xmlXPtrNewRangeNodeObject();
51583 test_ret += test_xmlXPtrNewRangeNodePoint();
51584 test_ret += test_xmlXPtrNewRangeNodes();
51585 test_ret += test_xmlXPtrNewRangePointNode();
51586 test_ret += test_xmlXPtrNewRangePoints();
51587 test_ret += test_xmlXPtrRangeToFunction();
51588 test_ret += test_xmlXPtrWrapLocationSet();
51591 printf("Module xpointer: %d errors\n", test_ret);
51595 test_module(const char *module) {
51596 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51597 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51598 if (!strcmp(module, "SAX2")) return(test_SAX2());
51599 if (!strcmp(module, "c14n")) return(test_c14n());
51600 if (!strcmp(module, "catalog")) return(test_catalog());
51601 if (!strcmp(module, "chvalid")) return(test_chvalid());
51602 if (!strcmp(module, "debugXML")) return(test_debugXML());
51603 if (!strcmp(module, "dict")) return(test_dict());
51604 if (!strcmp(module, "encoding")) return(test_encoding());
51605 if (!strcmp(module, "entities")) return(test_entities());
51606 if (!strcmp(module, "hash")) return(test_hash());
51607 if (!strcmp(module, "list")) return(test_list());
51608 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51609 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51610 if (!strcmp(module, "parser")) return(test_parser());
51611 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51612 if (!strcmp(module, "pattern")) return(test_pattern());
51613 if (!strcmp(module, "relaxng")) return(test_relaxng());
51614 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51615 if (!strcmp(module, "schematron")) return(test_schematron());
51616 if (!strcmp(module, "tree")) return(test_tree());
51617 if (!strcmp(module, "uri")) return(test_uri());
51618 if (!strcmp(module, "valid")) return(test_valid());
51619 if (!strcmp(module, "xinclude")) return(test_xinclude());
51620 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51621 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51622 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51623 if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51624 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51625 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51626 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51627 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51628 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51629 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51630 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51631 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51632 if (!strcmp(module, "xpath")) return(test_xpath());
51633 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51634 if (!strcmp(module, "xpointer")) return(test_xpointer());