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) {
11642 #if defined(LIBXML_FTP_ENABLED)
11645 void * ctx; /* an FTP context */
11648 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11649 mem_base = xmlMemBlocks();
11650 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11652 ret_val = xmlNanoFTPGetConnection(ctx);
11653 desret_int(ret_val);
11655 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11656 xmlResetLastError();
11657 if (mem_base != xmlMemBlocks()) {
11658 printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11659 xmlMemBlocks() - mem_base);
11661 printf(" %d", n_ctx);
11673 test_xmlNanoFTPGetResponse(void) {
11676 #if defined(LIBXML_FTP_ENABLED)
11679 void * ctx; /* an FTP context */
11682 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11683 mem_base = xmlMemBlocks();
11684 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11686 ret_val = xmlNanoFTPGetResponse(ctx);
11687 desret_int(ret_val);
11689 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11690 xmlResetLastError();
11691 if (mem_base != xmlMemBlocks()) {
11692 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11693 xmlMemBlocks() - mem_base);
11695 printf(" %d", n_ctx);
11707 test_xmlNanoFTPGetSocket(void) {
11710 #if defined(LIBXML_FTP_ENABLED)
11713 void * ctx; /* an FTP context */
11715 const char * filename; /* the file to retrieve (or NULL if path is in context). */
11718 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11719 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11720 mem_base = xmlMemBlocks();
11721 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11722 filename = gen_filepath(n_filename, 1);
11724 ret_val = xmlNanoFTPGetSocket(ctx, filename);
11725 desret_int(ret_val);
11727 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11728 des_filepath(n_filename, filename, 1);
11729 xmlResetLastError();
11730 if (mem_base != xmlMemBlocks()) {
11731 printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11732 xmlMemBlocks() - mem_base);
11734 printf(" %d", n_ctx);
11735 printf(" %d", n_filename);
11748 test_xmlNanoFTPInit(void) {
11751 #if defined(LIBXML_FTP_ENABLED)
11754 mem_base = xmlMemBlocks();
11758 xmlResetLastError();
11759 if (mem_base != xmlMemBlocks()) {
11760 printf("Leak of %d blocks found in xmlNanoFTPInit",
11761 xmlMemBlocks() - mem_base);
11773 test_xmlNanoFTPList(void) {
11777 /* missing type support */
11783 test_xmlNanoFTPNewCtxt(void) {
11786 #if defined(LIBXML_FTP_ENABLED)
11789 const char * URL; /* The URL used to initialize the context */
11792 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11793 mem_base = xmlMemBlocks();
11794 URL = gen_filepath(n_URL, 0);
11796 ret_val = xmlNanoFTPNewCtxt(URL);
11797 desret_xmlNanoFTPCtxtPtr(ret_val);
11799 des_filepath(n_URL, URL, 0);
11800 xmlResetLastError();
11801 if (mem_base != xmlMemBlocks()) {
11802 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11803 xmlMemBlocks() - mem_base);
11805 printf(" %d", n_URL);
11817 test_xmlNanoFTPOpen(void) {
11820 #if defined(LIBXML_FTP_ENABLED)
11823 const char * URL; /* the URL to the resource */
11826 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11827 mem_base = xmlMemBlocks();
11828 URL = gen_filepath(n_URL, 0);
11830 ret_val = xmlNanoFTPOpen(URL);
11831 desret_xmlNanoFTPCtxtPtr(ret_val);
11833 des_filepath(n_URL, URL, 0);
11834 xmlResetLastError();
11835 if (mem_base != xmlMemBlocks()) {
11836 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11837 xmlMemBlocks() - mem_base);
11839 printf(" %d", n_URL);
11851 test_xmlNanoFTPProxy(void) {
11854 #if defined(LIBXML_FTP_ENABLED)
11855 char * host; /* the proxy host name */
11857 int port; /* the proxy port */
11859 char * user; /* the proxy user name */
11861 char * passwd; /* the proxy password */
11863 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11866 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11867 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11868 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11869 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11870 for (n_type = 0;n_type < gen_nb_int;n_type++) {
11871 host = gen_const_char_ptr(n_host, 0);
11872 port = gen_int(n_port, 1);
11873 user = gen_const_char_ptr(n_user, 2);
11874 passwd = gen_const_char_ptr(n_passwd, 3);
11875 type = gen_int(n_type, 4);
11877 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11879 des_const_char_ptr(n_host, (const char *)host, 0);
11880 des_int(n_port, port, 1);
11881 des_const_char_ptr(n_user, (const char *)user, 2);
11882 des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11883 des_int(n_type, type, 4);
11884 xmlResetLastError();
11898 test_xmlNanoFTPQuit(void) {
11901 #if defined(LIBXML_FTP_ENABLED)
11904 void * ctx; /* an FTP context */
11907 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11908 mem_base = xmlMemBlocks();
11909 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11911 ret_val = xmlNanoFTPQuit(ctx);
11912 desret_int(ret_val);
11914 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11915 xmlResetLastError();
11916 if (mem_base != xmlMemBlocks()) {
11917 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11918 xmlMemBlocks() - mem_base);
11920 printf(" %d", n_ctx);
11932 test_xmlNanoFTPRead(void) {
11935 #if defined(LIBXML_FTP_ENABLED)
11938 void * ctx; /* the FTP context */
11940 void * dest; /* a buffer */
11942 int len; /* the buffer length */
11945 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11946 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11947 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11948 mem_base = xmlMemBlocks();
11949 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11950 dest = gen_void_ptr(n_dest, 1);
11951 len = gen_int(n_len, 2);
11953 ret_val = xmlNanoFTPRead(ctx, dest, len);
11954 desret_int(ret_val);
11956 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11957 des_void_ptr(n_dest, dest, 1);
11958 des_int(n_len, len, 2);
11959 xmlResetLastError();
11960 if (mem_base != xmlMemBlocks()) {
11961 printf("Leak of %d blocks found in xmlNanoFTPRead",
11962 xmlMemBlocks() - mem_base);
11964 printf(" %d", n_ctx);
11965 printf(" %d", n_dest);
11966 printf(" %d", n_len);
11980 test_xmlNanoFTPScanProxy(void) {
11983 #if defined(LIBXML_FTP_ENABLED)
11984 const char * URL; /* The proxy URL used to initialize the proxy context */
11987 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11988 URL = gen_filepath(n_URL, 0);
11990 xmlNanoFTPScanProxy(URL);
11992 des_filepath(n_URL, URL, 0);
11993 xmlResetLastError();
12003 test_xmlNanoFTPUpdateURL(void) {
12006 #if defined(LIBXML_FTP_ENABLED)
12009 void * ctx; /* an FTP context */
12011 const char * URL; /* The URL used to update the context */
12014 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12015 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12016 mem_base = xmlMemBlocks();
12017 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12018 URL = gen_filepath(n_URL, 1);
12020 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12021 desret_int(ret_val);
12023 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12024 des_filepath(n_URL, URL, 1);
12025 xmlResetLastError();
12026 if (mem_base != xmlMemBlocks()) {
12027 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12028 xmlMemBlocks() - mem_base);
12030 printf(" %d", n_ctx);
12031 printf(" %d", n_URL);
12043 test_nanoftp(void) {
12046 if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
12047 test_ret += test_xmlNanoFTPCheckResponse();
12048 test_ret += test_xmlNanoFTPCleanup();
12049 test_ret += test_xmlNanoFTPCloseConnection();
12050 test_ret += test_xmlNanoFTPCwd();
12051 test_ret += test_xmlNanoFTPDele();
12052 test_ret += test_xmlNanoFTPGet();
12053 test_ret += test_xmlNanoFTPGetConnection();
12054 test_ret += test_xmlNanoFTPGetResponse();
12055 test_ret += test_xmlNanoFTPGetSocket();
12056 test_ret += test_xmlNanoFTPInit();
12057 test_ret += test_xmlNanoFTPList();
12058 test_ret += test_xmlNanoFTPNewCtxt();
12059 test_ret += test_xmlNanoFTPOpen();
12060 test_ret += test_xmlNanoFTPProxy();
12061 test_ret += test_xmlNanoFTPQuit();
12062 test_ret += test_xmlNanoFTPRead();
12063 test_ret += test_xmlNanoFTPScanProxy();
12064 test_ret += test_xmlNanoFTPUpdateURL();
12067 printf("Module nanoftp: %d errors\n", test_ret);
12072 test_xmlNanoHTTPAuthHeader(void) {
12075 #if defined(LIBXML_HTTP_ENABLED)
12077 const char * ret_val;
12078 void * ctx; /* the HTTP context */
12081 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12082 mem_base = xmlMemBlocks();
12083 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12085 ret_val = xmlNanoHTTPAuthHeader(ctx);
12086 desret_const_char_ptr(ret_val);
12088 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12089 xmlResetLastError();
12090 if (mem_base != xmlMemBlocks()) {
12091 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12092 xmlMemBlocks() - mem_base);
12094 printf(" %d", n_ctx);
12106 test_xmlNanoHTTPCleanup(void) {
12109 #if defined(LIBXML_HTTP_ENABLED)
12112 mem_base = xmlMemBlocks();
12114 xmlNanoHTTPCleanup();
12116 xmlResetLastError();
12117 if (mem_base != xmlMemBlocks()) {
12118 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12119 xmlMemBlocks() - mem_base);
12131 test_xmlNanoHTTPContentLength(void) {
12134 #if defined(LIBXML_HTTP_ENABLED)
12137 void * ctx; /* the HTTP context */
12140 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12141 mem_base = xmlMemBlocks();
12142 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12144 ret_val = xmlNanoHTTPContentLength(ctx);
12145 desret_int(ret_val);
12147 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12148 xmlResetLastError();
12149 if (mem_base != xmlMemBlocks()) {
12150 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12151 xmlMemBlocks() - mem_base);
12153 printf(" %d", n_ctx);
12165 test_xmlNanoHTTPEncoding(void) {
12168 #if defined(LIBXML_HTTP_ENABLED)
12170 const char * ret_val;
12171 void * ctx; /* the HTTP context */
12174 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12175 mem_base = xmlMemBlocks();
12176 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12178 ret_val = xmlNanoHTTPEncoding(ctx);
12179 desret_const_char_ptr(ret_val);
12181 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12182 xmlResetLastError();
12183 if (mem_base != xmlMemBlocks()) {
12184 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12185 xmlMemBlocks() - mem_base);
12187 printf(" %d", n_ctx);
12198 #define gen_nb_char_ptr_ptr 1
12199 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12202 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12206 test_xmlNanoHTTPFetch(void) {
12209 #if defined(LIBXML_HTTP_ENABLED)
12212 const char * URL; /* The URL to load */
12214 const char * filename; /* the filename where the content should be saved */
12216 char ** contentType; /* if available the Content-Type information will be returned at that location */
12219 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12220 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12221 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12222 mem_base = xmlMemBlocks();
12223 URL = gen_fileoutput(n_URL, 0);
12224 filename = gen_fileoutput(n_filename, 1);
12225 contentType = gen_char_ptr_ptr(n_contentType, 2);
12227 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12228 desret_int(ret_val);
12230 des_fileoutput(n_URL, URL, 0);
12231 des_fileoutput(n_filename, filename, 1);
12232 des_char_ptr_ptr(n_contentType, contentType, 2);
12233 xmlResetLastError();
12234 if (mem_base != xmlMemBlocks()) {
12235 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12236 xmlMemBlocks() - mem_base);
12238 printf(" %d", n_URL);
12239 printf(" %d", n_filename);
12240 printf(" %d", n_contentType);
12254 test_xmlNanoHTTPInit(void) {
12257 #if defined(LIBXML_HTTP_ENABLED)
12260 mem_base = xmlMemBlocks();
12264 xmlResetLastError();
12265 if (mem_base != xmlMemBlocks()) {
12266 printf("Leak of %d blocks found in xmlNanoHTTPInit",
12267 xmlMemBlocks() - mem_base);
12279 test_xmlNanoHTTPMimeType(void) {
12282 #if defined(LIBXML_HTTP_ENABLED)
12284 const char * ret_val;
12285 void * ctx; /* the HTTP context */
12288 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12289 mem_base = xmlMemBlocks();
12290 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12292 ret_val = xmlNanoHTTPMimeType(ctx);
12293 desret_const_char_ptr(ret_val);
12295 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12296 xmlResetLastError();
12297 if (mem_base != xmlMemBlocks()) {
12298 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12299 xmlMemBlocks() - mem_base);
12301 printf(" %d", n_ctx);
12313 test_xmlNanoHTTPOpen(void) {
12316 #if defined(LIBXML_HTTP_ENABLED)
12319 const char * URL; /* The URL to load */
12321 char ** contentType; /* if available the Content-Type information will be returned at that location */
12324 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12325 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12326 mem_base = xmlMemBlocks();
12327 URL = gen_filepath(n_URL, 0);
12328 contentType = gen_char_ptr_ptr(n_contentType, 1);
12330 ret_val = xmlNanoHTTPOpen(URL, contentType);
12331 desret_xmlNanoHTTPCtxtPtr(ret_val);
12333 des_filepath(n_URL, URL, 0);
12334 des_char_ptr_ptr(n_contentType, contentType, 1);
12335 xmlResetLastError();
12336 if (mem_base != xmlMemBlocks()) {
12337 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12338 xmlMemBlocks() - mem_base);
12340 printf(" %d", n_URL);
12341 printf(" %d", n_contentType);
12354 test_xmlNanoHTTPOpenRedir(void) {
12357 #if defined(LIBXML_HTTP_ENABLED)
12360 const char * URL; /* The URL to load */
12362 char ** contentType; /* if available the Content-Type information will be returned at that location */
12364 char ** redir; /* if available the redirected URL will be returned */
12367 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12368 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12369 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12370 mem_base = xmlMemBlocks();
12371 URL = gen_filepath(n_URL, 0);
12372 contentType = gen_char_ptr_ptr(n_contentType, 1);
12373 redir = gen_char_ptr_ptr(n_redir, 2);
12375 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12376 desret_xmlNanoHTTPCtxtPtr(ret_val);
12378 des_filepath(n_URL, URL, 0);
12379 des_char_ptr_ptr(n_contentType, contentType, 1);
12380 des_char_ptr_ptr(n_redir, redir, 2);
12381 xmlResetLastError();
12382 if (mem_base != xmlMemBlocks()) {
12383 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12384 xmlMemBlocks() - mem_base);
12386 printf(" %d", n_URL);
12387 printf(" %d", n_contentType);
12388 printf(" %d", n_redir);
12402 test_xmlNanoHTTPRead(void) {
12405 #if defined(LIBXML_HTTP_ENABLED)
12408 void * ctx; /* the HTTP context */
12410 void * dest; /* a buffer */
12412 int len; /* the buffer length */
12415 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12416 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12417 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12418 mem_base = xmlMemBlocks();
12419 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12420 dest = gen_void_ptr(n_dest, 1);
12421 len = gen_int(n_len, 2);
12423 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12424 desret_int(ret_val);
12426 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12427 des_void_ptr(n_dest, dest, 1);
12428 des_int(n_len, len, 2);
12429 xmlResetLastError();
12430 if (mem_base != xmlMemBlocks()) {
12431 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12432 xmlMemBlocks() - mem_base);
12434 printf(" %d", n_ctx);
12435 printf(" %d", n_dest);
12436 printf(" %d", n_len);
12450 test_xmlNanoHTTPRedir(void) {
12454 /* missing type support */
12460 test_xmlNanoHTTPReturnCode(void) {
12463 #if defined(LIBXML_HTTP_ENABLED)
12466 void * ctx; /* the HTTP context */
12469 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12470 mem_base = xmlMemBlocks();
12471 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12473 ret_val = xmlNanoHTTPReturnCode(ctx);
12474 desret_int(ret_val);
12476 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12477 xmlResetLastError();
12478 if (mem_base != xmlMemBlocks()) {
12479 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12480 xmlMemBlocks() - mem_base);
12482 printf(" %d", n_ctx);
12494 test_xmlNanoHTTPSave(void) {
12497 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12500 void * ctxt; /* the HTTP context */
12502 const char * filename; /* the filename where the content should be saved */
12505 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12506 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12507 mem_base = xmlMemBlocks();
12508 ctxt = gen_void_ptr(n_ctxt, 0);
12509 filename = gen_fileoutput(n_filename, 1);
12511 ret_val = xmlNanoHTTPSave(ctxt, filename);
12512 desret_int(ret_val);
12514 des_void_ptr(n_ctxt, ctxt, 0);
12515 des_fileoutput(n_filename, filename, 1);
12516 xmlResetLastError();
12517 if (mem_base != xmlMemBlocks()) {
12518 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12519 xmlMemBlocks() - mem_base);
12521 printf(" %d", n_ctxt);
12522 printf(" %d", n_filename);
12535 test_xmlNanoHTTPScanProxy(void) {
12538 #if defined(LIBXML_HTTP_ENABLED)
12539 const char * URL; /* The proxy URL used to initialize the proxy context */
12542 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12543 URL = gen_filepath(n_URL, 0);
12545 xmlNanoHTTPScanProxy(URL);
12547 des_filepath(n_URL, URL, 0);
12548 xmlResetLastError();
12557 test_nanohttp(void) {
12560 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12561 test_ret += test_xmlNanoHTTPAuthHeader();
12562 test_ret += test_xmlNanoHTTPCleanup();
12563 test_ret += test_xmlNanoHTTPContentLength();
12564 test_ret += test_xmlNanoHTTPEncoding();
12565 test_ret += test_xmlNanoHTTPFetch();
12566 test_ret += test_xmlNanoHTTPInit();
12567 test_ret += test_xmlNanoHTTPMimeType();
12568 test_ret += test_xmlNanoHTTPOpen();
12569 test_ret += test_xmlNanoHTTPOpenRedir();
12570 test_ret += test_xmlNanoHTTPRead();
12571 test_ret += test_xmlNanoHTTPRedir();
12572 test_ret += test_xmlNanoHTTPReturnCode();
12573 test_ret += test_xmlNanoHTTPSave();
12574 test_ret += test_xmlNanoHTTPScanProxy();
12577 printf("Module nanohttp: %d errors\n", test_ret);
12582 test_xmlByteConsumed(void) {
12587 xmlParserCtxtPtr ctxt; /* an XML parser context */
12590 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12591 mem_base = xmlMemBlocks();
12592 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12594 ret_val = xmlByteConsumed(ctxt);
12595 desret_long(ret_val);
12597 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12598 xmlResetLastError();
12599 if (mem_base != xmlMemBlocks()) {
12600 printf("Leak of %d blocks found in xmlByteConsumed",
12601 xmlMemBlocks() - mem_base);
12603 printf(" %d", n_ctxt);
12614 test_xmlClearNodeInfoSeq(void) {
12618 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12621 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12622 mem_base = xmlMemBlocks();
12623 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12625 xmlClearNodeInfoSeq(seq);
12627 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12628 xmlResetLastError();
12629 if (mem_base != xmlMemBlocks()) {
12630 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12631 xmlMemBlocks() - mem_base);
12633 printf(" %d", n_seq);
12644 test_xmlClearParserCtxt(void) {
12648 xmlParserCtxtPtr ctxt; /* an XML parser context */
12651 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12652 mem_base = xmlMemBlocks();
12653 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12655 xmlClearParserCtxt(ctxt);
12657 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12658 xmlResetLastError();
12659 if (mem_base != xmlMemBlocks()) {
12660 printf("Leak of %d blocks found in xmlClearParserCtxt",
12661 xmlMemBlocks() - mem_base);
12663 printf(" %d", n_ctxt);
12674 test_xmlCreateDocParserCtxt(void) {
12678 xmlParserCtxtPtr ret_val;
12679 xmlChar * cur; /* a pointer to an array of xmlChar */
12682 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12683 mem_base = xmlMemBlocks();
12684 cur = gen_const_xmlChar_ptr(n_cur, 0);
12686 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12687 desret_xmlParserCtxtPtr(ret_val);
12689 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12690 xmlResetLastError();
12691 if (mem_base != xmlMemBlocks()) {
12692 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12693 xmlMemBlocks() - mem_base);
12695 printf(" %d", n_cur);
12706 test_xmlCreatePushParserCtxt(void) {
12709 #if defined(LIBXML_PUSH_ENABLED)
12711 xmlParserCtxtPtr ret_val;
12712 xmlSAXHandlerPtr sax; /* a SAX handler */
12714 void * user_data; /* The user data returned on SAX callbacks */
12716 char * chunk; /* a pointer to an array of chars */
12718 int size; /* number of chars in the array */
12720 const char * filename; /* an optional file name or URI */
12723 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12724 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12725 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12726 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12727 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12728 mem_base = xmlMemBlocks();
12729 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12730 user_data = gen_userdata(n_user_data, 1);
12731 chunk = gen_const_char_ptr(n_chunk, 2);
12732 size = gen_int(n_size, 3);
12733 filename = gen_fileoutput(n_filename, 4);
12735 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12736 desret_xmlParserCtxtPtr(ret_val);
12738 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12739 des_userdata(n_user_data, user_data, 1);
12740 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12741 des_int(n_size, size, 3);
12742 des_fileoutput(n_filename, filename, 4);
12743 xmlResetLastError();
12744 if (mem_base != xmlMemBlocks()) {
12745 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12746 xmlMemBlocks() - mem_base);
12748 printf(" %d", n_sax);
12749 printf(" %d", n_user_data);
12750 printf(" %d", n_chunk);
12751 printf(" %d", n_size);
12752 printf(" %d", n_filename);
12768 test_xmlCtxtReadDoc(void) {
12773 xmlParserCtxtPtr ctxt; /* an XML parser context */
12775 xmlChar * cur; /* a pointer to a zero terminated string */
12777 const char * URL; /* the base URL to use for the document */
12779 char * encoding; /* the document encoding, or NULL */
12781 int options; /* a combination of xmlParserOption */
12784 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12785 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12786 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12787 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12788 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12789 mem_base = xmlMemBlocks();
12790 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12791 cur = gen_const_xmlChar_ptr(n_cur, 1);
12792 URL = gen_filepath(n_URL, 2);
12793 encoding = gen_const_char_ptr(n_encoding, 3);
12794 options = gen_parseroptions(n_options, 4);
12796 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12797 desret_xmlDocPtr(ret_val);
12799 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12800 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12801 des_filepath(n_URL, URL, 2);
12802 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12803 des_parseroptions(n_options, options, 4);
12804 xmlResetLastError();
12805 if (mem_base != xmlMemBlocks()) {
12806 printf("Leak of %d blocks found in xmlCtxtReadDoc",
12807 xmlMemBlocks() - mem_base);
12809 printf(" %d", n_ctxt);
12810 printf(" %d", n_cur);
12811 printf(" %d", n_URL);
12812 printf(" %d", n_encoding);
12813 printf(" %d", n_options);
12828 test_xmlCtxtReadFile(void) {
12833 xmlParserCtxtPtr ctxt; /* an XML parser context */
12835 const char * filename; /* a file or URL */
12837 char * encoding; /* the document encoding, or NULL */
12839 int options; /* a combination of xmlParserOption */
12842 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12843 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12844 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12845 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12846 mem_base = xmlMemBlocks();
12847 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12848 filename = gen_filepath(n_filename, 1);
12849 encoding = gen_const_char_ptr(n_encoding, 2);
12850 options = gen_parseroptions(n_options, 3);
12852 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12853 desret_xmlDocPtr(ret_val);
12855 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12856 des_filepath(n_filename, filename, 1);
12857 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12858 des_parseroptions(n_options, options, 3);
12859 xmlResetLastError();
12860 if (mem_base != xmlMemBlocks()) {
12861 printf("Leak of %d blocks found in xmlCtxtReadFile",
12862 xmlMemBlocks() - mem_base);
12864 printf(" %d", n_ctxt);
12865 printf(" %d", n_filename);
12866 printf(" %d", n_encoding);
12867 printf(" %d", n_options);
12881 test_xmlCtxtReadMemory(void) {
12886 xmlParserCtxtPtr ctxt; /* an XML parser context */
12888 char * buffer; /* a pointer to a char array */
12890 int size; /* the size of the array */
12892 const char * URL; /* the base URL to use for the document */
12894 char * encoding; /* the document encoding, or NULL */
12896 int options; /* a combination of xmlParserOption */
12899 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12900 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12901 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12902 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12903 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12904 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12905 mem_base = xmlMemBlocks();
12906 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12907 buffer = gen_const_char_ptr(n_buffer, 1);
12908 size = gen_int(n_size, 2);
12909 URL = gen_filepath(n_URL, 3);
12910 encoding = gen_const_char_ptr(n_encoding, 4);
12911 options = gen_parseroptions(n_options, 5);
12913 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12914 desret_xmlDocPtr(ret_val);
12916 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12917 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12918 des_int(n_size, size, 2);
12919 des_filepath(n_URL, URL, 3);
12920 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12921 des_parseroptions(n_options, options, 5);
12922 xmlResetLastError();
12923 if (mem_base != xmlMemBlocks()) {
12924 printf("Leak of %d blocks found in xmlCtxtReadMemory",
12925 xmlMemBlocks() - mem_base);
12927 printf(" %d", n_ctxt);
12928 printf(" %d", n_buffer);
12929 printf(" %d", n_size);
12930 printf(" %d", n_URL);
12931 printf(" %d", n_encoding);
12932 printf(" %d", n_options);
12948 test_xmlCtxtReset(void) {
12952 xmlParserCtxtPtr ctxt; /* an XML parser context */
12955 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12956 mem_base = xmlMemBlocks();
12957 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12959 xmlCtxtReset(ctxt);
12961 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12962 xmlResetLastError();
12963 if (mem_base != xmlMemBlocks()) {
12964 printf("Leak of %d blocks found in xmlCtxtReset",
12965 xmlMemBlocks() - mem_base);
12967 printf(" %d", n_ctxt);
12978 test_xmlCtxtResetPush(void) {
12983 xmlParserCtxtPtr ctxt; /* an XML parser context */
12985 char * chunk; /* a pointer to an array of chars */
12987 int size; /* number of chars in the array */
12989 const char * filename; /* an optional file name or URI */
12991 char * encoding; /* the document encoding, or NULL */
12994 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12995 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12996 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12997 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12998 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12999 mem_base = xmlMemBlocks();
13000 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13001 chunk = gen_const_char_ptr(n_chunk, 1);
13002 size = gen_int(n_size, 2);
13003 filename = gen_filepath(n_filename, 3);
13004 encoding = gen_const_char_ptr(n_encoding, 4);
13006 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13007 desret_int(ret_val);
13009 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13010 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13011 des_int(n_size, size, 2);
13012 des_filepath(n_filename, filename, 3);
13013 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13014 xmlResetLastError();
13015 if (mem_base != xmlMemBlocks()) {
13016 printf("Leak of %d blocks found in xmlCtxtResetPush",
13017 xmlMemBlocks() - mem_base);
13019 printf(" %d", n_ctxt);
13020 printf(" %d", n_chunk);
13021 printf(" %d", n_size);
13022 printf(" %d", n_filename);
13023 printf(" %d", n_encoding);
13038 test_xmlCtxtUseOptions(void) {
13043 xmlParserCtxtPtr ctxt; /* an XML parser context */
13045 int options; /* a combination of xmlParserOption */
13048 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13049 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13050 mem_base = xmlMemBlocks();
13051 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13052 options = gen_parseroptions(n_options, 1);
13054 ret_val = xmlCtxtUseOptions(ctxt, options);
13055 desret_int(ret_val);
13057 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13058 des_parseroptions(n_options, options, 1);
13059 xmlResetLastError();
13060 if (mem_base != xmlMemBlocks()) {
13061 printf("Leak of %d blocks found in xmlCtxtUseOptions",
13062 xmlMemBlocks() - mem_base);
13064 printf(" %d", n_ctxt);
13065 printf(" %d", n_options);
13077 test_xmlGetExternalEntityLoader(void) {
13081 /* missing type support */
13087 test_xmlGetFeature(void) {
13090 #if defined(LIBXML_LEGACY_ENABLED)
13091 #ifdef LIBXML_LEGACY_ENABLED
13094 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13096 char * name; /* the feature name */
13098 void * result; /* location to store the result */
13101 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13102 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13103 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13104 mem_base = xmlMemBlocks();
13105 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13106 name = gen_const_char_ptr(n_name, 1);
13107 result = gen_void_ptr(n_result, 2);
13109 ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13110 desret_int(ret_val);
13112 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13113 des_const_char_ptr(n_name, (const char *)name, 1);
13114 des_void_ptr(n_result, result, 2);
13115 xmlResetLastError();
13116 if (mem_base != xmlMemBlocks()) {
13117 printf("Leak of %d blocks found in xmlGetFeature",
13118 xmlMemBlocks() - mem_base);
13120 printf(" %d", n_ctxt);
13121 printf(" %d", n_name);
13122 printf(" %d", n_result);
13136 #define gen_nb_const_char_ptr_ptr 1
13137 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13140 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13144 test_xmlGetFeaturesList(void) {
13147 #if defined(LIBXML_LEGACY_ENABLED)
13148 #ifdef LIBXML_LEGACY_ENABLED
13151 int * len; /* the length of the features name array (input/output) */
13153 char ** result; /* an array of string to be filled with the features name. */
13156 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13157 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13158 mem_base = xmlMemBlocks();
13159 len = gen_int_ptr(n_len, 0);
13160 result = gen_const_char_ptr_ptr(n_result, 1);
13162 ret_val = xmlGetFeaturesList(len, (const char **)result);
13163 desret_int(ret_val);
13165 des_int_ptr(n_len, len, 0);
13166 des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13167 xmlResetLastError();
13168 if (mem_base != xmlMemBlocks()) {
13169 printf("Leak of %d blocks found in xmlGetFeaturesList",
13170 xmlMemBlocks() - mem_base);
13172 printf(" %d", n_len);
13173 printf(" %d", n_result);
13187 test_xmlHasFeature(void) {
13192 xmlFeature feature; /* the feature to be examined */
13195 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13196 mem_base = xmlMemBlocks();
13197 feature = gen_xmlFeature(n_feature, 0);
13199 ret_val = xmlHasFeature(feature);
13200 desret_int(ret_val);
13202 des_xmlFeature(n_feature, feature, 0);
13203 xmlResetLastError();
13204 if (mem_base != xmlMemBlocks()) {
13205 printf("Leak of %d blocks found in xmlHasFeature",
13206 xmlMemBlocks() - mem_base);
13208 printf(" %d", n_feature);
13219 test_xmlIOParseDTD(void) {
13222 #if defined(LIBXML_VALID_ENABLED)
13223 #ifdef LIBXML_VALID_ENABLED
13225 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13227 xmlParserInputBufferPtr input; /* an Input Buffer */
13229 xmlCharEncoding enc; /* the charset encoding if known */
13232 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13233 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13234 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13235 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13236 input = gen_xmlParserInputBufferPtr(n_input, 1);
13237 enc = gen_xmlCharEncoding(n_enc, 2);
13239 ret_val = xmlIOParseDTD(sax, input, enc);
13241 desret_xmlDtdPtr(ret_val);
13243 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13244 des_xmlParserInputBufferPtr(n_input, input, 1);
13245 des_xmlCharEncoding(n_enc, enc, 2);
13246 xmlResetLastError();
13259 test_xmlInitNodeInfoSeq(void) {
13263 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13266 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13267 mem_base = xmlMemBlocks();
13268 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13270 xmlInitNodeInfoSeq(seq);
13272 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13273 xmlResetLastError();
13274 if (mem_base != xmlMemBlocks()) {
13275 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13276 xmlMemBlocks() - mem_base);
13278 printf(" %d", n_seq);
13289 test_xmlInitParser(void) {
13294 mem_base = xmlMemBlocks();
13298 xmlResetLastError();
13299 if (mem_base != xmlMemBlocks()) {
13300 printf("Leak of %d blocks found in xmlInitParser",
13301 xmlMemBlocks() - mem_base);
13312 test_xmlInitParserCtxt(void) {
13317 xmlParserCtxtPtr ctxt; /* an XML parser context */
13320 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13321 mem_base = xmlMemBlocks();
13322 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13324 ret_val = xmlInitParserCtxt(ctxt);
13325 desret_int(ret_val);
13327 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13328 xmlResetLastError();
13329 if (mem_base != xmlMemBlocks()) {
13330 printf("Leak of %d blocks found in xmlInitParserCtxt",
13331 xmlMemBlocks() - mem_base);
13333 printf(" %d", n_ctxt);
13344 test_xmlKeepBlanksDefault(void) {
13349 int val; /* int 0 or 1 */
13352 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13353 mem_base = xmlMemBlocks();
13354 val = gen_int(n_val, 0);
13356 ret_val = xmlKeepBlanksDefault(val);
13357 desret_int(ret_val);
13359 des_int(n_val, val, 0);
13360 xmlResetLastError();
13361 if (mem_base != xmlMemBlocks()) {
13362 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13363 xmlMemBlocks() - mem_base);
13365 printf(" %d", n_val);
13376 test_xmlLineNumbersDefault(void) {
13381 int val; /* int 0 or 1 */
13384 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13385 mem_base = xmlMemBlocks();
13386 val = gen_int(n_val, 0);
13388 ret_val = xmlLineNumbersDefault(val);
13389 desret_int(ret_val);
13391 des_int(n_val, val, 0);
13392 xmlResetLastError();
13393 if (mem_base != xmlMemBlocks()) {
13394 printf("Leak of %d blocks found in xmlLineNumbersDefault",
13395 xmlMemBlocks() - mem_base);
13397 printf(" %d", n_val);
13408 test_xmlLoadExternalEntity(void) {
13412 xmlParserInputPtr ret_val;
13413 const char * URL; /* the URL for the entity to load */
13415 char * ID; /* the Public ID for the entity to load */
13417 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13420 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13421 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13422 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13423 mem_base = xmlMemBlocks();
13424 URL = gen_filepath(n_URL, 0);
13425 ID = gen_const_char_ptr(n_ID, 1);
13426 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13428 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13429 desret_xmlParserInputPtr(ret_val);
13431 des_filepath(n_URL, URL, 0);
13432 des_const_char_ptr(n_ID, (const char *)ID, 1);
13433 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13434 xmlResetLastError();
13435 if (mem_base != xmlMemBlocks()) {
13436 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13437 xmlMemBlocks() - mem_base);
13439 printf(" %d", n_URL);
13440 printf(" %d", n_ID);
13441 printf(" %d", n_ctxt);
13454 test_xmlNewIOInputStream(void) {
13458 xmlParserInputPtr ret_val;
13459 xmlParserCtxtPtr ctxt; /* an XML parser context */
13461 xmlParserInputBufferPtr input; /* an I/O Input */
13463 xmlCharEncoding enc; /* the charset encoding if known */
13466 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13467 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13468 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13469 mem_base = xmlMemBlocks();
13470 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13471 input = gen_xmlParserInputBufferPtr(n_input, 1);
13472 enc = gen_xmlCharEncoding(n_enc, 2);
13474 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13475 if (ret_val != NULL) input = NULL;
13476 desret_xmlParserInputPtr(ret_val);
13478 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13479 des_xmlParserInputBufferPtr(n_input, input, 1);
13480 des_xmlCharEncoding(n_enc, enc, 2);
13481 xmlResetLastError();
13482 if (mem_base != xmlMemBlocks()) {
13483 printf("Leak of %d blocks found in xmlNewIOInputStream",
13484 xmlMemBlocks() - mem_base);
13486 printf(" %d", n_ctxt);
13487 printf(" %d", n_input);
13488 printf(" %d", n_enc);
13501 test_xmlNewParserCtxt(void) {
13505 xmlParserCtxtPtr ret_val;
13507 mem_base = xmlMemBlocks();
13509 ret_val = xmlNewParserCtxt();
13510 desret_xmlParserCtxtPtr(ret_val);
13512 xmlResetLastError();
13513 if (mem_base != xmlMemBlocks()) {
13514 printf("Leak of %d blocks found in xmlNewParserCtxt",
13515 xmlMemBlocks() - mem_base);
13525 #define gen_nb_xmlNodePtr_ptr 1
13526 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13529 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13533 test_xmlParseBalancedChunkMemory(void) {
13536 #if defined(LIBXML_SAX1_ENABLED)
13537 #ifdef LIBXML_SAX1_ENABLED
13540 xmlDocPtr doc; /* the document the chunk pertains to */
13542 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13544 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13546 int depth; /* Used for loop detection, use 0 */
13548 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13550 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13553 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13554 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13555 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13556 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13557 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13558 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13559 mem_base = xmlMemBlocks();
13560 doc = gen_xmlDocPtr(n_doc, 0);
13561 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13562 user_data = gen_userdata(n_user_data, 2);
13563 depth = gen_int(n_depth, 3);
13564 string = gen_const_xmlChar_ptr(n_string, 4);
13565 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13567 #ifdef LIBXML_SAX1_ENABLED
13568 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13572 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13573 desret_int(ret_val);
13575 des_xmlDocPtr(n_doc, doc, 0);
13576 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13577 des_userdata(n_user_data, user_data, 2);
13578 des_int(n_depth, depth, 3);
13579 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13580 des_xmlNodePtr_ptr(n_lst, lst, 5);
13581 xmlResetLastError();
13582 if (mem_base != xmlMemBlocks()) {
13583 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13584 xmlMemBlocks() - mem_base);
13586 printf(" %d", n_doc);
13587 printf(" %d", n_sax);
13588 printf(" %d", n_user_data);
13589 printf(" %d", n_depth);
13590 printf(" %d", n_string);
13591 printf(" %d", n_lst);
13609 test_xmlParseBalancedChunkMemoryRecover(void) {
13612 #if defined(LIBXML_SAX1_ENABLED)
13613 #ifdef LIBXML_SAX1_ENABLED
13616 xmlDocPtr doc; /* the document the chunk pertains to */
13618 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13620 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13622 int depth; /* Used for loop detection, use 0 */
13624 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13626 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13628 int recover; /* return nodes even if the data is broken (use 0) */
13631 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13632 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13633 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13634 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13635 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13636 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13637 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13638 mem_base = xmlMemBlocks();
13639 doc = gen_xmlDocPtr(n_doc, 0);
13640 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13641 user_data = gen_userdata(n_user_data, 2);
13642 depth = gen_int(n_depth, 3);
13643 string = gen_const_xmlChar_ptr(n_string, 4);
13644 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13645 recover = gen_int(n_recover, 6);
13647 #ifdef LIBXML_SAX1_ENABLED
13648 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13652 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13653 desret_int(ret_val);
13655 des_xmlDocPtr(n_doc, doc, 0);
13656 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13657 des_userdata(n_user_data, user_data, 2);
13658 des_int(n_depth, depth, 3);
13659 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13660 des_xmlNodePtr_ptr(n_lst, lst, 5);
13661 des_int(n_recover, recover, 6);
13662 xmlResetLastError();
13663 if (mem_base != xmlMemBlocks()) {
13664 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13665 xmlMemBlocks() - mem_base);
13667 printf(" %d", n_doc);
13668 printf(" %d", n_sax);
13669 printf(" %d", n_user_data);
13670 printf(" %d", n_depth);
13671 printf(" %d", n_string);
13672 printf(" %d", n_lst);
13673 printf(" %d", n_recover);
13692 test_xmlParseChunk(void) {
13695 #if defined(LIBXML_PUSH_ENABLED)
13698 xmlParserCtxtPtr ctxt; /* an XML parser context */
13700 char * chunk; /* an char array */
13702 int size; /* the size in byte of the chunk */
13704 int terminate; /* last chunk indicator */
13707 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13708 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13709 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13710 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13711 mem_base = xmlMemBlocks();
13712 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13713 chunk = gen_const_char_ptr(n_chunk, 1);
13714 size = gen_int(n_size, 2);
13715 terminate = gen_int(n_terminate, 3);
13717 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13718 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13719 desret_int(ret_val);
13721 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13722 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13723 des_int(n_size, size, 2);
13724 des_int(n_terminate, terminate, 3);
13725 xmlResetLastError();
13726 if (mem_base != xmlMemBlocks()) {
13727 printf("Leak of %d blocks found in xmlParseChunk",
13728 xmlMemBlocks() - mem_base);
13730 printf(" %d", n_ctxt);
13731 printf(" %d", n_chunk);
13732 printf(" %d", n_size);
13733 printf(" %d", n_terminate);
13748 test_xmlParseCtxtExternalEntity(void) {
13753 xmlParserCtxtPtr ctx; /* the existing parsing context */
13755 xmlChar * URL; /* the URL for the entity to load */
13757 xmlChar * ID; /* the System ID for the entity to load */
13759 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13762 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13763 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13764 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13765 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13766 mem_base = xmlMemBlocks();
13767 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13768 URL = gen_const_xmlChar_ptr(n_URL, 1);
13769 ID = gen_const_xmlChar_ptr(n_ID, 2);
13770 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13772 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13773 desret_int(ret_val);
13775 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13776 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13777 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13778 des_xmlNodePtr_ptr(n_lst, lst, 3);
13779 xmlResetLastError();
13780 if (mem_base != xmlMemBlocks()) {
13781 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13782 xmlMemBlocks() - mem_base);
13784 printf(" %d", n_ctx);
13785 printf(" %d", n_URL);
13786 printf(" %d", n_ID);
13787 printf(" %d", n_lst);
13801 test_xmlParseDTD(void) {
13804 #if defined(LIBXML_VALID_ENABLED)
13805 #ifdef LIBXML_VALID_ENABLED
13808 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13810 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13813 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13814 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13815 mem_base = xmlMemBlocks();
13816 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13817 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13819 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13820 desret_xmlDtdPtr(ret_val);
13822 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13823 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13824 xmlResetLastError();
13825 if (mem_base != xmlMemBlocks()) {
13826 printf("Leak of %d blocks found in xmlParseDTD",
13827 xmlMemBlocks() - mem_base);
13829 printf(" %d", n_ExternalID);
13830 printf(" %d", n_SystemID);
13844 test_xmlParseDoc(void) {
13847 #if defined(LIBXML_SAX1_ENABLED)
13848 #ifdef LIBXML_SAX1_ENABLED
13851 xmlChar * cur; /* a pointer to an array of xmlChar */
13854 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13855 mem_base = xmlMemBlocks();
13856 cur = gen_const_xmlChar_ptr(n_cur, 0);
13858 ret_val = xmlParseDoc((const xmlChar *)cur);
13859 desret_xmlDocPtr(ret_val);
13861 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13862 xmlResetLastError();
13863 if (mem_base != xmlMemBlocks()) {
13864 printf("Leak of %d blocks found in xmlParseDoc",
13865 xmlMemBlocks() - mem_base);
13867 printf(" %d", n_cur);
13880 test_xmlParseDocument(void) {
13885 xmlParserCtxtPtr ctxt; /* an XML parser context */
13888 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13889 mem_base = xmlMemBlocks();
13890 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13892 ret_val = xmlParseDocument(ctxt);
13893 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13894 desret_int(ret_val);
13896 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13897 xmlResetLastError();
13898 if (mem_base != xmlMemBlocks()) {
13899 printf("Leak of %d blocks found in xmlParseDocument",
13900 xmlMemBlocks() - mem_base);
13902 printf(" %d", n_ctxt);
13913 test_xmlParseEntity(void) {
13916 #if defined(LIBXML_SAX1_ENABLED)
13917 #ifdef LIBXML_SAX1_ENABLED
13920 const char * filename; /* the filename */
13923 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13924 mem_base = xmlMemBlocks();
13925 filename = gen_filepath(n_filename, 0);
13927 ret_val = xmlParseEntity(filename);
13928 desret_xmlDocPtr(ret_val);
13930 des_filepath(n_filename, filename, 0);
13931 xmlResetLastError();
13932 if (mem_base != xmlMemBlocks()) {
13933 printf("Leak of %d blocks found in xmlParseEntity",
13934 xmlMemBlocks() - mem_base);
13936 printf(" %d", n_filename);
13949 test_xmlParseExtParsedEnt(void) {
13954 xmlParserCtxtPtr ctxt; /* an XML parser context */
13957 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13958 mem_base = xmlMemBlocks();
13959 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13961 ret_val = xmlParseExtParsedEnt(ctxt);
13962 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13963 desret_int(ret_val);
13965 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13966 xmlResetLastError();
13967 if (mem_base != xmlMemBlocks()) {
13968 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13969 xmlMemBlocks() - mem_base);
13971 printf(" %d", n_ctxt);
13982 test_xmlParseExternalEntity(void) {
13985 #if defined(LIBXML_SAX1_ENABLED)
13986 #ifdef LIBXML_SAX1_ENABLED
13989 xmlDocPtr doc; /* the document the chunk pertains to */
13991 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13993 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13995 int depth; /* Used for loop detection, use 0 */
13997 xmlChar * URL; /* the URL for the entity to load */
13999 xmlChar * ID; /* the System ID for the entity to load */
14001 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14004 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14005 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14006 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14007 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14008 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14009 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14010 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14011 mem_base = xmlMemBlocks();
14012 doc = gen_xmlDocPtr(n_doc, 0);
14013 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14014 user_data = gen_userdata(n_user_data, 2);
14015 depth = gen_int(n_depth, 3);
14016 URL = gen_const_xmlChar_ptr(n_URL, 4);
14017 ID = gen_const_xmlChar_ptr(n_ID, 5);
14018 lst = gen_xmlNodePtr_ptr(n_lst, 6);
14020 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14021 desret_int(ret_val);
14023 des_xmlDocPtr(n_doc, doc, 0);
14024 des_xmlSAXHandlerPtr(n_sax, sax, 1);
14025 des_userdata(n_user_data, user_data, 2);
14026 des_int(n_depth, depth, 3);
14027 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14028 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14029 des_xmlNodePtr_ptr(n_lst, lst, 6);
14030 xmlResetLastError();
14031 if (mem_base != xmlMemBlocks()) {
14032 printf("Leak of %d blocks found in xmlParseExternalEntity",
14033 xmlMemBlocks() - mem_base);
14035 printf(" %d", n_doc);
14036 printf(" %d", n_sax);
14037 printf(" %d", n_user_data);
14038 printf(" %d", n_depth);
14039 printf(" %d", n_URL);
14040 printf(" %d", n_ID);
14041 printf(" %d", n_lst);
14060 test_xmlParseFile(void) {
14063 #if defined(LIBXML_SAX1_ENABLED)
14064 #ifdef LIBXML_SAX1_ENABLED
14067 const char * filename; /* the filename */
14070 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14071 mem_base = xmlMemBlocks();
14072 filename = gen_filepath(n_filename, 0);
14074 ret_val = xmlParseFile(filename);
14075 desret_xmlDocPtr(ret_val);
14077 des_filepath(n_filename, filename, 0);
14078 xmlResetLastError();
14079 if (mem_base != xmlMemBlocks()) {
14080 printf("Leak of %d blocks found in xmlParseFile",
14081 xmlMemBlocks() - mem_base);
14083 printf(" %d", n_filename);
14096 test_xmlParseInNodeContext(void) {
14100 xmlParserErrors ret_val;
14101 xmlNodePtr node; /* the context node */
14103 char * data; /* the input string */
14105 int datalen; /* the input string length in bytes */
14107 int options; /* a combination of xmlParserOption */
14109 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14112 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14113 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14114 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14115 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14116 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14117 mem_base = xmlMemBlocks();
14118 node = gen_xmlNodePtr(n_node, 0);
14119 data = gen_const_char_ptr(n_data, 1);
14120 datalen = gen_int(n_datalen, 2);
14121 options = gen_parseroptions(n_options, 3);
14122 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14124 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14125 desret_xmlParserErrors(ret_val);
14127 des_xmlNodePtr(n_node, node, 0);
14128 des_const_char_ptr(n_data, (const char *)data, 1);
14129 des_int(n_datalen, datalen, 2);
14130 des_parseroptions(n_options, options, 3);
14131 des_xmlNodePtr_ptr(n_lst, lst, 4);
14132 xmlResetLastError();
14133 if (mem_base != xmlMemBlocks()) {
14134 printf("Leak of %d blocks found in xmlParseInNodeContext",
14135 xmlMemBlocks() - mem_base);
14137 printf(" %d", n_node);
14138 printf(" %d", n_data);
14139 printf(" %d", n_datalen);
14140 printf(" %d", n_options);
14141 printf(" %d", n_lst);
14156 test_xmlParseMemory(void) {
14159 #if defined(LIBXML_SAX1_ENABLED)
14160 #ifdef LIBXML_SAX1_ENABLED
14163 char * buffer; /* an pointer to a char array */
14165 int size; /* the size of the array */
14168 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14169 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14170 mem_base = xmlMemBlocks();
14171 buffer = gen_const_char_ptr(n_buffer, 0);
14172 size = gen_int(n_size, 1);
14174 ret_val = xmlParseMemory((const char *)buffer, size);
14175 desret_xmlDocPtr(ret_val);
14177 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14178 des_int(n_size, size, 1);
14179 xmlResetLastError();
14180 if (mem_base != xmlMemBlocks()) {
14181 printf("Leak of %d blocks found in xmlParseMemory",
14182 xmlMemBlocks() - mem_base);
14184 printf(" %d", n_buffer);
14185 printf(" %d", n_size);
14198 #define gen_nb_const_xmlParserNodeInfoPtr 1
14199 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14202 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14206 test_xmlParserAddNodeInfo(void) {
14210 xmlParserCtxtPtr ctxt; /* an XML parser context */
14212 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14215 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14216 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14217 mem_base = xmlMemBlocks();
14218 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14219 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14221 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14223 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14224 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14225 xmlResetLastError();
14226 if (mem_base != xmlMemBlocks()) {
14227 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14228 xmlMemBlocks() - mem_base);
14230 printf(" %d", n_ctxt);
14231 printf(" %d", n_info);
14242 #define gen_nb_const_xmlParserCtxtPtr 1
14243 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14246 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14249 #define gen_nb_const_xmlNodePtr 1
14250 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14253 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14257 test_xmlParserFindNodeInfo(void) {
14261 const xmlParserNodeInfo * ret_val;
14262 xmlParserCtxtPtr ctx; /* an XML parser context */
14264 xmlNodePtr node; /* an XML node within the tree */
14267 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14268 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14269 mem_base = xmlMemBlocks();
14270 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14271 node = gen_const_xmlNodePtr(n_node, 1);
14273 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14274 desret_const_xmlParserNodeInfo_ptr(ret_val);
14276 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14277 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14278 xmlResetLastError();
14279 if (mem_base != xmlMemBlocks()) {
14280 printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14281 xmlMemBlocks() - mem_base);
14283 printf(" %d", n_ctx);
14284 printf(" %d", n_node);
14295 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14296 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14299 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14303 test_xmlParserFindNodeInfoIndex(void) {
14307 unsigned long ret_val;
14308 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14310 xmlNodePtr node; /* an XML node pointer */
14313 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14314 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14315 mem_base = xmlMemBlocks();
14316 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14317 node = gen_const_xmlNodePtr(n_node, 1);
14319 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14320 desret_unsigned_long(ret_val);
14322 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14323 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14324 xmlResetLastError();
14325 if (mem_base != xmlMemBlocks()) {
14326 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14327 xmlMemBlocks() - mem_base);
14329 printf(" %d", n_seq);
14330 printf(" %d", n_node);
14341 #define gen_nb_xmlParserInputPtr 1
14342 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14345 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14349 test_xmlParserInputGrow(void) {
14354 xmlParserInputPtr in; /* an XML parser input */
14356 int len; /* an indicative size for the lookahead */
14359 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14360 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14361 mem_base = xmlMemBlocks();
14362 in = gen_xmlParserInputPtr(n_in, 0);
14363 len = gen_int(n_len, 1);
14365 ret_val = xmlParserInputGrow(in, len);
14366 desret_int(ret_val);
14368 des_xmlParserInputPtr(n_in, in, 0);
14369 des_int(n_len, len, 1);
14370 xmlResetLastError();
14371 if (mem_base != xmlMemBlocks()) {
14372 printf("Leak of %d blocks found in xmlParserInputGrow",
14373 xmlMemBlocks() - mem_base);
14375 printf(" %d", n_in);
14376 printf(" %d", n_len);
14388 test_xmlParserInputRead(void) {
14393 xmlParserInputPtr in; /* an XML parser input */
14395 int len; /* an indicative size for the lookahead */
14398 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14399 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14400 mem_base = xmlMemBlocks();
14401 in = gen_xmlParserInputPtr(n_in, 0);
14402 len = gen_int(n_len, 1);
14404 ret_val = xmlParserInputRead(in, len);
14405 desret_int(ret_val);
14407 des_xmlParserInputPtr(n_in, in, 0);
14408 des_int(n_len, len, 1);
14409 xmlResetLastError();
14410 if (mem_base != xmlMemBlocks()) {
14411 printf("Leak of %d blocks found in xmlParserInputRead",
14412 xmlMemBlocks() - mem_base);
14414 printf(" %d", n_in);
14415 printf(" %d", n_len);
14427 test_xmlPedanticParserDefault(void) {
14432 int val; /* int 0 or 1 */
14435 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14436 mem_base = xmlMemBlocks();
14437 val = gen_int(n_val, 0);
14439 ret_val = xmlPedanticParserDefault(val);
14440 desret_int(ret_val);
14442 des_int(n_val, val, 0);
14443 xmlResetLastError();
14444 if (mem_base != xmlMemBlocks()) {
14445 printf("Leak of %d blocks found in xmlPedanticParserDefault",
14446 xmlMemBlocks() - mem_base);
14448 printf(" %d", n_val);
14459 test_xmlReadDoc(void) {
14464 xmlChar * cur; /* a pointer to a zero terminated string */
14466 const char * URL; /* the base URL to use for the document */
14468 char * encoding; /* the document encoding, or NULL */
14470 int options; /* a combination of xmlParserOption */
14473 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14474 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14475 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14476 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14477 mem_base = xmlMemBlocks();
14478 cur = gen_const_xmlChar_ptr(n_cur, 0);
14479 URL = gen_filepath(n_URL, 1);
14480 encoding = gen_const_char_ptr(n_encoding, 2);
14481 options = gen_parseroptions(n_options, 3);
14483 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14484 desret_xmlDocPtr(ret_val);
14486 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14487 des_filepath(n_URL, URL, 1);
14488 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14489 des_parseroptions(n_options, options, 3);
14490 xmlResetLastError();
14491 if (mem_base != xmlMemBlocks()) {
14492 printf("Leak of %d blocks found in xmlReadDoc",
14493 xmlMemBlocks() - mem_base);
14495 printf(" %d", n_cur);
14496 printf(" %d", n_URL);
14497 printf(" %d", n_encoding);
14498 printf(" %d", n_options);
14512 test_xmlReadFile(void) {
14517 const char * filename; /* a file or URL */
14519 char * encoding; /* the document encoding, or NULL */
14521 int options; /* a combination of xmlParserOption */
14524 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14525 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14526 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14527 mem_base = xmlMemBlocks();
14528 filename = gen_filepath(n_filename, 0);
14529 encoding = gen_const_char_ptr(n_encoding, 1);
14530 options = gen_parseroptions(n_options, 2);
14532 ret_val = xmlReadFile(filename, (const char *)encoding, options);
14533 desret_xmlDocPtr(ret_val);
14535 des_filepath(n_filename, filename, 0);
14536 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14537 des_parseroptions(n_options, options, 2);
14538 xmlResetLastError();
14539 if (mem_base != xmlMemBlocks()) {
14540 printf("Leak of %d blocks found in xmlReadFile",
14541 xmlMemBlocks() - mem_base);
14543 printf(" %d", n_filename);
14544 printf(" %d", n_encoding);
14545 printf(" %d", n_options);
14558 test_xmlReadMemory(void) {
14563 char * buffer; /* a pointer to a char array */
14565 int size; /* the size of the array */
14567 const char * URL; /* the base URL to use for the document */
14569 char * encoding; /* the document encoding, or NULL */
14571 int options; /* a combination of xmlParserOption */
14574 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14575 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14576 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14577 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14578 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14579 mem_base = xmlMemBlocks();
14580 buffer = gen_const_char_ptr(n_buffer, 0);
14581 size = gen_int(n_size, 1);
14582 URL = gen_filepath(n_URL, 2);
14583 encoding = gen_const_char_ptr(n_encoding, 3);
14584 options = gen_parseroptions(n_options, 4);
14586 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14587 desret_xmlDocPtr(ret_val);
14589 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14590 des_int(n_size, size, 1);
14591 des_filepath(n_URL, URL, 2);
14592 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14593 des_parseroptions(n_options, options, 4);
14594 xmlResetLastError();
14595 if (mem_base != xmlMemBlocks()) {
14596 printf("Leak of %d blocks found in xmlReadMemory",
14597 xmlMemBlocks() - mem_base);
14599 printf(" %d", n_buffer);
14600 printf(" %d", n_size);
14601 printf(" %d", n_URL);
14602 printf(" %d", n_encoding);
14603 printf(" %d", n_options);
14618 test_xmlRecoverDoc(void) {
14621 #if defined(LIBXML_SAX1_ENABLED)
14622 #ifdef LIBXML_SAX1_ENABLED
14625 xmlChar * cur; /* a pointer to an array of xmlChar */
14628 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14629 mem_base = xmlMemBlocks();
14630 cur = gen_const_xmlChar_ptr(n_cur, 0);
14632 ret_val = xmlRecoverDoc((const xmlChar *)cur);
14633 desret_xmlDocPtr(ret_val);
14635 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14636 xmlResetLastError();
14637 if (mem_base != xmlMemBlocks()) {
14638 printf("Leak of %d blocks found in xmlRecoverDoc",
14639 xmlMemBlocks() - mem_base);
14641 printf(" %d", n_cur);
14654 test_xmlRecoverFile(void) {
14657 #if defined(LIBXML_SAX1_ENABLED)
14658 #ifdef LIBXML_SAX1_ENABLED
14661 const char * filename; /* the filename */
14664 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14665 mem_base = xmlMemBlocks();
14666 filename = gen_filepath(n_filename, 0);
14668 ret_val = xmlRecoverFile(filename);
14669 desret_xmlDocPtr(ret_val);
14671 des_filepath(n_filename, filename, 0);
14672 xmlResetLastError();
14673 if (mem_base != xmlMemBlocks()) {
14674 printf("Leak of %d blocks found in xmlRecoverFile",
14675 xmlMemBlocks() - mem_base);
14677 printf(" %d", n_filename);
14690 test_xmlRecoverMemory(void) {
14693 #if defined(LIBXML_SAX1_ENABLED)
14694 #ifdef LIBXML_SAX1_ENABLED
14697 char * buffer; /* an pointer to a char array */
14699 int size; /* the size of the array */
14702 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14703 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14704 mem_base = xmlMemBlocks();
14705 buffer = gen_const_char_ptr(n_buffer, 0);
14706 size = gen_int(n_size, 1);
14708 ret_val = xmlRecoverMemory((const char *)buffer, size);
14709 desret_xmlDocPtr(ret_val);
14711 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14712 des_int(n_size, size, 1);
14713 xmlResetLastError();
14714 if (mem_base != xmlMemBlocks()) {
14715 printf("Leak of %d blocks found in xmlRecoverMemory",
14716 xmlMemBlocks() - mem_base);
14718 printf(" %d", n_buffer);
14719 printf(" %d", n_size);
14733 test_xmlSAXParseDTD(void) {
14736 #if defined(LIBXML_VALID_ENABLED)
14737 #ifdef LIBXML_SAX1_ENABLED
14740 xmlSAXHandlerPtr sax; /* the SAX handler block */
14742 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14744 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14747 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14748 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14749 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14750 mem_base = xmlMemBlocks();
14751 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14752 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14753 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14755 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14756 desret_xmlDtdPtr(ret_val);
14758 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14759 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14760 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14761 xmlResetLastError();
14762 if (mem_base != xmlMemBlocks()) {
14763 printf("Leak of %d blocks found in xmlSAXParseDTD",
14764 xmlMemBlocks() - mem_base);
14766 printf(" %d", n_sax);
14767 printf(" %d", n_ExternalID);
14768 printf(" %d", n_SystemID);
14783 test_xmlSAXParseDoc(void) {
14786 #if defined(LIBXML_SAX1_ENABLED)
14787 #ifdef LIBXML_SAX1_ENABLED
14790 xmlSAXHandlerPtr sax; /* the SAX handler block */
14792 xmlChar * cur; /* a pointer to an array of xmlChar */
14794 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14797 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14798 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14799 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14800 mem_base = xmlMemBlocks();
14801 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14802 cur = gen_const_xmlChar_ptr(n_cur, 1);
14803 recovery = gen_int(n_recovery, 2);
14805 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14806 desret_xmlDocPtr(ret_val);
14808 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14809 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14810 des_int(n_recovery, recovery, 2);
14811 xmlResetLastError();
14812 if (mem_base != xmlMemBlocks()) {
14813 printf("Leak of %d blocks found in xmlSAXParseDoc",
14814 xmlMemBlocks() - mem_base);
14816 printf(" %d", n_sax);
14817 printf(" %d", n_cur);
14818 printf(" %d", n_recovery);
14833 test_xmlSAXParseEntity(void) {
14836 #if defined(LIBXML_SAX1_ENABLED)
14837 #ifdef LIBXML_SAX1_ENABLED
14840 xmlSAXHandlerPtr sax; /* the SAX handler block */
14842 const char * filename; /* the filename */
14845 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14846 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14847 mem_base = xmlMemBlocks();
14848 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14849 filename = gen_filepath(n_filename, 1);
14851 ret_val = xmlSAXParseEntity(sax, filename);
14852 desret_xmlDocPtr(ret_val);
14854 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14855 des_filepath(n_filename, filename, 1);
14856 xmlResetLastError();
14857 if (mem_base != xmlMemBlocks()) {
14858 printf("Leak of %d blocks found in xmlSAXParseEntity",
14859 xmlMemBlocks() - mem_base);
14861 printf(" %d", n_sax);
14862 printf(" %d", n_filename);
14876 test_xmlSAXParseFile(void) {
14879 #if defined(LIBXML_SAX1_ENABLED)
14880 #ifdef LIBXML_SAX1_ENABLED
14883 xmlSAXHandlerPtr sax; /* the SAX handler block */
14885 const char * filename; /* the filename */
14887 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14890 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14891 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14892 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14893 mem_base = xmlMemBlocks();
14894 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14895 filename = gen_filepath(n_filename, 1);
14896 recovery = gen_int(n_recovery, 2);
14898 ret_val = xmlSAXParseFile(sax, filename, recovery);
14899 desret_xmlDocPtr(ret_val);
14901 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14902 des_filepath(n_filename, filename, 1);
14903 des_int(n_recovery, recovery, 2);
14904 xmlResetLastError();
14905 if (mem_base != xmlMemBlocks()) {
14906 printf("Leak of %d blocks found in xmlSAXParseFile",
14907 xmlMemBlocks() - mem_base);
14909 printf(" %d", n_sax);
14910 printf(" %d", n_filename);
14911 printf(" %d", n_recovery);
14926 test_xmlSAXParseFileWithData(void) {
14929 #if defined(LIBXML_SAX1_ENABLED)
14930 #ifdef LIBXML_SAX1_ENABLED
14933 xmlSAXHandlerPtr sax; /* the SAX handler block */
14935 const char * filename; /* the filename */
14937 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14939 void * data; /* the userdata */
14942 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14943 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14944 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14945 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14946 mem_base = xmlMemBlocks();
14947 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14948 filename = gen_filepath(n_filename, 1);
14949 recovery = gen_int(n_recovery, 2);
14950 data = gen_userdata(n_data, 3);
14952 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14953 desret_xmlDocPtr(ret_val);
14955 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14956 des_filepath(n_filename, filename, 1);
14957 des_int(n_recovery, recovery, 2);
14958 des_userdata(n_data, data, 3);
14959 xmlResetLastError();
14960 if (mem_base != xmlMemBlocks()) {
14961 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14962 xmlMemBlocks() - mem_base);
14964 printf(" %d", n_sax);
14965 printf(" %d", n_filename);
14966 printf(" %d", n_recovery);
14967 printf(" %d", n_data);
14983 test_xmlSAXParseMemory(void) {
14986 #if defined(LIBXML_SAX1_ENABLED)
14987 #ifdef LIBXML_SAX1_ENABLED
14990 xmlSAXHandlerPtr sax; /* the SAX handler block */
14992 char * buffer; /* an pointer to a char array */
14994 int size; /* the size of the array */
14996 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14999 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15000 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15001 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15002 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15003 mem_base = xmlMemBlocks();
15004 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15005 buffer = gen_const_char_ptr(n_buffer, 1);
15006 size = gen_int(n_size, 2);
15007 recovery = gen_int(n_recovery, 3);
15009 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15010 desret_xmlDocPtr(ret_val);
15012 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15013 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15014 des_int(n_size, size, 2);
15015 des_int(n_recovery, recovery, 3);
15016 xmlResetLastError();
15017 if (mem_base != xmlMemBlocks()) {
15018 printf("Leak of %d blocks found in xmlSAXParseMemory",
15019 xmlMemBlocks() - mem_base);
15021 printf(" %d", n_sax);
15022 printf(" %d", n_buffer);
15023 printf(" %d", n_size);
15024 printf(" %d", n_recovery);
15040 test_xmlSAXParseMemoryWithData(void) {
15043 #if defined(LIBXML_SAX1_ENABLED)
15044 #ifdef LIBXML_SAX1_ENABLED
15047 xmlSAXHandlerPtr sax; /* the SAX handler block */
15049 char * buffer; /* an pointer to a char array */
15051 int size; /* the size of the array */
15053 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15055 void * data; /* the userdata */
15058 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15059 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15060 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15061 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15062 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15063 mem_base = xmlMemBlocks();
15064 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15065 buffer = gen_const_char_ptr(n_buffer, 1);
15066 size = gen_int(n_size, 2);
15067 recovery = gen_int(n_recovery, 3);
15068 data = gen_userdata(n_data, 4);
15070 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15071 desret_xmlDocPtr(ret_val);
15073 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15074 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15075 des_int(n_size, size, 2);
15076 des_int(n_recovery, recovery, 3);
15077 des_userdata(n_data, data, 4);
15078 xmlResetLastError();
15079 if (mem_base != xmlMemBlocks()) {
15080 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15081 xmlMemBlocks() - mem_base);
15083 printf(" %d", n_sax);
15084 printf(" %d", n_buffer);
15085 printf(" %d", n_size);
15086 printf(" %d", n_recovery);
15087 printf(" %d", n_data);
15104 test_xmlSAXUserParseFile(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 const char * filename; /* a file name */
15118 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15119 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15120 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15121 mem_base = xmlMemBlocks();
15122 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15123 user_data = gen_userdata(n_user_data, 1);
15124 filename = gen_filepath(n_filename, 2);
15126 #ifdef LIBXML_SAX1_ENABLED
15127 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15131 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15132 desret_int(ret_val);
15134 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15135 des_userdata(n_user_data, user_data, 1);
15136 des_filepath(n_filename, filename, 2);
15137 xmlResetLastError();
15138 if (mem_base != xmlMemBlocks()) {
15139 printf("Leak of %d blocks found in xmlSAXUserParseFile",
15140 xmlMemBlocks() - mem_base);
15142 printf(" %d", n_sax);
15143 printf(" %d", n_user_data);
15144 printf(" %d", n_filename);
15159 test_xmlSAXUserParseMemory(void) {
15162 #if defined(LIBXML_SAX1_ENABLED)
15163 #ifdef LIBXML_SAX1_ENABLED
15166 xmlSAXHandlerPtr sax; /* a SAX handler */
15168 void * user_data; /* The user data returned on SAX callbacks */
15170 char * buffer; /* an in-memory XML document input */
15172 int size; /* the length of the XML document in bytes */
15175 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15176 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15177 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15178 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15179 mem_base = xmlMemBlocks();
15180 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15181 user_data = gen_userdata(n_user_data, 1);
15182 buffer = gen_const_char_ptr(n_buffer, 2);
15183 size = gen_int(n_size, 3);
15185 #ifdef LIBXML_SAX1_ENABLED
15186 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15190 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15191 desret_int(ret_val);
15193 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15194 des_userdata(n_user_data, user_data, 1);
15195 des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15196 des_int(n_size, size, 3);
15197 xmlResetLastError();
15198 if (mem_base != xmlMemBlocks()) {
15199 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15200 xmlMemBlocks() - mem_base);
15202 printf(" %d", n_sax);
15203 printf(" %d", n_user_data);
15204 printf(" %d", n_buffer);
15205 printf(" %d", n_size);
15221 test_xmlSetExternalEntityLoader(void) {
15225 /* missing type support */
15231 test_xmlSetFeature(void) {
15234 #if defined(LIBXML_LEGACY_ENABLED)
15235 #ifdef LIBXML_LEGACY_ENABLED
15238 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15240 char * name; /* the feature name */
15242 void * value; /* pointer to the location of the new value */
15245 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15246 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15247 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15248 mem_base = xmlMemBlocks();
15249 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15250 name = gen_const_char_ptr(n_name, 1);
15251 value = gen_void_ptr(n_value, 2);
15253 ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15254 desret_int(ret_val);
15256 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15257 des_const_char_ptr(n_name, (const char *)name, 1);
15258 des_void_ptr(n_value, value, 2);
15259 xmlResetLastError();
15260 if (mem_base != xmlMemBlocks()) {
15261 printf("Leak of %d blocks found in xmlSetFeature",
15262 xmlMemBlocks() - mem_base);
15264 printf(" %d", n_ctxt);
15265 printf(" %d", n_name);
15266 printf(" %d", n_value);
15281 test_xmlSetupParserForBuffer(void) {
15284 #if defined(LIBXML_SAX1_ENABLED)
15285 #ifdef LIBXML_SAX1_ENABLED
15287 xmlParserCtxtPtr ctxt; /* an XML parser context */
15289 xmlChar * buffer; /* a xmlChar * buffer */
15291 const char * filename; /* a file name */
15294 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15295 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15296 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15297 mem_base = xmlMemBlocks();
15298 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15299 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15300 filename = gen_filepath(n_filename, 2);
15302 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15304 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15305 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15306 des_filepath(n_filename, filename, 2);
15307 xmlResetLastError();
15308 if (mem_base != xmlMemBlocks()) {
15309 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15310 xmlMemBlocks() - mem_base);
15312 printf(" %d", n_ctxt);
15313 printf(" %d", n_buffer);
15314 printf(" %d", n_filename);
15329 test_xmlStopParser(void) {
15332 #ifdef LIBXML_PUSH_ENABLED
15334 xmlParserCtxtPtr ctxt; /* an XML parser context */
15337 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15338 mem_base = xmlMemBlocks();
15339 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15341 xmlStopParser(ctxt);
15343 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15344 xmlResetLastError();
15345 if (mem_base != xmlMemBlocks()) {
15346 printf("Leak of %d blocks found in xmlStopParser",
15347 xmlMemBlocks() - mem_base);
15349 printf(" %d", n_ctxt);
15361 test_xmlSubstituteEntitiesDefault(void) {
15366 int val; /* int 0 or 1 */
15369 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15370 mem_base = xmlMemBlocks();
15371 val = gen_int(n_val, 0);
15373 ret_val = xmlSubstituteEntitiesDefault(val);
15374 desret_int(ret_val);
15376 des_int(n_val, val, 0);
15377 xmlResetLastError();
15378 if (mem_base != xmlMemBlocks()) {
15379 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15380 xmlMemBlocks() - mem_base);
15382 printf(" %d", n_val);
15392 test_parser(void) {
15395 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15396 test_ret += test_xmlByteConsumed();
15397 test_ret += test_xmlClearNodeInfoSeq();
15398 test_ret += test_xmlClearParserCtxt();
15399 test_ret += test_xmlCreateDocParserCtxt();
15400 test_ret += test_xmlCreatePushParserCtxt();
15401 test_ret += test_xmlCtxtReadDoc();
15402 test_ret += test_xmlCtxtReadFile();
15403 test_ret += test_xmlCtxtReadMemory();
15404 test_ret += test_xmlCtxtReset();
15405 test_ret += test_xmlCtxtResetPush();
15406 test_ret += test_xmlCtxtUseOptions();
15407 test_ret += test_xmlGetExternalEntityLoader();
15408 test_ret += test_xmlGetFeature();
15409 test_ret += test_xmlGetFeaturesList();
15410 test_ret += test_xmlHasFeature();
15411 test_ret += test_xmlIOParseDTD();
15412 test_ret += test_xmlInitNodeInfoSeq();
15413 test_ret += test_xmlInitParser();
15414 test_ret += test_xmlInitParserCtxt();
15415 test_ret += test_xmlKeepBlanksDefault();
15416 test_ret += test_xmlLineNumbersDefault();
15417 test_ret += test_xmlLoadExternalEntity();
15418 test_ret += test_xmlNewIOInputStream();
15419 test_ret += test_xmlNewParserCtxt();
15420 test_ret += test_xmlParseBalancedChunkMemory();
15421 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15422 test_ret += test_xmlParseChunk();
15423 test_ret += test_xmlParseCtxtExternalEntity();
15424 test_ret += test_xmlParseDTD();
15425 test_ret += test_xmlParseDoc();
15426 test_ret += test_xmlParseDocument();
15427 test_ret += test_xmlParseEntity();
15428 test_ret += test_xmlParseExtParsedEnt();
15429 test_ret += test_xmlParseExternalEntity();
15430 test_ret += test_xmlParseFile();
15431 test_ret += test_xmlParseInNodeContext();
15432 test_ret += test_xmlParseMemory();
15433 test_ret += test_xmlParserAddNodeInfo();
15434 test_ret += test_xmlParserFindNodeInfo();
15435 test_ret += test_xmlParserFindNodeInfoIndex();
15436 test_ret += test_xmlParserInputGrow();
15437 test_ret += test_xmlParserInputRead();
15438 test_ret += test_xmlPedanticParserDefault();
15439 test_ret += test_xmlReadDoc();
15440 test_ret += test_xmlReadFile();
15441 test_ret += test_xmlReadMemory();
15442 test_ret += test_xmlRecoverDoc();
15443 test_ret += test_xmlRecoverFile();
15444 test_ret += test_xmlRecoverMemory();
15445 test_ret += test_xmlSAXParseDTD();
15446 test_ret += test_xmlSAXParseDoc();
15447 test_ret += test_xmlSAXParseEntity();
15448 test_ret += test_xmlSAXParseFile();
15449 test_ret += test_xmlSAXParseFileWithData();
15450 test_ret += test_xmlSAXParseMemory();
15451 test_ret += test_xmlSAXParseMemoryWithData();
15452 test_ret += test_xmlSAXUserParseFile();
15453 test_ret += test_xmlSAXUserParseMemory();
15454 test_ret += test_xmlSetExternalEntityLoader();
15455 test_ret += test_xmlSetFeature();
15456 test_ret += test_xmlSetupParserForBuffer();
15457 test_ret += test_xmlStopParser();
15458 test_ret += test_xmlSubstituteEntitiesDefault();
15461 printf("Module parser: %d errors\n", test_ret);
15466 test_htmlCreateFileParserCtxt(void) {
15469 #if defined(LIBXML_HTML_ENABLED)
15471 htmlParserCtxtPtr ret_val;
15472 const char * filename; /* the filename */
15474 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15477 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15478 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15479 mem_base = xmlMemBlocks();
15480 filename = gen_fileoutput(n_filename, 0);
15481 encoding = gen_const_char_ptr(n_encoding, 1);
15483 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15484 desret_htmlParserCtxtPtr(ret_val);
15486 des_fileoutput(n_filename, filename, 0);
15487 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15488 xmlResetLastError();
15489 if (mem_base != xmlMemBlocks()) {
15490 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15491 xmlMemBlocks() - mem_base);
15493 printf(" %d", n_filename);
15494 printf(" %d", n_encoding);
15507 test_htmlInitAutoClose(void) {
15510 #if defined(LIBXML_HTML_ENABLED)
15513 mem_base = xmlMemBlocks();
15515 htmlInitAutoClose();
15517 xmlResetLastError();
15518 if (mem_base != xmlMemBlocks()) {
15519 printf("Leak of %d blocks found in htmlInitAutoClose",
15520 xmlMemBlocks() - mem_base);
15532 test_inputPop(void) {
15536 xmlParserInputPtr ret_val;
15537 xmlParserCtxtPtr ctxt; /* an XML parser context */
15540 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15541 mem_base = xmlMemBlocks();
15542 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15544 ret_val = inputPop(ctxt);
15545 desret_xmlParserInputPtr(ret_val);
15547 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15548 xmlResetLastError();
15549 if (mem_base != xmlMemBlocks()) {
15550 printf("Leak of %d blocks found in inputPop",
15551 xmlMemBlocks() - mem_base);
15553 printf(" %d", n_ctxt);
15564 test_inputPush(void) {
15569 xmlParserCtxtPtr ctxt; /* an XML parser context */
15571 xmlParserInputPtr value; /* the parser input */
15574 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15575 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15576 mem_base = xmlMemBlocks();
15577 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15578 value = gen_xmlParserInputPtr(n_value, 1);
15580 ret_val = inputPush(ctxt, value);
15581 desret_int(ret_val);
15583 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15584 des_xmlParserInputPtr(n_value, value, 1);
15585 xmlResetLastError();
15586 if (mem_base != xmlMemBlocks()) {
15587 printf("Leak of %d blocks found in inputPush",
15588 xmlMemBlocks() - mem_base);
15590 printf(" %d", n_ctxt);
15591 printf(" %d", n_value);
15603 test_namePop(void) {
15607 const xmlChar * ret_val;
15608 xmlParserCtxtPtr ctxt; /* an XML parser context */
15611 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15612 mem_base = xmlMemBlocks();
15613 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15615 ret_val = namePop(ctxt);
15616 desret_const_xmlChar_ptr(ret_val);
15618 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15619 xmlResetLastError();
15620 if (mem_base != xmlMemBlocks()) {
15621 printf("Leak of %d blocks found in namePop",
15622 xmlMemBlocks() - mem_base);
15624 printf(" %d", n_ctxt);
15635 test_namePush(void) {
15640 xmlParserCtxtPtr ctxt; /* an XML parser context */
15642 xmlChar * value; /* the element name */
15645 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15646 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15647 mem_base = xmlMemBlocks();
15648 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15649 value = gen_const_xmlChar_ptr(n_value, 1);
15651 ret_val = namePush(ctxt, (const xmlChar *)value);
15652 desret_int(ret_val);
15654 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15655 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15656 xmlResetLastError();
15657 if (mem_base != xmlMemBlocks()) {
15658 printf("Leak of %d blocks found in namePush",
15659 xmlMemBlocks() - mem_base);
15661 printf(" %d", n_ctxt);
15662 printf(" %d", n_value);
15674 test_nodePop(void) {
15678 xmlNodePtr ret_val;
15679 xmlParserCtxtPtr ctxt; /* an XML parser context */
15682 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15683 mem_base = xmlMemBlocks();
15684 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15686 ret_val = nodePop(ctxt);
15687 desret_xmlNodePtr(ret_val);
15689 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15690 xmlResetLastError();
15691 if (mem_base != xmlMemBlocks()) {
15692 printf("Leak of %d blocks found in nodePop",
15693 xmlMemBlocks() - mem_base);
15695 printf(" %d", n_ctxt);
15706 test_nodePush(void) {
15711 xmlParserCtxtPtr ctxt; /* an XML parser context */
15713 xmlNodePtr value; /* the element node */
15716 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15717 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15718 mem_base = xmlMemBlocks();
15719 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15720 value = gen_xmlNodePtr(n_value, 1);
15722 ret_val = nodePush(ctxt, value);
15723 desret_int(ret_val);
15725 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15726 des_xmlNodePtr(n_value, value, 1);
15727 xmlResetLastError();
15728 if (mem_base != xmlMemBlocks()) {
15729 printf("Leak of %d blocks found in nodePush",
15730 xmlMemBlocks() - mem_base);
15732 printf(" %d", n_ctxt);
15733 printf(" %d", n_value);
15745 test_xmlCheckLanguageID(void) {
15750 xmlChar * lang; /* pointer to the string value */
15753 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15754 mem_base = xmlMemBlocks();
15755 lang = gen_const_xmlChar_ptr(n_lang, 0);
15757 ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15758 desret_int(ret_val);
15760 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15761 xmlResetLastError();
15762 if (mem_base != xmlMemBlocks()) {
15763 printf("Leak of %d blocks found in xmlCheckLanguageID",
15764 xmlMemBlocks() - mem_base);
15766 printf(" %d", n_lang);
15777 test_xmlCopyChar(void) {
15782 int len; /* Ignored, compatibility */
15784 xmlChar * out; /* pointer to an array of xmlChar */
15786 int val; /* the char value */
15789 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15790 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15791 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15792 mem_base = xmlMemBlocks();
15793 len = gen_int(n_len, 0);
15794 out = gen_xmlChar_ptr(n_out, 1);
15795 val = gen_int(n_val, 2);
15797 ret_val = xmlCopyChar(len, out, val);
15798 desret_int(ret_val);
15800 des_int(n_len, len, 0);
15801 des_xmlChar_ptr(n_out, out, 1);
15802 des_int(n_val, val, 2);
15803 xmlResetLastError();
15804 if (mem_base != xmlMemBlocks()) {
15805 printf("Leak of %d blocks found in xmlCopyChar",
15806 xmlMemBlocks() - mem_base);
15808 printf(" %d", n_len);
15809 printf(" %d", n_out);
15810 printf(" %d", n_val);
15823 test_xmlCopyCharMultiByte(void) {
15828 xmlChar * out; /* pointer to an array of xmlChar */
15830 int val; /* the char value */
15833 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15834 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15835 mem_base = xmlMemBlocks();
15836 out = gen_xmlChar_ptr(n_out, 0);
15837 val = gen_int(n_val, 1);
15839 ret_val = xmlCopyCharMultiByte(out, val);
15840 desret_int(ret_val);
15842 des_xmlChar_ptr(n_out, out, 0);
15843 des_int(n_val, val, 1);
15844 xmlResetLastError();
15845 if (mem_base != xmlMemBlocks()) {
15846 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15847 xmlMemBlocks() - mem_base);
15849 printf(" %d", n_out);
15850 printf(" %d", n_val);
15862 test_xmlCreateEntityParserCtxt(void) {
15866 xmlParserCtxtPtr ret_val;
15867 xmlChar * URL; /* the entity URL */
15869 xmlChar * ID; /* the entity PUBLIC ID */
15871 xmlChar * base; /* a possible base for the target URI */
15874 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15875 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15876 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15877 mem_base = xmlMemBlocks();
15878 URL = gen_const_xmlChar_ptr(n_URL, 0);
15879 ID = gen_const_xmlChar_ptr(n_ID, 1);
15880 base = gen_const_xmlChar_ptr(n_base, 2);
15882 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15883 desret_xmlParserCtxtPtr(ret_val);
15885 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15886 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15887 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15888 xmlResetLastError();
15889 if (mem_base != xmlMemBlocks()) {
15890 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15891 xmlMemBlocks() - mem_base);
15893 printf(" %d", n_URL);
15894 printf(" %d", n_ID);
15895 printf(" %d", n_base);
15908 test_xmlCreateFileParserCtxt(void) {
15912 xmlParserCtxtPtr ret_val;
15913 const char * filename; /* the filename */
15916 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15917 mem_base = xmlMemBlocks();
15918 filename = gen_fileoutput(n_filename, 0);
15920 ret_val = xmlCreateFileParserCtxt(filename);
15921 desret_xmlParserCtxtPtr(ret_val);
15923 des_fileoutput(n_filename, filename, 0);
15924 xmlResetLastError();
15925 if (mem_base != xmlMemBlocks()) {
15926 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15927 xmlMemBlocks() - mem_base);
15929 printf(" %d", n_filename);
15940 test_xmlCreateMemoryParserCtxt(void) {
15944 xmlParserCtxtPtr ret_val;
15945 char * buffer; /* a pointer to a char array */
15947 int size; /* the size of the array */
15950 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15951 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15952 mem_base = xmlMemBlocks();
15953 buffer = gen_const_char_ptr(n_buffer, 0);
15954 size = gen_int(n_size, 1);
15956 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15957 desret_xmlParserCtxtPtr(ret_val);
15959 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15960 des_int(n_size, size, 1);
15961 xmlResetLastError();
15962 if (mem_base != xmlMemBlocks()) {
15963 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15964 xmlMemBlocks() - mem_base);
15966 printf(" %d", n_buffer);
15967 printf(" %d", n_size);
15979 test_xmlCreateURLParserCtxt(void) {
15983 xmlParserCtxtPtr ret_val;
15984 const char * filename; /* the filename or URL */
15986 int options; /* a combination of xmlParserOption */
15989 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15990 for (n_options = 0;n_options < gen_nb_int;n_options++) {
15991 mem_base = xmlMemBlocks();
15992 filename = gen_fileoutput(n_filename, 0);
15993 options = gen_int(n_options, 1);
15995 ret_val = xmlCreateURLParserCtxt(filename, options);
15996 desret_xmlParserCtxtPtr(ret_val);
15998 des_fileoutput(n_filename, filename, 0);
15999 des_int(n_options, options, 1);
16000 xmlResetLastError();
16001 if (mem_base != xmlMemBlocks()) {
16002 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16003 xmlMemBlocks() - mem_base);
16005 printf(" %d", n_filename);
16006 printf(" %d", n_options);
16018 test_xmlCurrentChar(void) {
16023 xmlParserCtxtPtr ctxt; /* the XML parser context */
16025 int * len; /* pointer to the length of the char read */
16028 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16029 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16030 mem_base = xmlMemBlocks();
16031 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16032 len = gen_int_ptr(n_len, 1);
16034 ret_val = xmlCurrentChar(ctxt, len);
16035 desret_int(ret_val);
16037 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16038 des_int_ptr(n_len, len, 1);
16039 xmlResetLastError();
16040 if (mem_base != xmlMemBlocks()) {
16041 printf("Leak of %d blocks found in xmlCurrentChar",
16042 xmlMemBlocks() - mem_base);
16044 printf(" %d", n_ctxt);
16045 printf(" %d", n_len);
16057 test_xmlErrMemory(void) {
16061 xmlParserCtxtPtr ctxt; /* an XML parser context */
16063 char * extra; /* extra informations */
16066 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16067 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16068 mem_base = xmlMemBlocks();
16069 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16070 extra = gen_const_char_ptr(n_extra, 1);
16072 xmlErrMemory(ctxt, (const char *)extra);
16074 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16075 des_const_char_ptr(n_extra, (const char *)extra, 1);
16076 xmlResetLastError();
16077 if (mem_base != xmlMemBlocks()) {
16078 printf("Leak of %d blocks found in xmlErrMemory",
16079 xmlMemBlocks() - mem_base);
16081 printf(" %d", n_ctxt);
16082 printf(" %d", n_extra);
16094 test_xmlIsLetter(void) {
16099 int c; /* an unicode character (int) */
16102 for (n_c = 0;n_c < gen_nb_int;n_c++) {
16103 mem_base = xmlMemBlocks();
16104 c = gen_int(n_c, 0);
16106 ret_val = xmlIsLetter(c);
16107 desret_int(ret_val);
16109 des_int(n_c, c, 0);
16110 xmlResetLastError();
16111 if (mem_base != xmlMemBlocks()) {
16112 printf("Leak of %d blocks found in xmlIsLetter",
16113 xmlMemBlocks() - mem_base);
16115 printf(" %d", n_c);
16126 test_xmlNewEntityInputStream(void) {
16130 xmlParserInputPtr ret_val;
16131 xmlParserCtxtPtr ctxt; /* an XML parser context */
16133 xmlEntityPtr entity; /* an Entity pointer */
16136 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16137 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16138 mem_base = xmlMemBlocks();
16139 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16140 entity = gen_xmlEntityPtr(n_entity, 1);
16142 ret_val = xmlNewEntityInputStream(ctxt, entity);
16143 desret_xmlParserInputPtr(ret_val);
16145 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16146 des_xmlEntityPtr(n_entity, entity, 1);
16147 xmlResetLastError();
16148 if (mem_base != xmlMemBlocks()) {
16149 printf("Leak of %d blocks found in xmlNewEntityInputStream",
16150 xmlMemBlocks() - mem_base);
16152 printf(" %d", n_ctxt);
16153 printf(" %d", n_entity);
16165 test_xmlNewInputFromFile(void) {
16169 xmlParserInputPtr ret_val;
16170 xmlParserCtxtPtr ctxt; /* an XML parser context */
16172 const char * filename; /* the filename to use as entity */
16175 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16176 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16177 mem_base = xmlMemBlocks();
16178 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16179 filename = gen_filepath(n_filename, 1);
16181 ret_val = xmlNewInputFromFile(ctxt, filename);
16182 desret_xmlParserInputPtr(ret_val);
16184 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16185 des_filepath(n_filename, filename, 1);
16186 xmlResetLastError();
16187 if (mem_base != xmlMemBlocks()) {
16188 printf("Leak of %d blocks found in xmlNewInputFromFile",
16189 xmlMemBlocks() - mem_base);
16191 printf(" %d", n_ctxt);
16192 printf(" %d", n_filename);
16204 test_xmlNewInputStream(void) {
16208 xmlParserInputPtr ret_val;
16209 xmlParserCtxtPtr ctxt; /* an XML parser context */
16212 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16213 mem_base = xmlMemBlocks();
16214 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16216 ret_val = xmlNewInputStream(ctxt);
16217 desret_xmlParserInputPtr(ret_val);
16219 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16220 xmlResetLastError();
16221 if (mem_base != xmlMemBlocks()) {
16222 printf("Leak of %d blocks found in xmlNewInputStream",
16223 xmlMemBlocks() - mem_base);
16225 printf(" %d", n_ctxt);
16236 test_xmlNewStringInputStream(void) {
16240 xmlParserInputPtr ret_val;
16241 xmlParserCtxtPtr ctxt; /* an XML parser context */
16243 xmlChar * buffer; /* an memory buffer */
16246 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16247 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16248 mem_base = xmlMemBlocks();
16249 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16250 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16252 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16253 desret_xmlParserInputPtr(ret_val);
16255 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16256 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16257 xmlResetLastError();
16258 if (mem_base != xmlMemBlocks()) {
16259 printf("Leak of %d blocks found in xmlNewStringInputStream",
16260 xmlMemBlocks() - mem_base);
16262 printf(" %d", n_ctxt);
16263 printf(" %d", n_buffer);
16275 test_xmlNextChar(void) {
16279 xmlParserCtxtPtr ctxt; /* the XML parser context */
16282 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16283 mem_base = xmlMemBlocks();
16284 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16288 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16289 xmlResetLastError();
16290 if (mem_base != xmlMemBlocks()) {
16291 printf("Leak of %d blocks found in xmlNextChar",
16292 xmlMemBlocks() - mem_base);
16294 printf(" %d", n_ctxt);
16305 test_xmlParserInputShrink(void) {
16309 xmlParserInputPtr in; /* an XML parser input */
16312 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16313 mem_base = xmlMemBlocks();
16314 in = gen_xmlParserInputPtr(n_in, 0);
16316 xmlParserInputShrink(in);
16318 des_xmlParserInputPtr(n_in, in, 0);
16319 xmlResetLastError();
16320 if (mem_base != xmlMemBlocks()) {
16321 printf("Leak of %d blocks found in xmlParserInputShrink",
16322 xmlMemBlocks() - mem_base);
16324 printf(" %d", n_in);
16335 test_xmlPopInput(void) {
16340 xmlParserCtxtPtr ctxt; /* an XML parser context */
16343 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16344 mem_base = xmlMemBlocks();
16345 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16347 ret_val = xmlPopInput(ctxt);
16348 desret_xmlChar(ret_val);
16350 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16351 xmlResetLastError();
16352 if (mem_base != xmlMemBlocks()) {
16353 printf("Leak of %d blocks found in xmlPopInput",
16354 xmlMemBlocks() - mem_base);
16356 printf(" %d", n_ctxt);
16367 test_xmlPushInput(void) {
16372 xmlParserCtxtPtr ctxt; /* an XML parser context */
16374 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16377 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16378 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16379 mem_base = xmlMemBlocks();
16380 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16381 input = gen_xmlParserInputPtr(n_input, 1);
16383 ret_val = xmlPushInput(ctxt, input);
16384 desret_int(ret_val);
16386 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16387 des_xmlParserInputPtr(n_input, input, 1);
16388 xmlResetLastError();
16389 if (mem_base != xmlMemBlocks()) {
16390 printf("Leak of %d blocks found in xmlPushInput",
16391 xmlMemBlocks() - mem_base);
16393 printf(" %d", n_ctxt);
16394 printf(" %d", n_input);
16406 test_xmlSetEntityReferenceFunc(void) {
16410 /* missing type support */
16416 test_xmlSplitQName(void) {
16421 xmlParserCtxtPtr ctxt; /* an XML parser context */
16423 xmlChar * name; /* an XML parser context */
16425 xmlChar ** prefix; /* a xmlChar ** */
16428 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16429 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16430 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16431 mem_base = xmlMemBlocks();
16432 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16433 name = gen_const_xmlChar_ptr(n_name, 1);
16434 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16436 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16437 desret_xmlChar_ptr(ret_val);
16439 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16440 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16441 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16442 xmlResetLastError();
16443 if (mem_base != xmlMemBlocks()) {
16444 printf("Leak of %d blocks found in xmlSplitQName",
16445 xmlMemBlocks() - mem_base);
16447 printf(" %d", n_ctxt);
16448 printf(" %d", n_name);
16449 printf(" %d", n_prefix);
16462 test_xmlStringCurrentChar(void) {
16467 xmlParserCtxtPtr ctxt; /* the XML parser context */
16469 xmlChar * cur; /* pointer to the beginning of the char */
16471 int * len; /* pointer to the length of the char read */
16474 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16475 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16476 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16477 mem_base = xmlMemBlocks();
16478 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16479 cur = gen_const_xmlChar_ptr(n_cur, 1);
16480 len = gen_int_ptr(n_len, 2);
16482 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16483 desret_int(ret_val);
16485 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16486 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16487 des_int_ptr(n_len, len, 2);
16488 xmlResetLastError();
16489 if (mem_base != xmlMemBlocks()) {
16490 printf("Leak of %d blocks found in xmlStringCurrentChar",
16491 xmlMemBlocks() - mem_base);
16493 printf(" %d", n_ctxt);
16494 printf(" %d", n_cur);
16495 printf(" %d", n_len);
16508 test_xmlStringDecodeEntities(void) {
16513 xmlParserCtxtPtr ctxt; /* the parser context */
16515 xmlChar * str; /* the input string */
16517 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16519 xmlChar end; /* an end marker xmlChar, 0 if none */
16521 xmlChar end2; /* an end marker xmlChar, 0 if none */
16523 xmlChar end3; /* an end marker xmlChar, 0 if none */
16526 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16527 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16528 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16529 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16530 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16531 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16532 mem_base = xmlMemBlocks();
16533 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16534 str = gen_const_xmlChar_ptr(n_str, 1);
16535 what = gen_int(n_what, 2);
16536 end = gen_xmlChar(n_end, 3);
16537 end2 = gen_xmlChar(n_end2, 4);
16538 end3 = gen_xmlChar(n_end3, 5);
16540 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16541 desret_xmlChar_ptr(ret_val);
16543 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16544 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16545 des_int(n_what, what, 2);
16546 des_xmlChar(n_end, end, 3);
16547 des_xmlChar(n_end2, end2, 4);
16548 des_xmlChar(n_end3, end3, 5);
16549 xmlResetLastError();
16550 if (mem_base != xmlMemBlocks()) {
16551 printf("Leak of %d blocks found in xmlStringDecodeEntities",
16552 xmlMemBlocks() - mem_base);
16554 printf(" %d", n_ctxt);
16555 printf(" %d", n_str);
16556 printf(" %d", n_what);
16557 printf(" %d", n_end);
16558 printf(" %d", n_end2);
16559 printf(" %d", n_end3);
16575 test_xmlStringLenDecodeEntities(void) {
16580 xmlParserCtxtPtr ctxt; /* the parser context */
16582 xmlChar * str; /* the input string */
16584 int len; /* the string length */
16586 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16588 xmlChar end; /* an end marker xmlChar, 0 if none */
16590 xmlChar end2; /* an end marker xmlChar, 0 if none */
16592 xmlChar end3; /* an end marker xmlChar, 0 if none */
16595 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16596 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16597 for (n_len = 0;n_len < gen_nb_int;n_len++) {
16598 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16599 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16600 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16601 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16602 mem_base = xmlMemBlocks();
16603 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16604 str = gen_const_xmlChar_ptr(n_str, 1);
16605 len = gen_int(n_len, 2);
16606 what = gen_int(n_what, 3);
16607 end = gen_xmlChar(n_end, 4);
16608 end2 = gen_xmlChar(n_end2, 5);
16609 end3 = gen_xmlChar(n_end3, 6);
16611 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16612 desret_xmlChar_ptr(ret_val);
16614 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16615 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16616 des_int(n_len, len, 2);
16617 des_int(n_what, what, 3);
16618 des_xmlChar(n_end, end, 4);
16619 des_xmlChar(n_end2, end2, 5);
16620 des_xmlChar(n_end3, end3, 6);
16621 xmlResetLastError();
16622 if (mem_base != xmlMemBlocks()) {
16623 printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16624 xmlMemBlocks() - mem_base);
16626 printf(" %d", n_ctxt);
16627 printf(" %d", n_str);
16628 printf(" %d", n_len);
16629 printf(" %d", n_what);
16630 printf(" %d", n_end);
16631 printf(" %d", n_end2);
16632 printf(" %d", n_end3);
16649 test_xmlSwitchEncoding(void) {
16654 xmlParserCtxtPtr ctxt; /* the parser context */
16656 xmlCharEncoding enc; /* the encoding value (number) */
16659 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16660 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16661 mem_base = xmlMemBlocks();
16662 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16663 enc = gen_xmlCharEncoding(n_enc, 1);
16665 ret_val = xmlSwitchEncoding(ctxt, enc);
16666 desret_int(ret_val);
16668 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16669 des_xmlCharEncoding(n_enc, enc, 1);
16670 xmlResetLastError();
16671 if (mem_base != xmlMemBlocks()) {
16672 printf("Leak of %d blocks found in xmlSwitchEncoding",
16673 xmlMemBlocks() - mem_base);
16675 printf(" %d", n_ctxt);
16676 printf(" %d", n_enc);
16688 test_xmlSwitchInputEncoding(void) {
16693 xmlParserCtxtPtr ctxt; /* the parser context */
16695 xmlParserInputPtr input; /* the input stream */
16697 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16700 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16701 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16702 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16703 mem_base = xmlMemBlocks();
16704 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16705 input = gen_xmlParserInputPtr(n_input, 1);
16706 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16708 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16709 desret_int(ret_val);
16711 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16712 des_xmlParserInputPtr(n_input, input, 1);
16713 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16714 xmlResetLastError();
16715 if (mem_base != xmlMemBlocks()) {
16716 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16717 xmlMemBlocks() - mem_base);
16719 printf(" %d", n_ctxt);
16720 printf(" %d", n_input);
16721 printf(" %d", n_handler);
16734 test_xmlSwitchToEncoding(void) {
16739 xmlParserCtxtPtr ctxt; /* the parser context */
16741 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16744 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16745 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16746 mem_base = xmlMemBlocks();
16747 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16748 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16750 ret_val = xmlSwitchToEncoding(ctxt, handler);
16751 desret_int(ret_val);
16753 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16754 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16755 xmlResetLastError();
16756 if (mem_base != xmlMemBlocks()) {
16757 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16758 xmlMemBlocks() - mem_base);
16760 printf(" %d", n_ctxt);
16761 printf(" %d", n_handler);
16772 test_parserInternals(void) {
16775 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16776 test_ret += test_htmlCreateFileParserCtxt();
16777 test_ret += test_htmlInitAutoClose();
16778 test_ret += test_inputPop();
16779 test_ret += test_inputPush();
16780 test_ret += test_namePop();
16781 test_ret += test_namePush();
16782 test_ret += test_nodePop();
16783 test_ret += test_nodePush();
16784 test_ret += test_xmlCheckLanguageID();
16785 test_ret += test_xmlCopyChar();
16786 test_ret += test_xmlCopyCharMultiByte();
16787 test_ret += test_xmlCreateEntityParserCtxt();
16788 test_ret += test_xmlCreateFileParserCtxt();
16789 test_ret += test_xmlCreateMemoryParserCtxt();
16790 test_ret += test_xmlCreateURLParserCtxt();
16791 test_ret += test_xmlCurrentChar();
16792 test_ret += test_xmlErrMemory();
16793 test_ret += test_xmlIsLetter();
16794 test_ret += test_xmlNewEntityInputStream();
16795 test_ret += test_xmlNewInputFromFile();
16796 test_ret += test_xmlNewInputStream();
16797 test_ret += test_xmlNewStringInputStream();
16798 test_ret += test_xmlNextChar();
16799 test_ret += test_xmlParserInputShrink();
16800 test_ret += test_xmlPopInput();
16801 test_ret += test_xmlPushInput();
16802 test_ret += test_xmlSetEntityReferenceFunc();
16803 test_ret += test_xmlSplitQName();
16804 test_ret += test_xmlStringCurrentChar();
16805 test_ret += test_xmlStringDecodeEntities();
16806 test_ret += test_xmlStringLenDecodeEntities();
16807 test_ret += test_xmlSwitchEncoding();
16808 test_ret += test_xmlSwitchInputEncoding();
16809 test_ret += test_xmlSwitchToEncoding();
16812 printf("Module parserInternals: %d errors\n", test_ret);
16817 test_xmlPatternFromRoot(void) {
16820 #if defined(LIBXML_PATTERN_ENABLED)
16823 xmlPatternPtr comp; /* the precompiled pattern */
16826 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16827 mem_base = xmlMemBlocks();
16828 comp = gen_xmlPatternPtr(n_comp, 0);
16830 ret_val = xmlPatternFromRoot(comp);
16831 desret_int(ret_val);
16833 des_xmlPatternPtr(n_comp, comp, 0);
16834 xmlResetLastError();
16835 if (mem_base != xmlMemBlocks()) {
16836 printf("Leak of %d blocks found in xmlPatternFromRoot",
16837 xmlMemBlocks() - mem_base);
16839 printf(" %d", n_comp);
16851 test_xmlPatternGetStreamCtxt(void) {
16855 /* missing type support */
16861 test_xmlPatternMatch(void) {
16864 #if defined(LIBXML_PATTERN_ENABLED)
16867 xmlPatternPtr comp; /* the precompiled pattern */
16869 xmlNodePtr node; /* a node */
16872 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16873 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16874 mem_base = xmlMemBlocks();
16875 comp = gen_xmlPatternPtr(n_comp, 0);
16876 node = gen_xmlNodePtr(n_node, 1);
16878 ret_val = xmlPatternMatch(comp, node);
16879 desret_int(ret_val);
16881 des_xmlPatternPtr(n_comp, comp, 0);
16882 des_xmlNodePtr(n_node, node, 1);
16883 xmlResetLastError();
16884 if (mem_base != xmlMemBlocks()) {
16885 printf("Leak of %d blocks found in xmlPatternMatch",
16886 xmlMemBlocks() - mem_base);
16888 printf(" %d", n_comp);
16889 printf(" %d", n_node);
16902 test_xmlPatternMaxDepth(void) {
16905 #if defined(LIBXML_PATTERN_ENABLED)
16908 xmlPatternPtr comp; /* the precompiled pattern */
16911 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16912 mem_base = xmlMemBlocks();
16913 comp = gen_xmlPatternPtr(n_comp, 0);
16915 ret_val = xmlPatternMaxDepth(comp);
16916 desret_int(ret_val);
16918 des_xmlPatternPtr(n_comp, comp, 0);
16919 xmlResetLastError();
16920 if (mem_base != xmlMemBlocks()) {
16921 printf("Leak of %d blocks found in xmlPatternMaxDepth",
16922 xmlMemBlocks() - mem_base);
16924 printf(" %d", n_comp);
16936 test_xmlPatternMinDepth(void) {
16939 #if defined(LIBXML_PATTERN_ENABLED)
16942 xmlPatternPtr comp; /* the precompiled pattern */
16945 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16946 mem_base = xmlMemBlocks();
16947 comp = gen_xmlPatternPtr(n_comp, 0);
16949 ret_val = xmlPatternMinDepth(comp);
16950 desret_int(ret_val);
16952 des_xmlPatternPtr(n_comp, comp, 0);
16953 xmlResetLastError();
16954 if (mem_base != xmlMemBlocks()) {
16955 printf("Leak of %d blocks found in xmlPatternMinDepth",
16956 xmlMemBlocks() - mem_base);
16958 printf(" %d", n_comp);
16970 test_xmlPatternStreamable(void) {
16973 #if defined(LIBXML_PATTERN_ENABLED)
16976 xmlPatternPtr comp; /* the precompiled pattern */
16979 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16980 mem_base = xmlMemBlocks();
16981 comp = gen_xmlPatternPtr(n_comp, 0);
16983 ret_val = xmlPatternStreamable(comp);
16984 desret_int(ret_val);
16986 des_xmlPatternPtr(n_comp, comp, 0);
16987 xmlResetLastError();
16988 if (mem_base != xmlMemBlocks()) {
16989 printf("Leak of %d blocks found in xmlPatternStreamable",
16990 xmlMemBlocks() - mem_base);
16992 printf(" %d", n_comp);
17004 test_xmlPatterncompile(void) {
17008 /* missing type support */
17012 #ifdef LIBXML_PATTERN_ENABLED
17014 #define gen_nb_xmlStreamCtxtPtr 1
17015 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17018 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17024 test_xmlStreamPop(void) {
17027 #if defined(LIBXML_PATTERN_ENABLED)
17030 xmlStreamCtxtPtr stream; /* the stream context */
17033 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17034 mem_base = xmlMemBlocks();
17035 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17037 ret_val = xmlStreamPop(stream);
17038 desret_int(ret_val);
17040 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17041 xmlResetLastError();
17042 if (mem_base != xmlMemBlocks()) {
17043 printf("Leak of %d blocks found in xmlStreamPop",
17044 xmlMemBlocks() - mem_base);
17046 printf(" %d", n_stream);
17058 test_xmlStreamPush(void) {
17061 #if defined(LIBXML_PATTERN_ENABLED)
17064 xmlStreamCtxtPtr stream; /* the stream context */
17066 xmlChar * name; /* the current name */
17068 xmlChar * ns; /* the namespace name */
17071 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17072 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17073 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17074 mem_base = xmlMemBlocks();
17075 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17076 name = gen_const_xmlChar_ptr(n_name, 1);
17077 ns = gen_const_xmlChar_ptr(n_ns, 2);
17079 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17080 desret_int(ret_val);
17082 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17083 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17084 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17085 xmlResetLastError();
17086 if (mem_base != xmlMemBlocks()) {
17087 printf("Leak of %d blocks found in xmlStreamPush",
17088 xmlMemBlocks() - mem_base);
17090 printf(" %d", n_stream);
17091 printf(" %d", n_name);
17092 printf(" %d", n_ns);
17106 test_xmlStreamPushAttr(void) {
17109 #if defined(LIBXML_PATTERN_ENABLED)
17112 xmlStreamCtxtPtr stream; /* the stream context */
17114 xmlChar * name; /* the current name */
17116 xmlChar * ns; /* the namespace name */
17119 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17120 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17121 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17122 mem_base = xmlMemBlocks();
17123 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17124 name = gen_const_xmlChar_ptr(n_name, 1);
17125 ns = gen_const_xmlChar_ptr(n_ns, 2);
17127 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17128 desret_int(ret_val);
17130 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17131 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17132 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17133 xmlResetLastError();
17134 if (mem_base != xmlMemBlocks()) {
17135 printf("Leak of %d blocks found in xmlStreamPushAttr",
17136 xmlMemBlocks() - mem_base);
17138 printf(" %d", n_stream);
17139 printf(" %d", n_name);
17140 printf(" %d", n_ns);
17154 test_xmlStreamPushNode(void) {
17157 #if defined(LIBXML_PATTERN_ENABLED)
17160 xmlStreamCtxtPtr stream; /* the stream context */
17162 xmlChar * name; /* the current name */
17164 xmlChar * ns; /* the namespace name */
17166 int nodeType; /* the type of the node being pushed */
17169 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17170 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17171 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17172 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17173 mem_base = xmlMemBlocks();
17174 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17175 name = gen_const_xmlChar_ptr(n_name, 1);
17176 ns = gen_const_xmlChar_ptr(n_ns, 2);
17177 nodeType = gen_int(n_nodeType, 3);
17179 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17180 desret_int(ret_val);
17182 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17183 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17184 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17185 des_int(n_nodeType, nodeType, 3);
17186 xmlResetLastError();
17187 if (mem_base != xmlMemBlocks()) {
17188 printf("Leak of %d blocks found in xmlStreamPushNode",
17189 xmlMemBlocks() - mem_base);
17191 printf(" %d", n_stream);
17192 printf(" %d", n_name);
17193 printf(" %d", n_ns);
17194 printf(" %d", n_nodeType);
17209 test_xmlStreamWantsAnyNode(void) {
17212 #if defined(LIBXML_PATTERN_ENABLED)
17215 xmlStreamCtxtPtr streamCtxt; /* the stream context */
17218 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17219 mem_base = xmlMemBlocks();
17220 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17222 ret_val = xmlStreamWantsAnyNode(streamCtxt);
17223 desret_int(ret_val);
17225 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17226 xmlResetLastError();
17227 if (mem_base != xmlMemBlocks()) {
17228 printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17229 xmlMemBlocks() - mem_base);
17231 printf(" %d", n_streamCtxt);
17242 test_pattern(void) {
17245 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17246 test_ret += test_xmlPatternFromRoot();
17247 test_ret += test_xmlPatternGetStreamCtxt();
17248 test_ret += test_xmlPatternMatch();
17249 test_ret += test_xmlPatternMaxDepth();
17250 test_ret += test_xmlPatternMinDepth();
17251 test_ret += test_xmlPatternStreamable();
17252 test_ret += test_xmlPatterncompile();
17253 test_ret += test_xmlStreamPop();
17254 test_ret += test_xmlStreamPush();
17255 test_ret += test_xmlStreamPushAttr();
17256 test_ret += test_xmlStreamPushNode();
17257 test_ret += test_xmlStreamWantsAnyNode();
17260 printf("Module pattern: %d errors\n", test_ret);
17263 #ifdef LIBXML_SCHEMAS_ENABLED
17265 #define gen_nb_xmlRelaxNGPtr 1
17266 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17269 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17275 test_xmlRelaxNGDump(void) {
17278 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17280 FILE * output; /* the file output */
17282 xmlRelaxNGPtr schema; /* a schema structure */
17285 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17286 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17287 mem_base = xmlMemBlocks();
17288 output = gen_FILE_ptr(n_output, 0);
17289 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17291 xmlRelaxNGDump(output, schema);
17293 des_FILE_ptr(n_output, output, 0);
17294 des_xmlRelaxNGPtr(n_schema, schema, 1);
17295 xmlResetLastError();
17296 if (mem_base != xmlMemBlocks()) {
17297 printf("Leak of %d blocks found in xmlRelaxNGDump",
17298 xmlMemBlocks() - mem_base);
17300 printf(" %d", n_output);
17301 printf(" %d", n_schema);
17314 test_xmlRelaxNGDumpTree(void) {
17317 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17319 FILE * output; /* the file output */
17321 xmlRelaxNGPtr schema; /* a schema structure */
17324 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17325 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17326 mem_base = xmlMemBlocks();
17327 output = gen_FILE_ptr(n_output, 0);
17328 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17330 xmlRelaxNGDumpTree(output, schema);
17332 des_FILE_ptr(n_output, output, 0);
17333 des_xmlRelaxNGPtr(n_schema, schema, 1);
17334 xmlResetLastError();
17335 if (mem_base != xmlMemBlocks()) {
17336 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17337 xmlMemBlocks() - mem_base);
17339 printf(" %d", n_output);
17340 printf(" %d", n_schema);
17351 #ifdef LIBXML_SCHEMAS_ENABLED
17353 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17354 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17357 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17361 #ifdef LIBXML_SCHEMAS_ENABLED
17363 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17364 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17367 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17371 #ifdef LIBXML_SCHEMAS_ENABLED
17373 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17374 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17377 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17383 test_xmlRelaxNGGetParserErrors(void) {
17386 #if defined(LIBXML_SCHEMAS_ENABLED)
17389 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17391 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17393 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17395 void ** ctx; /* contextual data for the callbacks result */
17398 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17399 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17400 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17401 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17402 mem_base = xmlMemBlocks();
17403 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17404 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17405 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17406 ctx = gen_void_ptr_ptr(n_ctx, 3);
17408 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17409 desret_int(ret_val);
17411 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17412 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17413 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17414 des_void_ptr_ptr(n_ctx, ctx, 3);
17415 xmlResetLastError();
17416 if (mem_base != xmlMemBlocks()) {
17417 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17418 xmlMemBlocks() - mem_base);
17420 printf(" %d", n_ctxt);
17421 printf(" %d", n_err);
17422 printf(" %d", n_warn);
17423 printf(" %d", n_ctx);
17436 #ifdef LIBXML_SCHEMAS_ENABLED
17438 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17439 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17442 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17448 test_xmlRelaxNGGetValidErrors(void) {
17451 #if defined(LIBXML_SCHEMAS_ENABLED)
17454 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17456 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17458 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17460 void ** ctx; /* the functions context result */
17463 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17464 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17465 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17466 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17467 mem_base = xmlMemBlocks();
17468 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17469 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17470 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17471 ctx = gen_void_ptr_ptr(n_ctx, 3);
17473 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17474 desret_int(ret_val);
17476 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17477 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17478 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17479 des_void_ptr_ptr(n_ctx, ctx, 3);
17480 xmlResetLastError();
17481 if (mem_base != xmlMemBlocks()) {
17482 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17483 xmlMemBlocks() - mem_base);
17485 printf(" %d", n_ctxt);
17486 printf(" %d", n_err);
17487 printf(" %d", n_warn);
17488 printf(" %d", n_ctx);
17503 test_xmlRelaxNGInitTypes(void) {
17506 #if defined(LIBXML_SCHEMAS_ENABLED)
17510 mem_base = xmlMemBlocks();
17512 ret_val = xmlRelaxNGInitTypes();
17513 desret_int(ret_val);
17515 xmlResetLastError();
17516 if (mem_base != xmlMemBlocks()) {
17517 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17518 xmlMemBlocks() - mem_base);
17530 test_xmlRelaxNGNewDocParserCtxt(void) {
17533 #if defined(LIBXML_SCHEMAS_ENABLED)
17535 xmlRelaxNGParserCtxtPtr ret_val;
17536 xmlDocPtr doc; /* a preparsed document tree */
17539 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17540 mem_base = xmlMemBlocks();
17541 doc = gen_xmlDocPtr(n_doc, 0);
17543 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17544 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17546 des_xmlDocPtr(n_doc, doc, 0);
17547 xmlResetLastError();
17548 if (mem_base != xmlMemBlocks()) {
17549 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17550 xmlMemBlocks() - mem_base);
17552 printf(" %d", n_doc);
17564 test_xmlRelaxNGNewMemParserCtxt(void) {
17567 #if defined(LIBXML_SCHEMAS_ENABLED)
17569 xmlRelaxNGParserCtxtPtr ret_val;
17570 char * buffer; /* a pointer to a char array containing the schemas */
17572 int size; /* the size of the array */
17575 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17576 for (n_size = 0;n_size < gen_nb_int;n_size++) {
17577 mem_base = xmlMemBlocks();
17578 buffer = gen_const_char_ptr(n_buffer, 0);
17579 size = gen_int(n_size, 1);
17581 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17582 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17584 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17585 des_int(n_size, size, 1);
17586 xmlResetLastError();
17587 if (mem_base != xmlMemBlocks()) {
17588 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17589 xmlMemBlocks() - mem_base);
17591 printf(" %d", n_buffer);
17592 printf(" %d", n_size);
17605 test_xmlRelaxNGNewParserCtxt(void) {
17608 #if defined(LIBXML_SCHEMAS_ENABLED)
17610 xmlRelaxNGParserCtxtPtr ret_val;
17611 char * URL; /* the location of the schema */
17614 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17615 mem_base = xmlMemBlocks();
17616 URL = gen_const_char_ptr(n_URL, 0);
17618 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17619 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17621 des_const_char_ptr(n_URL, (const char *)URL, 0);
17622 xmlResetLastError();
17623 if (mem_base != xmlMemBlocks()) {
17624 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17625 xmlMemBlocks() - mem_base);
17627 printf(" %d", n_URL);
17639 test_xmlRelaxNGNewValidCtxt(void) {
17643 /* missing type support */
17649 test_xmlRelaxNGParse(void) {
17653 /* missing type support */
17659 test_xmlRelaxNGSetParserErrors(void) {
17663 /* missing type support */
17669 test_xmlRelaxNGSetParserStructuredErrors(void) {
17673 /* missing type support */
17679 test_xmlRelaxNGSetValidErrors(void) {
17683 /* missing type support */
17689 test_xmlRelaxNGSetValidStructuredErrors(void) {
17693 /* missing type support */
17699 test_xmlRelaxNGValidateDoc(void) {
17702 #if defined(LIBXML_SCHEMAS_ENABLED)
17705 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17707 xmlDocPtr doc; /* a parsed document tree */
17710 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17711 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17712 mem_base = xmlMemBlocks();
17713 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17714 doc = gen_xmlDocPtr(n_doc, 1);
17716 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17717 desret_int(ret_val);
17719 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17720 des_xmlDocPtr(n_doc, doc, 1);
17721 xmlResetLastError();
17722 if (mem_base != xmlMemBlocks()) {
17723 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17724 xmlMemBlocks() - mem_base);
17726 printf(" %d", n_ctxt);
17727 printf(" %d", n_doc);
17740 test_xmlRelaxNGValidateFullElement(void) {
17743 #if defined(LIBXML_SCHEMAS_ENABLED)
17746 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17748 xmlDocPtr doc; /* a document instance */
17750 xmlNodePtr elem; /* an element instance */
17753 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17754 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17755 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17756 mem_base = xmlMemBlocks();
17757 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17758 doc = gen_xmlDocPtr(n_doc, 1);
17759 elem = gen_xmlNodePtr(n_elem, 2);
17761 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17762 desret_int(ret_val);
17764 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17765 des_xmlDocPtr(n_doc, doc, 1);
17766 des_xmlNodePtr(n_elem, elem, 2);
17767 xmlResetLastError();
17768 if (mem_base != xmlMemBlocks()) {
17769 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17770 xmlMemBlocks() - mem_base);
17772 printf(" %d", n_ctxt);
17773 printf(" %d", n_doc);
17774 printf(" %d", n_elem);
17788 test_xmlRelaxNGValidatePopElement(void) {
17791 #if defined(LIBXML_SCHEMAS_ENABLED)
17794 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17796 xmlDocPtr doc; /* a document instance */
17798 xmlNodePtr elem; /* an element instance */
17801 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17802 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17803 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17804 mem_base = xmlMemBlocks();
17805 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17806 doc = gen_xmlDocPtr(n_doc, 1);
17807 elem = gen_xmlNodePtr(n_elem, 2);
17809 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17810 desret_int(ret_val);
17812 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17813 des_xmlDocPtr(n_doc, doc, 1);
17814 des_xmlNodePtr(n_elem, elem, 2);
17815 xmlResetLastError();
17816 if (mem_base != xmlMemBlocks()) {
17817 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17818 xmlMemBlocks() - mem_base);
17820 printf(" %d", n_ctxt);
17821 printf(" %d", n_doc);
17822 printf(" %d", n_elem);
17836 test_xmlRelaxNGValidatePushCData(void) {
17839 #if defined(LIBXML_SCHEMAS_ENABLED)
17842 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17844 xmlChar * data; /* some character data read */
17846 int len; /* the lenght of the data */
17849 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17850 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17851 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17852 mem_base = xmlMemBlocks();
17853 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17854 data = gen_const_xmlChar_ptr(n_data, 1);
17855 len = gen_int(n_len, 2);
17857 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17858 desret_int(ret_val);
17860 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17861 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17862 des_int(n_len, len, 2);
17863 xmlResetLastError();
17864 if (mem_base != xmlMemBlocks()) {
17865 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17866 xmlMemBlocks() - mem_base);
17868 printf(" %d", n_ctxt);
17869 printf(" %d", n_data);
17870 printf(" %d", n_len);
17884 test_xmlRelaxNGValidatePushElement(void) {
17887 #if defined(LIBXML_SCHEMAS_ENABLED)
17890 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17892 xmlDocPtr doc; /* a document instance */
17894 xmlNodePtr elem; /* an element instance */
17897 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17898 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17899 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17900 mem_base = xmlMemBlocks();
17901 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17902 doc = gen_xmlDocPtr(n_doc, 1);
17903 elem = gen_xmlNodePtr(n_elem, 2);
17905 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17906 desret_int(ret_val);
17908 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17909 des_xmlDocPtr(n_doc, doc, 1);
17910 des_xmlNodePtr(n_elem, elem, 2);
17911 xmlResetLastError();
17912 if (mem_base != xmlMemBlocks()) {
17913 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17914 xmlMemBlocks() - mem_base);
17916 printf(" %d", n_ctxt);
17917 printf(" %d", n_doc);
17918 printf(" %d", n_elem);
17932 test_xmlRelaxParserSetFlag(void) {
17935 #if defined(LIBXML_SCHEMAS_ENABLED)
17938 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17940 int flags; /* a set of flags values */
17943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17944 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17945 mem_base = xmlMemBlocks();
17946 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17947 flags = gen_int(n_flags, 1);
17949 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17950 desret_int(ret_val);
17952 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17953 des_int(n_flags, flags, 1);
17954 xmlResetLastError();
17955 if (mem_base != xmlMemBlocks()) {
17956 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17957 xmlMemBlocks() - mem_base);
17959 printf(" %d", n_ctxt);
17960 printf(" %d", n_flags);
17972 test_relaxng(void) {
17975 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17976 test_ret += test_xmlRelaxNGDump();
17977 test_ret += test_xmlRelaxNGDumpTree();
17978 test_ret += test_xmlRelaxNGGetParserErrors();
17979 test_ret += test_xmlRelaxNGGetValidErrors();
17980 test_ret += test_xmlRelaxNGInitTypes();
17981 test_ret += test_xmlRelaxNGNewDocParserCtxt();
17982 test_ret += test_xmlRelaxNGNewMemParserCtxt();
17983 test_ret += test_xmlRelaxNGNewParserCtxt();
17984 test_ret += test_xmlRelaxNGNewValidCtxt();
17985 test_ret += test_xmlRelaxNGParse();
17986 test_ret += test_xmlRelaxNGSetParserErrors();
17987 test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17988 test_ret += test_xmlRelaxNGSetValidErrors();
17989 test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17990 test_ret += test_xmlRelaxNGValidateDoc();
17991 test_ret += test_xmlRelaxNGValidateFullElement();
17992 test_ret += test_xmlRelaxNGValidatePopElement();
17993 test_ret += test_xmlRelaxNGValidatePushCData();
17994 test_ret += test_xmlRelaxNGValidatePushElement();
17995 test_ret += test_xmlRelaxParserSetFlag();
17998 printf("Module relaxng: %d errors\n", test_ret);
18002 test_schemasInternals(void) {
18005 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18008 printf("Module schemasInternals: %d errors\n", test_ret);
18013 test_xmlSchematronNewDocParserCtxt(void) {
18017 /* missing type support */
18023 test_xmlSchematronNewMemParserCtxt(void) {
18027 /* missing type support */
18033 test_xmlSchematronNewParserCtxt(void) {
18037 /* missing type support */
18041 #ifdef LIBXML_SCHEMATRON_ENABLED
18043 #define gen_nb_xmlSchematronPtr 1
18044 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18047 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18053 test_xmlSchematronNewValidCtxt(void) {
18057 /* missing type support */
18061 #ifdef LIBXML_SCHEMATRON_ENABLED
18063 #define gen_nb_xmlSchematronParserCtxtPtr 1
18064 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18067 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18073 test_xmlSchematronParse(void) {
18077 /* missing type support */
18081 #ifdef LIBXML_SCHEMATRON_ENABLED
18083 #define gen_nb_xmlSchematronValidCtxtPtr 1
18084 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18087 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18093 test_xmlSchematronSetValidStructuredErrors(void) {
18097 /* missing type support */
18103 test_xmlSchematronValidateDoc(void) {
18106 #if defined(LIBXML_SCHEMATRON_ENABLED)
18109 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18111 xmlDocPtr instance; /* the document instace tree */
18114 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18115 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18116 mem_base = xmlMemBlocks();
18117 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18118 instance = gen_xmlDocPtr(n_instance, 1);
18120 ret_val = xmlSchematronValidateDoc(ctxt, instance);
18121 desret_int(ret_val);
18123 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18124 des_xmlDocPtr(n_instance, instance, 1);
18125 xmlResetLastError();
18126 if (mem_base != xmlMemBlocks()) {
18127 printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18128 xmlMemBlocks() - mem_base);
18130 printf(" %d", n_ctxt);
18131 printf(" %d", n_instance);
18143 test_schematron(void) {
18146 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18147 test_ret += test_xmlSchematronNewDocParserCtxt();
18148 test_ret += test_xmlSchematronNewMemParserCtxt();
18149 test_ret += test_xmlSchematronNewParserCtxt();
18150 test_ret += test_xmlSchematronNewValidCtxt();
18151 test_ret += test_xmlSchematronParse();
18152 test_ret += test_xmlSchematronSetValidStructuredErrors();
18153 test_ret += test_xmlSchematronValidateDoc();
18156 printf("Module schematron: %d errors\n", test_ret);
18161 test_xmlAddChild(void) {
18165 xmlNodePtr ret_val;
18166 xmlNodePtr parent; /* the parent node */
18168 xmlNodePtr cur; /* the child node */
18171 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18172 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18173 mem_base = xmlMemBlocks();
18174 parent = gen_xmlNodePtr(n_parent, 0);
18175 cur = gen_xmlNodePtr_in(n_cur, 1);
18177 ret_val = xmlAddChild(parent, cur);
18178 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18179 desret_xmlNodePtr(ret_val);
18181 des_xmlNodePtr(n_parent, parent, 0);
18182 des_xmlNodePtr_in(n_cur, cur, 1);
18183 xmlResetLastError();
18184 if (mem_base != xmlMemBlocks()) {
18185 printf("Leak of %d blocks found in xmlAddChild",
18186 xmlMemBlocks() - mem_base);
18188 printf(" %d", n_parent);
18189 printf(" %d", n_cur);
18201 test_xmlAddChildList(void) {
18205 xmlNodePtr ret_val;
18206 xmlNodePtr parent; /* the parent node */
18208 xmlNodePtr cur; /* the first node in the list */
18211 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18212 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18213 mem_base = xmlMemBlocks();
18214 parent = gen_xmlNodePtr(n_parent, 0);
18215 cur = gen_xmlNodePtr_in(n_cur, 1);
18217 ret_val = xmlAddChildList(parent, cur);
18218 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18219 desret_xmlNodePtr(ret_val);
18221 des_xmlNodePtr(n_parent, parent, 0);
18222 des_xmlNodePtr_in(n_cur, cur, 1);
18223 xmlResetLastError();
18224 if (mem_base != xmlMemBlocks()) {
18225 printf("Leak of %d blocks found in xmlAddChildList",
18226 xmlMemBlocks() - mem_base);
18228 printf(" %d", n_parent);
18229 printf(" %d", n_cur);
18241 test_xmlAddNextSibling(void) {
18245 xmlNodePtr ret_val;
18246 xmlNodePtr cur; /* the child node */
18248 xmlNodePtr elem; /* the new node */
18251 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18252 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18253 mem_base = xmlMemBlocks();
18254 cur = gen_xmlNodePtr(n_cur, 0);
18255 elem = gen_xmlNodePtr_in(n_elem, 1);
18257 ret_val = xmlAddNextSibling(cur, elem);
18258 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18259 desret_xmlNodePtr(ret_val);
18261 des_xmlNodePtr(n_cur, cur, 0);
18262 des_xmlNodePtr_in(n_elem, elem, 1);
18263 xmlResetLastError();
18264 if (mem_base != xmlMemBlocks()) {
18265 printf("Leak of %d blocks found in xmlAddNextSibling",
18266 xmlMemBlocks() - mem_base);
18268 printf(" %d", n_cur);
18269 printf(" %d", n_elem);
18281 test_xmlAddPrevSibling(void) {
18284 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18286 xmlNodePtr ret_val;
18287 xmlNodePtr cur; /* the child node */
18289 xmlNodePtr elem; /* the new node */
18292 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18293 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18294 mem_base = xmlMemBlocks();
18295 cur = gen_xmlNodePtr(n_cur, 0);
18296 elem = gen_xmlNodePtr_in(n_elem, 1);
18298 ret_val = xmlAddPrevSibling(cur, elem);
18299 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18300 desret_xmlNodePtr(ret_val);
18302 des_xmlNodePtr(n_cur, cur, 0);
18303 des_xmlNodePtr_in(n_elem, elem, 1);
18304 xmlResetLastError();
18305 if (mem_base != xmlMemBlocks()) {
18306 printf("Leak of %d blocks found in xmlAddPrevSibling",
18307 xmlMemBlocks() - mem_base);
18309 printf(" %d", n_cur);
18310 printf(" %d", n_elem);
18323 test_xmlAddSibling(void) {
18327 xmlNodePtr ret_val;
18328 xmlNodePtr cur; /* the child node */
18330 xmlNodePtr elem; /* the new node */
18333 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18334 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18335 mem_base = xmlMemBlocks();
18336 cur = gen_xmlNodePtr(n_cur, 0);
18337 elem = gen_xmlNodePtr_in(n_elem, 1);
18339 ret_val = xmlAddSibling(cur, elem);
18340 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18341 desret_xmlNodePtr(ret_val);
18343 des_xmlNodePtr(n_cur, cur, 0);
18344 des_xmlNodePtr_in(n_elem, elem, 1);
18345 xmlResetLastError();
18346 if (mem_base != xmlMemBlocks()) {
18347 printf("Leak of %d blocks found in xmlAddSibling",
18348 xmlMemBlocks() - mem_base);
18350 printf(" %d", n_cur);
18351 printf(" %d", n_elem);
18363 test_xmlAttrSerializeTxtContent(void) {
18366 #if defined(LIBXML_OUTPUT_ENABLED)
18367 #ifdef LIBXML_OUTPUT_ENABLED
18369 xmlBufferPtr buf; /* the XML buffer output */
18371 xmlDocPtr doc; /* the document */
18373 xmlAttrPtr attr; /* the attribute node */
18375 xmlChar * string; /* the text content */
18378 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18379 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18380 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18381 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18382 mem_base = xmlMemBlocks();
18383 buf = gen_xmlBufferPtr(n_buf, 0);
18384 doc = gen_xmlDocPtr(n_doc, 1);
18385 attr = gen_xmlAttrPtr(n_attr, 2);
18386 string = gen_const_xmlChar_ptr(n_string, 3);
18388 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18390 des_xmlBufferPtr(n_buf, buf, 0);
18391 des_xmlDocPtr(n_doc, doc, 1);
18392 des_xmlAttrPtr(n_attr, attr, 2);
18393 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18394 xmlResetLastError();
18395 if (mem_base != xmlMemBlocks()) {
18396 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18397 xmlMemBlocks() - mem_base);
18399 printf(" %d", n_buf);
18400 printf(" %d", n_doc);
18401 printf(" %d", n_attr);
18402 printf(" %d", n_string);
18418 test_xmlBufferAdd(void) {
18423 xmlBufferPtr buf; /* the buffer to dump */
18425 xmlChar * str; /* the #xmlChar string */
18427 int len; /* the number of #xmlChar to add */
18430 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18431 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18432 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18433 mem_base = xmlMemBlocks();
18434 buf = gen_xmlBufferPtr(n_buf, 0);
18435 str = gen_const_xmlChar_ptr(n_str, 1);
18436 len = gen_int(n_len, 2);
18438 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18439 desret_int(ret_val);
18441 des_xmlBufferPtr(n_buf, buf, 0);
18442 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18443 des_int(n_len, len, 2);
18444 xmlResetLastError();
18445 if (mem_base != xmlMemBlocks()) {
18446 printf("Leak of %d blocks found in xmlBufferAdd",
18447 xmlMemBlocks() - mem_base);
18449 printf(" %d", n_buf);
18450 printf(" %d", n_str);
18451 printf(" %d", n_len);
18464 test_xmlBufferAddHead(void) {
18469 xmlBufferPtr buf; /* the buffer */
18471 xmlChar * str; /* the #xmlChar string */
18473 int len; /* the number of #xmlChar to add */
18476 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18477 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18478 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18479 mem_base = xmlMemBlocks();
18480 buf = gen_xmlBufferPtr(n_buf, 0);
18481 str = gen_const_xmlChar_ptr(n_str, 1);
18482 len = gen_int(n_len, 2);
18484 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18485 desret_int(ret_val);
18487 des_xmlBufferPtr(n_buf, buf, 0);
18488 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18489 des_int(n_len, len, 2);
18490 xmlResetLastError();
18491 if (mem_base != xmlMemBlocks()) {
18492 printf("Leak of %d blocks found in xmlBufferAddHead",
18493 xmlMemBlocks() - mem_base);
18495 printf(" %d", n_buf);
18496 printf(" %d", n_str);
18497 printf(" %d", n_len);
18510 test_xmlBufferCCat(void) {
18515 xmlBufferPtr buf; /* the buffer to dump */
18517 char * str; /* the C char string */
18520 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18521 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18522 mem_base = xmlMemBlocks();
18523 buf = gen_xmlBufferPtr(n_buf, 0);
18524 str = gen_const_char_ptr(n_str, 1);
18526 ret_val = xmlBufferCCat(buf, (const char *)str);
18527 desret_int(ret_val);
18529 des_xmlBufferPtr(n_buf, buf, 0);
18530 des_const_char_ptr(n_str, (const char *)str, 1);
18531 xmlResetLastError();
18532 if (mem_base != xmlMemBlocks()) {
18533 printf("Leak of %d blocks found in xmlBufferCCat",
18534 xmlMemBlocks() - mem_base);
18536 printf(" %d", n_buf);
18537 printf(" %d", n_str);
18549 test_xmlBufferCat(void) {
18554 xmlBufferPtr buf; /* the buffer to add to */
18556 xmlChar * str; /* the #xmlChar string */
18559 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18560 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18561 mem_base = xmlMemBlocks();
18562 buf = gen_xmlBufferPtr(n_buf, 0);
18563 str = gen_const_xmlChar_ptr(n_str, 1);
18565 ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18566 desret_int(ret_val);
18568 des_xmlBufferPtr(n_buf, buf, 0);
18569 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18570 xmlResetLastError();
18571 if (mem_base != xmlMemBlocks()) {
18572 printf("Leak of %d blocks found in xmlBufferCat",
18573 xmlMemBlocks() - mem_base);
18575 printf(" %d", n_buf);
18576 printf(" %d", n_str);
18587 #define gen_nb_const_xmlBufferPtr 1
18588 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18591 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18595 test_xmlBufferContent(void) {
18599 const xmlChar * ret_val;
18600 xmlBufferPtr buf; /* the buffer */
18603 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18604 mem_base = xmlMemBlocks();
18605 buf = gen_const_xmlBufferPtr(n_buf, 0);
18607 ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18608 desret_const_xmlChar_ptr(ret_val);
18610 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18611 xmlResetLastError();
18612 if (mem_base != xmlMemBlocks()) {
18613 printf("Leak of %d blocks found in xmlBufferContent",
18614 xmlMemBlocks() - mem_base);
18616 printf(" %d", n_buf);
18627 test_xmlBufferCreate(void) {
18631 xmlBufferPtr ret_val;
18633 mem_base = xmlMemBlocks();
18635 ret_val = xmlBufferCreate();
18636 desret_xmlBufferPtr(ret_val);
18638 xmlResetLastError();
18639 if (mem_base != xmlMemBlocks()) {
18640 printf("Leak of %d blocks found in xmlBufferCreate",
18641 xmlMemBlocks() - mem_base);
18652 test_xmlBufferCreateSize(void) {
18656 /* missing type support */
18662 test_xmlBufferCreateStatic(void) {
18666 /* missing type support */
18672 test_xmlBufferEmpty(void) {
18676 xmlBufferPtr buf; /* the buffer */
18679 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18680 mem_base = xmlMemBlocks();
18681 buf = gen_xmlBufferPtr(n_buf, 0);
18683 xmlBufferEmpty(buf);
18685 des_xmlBufferPtr(n_buf, buf, 0);
18686 xmlResetLastError();
18687 if (mem_base != xmlMemBlocks()) {
18688 printf("Leak of %d blocks found in xmlBufferEmpty",
18689 xmlMemBlocks() - mem_base);
18691 printf(" %d", n_buf);
18702 test_xmlBufferGrow(void) {
18707 xmlBufferPtr buf; /* the buffer */
18709 unsigned int len; /* the minimum free size to allocate */
18712 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18713 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18714 mem_base = xmlMemBlocks();
18715 buf = gen_xmlBufferPtr(n_buf, 0);
18716 len = gen_unsigned_int(n_len, 1);
18718 ret_val = xmlBufferGrow(buf, len);
18719 desret_int(ret_val);
18721 des_xmlBufferPtr(n_buf, buf, 0);
18722 des_unsigned_int(n_len, len, 1);
18723 xmlResetLastError();
18724 if (mem_base != xmlMemBlocks()) {
18725 printf("Leak of %d blocks found in xmlBufferGrow",
18726 xmlMemBlocks() - mem_base);
18728 printf(" %d", n_buf);
18729 printf(" %d", n_len);
18741 test_xmlBufferLength(void) {
18746 xmlBufferPtr buf; /* the buffer */
18749 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18750 mem_base = xmlMemBlocks();
18751 buf = gen_const_xmlBufferPtr(n_buf, 0);
18753 ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18754 desret_int(ret_val);
18756 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18757 xmlResetLastError();
18758 if (mem_base != xmlMemBlocks()) {
18759 printf("Leak of %d blocks found in xmlBufferLength",
18760 xmlMemBlocks() - mem_base);
18762 printf(" %d", n_buf);
18773 test_xmlBufferResize(void) {
18778 xmlBufferPtr buf; /* the buffer to resize */
18780 unsigned int size; /* the desired size */
18783 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18784 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18785 mem_base = xmlMemBlocks();
18786 buf = gen_xmlBufferPtr(n_buf, 0);
18787 size = gen_unsigned_int(n_size, 1);
18789 ret_val = xmlBufferResize(buf, size);
18790 desret_int(ret_val);
18792 des_xmlBufferPtr(n_buf, buf, 0);
18793 des_unsigned_int(n_size, size, 1);
18794 xmlResetLastError();
18795 if (mem_base != xmlMemBlocks()) {
18796 printf("Leak of %d blocks found in xmlBufferResize",
18797 xmlMemBlocks() - mem_base);
18799 printf(" %d", n_buf);
18800 printf(" %d", n_size);
18812 test_xmlBufferSetAllocationScheme(void) {
18816 xmlBufferPtr buf; /* the buffer to tune */
18818 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18821 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18822 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18823 mem_base = xmlMemBlocks();
18824 buf = gen_xmlBufferPtr(n_buf, 0);
18825 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18827 xmlBufferSetAllocationScheme(buf, scheme);
18828 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18830 des_xmlBufferPtr(n_buf, buf, 0);
18831 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18832 xmlResetLastError();
18833 if (mem_base != xmlMemBlocks()) {
18834 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18835 xmlMemBlocks() - mem_base);
18837 printf(" %d", n_buf);
18838 printf(" %d", n_scheme);
18850 test_xmlBufferShrink(void) {
18855 xmlBufferPtr buf; /* the buffer to dump */
18857 unsigned int len; /* the number of xmlChar to remove */
18860 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18861 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18862 mem_base = xmlMemBlocks();
18863 buf = gen_xmlBufferPtr(n_buf, 0);
18864 len = gen_unsigned_int(n_len, 1);
18866 ret_val = xmlBufferShrink(buf, len);
18867 desret_int(ret_val);
18869 des_xmlBufferPtr(n_buf, buf, 0);
18870 des_unsigned_int(n_len, len, 1);
18871 xmlResetLastError();
18872 if (mem_base != xmlMemBlocks()) {
18873 printf("Leak of %d blocks found in xmlBufferShrink",
18874 xmlMemBlocks() - mem_base);
18876 printf(" %d", n_buf);
18877 printf(" %d", n_len);
18889 test_xmlBufferWriteCHAR(void) {
18893 xmlBufferPtr buf; /* the XML buffer */
18895 xmlChar * string; /* the string to add */
18898 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18899 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18900 mem_base = xmlMemBlocks();
18901 buf = gen_xmlBufferPtr(n_buf, 0);
18902 string = gen_const_xmlChar_ptr(n_string, 1);
18904 xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18906 des_xmlBufferPtr(n_buf, buf, 0);
18907 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18908 xmlResetLastError();
18909 if (mem_base != xmlMemBlocks()) {
18910 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18911 xmlMemBlocks() - mem_base);
18913 printf(" %d", n_buf);
18914 printf(" %d", n_string);
18926 test_xmlBufferWriteChar(void) {
18930 xmlBufferPtr buf; /* the XML buffer output */
18932 char * string; /* the string to add */
18935 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18936 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18937 mem_base = xmlMemBlocks();
18938 buf = gen_xmlBufferPtr(n_buf, 0);
18939 string = gen_const_char_ptr(n_string, 1);
18941 xmlBufferWriteChar(buf, (const char *)string);
18943 des_xmlBufferPtr(n_buf, buf, 0);
18944 des_const_char_ptr(n_string, (const char *)string, 1);
18945 xmlResetLastError();
18946 if (mem_base != xmlMemBlocks()) {
18947 printf("Leak of %d blocks found in xmlBufferWriteChar",
18948 xmlMemBlocks() - mem_base);
18950 printf(" %d", n_buf);
18951 printf(" %d", n_string);
18963 test_xmlBufferWriteQuotedString(void) {
18967 xmlBufferPtr buf; /* the XML buffer output */
18969 xmlChar * string; /* the string to add */
18972 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18973 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18974 mem_base = xmlMemBlocks();
18975 buf = gen_xmlBufferPtr(n_buf, 0);
18976 string = gen_const_xmlChar_ptr(n_string, 1);
18978 xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18980 des_xmlBufferPtr(n_buf, buf, 0);
18981 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18982 xmlResetLastError();
18983 if (mem_base != xmlMemBlocks()) {
18984 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18985 xmlMemBlocks() - mem_base);
18987 printf(" %d", n_buf);
18988 printf(" %d", n_string);
19000 test_xmlBuildQName(void) {
19005 xmlChar * ncname; /* the Name */
19007 xmlChar * prefix; /* the prefix */
19009 xmlChar * memory; /* preallocated memory */
19011 int len; /* preallocated memory length */
19014 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19015 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19016 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19017 for (n_len = 0;n_len < gen_nb_int;n_len++) {
19018 mem_base = xmlMemBlocks();
19019 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19020 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19021 memory = gen_xmlChar_ptr(n_memory, 2);
19022 len = gen_int(n_len, 3);
19024 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19025 if ((ret_val != NULL) && (ret_val != ncname) &&
19026 (ret_val != prefix) && (ret_val != memory))
19029 desret_xmlChar_ptr(ret_val);
19031 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19032 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19033 des_xmlChar_ptr(n_memory, memory, 2);
19034 des_int(n_len, len, 3);
19035 xmlResetLastError();
19036 if (mem_base != xmlMemBlocks()) {
19037 printf("Leak of %d blocks found in xmlBuildQName",
19038 xmlMemBlocks() - mem_base);
19040 printf(" %d", n_ncname);
19041 printf(" %d", n_prefix);
19042 printf(" %d", n_memory);
19043 printf(" %d", n_len);
19057 test_xmlChildElementCount(void) {
19060 #if defined(LIBXML_TREE_ENABLED)
19062 unsigned long ret_val;
19063 xmlNodePtr parent; /* the parent node */
19066 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19067 mem_base = xmlMemBlocks();
19068 parent = gen_xmlNodePtr(n_parent, 0);
19070 ret_val = xmlChildElementCount(parent);
19071 desret_unsigned_long(ret_val);
19073 des_xmlNodePtr(n_parent, parent, 0);
19074 xmlResetLastError();
19075 if (mem_base != xmlMemBlocks()) {
19076 printf("Leak of %d blocks found in xmlChildElementCount",
19077 xmlMemBlocks() - mem_base);
19079 printf(" %d", n_parent);
19091 test_xmlCopyDoc(void) {
19094 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19097 xmlDocPtr doc; /* the document */
19099 int recursive; /* if not zero do a recursive copy. */
19102 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19103 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19104 mem_base = xmlMemBlocks();
19105 doc = gen_xmlDocPtr(n_doc, 0);
19106 recursive = gen_int(n_recursive, 1);
19108 ret_val = xmlCopyDoc(doc, recursive);
19109 desret_xmlDocPtr(ret_val);
19111 des_xmlDocPtr(n_doc, doc, 0);
19112 des_int(n_recursive, recursive, 1);
19113 xmlResetLastError();
19114 if (mem_base != xmlMemBlocks()) {
19115 printf("Leak of %d blocks found in xmlCopyDoc",
19116 xmlMemBlocks() - mem_base);
19118 printf(" %d", n_doc);
19119 printf(" %d", n_recursive);
19132 test_xmlCopyDtd(void) {
19135 #if defined(LIBXML_TREE_ENABLED)
19138 xmlDtdPtr dtd; /* the dtd */
19141 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19142 mem_base = xmlMemBlocks();
19143 dtd = gen_xmlDtdPtr(n_dtd, 0);
19145 ret_val = xmlCopyDtd(dtd);
19146 desret_xmlDtdPtr(ret_val);
19148 des_xmlDtdPtr(n_dtd, dtd, 0);
19149 xmlResetLastError();
19150 if (mem_base != xmlMemBlocks()) {
19151 printf("Leak of %d blocks found in xmlCopyDtd",
19152 xmlMemBlocks() - mem_base);
19154 printf(" %d", n_dtd);
19166 test_xmlCopyNamespace(void) {
19171 xmlNsPtr cur; /* the namespace */
19174 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19175 mem_base = xmlMemBlocks();
19176 cur = gen_xmlNsPtr(n_cur, 0);
19178 ret_val = xmlCopyNamespace(cur);
19179 if (ret_val != NULL) xmlFreeNs(ret_val);
19180 desret_xmlNsPtr(ret_val);
19182 des_xmlNsPtr(n_cur, cur, 0);
19183 xmlResetLastError();
19184 if (mem_base != xmlMemBlocks()) {
19185 printf("Leak of %d blocks found in xmlCopyNamespace",
19186 xmlMemBlocks() - mem_base);
19188 printf(" %d", n_cur);
19199 test_xmlCopyNamespaceList(void) {
19204 xmlNsPtr cur; /* the first namespace */
19207 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19208 mem_base = xmlMemBlocks();
19209 cur = gen_xmlNsPtr(n_cur, 0);
19211 ret_val = xmlCopyNamespaceList(cur);
19212 if (ret_val != NULL) xmlFreeNsList(ret_val);
19213 desret_xmlNsPtr(ret_val);
19215 des_xmlNsPtr(n_cur, cur, 0);
19216 xmlResetLastError();
19217 if (mem_base != xmlMemBlocks()) {
19218 printf("Leak of %d blocks found in xmlCopyNamespaceList",
19219 xmlMemBlocks() - mem_base);
19221 printf(" %d", n_cur);
19232 test_xmlCopyNode(void) {
19236 xmlNodePtr ret_val;
19237 xmlNodePtr node; /* the node */
19239 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19242 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19243 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19244 mem_base = xmlMemBlocks();
19245 node = gen_const_xmlNodePtr(n_node, 0);
19246 extended = gen_int(n_extended, 1);
19248 ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19249 desret_xmlNodePtr(ret_val);
19251 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19252 des_int(n_extended, extended, 1);
19253 xmlResetLastError();
19254 if (mem_base != xmlMemBlocks()) {
19255 printf("Leak of %d blocks found in xmlCopyNode",
19256 xmlMemBlocks() - mem_base);
19258 printf(" %d", n_node);
19259 printf(" %d", n_extended);
19271 test_xmlCopyNodeList(void) {
19275 xmlNodePtr ret_val;
19276 xmlNodePtr node; /* the first node in the list. */
19279 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19280 mem_base = xmlMemBlocks();
19281 node = gen_const_xmlNodePtr(n_node, 0);
19283 ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19284 desret_xmlNodePtr(ret_val);
19286 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19287 xmlResetLastError();
19288 if (mem_base != xmlMemBlocks()) {
19289 printf("Leak of %d blocks found in xmlCopyNodeList",
19290 xmlMemBlocks() - mem_base);
19292 printf(" %d", n_node);
19303 test_xmlCopyProp(void) {
19307 xmlAttrPtr ret_val;
19308 xmlNodePtr target; /* the element where the attribute will be grafted */
19310 xmlAttrPtr cur; /* the attribute */
19313 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19314 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19315 mem_base = xmlMemBlocks();
19316 target = gen_xmlNodePtr(n_target, 0);
19317 cur = gen_xmlAttrPtr(n_cur, 1);
19319 ret_val = xmlCopyProp(target, cur);
19320 desret_xmlAttrPtr(ret_val);
19322 des_xmlNodePtr(n_target, target, 0);
19323 des_xmlAttrPtr(n_cur, cur, 1);
19324 xmlResetLastError();
19325 if (mem_base != xmlMemBlocks()) {
19326 printf("Leak of %d blocks found in xmlCopyProp",
19327 xmlMemBlocks() - mem_base);
19329 printf(" %d", n_target);
19330 printf(" %d", n_cur);
19342 test_xmlCopyPropList(void) {
19346 xmlAttrPtr ret_val;
19347 xmlNodePtr target; /* the element where the attributes will be grafted */
19349 xmlAttrPtr cur; /* the first attribute */
19352 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19353 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19354 mem_base = xmlMemBlocks();
19355 target = gen_xmlNodePtr(n_target, 0);
19356 cur = gen_xmlAttrPtr(n_cur, 1);
19358 ret_val = xmlCopyPropList(target, cur);
19359 desret_xmlAttrPtr(ret_val);
19361 des_xmlNodePtr(n_target, target, 0);
19362 des_xmlAttrPtr(n_cur, cur, 1);
19363 xmlResetLastError();
19364 if (mem_base != xmlMemBlocks()) {
19365 printf("Leak of %d blocks found in xmlCopyPropList",
19366 xmlMemBlocks() - mem_base);
19368 printf(" %d", n_target);
19369 printf(" %d", n_cur);
19381 test_xmlCreateIntSubset(void) {
19386 xmlDocPtr doc; /* the document pointer */
19388 xmlChar * name; /* the DTD name */
19390 xmlChar * ExternalID; /* the external (PUBLIC) ID */
19392 xmlChar * SystemID; /* the system ID */
19395 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19396 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19397 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19398 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19399 mem_base = xmlMemBlocks();
19400 doc = gen_xmlDocPtr(n_doc, 0);
19401 name = gen_const_xmlChar_ptr(n_name, 1);
19402 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19403 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19405 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19406 desret_xmlDtdPtr(ret_val);
19408 des_xmlDocPtr(n_doc, doc, 0);
19409 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19410 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19411 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19412 xmlResetLastError();
19413 if (mem_base != xmlMemBlocks()) {
19414 printf("Leak of %d blocks found in xmlCreateIntSubset",
19415 xmlMemBlocks() - mem_base);
19417 printf(" %d", n_doc);
19418 printf(" %d", n_name);
19419 printf(" %d", n_ExternalID);
19420 printf(" %d", n_SystemID);
19433 #define gen_nb_xmlDOMWrapCtxtPtr 1
19434 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19437 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19441 test_xmlDOMWrapAdoptNode(void) {
19446 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19448 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19450 xmlNodePtr node; /* the node to start with */
19452 xmlDocPtr destDoc; /* the destination doc */
19454 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19456 int options; /* option flags */
19459 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19460 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19461 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19462 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19463 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19464 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19465 mem_base = xmlMemBlocks();
19466 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19467 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19468 node = gen_xmlNodePtr(n_node, 2);
19469 destDoc = gen_xmlDocPtr(n_destDoc, 3);
19470 destParent = gen_xmlNodePtr(n_destParent, 4);
19471 options = gen_int(n_options, 5);
19473 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19474 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19475 desret_int(ret_val);
19477 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19478 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19479 des_xmlNodePtr(n_node, node, 2);
19480 des_xmlDocPtr(n_destDoc, destDoc, 3);
19481 des_xmlNodePtr(n_destParent, destParent, 4);
19482 des_int(n_options, options, 5);
19483 xmlResetLastError();
19484 if (mem_base != xmlMemBlocks()) {
19485 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19486 xmlMemBlocks() - mem_base);
19488 printf(" %d", n_ctxt);
19489 printf(" %d", n_sourceDoc);
19490 printf(" %d", n_node);
19491 printf(" %d", n_destDoc);
19492 printf(" %d", n_destParent);
19493 printf(" %d", n_options);
19509 test_xmlDOMWrapCloneNode(void) {
19514 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19516 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19518 xmlNodePtr node; /* the node to start with */
19520 xmlNodePtr * resNode; /* the clone of the given @node */
19522 xmlDocPtr destDoc; /* the destination doc */
19524 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19526 int deep; /* descend into child if set */
19528 int options; /* option flags */
19531 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19532 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19533 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19534 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19535 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19536 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19537 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19538 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19539 mem_base = xmlMemBlocks();
19540 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19541 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19542 node = gen_xmlNodePtr(n_node, 2);
19543 resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19544 destDoc = gen_xmlDocPtr(n_destDoc, 4);
19545 destParent = gen_xmlNodePtr(n_destParent, 5);
19546 deep = gen_int(n_deep, 6);
19547 options = gen_int(n_options, 7);
19549 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19550 desret_int(ret_val);
19552 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19553 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19554 des_xmlNodePtr(n_node, node, 2);
19555 des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19556 des_xmlDocPtr(n_destDoc, destDoc, 4);
19557 des_xmlNodePtr(n_destParent, destParent, 5);
19558 des_int(n_deep, deep, 6);
19559 des_int(n_options, options, 7);
19560 xmlResetLastError();
19561 if (mem_base != xmlMemBlocks()) {
19562 printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19563 xmlMemBlocks() - mem_base);
19565 printf(" %d", n_ctxt);
19566 printf(" %d", n_sourceDoc);
19567 printf(" %d", n_node);
19568 printf(" %d", n_resNode);
19569 printf(" %d", n_destDoc);
19570 printf(" %d", n_destParent);
19571 printf(" %d", n_deep);
19572 printf(" %d", n_options);
19590 test_xmlDOMWrapNewCtxt(void) {
19594 /* missing type support */
19600 test_xmlDOMWrapReconcileNamespaces(void) {
19605 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19607 xmlNodePtr elem; /* the element-node */
19609 int options; /* option flags */
19612 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19613 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19614 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19615 mem_base = xmlMemBlocks();
19616 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19617 elem = gen_xmlNodePtr(n_elem, 1);
19618 options = gen_int(n_options, 2);
19620 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19621 desret_int(ret_val);
19623 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19624 des_xmlNodePtr(n_elem, elem, 1);
19625 des_int(n_options, options, 2);
19626 xmlResetLastError();
19627 if (mem_base != xmlMemBlocks()) {
19628 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19629 xmlMemBlocks() - mem_base);
19631 printf(" %d", n_ctxt);
19632 printf(" %d", n_elem);
19633 printf(" %d", n_options);
19646 test_xmlDOMWrapRemoveNode(void) {
19651 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19653 xmlDocPtr doc; /* the doc */
19655 xmlNodePtr node; /* the node to be removed. */
19657 int options; /* set of options, unused at the moment */
19660 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19661 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19662 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19663 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19664 mem_base = xmlMemBlocks();
19665 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19666 doc = gen_xmlDocPtr(n_doc, 1);
19667 node = gen_xmlNodePtr(n_node, 2);
19668 options = gen_int(n_options, 3);
19670 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19671 desret_int(ret_val);
19673 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19674 des_xmlDocPtr(n_doc, doc, 1);
19675 des_xmlNodePtr(n_node, node, 2);
19676 des_int(n_options, options, 3);
19677 xmlResetLastError();
19678 if (mem_base != xmlMemBlocks()) {
19679 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19680 xmlMemBlocks() - mem_base);
19682 printf(" %d", n_ctxt);
19683 printf(" %d", n_doc);
19684 printf(" %d", n_node);
19685 printf(" %d", n_options);
19699 test_xmlDocCopyNode(void) {
19703 xmlNodePtr ret_val;
19704 xmlNodePtr node; /* the node */
19706 xmlDocPtr doc; /* the document */
19708 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19711 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19712 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19713 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19714 mem_base = xmlMemBlocks();
19715 node = gen_const_xmlNodePtr(n_node, 0);
19716 doc = gen_xmlDocPtr(n_doc, 1);
19717 extended = gen_int(n_extended, 2);
19719 ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19720 desret_xmlNodePtr(ret_val);
19722 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19723 des_xmlDocPtr(n_doc, doc, 1);
19724 des_int(n_extended, extended, 2);
19725 xmlResetLastError();
19726 if (mem_base != xmlMemBlocks()) {
19727 printf("Leak of %d blocks found in xmlDocCopyNode",
19728 xmlMemBlocks() - mem_base);
19730 printf(" %d", n_node);
19731 printf(" %d", n_doc);
19732 printf(" %d", n_extended);
19745 test_xmlDocCopyNodeList(void) {
19749 xmlNodePtr ret_val;
19750 xmlDocPtr doc; /* the target document */
19752 xmlNodePtr node; /* the first node in the list. */
19755 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19756 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19757 mem_base = xmlMemBlocks();
19758 doc = gen_xmlDocPtr(n_doc, 0);
19759 node = gen_const_xmlNodePtr(n_node, 1);
19761 ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19762 desret_xmlNodePtr(ret_val);
19764 des_xmlDocPtr(n_doc, doc, 0);
19765 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19766 xmlResetLastError();
19767 if (mem_base != xmlMemBlocks()) {
19768 printf("Leak of %d blocks found in xmlDocCopyNodeList",
19769 xmlMemBlocks() - mem_base);
19771 printf(" %d", n_doc);
19772 printf(" %d", n_node);
19784 test_xmlDocDump(void) {
19787 #if defined(LIBXML_OUTPUT_ENABLED)
19790 FILE * f; /* the FILE* */
19792 xmlDocPtr cur; /* the document */
19795 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19796 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19797 mem_base = xmlMemBlocks();
19798 f = gen_FILE_ptr(n_f, 0);
19799 cur = gen_xmlDocPtr(n_cur, 1);
19801 ret_val = xmlDocDump(f, cur);
19802 desret_int(ret_val);
19804 des_FILE_ptr(n_f, f, 0);
19805 des_xmlDocPtr(n_cur, cur, 1);
19806 xmlResetLastError();
19807 if (mem_base != xmlMemBlocks()) {
19808 printf("Leak of %d blocks found in xmlDocDump",
19809 xmlMemBlocks() - mem_base);
19811 printf(" %d", n_f);
19812 printf(" %d", n_cur);
19825 test_xmlDocDumpFormatMemory(void) {
19828 #if defined(LIBXML_OUTPUT_ENABLED)
19830 xmlDocPtr cur; /* the document */
19832 xmlChar ** mem; /* OUT: the memory pointer */
19834 int * size; /* OUT: the memory length */
19836 int format; /* should formatting spaces been added */
19839 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19840 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19841 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19842 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19843 mem_base = xmlMemBlocks();
19844 cur = gen_xmlDocPtr(n_cur, 0);
19845 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19846 size = gen_int_ptr(n_size, 2);
19847 format = gen_int(n_format, 3);
19849 xmlDocDumpFormatMemory(cur, mem, size, format);
19851 des_xmlDocPtr(n_cur, cur, 0);
19852 des_xmlChar_ptr_ptr(n_mem, mem, 1);
19853 des_int_ptr(n_size, size, 2);
19854 des_int(n_format, format, 3);
19855 xmlResetLastError();
19856 if (mem_base != xmlMemBlocks()) {
19857 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19858 xmlMemBlocks() - mem_base);
19860 printf(" %d", n_cur);
19861 printf(" %d", n_mem);
19862 printf(" %d", n_size);
19863 printf(" %d", n_format);
19878 test_xmlDocDumpFormatMemoryEnc(void) {
19881 #if defined(LIBXML_OUTPUT_ENABLED)
19883 xmlDocPtr out_doc; /* Document to generate XML text from */
19885 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19887 int * doc_txt_len; /* Length of the generated XML text */
19889 char * txt_encoding; /* Character encoding to use when generating XML text */
19890 int n_txt_encoding;
19891 int format; /* should formatting spaces been added */
19894 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19895 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19896 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19897 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19898 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19899 mem_base = xmlMemBlocks();
19900 out_doc = gen_xmlDocPtr(n_out_doc, 0);
19901 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19902 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19903 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19904 format = gen_int(n_format, 4);
19906 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19908 des_xmlDocPtr(n_out_doc, out_doc, 0);
19909 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19910 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19911 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19912 des_int(n_format, format, 4);
19913 xmlResetLastError();
19914 if (mem_base != xmlMemBlocks()) {
19915 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19916 xmlMemBlocks() - mem_base);
19918 printf(" %d", n_out_doc);
19919 printf(" %d", n_doc_txt_ptr);
19920 printf(" %d", n_doc_txt_len);
19921 printf(" %d", n_txt_encoding);
19922 printf(" %d", n_format);
19938 test_xmlDocDumpMemory(void) {
19941 #if defined(LIBXML_OUTPUT_ENABLED)
19943 xmlDocPtr cur; /* the document */
19945 xmlChar ** mem; /* OUT: the memory pointer */
19947 int * size; /* OUT: the memory length */
19950 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19951 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19952 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19953 mem_base = xmlMemBlocks();
19954 cur = gen_xmlDocPtr(n_cur, 0);
19955 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19956 size = gen_int_ptr(n_size, 2);
19958 xmlDocDumpMemory(cur, mem, size);
19960 des_xmlDocPtr(n_cur, cur, 0);
19961 des_xmlChar_ptr_ptr(n_mem, mem, 1);
19962 des_int_ptr(n_size, size, 2);
19963 xmlResetLastError();
19964 if (mem_base != xmlMemBlocks()) {
19965 printf("Leak of %d blocks found in xmlDocDumpMemory",
19966 xmlMemBlocks() - mem_base);
19968 printf(" %d", n_cur);
19969 printf(" %d", n_mem);
19970 printf(" %d", n_size);
19984 test_xmlDocDumpMemoryEnc(void) {
19987 #if defined(LIBXML_OUTPUT_ENABLED)
19989 xmlDocPtr out_doc; /* Document to generate XML text from */
19991 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19993 int * doc_txt_len; /* Length of the generated XML text */
19995 char * txt_encoding; /* Character encoding to use when generating XML text */
19996 int n_txt_encoding;
19998 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19999 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20000 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20001 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20002 mem_base = xmlMemBlocks();
20003 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20004 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20005 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20006 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20008 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20010 des_xmlDocPtr(n_out_doc, out_doc, 0);
20011 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20012 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20013 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20014 xmlResetLastError();
20015 if (mem_base != xmlMemBlocks()) {
20016 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20017 xmlMemBlocks() - mem_base);
20019 printf(" %d", n_out_doc);
20020 printf(" %d", n_doc_txt_ptr);
20021 printf(" %d", n_doc_txt_len);
20022 printf(" %d", n_txt_encoding);
20037 test_xmlDocFormatDump(void) {
20040 #if defined(LIBXML_OUTPUT_ENABLED)
20043 FILE * f; /* the FILE* */
20045 xmlDocPtr cur; /* the document */
20047 int format; /* should formatting spaces been added */
20050 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20051 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20052 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20053 mem_base = xmlMemBlocks();
20054 f = gen_FILE_ptr(n_f, 0);
20055 cur = gen_xmlDocPtr(n_cur, 1);
20056 format = gen_int(n_format, 2);
20058 ret_val = xmlDocFormatDump(f, cur, format);
20059 desret_int(ret_val);
20061 des_FILE_ptr(n_f, f, 0);
20062 des_xmlDocPtr(n_cur, cur, 1);
20063 des_int(n_format, format, 2);
20064 xmlResetLastError();
20065 if (mem_base != xmlMemBlocks()) {
20066 printf("Leak of %d blocks found in xmlDocFormatDump",
20067 xmlMemBlocks() - mem_base);
20069 printf(" %d", n_f);
20070 printf(" %d", n_cur);
20071 printf(" %d", n_format);
20085 test_xmlDocGetRootElement(void) {
20089 xmlNodePtr ret_val;
20090 xmlDocPtr doc; /* the document */
20093 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20094 mem_base = xmlMemBlocks();
20095 doc = gen_xmlDocPtr(n_doc, 0);
20097 ret_val = xmlDocGetRootElement(doc);
20098 desret_xmlNodePtr(ret_val);
20100 des_xmlDocPtr(n_doc, doc, 0);
20101 xmlResetLastError();
20102 if (mem_base != xmlMemBlocks()) {
20103 printf("Leak of %d blocks found in xmlDocGetRootElement",
20104 xmlMemBlocks() - mem_base);
20106 printf(" %d", n_doc);
20117 test_xmlDocSetRootElement(void) {
20120 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20122 xmlNodePtr ret_val;
20123 xmlDocPtr doc; /* the document */
20125 xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */
20128 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20129 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20130 mem_base = xmlMemBlocks();
20131 doc = gen_xmlDocPtr(n_doc, 0);
20132 root = gen_xmlNodePtr_in(n_root, 1);
20134 ret_val = xmlDocSetRootElement(doc, root);
20135 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20136 desret_xmlNodePtr(ret_val);
20138 des_xmlDocPtr(n_doc, doc, 0);
20139 des_xmlNodePtr_in(n_root, root, 1);
20140 xmlResetLastError();
20141 if (mem_base != xmlMemBlocks()) {
20142 printf("Leak of %d blocks found in xmlDocSetRootElement",
20143 xmlMemBlocks() - mem_base);
20145 printf(" %d", n_doc);
20146 printf(" %d", n_root);
20159 test_xmlElemDump(void) {
20162 #if defined(LIBXML_OUTPUT_ENABLED)
20164 FILE * f; /* the FILE * for the output */
20166 xmlDocPtr doc; /* the document */
20168 xmlNodePtr cur; /* the current node */
20171 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20173 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20174 mem_base = xmlMemBlocks();
20175 f = gen_FILE_ptr(n_f, 0);
20176 doc = gen_xmlDocPtr(n_doc, 1);
20177 cur = gen_xmlNodePtr(n_cur, 2);
20179 xmlElemDump(f, doc, cur);
20181 des_FILE_ptr(n_f, f, 0);
20182 des_xmlDocPtr(n_doc, doc, 1);
20183 des_xmlNodePtr(n_cur, cur, 2);
20184 xmlResetLastError();
20185 if (mem_base != xmlMemBlocks()) {
20186 printf("Leak of %d blocks found in xmlElemDump",
20187 xmlMemBlocks() - mem_base);
20189 printf(" %d", n_f);
20190 printf(" %d", n_doc);
20191 printf(" %d", n_cur);
20205 test_xmlFirstElementChild(void) {
20208 #if defined(LIBXML_TREE_ENABLED)
20210 xmlNodePtr ret_val;
20211 xmlNodePtr parent; /* the parent node */
20214 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20215 mem_base = xmlMemBlocks();
20216 parent = gen_xmlNodePtr(n_parent, 0);
20218 ret_val = xmlFirstElementChild(parent);
20219 desret_xmlNodePtr(ret_val);
20221 des_xmlNodePtr(n_parent, parent, 0);
20222 xmlResetLastError();
20223 if (mem_base != xmlMemBlocks()) {
20224 printf("Leak of %d blocks found in xmlFirstElementChild",
20225 xmlMemBlocks() - mem_base);
20227 printf(" %d", n_parent);
20239 test_xmlGetBufferAllocationScheme(void) {
20243 xmlBufferAllocationScheme ret_val;
20245 mem_base = xmlMemBlocks();
20247 ret_val = xmlGetBufferAllocationScheme();
20248 desret_xmlBufferAllocationScheme(ret_val);
20250 xmlResetLastError();
20251 if (mem_base != xmlMemBlocks()) {
20252 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20253 xmlMemBlocks() - mem_base);
20264 test_xmlGetCompressMode(void) {
20270 mem_base = xmlMemBlocks();
20272 ret_val = xmlGetCompressMode();
20273 desret_int(ret_val);
20275 xmlResetLastError();
20276 if (mem_base != xmlMemBlocks()) {
20277 printf("Leak of %d blocks found in xmlGetCompressMode",
20278 xmlMemBlocks() - mem_base);
20289 test_xmlGetDocCompressMode(void) {
20294 xmlDocPtr doc; /* the document */
20297 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20298 mem_base = xmlMemBlocks();
20299 doc = gen_xmlDocPtr(n_doc, 0);
20301 ret_val = xmlGetDocCompressMode(doc);
20302 desret_int(ret_val);
20304 des_xmlDocPtr(n_doc, doc, 0);
20305 xmlResetLastError();
20306 if (mem_base != xmlMemBlocks()) {
20307 printf("Leak of %d blocks found in xmlGetDocCompressMode",
20308 xmlMemBlocks() - mem_base);
20310 printf(" %d", n_doc);
20321 test_xmlGetIntSubset(void) {
20326 xmlDocPtr doc; /* the document pointer */
20329 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20330 mem_base = xmlMemBlocks();
20331 doc = gen_xmlDocPtr(n_doc, 0);
20333 ret_val = xmlGetIntSubset(doc);
20334 desret_xmlDtdPtr(ret_val);
20336 des_xmlDocPtr(n_doc, doc, 0);
20337 xmlResetLastError();
20338 if (mem_base != xmlMemBlocks()) {
20339 printf("Leak of %d blocks found in xmlGetIntSubset",
20340 xmlMemBlocks() - mem_base);
20342 printf(" %d", n_doc);
20353 test_xmlGetLastChild(void) {
20357 xmlNodePtr ret_val;
20358 xmlNodePtr parent; /* the parent node */
20361 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20362 mem_base = xmlMemBlocks();
20363 parent = gen_xmlNodePtr(n_parent, 0);
20365 ret_val = xmlGetLastChild(parent);
20366 desret_xmlNodePtr(ret_val);
20368 des_xmlNodePtr(n_parent, parent, 0);
20369 xmlResetLastError();
20370 if (mem_base != xmlMemBlocks()) {
20371 printf("Leak of %d blocks found in xmlGetLastChild",
20372 xmlMemBlocks() - mem_base);
20374 printf(" %d", n_parent);
20385 test_xmlGetLineNo(void) {
20390 xmlNodePtr node; /* valid node */
20393 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20394 mem_base = xmlMemBlocks();
20395 node = gen_xmlNodePtr(n_node, 0);
20397 ret_val = xmlGetLineNo(node);
20398 desret_long(ret_val);
20400 des_xmlNodePtr(n_node, node, 0);
20401 xmlResetLastError();
20402 if (mem_base != xmlMemBlocks()) {
20403 printf("Leak of %d blocks found in xmlGetLineNo",
20404 xmlMemBlocks() - mem_base);
20406 printf(" %d", n_node);
20417 test_xmlGetNoNsProp(void) {
20422 xmlNodePtr node; /* the node */
20424 xmlChar * name; /* the attribute name */
20427 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20428 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20429 mem_base = xmlMemBlocks();
20430 node = gen_xmlNodePtr(n_node, 0);
20431 name = gen_const_xmlChar_ptr(n_name, 1);
20433 ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20434 desret_xmlChar_ptr(ret_val);
20436 des_xmlNodePtr(n_node, node, 0);
20437 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20438 xmlResetLastError();
20439 if (mem_base != xmlMemBlocks()) {
20440 printf("Leak of %d blocks found in xmlGetNoNsProp",
20441 xmlMemBlocks() - mem_base);
20443 printf(" %d", n_node);
20444 printf(" %d", n_name);
20456 test_xmlGetNodePath(void) {
20459 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20462 xmlNodePtr node; /* a node */
20465 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20466 mem_base = xmlMemBlocks();
20467 node = gen_xmlNodePtr(n_node, 0);
20469 ret_val = xmlGetNodePath(node);
20470 desret_xmlChar_ptr(ret_val);
20472 des_xmlNodePtr(n_node, node, 0);
20473 xmlResetLastError();
20474 if (mem_base != xmlMemBlocks()) {
20475 printf("Leak of %d blocks found in xmlGetNodePath",
20476 xmlMemBlocks() - mem_base);
20478 printf(" %d", n_node);
20490 test_xmlGetNsList(void) {
20494 /* missing type support */
20500 test_xmlGetNsProp(void) {
20505 xmlNodePtr node; /* the node */
20507 xmlChar * name; /* the attribute name */
20509 xmlChar * nameSpace; /* the URI of the namespace */
20512 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20513 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20514 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20515 mem_base = xmlMemBlocks();
20516 node = gen_xmlNodePtr(n_node, 0);
20517 name = gen_const_xmlChar_ptr(n_name, 1);
20518 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20520 ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20521 desret_xmlChar_ptr(ret_val);
20523 des_xmlNodePtr(n_node, node, 0);
20524 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20525 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20526 xmlResetLastError();
20527 if (mem_base != xmlMemBlocks()) {
20528 printf("Leak of %d blocks found in xmlGetNsProp",
20529 xmlMemBlocks() - mem_base);
20531 printf(" %d", n_node);
20532 printf(" %d", n_name);
20533 printf(" %d", n_nameSpace);
20546 test_xmlGetProp(void) {
20551 xmlNodePtr node; /* the node */
20553 xmlChar * name; /* the attribute name */
20556 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20557 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20558 mem_base = xmlMemBlocks();
20559 node = gen_xmlNodePtr(n_node, 0);
20560 name = gen_const_xmlChar_ptr(n_name, 1);
20562 ret_val = xmlGetProp(node, (const xmlChar *)name);
20563 desret_xmlChar_ptr(ret_val);
20565 des_xmlNodePtr(n_node, node, 0);
20566 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20567 xmlResetLastError();
20568 if (mem_base != xmlMemBlocks()) {
20569 printf("Leak of %d blocks found in xmlGetProp",
20570 xmlMemBlocks() - mem_base);
20572 printf(" %d", n_node);
20573 printf(" %d", n_name);
20585 test_xmlHasNsProp(void) {
20589 xmlAttrPtr ret_val;
20590 xmlNodePtr node; /* the node */
20592 xmlChar * name; /* the attribute name */
20594 xmlChar * nameSpace; /* the URI of the namespace */
20597 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20598 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20599 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20600 mem_base = xmlMemBlocks();
20601 node = gen_xmlNodePtr(n_node, 0);
20602 name = gen_const_xmlChar_ptr(n_name, 1);
20603 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20605 ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20606 desret_xmlAttrPtr(ret_val);
20608 des_xmlNodePtr(n_node, node, 0);
20609 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20610 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20611 xmlResetLastError();
20612 if (mem_base != xmlMemBlocks()) {
20613 printf("Leak of %d blocks found in xmlHasNsProp",
20614 xmlMemBlocks() - mem_base);
20616 printf(" %d", n_node);
20617 printf(" %d", n_name);
20618 printf(" %d", n_nameSpace);
20631 test_xmlHasProp(void) {
20635 xmlAttrPtr ret_val;
20636 xmlNodePtr node; /* the node */
20638 xmlChar * name; /* the attribute name */
20641 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20642 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20643 mem_base = xmlMemBlocks();
20644 node = gen_xmlNodePtr(n_node, 0);
20645 name = gen_const_xmlChar_ptr(n_name, 1);
20647 ret_val = xmlHasProp(node, (const xmlChar *)name);
20648 desret_xmlAttrPtr(ret_val);
20650 des_xmlNodePtr(n_node, node, 0);
20651 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20652 xmlResetLastError();
20653 if (mem_base != xmlMemBlocks()) {
20654 printf("Leak of %d blocks found in xmlHasProp",
20655 xmlMemBlocks() - mem_base);
20657 printf(" %d", n_node);
20658 printf(" %d", n_name);
20670 test_xmlIsBlankNode(void) {
20675 xmlNodePtr node; /* the node */
20678 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20679 mem_base = xmlMemBlocks();
20680 node = gen_xmlNodePtr(n_node, 0);
20682 ret_val = xmlIsBlankNode(node);
20683 desret_int(ret_val);
20685 des_xmlNodePtr(n_node, node, 0);
20686 xmlResetLastError();
20687 if (mem_base != xmlMemBlocks()) {
20688 printf("Leak of %d blocks found in xmlIsBlankNode",
20689 xmlMemBlocks() - mem_base);
20691 printf(" %d", n_node);
20702 test_xmlIsXHTML(void) {
20707 xmlChar * systemID; /* the system identifier */
20709 xmlChar * publicID; /* the public identifier */
20712 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20713 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20714 mem_base = xmlMemBlocks();
20715 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20716 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20718 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20719 desret_int(ret_val);
20721 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20722 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20723 xmlResetLastError();
20724 if (mem_base != xmlMemBlocks()) {
20725 printf("Leak of %d blocks found in xmlIsXHTML",
20726 xmlMemBlocks() - mem_base);
20728 printf(" %d", n_systemID);
20729 printf(" %d", n_publicID);
20741 test_xmlLastElementChild(void) {
20744 #if defined(LIBXML_TREE_ENABLED)
20746 xmlNodePtr ret_val;
20747 xmlNodePtr parent; /* the parent node */
20750 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20751 mem_base = xmlMemBlocks();
20752 parent = gen_xmlNodePtr(n_parent, 0);
20754 ret_val = xmlLastElementChild(parent);
20755 desret_xmlNodePtr(ret_val);
20757 des_xmlNodePtr(n_parent, parent, 0);
20758 xmlResetLastError();
20759 if (mem_base != xmlMemBlocks()) {
20760 printf("Leak of %d blocks found in xmlLastElementChild",
20761 xmlMemBlocks() - mem_base);
20763 printf(" %d", n_parent);
20775 test_xmlNewCDataBlock(void) {
20779 xmlNodePtr ret_val;
20780 xmlDocPtr doc; /* the document */
20782 xmlChar * content; /* the CDATA block content content */
20784 int len; /* the length of the block */
20787 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20788 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20789 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20790 mem_base = xmlMemBlocks();
20791 doc = gen_xmlDocPtr(n_doc, 0);
20792 content = gen_const_xmlChar_ptr(n_content, 1);
20793 len = gen_int(n_len, 2);
20795 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20796 desret_xmlNodePtr(ret_val);
20798 des_xmlDocPtr(n_doc, doc, 0);
20799 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20800 des_int(n_len, len, 2);
20801 xmlResetLastError();
20802 if (mem_base != xmlMemBlocks()) {
20803 printf("Leak of %d blocks found in xmlNewCDataBlock",
20804 xmlMemBlocks() - mem_base);
20806 printf(" %d", n_doc);
20807 printf(" %d", n_content);
20808 printf(" %d", n_len);
20821 test_xmlNewCharRef(void) {
20825 xmlNodePtr ret_val;
20826 xmlDocPtr doc; /* the document */
20828 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20831 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20832 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20833 mem_base = xmlMemBlocks();
20834 doc = gen_xmlDocPtr(n_doc, 0);
20835 name = gen_const_xmlChar_ptr(n_name, 1);
20837 ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20838 desret_xmlNodePtr(ret_val);
20840 des_xmlDocPtr(n_doc, doc, 0);
20841 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20842 xmlResetLastError();
20843 if (mem_base != xmlMemBlocks()) {
20844 printf("Leak of %d blocks found in xmlNewCharRef",
20845 xmlMemBlocks() - mem_base);
20847 printf(" %d", n_doc);
20848 printf(" %d", n_name);
20860 test_xmlNewChild(void) {
20863 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20864 #ifdef LIBXML_TREE_ENABLED
20866 xmlNodePtr ret_val;
20867 xmlNodePtr parent; /* the parent node */
20869 xmlNsPtr ns; /* a namespace if any */
20871 xmlChar * name; /* the name of the child */
20873 xmlChar * content; /* the XML content of the child if any. */
20876 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20877 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20878 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20879 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20880 mem_base = xmlMemBlocks();
20881 parent = gen_xmlNodePtr(n_parent, 0);
20882 ns = gen_xmlNsPtr(n_ns, 1);
20883 name = gen_const_xmlChar_ptr(n_name, 2);
20884 content = gen_const_xmlChar_ptr(n_content, 3);
20886 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20887 desret_xmlNodePtr(ret_val);
20889 des_xmlNodePtr(n_parent, parent, 0);
20890 des_xmlNsPtr(n_ns, ns, 1);
20891 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20892 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20893 xmlResetLastError();
20894 if (mem_base != xmlMemBlocks()) {
20895 printf("Leak of %d blocks found in xmlNewChild",
20896 xmlMemBlocks() - mem_base);
20898 printf(" %d", n_parent);
20899 printf(" %d", n_ns);
20900 printf(" %d", n_name);
20901 printf(" %d", n_content);
20917 test_xmlNewComment(void) {
20921 xmlNodePtr ret_val;
20922 xmlChar * content; /* the comment content */
20925 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20926 mem_base = xmlMemBlocks();
20927 content = gen_const_xmlChar_ptr(n_content, 0);
20929 ret_val = xmlNewComment((const xmlChar *)content);
20930 desret_xmlNodePtr(ret_val);
20932 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20933 xmlResetLastError();
20934 if (mem_base != xmlMemBlocks()) {
20935 printf("Leak of %d blocks found in xmlNewComment",
20936 xmlMemBlocks() - mem_base);
20938 printf(" %d", n_content);
20949 test_xmlNewDoc(void) {
20954 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20957 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20958 mem_base = xmlMemBlocks();
20959 version = gen_const_xmlChar_ptr(n_version, 0);
20961 ret_val = xmlNewDoc((const xmlChar *)version);
20962 desret_xmlDocPtr(ret_val);
20964 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20965 xmlResetLastError();
20966 if (mem_base != xmlMemBlocks()) {
20967 printf("Leak of %d blocks found in xmlNewDoc",
20968 xmlMemBlocks() - mem_base);
20970 printf(" %d", n_version);
20981 test_xmlNewDocComment(void) {
20985 xmlNodePtr ret_val;
20986 xmlDocPtr doc; /* the document */
20988 xmlChar * content; /* the comment content */
20991 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20992 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20993 mem_base = xmlMemBlocks();
20994 doc = gen_xmlDocPtr(n_doc, 0);
20995 content = gen_const_xmlChar_ptr(n_content, 1);
20997 ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20998 desret_xmlNodePtr(ret_val);
21000 des_xmlDocPtr(n_doc, doc, 0);
21001 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21002 xmlResetLastError();
21003 if (mem_base != xmlMemBlocks()) {
21004 printf("Leak of %d blocks found in xmlNewDocComment",
21005 xmlMemBlocks() - mem_base);
21007 printf(" %d", n_doc);
21008 printf(" %d", n_content);
21020 test_xmlNewDocFragment(void) {
21023 #if defined(LIBXML_TREE_ENABLED)
21025 xmlNodePtr ret_val;
21026 xmlDocPtr doc; /* the document owning the fragment */
21029 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21030 mem_base = xmlMemBlocks();
21031 doc = gen_xmlDocPtr(n_doc, 0);
21033 ret_val = xmlNewDocFragment(doc);
21034 desret_xmlNodePtr(ret_val);
21036 des_xmlDocPtr(n_doc, doc, 0);
21037 xmlResetLastError();
21038 if (mem_base != xmlMemBlocks()) {
21039 printf("Leak of %d blocks found in xmlNewDocFragment",
21040 xmlMemBlocks() - mem_base);
21042 printf(" %d", n_doc);
21054 test_xmlNewDocNode(void) {
21058 xmlNodePtr ret_val;
21059 xmlDocPtr doc; /* the document */
21061 xmlNsPtr ns; /* namespace if any */
21063 xmlChar * name; /* the node name */
21065 xmlChar * content; /* the XML text content if any */
21068 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21069 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21070 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21071 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21072 mem_base = xmlMemBlocks();
21073 doc = gen_xmlDocPtr(n_doc, 0);
21074 ns = gen_xmlNsPtr(n_ns, 1);
21075 name = gen_const_xmlChar_ptr(n_name, 2);
21076 content = gen_const_xmlChar_ptr(n_content, 3);
21078 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21079 desret_xmlNodePtr(ret_val);
21081 des_xmlDocPtr(n_doc, doc, 0);
21082 des_xmlNsPtr(n_ns, ns, 1);
21083 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21084 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21085 xmlResetLastError();
21086 if (mem_base != xmlMemBlocks()) {
21087 printf("Leak of %d blocks found in xmlNewDocNode",
21088 xmlMemBlocks() - mem_base);
21090 printf(" %d", n_doc);
21091 printf(" %d", n_ns);
21092 printf(" %d", n_name);
21093 printf(" %d", n_content);
21107 test_xmlNewDocNodeEatName(void) {
21111 xmlNodePtr ret_val;
21112 xmlDocPtr doc; /* the document */
21114 xmlNsPtr ns; /* namespace if any */
21116 xmlChar * name; /* the node name */
21118 xmlChar * content; /* the XML text content if any */
21121 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21122 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21123 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21124 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21125 mem_base = xmlMemBlocks();
21126 doc = gen_xmlDocPtr(n_doc, 0);
21127 ns = gen_xmlNsPtr(n_ns, 1);
21128 name = gen_eaten_name(n_name, 2);
21129 content = gen_const_xmlChar_ptr(n_content, 3);
21131 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21132 desret_xmlNodePtr(ret_val);
21134 des_xmlDocPtr(n_doc, doc, 0);
21135 des_xmlNsPtr(n_ns, ns, 1);
21136 des_eaten_name(n_name, name, 2);
21137 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21138 xmlResetLastError();
21139 if (mem_base != xmlMemBlocks()) {
21140 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21141 xmlMemBlocks() - mem_base);
21143 printf(" %d", n_doc);
21144 printf(" %d", n_ns);
21145 printf(" %d", n_name);
21146 printf(" %d", n_content);
21160 test_xmlNewDocPI(void) {
21164 xmlNodePtr ret_val;
21165 xmlDocPtr doc; /* the target document */
21167 xmlChar * name; /* the processing instruction name */
21169 xmlChar * content; /* the PI content */
21172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21173 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21174 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21175 mem_base = xmlMemBlocks();
21176 doc = gen_xmlDocPtr(n_doc, 0);
21177 name = gen_const_xmlChar_ptr(n_name, 1);
21178 content = gen_const_xmlChar_ptr(n_content, 2);
21180 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21181 desret_xmlNodePtr(ret_val);
21183 des_xmlDocPtr(n_doc, doc, 0);
21184 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21185 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21186 xmlResetLastError();
21187 if (mem_base != xmlMemBlocks()) {
21188 printf("Leak of %d blocks found in xmlNewDocPI",
21189 xmlMemBlocks() - mem_base);
21191 printf(" %d", n_doc);
21192 printf(" %d", n_name);
21193 printf(" %d", n_content);
21206 test_xmlNewDocProp(void) {
21210 xmlAttrPtr ret_val;
21211 xmlDocPtr doc; /* the document */
21213 xmlChar * name; /* the name of the attribute */
21215 xmlChar * value; /* the value of the attribute */
21218 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21219 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21220 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21221 mem_base = xmlMemBlocks();
21222 doc = gen_xmlDocPtr(n_doc, 0);
21223 name = gen_const_xmlChar_ptr(n_name, 1);
21224 value = gen_const_xmlChar_ptr(n_value, 2);
21226 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21227 desret_xmlAttrPtr(ret_val);
21229 des_xmlDocPtr(n_doc, doc, 0);
21230 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21231 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21232 xmlResetLastError();
21233 if (mem_base != xmlMemBlocks()) {
21234 printf("Leak of %d blocks found in xmlNewDocProp",
21235 xmlMemBlocks() - mem_base);
21237 printf(" %d", n_doc);
21238 printf(" %d", n_name);
21239 printf(" %d", n_value);
21252 test_xmlNewDocRawNode(void) {
21255 #if defined(LIBXML_TREE_ENABLED)
21256 #ifdef LIBXML_TREE_ENABLED
21258 xmlNodePtr ret_val;
21259 xmlDocPtr doc; /* the document */
21261 xmlNsPtr ns; /* namespace if any */
21263 xmlChar * name; /* the node name */
21265 xmlChar * content; /* the text content if any */
21268 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21269 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21270 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21271 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21272 mem_base = xmlMemBlocks();
21273 doc = gen_xmlDocPtr(n_doc, 0);
21274 ns = gen_xmlNsPtr(n_ns, 1);
21275 name = gen_const_xmlChar_ptr(n_name, 2);
21276 content = gen_const_xmlChar_ptr(n_content, 3);
21278 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21279 desret_xmlNodePtr(ret_val);
21281 des_xmlDocPtr(n_doc, doc, 0);
21282 des_xmlNsPtr(n_ns, ns, 1);
21283 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21284 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21285 xmlResetLastError();
21286 if (mem_base != xmlMemBlocks()) {
21287 printf("Leak of %d blocks found in xmlNewDocRawNode",
21288 xmlMemBlocks() - mem_base);
21290 printf(" %d", n_doc);
21291 printf(" %d", n_ns);
21292 printf(" %d", n_name);
21293 printf(" %d", n_content);
21309 test_xmlNewDocText(void) {
21313 xmlNodePtr ret_val;
21314 xmlDocPtr doc; /* the document */
21316 xmlChar * content; /* the text content */
21319 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21320 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21321 mem_base = xmlMemBlocks();
21322 doc = gen_xmlDocPtr(n_doc, 0);
21323 content = gen_const_xmlChar_ptr(n_content, 1);
21325 ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21326 desret_xmlNodePtr(ret_val);
21328 des_xmlDocPtr(n_doc, doc, 0);
21329 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21330 xmlResetLastError();
21331 if (mem_base != xmlMemBlocks()) {
21332 printf("Leak of %d blocks found in xmlNewDocText",
21333 xmlMemBlocks() - mem_base);
21335 printf(" %d", n_doc);
21336 printf(" %d", n_content);
21348 test_xmlNewDocTextLen(void) {
21352 xmlNodePtr ret_val;
21353 xmlDocPtr doc; /* the document */
21355 xmlChar * content; /* the text content */
21357 int len; /* the text len. */
21360 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21361 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21362 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21363 mem_base = xmlMemBlocks();
21364 doc = gen_xmlDocPtr(n_doc, 0);
21365 content = gen_const_xmlChar_ptr(n_content, 1);
21366 len = gen_int(n_len, 2);
21368 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21369 desret_xmlNodePtr(ret_val);
21371 des_xmlDocPtr(n_doc, doc, 0);
21372 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21373 des_int(n_len, len, 2);
21374 xmlResetLastError();
21375 if (mem_base != xmlMemBlocks()) {
21376 printf("Leak of %d blocks found in xmlNewDocTextLen",
21377 xmlMemBlocks() - mem_base);
21379 printf(" %d", n_doc);
21380 printf(" %d", n_content);
21381 printf(" %d", n_len);
21394 test_xmlNewDtd(void) {
21399 xmlDocPtr doc; /* the document pointer */
21401 xmlChar * name; /* the DTD name */
21403 xmlChar * ExternalID; /* the external ID */
21405 xmlChar * SystemID; /* the system ID */
21408 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21409 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21410 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21411 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21412 mem_base = xmlMemBlocks();
21413 doc = gen_xmlDocPtr(n_doc, 0);
21414 name = gen_const_xmlChar_ptr(n_name, 1);
21415 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21416 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21418 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21419 desret_xmlDtdPtr(ret_val);
21421 des_xmlDocPtr(n_doc, doc, 0);
21422 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21423 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21424 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21425 xmlResetLastError();
21426 if (mem_base != xmlMemBlocks()) {
21427 printf("Leak of %d blocks found in xmlNewDtd",
21428 xmlMemBlocks() - mem_base);
21430 printf(" %d", n_doc);
21431 printf(" %d", n_name);
21432 printf(" %d", n_ExternalID);
21433 printf(" %d", n_SystemID);
21447 test_xmlNewNode(void) {
21451 xmlNodePtr ret_val;
21452 xmlNsPtr ns; /* namespace if any */
21454 xmlChar * name; /* the node name */
21457 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21458 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21459 mem_base = xmlMemBlocks();
21460 ns = gen_xmlNsPtr(n_ns, 0);
21461 name = gen_const_xmlChar_ptr(n_name, 1);
21463 ret_val = xmlNewNode(ns, (const xmlChar *)name);
21464 desret_xmlNodePtr(ret_val);
21466 des_xmlNsPtr(n_ns, ns, 0);
21467 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21468 xmlResetLastError();
21469 if (mem_base != xmlMemBlocks()) {
21470 printf("Leak of %d blocks found in xmlNewNode",
21471 xmlMemBlocks() - mem_base);
21473 printf(" %d", n_ns);
21474 printf(" %d", n_name);
21486 test_xmlNewNodeEatName(void) {
21490 xmlNodePtr ret_val;
21491 xmlNsPtr ns; /* namespace if any */
21493 xmlChar * name; /* the node name */
21496 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21497 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21498 mem_base = xmlMemBlocks();
21499 ns = gen_xmlNsPtr(n_ns, 0);
21500 name = gen_eaten_name(n_name, 1);
21502 ret_val = xmlNewNodeEatName(ns, name);
21503 desret_xmlNodePtr(ret_val);
21505 des_xmlNsPtr(n_ns, ns, 0);
21506 des_eaten_name(n_name, name, 1);
21507 xmlResetLastError();
21508 if (mem_base != xmlMemBlocks()) {
21509 printf("Leak of %d blocks found in xmlNewNodeEatName",
21510 xmlMemBlocks() - mem_base);
21512 printf(" %d", n_ns);
21513 printf(" %d", n_name);
21525 test_xmlNewNs(void) {
21530 xmlNodePtr node; /* the element carrying the namespace */
21532 xmlChar * href; /* the URI associated */
21534 xmlChar * prefix; /* the prefix for the namespace */
21537 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21538 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21539 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21540 mem_base = xmlMemBlocks();
21541 node = gen_xmlNodePtr(n_node, 0);
21542 href = gen_const_xmlChar_ptr(n_href, 1);
21543 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21545 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21546 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21547 desret_xmlNsPtr(ret_val);
21549 des_xmlNodePtr(n_node, node, 0);
21550 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21551 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21552 xmlResetLastError();
21553 if (mem_base != xmlMemBlocks()) {
21554 printf("Leak of %d blocks found in xmlNewNs",
21555 xmlMemBlocks() - mem_base);
21557 printf(" %d", n_node);
21558 printf(" %d", n_href);
21559 printf(" %d", n_prefix);
21572 test_xmlNewNsProp(void) {
21576 xmlAttrPtr ret_val;
21577 xmlNodePtr node; /* the holding node */
21579 xmlNsPtr ns; /* the namespace */
21581 xmlChar * name; /* the name of the attribute */
21583 xmlChar * value; /* the value of the attribute */
21586 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21587 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21588 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21589 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21590 mem_base = xmlMemBlocks();
21591 node = gen_xmlNodePtr(n_node, 0);
21592 ns = gen_xmlNsPtr(n_ns, 1);
21593 name = gen_const_xmlChar_ptr(n_name, 2);
21594 value = gen_const_xmlChar_ptr(n_value, 3);
21596 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21597 desret_xmlAttrPtr(ret_val);
21599 des_xmlNodePtr(n_node, node, 0);
21600 des_xmlNsPtr(n_ns, ns, 1);
21601 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21602 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21603 xmlResetLastError();
21604 if (mem_base != xmlMemBlocks()) {
21605 printf("Leak of %d blocks found in xmlNewNsProp",
21606 xmlMemBlocks() - mem_base);
21608 printf(" %d", n_node);
21609 printf(" %d", n_ns);
21610 printf(" %d", n_name);
21611 printf(" %d", n_value);
21625 test_xmlNewNsPropEatName(void) {
21629 xmlAttrPtr ret_val;
21630 xmlNodePtr node; /* the holding node */
21632 xmlNsPtr ns; /* the namespace */
21634 xmlChar * name; /* the name of the attribute */
21636 xmlChar * value; /* the value of the attribute */
21639 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21640 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21641 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21642 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21643 mem_base = xmlMemBlocks();
21644 node = gen_xmlNodePtr(n_node, 0);
21645 ns = gen_xmlNsPtr(n_ns, 1);
21646 name = gen_eaten_name(n_name, 2);
21647 value = gen_const_xmlChar_ptr(n_value, 3);
21649 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21650 desret_xmlAttrPtr(ret_val);
21652 des_xmlNodePtr(n_node, node, 0);
21653 des_xmlNsPtr(n_ns, ns, 1);
21654 des_eaten_name(n_name, name, 2);
21655 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21656 xmlResetLastError();
21657 if (mem_base != xmlMemBlocks()) {
21658 printf("Leak of %d blocks found in xmlNewNsPropEatName",
21659 xmlMemBlocks() - mem_base);
21661 printf(" %d", n_node);
21662 printf(" %d", n_ns);
21663 printf(" %d", n_name);
21664 printf(" %d", n_value);
21678 test_xmlNewPI(void) {
21682 xmlNodePtr ret_val;
21683 xmlChar * name; /* the processing instruction name */
21685 xmlChar * content; /* the PI content */
21688 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21689 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21690 mem_base = xmlMemBlocks();
21691 name = gen_const_xmlChar_ptr(n_name, 0);
21692 content = gen_const_xmlChar_ptr(n_content, 1);
21694 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21695 desret_xmlNodePtr(ret_val);
21697 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21698 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21699 xmlResetLastError();
21700 if (mem_base != xmlMemBlocks()) {
21701 printf("Leak of %d blocks found in xmlNewPI",
21702 xmlMemBlocks() - mem_base);
21704 printf(" %d", n_name);
21705 printf(" %d", n_content);
21717 test_xmlNewProp(void) {
21720 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21721 #ifdef LIBXML_TREE_ENABLED
21723 xmlAttrPtr ret_val;
21724 xmlNodePtr node; /* the holding node */
21726 xmlChar * name; /* the name of the attribute */
21728 xmlChar * value; /* the value of the attribute */
21731 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21732 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21733 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21734 mem_base = xmlMemBlocks();
21735 node = gen_xmlNodePtr(n_node, 0);
21736 name = gen_const_xmlChar_ptr(n_name, 1);
21737 value = gen_const_xmlChar_ptr(n_value, 2);
21739 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21740 desret_xmlAttrPtr(ret_val);
21742 des_xmlNodePtr(n_node, node, 0);
21743 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21744 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21745 xmlResetLastError();
21746 if (mem_base != xmlMemBlocks()) {
21747 printf("Leak of %d blocks found in xmlNewProp",
21748 xmlMemBlocks() - mem_base);
21750 printf(" %d", n_node);
21751 printf(" %d", n_name);
21752 printf(" %d", n_value);
21767 test_xmlNewReference(void) {
21771 xmlNodePtr ret_val;
21772 xmlDocPtr doc; /* the document */
21774 xmlChar * name; /* the reference name, or the reference string with & and ; */
21777 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21778 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21779 mem_base = xmlMemBlocks();
21780 doc = gen_xmlDocPtr(n_doc, 0);
21781 name = gen_const_xmlChar_ptr(n_name, 1);
21783 ret_val = xmlNewReference(doc, (const xmlChar *)name);
21784 desret_xmlNodePtr(ret_val);
21786 des_xmlDocPtr(n_doc, doc, 0);
21787 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21788 xmlResetLastError();
21789 if (mem_base != xmlMemBlocks()) {
21790 printf("Leak of %d blocks found in xmlNewReference",
21791 xmlMemBlocks() - mem_base);
21793 printf(" %d", n_doc);
21794 printf(" %d", n_name);
21806 test_xmlNewText(void) {
21810 xmlNodePtr ret_val;
21811 xmlChar * content; /* the text content */
21814 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21815 mem_base = xmlMemBlocks();
21816 content = gen_const_xmlChar_ptr(n_content, 0);
21818 ret_val = xmlNewText((const xmlChar *)content);
21819 desret_xmlNodePtr(ret_val);
21821 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21822 xmlResetLastError();
21823 if (mem_base != xmlMemBlocks()) {
21824 printf("Leak of %d blocks found in xmlNewText",
21825 xmlMemBlocks() - mem_base);
21827 printf(" %d", n_content);
21838 test_xmlNewTextChild(void) {
21841 #if defined(LIBXML_TREE_ENABLED)
21842 #ifdef LIBXML_TREE_ENABLED
21844 xmlNodePtr ret_val;
21845 xmlNodePtr parent; /* the parent node */
21847 xmlNsPtr ns; /* a namespace if any */
21849 xmlChar * name; /* the name of the child */
21851 xmlChar * content; /* the text content of the child if any. */
21854 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21855 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21856 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21857 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21858 mem_base = xmlMemBlocks();
21859 parent = gen_xmlNodePtr(n_parent, 0);
21860 ns = gen_xmlNsPtr(n_ns, 1);
21861 name = gen_const_xmlChar_ptr(n_name, 2);
21862 content = gen_const_xmlChar_ptr(n_content, 3);
21864 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21865 desret_xmlNodePtr(ret_val);
21867 des_xmlNodePtr(n_parent, parent, 0);
21868 des_xmlNsPtr(n_ns, ns, 1);
21869 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21870 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21871 xmlResetLastError();
21872 if (mem_base != xmlMemBlocks()) {
21873 printf("Leak of %d blocks found in xmlNewTextChild",
21874 xmlMemBlocks() - mem_base);
21876 printf(" %d", n_parent);
21877 printf(" %d", n_ns);
21878 printf(" %d", n_name);
21879 printf(" %d", n_content);
21895 test_xmlNewTextLen(void) {
21899 xmlNodePtr ret_val;
21900 xmlChar * content; /* the text content */
21902 int len; /* the text len. */
21905 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21906 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21907 mem_base = xmlMemBlocks();
21908 content = gen_const_xmlChar_ptr(n_content, 0);
21909 len = gen_int(n_len, 1);
21911 ret_val = xmlNewTextLen((const xmlChar *)content, len);
21912 desret_xmlNodePtr(ret_val);
21914 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21915 des_int(n_len, len, 1);
21916 xmlResetLastError();
21917 if (mem_base != xmlMemBlocks()) {
21918 printf("Leak of %d blocks found in xmlNewTextLen",
21919 xmlMemBlocks() - mem_base);
21921 printf(" %d", n_content);
21922 printf(" %d", n_len);
21934 test_xmlNextElementSibling(void) {
21937 #if defined(LIBXML_TREE_ENABLED)
21939 xmlNodePtr ret_val;
21940 xmlNodePtr node; /* the current node */
21943 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21944 mem_base = xmlMemBlocks();
21945 node = gen_xmlNodePtr(n_node, 0);
21947 ret_val = xmlNextElementSibling(node);
21948 desret_xmlNodePtr(ret_val);
21950 des_xmlNodePtr(n_node, node, 0);
21951 xmlResetLastError();
21952 if (mem_base != xmlMemBlocks()) {
21953 printf("Leak of %d blocks found in xmlNextElementSibling",
21954 xmlMemBlocks() - mem_base);
21956 printf(" %d", n_node);
21968 test_xmlNodeAddContent(void) {
21972 xmlNodePtr cur; /* the node being modified */
21974 xmlChar * content; /* extra content */
21977 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21978 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21979 mem_base = xmlMemBlocks();
21980 cur = gen_xmlNodePtr(n_cur, 0);
21981 content = gen_const_xmlChar_ptr(n_content, 1);
21983 xmlNodeAddContent(cur, (const xmlChar *)content);
21985 des_xmlNodePtr(n_cur, cur, 0);
21986 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21987 xmlResetLastError();
21988 if (mem_base != xmlMemBlocks()) {
21989 printf("Leak of %d blocks found in xmlNodeAddContent",
21990 xmlMemBlocks() - mem_base);
21992 printf(" %d", n_cur);
21993 printf(" %d", n_content);
22005 test_xmlNodeAddContentLen(void) {
22009 xmlNodePtr cur; /* the node being modified */
22011 xmlChar * content; /* extra content */
22013 int len; /* the size of @content */
22016 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22017 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22018 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22019 mem_base = xmlMemBlocks();
22020 cur = gen_xmlNodePtr(n_cur, 0);
22021 content = gen_const_xmlChar_ptr(n_content, 1);
22022 len = gen_int(n_len, 2);
22024 xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22026 des_xmlNodePtr(n_cur, cur, 0);
22027 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22028 des_int(n_len, len, 2);
22029 xmlResetLastError();
22030 if (mem_base != xmlMemBlocks()) {
22031 printf("Leak of %d blocks found in xmlNodeAddContentLen",
22032 xmlMemBlocks() - mem_base);
22034 printf(" %d", n_cur);
22035 printf(" %d", n_content);
22036 printf(" %d", n_len);
22049 test_xmlNodeBufGetContent(void) {
22054 xmlBufferPtr buffer; /* a buffer */
22056 xmlNodePtr cur; /* the node being read */
22059 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22060 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22061 mem_base = xmlMemBlocks();
22062 buffer = gen_xmlBufferPtr(n_buffer, 0);
22063 cur = gen_xmlNodePtr(n_cur, 1);
22065 ret_val = xmlNodeBufGetContent(buffer, cur);
22066 desret_int(ret_val);
22068 des_xmlBufferPtr(n_buffer, buffer, 0);
22069 des_xmlNodePtr(n_cur, cur, 1);
22070 xmlResetLastError();
22071 if (mem_base != xmlMemBlocks()) {
22072 printf("Leak of %d blocks found in xmlNodeBufGetContent",
22073 xmlMemBlocks() - mem_base);
22075 printf(" %d", n_buffer);
22076 printf(" %d", n_cur);
22088 test_xmlNodeDump(void) {
22091 #if defined(LIBXML_OUTPUT_ENABLED)
22094 xmlBufferPtr buf; /* the XML buffer output */
22096 xmlDocPtr doc; /* the document */
22098 xmlNodePtr cur; /* the current node */
22100 int level; /* the imbrication level for indenting */
22102 int format; /* is formatting allowed */
22105 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22106 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22107 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22108 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22109 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22110 mem_base = xmlMemBlocks();
22111 buf = gen_xmlBufferPtr(n_buf, 0);
22112 doc = gen_xmlDocPtr(n_doc, 1);
22113 cur = gen_xmlNodePtr(n_cur, 2);
22114 level = gen_int(n_level, 3);
22115 format = gen_int(n_format, 4);
22117 ret_val = xmlNodeDump(buf, doc, cur, level, format);
22118 desret_int(ret_val);
22120 des_xmlBufferPtr(n_buf, buf, 0);
22121 des_xmlDocPtr(n_doc, doc, 1);
22122 des_xmlNodePtr(n_cur, cur, 2);
22123 des_int(n_level, level, 3);
22124 des_int(n_format, format, 4);
22125 xmlResetLastError();
22126 if (mem_base != xmlMemBlocks()) {
22127 printf("Leak of %d blocks found in xmlNodeDump",
22128 xmlMemBlocks() - mem_base);
22130 printf(" %d", n_buf);
22131 printf(" %d", n_doc);
22132 printf(" %d", n_cur);
22133 printf(" %d", n_level);
22134 printf(" %d", n_format);
22150 test_xmlNodeDumpOutput(void) {
22153 #if defined(LIBXML_OUTPUT_ENABLED)
22155 xmlOutputBufferPtr buf; /* the XML buffer output */
22157 xmlDocPtr doc; /* the document */
22159 xmlNodePtr cur; /* the current node */
22161 int level; /* the imbrication level for indenting */
22163 int format; /* is formatting allowed */
22165 char * encoding; /* an optional encoding string */
22168 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22169 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22170 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22171 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22172 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22173 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22174 mem_base = xmlMemBlocks();
22175 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22176 doc = gen_xmlDocPtr(n_doc, 1);
22177 cur = gen_xmlNodePtr(n_cur, 2);
22178 level = gen_int(n_level, 3);
22179 format = gen_int(n_format, 4);
22180 encoding = gen_const_char_ptr(n_encoding, 5);
22182 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22184 des_xmlOutputBufferPtr(n_buf, buf, 0);
22185 des_xmlDocPtr(n_doc, doc, 1);
22186 des_xmlNodePtr(n_cur, cur, 2);
22187 des_int(n_level, level, 3);
22188 des_int(n_format, format, 4);
22189 des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22190 xmlResetLastError();
22191 if (mem_base != xmlMemBlocks()) {
22192 printf("Leak of %d blocks found in xmlNodeDumpOutput",
22193 xmlMemBlocks() - mem_base);
22195 printf(" %d", n_buf);
22196 printf(" %d", n_doc);
22197 printf(" %d", n_cur);
22198 printf(" %d", n_level);
22199 printf(" %d", n_format);
22200 printf(" %d", n_encoding);
22217 test_xmlNodeGetBase(void) {
22222 xmlDocPtr doc; /* the document the node pertains to */
22224 xmlNodePtr cur; /* the node being checked */
22227 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22228 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22229 mem_base = xmlMemBlocks();
22230 doc = gen_xmlDocPtr(n_doc, 0);
22231 cur = gen_xmlNodePtr(n_cur, 1);
22233 ret_val = xmlNodeGetBase(doc, cur);
22234 desret_xmlChar_ptr(ret_val);
22236 des_xmlDocPtr(n_doc, doc, 0);
22237 des_xmlNodePtr(n_cur, cur, 1);
22238 xmlResetLastError();
22239 if (mem_base != xmlMemBlocks()) {
22240 printf("Leak of %d blocks found in xmlNodeGetBase",
22241 xmlMemBlocks() - mem_base);
22243 printf(" %d", n_doc);
22244 printf(" %d", n_cur);
22256 test_xmlNodeGetContent(void) {
22261 xmlNodePtr cur; /* the node being read */
22264 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22265 mem_base = xmlMemBlocks();
22266 cur = gen_xmlNodePtr(n_cur, 0);
22268 ret_val = xmlNodeGetContent(cur);
22269 desret_xmlChar_ptr(ret_val);
22271 des_xmlNodePtr(n_cur, cur, 0);
22272 xmlResetLastError();
22273 if (mem_base != xmlMemBlocks()) {
22274 printf("Leak of %d blocks found in xmlNodeGetContent",
22275 xmlMemBlocks() - mem_base);
22277 printf(" %d", n_cur);
22288 test_xmlNodeGetLang(void) {
22293 xmlNodePtr cur; /* the node being checked */
22296 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22297 mem_base = xmlMemBlocks();
22298 cur = gen_xmlNodePtr(n_cur, 0);
22300 ret_val = xmlNodeGetLang(cur);
22301 desret_xmlChar_ptr(ret_val);
22303 des_xmlNodePtr(n_cur, cur, 0);
22304 xmlResetLastError();
22305 if (mem_base != xmlMemBlocks()) {
22306 printf("Leak of %d blocks found in xmlNodeGetLang",
22307 xmlMemBlocks() - mem_base);
22309 printf(" %d", n_cur);
22320 test_xmlNodeGetSpacePreserve(void) {
22325 xmlNodePtr cur; /* the node being checked */
22328 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22329 mem_base = xmlMemBlocks();
22330 cur = gen_xmlNodePtr(n_cur, 0);
22332 ret_val = xmlNodeGetSpacePreserve(cur);
22333 desret_int(ret_val);
22335 des_xmlNodePtr(n_cur, cur, 0);
22336 xmlResetLastError();
22337 if (mem_base != xmlMemBlocks()) {
22338 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22339 xmlMemBlocks() - mem_base);
22341 printf(" %d", n_cur);
22352 test_xmlNodeIsText(void) {
22357 xmlNodePtr node; /* the node */
22360 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22361 mem_base = xmlMemBlocks();
22362 node = gen_xmlNodePtr(n_node, 0);
22364 ret_val = xmlNodeIsText(node);
22365 desret_int(ret_val);
22367 des_xmlNodePtr(n_node, node, 0);
22368 xmlResetLastError();
22369 if (mem_base != xmlMemBlocks()) {
22370 printf("Leak of %d blocks found in xmlNodeIsText",
22371 xmlMemBlocks() - mem_base);
22373 printf(" %d", n_node);
22384 test_xmlNodeListGetRawString(void) {
22387 #if defined(LIBXML_TREE_ENABLED)
22390 xmlDocPtr doc; /* the document */
22392 xmlNodePtr list; /* a Node list */
22394 int inLine; /* should we replace entity contents or show their external form */
22397 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22398 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22399 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22400 mem_base = xmlMemBlocks();
22401 doc = gen_xmlDocPtr(n_doc, 0);
22402 list = gen_xmlNodePtr(n_list, 1);
22403 inLine = gen_int(n_inLine, 2);
22405 ret_val = xmlNodeListGetRawString(doc, list, inLine);
22406 desret_xmlChar_ptr(ret_val);
22408 des_xmlDocPtr(n_doc, doc, 0);
22409 des_xmlNodePtr(n_list, list, 1);
22410 des_int(n_inLine, inLine, 2);
22411 xmlResetLastError();
22412 if (mem_base != xmlMemBlocks()) {
22413 printf("Leak of %d blocks found in xmlNodeListGetRawString",
22414 xmlMemBlocks() - mem_base);
22416 printf(" %d", n_doc);
22417 printf(" %d", n_list);
22418 printf(" %d", n_inLine);
22432 test_xmlNodeListGetString(void) {
22437 xmlDocPtr doc; /* the document */
22439 xmlNodePtr list; /* a Node list */
22441 int inLine; /* should we replace entity contents or show their external form */
22444 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22445 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22446 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22447 mem_base = xmlMemBlocks();
22448 doc = gen_xmlDocPtr(n_doc, 0);
22449 list = gen_xmlNodePtr(n_list, 1);
22450 inLine = gen_int(n_inLine, 2);
22452 ret_val = xmlNodeListGetString(doc, list, inLine);
22453 desret_xmlChar_ptr(ret_val);
22455 des_xmlDocPtr(n_doc, doc, 0);
22456 des_xmlNodePtr(n_list, list, 1);
22457 des_int(n_inLine, inLine, 2);
22458 xmlResetLastError();
22459 if (mem_base != xmlMemBlocks()) {
22460 printf("Leak of %d blocks found in xmlNodeListGetString",
22461 xmlMemBlocks() - mem_base);
22463 printf(" %d", n_doc);
22464 printf(" %d", n_list);
22465 printf(" %d", n_inLine);
22478 test_xmlNodeSetBase(void) {
22481 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22483 xmlNodePtr cur; /* the node being changed */
22485 xmlChar * uri; /* the new base URI */
22488 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22489 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22490 mem_base = xmlMemBlocks();
22491 cur = gen_xmlNodePtr(n_cur, 0);
22492 uri = gen_const_xmlChar_ptr(n_uri, 1);
22494 xmlNodeSetBase(cur, (const xmlChar *)uri);
22496 des_xmlNodePtr(n_cur, cur, 0);
22497 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22498 xmlResetLastError();
22499 if (mem_base != xmlMemBlocks()) {
22500 printf("Leak of %d blocks found in xmlNodeSetBase",
22501 xmlMemBlocks() - mem_base);
22503 printf(" %d", n_cur);
22504 printf(" %d", n_uri);
22517 test_xmlNodeSetContent(void) {
22521 xmlNodePtr cur; /* the node being modified */
22523 xmlChar * content; /* the new value of the content */
22526 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22527 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22528 mem_base = xmlMemBlocks();
22529 cur = gen_xmlNodePtr(n_cur, 0);
22530 content = gen_const_xmlChar_ptr(n_content, 1);
22532 xmlNodeSetContent(cur, (const xmlChar *)content);
22534 des_xmlNodePtr(n_cur, cur, 0);
22535 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22536 xmlResetLastError();
22537 if (mem_base != xmlMemBlocks()) {
22538 printf("Leak of %d blocks found in xmlNodeSetContent",
22539 xmlMemBlocks() - mem_base);
22541 printf(" %d", n_cur);
22542 printf(" %d", n_content);
22554 test_xmlNodeSetContentLen(void) {
22557 #if defined(LIBXML_TREE_ENABLED)
22559 xmlNodePtr cur; /* the node being modified */
22561 xmlChar * content; /* the new value of the content */
22563 int len; /* the size of @content */
22566 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22567 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22568 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22569 mem_base = xmlMemBlocks();
22570 cur = gen_xmlNodePtr(n_cur, 0);
22571 content = gen_const_xmlChar_ptr(n_content, 1);
22572 len = gen_int(n_len, 2);
22574 xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22576 des_xmlNodePtr(n_cur, cur, 0);
22577 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22578 des_int(n_len, len, 2);
22579 xmlResetLastError();
22580 if (mem_base != xmlMemBlocks()) {
22581 printf("Leak of %d blocks found in xmlNodeSetContentLen",
22582 xmlMemBlocks() - mem_base);
22584 printf(" %d", n_cur);
22585 printf(" %d", n_content);
22586 printf(" %d", n_len);
22600 test_xmlNodeSetLang(void) {
22603 #if defined(LIBXML_TREE_ENABLED)
22605 xmlNodePtr cur; /* the node being changed */
22607 xmlChar * lang; /* the language description */
22610 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22611 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22612 mem_base = xmlMemBlocks();
22613 cur = gen_xmlNodePtr(n_cur, 0);
22614 lang = gen_const_xmlChar_ptr(n_lang, 1);
22616 xmlNodeSetLang(cur, (const xmlChar *)lang);
22618 des_xmlNodePtr(n_cur, cur, 0);
22619 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22620 xmlResetLastError();
22621 if (mem_base != xmlMemBlocks()) {
22622 printf("Leak of %d blocks found in xmlNodeSetLang",
22623 xmlMemBlocks() - mem_base);
22625 printf(" %d", n_cur);
22626 printf(" %d", n_lang);
22639 test_xmlNodeSetName(void) {
22642 #if defined(LIBXML_TREE_ENABLED)
22644 xmlNodePtr cur; /* the node being changed */
22646 xmlChar * name; /* the new tag name */
22649 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22650 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22651 mem_base = xmlMemBlocks();
22652 cur = gen_xmlNodePtr(n_cur, 0);
22653 name = gen_const_xmlChar_ptr(n_name, 1);
22655 xmlNodeSetName(cur, (const xmlChar *)name);
22657 des_xmlNodePtr(n_cur, cur, 0);
22658 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22659 xmlResetLastError();
22660 if (mem_base != xmlMemBlocks()) {
22661 printf("Leak of %d blocks found in xmlNodeSetName",
22662 xmlMemBlocks() - mem_base);
22664 printf(" %d", n_cur);
22665 printf(" %d", n_name);
22678 test_xmlNodeSetSpacePreserve(void) {
22681 #if defined(LIBXML_TREE_ENABLED)
22683 xmlNodePtr cur; /* the node being changed */
22685 int val; /* the xml:space value ("0": default, 1: "preserve") */
22688 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22689 for (n_val = 0;n_val < gen_nb_int;n_val++) {
22690 mem_base = xmlMemBlocks();
22691 cur = gen_xmlNodePtr(n_cur, 0);
22692 val = gen_int(n_val, 1);
22694 xmlNodeSetSpacePreserve(cur, val);
22696 des_xmlNodePtr(n_cur, cur, 0);
22697 des_int(n_val, val, 1);
22698 xmlResetLastError();
22699 if (mem_base != xmlMemBlocks()) {
22700 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22701 xmlMemBlocks() - mem_base);
22703 printf(" %d", n_cur);
22704 printf(" %d", n_val);
22717 test_xmlPreviousElementSibling(void) {
22720 #if defined(LIBXML_TREE_ENABLED)
22722 xmlNodePtr ret_val;
22723 xmlNodePtr node; /* the current node */
22726 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22727 mem_base = xmlMemBlocks();
22728 node = gen_xmlNodePtr(n_node, 0);
22730 ret_val = xmlPreviousElementSibling(node);
22731 desret_xmlNodePtr(ret_val);
22733 des_xmlNodePtr(n_node, node, 0);
22734 xmlResetLastError();
22735 if (mem_base != xmlMemBlocks()) {
22736 printf("Leak of %d blocks found in xmlPreviousElementSibling",
22737 xmlMemBlocks() - mem_base);
22739 printf(" %d", n_node);
22751 test_xmlReconciliateNs(void) {
22754 #if defined(LIBXML_TREE_ENABLED)
22755 #ifdef LIBXML_TREE_ENABLED
22758 xmlDocPtr doc; /* the document */
22760 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22763 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22764 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22765 mem_base = xmlMemBlocks();
22766 doc = gen_xmlDocPtr(n_doc, 0);
22767 tree = gen_xmlNodePtr(n_tree, 1);
22769 ret_val = xmlReconciliateNs(doc, tree);
22770 desret_int(ret_val);
22772 des_xmlDocPtr(n_doc, doc, 0);
22773 des_xmlNodePtr(n_tree, tree, 1);
22774 xmlResetLastError();
22775 if (mem_base != xmlMemBlocks()) {
22776 printf("Leak of %d blocks found in xmlReconciliateNs",
22777 xmlMemBlocks() - mem_base);
22779 printf(" %d", n_doc);
22780 printf(" %d", n_tree);
22794 test_xmlRemoveProp(void) {
22799 xmlAttrPtr cur; /* an attribute */
22802 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22803 mem_base = xmlMemBlocks();
22804 cur = gen_xmlAttrPtr(n_cur, 0);
22806 ret_val = xmlRemoveProp(cur);
22808 desret_int(ret_val);
22810 des_xmlAttrPtr(n_cur, cur, 0);
22811 xmlResetLastError();
22812 if (mem_base != xmlMemBlocks()) {
22813 printf("Leak of %d blocks found in xmlRemoveProp",
22814 xmlMemBlocks() - mem_base);
22816 printf(" %d", n_cur);
22827 test_xmlReplaceNode(void) {
22830 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22832 xmlNodePtr ret_val;
22833 xmlNodePtr old; /* the old node */
22835 xmlNodePtr cur; /* the node */
22838 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22839 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22840 mem_base = xmlMemBlocks();
22841 old = gen_xmlNodePtr(n_old, 0);
22842 cur = gen_xmlNodePtr_in(n_cur, 1);
22844 ret_val = xmlReplaceNode(old, cur);
22846 xmlUnlinkNode(cur);
22847 xmlFreeNode(cur) ; cur = NULL ; }
22849 xmlUnlinkNode(old);
22850 xmlFreeNode(old) ; old = NULL ; }
22852 desret_xmlNodePtr(ret_val);
22854 des_xmlNodePtr(n_old, old, 0);
22855 des_xmlNodePtr_in(n_cur, cur, 1);
22856 xmlResetLastError();
22857 if (mem_base != xmlMemBlocks()) {
22858 printf("Leak of %d blocks found in xmlReplaceNode",
22859 xmlMemBlocks() - mem_base);
22861 printf(" %d", n_old);
22862 printf(" %d", n_cur);
22875 test_xmlSaveFile(void) {
22878 #if defined(LIBXML_OUTPUT_ENABLED)
22881 const char * filename; /* the filename (or URL) */
22883 xmlDocPtr cur; /* the document */
22886 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22887 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22888 mem_base = xmlMemBlocks();
22889 filename = gen_fileoutput(n_filename, 0);
22890 cur = gen_xmlDocPtr(n_cur, 1);
22892 ret_val = xmlSaveFile(filename, cur);
22893 desret_int(ret_val);
22895 des_fileoutput(n_filename, filename, 0);
22896 des_xmlDocPtr(n_cur, cur, 1);
22897 xmlResetLastError();
22898 if (mem_base != xmlMemBlocks()) {
22899 printf("Leak of %d blocks found in xmlSaveFile",
22900 xmlMemBlocks() - mem_base);
22902 printf(" %d", n_filename);
22903 printf(" %d", n_cur);
22916 test_xmlSaveFileEnc(void) {
22919 #if defined(LIBXML_OUTPUT_ENABLED)
22922 const char * filename; /* the filename (or URL) */
22924 xmlDocPtr cur; /* the document */
22926 char * encoding; /* the name of an encoding (or NULL) */
22929 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22930 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22931 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22932 mem_base = xmlMemBlocks();
22933 filename = gen_fileoutput(n_filename, 0);
22934 cur = gen_xmlDocPtr(n_cur, 1);
22935 encoding = gen_const_char_ptr(n_encoding, 2);
22937 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22938 desret_int(ret_val);
22940 des_fileoutput(n_filename, filename, 0);
22941 des_xmlDocPtr(n_cur, cur, 1);
22942 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22943 xmlResetLastError();
22944 if (mem_base != xmlMemBlocks()) {
22945 printf("Leak of %d blocks found in xmlSaveFileEnc",
22946 xmlMemBlocks() - mem_base);
22948 printf(" %d", n_filename);
22949 printf(" %d", n_cur);
22950 printf(" %d", n_encoding);
22964 test_xmlSaveFileTo(void) {
22967 #if defined(LIBXML_OUTPUT_ENABLED)
22970 xmlOutputBufferPtr buf; /* an output I/O buffer */
22972 xmlDocPtr cur; /* the document */
22974 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22977 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22978 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22979 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22980 mem_base = xmlMemBlocks();
22981 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22982 cur = gen_xmlDocPtr(n_cur, 1);
22983 encoding = gen_const_char_ptr(n_encoding, 2);
22985 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22987 desret_int(ret_val);
22989 des_xmlOutputBufferPtr(n_buf, buf, 0);
22990 des_xmlDocPtr(n_cur, cur, 1);
22991 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22992 xmlResetLastError();
22993 if (mem_base != xmlMemBlocks()) {
22994 printf("Leak of %d blocks found in xmlSaveFileTo",
22995 xmlMemBlocks() - mem_base);
22997 printf(" %d", n_buf);
22998 printf(" %d", n_cur);
22999 printf(" %d", n_encoding);
23013 test_xmlSaveFormatFile(void) {
23016 #if defined(LIBXML_OUTPUT_ENABLED)
23019 const char * filename; /* the filename (or URL) */
23021 xmlDocPtr cur; /* the document */
23023 int format; /* should formatting spaces been added */
23026 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23027 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23028 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23029 mem_base = xmlMemBlocks();
23030 filename = gen_fileoutput(n_filename, 0);
23031 cur = gen_xmlDocPtr(n_cur, 1);
23032 format = gen_int(n_format, 2);
23034 ret_val = xmlSaveFormatFile(filename, cur, format);
23035 desret_int(ret_val);
23037 des_fileoutput(n_filename, filename, 0);
23038 des_xmlDocPtr(n_cur, cur, 1);
23039 des_int(n_format, format, 2);
23040 xmlResetLastError();
23041 if (mem_base != xmlMemBlocks()) {
23042 printf("Leak of %d blocks found in xmlSaveFormatFile",
23043 xmlMemBlocks() - mem_base);
23045 printf(" %d", n_filename);
23046 printf(" %d", n_cur);
23047 printf(" %d", n_format);
23061 test_xmlSaveFormatFileEnc(void) {
23064 #if defined(LIBXML_OUTPUT_ENABLED)
23067 const char * filename; /* the filename or URL to output */
23069 xmlDocPtr cur; /* the document being saved */
23071 char * encoding; /* the name of the encoding to use or NULL. */
23073 int format; /* should formatting spaces be added. */
23076 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23077 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23078 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23079 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23080 mem_base = xmlMemBlocks();
23081 filename = gen_fileoutput(n_filename, 0);
23082 cur = gen_xmlDocPtr(n_cur, 1);
23083 encoding = gen_const_char_ptr(n_encoding, 2);
23084 format = gen_int(n_format, 3);
23086 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23087 desret_int(ret_val);
23089 des_fileoutput(n_filename, filename, 0);
23090 des_xmlDocPtr(n_cur, cur, 1);
23091 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23092 des_int(n_format, format, 3);
23093 xmlResetLastError();
23094 if (mem_base != xmlMemBlocks()) {
23095 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23096 xmlMemBlocks() - mem_base);
23098 printf(" %d", n_filename);
23099 printf(" %d", n_cur);
23100 printf(" %d", n_encoding);
23101 printf(" %d", n_format);
23116 test_xmlSaveFormatFileTo(void) {
23119 #if defined(LIBXML_OUTPUT_ENABLED)
23122 xmlOutputBufferPtr buf; /* an output I/O buffer */
23124 xmlDocPtr cur; /* the document */
23126 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23128 int format; /* should formatting spaces been added */
23131 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23132 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23133 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23134 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23135 mem_base = xmlMemBlocks();
23136 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23137 cur = gen_xmlDocPtr(n_cur, 1);
23138 encoding = gen_const_char_ptr(n_encoding, 2);
23139 format = gen_int(n_format, 3);
23141 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23143 desret_int(ret_val);
23145 des_xmlOutputBufferPtr(n_buf, buf, 0);
23146 des_xmlDocPtr(n_cur, cur, 1);
23147 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23148 des_int(n_format, format, 3);
23149 xmlResetLastError();
23150 if (mem_base != xmlMemBlocks()) {
23151 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23152 xmlMemBlocks() - mem_base);
23154 printf(" %d", n_buf);
23155 printf(" %d", n_cur);
23156 printf(" %d", n_encoding);
23157 printf(" %d", n_format);
23172 test_xmlSearchNs(void) {
23177 xmlDocPtr doc; /* the document */
23179 xmlNodePtr node; /* the current node */
23181 xmlChar * nameSpace; /* the namespace prefix */
23184 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23185 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23186 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23187 mem_base = xmlMemBlocks();
23188 doc = gen_xmlDocPtr(n_doc, 0);
23189 node = gen_xmlNodePtr(n_node, 1);
23190 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23192 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23193 desret_xmlNsPtr(ret_val);
23195 des_xmlDocPtr(n_doc, doc, 0);
23196 des_xmlNodePtr(n_node, node, 1);
23197 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23198 xmlResetLastError();
23199 if (mem_base != xmlMemBlocks()) {
23200 printf("Leak of %d blocks found in xmlSearchNs",
23201 xmlMemBlocks() - mem_base);
23203 printf(" %d", n_doc);
23204 printf(" %d", n_node);
23205 printf(" %d", n_nameSpace);
23218 test_xmlSearchNsByHref(void) {
23223 xmlDocPtr doc; /* the document */
23225 xmlNodePtr node; /* the current node */
23227 xmlChar * href; /* the namespace value */
23230 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23231 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23232 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23233 mem_base = xmlMemBlocks();
23234 doc = gen_xmlDocPtr(n_doc, 0);
23235 node = gen_xmlNodePtr(n_node, 1);
23236 href = gen_const_xmlChar_ptr(n_href, 2);
23238 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23239 desret_xmlNsPtr(ret_val);
23241 des_xmlDocPtr(n_doc, doc, 0);
23242 des_xmlNodePtr(n_node, node, 1);
23243 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23244 xmlResetLastError();
23245 if (mem_base != xmlMemBlocks()) {
23246 printf("Leak of %d blocks found in xmlSearchNsByHref",
23247 xmlMemBlocks() - mem_base);
23249 printf(" %d", n_doc);
23250 printf(" %d", n_node);
23251 printf(" %d", n_href);
23264 test_xmlSetBufferAllocationScheme(void) {
23268 xmlBufferAllocationScheme scheme; /* allocation method to use */
23271 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23272 mem_base = xmlMemBlocks();
23273 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23275 xmlSetBufferAllocationScheme(scheme);
23277 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23278 xmlResetLastError();
23279 if (mem_base != xmlMemBlocks()) {
23280 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23281 xmlMemBlocks() - mem_base);
23283 printf(" %d", n_scheme);
23294 test_xmlSetCompressMode(void) {
23298 int mode; /* the compression ratio */
23301 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23302 mem_base = xmlMemBlocks();
23303 mode = gen_int(n_mode, 0);
23305 xmlSetCompressMode(mode);
23307 des_int(n_mode, mode, 0);
23308 xmlResetLastError();
23309 if (mem_base != xmlMemBlocks()) {
23310 printf("Leak of %d blocks found in xmlSetCompressMode",
23311 xmlMemBlocks() - mem_base);
23313 printf(" %d", n_mode);
23324 test_xmlSetDocCompressMode(void) {
23328 xmlDocPtr doc; /* the document */
23330 int mode; /* the compression ratio */
23333 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23334 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23335 mem_base = xmlMemBlocks();
23336 doc = gen_xmlDocPtr(n_doc, 0);
23337 mode = gen_int(n_mode, 1);
23339 xmlSetDocCompressMode(doc, mode);
23341 des_xmlDocPtr(n_doc, doc, 0);
23342 des_int(n_mode, mode, 1);
23343 xmlResetLastError();
23344 if (mem_base != xmlMemBlocks()) {
23345 printf("Leak of %d blocks found in xmlSetDocCompressMode",
23346 xmlMemBlocks() - mem_base);
23348 printf(" %d", n_doc);
23349 printf(" %d", n_mode);
23361 test_xmlSetNs(void) {
23365 xmlNodePtr node; /* a node in the document */
23367 xmlNsPtr ns; /* a namespace pointer */
23370 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23371 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23372 mem_base = xmlMemBlocks();
23373 node = gen_xmlNodePtr(n_node, 0);
23374 ns = gen_xmlNsPtr(n_ns, 1);
23376 xmlSetNs(node, ns);
23378 des_xmlNodePtr(n_node, node, 0);
23379 des_xmlNsPtr(n_ns, ns, 1);
23380 xmlResetLastError();
23381 if (mem_base != xmlMemBlocks()) {
23382 printf("Leak of %d blocks found in xmlSetNs",
23383 xmlMemBlocks() - mem_base);
23385 printf(" %d", n_node);
23386 printf(" %d", n_ns);
23398 test_xmlSetNsProp(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 xmlNsPtr ns; /* the namespace definition */
23408 xmlChar * name; /* the attribute name */
23410 xmlChar * value; /* the attribute value */
23413 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23414 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23415 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23416 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23417 mem_base = xmlMemBlocks();
23418 node = gen_xmlNodePtr(n_node, 0);
23419 ns = gen_xmlNsPtr(n_ns, 1);
23420 name = gen_const_xmlChar_ptr(n_name, 2);
23421 value = gen_const_xmlChar_ptr(n_value, 3);
23423 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23424 desret_xmlAttrPtr(ret_val);
23426 des_xmlNodePtr(n_node, node, 0);
23427 des_xmlNsPtr(n_ns, ns, 1);
23428 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23429 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23430 xmlResetLastError();
23431 if (mem_base != xmlMemBlocks()) {
23432 printf("Leak of %d blocks found in xmlSetNsProp",
23433 xmlMemBlocks() - mem_base);
23435 printf(" %d", n_node);
23436 printf(" %d", n_ns);
23437 printf(" %d", n_name);
23438 printf(" %d", n_value);
23453 test_xmlSetProp(void) {
23456 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23458 xmlAttrPtr ret_val;
23459 xmlNodePtr node; /* the node */
23461 xmlChar * name; /* the attribute name (a QName) */
23463 xmlChar * value; /* the attribute value */
23466 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23467 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23468 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23469 mem_base = xmlMemBlocks();
23470 node = gen_xmlNodePtr(n_node, 0);
23471 name = gen_const_xmlChar_ptr(n_name, 1);
23472 value = gen_const_xmlChar_ptr(n_value, 2);
23474 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23475 desret_xmlAttrPtr(ret_val);
23477 des_xmlNodePtr(n_node, node, 0);
23478 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23479 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23480 xmlResetLastError();
23481 if (mem_base != xmlMemBlocks()) {
23482 printf("Leak of %d blocks found in xmlSetProp",
23483 xmlMemBlocks() - mem_base);
23485 printf(" %d", n_node);
23486 printf(" %d", n_name);
23487 printf(" %d", n_value);
23501 test_xmlSplitQName2(void) {
23506 xmlChar * name; /* the full QName */
23508 xmlChar ** prefix; /* a xmlChar ** */
23511 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23512 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23513 mem_base = xmlMemBlocks();
23514 name = gen_const_xmlChar_ptr(n_name, 0);
23515 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23517 ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23518 desret_xmlChar_ptr(ret_val);
23520 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23521 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23522 xmlResetLastError();
23523 if (mem_base != xmlMemBlocks()) {
23524 printf("Leak of %d blocks found in xmlSplitQName2",
23525 xmlMemBlocks() - mem_base);
23527 printf(" %d", n_name);
23528 printf(" %d", n_prefix);
23540 test_xmlSplitQName3(void) {
23544 const xmlChar * ret_val;
23545 xmlChar * name; /* the full QName */
23547 int * len; /* an int * */
23550 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23551 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23552 mem_base = xmlMemBlocks();
23553 name = gen_const_xmlChar_ptr(n_name, 0);
23554 len = gen_int_ptr(n_len, 1);
23556 ret_val = xmlSplitQName3((const xmlChar *)name, len);
23557 desret_const_xmlChar_ptr(ret_val);
23559 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23560 des_int_ptr(n_len, len, 1);
23561 xmlResetLastError();
23562 if (mem_base != xmlMemBlocks()) {
23563 printf("Leak of %d blocks found in xmlSplitQName3",
23564 xmlMemBlocks() - mem_base);
23566 printf(" %d", n_name);
23567 printf(" %d", n_len);
23579 test_xmlStringGetNodeList(void) {
23583 xmlNodePtr ret_val;
23584 xmlDocPtr doc; /* the document */
23586 xmlChar * value; /* the value of the attribute */
23589 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23590 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23591 mem_base = xmlMemBlocks();
23592 doc = gen_xmlDocPtr(n_doc, 0);
23593 value = gen_const_xmlChar_ptr(n_value, 1);
23595 ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23596 desret_xmlNodePtr(ret_val);
23598 des_xmlDocPtr(n_doc, doc, 0);
23599 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23600 xmlResetLastError();
23601 if (mem_base != xmlMemBlocks()) {
23602 printf("Leak of %d blocks found in xmlStringGetNodeList",
23603 xmlMemBlocks() - mem_base);
23605 printf(" %d", n_doc);
23606 printf(" %d", n_value);
23618 test_xmlStringLenGetNodeList(void) {
23622 xmlNodePtr ret_val;
23623 xmlDocPtr doc; /* the document */
23625 xmlChar * value; /* the value of the text */
23627 int len; /* the length of the string value */
23630 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23631 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23632 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23633 mem_base = xmlMemBlocks();
23634 doc = gen_xmlDocPtr(n_doc, 0);
23635 value = gen_const_xmlChar_ptr(n_value, 1);
23636 len = gen_int(n_len, 2);
23638 ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23639 desret_xmlNodePtr(ret_val);
23641 des_xmlDocPtr(n_doc, doc, 0);
23642 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23643 des_int(n_len, len, 2);
23644 xmlResetLastError();
23645 if (mem_base != xmlMemBlocks()) {
23646 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23647 xmlMemBlocks() - mem_base);
23649 printf(" %d", n_doc);
23650 printf(" %d", n_value);
23651 printf(" %d", n_len);
23664 test_xmlTextConcat(void) {
23669 xmlNodePtr node; /* the node */
23671 xmlChar * content; /* the content */
23673 int len; /* @content length */
23676 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23677 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23678 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23679 mem_base = xmlMemBlocks();
23680 node = gen_xmlNodePtr(n_node, 0);
23681 content = gen_const_xmlChar_ptr(n_content, 1);
23682 len = gen_int(n_len, 2);
23684 ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23685 desret_int(ret_val);
23687 des_xmlNodePtr(n_node, node, 0);
23688 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23689 des_int(n_len, len, 2);
23690 xmlResetLastError();
23691 if (mem_base != xmlMemBlocks()) {
23692 printf("Leak of %d blocks found in xmlTextConcat",
23693 xmlMemBlocks() - mem_base);
23695 printf(" %d", n_node);
23696 printf(" %d", n_content);
23697 printf(" %d", n_len);
23710 test_xmlTextMerge(void) {
23714 xmlNodePtr ret_val;
23715 xmlNodePtr first; /* the first text node */
23717 xmlNodePtr second; /* the second text node being merged */
23720 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23721 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23722 mem_base = xmlMemBlocks();
23723 first = gen_xmlNodePtr_in(n_first, 0);
23724 second = gen_xmlNodePtr_in(n_second, 1);
23726 ret_val = xmlTextMerge(first, second);
23727 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23728 xmlUnlinkNode(second);
23729 xmlFreeNode(second) ; second = NULL ; }
23730 desret_xmlNodePtr(ret_val);
23732 des_xmlNodePtr_in(n_first, first, 0);
23733 des_xmlNodePtr_in(n_second, second, 1);
23734 xmlResetLastError();
23735 if (mem_base != xmlMemBlocks()) {
23736 printf("Leak of %d blocks found in xmlTextMerge",
23737 xmlMemBlocks() - mem_base);
23739 printf(" %d", n_first);
23740 printf(" %d", n_second);
23752 test_xmlUnsetNsProp(void) {
23755 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23758 xmlNodePtr node; /* the node */
23760 xmlNsPtr ns; /* the namespace definition */
23762 xmlChar * name; /* the attribute name */
23765 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23766 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23767 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23768 mem_base = xmlMemBlocks();
23769 node = gen_xmlNodePtr(n_node, 0);
23770 ns = gen_xmlNsPtr(n_ns, 1);
23771 name = gen_const_xmlChar_ptr(n_name, 2);
23773 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23774 desret_int(ret_val);
23776 des_xmlNodePtr(n_node, node, 0);
23777 des_xmlNsPtr(n_ns, ns, 1);
23778 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23779 xmlResetLastError();
23780 if (mem_base != xmlMemBlocks()) {
23781 printf("Leak of %d blocks found in xmlUnsetNsProp",
23782 xmlMemBlocks() - mem_base);
23784 printf(" %d", n_node);
23785 printf(" %d", n_ns);
23786 printf(" %d", n_name);
23800 test_xmlUnsetProp(void) {
23803 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23806 xmlNodePtr node; /* the node */
23808 xmlChar * name; /* the attribute name */
23811 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23812 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23813 mem_base = xmlMemBlocks();
23814 node = gen_xmlNodePtr(n_node, 0);
23815 name = gen_const_xmlChar_ptr(n_name, 1);
23817 ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23818 desret_int(ret_val);
23820 des_xmlNodePtr(n_node, node, 0);
23821 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23822 xmlResetLastError();
23823 if (mem_base != xmlMemBlocks()) {
23824 printf("Leak of %d blocks found in xmlUnsetProp",
23825 xmlMemBlocks() - mem_base);
23827 printf(" %d", n_node);
23828 printf(" %d", n_name);
23841 test_xmlValidateNCName(void) {
23844 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
23845 #ifdef LIBXML_TREE_ENABLED
23848 xmlChar * value; /* the value to check */
23850 int space; /* allow spaces in front and end of the string */
23853 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23854 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23855 mem_base = xmlMemBlocks();
23856 value = gen_const_xmlChar_ptr(n_value, 0);
23857 space = gen_int(n_space, 1);
23859 ret_val = xmlValidateNCName((const xmlChar *)value, space);
23860 desret_int(ret_val);
23862 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23863 des_int(n_space, space, 1);
23864 xmlResetLastError();
23865 if (mem_base != xmlMemBlocks()) {
23866 printf("Leak of %d blocks found in xmlValidateNCName",
23867 xmlMemBlocks() - mem_base);
23869 printf(" %d", n_value);
23870 printf(" %d", n_space);
23884 test_xmlValidateNMToken(void) {
23887 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23888 #ifdef LIBXML_TREE_ENABLED
23891 xmlChar * value; /* the value to check */
23893 int space; /* allow spaces in front and end of the string */
23896 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23897 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23898 mem_base = xmlMemBlocks();
23899 value = gen_const_xmlChar_ptr(n_value, 0);
23900 space = gen_int(n_space, 1);
23902 ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23903 desret_int(ret_val);
23905 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23906 des_int(n_space, space, 1);
23907 xmlResetLastError();
23908 if (mem_base != xmlMemBlocks()) {
23909 printf("Leak of %d blocks found in xmlValidateNMToken",
23910 xmlMemBlocks() - mem_base);
23912 printf(" %d", n_value);
23913 printf(" %d", n_space);
23927 test_xmlValidateName(void) {
23930 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23931 #ifdef LIBXML_TREE_ENABLED
23934 xmlChar * value; /* the value to check */
23936 int space; /* allow spaces in front and end of the string */
23939 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23940 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23941 mem_base = xmlMemBlocks();
23942 value = gen_const_xmlChar_ptr(n_value, 0);
23943 space = gen_int(n_space, 1);
23945 ret_val = xmlValidateName((const xmlChar *)value, space);
23946 desret_int(ret_val);
23948 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23949 des_int(n_space, space, 1);
23950 xmlResetLastError();
23951 if (mem_base != xmlMemBlocks()) {
23952 printf("Leak of %d blocks found in xmlValidateName",
23953 xmlMemBlocks() - mem_base);
23955 printf(" %d", n_value);
23956 printf(" %d", n_space);
23970 test_xmlValidateQName(void) {
23973 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23974 #ifdef LIBXML_TREE_ENABLED
23977 xmlChar * value; /* the value to check */
23979 int space; /* allow spaces in front and end of the string */
23982 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23983 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23984 mem_base = xmlMemBlocks();
23985 value = gen_const_xmlChar_ptr(n_value, 0);
23986 space = gen_int(n_space, 1);
23988 ret_val = xmlValidateQName((const xmlChar *)value, space);
23989 desret_int(ret_val);
23991 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23992 des_int(n_space, space, 1);
23993 xmlResetLastError();
23994 if (mem_base != xmlMemBlocks()) {
23995 printf("Leak of %d blocks found in xmlValidateQName",
23996 xmlMemBlocks() - mem_base);
23998 printf(" %d", n_value);
23999 printf(" %d", n_space);
24015 if (quiet == 0) printf("Testing tree : 138 of 157 functions ...\n");
24016 test_ret += test_xmlAddChild();
24017 test_ret += test_xmlAddChildList();
24018 test_ret += test_xmlAddNextSibling();
24019 test_ret += test_xmlAddPrevSibling();
24020 test_ret += test_xmlAddSibling();
24021 test_ret += test_xmlAttrSerializeTxtContent();
24022 test_ret += test_xmlBufferAdd();
24023 test_ret += test_xmlBufferAddHead();
24024 test_ret += test_xmlBufferCCat();
24025 test_ret += test_xmlBufferCat();
24026 test_ret += test_xmlBufferContent();
24027 test_ret += test_xmlBufferCreate();
24028 test_ret += test_xmlBufferCreateSize();
24029 test_ret += test_xmlBufferCreateStatic();
24030 test_ret += test_xmlBufferEmpty();
24031 test_ret += test_xmlBufferGrow();
24032 test_ret += test_xmlBufferLength();
24033 test_ret += test_xmlBufferResize();
24034 test_ret += test_xmlBufferSetAllocationScheme();
24035 test_ret += test_xmlBufferShrink();
24036 test_ret += test_xmlBufferWriteCHAR();
24037 test_ret += test_xmlBufferWriteChar();
24038 test_ret += test_xmlBufferWriteQuotedString();
24039 test_ret += test_xmlBuildQName();
24040 test_ret += test_xmlChildElementCount();
24041 test_ret += test_xmlCopyDoc();
24042 test_ret += test_xmlCopyDtd();
24043 test_ret += test_xmlCopyNamespace();
24044 test_ret += test_xmlCopyNamespaceList();
24045 test_ret += test_xmlCopyNode();
24046 test_ret += test_xmlCopyNodeList();
24047 test_ret += test_xmlCopyProp();
24048 test_ret += test_xmlCopyPropList();
24049 test_ret += test_xmlCreateIntSubset();
24050 test_ret += test_xmlDOMWrapAdoptNode();
24051 test_ret += test_xmlDOMWrapCloneNode();
24052 test_ret += test_xmlDOMWrapNewCtxt();
24053 test_ret += test_xmlDOMWrapReconcileNamespaces();
24054 test_ret += test_xmlDOMWrapRemoveNode();
24055 test_ret += test_xmlDocCopyNode();
24056 test_ret += test_xmlDocCopyNodeList();
24057 test_ret += test_xmlDocDump();
24058 test_ret += test_xmlDocDumpFormatMemory();
24059 test_ret += test_xmlDocDumpFormatMemoryEnc();
24060 test_ret += test_xmlDocDumpMemory();
24061 test_ret += test_xmlDocDumpMemoryEnc();
24062 test_ret += test_xmlDocFormatDump();
24063 test_ret += test_xmlDocGetRootElement();
24064 test_ret += test_xmlDocSetRootElement();
24065 test_ret += test_xmlElemDump();
24066 test_ret += test_xmlFirstElementChild();
24067 test_ret += test_xmlGetBufferAllocationScheme();
24068 test_ret += test_xmlGetCompressMode();
24069 test_ret += test_xmlGetDocCompressMode();
24070 test_ret += test_xmlGetIntSubset();
24071 test_ret += test_xmlGetLastChild();
24072 test_ret += test_xmlGetLineNo();
24073 test_ret += test_xmlGetNoNsProp();
24074 test_ret += test_xmlGetNodePath();
24075 test_ret += test_xmlGetNsList();
24076 test_ret += test_xmlGetNsProp();
24077 test_ret += test_xmlGetProp();
24078 test_ret += test_xmlHasNsProp();
24079 test_ret += test_xmlHasProp();
24080 test_ret += test_xmlIsBlankNode();
24081 test_ret += test_xmlIsXHTML();
24082 test_ret += test_xmlLastElementChild();
24083 test_ret += test_xmlNewCDataBlock();
24084 test_ret += test_xmlNewCharRef();
24085 test_ret += test_xmlNewChild();
24086 test_ret += test_xmlNewComment();
24087 test_ret += test_xmlNewDoc();
24088 test_ret += test_xmlNewDocComment();
24089 test_ret += test_xmlNewDocFragment();
24090 test_ret += test_xmlNewDocNode();
24091 test_ret += test_xmlNewDocNodeEatName();
24092 test_ret += test_xmlNewDocPI();
24093 test_ret += test_xmlNewDocProp();
24094 test_ret += test_xmlNewDocRawNode();
24095 test_ret += test_xmlNewDocText();
24096 test_ret += test_xmlNewDocTextLen();
24097 test_ret += test_xmlNewDtd();
24098 test_ret += test_xmlNewNode();
24099 test_ret += test_xmlNewNodeEatName();
24100 test_ret += test_xmlNewNs();
24101 test_ret += test_xmlNewNsProp();
24102 test_ret += test_xmlNewNsPropEatName();
24103 test_ret += test_xmlNewPI();
24104 test_ret += test_xmlNewProp();
24105 test_ret += test_xmlNewReference();
24106 test_ret += test_xmlNewText();
24107 test_ret += test_xmlNewTextChild();
24108 test_ret += test_xmlNewTextLen();
24109 test_ret += test_xmlNextElementSibling();
24110 test_ret += test_xmlNodeAddContent();
24111 test_ret += test_xmlNodeAddContentLen();
24112 test_ret += test_xmlNodeBufGetContent();
24113 test_ret += test_xmlNodeDump();
24114 test_ret += test_xmlNodeDumpOutput();
24115 test_ret += test_xmlNodeGetBase();
24116 test_ret += test_xmlNodeGetContent();
24117 test_ret += test_xmlNodeGetLang();
24118 test_ret += test_xmlNodeGetSpacePreserve();
24119 test_ret += test_xmlNodeIsText();
24120 test_ret += test_xmlNodeListGetRawString();
24121 test_ret += test_xmlNodeListGetString();
24122 test_ret += test_xmlNodeSetBase();
24123 test_ret += test_xmlNodeSetContent();
24124 test_ret += test_xmlNodeSetContentLen();
24125 test_ret += test_xmlNodeSetLang();
24126 test_ret += test_xmlNodeSetName();
24127 test_ret += test_xmlNodeSetSpacePreserve();
24128 test_ret += test_xmlPreviousElementSibling();
24129 test_ret += test_xmlReconciliateNs();
24130 test_ret += test_xmlRemoveProp();
24131 test_ret += test_xmlReplaceNode();
24132 test_ret += test_xmlSaveFile();
24133 test_ret += test_xmlSaveFileEnc();
24134 test_ret += test_xmlSaveFileTo();
24135 test_ret += test_xmlSaveFormatFile();
24136 test_ret += test_xmlSaveFormatFileEnc();
24137 test_ret += test_xmlSaveFormatFileTo();
24138 test_ret += test_xmlSearchNs();
24139 test_ret += test_xmlSearchNsByHref();
24140 test_ret += test_xmlSetBufferAllocationScheme();
24141 test_ret += test_xmlSetCompressMode();
24142 test_ret += test_xmlSetDocCompressMode();
24143 test_ret += test_xmlSetNs();
24144 test_ret += test_xmlSetNsProp();
24145 test_ret += test_xmlSetProp();
24146 test_ret += test_xmlSplitQName2();
24147 test_ret += test_xmlSplitQName3();
24148 test_ret += test_xmlStringGetNodeList();
24149 test_ret += test_xmlStringLenGetNodeList();
24150 test_ret += test_xmlTextConcat();
24151 test_ret += test_xmlTextMerge();
24152 test_ret += test_xmlUnsetNsProp();
24153 test_ret += test_xmlUnsetProp();
24154 test_ret += test_xmlValidateNCName();
24155 test_ret += test_xmlValidateNMToken();
24156 test_ret += test_xmlValidateName();
24157 test_ret += test_xmlValidateQName();
24160 printf("Module tree: %d errors\n", test_ret);
24165 test_xmlBuildRelativeURI(void) {
24170 xmlChar * URI; /* the URI reference under consideration */
24172 xmlChar * base; /* the base value */
24175 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24176 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24177 mem_base = xmlMemBlocks();
24178 URI = gen_const_xmlChar_ptr(n_URI, 0);
24179 base = gen_const_xmlChar_ptr(n_base, 1);
24181 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24182 desret_xmlChar_ptr(ret_val);
24184 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24185 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24186 xmlResetLastError();
24187 if (mem_base != xmlMemBlocks()) {
24188 printf("Leak of %d blocks found in xmlBuildRelativeURI",
24189 xmlMemBlocks() - mem_base);
24191 printf(" %d", n_URI);
24192 printf(" %d", n_base);
24204 test_xmlBuildURI(void) {
24209 xmlChar * URI; /* the URI instance found in the document */
24211 xmlChar * base; /* the base value */
24214 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24215 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24216 mem_base = xmlMemBlocks();
24217 URI = gen_const_xmlChar_ptr(n_URI, 0);
24218 base = gen_const_xmlChar_ptr(n_base, 1);
24220 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24221 desret_xmlChar_ptr(ret_val);
24223 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24224 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24225 xmlResetLastError();
24226 if (mem_base != xmlMemBlocks()) {
24227 printf("Leak of %d blocks found in xmlBuildURI",
24228 xmlMemBlocks() - mem_base);
24230 printf(" %d", n_URI);
24231 printf(" %d", n_base);
24243 test_xmlCanonicPath(void) {
24248 xmlChar * path; /* the resource locator in a filesystem notation */
24251 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24252 mem_base = xmlMemBlocks();
24253 path = gen_const_xmlChar_ptr(n_path, 0);
24255 ret_val = xmlCanonicPath((const xmlChar *)path);
24256 desret_xmlChar_ptr(ret_val);
24258 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24259 xmlResetLastError();
24260 if (mem_base != xmlMemBlocks()) {
24261 printf("Leak of %d blocks found in xmlCanonicPath",
24262 xmlMemBlocks() - mem_base);
24264 printf(" %d", n_path);
24275 test_xmlCreateURI(void) {
24279 /* missing type support */
24285 test_xmlNormalizeURIPath(void) {
24290 char * path; /* pointer to the path string */
24293 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24294 mem_base = xmlMemBlocks();
24295 path = gen_char_ptr(n_path, 0);
24297 ret_val = xmlNormalizeURIPath(path);
24298 desret_int(ret_val);
24300 des_char_ptr(n_path, path, 0);
24301 xmlResetLastError();
24302 if (mem_base != xmlMemBlocks()) {
24303 printf("Leak of %d blocks found in xmlNormalizeURIPath",
24304 xmlMemBlocks() - mem_base);
24306 printf(" %d", n_path);
24317 test_xmlParseURI(void) {
24321 /* missing type support */
24327 test_xmlParseURIRaw(void) {
24331 /* missing type support */
24336 #define gen_nb_xmlURIPtr 1
24337 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24340 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24344 test_xmlParseURIReference(void) {
24349 xmlURIPtr uri; /* pointer to an URI structure */
24351 char * str; /* the string to analyze */
24354 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24355 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24356 mem_base = xmlMemBlocks();
24357 uri = gen_xmlURIPtr(n_uri, 0);
24358 str = gen_const_char_ptr(n_str, 1);
24360 ret_val = xmlParseURIReference(uri, (const char *)str);
24361 desret_int(ret_val);
24363 des_xmlURIPtr(n_uri, uri, 0);
24364 des_const_char_ptr(n_str, (const char *)str, 1);
24365 xmlResetLastError();
24366 if (mem_base != xmlMemBlocks()) {
24367 printf("Leak of %d blocks found in xmlParseURIReference",
24368 xmlMemBlocks() - mem_base);
24370 printf(" %d", n_uri);
24371 printf(" %d", n_str);
24383 test_xmlPathToURI(void) {
24388 xmlChar * path; /* the resource locator in a filesystem notation */
24391 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24392 mem_base = xmlMemBlocks();
24393 path = gen_const_xmlChar_ptr(n_path, 0);
24395 ret_val = xmlPathToURI((const xmlChar *)path);
24396 desret_xmlChar_ptr(ret_val);
24398 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24399 xmlResetLastError();
24400 if (mem_base != xmlMemBlocks()) {
24401 printf("Leak of %d blocks found in xmlPathToURI",
24402 xmlMemBlocks() - mem_base);
24404 printf(" %d", n_path);
24415 test_xmlPrintURI(void) {
24419 FILE * stream; /* a FILE* for the output */
24421 xmlURIPtr uri; /* pointer to an xmlURI */
24424 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24425 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24426 mem_base = xmlMemBlocks();
24427 stream = gen_FILE_ptr(n_stream, 0);
24428 uri = gen_xmlURIPtr(n_uri, 1);
24430 xmlPrintURI(stream, uri);
24432 des_FILE_ptr(n_stream, stream, 0);
24433 des_xmlURIPtr(n_uri, uri, 1);
24434 xmlResetLastError();
24435 if (mem_base != xmlMemBlocks()) {
24436 printf("Leak of %d blocks found in xmlPrintURI",
24437 xmlMemBlocks() - mem_base);
24439 printf(" %d", n_stream);
24440 printf(" %d", n_uri);
24452 test_xmlSaveUri(void) {
24457 xmlURIPtr uri; /* pointer to an xmlURI */
24460 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24461 mem_base = xmlMemBlocks();
24462 uri = gen_xmlURIPtr(n_uri, 0);
24464 ret_val = xmlSaveUri(uri);
24465 desret_xmlChar_ptr(ret_val);
24467 des_xmlURIPtr(n_uri, uri, 0);
24468 xmlResetLastError();
24469 if (mem_base != xmlMemBlocks()) {
24470 printf("Leak of %d blocks found in xmlSaveUri",
24471 xmlMemBlocks() - mem_base);
24473 printf(" %d", n_uri);
24484 test_xmlURIEscape(void) {
24489 xmlChar * str; /* the string of the URI to escape */
24492 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24493 mem_base = xmlMemBlocks();
24494 str = gen_const_xmlChar_ptr(n_str, 0);
24496 ret_val = xmlURIEscape((const xmlChar *)str);
24497 desret_xmlChar_ptr(ret_val);
24499 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24500 xmlResetLastError();
24501 if (mem_base != xmlMemBlocks()) {
24502 printf("Leak of %d blocks found in xmlURIEscape",
24503 xmlMemBlocks() - mem_base);
24505 printf(" %d", n_str);
24516 test_xmlURIEscapeStr(void) {
24521 xmlChar * str; /* string to escape */
24523 xmlChar * list; /* exception list string of chars not to escape */
24526 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24527 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24528 mem_base = xmlMemBlocks();
24529 str = gen_const_xmlChar_ptr(n_str, 0);
24530 list = gen_const_xmlChar_ptr(n_list, 1);
24532 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24533 desret_xmlChar_ptr(ret_val);
24535 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24536 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24537 xmlResetLastError();
24538 if (mem_base != xmlMemBlocks()) {
24539 printf("Leak of %d blocks found in xmlURIEscapeStr",
24540 xmlMemBlocks() - mem_base);
24542 printf(" %d", n_str);
24543 printf(" %d", n_list);
24555 test_xmlURIUnescapeString(void) {
24559 /* missing type support */
24567 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24568 test_ret += test_xmlBuildRelativeURI();
24569 test_ret += test_xmlBuildURI();
24570 test_ret += test_xmlCanonicPath();
24571 test_ret += test_xmlCreateURI();
24572 test_ret += test_xmlNormalizeURIPath();
24573 test_ret += test_xmlParseURI();
24574 test_ret += test_xmlParseURIRaw();
24575 test_ret += test_xmlParseURIReference();
24576 test_ret += test_xmlPathToURI();
24577 test_ret += test_xmlPrintURI();
24578 test_ret += test_xmlSaveUri();
24579 test_ret += test_xmlURIEscape();
24580 test_ret += test_xmlURIEscapeStr();
24581 test_ret += test_xmlURIUnescapeString();
24584 printf("Module uri: %d errors\n", test_ret);
24589 test_xmlAddAttributeDecl(void) {
24593 xmlAttributePtr ret_val;
24594 xmlValidCtxtPtr ctxt; /* the validation context */
24596 xmlDtdPtr dtd; /* pointer to the DTD */
24598 xmlChar * elem; /* the element name */
24600 xmlChar * name; /* the attribute name */
24602 xmlChar * ns; /* the attribute namespace prefix */
24604 xmlAttributeType type; /* the attribute type */
24606 xmlAttributeDefault def; /* the attribute default type */
24608 xmlChar * defaultValue; /* the attribute default value */
24609 int n_defaultValue;
24610 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24613 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24614 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24615 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24616 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24617 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24618 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24619 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24620 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24621 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24622 mem_base = xmlMemBlocks();
24623 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24624 dtd = gen_xmlDtdPtr(n_dtd, 1);
24625 elem = gen_const_xmlChar_ptr(n_elem, 2);
24626 name = gen_const_xmlChar_ptr(n_name, 3);
24627 ns = gen_const_xmlChar_ptr(n_ns, 4);
24628 type = gen_xmlAttributeType(n_type, 5);
24629 def = gen_xmlAttributeDefault(n_def, 6);
24630 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24631 tree = gen_xmlEnumerationPtr(n_tree, 8);
24633 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24634 desret_xmlAttributePtr(ret_val);
24636 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24637 des_xmlDtdPtr(n_dtd, dtd, 1);
24638 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24639 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24640 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24641 des_xmlAttributeType(n_type, type, 5);
24642 des_xmlAttributeDefault(n_def, def, 6);
24643 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24644 des_xmlEnumerationPtr(n_tree, tree, 8);
24645 xmlResetLastError();
24646 if (mem_base != xmlMemBlocks()) {
24647 printf("Leak of %d blocks found in xmlAddAttributeDecl",
24648 xmlMemBlocks() - mem_base);
24650 printf(" %d", n_ctxt);
24651 printf(" %d", n_dtd);
24652 printf(" %d", n_elem);
24653 printf(" %d", n_name);
24654 printf(" %d", n_ns);
24655 printf(" %d", n_type);
24656 printf(" %d", n_def);
24657 printf(" %d", n_defaultValue);
24658 printf(" %d", n_tree);
24677 test_xmlAddElementDecl(void) {
24681 xmlElementPtr ret_val;
24682 xmlValidCtxtPtr ctxt; /* the validation context */
24684 xmlDtdPtr dtd; /* pointer to the DTD */
24686 xmlChar * name; /* the entity name */
24688 xmlElementTypeVal type; /* the element type */
24690 xmlElementContentPtr content; /* the element content tree or NULL */
24693 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24694 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24695 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24696 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24697 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24698 mem_base = xmlMemBlocks();
24699 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24700 dtd = gen_xmlDtdPtr(n_dtd, 1);
24701 name = gen_const_xmlChar_ptr(n_name, 2);
24702 type = gen_xmlElementTypeVal(n_type, 3);
24703 content = gen_xmlElementContentPtr(n_content, 4);
24705 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24706 desret_xmlElementPtr(ret_val);
24708 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24709 des_xmlDtdPtr(n_dtd, dtd, 1);
24710 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24711 des_xmlElementTypeVal(n_type, type, 3);
24712 des_xmlElementContentPtr(n_content, content, 4);
24713 xmlResetLastError();
24714 if (mem_base != xmlMemBlocks()) {
24715 printf("Leak of %d blocks found in xmlAddElementDecl",
24716 xmlMemBlocks() - mem_base);
24718 printf(" %d", n_ctxt);
24719 printf(" %d", n_dtd);
24720 printf(" %d", n_name);
24721 printf(" %d", n_type);
24722 printf(" %d", n_content);
24737 test_xmlAddID(void) {
24741 /* missing type support */
24747 test_xmlAddNotationDecl(void) {
24751 /* missing type support */
24757 test_xmlAddRef(void) {
24761 /* missing type support */
24766 #define gen_nb_xmlAttributeTablePtr 1
24767 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24770 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24774 test_xmlCopyAttributeTable(void) {
24778 /* missing type support */
24784 test_xmlCopyDocElementContent(void) {
24788 xmlElementContentPtr ret_val;
24789 xmlDocPtr doc; /* the document owning the element declaration */
24791 xmlElementContentPtr cur; /* An element content pointer. */
24794 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24795 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24796 mem_base = xmlMemBlocks();
24797 doc = gen_xmlDocPtr(n_doc, 0);
24798 cur = gen_xmlElementContentPtr(n_cur, 1);
24800 ret_val = xmlCopyDocElementContent(doc, cur);
24801 desret_xmlElementContentPtr(ret_val);
24803 des_xmlDocPtr(n_doc, doc, 0);
24804 des_xmlElementContentPtr(n_cur, cur, 1);
24805 xmlResetLastError();
24806 if (mem_base != xmlMemBlocks()) {
24807 printf("Leak of %d blocks found in xmlCopyDocElementContent",
24808 xmlMemBlocks() - mem_base);
24810 printf(" %d", n_doc);
24811 printf(" %d", n_cur);
24823 test_xmlCopyElementContent(void) {
24827 xmlElementContentPtr ret_val;
24828 xmlElementContentPtr cur; /* An element content pointer. */
24831 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24832 mem_base = xmlMemBlocks();
24833 cur = gen_xmlElementContentPtr(n_cur, 0);
24835 ret_val = xmlCopyElementContent(cur);
24836 desret_xmlElementContentPtr(ret_val);
24838 des_xmlElementContentPtr(n_cur, cur, 0);
24839 xmlResetLastError();
24840 if (mem_base != xmlMemBlocks()) {
24841 printf("Leak of %d blocks found in xmlCopyElementContent",
24842 xmlMemBlocks() - mem_base);
24844 printf(" %d", n_cur);
24854 #define gen_nb_xmlElementTablePtr 1
24855 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24858 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24862 test_xmlCopyElementTable(void) {
24866 /* missing type support */
24872 test_xmlCopyEnumeration(void) {
24876 /* missing type support */
24881 #define gen_nb_xmlNotationTablePtr 1
24882 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24885 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24889 test_xmlCopyNotationTable(void) {
24893 /* missing type support */
24899 test_xmlCreateEnumeration(void) {
24903 /* missing type support */
24908 #define gen_nb_xmlAttributePtr 1
24909 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24912 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24916 test_xmlDumpAttributeDecl(void) {
24919 #if defined(LIBXML_OUTPUT_ENABLED)
24921 xmlBufferPtr buf; /* the XML buffer output */
24923 xmlAttributePtr attr; /* An attribute declaration */
24926 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24927 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24928 mem_base = xmlMemBlocks();
24929 buf = gen_xmlBufferPtr(n_buf, 0);
24930 attr = gen_xmlAttributePtr(n_attr, 1);
24932 xmlDumpAttributeDecl(buf, attr);
24934 des_xmlBufferPtr(n_buf, buf, 0);
24935 des_xmlAttributePtr(n_attr, attr, 1);
24936 xmlResetLastError();
24937 if (mem_base != xmlMemBlocks()) {
24938 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24939 xmlMemBlocks() - mem_base);
24941 printf(" %d", n_buf);
24942 printf(" %d", n_attr);
24955 test_xmlDumpAttributeTable(void) {
24958 #if defined(LIBXML_OUTPUT_ENABLED)
24960 xmlBufferPtr buf; /* the XML buffer output */
24962 xmlAttributeTablePtr table; /* An attribute table */
24965 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24966 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24967 mem_base = xmlMemBlocks();
24968 buf = gen_xmlBufferPtr(n_buf, 0);
24969 table = gen_xmlAttributeTablePtr(n_table, 1);
24971 xmlDumpAttributeTable(buf, table);
24973 des_xmlBufferPtr(n_buf, buf, 0);
24974 des_xmlAttributeTablePtr(n_table, table, 1);
24975 xmlResetLastError();
24976 if (mem_base != xmlMemBlocks()) {
24977 printf("Leak of %d blocks found in xmlDumpAttributeTable",
24978 xmlMemBlocks() - mem_base);
24980 printf(" %d", n_buf);
24981 printf(" %d", n_table);
24993 #define gen_nb_xmlElementPtr 1
24994 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24997 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25001 test_xmlDumpElementDecl(void) {
25004 #if defined(LIBXML_OUTPUT_ENABLED)
25006 xmlBufferPtr buf; /* the XML buffer output */
25008 xmlElementPtr elem; /* An element table */
25011 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25012 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25013 mem_base = xmlMemBlocks();
25014 buf = gen_xmlBufferPtr(n_buf, 0);
25015 elem = gen_xmlElementPtr(n_elem, 1);
25017 xmlDumpElementDecl(buf, elem);
25019 des_xmlBufferPtr(n_buf, buf, 0);
25020 des_xmlElementPtr(n_elem, elem, 1);
25021 xmlResetLastError();
25022 if (mem_base != xmlMemBlocks()) {
25023 printf("Leak of %d blocks found in xmlDumpElementDecl",
25024 xmlMemBlocks() - mem_base);
25026 printf(" %d", n_buf);
25027 printf(" %d", n_elem);
25040 test_xmlDumpElementTable(void) {
25043 #if defined(LIBXML_OUTPUT_ENABLED)
25045 xmlBufferPtr buf; /* the XML buffer output */
25047 xmlElementTablePtr table; /* An element table */
25050 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25051 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25052 mem_base = xmlMemBlocks();
25053 buf = gen_xmlBufferPtr(n_buf, 0);
25054 table = gen_xmlElementTablePtr(n_table, 1);
25056 xmlDumpElementTable(buf, table);
25058 des_xmlBufferPtr(n_buf, buf, 0);
25059 des_xmlElementTablePtr(n_table, table, 1);
25060 xmlResetLastError();
25061 if (mem_base != xmlMemBlocks()) {
25062 printf("Leak of %d blocks found in xmlDumpElementTable",
25063 xmlMemBlocks() - mem_base);
25065 printf(" %d", n_buf);
25066 printf(" %d", n_table);
25078 #define gen_nb_xmlNotationPtr 1
25079 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25082 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25086 test_xmlDumpNotationDecl(void) {
25089 #if defined(LIBXML_OUTPUT_ENABLED)
25091 xmlBufferPtr buf; /* the XML buffer output */
25093 xmlNotationPtr nota; /* A notation declaration */
25096 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25097 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25098 mem_base = xmlMemBlocks();
25099 buf = gen_xmlBufferPtr(n_buf, 0);
25100 nota = gen_xmlNotationPtr(n_nota, 1);
25102 xmlDumpNotationDecl(buf, nota);
25104 des_xmlBufferPtr(n_buf, buf, 0);
25105 des_xmlNotationPtr(n_nota, nota, 1);
25106 xmlResetLastError();
25107 if (mem_base != xmlMemBlocks()) {
25108 printf("Leak of %d blocks found in xmlDumpNotationDecl",
25109 xmlMemBlocks() - mem_base);
25111 printf(" %d", n_buf);
25112 printf(" %d", n_nota);
25125 test_xmlDumpNotationTable(void) {
25128 #if defined(LIBXML_OUTPUT_ENABLED)
25130 xmlBufferPtr buf; /* the XML buffer output */
25132 xmlNotationTablePtr table; /* A notation table */
25135 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25136 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25137 mem_base = xmlMemBlocks();
25138 buf = gen_xmlBufferPtr(n_buf, 0);
25139 table = gen_xmlNotationTablePtr(n_table, 1);
25141 xmlDumpNotationTable(buf, table);
25143 des_xmlBufferPtr(n_buf, buf, 0);
25144 des_xmlNotationTablePtr(n_table, table, 1);
25145 xmlResetLastError();
25146 if (mem_base != xmlMemBlocks()) {
25147 printf("Leak of %d blocks found in xmlDumpNotationTable",
25148 xmlMemBlocks() - mem_base);
25150 printf(" %d", n_buf);
25151 printf(" %d", n_table);
25164 test_xmlGetDtdAttrDesc(void) {
25168 xmlAttributePtr ret_val;
25169 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25171 xmlChar * elem; /* the element name */
25173 xmlChar * name; /* the attribute name */
25176 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25177 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25178 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25179 mem_base = xmlMemBlocks();
25180 dtd = gen_xmlDtdPtr(n_dtd, 0);
25181 elem = gen_const_xmlChar_ptr(n_elem, 1);
25182 name = gen_const_xmlChar_ptr(n_name, 2);
25184 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25185 desret_xmlAttributePtr(ret_val);
25187 des_xmlDtdPtr(n_dtd, dtd, 0);
25188 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25189 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25190 xmlResetLastError();
25191 if (mem_base != xmlMemBlocks()) {
25192 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25193 xmlMemBlocks() - mem_base);
25195 printf(" %d", n_dtd);
25196 printf(" %d", n_elem);
25197 printf(" %d", n_name);
25210 test_xmlGetDtdElementDesc(void) {
25214 xmlElementPtr ret_val;
25215 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25217 xmlChar * name; /* the element name */
25220 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25221 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25222 mem_base = xmlMemBlocks();
25223 dtd = gen_xmlDtdPtr(n_dtd, 0);
25224 name = gen_const_xmlChar_ptr(n_name, 1);
25226 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25227 desret_xmlElementPtr(ret_val);
25229 des_xmlDtdPtr(n_dtd, dtd, 0);
25230 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25231 xmlResetLastError();
25232 if (mem_base != xmlMemBlocks()) {
25233 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25234 xmlMemBlocks() - mem_base);
25236 printf(" %d", n_dtd);
25237 printf(" %d", n_name);
25249 test_xmlGetDtdNotationDesc(void) {
25253 /* missing type support */
25259 test_xmlGetDtdQAttrDesc(void) {
25263 xmlAttributePtr ret_val;
25264 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25266 xmlChar * elem; /* the element name */
25268 xmlChar * name; /* the attribute name */
25270 xmlChar * prefix; /* the attribute namespace prefix */
25273 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25274 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25275 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25276 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25277 mem_base = xmlMemBlocks();
25278 dtd = gen_xmlDtdPtr(n_dtd, 0);
25279 elem = gen_const_xmlChar_ptr(n_elem, 1);
25280 name = gen_const_xmlChar_ptr(n_name, 2);
25281 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25283 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25284 desret_xmlAttributePtr(ret_val);
25286 des_xmlDtdPtr(n_dtd, dtd, 0);
25287 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25288 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25289 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25290 xmlResetLastError();
25291 if (mem_base != xmlMemBlocks()) {
25292 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25293 xmlMemBlocks() - mem_base);
25295 printf(" %d", n_dtd);
25296 printf(" %d", n_elem);
25297 printf(" %d", n_name);
25298 printf(" %d", n_prefix);
25312 test_xmlGetDtdQElementDesc(void) {
25316 xmlElementPtr ret_val;
25317 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25319 xmlChar * name; /* the element name */
25321 xmlChar * prefix; /* the element namespace prefix */
25324 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25325 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25326 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25327 mem_base = xmlMemBlocks();
25328 dtd = gen_xmlDtdPtr(n_dtd, 0);
25329 name = gen_const_xmlChar_ptr(n_name, 1);
25330 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25332 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25333 desret_xmlElementPtr(ret_val);
25335 des_xmlDtdPtr(n_dtd, dtd, 0);
25336 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25337 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25338 xmlResetLastError();
25339 if (mem_base != xmlMemBlocks()) {
25340 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25341 xmlMemBlocks() - mem_base);
25343 printf(" %d", n_dtd);
25344 printf(" %d", n_name);
25345 printf(" %d", n_prefix);
25358 test_xmlGetID(void) {
25362 xmlAttrPtr ret_val;
25363 xmlDocPtr doc; /* pointer to the document */
25365 xmlChar * ID; /* the ID value */
25368 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25369 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25370 mem_base = xmlMemBlocks();
25371 doc = gen_xmlDocPtr(n_doc, 0);
25372 ID = gen_const_xmlChar_ptr(n_ID, 1);
25374 ret_val = xmlGetID(doc, (const xmlChar *)ID);
25375 desret_xmlAttrPtr(ret_val);
25377 des_xmlDocPtr(n_doc, doc, 0);
25378 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25379 xmlResetLastError();
25380 if (mem_base != xmlMemBlocks()) {
25381 printf("Leak of %d blocks found in xmlGetID",
25382 xmlMemBlocks() - mem_base);
25384 printf(" %d", n_doc);
25385 printf(" %d", n_ID);
25397 test_xmlGetRefs(void) {
25401 /* missing type support */
25407 test_xmlIsID(void) {
25412 xmlDocPtr doc; /* the document */
25414 xmlNodePtr elem; /* the element carrying the attribute */
25416 xmlAttrPtr attr; /* the attribute */
25419 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25420 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25421 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25422 mem_base = xmlMemBlocks();
25423 doc = gen_xmlDocPtr(n_doc, 0);
25424 elem = gen_xmlNodePtr(n_elem, 1);
25425 attr = gen_xmlAttrPtr(n_attr, 2);
25427 ret_val = xmlIsID(doc, elem, attr);
25428 desret_int(ret_val);
25430 des_xmlDocPtr(n_doc, doc, 0);
25431 des_xmlNodePtr(n_elem, elem, 1);
25432 des_xmlAttrPtr(n_attr, attr, 2);
25433 xmlResetLastError();
25434 if (mem_base != xmlMemBlocks()) {
25435 printf("Leak of %d blocks found in xmlIsID",
25436 xmlMemBlocks() - mem_base);
25438 printf(" %d", n_doc);
25439 printf(" %d", n_elem);
25440 printf(" %d", n_attr);
25453 test_xmlIsMixedElement(void) {
25458 xmlDocPtr doc; /* the document */
25460 xmlChar * name; /* the element name */
25463 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25464 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25465 mem_base = xmlMemBlocks();
25466 doc = gen_xmlDocPtr(n_doc, 0);
25467 name = gen_const_xmlChar_ptr(n_name, 1);
25469 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25470 desret_int(ret_val);
25472 des_xmlDocPtr(n_doc, doc, 0);
25473 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25474 xmlResetLastError();
25475 if (mem_base != xmlMemBlocks()) {
25476 printf("Leak of %d blocks found in xmlIsMixedElement",
25477 xmlMemBlocks() - mem_base);
25479 printf(" %d", n_doc);
25480 printf(" %d", n_name);
25492 test_xmlIsRef(void) {
25497 xmlDocPtr doc; /* the document */
25499 xmlNodePtr elem; /* the element carrying the attribute */
25501 xmlAttrPtr attr; /* the attribute */
25504 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25505 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25506 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25507 mem_base = xmlMemBlocks();
25508 doc = gen_xmlDocPtr(n_doc, 0);
25509 elem = gen_xmlNodePtr(n_elem, 1);
25510 attr = gen_xmlAttrPtr(n_attr, 2);
25512 ret_val = xmlIsRef(doc, elem, attr);
25513 desret_int(ret_val);
25515 des_xmlDocPtr(n_doc, doc, 0);
25516 des_xmlNodePtr(n_elem, elem, 1);
25517 des_xmlAttrPtr(n_attr, attr, 2);
25518 xmlResetLastError();
25519 if (mem_base != xmlMemBlocks()) {
25520 printf("Leak of %d blocks found in xmlIsRef",
25521 xmlMemBlocks() - mem_base);
25523 printf(" %d", n_doc);
25524 printf(" %d", n_elem);
25525 printf(" %d", n_attr);
25538 test_xmlNewDocElementContent(void) {
25542 xmlElementContentPtr ret_val;
25543 xmlDocPtr doc; /* the document */
25545 xmlChar * name; /* the subelement name or NULL */
25547 xmlElementContentType type; /* the type of element content decl */
25550 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25551 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25552 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25553 mem_base = xmlMemBlocks();
25554 doc = gen_xmlDocPtr(n_doc, 0);
25555 name = gen_const_xmlChar_ptr(n_name, 1);
25556 type = gen_xmlElementContentType(n_type, 2);
25558 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25559 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25560 desret_xmlElementContentPtr(ret_val);
25562 des_xmlDocPtr(n_doc, doc, 0);
25563 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25564 des_xmlElementContentType(n_type, type, 2);
25565 xmlResetLastError();
25566 if (mem_base != xmlMemBlocks()) {
25567 printf("Leak of %d blocks found in xmlNewDocElementContent",
25568 xmlMemBlocks() - mem_base);
25570 printf(" %d", n_doc);
25571 printf(" %d", n_name);
25572 printf(" %d", n_type);
25585 test_xmlNewElementContent(void) {
25589 xmlElementContentPtr ret_val;
25590 xmlChar * name; /* the subelement name or NULL */
25592 xmlElementContentType type; /* the type of element content decl */
25595 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25596 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25597 mem_base = xmlMemBlocks();
25598 name = gen_const_xmlChar_ptr(n_name, 0);
25599 type = gen_xmlElementContentType(n_type, 1);
25601 ret_val = xmlNewElementContent((const xmlChar *)name, type);
25602 desret_xmlElementContentPtr(ret_val);
25604 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25605 des_xmlElementContentType(n_type, type, 1);
25606 xmlResetLastError();
25607 if (mem_base != xmlMemBlocks()) {
25608 printf("Leak of %d blocks found in xmlNewElementContent",
25609 xmlMemBlocks() - mem_base);
25611 printf(" %d", n_name);
25612 printf(" %d", n_type);
25624 test_xmlNewValidCtxt(void) {
25628 /* missing type support */
25634 test_xmlRemoveID(void) {
25639 xmlDocPtr doc; /* the document */
25641 xmlAttrPtr attr; /* the attribute */
25644 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25645 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25646 mem_base = xmlMemBlocks();
25647 doc = gen_xmlDocPtr(n_doc, 0);
25648 attr = gen_xmlAttrPtr(n_attr, 1);
25650 ret_val = xmlRemoveID(doc, attr);
25651 desret_int(ret_val);
25653 des_xmlDocPtr(n_doc, doc, 0);
25654 des_xmlAttrPtr(n_attr, attr, 1);
25655 xmlResetLastError();
25656 if (mem_base != xmlMemBlocks()) {
25657 printf("Leak of %d blocks found in xmlRemoveID",
25658 xmlMemBlocks() - mem_base);
25660 printf(" %d", n_doc);
25661 printf(" %d", n_attr);
25673 test_xmlRemoveRef(void) {
25678 xmlDocPtr doc; /* the document */
25680 xmlAttrPtr attr; /* the attribute */
25683 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25684 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25685 mem_base = xmlMemBlocks();
25686 doc = gen_xmlDocPtr(n_doc, 0);
25687 attr = gen_xmlAttrPtr(n_attr, 1);
25689 ret_val = xmlRemoveRef(doc, attr);
25690 desret_int(ret_val);
25692 des_xmlDocPtr(n_doc, doc, 0);
25693 des_xmlAttrPtr(n_attr, attr, 1);
25694 xmlResetLastError();
25695 if (mem_base != xmlMemBlocks()) {
25696 printf("Leak of %d blocks found in xmlRemoveRef",
25697 xmlMemBlocks() - mem_base);
25699 printf(" %d", n_doc);
25700 printf(" %d", n_attr);
25712 test_xmlSnprintfElementContent(void) {
25716 char * buf; /* an output buffer */
25718 int size; /* the buffer size */
25720 xmlElementContentPtr content; /* An element table */
25722 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25725 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25726 for (n_size = 0;n_size < gen_nb_int;n_size++) {
25727 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25728 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25729 mem_base = xmlMemBlocks();
25730 buf = gen_char_ptr(n_buf, 0);
25731 size = gen_int(n_size, 1);
25732 content = gen_xmlElementContentPtr(n_content, 2);
25733 englob = gen_int(n_englob, 3);
25735 xmlSnprintfElementContent(buf, size, content, englob);
25737 des_char_ptr(n_buf, buf, 0);
25738 des_int(n_size, size, 1);
25739 des_xmlElementContentPtr(n_content, content, 2);
25740 des_int(n_englob, englob, 3);
25741 xmlResetLastError();
25742 if (mem_base != xmlMemBlocks()) {
25743 printf("Leak of %d blocks found in xmlSnprintfElementContent",
25744 xmlMemBlocks() - mem_base);
25746 printf(" %d", n_buf);
25747 printf(" %d", n_size);
25748 printf(" %d", n_content);
25749 printf(" %d", n_englob);
25763 test_xmlSprintfElementContent(void) {
25766 #if defined(LIBXML_OUTPUT_ENABLED)
25767 #ifdef LIBXML_OUTPUT_ENABLED
25769 char * buf; /* an output buffer */
25771 xmlElementContentPtr content; /* An element table */
25773 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25776 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25777 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25778 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25779 mem_base = xmlMemBlocks();
25780 buf = gen_char_ptr(n_buf, 0);
25781 content = gen_xmlElementContentPtr(n_content, 1);
25782 englob = gen_int(n_englob, 2);
25784 xmlSprintfElementContent(buf, content, englob);
25786 des_char_ptr(n_buf, buf, 0);
25787 des_xmlElementContentPtr(n_content, content, 1);
25788 des_int(n_englob, englob, 2);
25789 xmlResetLastError();
25790 if (mem_base != xmlMemBlocks()) {
25791 printf("Leak of %d blocks found in xmlSprintfElementContent",
25792 xmlMemBlocks() - mem_base);
25794 printf(" %d", n_buf);
25795 printf(" %d", n_content);
25796 printf(" %d", n_englob);
25811 test_xmlValidBuildContentModel(void) {
25814 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25817 xmlValidCtxtPtr ctxt; /* a validation context */
25819 xmlElementPtr elem; /* an element declaration node */
25822 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25823 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25824 mem_base = xmlMemBlocks();
25825 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25826 elem = gen_xmlElementPtr(n_elem, 1);
25828 ret_val = xmlValidBuildContentModel(ctxt, elem);
25829 desret_int(ret_val);
25831 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25832 des_xmlElementPtr(n_elem, elem, 1);
25833 xmlResetLastError();
25834 if (mem_base != xmlMemBlocks()) {
25835 printf("Leak of %d blocks found in xmlValidBuildContentModel",
25836 xmlMemBlocks() - mem_base);
25838 printf(" %d", n_ctxt);
25839 printf(" %d", n_elem);
25852 test_xmlValidCtxtNormalizeAttributeValue(void) {
25855 #if defined(LIBXML_VALID_ENABLED)
25858 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25860 xmlDocPtr doc; /* the document */
25862 xmlNodePtr elem; /* the parent */
25864 xmlChar * name; /* the attribute name */
25866 xmlChar * value; /* the attribute value */
25869 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25870 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25871 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25872 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25873 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25874 mem_base = xmlMemBlocks();
25875 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25876 doc = gen_xmlDocPtr(n_doc, 1);
25877 elem = gen_xmlNodePtr(n_elem, 2);
25878 name = gen_const_xmlChar_ptr(n_name, 3);
25879 value = gen_const_xmlChar_ptr(n_value, 4);
25881 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25882 desret_xmlChar_ptr(ret_val);
25884 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25885 des_xmlDocPtr(n_doc, doc, 1);
25886 des_xmlNodePtr(n_elem, elem, 2);
25887 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25888 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25889 xmlResetLastError();
25890 if (mem_base != xmlMemBlocks()) {
25891 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25892 xmlMemBlocks() - mem_base);
25894 printf(" %d", n_ctxt);
25895 printf(" %d", n_doc);
25896 printf(" %d", n_elem);
25897 printf(" %d", n_name);
25898 printf(" %d", n_value);
25913 #define gen_nb_xmlElementContent_ptr 1
25914 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25917 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25921 test_xmlValidGetPotentialChildren(void) {
25924 #if defined(LIBXML_VALID_ENABLED)
25925 #ifdef LIBXML_VALID_ENABLED
25928 xmlElementContent * ctree; /* an element content tree */
25930 xmlChar ** names; /* an array to store the list of child names */
25932 int * len; /* a pointer to the number of element in the list */
25934 int max; /* the size of the array */
25937 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25938 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25939 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25940 for (n_max = 0;n_max < gen_nb_int;n_max++) {
25941 mem_base = xmlMemBlocks();
25942 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25943 names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25944 len = gen_int_ptr(n_len, 2);
25945 max = gen_int(n_max, 3);
25947 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25948 desret_int(ret_val);
25950 des_xmlElementContent_ptr(n_ctree, ctree, 0);
25951 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25952 des_int_ptr(n_len, len, 2);
25953 des_int(n_max, max, 3);
25954 xmlResetLastError();
25955 if (mem_base != xmlMemBlocks()) {
25956 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25957 xmlMemBlocks() - mem_base);
25959 printf(" %d", n_ctree);
25960 printf(" %d", n_names);
25961 printf(" %d", n_len);
25962 printf(" %d", n_max);
25978 test_xmlValidGetValidElements(void) {
25981 #if defined(LIBXML_VALID_ENABLED)
25982 #ifdef LIBXML_VALID_ENABLED
25985 xmlNode * prev; /* an element to insert after */
25987 xmlNode * next; /* an element to insert next */
25989 xmlChar ** names; /* an array to store the list of child names */
25991 int max; /* the size of the array */
25994 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25995 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25996 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25997 for (n_max = 0;n_max < gen_nb_int;n_max++) {
25998 mem_base = xmlMemBlocks();
25999 prev = gen_xmlNodePtr(n_prev, 0);
26000 next = gen_xmlNodePtr(n_next, 1);
26001 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26002 max = gen_int(n_max, 3);
26004 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26005 desret_int(ret_val);
26007 des_xmlNodePtr(n_prev, prev, 0);
26008 des_xmlNodePtr(n_next, next, 1);
26009 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26010 des_int(n_max, max, 3);
26011 xmlResetLastError();
26012 if (mem_base != xmlMemBlocks()) {
26013 printf("Leak of %d blocks found in xmlValidGetValidElements",
26014 xmlMemBlocks() - mem_base);
26016 printf(" %d", n_prev);
26017 printf(" %d", n_next);
26018 printf(" %d", n_names);
26019 printf(" %d", n_max);
26035 test_xmlValidNormalizeAttributeValue(void) {
26038 #if defined(LIBXML_VALID_ENABLED)
26041 xmlDocPtr doc; /* the document */
26043 xmlNodePtr elem; /* the parent */
26045 xmlChar * name; /* the attribute name */
26047 xmlChar * value; /* the attribute value */
26050 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26051 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26052 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26053 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26054 mem_base = xmlMemBlocks();
26055 doc = gen_xmlDocPtr(n_doc, 0);
26056 elem = gen_xmlNodePtr(n_elem, 1);
26057 name = gen_const_xmlChar_ptr(n_name, 2);
26058 value = gen_const_xmlChar_ptr(n_value, 3);
26060 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26061 desret_xmlChar_ptr(ret_val);
26063 des_xmlDocPtr(n_doc, doc, 0);
26064 des_xmlNodePtr(n_elem, elem, 1);
26065 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26066 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26067 xmlResetLastError();
26068 if (mem_base != xmlMemBlocks()) {
26069 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26070 xmlMemBlocks() - mem_base);
26072 printf(" %d", n_doc);
26073 printf(" %d", n_elem);
26074 printf(" %d", n_name);
26075 printf(" %d", n_value);
26090 test_xmlValidateAttributeDecl(void) {
26093 #if defined(LIBXML_VALID_ENABLED)
26096 xmlValidCtxtPtr ctxt; /* the validation context */
26098 xmlDocPtr doc; /* a document instance */
26100 xmlAttributePtr attr; /* an attribute definition */
26103 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26104 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26105 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26106 mem_base = xmlMemBlocks();
26107 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26108 doc = gen_xmlDocPtr(n_doc, 1);
26109 attr = gen_xmlAttributePtr(n_attr, 2);
26111 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26112 desret_int(ret_val);
26114 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26115 des_xmlDocPtr(n_doc, doc, 1);
26116 des_xmlAttributePtr(n_attr, attr, 2);
26117 xmlResetLastError();
26118 if (mem_base != xmlMemBlocks()) {
26119 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26120 xmlMemBlocks() - mem_base);
26122 printf(" %d", n_ctxt);
26123 printf(" %d", n_doc);
26124 printf(" %d", n_attr);
26138 test_xmlValidateAttributeValue(void) {
26141 #if defined(LIBXML_VALID_ENABLED)
26144 xmlAttributeType type; /* an attribute type */
26146 xmlChar * value; /* an attribute value */
26149 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26150 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26151 mem_base = xmlMemBlocks();
26152 type = gen_xmlAttributeType(n_type, 0);
26153 value = gen_const_xmlChar_ptr(n_value, 1);
26155 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26156 desret_int(ret_val);
26158 des_xmlAttributeType(n_type, type, 0);
26159 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26160 xmlResetLastError();
26161 if (mem_base != xmlMemBlocks()) {
26162 printf("Leak of %d blocks found in xmlValidateAttributeValue",
26163 xmlMemBlocks() - mem_base);
26165 printf(" %d", n_type);
26166 printf(" %d", n_value);
26179 test_xmlValidateDocument(void) {
26182 #if defined(LIBXML_VALID_ENABLED)
26185 xmlValidCtxtPtr ctxt; /* the validation context */
26187 xmlDocPtr doc; /* a document instance */
26190 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26191 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26192 mem_base = xmlMemBlocks();
26193 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26194 doc = gen_xmlDocPtr(n_doc, 1);
26196 ret_val = xmlValidateDocument(ctxt, doc);
26197 desret_int(ret_val);
26199 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26200 des_xmlDocPtr(n_doc, doc, 1);
26201 xmlResetLastError();
26202 if (mem_base != xmlMemBlocks()) {
26203 printf("Leak of %d blocks found in xmlValidateDocument",
26204 xmlMemBlocks() - mem_base);
26206 printf(" %d", n_ctxt);
26207 printf(" %d", n_doc);
26220 test_xmlValidateDocumentFinal(void) {
26223 #if defined(LIBXML_VALID_ENABLED)
26226 xmlValidCtxtPtr ctxt; /* the validation context */
26228 xmlDocPtr doc; /* a document instance */
26231 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26232 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26233 mem_base = xmlMemBlocks();
26234 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26235 doc = gen_xmlDocPtr(n_doc, 1);
26237 ret_val = xmlValidateDocumentFinal(ctxt, doc);
26238 desret_int(ret_val);
26240 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26241 des_xmlDocPtr(n_doc, doc, 1);
26242 xmlResetLastError();
26243 if (mem_base != xmlMemBlocks()) {
26244 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26245 xmlMemBlocks() - mem_base);
26247 printf(" %d", n_ctxt);
26248 printf(" %d", n_doc);
26261 test_xmlValidateDtd(void) {
26264 #if defined(LIBXML_VALID_ENABLED)
26267 xmlValidCtxtPtr ctxt; /* the validation context */
26269 xmlDocPtr doc; /* a document instance */
26271 xmlDtdPtr dtd; /* a dtd instance */
26274 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26275 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26276 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26277 mem_base = xmlMemBlocks();
26278 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26279 doc = gen_xmlDocPtr(n_doc, 1);
26280 dtd = gen_xmlDtdPtr(n_dtd, 2);
26282 ret_val = xmlValidateDtd(ctxt, doc, dtd);
26283 desret_int(ret_val);
26285 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26286 des_xmlDocPtr(n_doc, doc, 1);
26287 des_xmlDtdPtr(n_dtd, dtd, 2);
26288 xmlResetLastError();
26289 if (mem_base != xmlMemBlocks()) {
26290 printf("Leak of %d blocks found in xmlValidateDtd",
26291 xmlMemBlocks() - mem_base);
26293 printf(" %d", n_ctxt);
26294 printf(" %d", n_doc);
26295 printf(" %d", n_dtd);
26309 test_xmlValidateDtdFinal(void) {
26312 #if defined(LIBXML_VALID_ENABLED)
26315 xmlValidCtxtPtr ctxt; /* the validation context */
26317 xmlDocPtr doc; /* a document instance */
26320 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26321 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26322 mem_base = xmlMemBlocks();
26323 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26324 doc = gen_xmlDocPtr(n_doc, 1);
26326 ret_val = xmlValidateDtdFinal(ctxt, doc);
26327 desret_int(ret_val);
26329 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26330 des_xmlDocPtr(n_doc, doc, 1);
26331 xmlResetLastError();
26332 if (mem_base != xmlMemBlocks()) {
26333 printf("Leak of %d blocks found in xmlValidateDtdFinal",
26334 xmlMemBlocks() - mem_base);
26336 printf(" %d", n_ctxt);
26337 printf(" %d", n_doc);
26350 test_xmlValidateElement(void) {
26353 #if defined(LIBXML_VALID_ENABLED)
26356 xmlValidCtxtPtr ctxt; /* the validation context */
26358 xmlDocPtr doc; /* a document instance */
26360 xmlNodePtr elem; /* an element instance */
26363 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26364 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26365 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26366 mem_base = xmlMemBlocks();
26367 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26368 doc = gen_xmlDocPtr(n_doc, 1);
26369 elem = gen_xmlNodePtr(n_elem, 2);
26371 ret_val = xmlValidateElement(ctxt, doc, elem);
26372 desret_int(ret_val);
26374 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26375 des_xmlDocPtr(n_doc, doc, 1);
26376 des_xmlNodePtr(n_elem, elem, 2);
26377 xmlResetLastError();
26378 if (mem_base != xmlMemBlocks()) {
26379 printf("Leak of %d blocks found in xmlValidateElement",
26380 xmlMemBlocks() - mem_base);
26382 printf(" %d", n_ctxt);
26383 printf(" %d", n_doc);
26384 printf(" %d", n_elem);
26398 test_xmlValidateElementDecl(void) {
26401 #if defined(LIBXML_VALID_ENABLED)
26404 xmlValidCtxtPtr ctxt; /* the validation context */
26406 xmlDocPtr doc; /* a document instance */
26408 xmlElementPtr elem; /* an element definition */
26411 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26412 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26413 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26414 mem_base = xmlMemBlocks();
26415 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26416 doc = gen_xmlDocPtr(n_doc, 1);
26417 elem = gen_xmlElementPtr(n_elem, 2);
26419 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26420 desret_int(ret_val);
26422 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26423 des_xmlDocPtr(n_doc, doc, 1);
26424 des_xmlElementPtr(n_elem, elem, 2);
26425 xmlResetLastError();
26426 if (mem_base != xmlMemBlocks()) {
26427 printf("Leak of %d blocks found in xmlValidateElementDecl",
26428 xmlMemBlocks() - mem_base);
26430 printf(" %d", n_ctxt);
26431 printf(" %d", n_doc);
26432 printf(" %d", n_elem);
26446 test_xmlValidateNameValue(void) {
26449 #if defined(LIBXML_VALID_ENABLED)
26452 xmlChar * value; /* an Name value */
26455 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26456 mem_base = xmlMemBlocks();
26457 value = gen_const_xmlChar_ptr(n_value, 0);
26459 ret_val = xmlValidateNameValue((const xmlChar *)value);
26460 desret_int(ret_val);
26462 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26463 xmlResetLastError();
26464 if (mem_base != xmlMemBlocks()) {
26465 printf("Leak of %d blocks found in xmlValidateNameValue",
26466 xmlMemBlocks() - mem_base);
26468 printf(" %d", n_value);
26480 test_xmlValidateNamesValue(void) {
26483 #if defined(LIBXML_VALID_ENABLED)
26486 xmlChar * value; /* an Names value */
26489 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26490 mem_base = xmlMemBlocks();
26491 value = gen_const_xmlChar_ptr(n_value, 0);
26493 ret_val = xmlValidateNamesValue((const xmlChar *)value);
26494 desret_int(ret_val);
26496 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26497 xmlResetLastError();
26498 if (mem_base != xmlMemBlocks()) {
26499 printf("Leak of %d blocks found in xmlValidateNamesValue",
26500 xmlMemBlocks() - mem_base);
26502 printf(" %d", n_value);
26514 test_xmlValidateNmtokenValue(void) {
26517 #if defined(LIBXML_VALID_ENABLED)
26520 xmlChar * value; /* an Nmtoken value */
26523 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26524 mem_base = xmlMemBlocks();
26525 value = gen_const_xmlChar_ptr(n_value, 0);
26527 ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26528 desret_int(ret_val);
26530 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26531 xmlResetLastError();
26532 if (mem_base != xmlMemBlocks()) {
26533 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26534 xmlMemBlocks() - mem_base);
26536 printf(" %d", n_value);
26548 test_xmlValidateNmtokensValue(void) {
26551 #if defined(LIBXML_VALID_ENABLED)
26554 xmlChar * value; /* an Nmtokens value */
26557 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26558 mem_base = xmlMemBlocks();
26559 value = gen_const_xmlChar_ptr(n_value, 0);
26561 ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26562 desret_int(ret_val);
26564 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26565 xmlResetLastError();
26566 if (mem_base != xmlMemBlocks()) {
26567 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26568 xmlMemBlocks() - mem_base);
26570 printf(" %d", n_value);
26582 test_xmlValidateNotationDecl(void) {
26585 #if defined(LIBXML_VALID_ENABLED)
26588 xmlValidCtxtPtr ctxt; /* the validation context */
26590 xmlDocPtr doc; /* a document instance */
26592 xmlNotationPtr nota; /* a notation definition */
26595 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26596 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26597 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26598 mem_base = xmlMemBlocks();
26599 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26600 doc = gen_xmlDocPtr(n_doc, 1);
26601 nota = gen_xmlNotationPtr(n_nota, 2);
26603 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26604 desret_int(ret_val);
26606 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26607 des_xmlDocPtr(n_doc, doc, 1);
26608 des_xmlNotationPtr(n_nota, nota, 2);
26609 xmlResetLastError();
26610 if (mem_base != xmlMemBlocks()) {
26611 printf("Leak of %d blocks found in xmlValidateNotationDecl",
26612 xmlMemBlocks() - mem_base);
26614 printf(" %d", n_ctxt);
26615 printf(" %d", n_doc);
26616 printf(" %d", n_nota);
26630 test_xmlValidateNotationUse(void) {
26633 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26636 xmlValidCtxtPtr ctxt; /* the validation context */
26638 xmlDocPtr doc; /* the document */
26640 xmlChar * notationName; /* the notation name to check */
26641 int n_notationName;
26643 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26644 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26645 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26646 mem_base = xmlMemBlocks();
26647 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26648 doc = gen_xmlDocPtr(n_doc, 1);
26649 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26651 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26652 desret_int(ret_val);
26654 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26655 des_xmlDocPtr(n_doc, doc, 1);
26656 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26657 xmlResetLastError();
26658 if (mem_base != xmlMemBlocks()) {
26659 printf("Leak of %d blocks found in xmlValidateNotationUse",
26660 xmlMemBlocks() - mem_base);
26662 printf(" %d", n_ctxt);
26663 printf(" %d", n_doc);
26664 printf(" %d", n_notationName);
26678 test_xmlValidateOneAttribute(void) {
26681 #if defined(LIBXML_VALID_ENABLED)
26684 xmlValidCtxtPtr ctxt; /* the validation context */
26686 xmlDocPtr doc; /* a document instance */
26688 xmlNodePtr elem; /* an element instance */
26690 xmlAttrPtr attr; /* an attribute instance */
26692 xmlChar * value; /* the attribute value (without entities processing) */
26695 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26696 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26697 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26698 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26699 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26700 mem_base = xmlMemBlocks();
26701 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26702 doc = gen_xmlDocPtr(n_doc, 1);
26703 elem = gen_xmlNodePtr(n_elem, 2);
26704 attr = gen_xmlAttrPtr(n_attr, 3);
26705 value = gen_const_xmlChar_ptr(n_value, 4);
26707 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26708 desret_int(ret_val);
26710 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26711 des_xmlDocPtr(n_doc, doc, 1);
26712 des_xmlNodePtr(n_elem, elem, 2);
26713 des_xmlAttrPtr(n_attr, attr, 3);
26714 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26715 xmlResetLastError();
26716 if (mem_base != xmlMemBlocks()) {
26717 printf("Leak of %d blocks found in xmlValidateOneAttribute",
26718 xmlMemBlocks() - mem_base);
26720 printf(" %d", n_ctxt);
26721 printf(" %d", n_doc);
26722 printf(" %d", n_elem);
26723 printf(" %d", n_attr);
26724 printf(" %d", n_value);
26740 test_xmlValidateOneElement(void) {
26743 #if defined(LIBXML_VALID_ENABLED)
26746 xmlValidCtxtPtr ctxt; /* the validation context */
26748 xmlDocPtr doc; /* a document instance */
26750 xmlNodePtr elem; /* an element instance */
26753 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26754 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26755 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26756 mem_base = xmlMemBlocks();
26757 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26758 doc = gen_xmlDocPtr(n_doc, 1);
26759 elem = gen_xmlNodePtr(n_elem, 2);
26761 ret_val = xmlValidateOneElement(ctxt, doc, elem);
26762 desret_int(ret_val);
26764 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26765 des_xmlDocPtr(n_doc, doc, 1);
26766 des_xmlNodePtr(n_elem, elem, 2);
26767 xmlResetLastError();
26768 if (mem_base != xmlMemBlocks()) {
26769 printf("Leak of %d blocks found in xmlValidateOneElement",
26770 xmlMemBlocks() - mem_base);
26772 printf(" %d", n_ctxt);
26773 printf(" %d", n_doc);
26774 printf(" %d", n_elem);
26788 test_xmlValidateOneNamespace(void) {
26791 #if defined(LIBXML_VALID_ENABLED)
26794 xmlValidCtxtPtr ctxt; /* the validation context */
26796 xmlDocPtr doc; /* a document instance */
26798 xmlNodePtr elem; /* an element instance */
26800 xmlChar * prefix; /* the namespace prefix */
26802 xmlNsPtr ns; /* an namespace declaration instance */
26804 xmlChar * value; /* the attribute value (without entities processing) */
26807 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26808 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26809 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26810 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26811 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26812 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26813 mem_base = xmlMemBlocks();
26814 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26815 doc = gen_xmlDocPtr(n_doc, 1);
26816 elem = gen_xmlNodePtr(n_elem, 2);
26817 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26818 ns = gen_xmlNsPtr(n_ns, 4);
26819 value = gen_const_xmlChar_ptr(n_value, 5);
26821 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26822 desret_int(ret_val);
26824 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26825 des_xmlDocPtr(n_doc, doc, 1);
26826 des_xmlNodePtr(n_elem, elem, 2);
26827 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26828 des_xmlNsPtr(n_ns, ns, 4);
26829 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26830 xmlResetLastError();
26831 if (mem_base != xmlMemBlocks()) {
26832 printf("Leak of %d blocks found in xmlValidateOneNamespace",
26833 xmlMemBlocks() - mem_base);
26835 printf(" %d", n_ctxt);
26836 printf(" %d", n_doc);
26837 printf(" %d", n_elem);
26838 printf(" %d", n_prefix);
26839 printf(" %d", n_ns);
26840 printf(" %d", n_value);
26857 test_xmlValidatePopElement(void) {
26860 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26863 xmlValidCtxtPtr ctxt; /* the validation context */
26865 xmlDocPtr doc; /* a document instance */
26867 xmlNodePtr elem; /* an element instance */
26869 xmlChar * qname; /* the qualified name as appearing in the serialization */
26872 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26873 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26874 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26875 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26876 mem_base = xmlMemBlocks();
26877 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26878 doc = gen_xmlDocPtr(n_doc, 1);
26879 elem = gen_xmlNodePtr(n_elem, 2);
26880 qname = gen_const_xmlChar_ptr(n_qname, 3);
26882 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26883 desret_int(ret_val);
26885 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26886 des_xmlDocPtr(n_doc, doc, 1);
26887 des_xmlNodePtr(n_elem, elem, 2);
26888 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26889 xmlResetLastError();
26890 if (mem_base != xmlMemBlocks()) {
26891 printf("Leak of %d blocks found in xmlValidatePopElement",
26892 xmlMemBlocks() - mem_base);
26894 printf(" %d", n_ctxt);
26895 printf(" %d", n_doc);
26896 printf(" %d", n_elem);
26897 printf(" %d", n_qname);
26912 test_xmlValidatePushCData(void) {
26915 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26918 xmlValidCtxtPtr ctxt; /* the validation context */
26920 xmlChar * data; /* some character data read */
26922 int len; /* the lenght of the data */
26925 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26926 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26927 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26928 mem_base = xmlMemBlocks();
26929 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26930 data = gen_const_xmlChar_ptr(n_data, 1);
26931 len = gen_int(n_len, 2);
26933 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26934 desret_int(ret_val);
26936 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26937 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26938 des_int(n_len, len, 2);
26939 xmlResetLastError();
26940 if (mem_base != xmlMemBlocks()) {
26941 printf("Leak of %d blocks found in xmlValidatePushCData",
26942 xmlMemBlocks() - mem_base);
26944 printf(" %d", n_ctxt);
26945 printf(" %d", n_data);
26946 printf(" %d", n_len);
26960 test_xmlValidatePushElement(void) {
26963 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26966 xmlValidCtxtPtr ctxt; /* the validation context */
26968 xmlDocPtr doc; /* a document instance */
26970 xmlNodePtr elem; /* an element instance */
26972 xmlChar * qname; /* the qualified name as appearing in the serialization */
26975 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26976 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26977 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26978 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26979 mem_base = xmlMemBlocks();
26980 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26981 doc = gen_xmlDocPtr(n_doc, 1);
26982 elem = gen_xmlNodePtr(n_elem, 2);
26983 qname = gen_const_xmlChar_ptr(n_qname, 3);
26985 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26986 desret_int(ret_val);
26988 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26989 des_xmlDocPtr(n_doc, doc, 1);
26990 des_xmlNodePtr(n_elem, elem, 2);
26991 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26992 xmlResetLastError();
26993 if (mem_base != xmlMemBlocks()) {
26994 printf("Leak of %d blocks found in xmlValidatePushElement",
26995 xmlMemBlocks() - mem_base);
26997 printf(" %d", n_ctxt);
26998 printf(" %d", n_doc);
26999 printf(" %d", n_elem);
27000 printf(" %d", n_qname);
27015 test_xmlValidateRoot(void) {
27018 #if defined(LIBXML_VALID_ENABLED)
27021 xmlValidCtxtPtr ctxt; /* the validation context */
27023 xmlDocPtr doc; /* a document instance */
27026 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27027 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27028 mem_base = xmlMemBlocks();
27029 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27030 doc = gen_xmlDocPtr(n_doc, 1);
27032 ret_val = xmlValidateRoot(ctxt, doc);
27033 desret_int(ret_val);
27035 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27036 des_xmlDocPtr(n_doc, doc, 1);
27037 xmlResetLastError();
27038 if (mem_base != xmlMemBlocks()) {
27039 printf("Leak of %d blocks found in xmlValidateRoot",
27040 xmlMemBlocks() - mem_base);
27042 printf(" %d", n_ctxt);
27043 printf(" %d", n_doc);
27058 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27059 test_ret += test_xmlAddAttributeDecl();
27060 test_ret += test_xmlAddElementDecl();
27061 test_ret += test_xmlAddID();
27062 test_ret += test_xmlAddNotationDecl();
27063 test_ret += test_xmlAddRef();
27064 test_ret += test_xmlCopyAttributeTable();
27065 test_ret += test_xmlCopyDocElementContent();
27066 test_ret += test_xmlCopyElementContent();
27067 test_ret += test_xmlCopyElementTable();
27068 test_ret += test_xmlCopyEnumeration();
27069 test_ret += test_xmlCopyNotationTable();
27070 test_ret += test_xmlCreateEnumeration();
27071 test_ret += test_xmlDumpAttributeDecl();
27072 test_ret += test_xmlDumpAttributeTable();
27073 test_ret += test_xmlDumpElementDecl();
27074 test_ret += test_xmlDumpElementTable();
27075 test_ret += test_xmlDumpNotationDecl();
27076 test_ret += test_xmlDumpNotationTable();
27077 test_ret += test_xmlGetDtdAttrDesc();
27078 test_ret += test_xmlGetDtdElementDesc();
27079 test_ret += test_xmlGetDtdNotationDesc();
27080 test_ret += test_xmlGetDtdQAttrDesc();
27081 test_ret += test_xmlGetDtdQElementDesc();
27082 test_ret += test_xmlGetID();
27083 test_ret += test_xmlGetRefs();
27084 test_ret += test_xmlIsID();
27085 test_ret += test_xmlIsMixedElement();
27086 test_ret += test_xmlIsRef();
27087 test_ret += test_xmlNewDocElementContent();
27088 test_ret += test_xmlNewElementContent();
27089 test_ret += test_xmlNewValidCtxt();
27090 test_ret += test_xmlRemoveID();
27091 test_ret += test_xmlRemoveRef();
27092 test_ret += test_xmlSnprintfElementContent();
27093 test_ret += test_xmlSprintfElementContent();
27094 test_ret += test_xmlValidBuildContentModel();
27095 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27096 test_ret += test_xmlValidGetPotentialChildren();
27097 test_ret += test_xmlValidGetValidElements();
27098 test_ret += test_xmlValidNormalizeAttributeValue();
27099 test_ret += test_xmlValidateAttributeDecl();
27100 test_ret += test_xmlValidateAttributeValue();
27101 test_ret += test_xmlValidateDocument();
27102 test_ret += test_xmlValidateDocumentFinal();
27103 test_ret += test_xmlValidateDtd();
27104 test_ret += test_xmlValidateDtdFinal();
27105 test_ret += test_xmlValidateElement();
27106 test_ret += test_xmlValidateElementDecl();
27107 test_ret += test_xmlValidateNameValue();
27108 test_ret += test_xmlValidateNamesValue();
27109 test_ret += test_xmlValidateNmtokenValue();
27110 test_ret += test_xmlValidateNmtokensValue();
27111 test_ret += test_xmlValidateNotationDecl();
27112 test_ret += test_xmlValidateNotationUse();
27113 test_ret += test_xmlValidateOneAttribute();
27114 test_ret += test_xmlValidateOneElement();
27115 test_ret += test_xmlValidateOneNamespace();
27116 test_ret += test_xmlValidatePopElement();
27117 test_ret += test_xmlValidatePushCData();
27118 test_ret += test_xmlValidatePushElement();
27119 test_ret += test_xmlValidateRoot();
27122 printf("Module valid: %d errors\n", test_ret);
27127 test_xmlXIncludeNewContext(void) {
27131 /* missing type support */
27137 test_xmlXIncludeProcess(void) {
27140 #if defined(LIBXML_XINCLUDE_ENABLED)
27143 xmlDocPtr doc; /* an XML document */
27146 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27147 mem_base = xmlMemBlocks();
27148 doc = gen_xmlDocPtr(n_doc, 0);
27150 ret_val = xmlXIncludeProcess(doc);
27151 desret_int(ret_val);
27153 des_xmlDocPtr(n_doc, doc, 0);
27154 xmlResetLastError();
27155 if (mem_base != xmlMemBlocks()) {
27156 printf("Leak of %d blocks found in xmlXIncludeProcess",
27157 xmlMemBlocks() - mem_base);
27159 printf(" %d", n_doc);
27171 test_xmlXIncludeProcessFlags(void) {
27174 #if defined(LIBXML_XINCLUDE_ENABLED)
27177 xmlDocPtr doc; /* an XML document */
27179 int flags; /* a set of xmlParserOption used for parsing XML includes */
27182 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27183 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27184 mem_base = xmlMemBlocks();
27185 doc = gen_xmlDocPtr(n_doc, 0);
27186 flags = gen_int(n_flags, 1);
27188 ret_val = xmlXIncludeProcessFlags(doc, flags);
27189 desret_int(ret_val);
27191 des_xmlDocPtr(n_doc, doc, 0);
27192 des_int(n_flags, flags, 1);
27193 xmlResetLastError();
27194 if (mem_base != xmlMemBlocks()) {
27195 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27196 xmlMemBlocks() - mem_base);
27198 printf(" %d", n_doc);
27199 printf(" %d", n_flags);
27212 test_xmlXIncludeProcessFlagsData(void) {
27215 #if defined(LIBXML_XINCLUDE_ENABLED)
27218 xmlDocPtr doc; /* an XML document */
27220 int flags; /* a set of xmlParserOption used for parsing XML includes */
27222 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27225 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27226 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27227 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27228 mem_base = xmlMemBlocks();
27229 doc = gen_xmlDocPtr(n_doc, 0);
27230 flags = gen_int(n_flags, 1);
27231 data = gen_userdata(n_data, 2);
27233 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27234 desret_int(ret_val);
27236 des_xmlDocPtr(n_doc, doc, 0);
27237 des_int(n_flags, flags, 1);
27238 des_userdata(n_data, data, 2);
27239 xmlResetLastError();
27240 if (mem_base != xmlMemBlocks()) {
27241 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27242 xmlMemBlocks() - mem_base);
27244 printf(" %d", n_doc);
27245 printf(" %d", n_flags);
27246 printf(" %d", n_data);
27258 #ifdef LIBXML_XINCLUDE_ENABLED
27260 #define gen_nb_xmlXIncludeCtxtPtr 1
27261 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27264 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27270 test_xmlXIncludeProcessNode(void) {
27273 #if defined(LIBXML_XINCLUDE_ENABLED)
27276 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27278 xmlNodePtr node; /* a node in an XML document */
27281 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27282 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27283 mem_base = xmlMemBlocks();
27284 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27285 node = gen_xmlNodePtr(n_node, 1);
27287 ret_val = xmlXIncludeProcessNode(ctxt, node);
27288 desret_int(ret_val);
27290 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27291 des_xmlNodePtr(n_node, node, 1);
27292 xmlResetLastError();
27293 if (mem_base != xmlMemBlocks()) {
27294 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27295 xmlMemBlocks() - mem_base);
27297 printf(" %d", n_ctxt);
27298 printf(" %d", n_node);
27311 test_xmlXIncludeProcessTree(void) {
27314 #if defined(LIBXML_XINCLUDE_ENABLED)
27317 xmlNodePtr tree; /* a node in an XML document */
27320 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27321 mem_base = xmlMemBlocks();
27322 tree = gen_xmlNodePtr(n_tree, 0);
27324 ret_val = xmlXIncludeProcessTree(tree);
27325 desret_int(ret_val);
27327 des_xmlNodePtr(n_tree, tree, 0);
27328 xmlResetLastError();
27329 if (mem_base != xmlMemBlocks()) {
27330 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27331 xmlMemBlocks() - mem_base);
27333 printf(" %d", n_tree);
27345 test_xmlXIncludeProcessTreeFlags(void) {
27348 #if defined(LIBXML_XINCLUDE_ENABLED)
27351 xmlNodePtr tree; /* a node in an XML document */
27353 int flags; /* a set of xmlParserOption used for parsing XML includes */
27356 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27357 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27358 mem_base = xmlMemBlocks();
27359 tree = gen_xmlNodePtr(n_tree, 0);
27360 flags = gen_int(n_flags, 1);
27362 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27363 desret_int(ret_val);
27365 des_xmlNodePtr(n_tree, tree, 0);
27366 des_int(n_flags, flags, 1);
27367 xmlResetLastError();
27368 if (mem_base != xmlMemBlocks()) {
27369 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27370 xmlMemBlocks() - mem_base);
27372 printf(" %d", n_tree);
27373 printf(" %d", n_flags);
27386 test_xmlXIncludeProcessTreeFlagsData(void) {
27389 #if defined(LIBXML_XINCLUDE_ENABLED)
27392 xmlNodePtr tree; /* an XML node */
27394 int flags; /* a set of xmlParserOption used for parsing XML includes */
27396 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27399 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27400 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27401 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27402 mem_base = xmlMemBlocks();
27403 tree = gen_xmlNodePtr(n_tree, 0);
27404 flags = gen_int(n_flags, 1);
27405 data = gen_userdata(n_data, 2);
27407 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27408 desret_int(ret_val);
27410 des_xmlNodePtr(n_tree, tree, 0);
27411 des_int(n_flags, flags, 1);
27412 des_userdata(n_data, data, 2);
27413 xmlResetLastError();
27414 if (mem_base != xmlMemBlocks()) {
27415 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27416 xmlMemBlocks() - mem_base);
27418 printf(" %d", n_tree);
27419 printf(" %d", n_flags);
27420 printf(" %d", n_data);
27434 test_xmlXIncludeSetFlags(void) {
27437 #if defined(LIBXML_XINCLUDE_ENABLED)
27440 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27442 int flags; /* a set of xmlParserOption used for parsing XML includes */
27445 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27446 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27447 mem_base = xmlMemBlocks();
27448 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27449 flags = gen_int(n_flags, 1);
27451 ret_val = xmlXIncludeSetFlags(ctxt, flags);
27452 desret_int(ret_val);
27454 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27455 des_int(n_flags, flags, 1);
27456 xmlResetLastError();
27457 if (mem_base != xmlMemBlocks()) {
27458 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27459 xmlMemBlocks() - mem_base);
27461 printf(" %d", n_ctxt);
27462 printf(" %d", n_flags);
27474 test_xinclude(void) {
27477 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27478 test_ret += test_xmlXIncludeNewContext();
27479 test_ret += test_xmlXIncludeProcess();
27480 test_ret += test_xmlXIncludeProcessFlags();
27481 test_ret += test_xmlXIncludeProcessFlagsData();
27482 test_ret += test_xmlXIncludeProcessNode();
27483 test_ret += test_xmlXIncludeProcessTree();
27484 test_ret += test_xmlXIncludeProcessTreeFlags();
27485 test_ret += test_xmlXIncludeProcessTreeFlagsData();
27486 test_ret += test_xmlXIncludeSetFlags();
27489 printf("Module xinclude: %d errors\n", test_ret);
27494 test_xmlAllocOutputBuffer(void) {
27497 #if defined(LIBXML_OUTPUT_ENABLED)
27499 xmlOutputBufferPtr ret_val;
27500 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27503 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27504 mem_base = xmlMemBlocks();
27505 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27507 ret_val = xmlAllocOutputBuffer(encoder);
27508 desret_xmlOutputBufferPtr(ret_val);
27510 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27511 xmlResetLastError();
27512 if (mem_base != xmlMemBlocks()) {
27513 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27514 xmlMemBlocks() - mem_base);
27516 printf(" %d", n_encoder);
27528 test_xmlAllocParserInputBuffer(void) {
27532 xmlParserInputBufferPtr ret_val;
27533 xmlCharEncoding enc; /* the charset encoding if known */
27536 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27537 mem_base = xmlMemBlocks();
27538 enc = gen_xmlCharEncoding(n_enc, 0);
27540 ret_val = xmlAllocParserInputBuffer(enc);
27541 desret_xmlParserInputBufferPtr(ret_val);
27543 des_xmlCharEncoding(n_enc, enc, 0);
27544 xmlResetLastError();
27545 if (mem_base != xmlMemBlocks()) {
27546 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27547 xmlMemBlocks() - mem_base);
27549 printf(" %d", n_enc);
27560 test_xmlCheckFilename(void) {
27565 char * path; /* the path to check */
27568 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27569 mem_base = xmlMemBlocks();
27570 path = gen_const_char_ptr(n_path, 0);
27572 ret_val = xmlCheckFilename((const char *)path);
27573 desret_int(ret_val);
27575 des_const_char_ptr(n_path, (const char *)path, 0);
27576 xmlResetLastError();
27577 if (mem_base != xmlMemBlocks()) {
27578 printf("Leak of %d blocks found in xmlCheckFilename",
27579 xmlMemBlocks() - mem_base);
27581 printf(" %d", n_path);
27592 test_xmlCheckHTTPInput(void) {
27596 xmlParserInputPtr ret_val;
27597 xmlParserCtxtPtr ctxt; /* an XML parser context */
27599 xmlParserInputPtr ret; /* an XML parser input */
27602 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27603 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27604 mem_base = xmlMemBlocks();
27605 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27606 ret = gen_xmlParserInputPtr(n_ret, 1);
27608 ret_val = xmlCheckHTTPInput(ctxt, ret);
27609 desret_xmlParserInputPtr(ret_val);
27611 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27612 des_xmlParserInputPtr(n_ret, ret, 1);
27613 xmlResetLastError();
27614 if (mem_base != xmlMemBlocks()) {
27615 printf("Leak of %d blocks found in xmlCheckHTTPInput",
27616 xmlMemBlocks() - mem_base);
27618 printf(" %d", n_ctxt);
27619 printf(" %d", n_ret);
27631 test_xmlCleanupInputCallbacks(void) {
27636 mem_base = xmlMemBlocks();
27638 xmlCleanupInputCallbacks();
27640 xmlResetLastError();
27641 if (mem_base != xmlMemBlocks()) {
27642 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27643 xmlMemBlocks() - mem_base);
27654 test_xmlCleanupOutputCallbacks(void) {
27657 #if defined(LIBXML_OUTPUT_ENABLED)
27660 mem_base = xmlMemBlocks();
27662 xmlCleanupOutputCallbacks();
27664 xmlResetLastError();
27665 if (mem_base != xmlMemBlocks()) {
27666 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27667 xmlMemBlocks() - mem_base);
27679 test_xmlFileClose(void) {
27684 void * context; /* the I/O context */
27687 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27688 mem_base = xmlMemBlocks();
27689 context = gen_void_ptr(n_context, 0);
27691 ret_val = xmlFileClose(context);
27692 desret_int(ret_val);
27694 des_void_ptr(n_context, context, 0);
27695 xmlResetLastError();
27696 if (mem_base != xmlMemBlocks()) {
27697 printf("Leak of %d blocks found in xmlFileClose",
27698 xmlMemBlocks() - mem_base);
27700 printf(" %d", n_context);
27711 test_xmlFileMatch(void) {
27716 const char * filename; /* the URI for matching */
27719 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27720 mem_base = xmlMemBlocks();
27721 filename = gen_filepath(n_filename, 0);
27723 ret_val = xmlFileMatch(filename);
27724 desret_int(ret_val);
27726 des_filepath(n_filename, filename, 0);
27727 xmlResetLastError();
27728 if (mem_base != xmlMemBlocks()) {
27729 printf("Leak of %d blocks found in xmlFileMatch",
27730 xmlMemBlocks() - mem_base);
27732 printf(" %d", n_filename);
27743 test_xmlFileOpen(void) {
27748 const char * filename; /* the URI for matching */
27751 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27752 mem_base = xmlMemBlocks();
27753 filename = gen_filepath(n_filename, 0);
27755 ret_val = xmlFileOpen(filename);
27756 desret_void_ptr(ret_val);
27758 des_filepath(n_filename, filename, 0);
27759 xmlResetLastError();
27760 if (mem_base != xmlMemBlocks()) {
27761 printf("Leak of %d blocks found in xmlFileOpen",
27762 xmlMemBlocks() - mem_base);
27764 printf(" %d", n_filename);
27775 test_xmlFileRead(void) {
27780 void * context; /* the I/O context */
27782 char * buffer; /* where to drop data */
27784 int len; /* number of bytes to write */
27787 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27788 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27789 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27790 mem_base = xmlMemBlocks();
27791 context = gen_void_ptr(n_context, 0);
27792 buffer = gen_char_ptr(n_buffer, 1);
27793 len = gen_int(n_len, 2);
27795 ret_val = xmlFileRead(context, buffer, len);
27796 desret_int(ret_val);
27798 des_void_ptr(n_context, context, 0);
27799 des_char_ptr(n_buffer, buffer, 1);
27800 des_int(n_len, len, 2);
27801 xmlResetLastError();
27802 if (mem_base != xmlMemBlocks()) {
27803 printf("Leak of %d blocks found in xmlFileRead",
27804 xmlMemBlocks() - mem_base);
27806 printf(" %d", n_context);
27807 printf(" %d", n_buffer);
27808 printf(" %d", n_len);
27821 test_xmlIOFTPClose(void) {
27824 #if defined(LIBXML_FTP_ENABLED)
27827 void * context; /* the I/O context */
27830 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27831 mem_base = xmlMemBlocks();
27832 context = gen_void_ptr(n_context, 0);
27834 ret_val = xmlIOFTPClose(context);
27835 desret_int(ret_val);
27837 des_void_ptr(n_context, context, 0);
27838 xmlResetLastError();
27839 if (mem_base != xmlMemBlocks()) {
27840 printf("Leak of %d blocks found in xmlIOFTPClose",
27841 xmlMemBlocks() - mem_base);
27843 printf(" %d", n_context);
27855 test_xmlIOFTPMatch(void) {
27858 #if defined(LIBXML_FTP_ENABLED)
27861 const char * filename; /* the URI for matching */
27864 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27865 mem_base = xmlMemBlocks();
27866 filename = gen_filepath(n_filename, 0);
27868 ret_val = xmlIOFTPMatch(filename);
27869 desret_int(ret_val);
27871 des_filepath(n_filename, filename, 0);
27872 xmlResetLastError();
27873 if (mem_base != xmlMemBlocks()) {
27874 printf("Leak of %d blocks found in xmlIOFTPMatch",
27875 xmlMemBlocks() - mem_base);
27877 printf(" %d", n_filename);
27889 test_xmlIOFTPOpen(void) {
27892 #if defined(LIBXML_FTP_ENABLED)
27895 const char * filename; /* the URI for matching */
27898 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27899 mem_base = xmlMemBlocks();
27900 filename = gen_filepath(n_filename, 0);
27902 ret_val = xmlIOFTPOpen(filename);
27903 desret_void_ptr(ret_val);
27905 des_filepath(n_filename, filename, 0);
27906 xmlResetLastError();
27907 if (mem_base != xmlMemBlocks()) {
27908 printf("Leak of %d blocks found in xmlIOFTPOpen",
27909 xmlMemBlocks() - mem_base);
27911 printf(" %d", n_filename);
27923 test_xmlIOFTPRead(void) {
27926 #if defined(LIBXML_FTP_ENABLED)
27929 void * context; /* the I/O context */
27931 char * buffer; /* where to drop data */
27933 int len; /* number of bytes to write */
27936 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27937 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27938 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27939 mem_base = xmlMemBlocks();
27940 context = gen_void_ptr(n_context, 0);
27941 buffer = gen_char_ptr(n_buffer, 1);
27942 len = gen_int(n_len, 2);
27944 ret_val = xmlIOFTPRead(context, buffer, len);
27945 desret_int(ret_val);
27947 des_void_ptr(n_context, context, 0);
27948 des_char_ptr(n_buffer, buffer, 1);
27949 des_int(n_len, len, 2);
27950 xmlResetLastError();
27951 if (mem_base != xmlMemBlocks()) {
27952 printf("Leak of %d blocks found in xmlIOFTPRead",
27953 xmlMemBlocks() - mem_base);
27955 printf(" %d", n_context);
27956 printf(" %d", n_buffer);
27957 printf(" %d", n_len);
27971 test_xmlIOHTTPClose(void) {
27974 #if defined(LIBXML_HTTP_ENABLED)
27977 void * context; /* the I/O context */
27980 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27981 mem_base = xmlMemBlocks();
27982 context = gen_void_ptr(n_context, 0);
27984 ret_val = xmlIOHTTPClose(context);
27985 desret_int(ret_val);
27987 des_void_ptr(n_context, context, 0);
27988 xmlResetLastError();
27989 if (mem_base != xmlMemBlocks()) {
27990 printf("Leak of %d blocks found in xmlIOHTTPClose",
27991 xmlMemBlocks() - mem_base);
27993 printf(" %d", n_context);
28005 test_xmlIOHTTPMatch(void) {
28008 #if defined(LIBXML_HTTP_ENABLED)
28011 const char * filename; /* the URI for matching */
28014 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28015 mem_base = xmlMemBlocks();
28016 filename = gen_filepath(n_filename, 0);
28018 ret_val = xmlIOHTTPMatch(filename);
28019 desret_int(ret_val);
28021 des_filepath(n_filename, filename, 0);
28022 xmlResetLastError();
28023 if (mem_base != xmlMemBlocks()) {
28024 printf("Leak of %d blocks found in xmlIOHTTPMatch",
28025 xmlMemBlocks() - mem_base);
28027 printf(" %d", n_filename);
28039 test_xmlIOHTTPOpen(void) {
28042 #if defined(LIBXML_HTTP_ENABLED)
28045 const char * filename; /* the URI for matching */
28048 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28049 mem_base = xmlMemBlocks();
28050 filename = gen_filepath(n_filename, 0);
28052 ret_val = xmlIOHTTPOpen(filename);
28053 desret_xmlNanoHTTPCtxtPtr(ret_val);
28055 des_filepath(n_filename, filename, 0);
28056 xmlResetLastError();
28057 if (mem_base != xmlMemBlocks()) {
28058 printf("Leak of %d blocks found in xmlIOHTTPOpen",
28059 xmlMemBlocks() - mem_base);
28061 printf(" %d", n_filename);
28073 test_xmlIOHTTPRead(void) {
28076 #if defined(LIBXML_HTTP_ENABLED)
28079 void * context; /* the I/O context */
28081 char * buffer; /* where to drop data */
28083 int len; /* number of bytes to write */
28086 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28087 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28088 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28089 mem_base = xmlMemBlocks();
28090 context = gen_void_ptr(n_context, 0);
28091 buffer = gen_char_ptr(n_buffer, 1);
28092 len = gen_int(n_len, 2);
28094 ret_val = xmlIOHTTPRead(context, buffer, len);
28095 desret_int(ret_val);
28097 des_void_ptr(n_context, context, 0);
28098 des_char_ptr(n_buffer, buffer, 1);
28099 des_int(n_len, len, 2);
28100 xmlResetLastError();
28101 if (mem_base != xmlMemBlocks()) {
28102 printf("Leak of %d blocks found in xmlIOHTTPRead",
28103 xmlMemBlocks() - mem_base);
28105 printf(" %d", n_context);
28106 printf(" %d", n_buffer);
28107 printf(" %d", n_len);
28121 test_xmlNoNetExternalEntityLoader(void) {
28125 xmlParserInputPtr ret_val;
28126 const char * URL; /* the URL for the entity to load */
28128 char * ID; /* the System ID for the entity to load */
28130 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28133 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28134 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28135 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28136 mem_base = xmlMemBlocks();
28137 URL = gen_filepath(n_URL, 0);
28138 ID = gen_const_char_ptr(n_ID, 1);
28139 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28141 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28142 desret_xmlParserInputPtr(ret_val);
28144 des_filepath(n_URL, URL, 0);
28145 des_const_char_ptr(n_ID, (const char *)ID, 1);
28146 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28147 xmlResetLastError();
28148 if (mem_base != xmlMemBlocks()) {
28149 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28150 xmlMemBlocks() - mem_base);
28152 printf(" %d", n_URL);
28153 printf(" %d", n_ID);
28154 printf(" %d", n_ctxt);
28167 test_xmlNormalizeWindowsPath(void) {
28172 xmlChar * path; /* the input file path */
28175 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28176 mem_base = xmlMemBlocks();
28177 path = gen_const_xmlChar_ptr(n_path, 0);
28179 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28180 desret_xmlChar_ptr(ret_val);
28182 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28183 xmlResetLastError();
28184 if (mem_base != xmlMemBlocks()) {
28185 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28186 xmlMemBlocks() - mem_base);
28188 printf(" %d", n_path);
28199 test_xmlOutputBufferCreateBuffer(void) {
28202 #if defined(LIBXML_OUTPUT_ENABLED)
28204 xmlOutputBufferPtr ret_val;
28205 xmlBufferPtr buffer; /* a xmlBufferPtr */
28207 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28210 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28211 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28212 mem_base = xmlMemBlocks();
28213 buffer = gen_xmlBufferPtr(n_buffer, 0);
28214 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28216 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28217 desret_xmlOutputBufferPtr(ret_val);
28219 des_xmlBufferPtr(n_buffer, buffer, 0);
28220 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28221 xmlResetLastError();
28222 if (mem_base != xmlMemBlocks()) {
28223 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28224 xmlMemBlocks() - mem_base);
28226 printf(" %d", n_buffer);
28227 printf(" %d", n_encoder);
28240 test_xmlOutputBufferCreateFd(void) {
28243 #if defined(LIBXML_OUTPUT_ENABLED)
28245 xmlOutputBufferPtr ret_val;
28246 int fd; /* a file descriptor number */
28248 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28251 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28252 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28253 mem_base = xmlMemBlocks();
28254 fd = gen_int(n_fd, 0);
28255 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28257 ret_val = xmlOutputBufferCreateFd(fd, encoder);
28258 desret_xmlOutputBufferPtr(ret_val);
28260 des_int(n_fd, fd, 0);
28261 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28262 xmlResetLastError();
28263 if (mem_base != xmlMemBlocks()) {
28264 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28265 xmlMemBlocks() - mem_base);
28267 printf(" %d", n_fd);
28268 printf(" %d", n_encoder);
28281 test_xmlOutputBufferCreateFile(void) {
28284 #if defined(LIBXML_OUTPUT_ENABLED)
28286 xmlOutputBufferPtr ret_val;
28287 FILE * file; /* a FILE* */
28289 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28292 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28293 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28294 mem_base = xmlMemBlocks();
28295 file = gen_FILE_ptr(n_file, 0);
28296 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28298 ret_val = xmlOutputBufferCreateFile(file, encoder);
28299 desret_xmlOutputBufferPtr(ret_val);
28301 des_FILE_ptr(n_file, file, 0);
28302 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28303 xmlResetLastError();
28304 if (mem_base != xmlMemBlocks()) {
28305 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28306 xmlMemBlocks() - mem_base);
28308 printf(" %d", n_file);
28309 printf(" %d", n_encoder);
28322 test_xmlOutputBufferCreateFilename(void) {
28325 #if defined(LIBXML_OUTPUT_ENABLED)
28327 xmlOutputBufferPtr ret_val;
28328 const char * URI; /* a C string containing the URI or filename */
28330 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28332 int compression; /* the compression ration (0 none, 9 max). */
28335 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28336 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28337 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28338 mem_base = xmlMemBlocks();
28339 URI = gen_fileoutput(n_URI, 0);
28340 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28341 compression = gen_int(n_compression, 2);
28343 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28344 desret_xmlOutputBufferPtr(ret_val);
28346 des_fileoutput(n_URI, URI, 0);
28347 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28348 des_int(n_compression, compression, 2);
28349 xmlResetLastError();
28350 if (mem_base != xmlMemBlocks()) {
28351 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28352 xmlMemBlocks() - mem_base);
28354 printf(" %d", n_URI);
28355 printf(" %d", n_encoder);
28356 printf(" %d", n_compression);
28370 test_xmlOutputBufferFlush(void) {
28373 #if defined(LIBXML_OUTPUT_ENABLED)
28376 xmlOutputBufferPtr out; /* a buffered output */
28379 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28380 mem_base = xmlMemBlocks();
28381 out = gen_xmlOutputBufferPtr(n_out, 0);
28383 ret_val = xmlOutputBufferFlush(out);
28384 desret_int(ret_val);
28386 des_xmlOutputBufferPtr(n_out, out, 0);
28387 xmlResetLastError();
28388 if (mem_base != xmlMemBlocks()) {
28389 printf("Leak of %d blocks found in xmlOutputBufferFlush",
28390 xmlMemBlocks() - mem_base);
28392 printf(" %d", n_out);
28404 test_xmlOutputBufferWrite(void) {
28407 #if defined(LIBXML_OUTPUT_ENABLED)
28410 xmlOutputBufferPtr out; /* a buffered parser output */
28412 int len; /* the size in bytes of the array. */
28414 char * buf; /* an char array */
28417 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28418 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28419 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28420 mem_base = xmlMemBlocks();
28421 out = gen_xmlOutputBufferPtr(n_out, 0);
28422 len = gen_int(n_len, 1);
28423 buf = gen_const_char_ptr(n_buf, 2);
28425 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28426 desret_int(ret_val);
28428 des_xmlOutputBufferPtr(n_out, out, 0);
28429 des_int(n_len, len, 1);
28430 des_const_char_ptr(n_buf, (const char *)buf, 2);
28431 xmlResetLastError();
28432 if (mem_base != xmlMemBlocks()) {
28433 printf("Leak of %d blocks found in xmlOutputBufferWrite",
28434 xmlMemBlocks() - mem_base);
28436 printf(" %d", n_out);
28437 printf(" %d", n_len);
28438 printf(" %d", n_buf);
28452 test_xmlOutputBufferWriteEscape(void) {
28456 /* missing type support */
28462 test_xmlOutputBufferWriteString(void) {
28465 #if defined(LIBXML_OUTPUT_ENABLED)
28468 xmlOutputBufferPtr out; /* a buffered parser output */
28470 char * str; /* a zero terminated C string */
28473 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28474 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28475 mem_base = xmlMemBlocks();
28476 out = gen_xmlOutputBufferPtr(n_out, 0);
28477 str = gen_const_char_ptr(n_str, 1);
28479 ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28480 desret_int(ret_val);
28482 des_xmlOutputBufferPtr(n_out, out, 0);
28483 des_const_char_ptr(n_str, (const char *)str, 1);
28484 xmlResetLastError();
28485 if (mem_base != xmlMemBlocks()) {
28486 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28487 xmlMemBlocks() - mem_base);
28489 printf(" %d", n_out);
28490 printf(" %d", n_str);
28503 test_xmlParserGetDirectory(void) {
28507 /* missing type support */
28513 test_xmlParserInputBufferCreateFd(void) {
28517 xmlParserInputBufferPtr ret_val;
28518 int fd; /* a file descriptor number */
28520 xmlCharEncoding enc; /* the charset encoding if known */
28523 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28524 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28525 mem_base = xmlMemBlocks();
28526 fd = gen_int(n_fd, 0);
28527 enc = gen_xmlCharEncoding(n_enc, 1);
28528 if (fd >= 0) fd = -1;
28530 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28531 desret_xmlParserInputBufferPtr(ret_val);
28533 des_int(n_fd, fd, 0);
28534 des_xmlCharEncoding(n_enc, enc, 1);
28535 xmlResetLastError();
28536 if (mem_base != xmlMemBlocks()) {
28537 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28538 xmlMemBlocks() - mem_base);
28540 printf(" %d", n_fd);
28541 printf(" %d", n_enc);
28553 test_xmlParserInputBufferCreateFile(void) {
28557 xmlParserInputBufferPtr ret_val;
28558 FILE * file; /* a FILE* */
28560 xmlCharEncoding enc; /* the charset encoding if known */
28563 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28564 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28565 mem_base = xmlMemBlocks();
28566 file = gen_FILE_ptr(n_file, 0);
28567 enc = gen_xmlCharEncoding(n_enc, 1);
28569 ret_val = xmlParserInputBufferCreateFile(file, enc);
28570 desret_xmlParserInputBufferPtr(ret_val);
28572 des_FILE_ptr(n_file, file, 0);
28573 des_xmlCharEncoding(n_enc, enc, 1);
28574 xmlResetLastError();
28575 if (mem_base != xmlMemBlocks()) {
28576 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28577 xmlMemBlocks() - mem_base);
28579 printf(" %d", n_file);
28580 printf(" %d", n_enc);
28592 test_xmlParserInputBufferCreateFilename(void) {
28596 xmlParserInputBufferPtr ret_val;
28597 const char * URI; /* a C string containing the URI or filename */
28599 xmlCharEncoding enc; /* the charset encoding if known */
28602 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28603 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28604 mem_base = xmlMemBlocks();
28605 URI = gen_fileoutput(n_URI, 0);
28606 enc = gen_xmlCharEncoding(n_enc, 1);
28608 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28609 desret_xmlParserInputBufferPtr(ret_val);
28611 des_fileoutput(n_URI, URI, 0);
28612 des_xmlCharEncoding(n_enc, enc, 1);
28613 xmlResetLastError();
28614 if (mem_base != xmlMemBlocks()) {
28615 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28616 xmlMemBlocks() - mem_base);
28618 printf(" %d", n_URI);
28619 printf(" %d", n_enc);
28631 test_xmlParserInputBufferCreateMem(void) {
28635 xmlParserInputBufferPtr ret_val;
28636 char * mem; /* the memory input */
28638 int size; /* the length of the memory block */
28640 xmlCharEncoding enc; /* the charset encoding if known */
28643 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28644 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28645 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28646 mem_base = xmlMemBlocks();
28647 mem = gen_const_char_ptr(n_mem, 0);
28648 size = gen_int(n_size, 1);
28649 enc = gen_xmlCharEncoding(n_enc, 2);
28651 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28652 desret_xmlParserInputBufferPtr(ret_val);
28654 des_const_char_ptr(n_mem, (const char *)mem, 0);
28655 des_int(n_size, size, 1);
28656 des_xmlCharEncoding(n_enc, enc, 2);
28657 xmlResetLastError();
28658 if (mem_base != xmlMemBlocks()) {
28659 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28660 xmlMemBlocks() - mem_base);
28662 printf(" %d", n_mem);
28663 printf(" %d", n_size);
28664 printf(" %d", n_enc);
28677 test_xmlParserInputBufferCreateStatic(void) {
28681 xmlParserInputBufferPtr ret_val;
28682 char * mem; /* the memory input */
28684 int size; /* the length of the memory block */
28686 xmlCharEncoding enc; /* the charset encoding if known */
28689 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28690 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28691 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28692 mem_base = xmlMemBlocks();
28693 mem = gen_const_char_ptr(n_mem, 0);
28694 size = gen_int(n_size, 1);
28695 enc = gen_xmlCharEncoding(n_enc, 2);
28697 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28698 desret_xmlParserInputBufferPtr(ret_val);
28700 des_const_char_ptr(n_mem, (const char *)mem, 0);
28701 des_int(n_size, size, 1);
28702 des_xmlCharEncoding(n_enc, enc, 2);
28703 xmlResetLastError();
28704 if (mem_base != xmlMemBlocks()) {
28705 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28706 xmlMemBlocks() - mem_base);
28708 printf(" %d", n_mem);
28709 printf(" %d", n_size);
28710 printf(" %d", n_enc);
28723 test_xmlParserInputBufferGrow(void) {
28728 xmlParserInputBufferPtr in; /* a buffered parser input */
28730 int len; /* indicative value of the amount of chars to read */
28733 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28734 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28735 mem_base = xmlMemBlocks();
28736 in = gen_xmlParserInputBufferPtr(n_in, 0);
28737 len = gen_int(n_len, 1);
28739 ret_val = xmlParserInputBufferGrow(in, len);
28740 desret_int(ret_val);
28742 des_xmlParserInputBufferPtr(n_in, in, 0);
28743 des_int(n_len, len, 1);
28744 xmlResetLastError();
28745 if (mem_base != xmlMemBlocks()) {
28746 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28747 xmlMemBlocks() - mem_base);
28749 printf(" %d", n_in);
28750 printf(" %d", n_len);
28762 test_xmlParserInputBufferPush(void) {
28767 xmlParserInputBufferPtr in; /* a buffered parser input */
28769 int len; /* the size in bytes of the array. */
28771 char * buf; /* an char array */
28774 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28775 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28776 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28777 mem_base = xmlMemBlocks();
28778 in = gen_xmlParserInputBufferPtr(n_in, 0);
28779 len = gen_int(n_len, 1);
28780 buf = gen_const_char_ptr(n_buf, 2);
28782 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28783 desret_int(ret_val);
28785 des_xmlParserInputBufferPtr(n_in, in, 0);
28786 des_int(n_len, len, 1);
28787 des_const_char_ptr(n_buf, (const char *)buf, 2);
28788 xmlResetLastError();
28789 if (mem_base != xmlMemBlocks()) {
28790 printf("Leak of %d blocks found in xmlParserInputBufferPush",
28791 xmlMemBlocks() - mem_base);
28793 printf(" %d", n_in);
28794 printf(" %d", n_len);
28795 printf(" %d", n_buf);
28808 test_xmlParserInputBufferRead(void) {
28813 xmlParserInputBufferPtr in; /* a buffered parser input */
28815 int len; /* indicative value of the amount of chars to read */
28818 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28819 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28820 mem_base = xmlMemBlocks();
28821 in = gen_xmlParserInputBufferPtr(n_in, 0);
28822 len = gen_int(n_len, 1);
28824 ret_val = xmlParserInputBufferRead(in, len);
28825 desret_int(ret_val);
28827 des_xmlParserInputBufferPtr(n_in, in, 0);
28828 des_int(n_len, len, 1);
28829 xmlResetLastError();
28830 if (mem_base != xmlMemBlocks()) {
28831 printf("Leak of %d blocks found in xmlParserInputBufferRead",
28832 xmlMemBlocks() - mem_base);
28834 printf(" %d", n_in);
28835 printf(" %d", n_len);
28847 test_xmlPopInputCallbacks(void) {
28853 mem_base = xmlMemBlocks();
28855 ret_val = xmlPopInputCallbacks();
28856 desret_int(ret_val);
28858 xmlResetLastError();
28859 if (mem_base != xmlMemBlocks()) {
28860 printf("Leak of %d blocks found in xmlPopInputCallbacks",
28861 xmlMemBlocks() - mem_base);
28872 test_xmlRegisterDefaultInputCallbacks(void) {
28877 mem_base = xmlMemBlocks();
28879 xmlRegisterDefaultInputCallbacks();
28881 xmlResetLastError();
28882 if (mem_base != xmlMemBlocks()) {
28883 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28884 xmlMemBlocks() - mem_base);
28895 test_xmlRegisterDefaultOutputCallbacks(void) {
28898 #if defined(LIBXML_OUTPUT_ENABLED)
28901 mem_base = xmlMemBlocks();
28903 xmlRegisterDefaultOutputCallbacks();
28905 xmlResetLastError();
28906 if (mem_base != xmlMemBlocks()) {
28907 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28908 xmlMemBlocks() - mem_base);
28920 test_xmlRegisterHTTPPostCallbacks(void) {
28923 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28926 mem_base = xmlMemBlocks();
28928 xmlRegisterHTTPPostCallbacks();
28930 xmlResetLastError();
28931 if (mem_base != xmlMemBlocks()) {
28932 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28933 xmlMemBlocks() - mem_base);
28947 if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28948 test_ret += test_xmlAllocOutputBuffer();
28949 test_ret += test_xmlAllocParserInputBuffer();
28950 test_ret += test_xmlCheckFilename();
28951 test_ret += test_xmlCheckHTTPInput();
28952 test_ret += test_xmlCleanupInputCallbacks();
28953 test_ret += test_xmlCleanupOutputCallbacks();
28954 test_ret += test_xmlFileClose();
28955 test_ret += test_xmlFileMatch();
28956 test_ret += test_xmlFileOpen();
28957 test_ret += test_xmlFileRead();
28958 test_ret += test_xmlIOFTPClose();
28959 test_ret += test_xmlIOFTPMatch();
28960 test_ret += test_xmlIOFTPOpen();
28961 test_ret += test_xmlIOFTPRead();
28962 test_ret += test_xmlIOHTTPClose();
28963 test_ret += test_xmlIOHTTPMatch();
28964 test_ret += test_xmlIOHTTPOpen();
28965 test_ret += test_xmlIOHTTPRead();
28966 test_ret += test_xmlNoNetExternalEntityLoader();
28967 test_ret += test_xmlNormalizeWindowsPath();
28968 test_ret += test_xmlOutputBufferCreateBuffer();
28969 test_ret += test_xmlOutputBufferCreateFd();
28970 test_ret += test_xmlOutputBufferCreateFile();
28971 test_ret += test_xmlOutputBufferCreateFilename();
28972 test_ret += test_xmlOutputBufferFlush();
28973 test_ret += test_xmlOutputBufferWrite();
28974 test_ret += test_xmlOutputBufferWriteEscape();
28975 test_ret += test_xmlOutputBufferWriteString();
28976 test_ret += test_xmlParserGetDirectory();
28977 test_ret += test_xmlParserInputBufferCreateFd();
28978 test_ret += test_xmlParserInputBufferCreateFile();
28979 test_ret += test_xmlParserInputBufferCreateFilename();
28980 test_ret += test_xmlParserInputBufferCreateMem();
28981 test_ret += test_xmlParserInputBufferCreateStatic();
28982 test_ret += test_xmlParserInputBufferGrow();
28983 test_ret += test_xmlParserInputBufferPush();
28984 test_ret += test_xmlParserInputBufferRead();
28985 test_ret += test_xmlPopInputCallbacks();
28986 test_ret += test_xmlRegisterDefaultInputCallbacks();
28987 test_ret += test_xmlRegisterDefaultOutputCallbacks();
28988 test_ret += test_xmlRegisterHTTPPostCallbacks();
28991 printf("Module xmlIO: %d errors\n", test_ret);
28994 #ifdef LIBXML_AUTOMATA_ENABLED
28996 #define gen_nb_xmlAutomataPtr 1
28997 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29000 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29006 test_xmlAutomataCompile(void) {
29010 /* missing type support */
29016 test_xmlAutomataGetInitState(void) {
29020 /* missing type support */
29026 test_xmlAutomataIsDeterminist(void) {
29029 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29032 xmlAutomataPtr am; /* an automata */
29035 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29036 mem_base = xmlMemBlocks();
29037 am = gen_xmlAutomataPtr(n_am, 0);
29039 ret_val = xmlAutomataIsDeterminist(am);
29040 desret_int(ret_val);
29042 des_xmlAutomataPtr(n_am, am, 0);
29043 xmlResetLastError();
29044 if (mem_base != xmlMemBlocks()) {
29045 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29046 xmlMemBlocks() - mem_base);
29048 printf(" %d", n_am);
29058 #ifdef LIBXML_AUTOMATA_ENABLED
29060 #define gen_nb_xmlAutomataStatePtr 1
29061 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29064 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29070 test_xmlAutomataNewAllTrans(void) {
29074 /* missing type support */
29080 test_xmlAutomataNewCountTrans(void) {
29084 /* missing type support */
29090 test_xmlAutomataNewCountTrans2(void) {
29094 /* missing type support */
29100 test_xmlAutomataNewCountedTrans(void) {
29104 /* missing type support */
29110 test_xmlAutomataNewCounter(void) {
29113 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29116 xmlAutomataPtr am; /* an automata */
29118 int min; /* the minimal value on the counter */
29120 int max; /* the maximal value on the counter */
29123 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29124 for (n_min = 0;n_min < gen_nb_int;n_min++) {
29125 for (n_max = 0;n_max < gen_nb_int;n_max++) {
29126 mem_base = xmlMemBlocks();
29127 am = gen_xmlAutomataPtr(n_am, 0);
29128 min = gen_int(n_min, 1);
29129 max = gen_int(n_max, 2);
29131 ret_val = xmlAutomataNewCounter(am, min, max);
29132 desret_int(ret_val);
29134 des_xmlAutomataPtr(n_am, am, 0);
29135 des_int(n_min, min, 1);
29136 des_int(n_max, max, 2);
29137 xmlResetLastError();
29138 if (mem_base != xmlMemBlocks()) {
29139 printf("Leak of %d blocks found in xmlAutomataNewCounter",
29140 xmlMemBlocks() - mem_base);
29142 printf(" %d", n_am);
29143 printf(" %d", n_min);
29144 printf(" %d", n_max);
29158 test_xmlAutomataNewCounterTrans(void) {
29162 /* missing type support */
29168 test_xmlAutomataNewEpsilon(void) {
29172 /* missing type support */
29178 test_xmlAutomataNewNegTrans(void) {
29182 /* missing type support */
29188 test_xmlAutomataNewOnceTrans(void) {
29192 /* missing type support */
29198 test_xmlAutomataNewOnceTrans2(void) {
29202 /* missing type support */
29208 test_xmlAutomataNewState(void) {
29212 /* missing type support */
29218 test_xmlAutomataNewTransition(void) {
29222 /* missing type support */
29228 test_xmlAutomataNewTransition2(void) {
29232 /* missing type support */
29238 test_xmlAutomataSetFinalState(void) {
29241 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29244 xmlAutomataPtr am; /* an automata */
29246 xmlAutomataStatePtr state; /* a state in this automata */
29249 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29250 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29251 mem_base = xmlMemBlocks();
29252 am = gen_xmlAutomataPtr(n_am, 0);
29253 state = gen_xmlAutomataStatePtr(n_state, 1);
29255 ret_val = xmlAutomataSetFinalState(am, state);
29256 desret_int(ret_val);
29258 des_xmlAutomataPtr(n_am, am, 0);
29259 des_xmlAutomataStatePtr(n_state, state, 1);
29260 xmlResetLastError();
29261 if (mem_base != xmlMemBlocks()) {
29262 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29263 xmlMemBlocks() - mem_base);
29265 printf(" %d", n_am);
29266 printf(" %d", n_state);
29279 test_xmlNewAutomata(void) {
29283 /* missing type support */
29288 test_xmlautomata(void) {
29291 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29292 test_ret += test_xmlAutomataCompile();
29293 test_ret += test_xmlAutomataGetInitState();
29294 test_ret += test_xmlAutomataIsDeterminist();
29295 test_ret += test_xmlAutomataNewAllTrans();
29296 test_ret += test_xmlAutomataNewCountTrans();
29297 test_ret += test_xmlAutomataNewCountTrans2();
29298 test_ret += test_xmlAutomataNewCountedTrans();
29299 test_ret += test_xmlAutomataNewCounter();
29300 test_ret += test_xmlAutomataNewCounterTrans();
29301 test_ret += test_xmlAutomataNewEpsilon();
29302 test_ret += test_xmlAutomataNewNegTrans();
29303 test_ret += test_xmlAutomataNewOnceTrans();
29304 test_ret += test_xmlAutomataNewOnceTrans2();
29305 test_ret += test_xmlAutomataNewState();
29306 test_ret += test_xmlAutomataNewTransition();
29307 test_ret += test_xmlAutomataNewTransition2();
29308 test_ret += test_xmlAutomataSetFinalState();
29309 test_ret += test_xmlNewAutomata();
29312 printf("Module xmlautomata: %d errors\n", test_ret);
29316 #define gen_nb_xmlGenericErrorFunc_ptr 1
29317 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29320 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29324 test_initGenericErrorDefaultFunc(void) {
29328 xmlGenericErrorFunc * handler; /* the handler */
29331 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29332 mem_base = xmlMemBlocks();
29333 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29335 initGenericErrorDefaultFunc(handler);
29337 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29338 xmlResetLastError();
29339 if (mem_base != xmlMemBlocks()) {
29340 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29341 xmlMemBlocks() - mem_base);
29343 printf(" %d", n_handler);
29353 #define gen_nb_xmlErrorPtr 1
29354 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29357 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29361 test_xmlCopyError(void) {
29366 xmlErrorPtr from; /* a source error */
29368 xmlErrorPtr to; /* a target error */
29371 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29372 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29373 mem_base = xmlMemBlocks();
29374 from = gen_xmlErrorPtr(n_from, 0);
29375 to = gen_xmlErrorPtr(n_to, 1);
29377 ret_val = xmlCopyError(from, to);
29378 desret_int(ret_val);
29380 des_xmlErrorPtr(n_from, from, 0);
29381 des_xmlErrorPtr(n_to, to, 1);
29382 xmlResetLastError();
29383 if (mem_base != xmlMemBlocks()) {
29384 printf("Leak of %d blocks found in xmlCopyError",
29385 xmlMemBlocks() - mem_base);
29387 printf(" %d", n_from);
29388 printf(" %d", n_to);
29400 test_xmlCtxtGetLastError(void) {
29404 /* missing type support */
29410 test_xmlCtxtResetLastError(void) {
29414 void * ctx; /* an XML parser context */
29417 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29418 mem_base = xmlMemBlocks();
29419 ctx = gen_void_ptr(n_ctx, 0);
29421 xmlCtxtResetLastError(ctx);
29423 des_void_ptr(n_ctx, ctx, 0);
29424 xmlResetLastError();
29425 if (mem_base != xmlMemBlocks()) {
29426 printf("Leak of %d blocks found in xmlCtxtResetLastError",
29427 xmlMemBlocks() - mem_base);
29429 printf(" %d", n_ctx);
29440 test_xmlGetLastError(void) {
29444 /* missing type support */
29450 test_xmlParserError(void) {
29454 /* missing type support */
29460 test_xmlParserPrintFileContext(void) {
29464 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29467 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29468 mem_base = xmlMemBlocks();
29469 input = gen_xmlParserInputPtr(n_input, 0);
29471 xmlParserPrintFileContext(input);
29473 des_xmlParserInputPtr(n_input, input, 0);
29474 xmlResetLastError();
29475 if (mem_base != xmlMemBlocks()) {
29476 printf("Leak of %d blocks found in xmlParserPrintFileContext",
29477 xmlMemBlocks() - mem_base);
29479 printf(" %d", n_input);
29490 test_xmlParserPrintFileInfo(void) {
29494 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29497 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29498 mem_base = xmlMemBlocks();
29499 input = gen_xmlParserInputPtr(n_input, 0);
29501 xmlParserPrintFileInfo(input);
29503 des_xmlParserInputPtr(n_input, input, 0);
29504 xmlResetLastError();
29505 if (mem_base != xmlMemBlocks()) {
29506 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29507 xmlMemBlocks() - mem_base);
29509 printf(" %d", n_input);
29520 test_xmlParserValidityError(void) {
29524 /* missing type support */
29530 test_xmlParserValidityWarning(void) {
29534 /* missing type support */
29540 test_xmlParserWarning(void) {
29544 /* missing type support */
29550 test_xmlResetError(void) {
29554 xmlErrorPtr err; /* pointer to the error. */
29557 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29558 mem_base = xmlMemBlocks();
29559 err = gen_xmlErrorPtr(n_err, 0);
29561 xmlResetError(err);
29563 des_xmlErrorPtr(n_err, err, 0);
29564 xmlResetLastError();
29565 if (mem_base != xmlMemBlocks()) {
29566 printf("Leak of %d blocks found in xmlResetError",
29567 xmlMemBlocks() - mem_base);
29569 printf(" %d", n_err);
29580 test_xmlResetLastError(void) {
29585 xmlResetLastError();
29587 xmlResetLastError();
29595 test_xmlSetGenericErrorFunc(void) {
29599 /* missing type support */
29605 test_xmlSetStructuredErrorFunc(void) {
29609 /* missing type support */
29614 test_xmlerror(void) {
29617 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29618 test_ret += test_initGenericErrorDefaultFunc();
29619 test_ret += test_xmlCopyError();
29620 test_ret += test_xmlCtxtGetLastError();
29621 test_ret += test_xmlCtxtResetLastError();
29622 test_ret += test_xmlGetLastError();
29623 test_ret += test_xmlParserError();
29624 test_ret += test_xmlParserPrintFileContext();
29625 test_ret += test_xmlParserPrintFileInfo();
29626 test_ret += test_xmlParserValidityError();
29627 test_ret += test_xmlParserValidityWarning();
29628 test_ret += test_xmlParserWarning();
29629 test_ret += test_xmlResetError();
29630 test_ret += test_xmlResetLastError();
29631 test_ret += test_xmlSetGenericErrorFunc();
29632 test_ret += test_xmlSetStructuredErrorFunc();
29635 printf("Module xmlerror: %d errors\n", test_ret);
29638 #ifdef LIBXML_MODULES_ENABLED
29640 #define gen_nb_xmlModulePtr 1
29641 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29644 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29650 test_xmlModuleClose(void) {
29653 #if defined(LIBXML_MODULES_ENABLED)
29656 xmlModulePtr module; /* the module handle */
29659 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29660 mem_base = xmlMemBlocks();
29661 module = gen_xmlModulePtr(n_module, 0);
29663 ret_val = xmlModuleClose(module);
29664 desret_int(ret_val);
29666 des_xmlModulePtr(n_module, module, 0);
29667 xmlResetLastError();
29668 if (mem_base != xmlMemBlocks()) {
29669 printf("Leak of %d blocks found in xmlModuleClose",
29670 xmlMemBlocks() - mem_base);
29672 printf(" %d", n_module);
29684 test_xmlModuleOpen(void) {
29688 /* missing type support */
29694 test_xmlModuleSymbol(void) {
29697 #if defined(LIBXML_MODULES_ENABLED)
29700 xmlModulePtr module; /* the module */
29702 char * name; /* the name of the symbol */
29704 void ** symbol; /* the resulting symbol address */
29707 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29708 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29709 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29710 mem_base = xmlMemBlocks();
29711 module = gen_xmlModulePtr(n_module, 0);
29712 name = gen_const_char_ptr(n_name, 1);
29713 symbol = gen_void_ptr_ptr(n_symbol, 2);
29715 ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29716 desret_int(ret_val);
29718 des_xmlModulePtr(n_module, module, 0);
29719 des_const_char_ptr(n_name, (const char *)name, 1);
29720 des_void_ptr_ptr(n_symbol, symbol, 2);
29721 xmlResetLastError();
29722 if (mem_base != xmlMemBlocks()) {
29723 printf("Leak of %d blocks found in xmlModuleSymbol",
29724 xmlMemBlocks() - mem_base);
29726 printf(" %d", n_module);
29727 printf(" %d", n_name);
29728 printf(" %d", n_symbol);
29741 test_xmlmodule(void) {
29744 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29745 test_ret += test_xmlModuleClose();
29746 test_ret += test_xmlModuleOpen();
29747 test_ret += test_xmlModuleSymbol();
29750 printf("Module xmlmodule: %d errors\n", test_ret);
29755 test_xmlNewTextReader(void) {
29758 #if defined(LIBXML_READER_ENABLED)
29760 xmlTextReaderPtr ret_val;
29761 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29763 const char * URI; /* the URI information for the source if available */
29766 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29767 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29768 mem_base = xmlMemBlocks();
29769 input = gen_xmlParserInputBufferPtr(n_input, 0);
29770 URI = gen_filepath(n_URI, 1);
29772 ret_val = xmlNewTextReader(input, URI);
29773 desret_xmlTextReaderPtr(ret_val);
29775 des_xmlParserInputBufferPtr(n_input, input, 0);
29776 des_filepath(n_URI, URI, 1);
29777 xmlResetLastError();
29778 if (mem_base != xmlMemBlocks()) {
29779 printf("Leak of %d blocks found in xmlNewTextReader",
29780 xmlMemBlocks() - mem_base);
29782 printf(" %d", n_input);
29783 printf(" %d", n_URI);
29796 test_xmlNewTextReaderFilename(void) {
29799 #if defined(LIBXML_READER_ENABLED)
29801 xmlTextReaderPtr ret_val;
29802 const char * URI; /* the URI of the resource to process */
29805 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29806 mem_base = xmlMemBlocks();
29807 URI = gen_filepath(n_URI, 0);
29809 ret_val = xmlNewTextReaderFilename(URI);
29810 desret_xmlTextReaderPtr(ret_val);
29812 des_filepath(n_URI, URI, 0);
29813 xmlResetLastError();
29814 if (mem_base != xmlMemBlocks()) {
29815 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29816 xmlMemBlocks() - mem_base);
29818 printf(" %d", n_URI);
29830 test_xmlReaderForDoc(void) {
29833 #if defined(LIBXML_READER_ENABLED)
29835 xmlTextReaderPtr ret_val;
29836 xmlChar * cur; /* a pointer to a zero terminated string */
29838 const char * URL; /* the base URL to use for the document */
29840 char * encoding; /* the document encoding, or NULL */
29842 int options; /* a combination of xmlParserOption */
29845 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29846 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29847 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29848 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29849 mem_base = xmlMemBlocks();
29850 cur = gen_const_xmlChar_ptr(n_cur, 0);
29851 URL = gen_filepath(n_URL, 1);
29852 encoding = gen_const_char_ptr(n_encoding, 2);
29853 options = gen_parseroptions(n_options, 3);
29855 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29856 desret_xmlTextReaderPtr(ret_val);
29858 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29859 des_filepath(n_URL, URL, 1);
29860 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29861 des_parseroptions(n_options, options, 3);
29862 xmlResetLastError();
29863 if (mem_base != xmlMemBlocks()) {
29864 printf("Leak of %d blocks found in xmlReaderForDoc",
29865 xmlMemBlocks() - mem_base);
29867 printf(" %d", n_cur);
29868 printf(" %d", n_URL);
29869 printf(" %d", n_encoding);
29870 printf(" %d", n_options);
29885 test_xmlReaderForFile(void) {
29888 #if defined(LIBXML_READER_ENABLED)
29890 xmlTextReaderPtr ret_val;
29891 const char * filename; /* a file or URL */
29893 char * encoding; /* the document encoding, or NULL */
29895 int options; /* a combination of xmlParserOption */
29898 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29899 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29900 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29901 mem_base = xmlMemBlocks();
29902 filename = gen_filepath(n_filename, 0);
29903 encoding = gen_const_char_ptr(n_encoding, 1);
29904 options = gen_parseroptions(n_options, 2);
29906 ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29907 desret_xmlTextReaderPtr(ret_val);
29909 des_filepath(n_filename, filename, 0);
29910 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29911 des_parseroptions(n_options, options, 2);
29912 xmlResetLastError();
29913 if (mem_base != xmlMemBlocks()) {
29914 printf("Leak of %d blocks found in xmlReaderForFile",
29915 xmlMemBlocks() - mem_base);
29917 printf(" %d", n_filename);
29918 printf(" %d", n_encoding);
29919 printf(" %d", n_options);
29933 test_xmlReaderForMemory(void) {
29936 #if defined(LIBXML_READER_ENABLED)
29938 xmlTextReaderPtr ret_val;
29939 char * buffer; /* a pointer to a char array */
29941 int size; /* the size of the array */
29943 const char * URL; /* the base URL to use for the document */
29945 char * encoding; /* the document encoding, or NULL */
29947 int options; /* a combination of xmlParserOption */
29950 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29951 for (n_size = 0;n_size < gen_nb_int;n_size++) {
29952 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29953 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29954 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29955 mem_base = xmlMemBlocks();
29956 buffer = gen_const_char_ptr(n_buffer, 0);
29957 size = gen_int(n_size, 1);
29958 URL = gen_filepath(n_URL, 2);
29959 encoding = gen_const_char_ptr(n_encoding, 3);
29960 options = gen_parseroptions(n_options, 4);
29962 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29963 desret_xmlTextReaderPtr(ret_val);
29965 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29966 des_int(n_size, size, 1);
29967 des_filepath(n_URL, URL, 2);
29968 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29969 des_parseroptions(n_options, options, 4);
29970 xmlResetLastError();
29971 if (mem_base != xmlMemBlocks()) {
29972 printf("Leak of %d blocks found in xmlReaderForMemory",
29973 xmlMemBlocks() - mem_base);
29975 printf(" %d", n_buffer);
29976 printf(" %d", n_size);
29977 printf(" %d", n_URL);
29978 printf(" %d", n_encoding);
29979 printf(" %d", n_options);
29995 test_xmlReaderNewDoc(void) {
29998 #if defined(LIBXML_READER_ENABLED)
30001 xmlTextReaderPtr reader; /* an XML reader */
30003 xmlChar * cur; /* a pointer to a zero terminated string */
30005 const char * URL; /* the base URL to use for the document */
30007 char * encoding; /* the document encoding, or NULL */
30009 int options; /* a combination of xmlParserOption */
30012 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30013 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30014 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30015 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30016 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30017 mem_base = xmlMemBlocks();
30018 reader = gen_xmlTextReaderPtr(n_reader, 0);
30019 cur = gen_const_xmlChar_ptr(n_cur, 1);
30020 URL = gen_filepath(n_URL, 2);
30021 encoding = gen_const_char_ptr(n_encoding, 3);
30022 options = gen_parseroptions(n_options, 4);
30024 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30025 desret_int(ret_val);
30027 des_xmlTextReaderPtr(n_reader, reader, 0);
30028 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30029 des_filepath(n_URL, URL, 2);
30030 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30031 des_parseroptions(n_options, options, 4);
30032 xmlResetLastError();
30033 if (mem_base != xmlMemBlocks()) {
30034 printf("Leak of %d blocks found in xmlReaderNewDoc",
30035 xmlMemBlocks() - mem_base);
30037 printf(" %d", n_reader);
30038 printf(" %d", n_cur);
30039 printf(" %d", n_URL);
30040 printf(" %d", n_encoding);
30041 printf(" %d", n_options);
30057 test_xmlReaderNewFile(void) {
30060 #if defined(LIBXML_READER_ENABLED)
30063 xmlTextReaderPtr reader; /* an XML reader */
30065 const char * filename; /* a file or URL */
30067 char * encoding; /* the document encoding, or NULL */
30069 int options; /* a combination of xmlParserOption */
30072 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30073 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30074 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30075 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30076 mem_base = xmlMemBlocks();
30077 reader = gen_xmlTextReaderPtr(n_reader, 0);
30078 filename = gen_filepath(n_filename, 1);
30079 encoding = gen_const_char_ptr(n_encoding, 2);
30080 options = gen_parseroptions(n_options, 3);
30082 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30083 desret_int(ret_val);
30085 des_xmlTextReaderPtr(n_reader, reader, 0);
30086 des_filepath(n_filename, filename, 1);
30087 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30088 des_parseroptions(n_options, options, 3);
30089 xmlResetLastError();
30090 if (mem_base != xmlMemBlocks()) {
30091 printf("Leak of %d blocks found in xmlReaderNewFile",
30092 xmlMemBlocks() - mem_base);
30094 printf(" %d", n_reader);
30095 printf(" %d", n_filename);
30096 printf(" %d", n_encoding);
30097 printf(" %d", n_options);
30112 test_xmlReaderNewMemory(void) {
30115 #if defined(LIBXML_READER_ENABLED)
30118 xmlTextReaderPtr reader; /* an XML reader */
30120 char * buffer; /* a pointer to a char array */
30122 int size; /* the size of the array */
30124 const char * URL; /* the base URL to use for the document */
30126 char * encoding; /* the document encoding, or NULL */
30128 int options; /* a combination of xmlParserOption */
30131 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30132 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30133 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30134 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30135 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30136 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30137 mem_base = xmlMemBlocks();
30138 reader = gen_xmlTextReaderPtr(n_reader, 0);
30139 buffer = gen_const_char_ptr(n_buffer, 1);
30140 size = gen_int(n_size, 2);
30141 URL = gen_filepath(n_URL, 3);
30142 encoding = gen_const_char_ptr(n_encoding, 4);
30143 options = gen_parseroptions(n_options, 5);
30145 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30146 desret_int(ret_val);
30148 des_xmlTextReaderPtr(n_reader, reader, 0);
30149 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30150 des_int(n_size, size, 2);
30151 des_filepath(n_URL, URL, 3);
30152 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30153 des_parseroptions(n_options, options, 5);
30154 xmlResetLastError();
30155 if (mem_base != xmlMemBlocks()) {
30156 printf("Leak of %d blocks found in xmlReaderNewMemory",
30157 xmlMemBlocks() - mem_base);
30159 printf(" %d", n_reader);
30160 printf(" %d", n_buffer);
30161 printf(" %d", n_size);
30162 printf(" %d", n_URL);
30163 printf(" %d", n_encoding);
30164 printf(" %d", n_options);
30181 test_xmlReaderNewWalker(void) {
30184 #if defined(LIBXML_READER_ENABLED)
30187 xmlTextReaderPtr reader; /* an XML reader */
30189 xmlDocPtr doc; /* a preparsed document */
30192 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30193 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30194 mem_base = xmlMemBlocks();
30195 reader = gen_xmlTextReaderPtr(n_reader, 0);
30196 doc = gen_xmlDocPtr(n_doc, 1);
30198 ret_val = xmlReaderNewWalker(reader, doc);
30199 desret_int(ret_val);
30201 des_xmlTextReaderPtr(n_reader, reader, 0);
30202 des_xmlDocPtr(n_doc, doc, 1);
30203 xmlResetLastError();
30204 if (mem_base != xmlMemBlocks()) {
30205 printf("Leak of %d blocks found in xmlReaderNewWalker",
30206 xmlMemBlocks() - mem_base);
30208 printf(" %d", n_reader);
30209 printf(" %d", n_doc);
30222 test_xmlReaderWalker(void) {
30225 #if defined(LIBXML_READER_ENABLED)
30227 xmlTextReaderPtr ret_val;
30228 xmlDocPtr doc; /* a preparsed document */
30231 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30232 mem_base = xmlMemBlocks();
30233 doc = gen_xmlDocPtr(n_doc, 0);
30235 ret_val = xmlReaderWalker(doc);
30236 desret_xmlTextReaderPtr(ret_val);
30238 des_xmlDocPtr(n_doc, doc, 0);
30239 xmlResetLastError();
30240 if (mem_base != xmlMemBlocks()) {
30241 printf("Leak of %d blocks found in xmlReaderWalker",
30242 xmlMemBlocks() - mem_base);
30244 printf(" %d", n_doc);
30256 test_xmlTextReaderAttributeCount(void) {
30259 #if defined(LIBXML_READER_ENABLED)
30262 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30265 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30266 mem_base = xmlMemBlocks();
30267 reader = gen_xmlTextReaderPtr(n_reader, 0);
30269 ret_val = xmlTextReaderAttributeCount(reader);
30270 desret_int(ret_val);
30272 des_xmlTextReaderPtr(n_reader, reader, 0);
30273 xmlResetLastError();
30274 if (mem_base != xmlMemBlocks()) {
30275 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30276 xmlMemBlocks() - mem_base);
30278 printf(" %d", n_reader);
30290 test_xmlTextReaderBaseUri(void) {
30293 #if defined(LIBXML_READER_ENABLED)
30296 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30299 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30300 mem_base = xmlMemBlocks();
30301 reader = gen_xmlTextReaderPtr(n_reader, 0);
30303 ret_val = xmlTextReaderBaseUri(reader);
30304 desret_xmlChar_ptr(ret_val);
30306 des_xmlTextReaderPtr(n_reader, reader, 0);
30307 xmlResetLastError();
30308 if (mem_base != xmlMemBlocks()) {
30309 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30310 xmlMemBlocks() - mem_base);
30312 printf(" %d", n_reader);
30324 test_xmlTextReaderByteConsumed(void) {
30327 #if defined(LIBXML_READER_ENABLED)
30330 xmlTextReaderPtr reader; /* an XML reader */
30333 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30334 mem_base = xmlMemBlocks();
30335 reader = gen_xmlTextReaderPtr(n_reader, 0);
30337 ret_val = xmlTextReaderByteConsumed(reader);
30338 desret_long(ret_val);
30340 des_xmlTextReaderPtr(n_reader, reader, 0);
30341 xmlResetLastError();
30342 if (mem_base != xmlMemBlocks()) {
30343 printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30344 xmlMemBlocks() - mem_base);
30346 printf(" %d", n_reader);
30358 test_xmlTextReaderClose(void) {
30361 #if defined(LIBXML_READER_ENABLED)
30364 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30367 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30368 mem_base = xmlMemBlocks();
30369 reader = gen_xmlTextReaderPtr(n_reader, 0);
30371 ret_val = xmlTextReaderClose(reader);
30372 desret_int(ret_val);
30374 des_xmlTextReaderPtr(n_reader, reader, 0);
30375 xmlResetLastError();
30376 if (mem_base != xmlMemBlocks()) {
30377 printf("Leak of %d blocks found in xmlTextReaderClose",
30378 xmlMemBlocks() - mem_base);
30380 printf(" %d", n_reader);
30392 test_xmlTextReaderConstBaseUri(void) {
30395 #if defined(LIBXML_READER_ENABLED)
30397 const xmlChar * ret_val;
30398 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30401 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30402 mem_base = xmlMemBlocks();
30403 reader = gen_xmlTextReaderPtr(n_reader, 0);
30405 ret_val = xmlTextReaderConstBaseUri(reader);
30406 desret_const_xmlChar_ptr(ret_val);
30408 des_xmlTextReaderPtr(n_reader, reader, 0);
30409 xmlResetLastError();
30410 if (mem_base != xmlMemBlocks()) {
30411 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30412 xmlMemBlocks() - mem_base);
30414 printf(" %d", n_reader);
30426 test_xmlTextReaderConstEncoding(void) {
30429 #if defined(LIBXML_READER_ENABLED)
30431 const xmlChar * ret_val;
30432 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30435 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30436 mem_base = xmlMemBlocks();
30437 reader = gen_xmlTextReaderPtr(n_reader, 0);
30439 ret_val = xmlTextReaderConstEncoding(reader);
30440 desret_const_xmlChar_ptr(ret_val);
30442 des_xmlTextReaderPtr(n_reader, reader, 0);
30443 xmlResetLastError();
30444 if (mem_base != xmlMemBlocks()) {
30445 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30446 xmlMemBlocks() - mem_base);
30448 printf(" %d", n_reader);
30460 test_xmlTextReaderConstLocalName(void) {
30463 #if defined(LIBXML_READER_ENABLED)
30465 const xmlChar * ret_val;
30466 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30469 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30470 mem_base = xmlMemBlocks();
30471 reader = gen_xmlTextReaderPtr(n_reader, 0);
30473 ret_val = xmlTextReaderConstLocalName(reader);
30474 desret_const_xmlChar_ptr(ret_val);
30476 des_xmlTextReaderPtr(n_reader, reader, 0);
30477 xmlResetLastError();
30478 if (mem_base != xmlMemBlocks()) {
30479 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30480 xmlMemBlocks() - mem_base);
30482 printf(" %d", n_reader);
30494 test_xmlTextReaderConstName(void) {
30497 #if defined(LIBXML_READER_ENABLED)
30499 const xmlChar * ret_val;
30500 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30503 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30504 mem_base = xmlMemBlocks();
30505 reader = gen_xmlTextReaderPtr(n_reader, 0);
30507 ret_val = xmlTextReaderConstName(reader);
30508 desret_const_xmlChar_ptr(ret_val);
30510 des_xmlTextReaderPtr(n_reader, reader, 0);
30511 xmlResetLastError();
30512 if (mem_base != xmlMemBlocks()) {
30513 printf("Leak of %d blocks found in xmlTextReaderConstName",
30514 xmlMemBlocks() - mem_base);
30516 printf(" %d", n_reader);
30528 test_xmlTextReaderConstNamespaceUri(void) {
30531 #if defined(LIBXML_READER_ENABLED)
30533 const xmlChar * ret_val;
30534 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30537 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30538 mem_base = xmlMemBlocks();
30539 reader = gen_xmlTextReaderPtr(n_reader, 0);
30541 ret_val = xmlTextReaderConstNamespaceUri(reader);
30542 desret_const_xmlChar_ptr(ret_val);
30544 des_xmlTextReaderPtr(n_reader, reader, 0);
30545 xmlResetLastError();
30546 if (mem_base != xmlMemBlocks()) {
30547 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30548 xmlMemBlocks() - mem_base);
30550 printf(" %d", n_reader);
30562 test_xmlTextReaderConstPrefix(void) {
30565 #if defined(LIBXML_READER_ENABLED)
30567 const xmlChar * ret_val;
30568 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30571 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30572 mem_base = xmlMemBlocks();
30573 reader = gen_xmlTextReaderPtr(n_reader, 0);
30575 ret_val = xmlTextReaderConstPrefix(reader);
30576 desret_const_xmlChar_ptr(ret_val);
30578 des_xmlTextReaderPtr(n_reader, reader, 0);
30579 xmlResetLastError();
30580 if (mem_base != xmlMemBlocks()) {
30581 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30582 xmlMemBlocks() - mem_base);
30584 printf(" %d", n_reader);
30596 test_xmlTextReaderConstString(void) {
30599 #if defined(LIBXML_READER_ENABLED)
30601 const xmlChar * ret_val;
30602 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30604 xmlChar * str; /* the string to intern. */
30607 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30608 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30609 mem_base = xmlMemBlocks();
30610 reader = gen_xmlTextReaderPtr(n_reader, 0);
30611 str = gen_const_xmlChar_ptr(n_str, 1);
30613 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30614 desret_const_xmlChar_ptr(ret_val);
30616 des_xmlTextReaderPtr(n_reader, reader, 0);
30617 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30618 xmlResetLastError();
30619 if (mem_base != xmlMemBlocks()) {
30620 printf("Leak of %d blocks found in xmlTextReaderConstString",
30621 xmlMemBlocks() - mem_base);
30623 printf(" %d", n_reader);
30624 printf(" %d", n_str);
30637 test_xmlTextReaderConstValue(void) {
30640 #if defined(LIBXML_READER_ENABLED)
30642 const xmlChar * ret_val;
30643 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30646 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30647 mem_base = xmlMemBlocks();
30648 reader = gen_xmlTextReaderPtr(n_reader, 0);
30650 ret_val = xmlTextReaderConstValue(reader);
30651 desret_const_xmlChar_ptr(ret_val);
30653 des_xmlTextReaderPtr(n_reader, reader, 0);
30654 xmlResetLastError();
30655 if (mem_base != xmlMemBlocks()) {
30656 printf("Leak of %d blocks found in xmlTextReaderConstValue",
30657 xmlMemBlocks() - mem_base);
30659 printf(" %d", n_reader);
30671 test_xmlTextReaderConstXmlLang(void) {
30674 #if defined(LIBXML_READER_ENABLED)
30676 const xmlChar * ret_val;
30677 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30680 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30681 mem_base = xmlMemBlocks();
30682 reader = gen_xmlTextReaderPtr(n_reader, 0);
30684 ret_val = xmlTextReaderConstXmlLang(reader);
30685 desret_const_xmlChar_ptr(ret_val);
30687 des_xmlTextReaderPtr(n_reader, reader, 0);
30688 xmlResetLastError();
30689 if (mem_base != xmlMemBlocks()) {
30690 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30691 xmlMemBlocks() - mem_base);
30693 printf(" %d", n_reader);
30705 test_xmlTextReaderConstXmlVersion(void) {
30708 #if defined(LIBXML_READER_ENABLED)
30710 const xmlChar * ret_val;
30711 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30714 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30715 mem_base = xmlMemBlocks();
30716 reader = gen_xmlTextReaderPtr(n_reader, 0);
30718 ret_val = xmlTextReaderConstXmlVersion(reader);
30719 desret_const_xmlChar_ptr(ret_val);
30721 des_xmlTextReaderPtr(n_reader, reader, 0);
30722 xmlResetLastError();
30723 if (mem_base != xmlMemBlocks()) {
30724 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30725 xmlMemBlocks() - mem_base);
30727 printf(" %d", n_reader);
30739 test_xmlTextReaderCurrentDoc(void) {
30742 #if defined(LIBXML_READER_ENABLED)
30745 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30748 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30749 mem_base = xmlMemBlocks();
30750 reader = gen_xmlTextReaderPtr(n_reader, 0);
30752 ret_val = xmlTextReaderCurrentDoc(reader);
30753 desret_xmlDocPtr(ret_val);
30755 des_xmlTextReaderPtr(n_reader, reader, 0);
30756 xmlResetLastError();
30757 if (mem_base != xmlMemBlocks()) {
30758 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30759 xmlMemBlocks() - mem_base);
30761 printf(" %d", n_reader);
30773 test_xmlTextReaderCurrentNode(void) {
30776 #if defined(LIBXML_READER_ENABLED)
30778 xmlNodePtr ret_val;
30779 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30782 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30783 mem_base = xmlMemBlocks();
30784 reader = gen_xmlTextReaderPtr(n_reader, 0);
30786 ret_val = xmlTextReaderCurrentNode(reader);
30787 desret_xmlNodePtr(ret_val);
30789 des_xmlTextReaderPtr(n_reader, reader, 0);
30790 xmlResetLastError();
30791 if (mem_base != xmlMemBlocks()) {
30792 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30793 xmlMemBlocks() - mem_base);
30795 printf(" %d", n_reader);
30807 test_xmlTextReaderDepth(void) {
30810 #if defined(LIBXML_READER_ENABLED)
30813 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30816 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30817 mem_base = xmlMemBlocks();
30818 reader = gen_xmlTextReaderPtr(n_reader, 0);
30820 ret_val = xmlTextReaderDepth(reader);
30821 desret_int(ret_val);
30823 des_xmlTextReaderPtr(n_reader, reader, 0);
30824 xmlResetLastError();
30825 if (mem_base != xmlMemBlocks()) {
30826 printf("Leak of %d blocks found in xmlTextReaderDepth",
30827 xmlMemBlocks() - mem_base);
30829 printf(" %d", n_reader);
30841 test_xmlTextReaderExpand(void) {
30844 #if defined(LIBXML_READER_ENABLED)
30846 xmlNodePtr ret_val;
30847 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30850 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30851 mem_base = xmlMemBlocks();
30852 reader = gen_xmlTextReaderPtr(n_reader, 0);
30854 ret_val = xmlTextReaderExpand(reader);
30855 desret_xmlNodePtr(ret_val);
30857 des_xmlTextReaderPtr(n_reader, reader, 0);
30858 xmlResetLastError();
30859 if (mem_base != xmlMemBlocks()) {
30860 printf("Leak of %d blocks found in xmlTextReaderExpand",
30861 xmlMemBlocks() - mem_base);
30863 printf(" %d", n_reader);
30875 test_xmlTextReaderGetAttribute(void) {
30878 #if defined(LIBXML_READER_ENABLED)
30881 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30883 xmlChar * name; /* the qualified name of the attribute. */
30886 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30887 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30888 mem_base = xmlMemBlocks();
30889 reader = gen_xmlTextReaderPtr(n_reader, 0);
30890 name = gen_const_xmlChar_ptr(n_name, 1);
30892 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30893 desret_xmlChar_ptr(ret_val);
30895 des_xmlTextReaderPtr(n_reader, reader, 0);
30896 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30897 xmlResetLastError();
30898 if (mem_base != xmlMemBlocks()) {
30899 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30900 xmlMemBlocks() - mem_base);
30902 printf(" %d", n_reader);
30903 printf(" %d", n_name);
30916 test_xmlTextReaderGetAttributeNo(void) {
30919 #if defined(LIBXML_READER_ENABLED)
30922 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30924 int no; /* the zero-based index of the attribute relative to the containing element */
30927 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30928 for (n_no = 0;n_no < gen_nb_int;n_no++) {
30929 mem_base = xmlMemBlocks();
30930 reader = gen_xmlTextReaderPtr(n_reader, 0);
30931 no = gen_int(n_no, 1);
30933 ret_val = xmlTextReaderGetAttributeNo(reader, no);
30934 desret_xmlChar_ptr(ret_val);
30936 des_xmlTextReaderPtr(n_reader, reader, 0);
30937 des_int(n_no, no, 1);
30938 xmlResetLastError();
30939 if (mem_base != xmlMemBlocks()) {
30940 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30941 xmlMemBlocks() - mem_base);
30943 printf(" %d", n_reader);
30944 printf(" %d", n_no);
30957 test_xmlTextReaderGetAttributeNs(void) {
30960 #if defined(LIBXML_READER_ENABLED)
30963 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30965 xmlChar * localName; /* the local name of the attribute. */
30967 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30968 int n_namespaceURI;
30970 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30971 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30972 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30973 mem_base = xmlMemBlocks();
30974 reader = gen_xmlTextReaderPtr(n_reader, 0);
30975 localName = gen_const_xmlChar_ptr(n_localName, 1);
30976 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30978 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30979 desret_xmlChar_ptr(ret_val);
30981 des_xmlTextReaderPtr(n_reader, reader, 0);
30982 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30983 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30984 xmlResetLastError();
30985 if (mem_base != xmlMemBlocks()) {
30986 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30987 xmlMemBlocks() - mem_base);
30989 printf(" %d", n_reader);
30990 printf(" %d", n_localName);
30991 printf(" %d", n_namespaceURI);
31003 #ifdef LIBXML_READER_ENABLED
31005 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31006 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31009 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31015 test_xmlTextReaderGetErrorHandler(void) {
31018 #if defined(LIBXML_READER_ENABLED)
31020 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31022 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31024 void ** arg; /* a user argument */
31027 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31028 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31029 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31030 mem_base = xmlMemBlocks();
31031 reader = gen_xmlTextReaderPtr(n_reader, 0);
31032 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31033 arg = gen_void_ptr_ptr(n_arg, 2);
31035 xmlTextReaderGetErrorHandler(reader, f, arg);
31037 des_xmlTextReaderPtr(n_reader, reader, 0);
31038 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31039 des_void_ptr_ptr(n_arg, arg, 2);
31040 xmlResetLastError();
31041 if (mem_base != xmlMemBlocks()) {
31042 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31043 xmlMemBlocks() - mem_base);
31045 printf(" %d", n_reader);
31046 printf(" %d", n_f);
31047 printf(" %d", n_arg);
31061 test_xmlTextReaderGetParserColumnNumber(void) {
31064 #if defined(LIBXML_READER_ENABLED)
31067 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31070 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31071 mem_base = xmlMemBlocks();
31072 reader = gen_xmlTextReaderPtr(n_reader, 0);
31074 ret_val = xmlTextReaderGetParserColumnNumber(reader);
31075 desret_int(ret_val);
31077 des_xmlTextReaderPtr(n_reader, reader, 0);
31078 xmlResetLastError();
31079 if (mem_base != xmlMemBlocks()) {
31080 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31081 xmlMemBlocks() - mem_base);
31083 printf(" %d", n_reader);
31095 test_xmlTextReaderGetParserLineNumber(void) {
31098 #if defined(LIBXML_READER_ENABLED)
31101 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31104 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31105 mem_base = xmlMemBlocks();
31106 reader = gen_xmlTextReaderPtr(n_reader, 0);
31108 ret_val = xmlTextReaderGetParserLineNumber(reader);
31109 desret_int(ret_val);
31111 des_xmlTextReaderPtr(n_reader, reader, 0);
31112 xmlResetLastError();
31113 if (mem_base != xmlMemBlocks()) {
31114 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31115 xmlMemBlocks() - mem_base);
31117 printf(" %d", n_reader);
31129 test_xmlTextReaderGetParserProp(void) {
31132 #if defined(LIBXML_READER_ENABLED)
31135 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31137 int prop; /* the xmlParserProperties to get */
31140 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31141 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31142 mem_base = xmlMemBlocks();
31143 reader = gen_xmlTextReaderPtr(n_reader, 0);
31144 prop = gen_int(n_prop, 1);
31146 ret_val = xmlTextReaderGetParserProp(reader, prop);
31147 desret_int(ret_val);
31149 des_xmlTextReaderPtr(n_reader, reader, 0);
31150 des_int(n_prop, prop, 1);
31151 xmlResetLastError();
31152 if (mem_base != xmlMemBlocks()) {
31153 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31154 xmlMemBlocks() - mem_base);
31156 printf(" %d", n_reader);
31157 printf(" %d", n_prop);
31170 test_xmlTextReaderGetRemainder(void) {
31173 #if defined(LIBXML_READER_ENABLED)
31175 xmlParserInputBufferPtr ret_val;
31176 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31179 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31180 mem_base = xmlMemBlocks();
31181 reader = gen_xmlTextReaderPtr(n_reader, 0);
31183 ret_val = xmlTextReaderGetRemainder(reader);
31184 desret_xmlParserInputBufferPtr(ret_val);
31186 des_xmlTextReaderPtr(n_reader, reader, 0);
31187 xmlResetLastError();
31188 if (mem_base != xmlMemBlocks()) {
31189 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31190 xmlMemBlocks() - mem_base);
31192 printf(" %d", n_reader);
31204 test_xmlTextReaderHasAttributes(void) {
31207 #if defined(LIBXML_READER_ENABLED)
31210 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31213 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31214 mem_base = xmlMemBlocks();
31215 reader = gen_xmlTextReaderPtr(n_reader, 0);
31217 ret_val = xmlTextReaderHasAttributes(reader);
31218 desret_int(ret_val);
31220 des_xmlTextReaderPtr(n_reader, reader, 0);
31221 xmlResetLastError();
31222 if (mem_base != xmlMemBlocks()) {
31223 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31224 xmlMemBlocks() - mem_base);
31226 printf(" %d", n_reader);
31238 test_xmlTextReaderHasValue(void) {
31241 #if defined(LIBXML_READER_ENABLED)
31244 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31247 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31248 mem_base = xmlMemBlocks();
31249 reader = gen_xmlTextReaderPtr(n_reader, 0);
31251 ret_val = xmlTextReaderHasValue(reader);
31252 desret_int(ret_val);
31254 des_xmlTextReaderPtr(n_reader, reader, 0);
31255 xmlResetLastError();
31256 if (mem_base != xmlMemBlocks()) {
31257 printf("Leak of %d blocks found in xmlTextReaderHasValue",
31258 xmlMemBlocks() - mem_base);
31260 printf(" %d", n_reader);
31272 test_xmlTextReaderIsDefault(void) {
31275 #if defined(LIBXML_READER_ENABLED)
31278 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31281 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31282 mem_base = xmlMemBlocks();
31283 reader = gen_xmlTextReaderPtr(n_reader, 0);
31285 ret_val = xmlTextReaderIsDefault(reader);
31286 desret_int(ret_val);
31288 des_xmlTextReaderPtr(n_reader, reader, 0);
31289 xmlResetLastError();
31290 if (mem_base != xmlMemBlocks()) {
31291 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31292 xmlMemBlocks() - mem_base);
31294 printf(" %d", n_reader);
31306 test_xmlTextReaderIsEmptyElement(void) {
31309 #if defined(LIBXML_READER_ENABLED)
31312 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31315 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31316 mem_base = xmlMemBlocks();
31317 reader = gen_xmlTextReaderPtr(n_reader, 0);
31319 ret_val = xmlTextReaderIsEmptyElement(reader);
31320 desret_int(ret_val);
31322 des_xmlTextReaderPtr(n_reader, reader, 0);
31323 xmlResetLastError();
31324 if (mem_base != xmlMemBlocks()) {
31325 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31326 xmlMemBlocks() - mem_base);
31328 printf(" %d", n_reader);
31340 test_xmlTextReaderIsNamespaceDecl(void) {
31343 #if defined(LIBXML_READER_ENABLED)
31346 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31349 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31350 mem_base = xmlMemBlocks();
31351 reader = gen_xmlTextReaderPtr(n_reader, 0);
31353 ret_val = xmlTextReaderIsNamespaceDecl(reader);
31354 desret_int(ret_val);
31356 des_xmlTextReaderPtr(n_reader, reader, 0);
31357 xmlResetLastError();
31358 if (mem_base != xmlMemBlocks()) {
31359 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31360 xmlMemBlocks() - mem_base);
31362 printf(" %d", n_reader);
31374 test_xmlTextReaderIsValid(void) {
31377 #if defined(LIBXML_READER_ENABLED)
31380 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31383 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31384 mem_base = xmlMemBlocks();
31385 reader = gen_xmlTextReaderPtr(n_reader, 0);
31387 ret_val = xmlTextReaderIsValid(reader);
31388 desret_int(ret_val);
31390 des_xmlTextReaderPtr(n_reader, reader, 0);
31391 xmlResetLastError();
31392 if (mem_base != xmlMemBlocks()) {
31393 printf("Leak of %d blocks found in xmlTextReaderIsValid",
31394 xmlMemBlocks() - mem_base);
31396 printf(" %d", n_reader);
31408 test_xmlTextReaderLocalName(void) {
31411 #if defined(LIBXML_READER_ENABLED)
31414 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31417 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31418 mem_base = xmlMemBlocks();
31419 reader = gen_xmlTextReaderPtr(n_reader, 0);
31421 ret_val = xmlTextReaderLocalName(reader);
31422 desret_xmlChar_ptr(ret_val);
31424 des_xmlTextReaderPtr(n_reader, reader, 0);
31425 xmlResetLastError();
31426 if (mem_base != xmlMemBlocks()) {
31427 printf("Leak of %d blocks found in xmlTextReaderLocalName",
31428 xmlMemBlocks() - mem_base);
31430 printf(" %d", n_reader);
31440 #ifdef LIBXML_READER_ENABLED
31442 #define gen_nb_xmlTextReaderLocatorPtr 1
31443 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31446 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31452 test_xmlTextReaderLocatorBaseURI(void) {
31455 #if defined(LIBXML_READER_ENABLED)
31458 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31461 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31462 mem_base = xmlMemBlocks();
31463 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31465 ret_val = xmlTextReaderLocatorBaseURI(locator);
31466 desret_xmlChar_ptr(ret_val);
31468 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31469 xmlResetLastError();
31470 if (mem_base != xmlMemBlocks()) {
31471 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31472 xmlMemBlocks() - mem_base);
31474 printf(" %d", n_locator);
31486 test_xmlTextReaderLocatorLineNumber(void) {
31489 #if defined(LIBXML_READER_ENABLED)
31492 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31495 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31496 mem_base = xmlMemBlocks();
31497 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31499 ret_val = xmlTextReaderLocatorLineNumber(locator);
31500 desret_int(ret_val);
31502 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31503 xmlResetLastError();
31504 if (mem_base != xmlMemBlocks()) {
31505 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31506 xmlMemBlocks() - mem_base);
31508 printf(" %d", n_locator);
31520 test_xmlTextReaderLookupNamespace(void) {
31523 #if defined(LIBXML_READER_ENABLED)
31526 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31528 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31531 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31532 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31533 mem_base = xmlMemBlocks();
31534 reader = gen_xmlTextReaderPtr(n_reader, 0);
31535 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31537 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31538 desret_xmlChar_ptr(ret_val);
31540 des_xmlTextReaderPtr(n_reader, reader, 0);
31541 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31542 xmlResetLastError();
31543 if (mem_base != xmlMemBlocks()) {
31544 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31545 xmlMemBlocks() - mem_base);
31547 printf(" %d", n_reader);
31548 printf(" %d", n_prefix);
31561 test_xmlTextReaderMoveToAttribute(void) {
31564 #if defined(LIBXML_READER_ENABLED)
31567 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31569 xmlChar * name; /* the qualified name of the attribute. */
31572 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31573 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31574 mem_base = xmlMemBlocks();
31575 reader = gen_xmlTextReaderPtr(n_reader, 0);
31576 name = gen_const_xmlChar_ptr(n_name, 1);
31578 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31579 desret_int(ret_val);
31581 des_xmlTextReaderPtr(n_reader, reader, 0);
31582 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31583 xmlResetLastError();
31584 if (mem_base != xmlMemBlocks()) {
31585 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31586 xmlMemBlocks() - mem_base);
31588 printf(" %d", n_reader);
31589 printf(" %d", n_name);
31602 test_xmlTextReaderMoveToAttributeNo(void) {
31605 #if defined(LIBXML_READER_ENABLED)
31608 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31610 int no; /* the zero-based index of the attribute relative to the containing element. */
31613 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31614 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31615 mem_base = xmlMemBlocks();
31616 reader = gen_xmlTextReaderPtr(n_reader, 0);
31617 no = gen_int(n_no, 1);
31619 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31620 desret_int(ret_val);
31622 des_xmlTextReaderPtr(n_reader, reader, 0);
31623 des_int(n_no, no, 1);
31624 xmlResetLastError();
31625 if (mem_base != xmlMemBlocks()) {
31626 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31627 xmlMemBlocks() - mem_base);
31629 printf(" %d", n_reader);
31630 printf(" %d", n_no);
31643 test_xmlTextReaderMoveToAttributeNs(void) {
31646 #if defined(LIBXML_READER_ENABLED)
31649 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31651 xmlChar * localName; /* the local name of the attribute. */
31653 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31654 int n_namespaceURI;
31656 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31657 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31658 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31659 mem_base = xmlMemBlocks();
31660 reader = gen_xmlTextReaderPtr(n_reader, 0);
31661 localName = gen_const_xmlChar_ptr(n_localName, 1);
31662 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31664 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31665 desret_int(ret_val);
31667 des_xmlTextReaderPtr(n_reader, reader, 0);
31668 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31669 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31670 xmlResetLastError();
31671 if (mem_base != xmlMemBlocks()) {
31672 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31673 xmlMemBlocks() - mem_base);
31675 printf(" %d", n_reader);
31676 printf(" %d", n_localName);
31677 printf(" %d", n_namespaceURI);
31691 test_xmlTextReaderMoveToElement(void) {
31694 #if defined(LIBXML_READER_ENABLED)
31697 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31700 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31701 mem_base = xmlMemBlocks();
31702 reader = gen_xmlTextReaderPtr(n_reader, 0);
31704 ret_val = xmlTextReaderMoveToElement(reader);
31705 desret_int(ret_val);
31707 des_xmlTextReaderPtr(n_reader, reader, 0);
31708 xmlResetLastError();
31709 if (mem_base != xmlMemBlocks()) {
31710 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31711 xmlMemBlocks() - mem_base);
31713 printf(" %d", n_reader);
31725 test_xmlTextReaderMoveToFirstAttribute(void) {
31728 #if defined(LIBXML_READER_ENABLED)
31731 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31734 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31735 mem_base = xmlMemBlocks();
31736 reader = gen_xmlTextReaderPtr(n_reader, 0);
31738 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31739 desret_int(ret_val);
31741 des_xmlTextReaderPtr(n_reader, reader, 0);
31742 xmlResetLastError();
31743 if (mem_base != xmlMemBlocks()) {
31744 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31745 xmlMemBlocks() - mem_base);
31747 printf(" %d", n_reader);
31759 test_xmlTextReaderMoveToNextAttribute(void) {
31762 #if defined(LIBXML_READER_ENABLED)
31765 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31768 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31769 mem_base = xmlMemBlocks();
31770 reader = gen_xmlTextReaderPtr(n_reader, 0);
31772 ret_val = xmlTextReaderMoveToNextAttribute(reader);
31773 desret_int(ret_val);
31775 des_xmlTextReaderPtr(n_reader, reader, 0);
31776 xmlResetLastError();
31777 if (mem_base != xmlMemBlocks()) {
31778 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31779 xmlMemBlocks() - mem_base);
31781 printf(" %d", n_reader);
31793 test_xmlTextReaderName(void) {
31796 #if defined(LIBXML_READER_ENABLED)
31799 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31802 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31803 mem_base = xmlMemBlocks();
31804 reader = gen_xmlTextReaderPtr(n_reader, 0);
31806 ret_val = xmlTextReaderName(reader);
31807 desret_xmlChar_ptr(ret_val);
31809 des_xmlTextReaderPtr(n_reader, reader, 0);
31810 xmlResetLastError();
31811 if (mem_base != xmlMemBlocks()) {
31812 printf("Leak of %d blocks found in xmlTextReaderName",
31813 xmlMemBlocks() - mem_base);
31815 printf(" %d", n_reader);
31827 test_xmlTextReaderNamespaceUri(void) {
31830 #if defined(LIBXML_READER_ENABLED)
31833 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31836 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31837 mem_base = xmlMemBlocks();
31838 reader = gen_xmlTextReaderPtr(n_reader, 0);
31840 ret_val = xmlTextReaderNamespaceUri(reader);
31841 desret_xmlChar_ptr(ret_val);
31843 des_xmlTextReaderPtr(n_reader, reader, 0);
31844 xmlResetLastError();
31845 if (mem_base != xmlMemBlocks()) {
31846 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31847 xmlMemBlocks() - mem_base);
31849 printf(" %d", n_reader);
31861 test_xmlTextReaderNext(void) {
31864 #if defined(LIBXML_READER_ENABLED)
31867 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31870 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31871 mem_base = xmlMemBlocks();
31872 reader = gen_xmlTextReaderPtr(n_reader, 0);
31874 ret_val = xmlTextReaderNext(reader);
31875 desret_int(ret_val);
31877 des_xmlTextReaderPtr(n_reader, reader, 0);
31878 xmlResetLastError();
31879 if (mem_base != xmlMemBlocks()) {
31880 printf("Leak of %d blocks found in xmlTextReaderNext",
31881 xmlMemBlocks() - mem_base);
31883 printf(" %d", n_reader);
31895 test_xmlTextReaderNextSibling(void) {
31898 #if defined(LIBXML_READER_ENABLED)
31901 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31904 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31905 mem_base = xmlMemBlocks();
31906 reader = gen_xmlTextReaderPtr(n_reader, 0);
31908 ret_val = xmlTextReaderNextSibling(reader);
31909 desret_int(ret_val);
31911 des_xmlTextReaderPtr(n_reader, reader, 0);
31912 xmlResetLastError();
31913 if (mem_base != xmlMemBlocks()) {
31914 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31915 xmlMemBlocks() - mem_base);
31917 printf(" %d", n_reader);
31929 test_xmlTextReaderNodeType(void) {
31932 #if defined(LIBXML_READER_ENABLED)
31935 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31938 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31939 mem_base = xmlMemBlocks();
31940 reader = gen_xmlTextReaderPtr(n_reader, 0);
31942 ret_val = xmlTextReaderNodeType(reader);
31943 desret_int(ret_val);
31945 des_xmlTextReaderPtr(n_reader, reader, 0);
31946 xmlResetLastError();
31947 if (mem_base != xmlMemBlocks()) {
31948 printf("Leak of %d blocks found in xmlTextReaderNodeType",
31949 xmlMemBlocks() - mem_base);
31951 printf(" %d", n_reader);
31963 test_xmlTextReaderNormalization(void) {
31966 #if defined(LIBXML_READER_ENABLED)
31969 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31972 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31973 mem_base = xmlMemBlocks();
31974 reader = gen_xmlTextReaderPtr(n_reader, 0);
31976 ret_val = xmlTextReaderNormalization(reader);
31977 desret_int(ret_val);
31979 des_xmlTextReaderPtr(n_reader, reader, 0);
31980 xmlResetLastError();
31981 if (mem_base != xmlMemBlocks()) {
31982 printf("Leak of %d blocks found in xmlTextReaderNormalization",
31983 xmlMemBlocks() - mem_base);
31985 printf(" %d", n_reader);
31997 test_xmlTextReaderPrefix(void) {
32000 #if defined(LIBXML_READER_ENABLED)
32003 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32006 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32007 mem_base = xmlMemBlocks();
32008 reader = gen_xmlTextReaderPtr(n_reader, 0);
32010 ret_val = xmlTextReaderPrefix(reader);
32011 desret_xmlChar_ptr(ret_val);
32013 des_xmlTextReaderPtr(n_reader, reader, 0);
32014 xmlResetLastError();
32015 if (mem_base != xmlMemBlocks()) {
32016 printf("Leak of %d blocks found in xmlTextReaderPrefix",
32017 xmlMemBlocks() - mem_base);
32019 printf(" %d", n_reader);
32031 test_xmlTextReaderPreserve(void) {
32034 #if defined(LIBXML_READER_ENABLED)
32036 xmlNodePtr ret_val;
32037 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32040 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32041 mem_base = xmlMemBlocks();
32042 reader = gen_xmlTextReaderPtr(n_reader, 0);
32044 ret_val = xmlTextReaderPreserve(reader);
32045 desret_xmlNodePtr(ret_val);
32047 des_xmlTextReaderPtr(n_reader, reader, 0);
32048 xmlResetLastError();
32049 if (mem_base != xmlMemBlocks()) {
32050 printf("Leak of %d blocks found in xmlTextReaderPreserve",
32051 xmlMemBlocks() - mem_base);
32053 printf(" %d", n_reader);
32065 test_xmlTextReaderPreservePattern(void) {
32068 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32069 #ifdef LIBXML_PATTERN_ENABLED
32072 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32074 xmlChar * pattern; /* an XPath subset pattern */
32076 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32079 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32080 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32081 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32082 mem_base = xmlMemBlocks();
32083 reader = gen_xmlTextReaderPtr(n_reader, 0);
32084 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32085 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32087 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32088 desret_int(ret_val);
32090 des_xmlTextReaderPtr(n_reader, reader, 0);
32091 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32092 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32093 xmlResetLastError();
32094 if (mem_base != xmlMemBlocks()) {
32095 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32096 xmlMemBlocks() - mem_base);
32098 printf(" %d", n_reader);
32099 printf(" %d", n_pattern);
32100 printf(" %d", n_namespaces);
32115 test_xmlTextReaderQuoteChar(void) {
32118 #if defined(LIBXML_READER_ENABLED)
32121 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32124 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32125 mem_base = xmlMemBlocks();
32126 reader = gen_xmlTextReaderPtr(n_reader, 0);
32128 ret_val = xmlTextReaderQuoteChar(reader);
32129 desret_int(ret_val);
32131 des_xmlTextReaderPtr(n_reader, reader, 0);
32132 xmlResetLastError();
32133 if (mem_base != xmlMemBlocks()) {
32134 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32135 xmlMemBlocks() - mem_base);
32137 printf(" %d", n_reader);
32149 test_xmlTextReaderRead(void) {
32152 #if defined(LIBXML_READER_ENABLED)
32155 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32158 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32159 mem_base = xmlMemBlocks();
32160 reader = gen_xmlTextReaderPtr(n_reader, 0);
32162 ret_val = xmlTextReaderRead(reader);
32163 desret_int(ret_val);
32165 des_xmlTextReaderPtr(n_reader, reader, 0);
32166 xmlResetLastError();
32167 if (mem_base != xmlMemBlocks()) {
32168 printf("Leak of %d blocks found in xmlTextReaderRead",
32169 xmlMemBlocks() - mem_base);
32171 printf(" %d", n_reader);
32183 test_xmlTextReaderReadAttributeValue(void) {
32186 #if defined(LIBXML_READER_ENABLED)
32189 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32192 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32193 mem_base = xmlMemBlocks();
32194 reader = gen_xmlTextReaderPtr(n_reader, 0);
32196 ret_val = xmlTextReaderReadAttributeValue(reader);
32197 desret_int(ret_val);
32199 des_xmlTextReaderPtr(n_reader, reader, 0);
32200 xmlResetLastError();
32201 if (mem_base != xmlMemBlocks()) {
32202 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32203 xmlMemBlocks() - mem_base);
32205 printf(" %d", n_reader);
32217 test_xmlTextReaderReadState(void) {
32220 #if defined(LIBXML_READER_ENABLED)
32223 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32226 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32227 mem_base = xmlMemBlocks();
32228 reader = gen_xmlTextReaderPtr(n_reader, 0);
32230 ret_val = xmlTextReaderReadState(reader);
32231 desret_int(ret_val);
32233 des_xmlTextReaderPtr(n_reader, reader, 0);
32234 xmlResetLastError();
32235 if (mem_base != xmlMemBlocks()) {
32236 printf("Leak of %d blocks found in xmlTextReaderReadState",
32237 xmlMemBlocks() - mem_base);
32239 printf(" %d", n_reader);
32251 test_xmlTextReaderRelaxNGSetSchema(void) {
32254 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32257 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32259 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32262 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32263 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32264 mem_base = xmlMemBlocks();
32265 reader = gen_xmlTextReaderPtr(n_reader, 0);
32266 schema = gen_xmlRelaxNGPtr(n_schema, 1);
32268 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32269 desret_int(ret_val);
32271 des_xmlTextReaderPtr(n_reader, reader, 0);
32272 des_xmlRelaxNGPtr(n_schema, schema, 1);
32273 xmlResetLastError();
32274 if (mem_base != xmlMemBlocks()) {
32275 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32276 xmlMemBlocks() - mem_base);
32278 printf(" %d", n_reader);
32279 printf(" %d", n_schema);
32292 test_xmlTextReaderRelaxNGValidate(void) {
32295 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32298 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32300 char * rng; /* the path to a RelaxNG schema or NULL */
32303 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32304 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32305 mem_base = xmlMemBlocks();
32306 reader = gen_xmlTextReaderPtr(n_reader, 0);
32307 rng = gen_const_char_ptr(n_rng, 1);
32309 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32310 desret_int(ret_val);
32312 des_xmlTextReaderPtr(n_reader, reader, 0);
32313 des_const_char_ptr(n_rng, (const char *)rng, 1);
32314 xmlResetLastError();
32315 if (mem_base != xmlMemBlocks()) {
32316 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32317 xmlMemBlocks() - mem_base);
32319 printf(" %d", n_reader);
32320 printf(" %d", n_rng);
32333 test_xmlTextReaderSchemaValidate(void) {
32336 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32338 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32340 char * xsd; /* the path to a W3C XSD schema or NULL */
32343 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32344 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32345 reader = gen_xmlTextReaderPtr(n_reader, 0);
32346 xsd = gen_const_char_ptr(n_xsd, 1);
32348 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32349 desret_int(ret_val);
32351 des_xmlTextReaderPtr(n_reader, reader, 0);
32352 des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32353 xmlResetLastError();
32364 test_xmlTextReaderSchemaValidateCtxt(void) {
32367 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32370 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32372 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32374 int options; /* options (not used yet) */
32377 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32378 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32379 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32380 mem_base = xmlMemBlocks();
32381 reader = gen_xmlTextReaderPtr(n_reader, 0);
32382 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32383 options = gen_parseroptions(n_options, 2);
32385 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32386 desret_int(ret_val);
32388 des_xmlTextReaderPtr(n_reader, reader, 0);
32389 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32390 des_parseroptions(n_options, options, 2);
32391 xmlResetLastError();
32392 if (mem_base != xmlMemBlocks()) {
32393 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32394 xmlMemBlocks() - mem_base);
32396 printf(" %d", n_reader);
32397 printf(" %d", n_ctxt);
32398 printf(" %d", n_options);
32412 test_xmlTextReaderSetErrorHandler(void) {
32416 /* missing type support */
32422 test_xmlTextReaderSetParserProp(void) {
32425 #if defined(LIBXML_READER_ENABLED)
32428 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32430 int prop; /* the xmlParserProperties to set */
32432 int value; /* usually 0 or 1 to (de)activate it */
32435 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32436 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32437 for (n_value = 0;n_value < gen_nb_int;n_value++) {
32438 mem_base = xmlMemBlocks();
32439 reader = gen_xmlTextReaderPtr(n_reader, 0);
32440 prop = gen_int(n_prop, 1);
32441 value = gen_int(n_value, 2);
32443 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32444 desret_int(ret_val);
32446 des_xmlTextReaderPtr(n_reader, reader, 0);
32447 des_int(n_prop, prop, 1);
32448 des_int(n_value, value, 2);
32449 xmlResetLastError();
32450 if (mem_base != xmlMemBlocks()) {
32451 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32452 xmlMemBlocks() - mem_base);
32454 printf(" %d", n_reader);
32455 printf(" %d", n_prop);
32456 printf(" %d", n_value);
32470 test_xmlTextReaderSetSchema(void) {
32473 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32476 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32478 xmlSchemaPtr schema; /* a precompiled Schema schema */
32481 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32482 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32483 mem_base = xmlMemBlocks();
32484 reader = gen_xmlTextReaderPtr(n_reader, 0);
32485 schema = gen_xmlSchemaPtr(n_schema, 1);
32487 ret_val = xmlTextReaderSetSchema(reader, schema);
32488 desret_int(ret_val);
32490 des_xmlTextReaderPtr(n_reader, reader, 0);
32491 des_xmlSchemaPtr(n_schema, schema, 1);
32492 xmlResetLastError();
32493 if (mem_base != xmlMemBlocks()) {
32494 printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32495 xmlMemBlocks() - mem_base);
32497 printf(" %d", n_reader);
32498 printf(" %d", n_schema);
32511 test_xmlTextReaderSetStructuredErrorHandler(void) {
32515 /* missing type support */
32521 test_xmlTextReaderSetup(void) {
32524 #if defined(LIBXML_READER_ENABLED)
32527 xmlTextReaderPtr reader; /* an XML reader */
32529 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32531 const char * URL; /* the base URL to use for the document */
32533 char * encoding; /* the document encoding, or NULL */
32535 int options; /* a combination of xmlParserOption */
32538 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32539 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32540 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32541 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32542 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32543 mem_base = xmlMemBlocks();
32544 reader = gen_xmlTextReaderPtr(n_reader, 0);
32545 input = gen_xmlParserInputBufferPtr(n_input, 1);
32546 URL = gen_filepath(n_URL, 2);
32547 encoding = gen_const_char_ptr(n_encoding, 3);
32548 options = gen_parseroptions(n_options, 4);
32550 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32551 desret_int(ret_val);
32553 des_xmlTextReaderPtr(n_reader, reader, 0);
32554 des_filepath(n_URL, URL, 2);
32555 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32556 des_parseroptions(n_options, options, 4);
32557 xmlResetLastError();
32558 if (mem_base != xmlMemBlocks()) {
32559 printf("Leak of %d blocks found in xmlTextReaderSetup",
32560 xmlMemBlocks() - mem_base);
32562 printf(" %d", n_reader);
32563 printf(" %d", n_input);
32564 printf(" %d", n_URL);
32565 printf(" %d", n_encoding);
32566 printf(" %d", n_options);
32582 test_xmlTextReaderStandalone(void) {
32585 #if defined(LIBXML_READER_ENABLED)
32588 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32591 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32592 mem_base = xmlMemBlocks();
32593 reader = gen_xmlTextReaderPtr(n_reader, 0);
32595 ret_val = xmlTextReaderStandalone(reader);
32596 desret_int(ret_val);
32598 des_xmlTextReaderPtr(n_reader, reader, 0);
32599 xmlResetLastError();
32600 if (mem_base != xmlMemBlocks()) {
32601 printf("Leak of %d blocks found in xmlTextReaderStandalone",
32602 xmlMemBlocks() - mem_base);
32604 printf(" %d", n_reader);
32616 test_xmlTextReaderValue(void) {
32619 #if defined(LIBXML_READER_ENABLED)
32622 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32625 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32626 mem_base = xmlMemBlocks();
32627 reader = gen_xmlTextReaderPtr(n_reader, 0);
32629 ret_val = xmlTextReaderValue(reader);
32630 desret_xmlChar_ptr(ret_val);
32632 des_xmlTextReaderPtr(n_reader, reader, 0);
32633 xmlResetLastError();
32634 if (mem_base != xmlMemBlocks()) {
32635 printf("Leak of %d blocks found in xmlTextReaderValue",
32636 xmlMemBlocks() - mem_base);
32638 printf(" %d", n_reader);
32650 test_xmlTextReaderXmlLang(void) {
32653 #if defined(LIBXML_READER_ENABLED)
32656 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32659 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32660 mem_base = xmlMemBlocks();
32661 reader = gen_xmlTextReaderPtr(n_reader, 0);
32663 ret_val = xmlTextReaderXmlLang(reader);
32664 desret_xmlChar_ptr(ret_val);
32666 des_xmlTextReaderPtr(n_reader, reader, 0);
32667 xmlResetLastError();
32668 if (mem_base != xmlMemBlocks()) {
32669 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32670 xmlMemBlocks() - mem_base);
32672 printf(" %d", n_reader);
32683 test_xmlreader(void) {
32686 if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32687 test_ret += test_xmlNewTextReader();
32688 test_ret += test_xmlNewTextReaderFilename();
32689 test_ret += test_xmlReaderForDoc();
32690 test_ret += test_xmlReaderForFile();
32691 test_ret += test_xmlReaderForMemory();
32692 test_ret += test_xmlReaderNewDoc();
32693 test_ret += test_xmlReaderNewFile();
32694 test_ret += test_xmlReaderNewMemory();
32695 test_ret += test_xmlReaderNewWalker();
32696 test_ret += test_xmlReaderWalker();
32697 test_ret += test_xmlTextReaderAttributeCount();
32698 test_ret += test_xmlTextReaderBaseUri();
32699 test_ret += test_xmlTextReaderByteConsumed();
32700 test_ret += test_xmlTextReaderClose();
32701 test_ret += test_xmlTextReaderConstBaseUri();
32702 test_ret += test_xmlTextReaderConstEncoding();
32703 test_ret += test_xmlTextReaderConstLocalName();
32704 test_ret += test_xmlTextReaderConstName();
32705 test_ret += test_xmlTextReaderConstNamespaceUri();
32706 test_ret += test_xmlTextReaderConstPrefix();
32707 test_ret += test_xmlTextReaderConstString();
32708 test_ret += test_xmlTextReaderConstValue();
32709 test_ret += test_xmlTextReaderConstXmlLang();
32710 test_ret += test_xmlTextReaderConstXmlVersion();
32711 test_ret += test_xmlTextReaderCurrentDoc();
32712 test_ret += test_xmlTextReaderCurrentNode();
32713 test_ret += test_xmlTextReaderDepth();
32714 test_ret += test_xmlTextReaderExpand();
32715 test_ret += test_xmlTextReaderGetAttribute();
32716 test_ret += test_xmlTextReaderGetAttributeNo();
32717 test_ret += test_xmlTextReaderGetAttributeNs();
32718 test_ret += test_xmlTextReaderGetErrorHandler();
32719 test_ret += test_xmlTextReaderGetParserColumnNumber();
32720 test_ret += test_xmlTextReaderGetParserLineNumber();
32721 test_ret += test_xmlTextReaderGetParserProp();
32722 test_ret += test_xmlTextReaderGetRemainder();
32723 test_ret += test_xmlTextReaderHasAttributes();
32724 test_ret += test_xmlTextReaderHasValue();
32725 test_ret += test_xmlTextReaderIsDefault();
32726 test_ret += test_xmlTextReaderIsEmptyElement();
32727 test_ret += test_xmlTextReaderIsNamespaceDecl();
32728 test_ret += test_xmlTextReaderIsValid();
32729 test_ret += test_xmlTextReaderLocalName();
32730 test_ret += test_xmlTextReaderLocatorBaseURI();
32731 test_ret += test_xmlTextReaderLocatorLineNumber();
32732 test_ret += test_xmlTextReaderLookupNamespace();
32733 test_ret += test_xmlTextReaderMoveToAttribute();
32734 test_ret += test_xmlTextReaderMoveToAttributeNo();
32735 test_ret += test_xmlTextReaderMoveToAttributeNs();
32736 test_ret += test_xmlTextReaderMoveToElement();
32737 test_ret += test_xmlTextReaderMoveToFirstAttribute();
32738 test_ret += test_xmlTextReaderMoveToNextAttribute();
32739 test_ret += test_xmlTextReaderName();
32740 test_ret += test_xmlTextReaderNamespaceUri();
32741 test_ret += test_xmlTextReaderNext();
32742 test_ret += test_xmlTextReaderNextSibling();
32743 test_ret += test_xmlTextReaderNodeType();
32744 test_ret += test_xmlTextReaderNormalization();
32745 test_ret += test_xmlTextReaderPrefix();
32746 test_ret += test_xmlTextReaderPreserve();
32747 test_ret += test_xmlTextReaderPreservePattern();
32748 test_ret += test_xmlTextReaderQuoteChar();
32749 test_ret += test_xmlTextReaderRead();
32750 test_ret += test_xmlTextReaderReadAttributeValue();
32751 test_ret += test_xmlTextReaderReadState();
32752 test_ret += test_xmlTextReaderRelaxNGSetSchema();
32753 test_ret += test_xmlTextReaderRelaxNGValidate();
32754 test_ret += test_xmlTextReaderSchemaValidate();
32755 test_ret += test_xmlTextReaderSchemaValidateCtxt();
32756 test_ret += test_xmlTextReaderSetErrorHandler();
32757 test_ret += test_xmlTextReaderSetParserProp();
32758 test_ret += test_xmlTextReaderSetSchema();
32759 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32760 test_ret += test_xmlTextReaderSetup();
32761 test_ret += test_xmlTextReaderStandalone();
32762 test_ret += test_xmlTextReaderValue();
32763 test_ret += test_xmlTextReaderXmlLang();
32766 printf("Module xmlreader: %d errors\n", test_ret);
32771 test_xmlExpCtxtNbCons(void) {
32774 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32777 xmlExpCtxtPtr ctxt; /* an expression context */
32780 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32781 mem_base = xmlMemBlocks();
32782 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32784 ret_val = xmlExpCtxtNbCons(ctxt);
32785 desret_int(ret_val);
32787 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32788 xmlResetLastError();
32789 if (mem_base != xmlMemBlocks()) {
32790 printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32791 xmlMemBlocks() - mem_base);
32793 printf(" %d", n_ctxt);
32805 test_xmlExpCtxtNbNodes(void) {
32808 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32811 xmlExpCtxtPtr ctxt; /* an expression context */
32814 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32815 mem_base = xmlMemBlocks();
32816 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32818 ret_val = xmlExpCtxtNbNodes(ctxt);
32819 desret_int(ret_val);
32821 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32822 xmlResetLastError();
32823 if (mem_base != xmlMemBlocks()) {
32824 printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32825 xmlMemBlocks() - mem_base);
32827 printf(" %d", n_ctxt);
32839 test_xmlExpDump(void) {
32842 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32844 xmlBufferPtr buf; /* a buffer to receive the output */
32846 xmlExpNodePtr expr; /* the compiled expression */
32849 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32850 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32851 mem_base = xmlMemBlocks();
32852 buf = gen_xmlBufferPtr(n_buf, 0);
32853 expr = gen_xmlExpNodePtr(n_expr, 1);
32855 xmlExpDump(buf, expr);
32857 des_xmlBufferPtr(n_buf, buf, 0);
32858 des_xmlExpNodePtr(n_expr, expr, 1);
32859 xmlResetLastError();
32860 if (mem_base != xmlMemBlocks()) {
32861 printf("Leak of %d blocks found in xmlExpDump",
32862 xmlMemBlocks() - mem_base);
32864 printf(" %d", n_buf);
32865 printf(" %d", n_expr);
32878 test_xmlExpExpDerive(void) {
32882 /* missing type support */
32888 test_xmlExpGetLanguage(void) {
32891 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32894 xmlExpCtxtPtr ctxt; /* the expression context */
32896 xmlExpNodePtr exp; /* the expression */
32898 xmlChar ** langList; /* 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_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
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 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32911 len = gen_int(n_len, 3);
32913 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, 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_langList, (const xmlChar **)langList, 2);
32919 des_int(n_len, len, 3);
32920 xmlResetLastError();
32921 if (mem_base != xmlMemBlocks()) {
32922 printf("Leak of %d blocks found in xmlExpGetLanguage",
32923 xmlMemBlocks() - mem_base);
32925 printf(" %d", n_ctxt);
32926 printf(" %d", n_exp);
32927 printf(" %d", n_langList);
32928 printf(" %d", n_len);
32943 test_xmlExpGetStart(void) {
32946 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32949 xmlExpCtxtPtr ctxt; /* the expression context */
32951 xmlExpNodePtr exp; /* the expression */
32953 xmlChar ** tokList; /* where to store the tokens */
32955 int len; /* the allocated lenght of @list */
32958 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32959 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32960 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32961 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32962 mem_base = xmlMemBlocks();
32963 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32964 exp = gen_xmlExpNodePtr(n_exp, 1);
32965 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32966 len = gen_int(n_len, 3);
32968 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32969 desret_int(ret_val);
32971 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32972 des_xmlExpNodePtr(n_exp, exp, 1);
32973 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32974 des_int(n_len, len, 3);
32975 xmlResetLastError();
32976 if (mem_base != xmlMemBlocks()) {
32977 printf("Leak of %d blocks found in xmlExpGetStart",
32978 xmlMemBlocks() - mem_base);
32980 printf(" %d", n_ctxt);
32981 printf(" %d", n_exp);
32982 printf(" %d", n_tokList);
32983 printf(" %d", n_len);
32998 test_xmlExpIsNillable(void) {
33001 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33004 xmlExpNodePtr exp; /* the expression */
33007 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33008 mem_base = xmlMemBlocks();
33009 exp = gen_xmlExpNodePtr(n_exp, 0);
33011 ret_val = xmlExpIsNillable(exp);
33012 desret_int(ret_val);
33014 des_xmlExpNodePtr(n_exp, exp, 0);
33015 xmlResetLastError();
33016 if (mem_base != xmlMemBlocks()) {
33017 printf("Leak of %d blocks found in xmlExpIsNillable",
33018 xmlMemBlocks() - mem_base);
33020 printf(" %d", n_exp);
33032 test_xmlExpMaxToken(void) {
33035 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33038 xmlExpNodePtr expr; /* a compiled expression */
33041 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33042 mem_base = xmlMemBlocks();
33043 expr = gen_xmlExpNodePtr(n_expr, 0);
33045 ret_val = xmlExpMaxToken(expr);
33046 desret_int(ret_val);
33048 des_xmlExpNodePtr(n_expr, expr, 0);
33049 xmlResetLastError();
33050 if (mem_base != xmlMemBlocks()) {
33051 printf("Leak of %d blocks found in xmlExpMaxToken",
33052 xmlMemBlocks() - mem_base);
33054 printf(" %d", n_expr);
33066 test_xmlExpNewAtom(void) {
33070 /* missing type support */
33076 test_xmlExpNewCtxt(void) {
33080 /* missing type support */
33086 test_xmlExpNewOr(void) {
33090 /* missing type support */
33096 test_xmlExpNewRange(void) {
33100 /* missing type support */
33106 test_xmlExpNewSeq(void) {
33110 /* missing type support */
33116 test_xmlExpParse(void) {
33120 /* missing type support */
33126 test_xmlExpRef(void) {
33129 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33131 xmlExpNodePtr exp; /* the expression */
33134 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33135 mem_base = xmlMemBlocks();
33136 exp = gen_xmlExpNodePtr(n_exp, 0);
33140 des_xmlExpNodePtr(n_exp, exp, 0);
33141 xmlResetLastError();
33142 if (mem_base != xmlMemBlocks()) {
33143 printf("Leak of %d blocks found in xmlExpRef",
33144 xmlMemBlocks() - mem_base);
33146 printf(" %d", n_exp);
33158 test_xmlExpStringDerive(void) {
33162 /* missing type support */
33168 test_xmlExpSubsume(void) {
33171 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33174 xmlExpCtxtPtr ctxt; /* the expressions context */
33176 xmlExpNodePtr exp; /* the englobing expression */
33178 xmlExpNodePtr sub; /* the subexpression */
33181 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33182 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33183 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33184 mem_base = xmlMemBlocks();
33185 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33186 exp = gen_xmlExpNodePtr(n_exp, 1);
33187 sub = gen_xmlExpNodePtr(n_sub, 2);
33189 ret_val = xmlExpSubsume(ctxt, exp, sub);
33190 desret_int(ret_val);
33192 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33193 des_xmlExpNodePtr(n_exp, exp, 1);
33194 des_xmlExpNodePtr(n_sub, sub, 2);
33195 xmlResetLastError();
33196 if (mem_base != xmlMemBlocks()) {
33197 printf("Leak of %d blocks found in xmlExpSubsume",
33198 xmlMemBlocks() - mem_base);
33200 printf(" %d", n_ctxt);
33201 printf(" %d", n_exp);
33202 printf(" %d", n_sub);
33214 #ifdef LIBXML_REGEXP_ENABLED
33216 #define gen_nb_xmlRegExecCtxtPtr 1
33217 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33220 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33226 test_xmlRegExecErrInfo(void) {
33229 #if defined(LIBXML_REGEXP_ENABLED)
33232 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33234 xmlChar ** string; /* return value for the error string */
33236 int * nbval; /* pointer to the number of accepted values IN/OUT */
33238 int * nbneg; /* return number of negative transitions */
33240 xmlChar ** values; /* pointer to the array of acceptable values */
33242 int * terminal; /* return value if this was a terminal state */
33245 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33246 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33247 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33248 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33249 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33250 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33251 mem_base = xmlMemBlocks();
33252 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33253 string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33254 nbval = gen_int_ptr(n_nbval, 2);
33255 nbneg = gen_int_ptr(n_nbneg, 3);
33256 values = gen_xmlChar_ptr_ptr(n_values, 4);
33257 terminal = gen_int_ptr(n_terminal, 5);
33259 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33260 desret_int(ret_val);
33262 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33263 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33264 des_int_ptr(n_nbval, nbval, 2);
33265 des_int_ptr(n_nbneg, nbneg, 3);
33266 des_xmlChar_ptr_ptr(n_values, values, 4);
33267 des_int_ptr(n_terminal, terminal, 5);
33268 xmlResetLastError();
33269 if (mem_base != xmlMemBlocks()) {
33270 printf("Leak of %d blocks found in xmlRegExecErrInfo",
33271 xmlMemBlocks() - mem_base);
33273 printf(" %d", n_exec);
33274 printf(" %d", n_string);
33275 printf(" %d", n_nbval);
33276 printf(" %d", n_nbneg);
33277 printf(" %d", n_values);
33278 printf(" %d", n_terminal);
33295 test_xmlRegExecNextValues(void) {
33298 #if defined(LIBXML_REGEXP_ENABLED)
33301 xmlRegExecCtxtPtr exec; /* a regexp execution context */
33303 int * nbval; /* pointer to the number of accepted values IN/OUT */
33305 int * nbneg; /* return number of negative transitions */
33307 xmlChar ** values; /* pointer to the array of acceptable values */
33309 int * terminal; /* return value if this was a terminal state */
33312 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33313 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33314 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33315 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33316 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33317 mem_base = xmlMemBlocks();
33318 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33319 nbval = gen_int_ptr(n_nbval, 1);
33320 nbneg = gen_int_ptr(n_nbneg, 2);
33321 values = gen_xmlChar_ptr_ptr(n_values, 3);
33322 terminal = gen_int_ptr(n_terminal, 4);
33324 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33325 desret_int(ret_val);
33327 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33328 des_int_ptr(n_nbval, nbval, 1);
33329 des_int_ptr(n_nbneg, nbneg, 2);
33330 des_xmlChar_ptr_ptr(n_values, values, 3);
33331 des_int_ptr(n_terminal, terminal, 4);
33332 xmlResetLastError();
33333 if (mem_base != xmlMemBlocks()) {
33334 printf("Leak of %d blocks found in xmlRegExecNextValues",
33335 xmlMemBlocks() - mem_base);
33337 printf(" %d", n_exec);
33338 printf(" %d", n_nbval);
33339 printf(" %d", n_nbneg);
33340 printf(" %d", n_values);
33341 printf(" %d", n_terminal);
33357 test_xmlRegExecPushString(void) {
33360 #if defined(LIBXML_REGEXP_ENABLED)
33363 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33365 xmlChar * value; /* a string token input */
33367 void * data; /* data associated to the token to reuse in callbacks */
33370 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33371 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33372 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33373 mem_base = xmlMemBlocks();
33374 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33375 value = gen_const_xmlChar_ptr(n_value, 1);
33376 data = gen_userdata(n_data, 2);
33378 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33379 desret_int(ret_val);
33381 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33382 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33383 des_userdata(n_data, data, 2);
33384 xmlResetLastError();
33385 if (mem_base != xmlMemBlocks()) {
33386 printf("Leak of %d blocks found in xmlRegExecPushString",
33387 xmlMemBlocks() - mem_base);
33389 printf(" %d", n_exec);
33390 printf(" %d", n_value);
33391 printf(" %d", n_data);
33405 test_xmlRegExecPushString2(void) {
33408 #if defined(LIBXML_REGEXP_ENABLED)
33411 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33413 xmlChar * value; /* the first string token input */
33415 xmlChar * value2; /* the second string token input */
33417 void * data; /* data associated to the token to reuse in callbacks */
33420 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33421 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33422 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33423 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33424 mem_base = xmlMemBlocks();
33425 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33426 value = gen_const_xmlChar_ptr(n_value, 1);
33427 value2 = gen_const_xmlChar_ptr(n_value2, 2);
33428 data = gen_userdata(n_data, 3);
33430 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33431 desret_int(ret_val);
33433 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33434 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33435 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33436 des_userdata(n_data, data, 3);
33437 xmlResetLastError();
33438 if (mem_base != xmlMemBlocks()) {
33439 printf("Leak of %d blocks found in xmlRegExecPushString2",
33440 xmlMemBlocks() - mem_base);
33442 printf(" %d", n_exec);
33443 printf(" %d", n_value);
33444 printf(" %d", n_value2);
33445 printf(" %d", n_data);
33458 #ifdef LIBXML_REGEXP_ENABLED
33460 #define gen_nb_xmlRegexpPtr 1
33461 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33464 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33470 test_xmlRegNewExecCtxt(void) {
33474 /* missing type support */
33480 test_xmlRegexpCompile(void) {
33484 /* missing type support */
33490 test_xmlRegexpExec(void) {
33493 #if defined(LIBXML_REGEXP_ENABLED)
33496 xmlRegexpPtr comp; /* the compiled regular expression */
33498 xmlChar * content; /* the value to check against the regular expression */
33501 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33502 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33503 mem_base = xmlMemBlocks();
33504 comp = gen_xmlRegexpPtr(n_comp, 0);
33505 content = gen_const_xmlChar_ptr(n_content, 1);
33507 ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33508 desret_int(ret_val);
33510 des_xmlRegexpPtr(n_comp, comp, 0);
33511 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33512 xmlResetLastError();
33513 if (mem_base != xmlMemBlocks()) {
33514 printf("Leak of %d blocks found in xmlRegexpExec",
33515 xmlMemBlocks() - mem_base);
33517 printf(" %d", n_comp);
33518 printf(" %d", n_content);
33531 test_xmlRegexpIsDeterminist(void) {
33534 #if defined(LIBXML_REGEXP_ENABLED)
33537 xmlRegexpPtr comp; /* the compiled regular expression */
33540 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33541 mem_base = xmlMemBlocks();
33542 comp = gen_xmlRegexpPtr(n_comp, 0);
33544 ret_val = xmlRegexpIsDeterminist(comp);
33545 desret_int(ret_val);
33547 des_xmlRegexpPtr(n_comp, comp, 0);
33548 xmlResetLastError();
33549 if (mem_base != xmlMemBlocks()) {
33550 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33551 xmlMemBlocks() - mem_base);
33553 printf(" %d", n_comp);
33565 test_xmlRegexpPrint(void) {
33568 #if defined(LIBXML_REGEXP_ENABLED)
33570 FILE * output; /* the file for the output debug */
33572 xmlRegexpPtr regexp; /* the compiled regexp */
33575 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33576 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33577 mem_base = xmlMemBlocks();
33578 output = gen_FILE_ptr(n_output, 0);
33579 regexp = gen_xmlRegexpPtr(n_regexp, 1);
33581 xmlRegexpPrint(output, regexp);
33583 des_FILE_ptr(n_output, output, 0);
33584 des_xmlRegexpPtr(n_regexp, regexp, 1);
33585 xmlResetLastError();
33586 if (mem_base != xmlMemBlocks()) {
33587 printf("Leak of %d blocks found in xmlRegexpPrint",
33588 xmlMemBlocks() - mem_base);
33590 printf(" %d", n_output);
33591 printf(" %d", n_regexp);
33603 test_xmlregexp(void) {
33606 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33607 test_ret += test_xmlExpCtxtNbCons();
33608 test_ret += test_xmlExpCtxtNbNodes();
33609 test_ret += test_xmlExpDump();
33610 test_ret += test_xmlExpExpDerive();
33611 test_ret += test_xmlExpGetLanguage();
33612 test_ret += test_xmlExpGetStart();
33613 test_ret += test_xmlExpIsNillable();
33614 test_ret += test_xmlExpMaxToken();
33615 test_ret += test_xmlExpNewAtom();
33616 test_ret += test_xmlExpNewCtxt();
33617 test_ret += test_xmlExpNewOr();
33618 test_ret += test_xmlExpNewRange();
33619 test_ret += test_xmlExpNewSeq();
33620 test_ret += test_xmlExpParse();
33621 test_ret += test_xmlExpRef();
33622 test_ret += test_xmlExpStringDerive();
33623 test_ret += test_xmlExpSubsume();
33624 test_ret += test_xmlRegExecErrInfo();
33625 test_ret += test_xmlRegExecNextValues();
33626 test_ret += test_xmlRegExecPushString();
33627 test_ret += test_xmlRegExecPushString2();
33628 test_ret += test_xmlRegNewExecCtxt();
33629 test_ret += test_xmlRegexpCompile();
33630 test_ret += test_xmlRegexpExec();
33631 test_ret += test_xmlRegexpIsDeterminist();
33632 test_ret += test_xmlRegexpPrint();
33635 printf("Module xmlregexp: %d errors\n", test_ret);
33638 #ifdef LIBXML_OUTPUT_ENABLED
33640 #define gen_nb_xmlSaveCtxtPtr 1
33641 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33644 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33650 test_xmlSaveClose(void) {
33653 #if defined(LIBXML_OUTPUT_ENABLED)
33656 xmlSaveCtxtPtr ctxt; /* a document saving context */
33659 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33660 mem_base = xmlMemBlocks();
33661 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33663 ret_val = xmlSaveClose(ctxt);
33664 desret_int(ret_val);
33666 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33667 xmlResetLastError();
33668 if (mem_base != xmlMemBlocks()) {
33669 printf("Leak of %d blocks found in xmlSaveClose",
33670 xmlMemBlocks() - mem_base);
33672 printf(" %d", n_ctxt);
33684 test_xmlSaveDoc(void) {
33687 #if defined(LIBXML_OUTPUT_ENABLED)
33690 xmlSaveCtxtPtr ctxt; /* a document saving context */
33692 xmlDocPtr doc; /* a document */
33695 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33696 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33697 mem_base = xmlMemBlocks();
33698 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33699 doc = gen_xmlDocPtr(n_doc, 1);
33701 ret_val = xmlSaveDoc(ctxt, doc);
33702 desret_long(ret_val);
33704 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33705 des_xmlDocPtr(n_doc, doc, 1);
33706 xmlResetLastError();
33707 if (mem_base != xmlMemBlocks()) {
33708 printf("Leak of %d blocks found in xmlSaveDoc",
33709 xmlMemBlocks() - mem_base);
33711 printf(" %d", n_ctxt);
33712 printf(" %d", n_doc);
33725 test_xmlSaveFlush(void) {
33728 #if defined(LIBXML_OUTPUT_ENABLED)
33731 xmlSaveCtxtPtr ctxt; /* a document saving context */
33734 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33735 mem_base = xmlMemBlocks();
33736 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33738 ret_val = xmlSaveFlush(ctxt);
33739 desret_int(ret_val);
33741 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33742 xmlResetLastError();
33743 if (mem_base != xmlMemBlocks()) {
33744 printf("Leak of %d blocks found in xmlSaveFlush",
33745 xmlMemBlocks() - mem_base);
33747 printf(" %d", n_ctxt);
33759 test_xmlSaveSetAttrEscape(void) {
33763 /* missing type support */
33769 test_xmlSaveSetEscape(void) {
33773 /* missing type support */
33779 test_xmlSaveToBuffer(void) {
33783 /* missing type support */
33789 test_xmlSaveToFd(void) {
33793 /* missing type support */
33799 test_xmlSaveToFilename(void) {
33803 /* missing type support */
33809 test_xmlSaveTree(void) {
33812 #if defined(LIBXML_OUTPUT_ENABLED)
33815 xmlSaveCtxtPtr ctxt; /* a document saving context */
33817 xmlNodePtr node; /* the top node of the subtree to save */
33820 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33821 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33822 mem_base = xmlMemBlocks();
33823 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33824 node = gen_xmlNodePtr(n_node, 1);
33826 ret_val = xmlSaveTree(ctxt, node);
33827 desret_long(ret_val);
33829 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33830 des_xmlNodePtr(n_node, node, 1);
33831 xmlResetLastError();
33832 if (mem_base != xmlMemBlocks()) {
33833 printf("Leak of %d blocks found in xmlSaveTree",
33834 xmlMemBlocks() - mem_base);
33836 printf(" %d", n_ctxt);
33837 printf(" %d", n_node);
33849 test_xmlsave(void) {
33852 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33853 test_ret += test_xmlSaveClose();
33854 test_ret += test_xmlSaveDoc();
33855 test_ret += test_xmlSaveFlush();
33856 test_ret += test_xmlSaveSetAttrEscape();
33857 test_ret += test_xmlSaveSetEscape();
33858 test_ret += test_xmlSaveToBuffer();
33859 test_ret += test_xmlSaveToFd();
33860 test_ret += test_xmlSaveToFilename();
33861 test_ret += test_xmlSaveTree();
33864 printf("Module xmlsave: %d errors\n", test_ret);
33869 test_xmlSchemaDump(void) {
33872 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33874 FILE * output; /* the file output */
33876 xmlSchemaPtr schema; /* a schema structure */
33879 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33880 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33881 mem_base = xmlMemBlocks();
33882 output = gen_FILE_ptr(n_output, 0);
33883 schema = gen_xmlSchemaPtr(n_schema, 1);
33885 xmlSchemaDump(output, schema);
33887 des_FILE_ptr(n_output, output, 0);
33888 des_xmlSchemaPtr(n_schema, schema, 1);
33889 xmlResetLastError();
33890 if (mem_base != xmlMemBlocks()) {
33891 printf("Leak of %d blocks found in xmlSchemaDump",
33892 xmlMemBlocks() - mem_base);
33894 printf(" %d", n_output);
33895 printf(" %d", n_schema);
33906 #ifdef LIBXML_SCHEMAS_ENABLED
33908 #define gen_nb_xmlSchemaParserCtxtPtr 1
33909 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33912 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33916 #ifdef LIBXML_SCHEMAS_ENABLED
33918 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33919 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33922 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33926 #ifdef LIBXML_SCHEMAS_ENABLED
33928 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33929 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33932 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33938 test_xmlSchemaGetParserErrors(void) {
33941 #if defined(LIBXML_SCHEMAS_ENABLED)
33944 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33946 xmlSchemaValidityErrorFunc * err; /* the error callback result */
33948 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33950 void ** ctx; /* contextual data for the callbacks result */
33953 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;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_xmlSchemaParserCtxtPtr(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 = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33964 desret_int(ret_val);
33966 des_xmlSchemaParserCtxtPtr(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 xmlSchemaGetParserErrors",
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_xmlSchemaGetValidErrors(void) {
33996 #if defined(LIBXML_SCHEMAS_ENABLED)
33999 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34001 xmlSchemaValidityErrorFunc * err; /* the error function result */
34003 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34005 void ** ctx; /* the functions context result */
34008 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34009 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34010 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34011 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34012 mem_base = xmlMemBlocks();
34013 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34014 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34015 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34016 ctx = gen_void_ptr_ptr(n_ctx, 3);
34018 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34019 desret_int(ret_val);
34021 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34022 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34023 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34024 des_void_ptr_ptr(n_ctx, ctx, 3);
34025 xmlResetLastError();
34026 if (mem_base != xmlMemBlocks()) {
34027 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34028 xmlMemBlocks() - mem_base);
34030 printf(" %d", n_ctxt);
34031 printf(" %d", n_err);
34032 printf(" %d", n_warn);
34033 printf(" %d", n_ctx);
34048 test_xmlSchemaIsValid(void) {
34051 #if defined(LIBXML_SCHEMAS_ENABLED)
34054 xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34057 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34058 mem_base = xmlMemBlocks();
34059 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34061 ret_val = xmlSchemaIsValid(ctxt);
34062 desret_int(ret_val);
34064 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34065 xmlResetLastError();
34066 if (mem_base != xmlMemBlocks()) {
34067 printf("Leak of %d blocks found in xmlSchemaIsValid",
34068 xmlMemBlocks() - mem_base);
34070 printf(" %d", n_ctxt);
34082 test_xmlSchemaNewDocParserCtxt(void) {
34085 #if defined(LIBXML_SCHEMAS_ENABLED)
34087 xmlSchemaParserCtxtPtr ret_val;
34088 xmlDocPtr doc; /* a preparsed document tree */
34091 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34092 mem_base = xmlMemBlocks();
34093 doc = gen_xmlDocPtr(n_doc, 0);
34095 ret_val = xmlSchemaNewDocParserCtxt(doc);
34096 desret_xmlSchemaParserCtxtPtr(ret_val);
34098 des_xmlDocPtr(n_doc, doc, 0);
34099 xmlResetLastError();
34100 if (mem_base != xmlMemBlocks()) {
34101 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34102 xmlMemBlocks() - mem_base);
34104 printf(" %d", n_doc);
34116 test_xmlSchemaNewMemParserCtxt(void) {
34119 #if defined(LIBXML_SCHEMAS_ENABLED)
34121 xmlSchemaParserCtxtPtr ret_val;
34122 char * buffer; /* a pointer to a char array containing the schemas */
34124 int size; /* the size of the array */
34127 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34128 for (n_size = 0;n_size < gen_nb_int;n_size++) {
34129 mem_base = xmlMemBlocks();
34130 buffer = gen_const_char_ptr(n_buffer, 0);
34131 size = gen_int(n_size, 1);
34133 ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34134 desret_xmlSchemaParserCtxtPtr(ret_val);
34136 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34137 des_int(n_size, size, 1);
34138 xmlResetLastError();
34139 if (mem_base != xmlMemBlocks()) {
34140 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34141 xmlMemBlocks() - mem_base);
34143 printf(" %d", n_buffer);
34144 printf(" %d", n_size);
34157 test_xmlSchemaNewParserCtxt(void) {
34160 #if defined(LIBXML_SCHEMAS_ENABLED)
34162 xmlSchemaParserCtxtPtr ret_val;
34163 char * URL; /* the location of the schema */
34166 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34167 mem_base = xmlMemBlocks();
34168 URL = gen_const_char_ptr(n_URL, 0);
34170 ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34171 desret_xmlSchemaParserCtxtPtr(ret_val);
34173 des_const_char_ptr(n_URL, (const char *)URL, 0);
34174 xmlResetLastError();
34175 if (mem_base != xmlMemBlocks()) {
34176 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34177 xmlMemBlocks() - mem_base);
34179 printf(" %d", n_URL);
34191 test_xmlSchemaNewValidCtxt(void) {
34195 /* missing type support */
34201 test_xmlSchemaParse(void) {
34205 /* missing type support */
34209 #ifdef LIBXML_SCHEMAS_ENABLED
34211 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34212 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34215 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34221 test_xmlSchemaSAXPlug(void) {
34225 /* missing type support */
34229 #ifdef LIBXML_SCHEMAS_ENABLED
34231 #define gen_nb_xmlSchemaSAXPlugPtr 1
34232 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34235 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34241 test_xmlSchemaSAXUnplug(void) {
34244 #if defined(LIBXML_SCHEMAS_ENABLED)
34247 xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34250 for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34251 mem_base = xmlMemBlocks();
34252 plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34254 ret_val = xmlSchemaSAXUnplug(plug);
34255 desret_int(ret_val);
34257 des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34258 xmlResetLastError();
34259 if (mem_base != xmlMemBlocks()) {
34260 printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34261 xmlMemBlocks() - mem_base);
34263 printf(" %d", n_plug);
34275 test_xmlSchemaSetParserErrors(void) {
34279 /* missing type support */
34285 test_xmlSchemaSetParserStructuredErrors(void) {
34289 /* missing type support */
34295 test_xmlSchemaSetValidErrors(void) {
34299 /* missing type support */
34305 test_xmlSchemaSetValidOptions(void) {
34308 #if defined(LIBXML_SCHEMAS_ENABLED)
34311 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34313 int options; /* a combination of xmlSchemaValidOption */
34316 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34317 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34318 mem_base = xmlMemBlocks();
34319 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34320 options = gen_int(n_options, 1);
34322 ret_val = xmlSchemaSetValidOptions(ctxt, options);
34323 desret_int(ret_val);
34325 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34326 des_int(n_options, options, 1);
34327 xmlResetLastError();
34328 if (mem_base != xmlMemBlocks()) {
34329 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34330 xmlMemBlocks() - mem_base);
34332 printf(" %d", n_ctxt);
34333 printf(" %d", n_options);
34346 test_xmlSchemaSetValidStructuredErrors(void) {
34350 /* missing type support */
34356 test_xmlSchemaValidCtxtGetOptions(void) {
34359 #if defined(LIBXML_SCHEMAS_ENABLED)
34362 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34365 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34366 mem_base = xmlMemBlocks();
34367 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34369 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34370 desret_int(ret_val);
34372 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34373 xmlResetLastError();
34374 if (mem_base != xmlMemBlocks()) {
34375 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34376 xmlMemBlocks() - mem_base);
34378 printf(" %d", n_ctxt);
34390 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34393 #if defined(LIBXML_SCHEMAS_ENABLED)
34395 xmlParserCtxtPtr ret_val;
34396 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34399 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34400 mem_base = xmlMemBlocks();
34401 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34403 ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34404 desret_xmlParserCtxtPtr(ret_val);
34406 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34407 xmlResetLastError();
34408 if (mem_base != xmlMemBlocks()) {
34409 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34410 xmlMemBlocks() - mem_base);
34412 printf(" %d", n_ctxt);
34424 test_xmlSchemaValidateDoc(void) {
34427 #if defined(LIBXML_SCHEMAS_ENABLED)
34430 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34432 xmlDocPtr doc; /* a parsed document tree */
34435 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34436 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34437 mem_base = xmlMemBlocks();
34438 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34439 doc = gen_xmlDocPtr(n_doc, 1);
34441 ret_val = xmlSchemaValidateDoc(ctxt, doc);
34442 desret_int(ret_val);
34444 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34445 des_xmlDocPtr(n_doc, doc, 1);
34446 xmlResetLastError();
34447 if (mem_base != xmlMemBlocks()) {
34448 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34449 xmlMemBlocks() - mem_base);
34451 printf(" %d", n_ctxt);
34452 printf(" %d", n_doc);
34465 test_xmlSchemaValidateFile(void) {
34468 #if defined(LIBXML_SCHEMAS_ENABLED)
34471 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34473 const char * filename; /* the URI of the instance */
34475 int options; /* a future set of options, currently unused */
34478 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34479 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34480 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34481 mem_base = xmlMemBlocks();
34482 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34483 filename = gen_filepath(n_filename, 1);
34484 options = gen_int(n_options, 2);
34486 ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34487 desret_int(ret_val);
34489 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34490 des_filepath(n_filename, filename, 1);
34491 des_int(n_options, options, 2);
34492 xmlResetLastError();
34493 if (mem_base != xmlMemBlocks()) {
34494 printf("Leak of %d blocks found in xmlSchemaValidateFile",
34495 xmlMemBlocks() - mem_base);
34497 printf(" %d", n_ctxt);
34498 printf(" %d", n_filename);
34499 printf(" %d", n_options);
34513 test_xmlSchemaValidateOneElement(void) {
34516 #if defined(LIBXML_SCHEMAS_ENABLED)
34519 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34521 xmlNodePtr elem; /* an element node */
34524 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34525 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34526 mem_base = xmlMemBlocks();
34527 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34528 elem = gen_xmlNodePtr(n_elem, 1);
34530 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34531 desret_int(ret_val);
34533 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34534 des_xmlNodePtr(n_elem, elem, 1);
34535 xmlResetLastError();
34536 if (mem_base != xmlMemBlocks()) {
34537 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34538 xmlMemBlocks() - mem_base);
34540 printf(" %d", n_ctxt);
34541 printf(" %d", n_elem);
34554 test_xmlSchemaValidateStream(void) {
34557 #if defined(LIBXML_SCHEMAS_ENABLED)
34560 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34562 xmlParserInputBufferPtr input; /* the input to use for reading the data */
34564 xmlCharEncoding enc; /* an optional encoding information */
34566 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34568 void * user_data; /* the context to provide to the SAX handler. */
34571 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34572 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34573 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34574 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34575 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34576 mem_base = xmlMemBlocks();
34577 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34578 input = gen_xmlParserInputBufferPtr(n_input, 1);
34579 enc = gen_xmlCharEncoding(n_enc, 2);
34580 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34581 user_data = gen_userdata(n_user_data, 4);
34583 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34584 desret_int(ret_val);
34586 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34587 des_xmlParserInputBufferPtr(n_input, input, 1);
34588 des_xmlCharEncoding(n_enc, enc, 2);
34589 des_xmlSAXHandlerPtr(n_sax, sax, 3);
34590 des_userdata(n_user_data, user_data, 4);
34591 xmlResetLastError();
34592 if (mem_base != xmlMemBlocks()) {
34593 printf("Leak of %d blocks found in xmlSchemaValidateStream",
34594 xmlMemBlocks() - mem_base);
34596 printf(" %d", n_ctxt);
34597 printf(" %d", n_input);
34598 printf(" %d", n_enc);
34599 printf(" %d", n_sax);
34600 printf(" %d", n_user_data);
34615 test_xmlschemas(void) {
34618 if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34619 test_ret += test_xmlSchemaDump();
34620 test_ret += test_xmlSchemaGetParserErrors();
34621 test_ret += test_xmlSchemaGetValidErrors();
34622 test_ret += test_xmlSchemaIsValid();
34623 test_ret += test_xmlSchemaNewDocParserCtxt();
34624 test_ret += test_xmlSchemaNewMemParserCtxt();
34625 test_ret += test_xmlSchemaNewParserCtxt();
34626 test_ret += test_xmlSchemaNewValidCtxt();
34627 test_ret += test_xmlSchemaParse();
34628 test_ret += test_xmlSchemaSAXPlug();
34629 test_ret += test_xmlSchemaSAXUnplug();
34630 test_ret += test_xmlSchemaSetParserErrors();
34631 test_ret += test_xmlSchemaSetParserStructuredErrors();
34632 test_ret += test_xmlSchemaSetValidErrors();
34633 test_ret += test_xmlSchemaSetValidOptions();
34634 test_ret += test_xmlSchemaSetValidStructuredErrors();
34635 test_ret += test_xmlSchemaValidCtxtGetOptions();
34636 test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34637 test_ret += test_xmlSchemaValidateDoc();
34638 test_ret += test_xmlSchemaValidateFile();
34639 test_ret += test_xmlSchemaValidateOneElement();
34640 test_ret += test_xmlSchemaValidateStream();
34643 printf("Module xmlschemas: %d errors\n", test_ret);
34646 #ifdef LIBXML_SCHEMAS_ENABLED
34648 #define gen_nb_xmlSchemaFacetPtr 1
34649 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34652 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34656 #ifdef LIBXML_SCHEMAS_ENABLED
34658 #define gen_nb_xmlSchemaTypePtr 1
34659 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34662 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34668 test_xmlSchemaCheckFacet(void) {
34671 #if defined(LIBXML_SCHEMAS_ENABLED)
34674 xmlSchemaFacetPtr facet; /* the facet */
34676 xmlSchemaTypePtr typeDecl; /* the schema type definition */
34678 xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34680 xmlChar * name; /* the optional name of the type */
34683 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34684 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34685 for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34686 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34687 mem_base = xmlMemBlocks();
34688 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34689 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34690 pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34691 name = gen_const_xmlChar_ptr(n_name, 3);
34693 ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34694 desret_int(ret_val);
34696 des_xmlSchemaFacetPtr(n_facet, facet, 0);
34697 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34698 des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34699 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34700 xmlResetLastError();
34701 if (mem_base != xmlMemBlocks()) {
34702 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34703 xmlMemBlocks() - mem_base);
34705 printf(" %d", n_facet);
34706 printf(" %d", n_typeDecl);
34707 printf(" %d", n_pctxt);
34708 printf(" %d", n_name);
34723 test_xmlSchemaCleanupTypes(void) {
34726 #if defined(LIBXML_SCHEMAS_ENABLED)
34729 xmlSchemaCleanupTypes();
34731 xmlResetLastError();
34740 test_xmlSchemaCollapseString(void) {
34743 #if defined(LIBXML_SCHEMAS_ENABLED)
34746 xmlChar * value; /* a value */
34749 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34750 mem_base = xmlMemBlocks();
34751 value = gen_const_xmlChar_ptr(n_value, 0);
34753 ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34754 desret_xmlChar_ptr(ret_val);
34756 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34757 xmlResetLastError();
34758 if (mem_base != xmlMemBlocks()) {
34759 printf("Leak of %d blocks found in xmlSchemaCollapseString",
34760 xmlMemBlocks() - mem_base);
34762 printf(" %d", n_value);
34772 #ifdef LIBXML_SCHEMAS_ENABLED
34774 #define gen_nb_xmlSchemaValPtr 1
34775 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34778 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34784 test_xmlSchemaCompareValues(void) {
34787 #if defined(LIBXML_SCHEMAS_ENABLED)
34790 xmlSchemaValPtr x; /* a first value */
34792 xmlSchemaValPtr y; /* a second value */
34795 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34796 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34797 mem_base = xmlMemBlocks();
34798 x = gen_xmlSchemaValPtr(n_x, 0);
34799 y = gen_xmlSchemaValPtr(n_y, 1);
34801 ret_val = xmlSchemaCompareValues(x, y);
34802 desret_int(ret_val);
34804 des_xmlSchemaValPtr(n_x, x, 0);
34805 des_xmlSchemaValPtr(n_y, y, 1);
34806 xmlResetLastError();
34807 if (mem_base != xmlMemBlocks()) {
34808 printf("Leak of %d blocks found in xmlSchemaCompareValues",
34809 xmlMemBlocks() - mem_base);
34811 printf(" %d", n_x);
34812 printf(" %d", n_y);
34825 test_xmlSchemaCompareValuesWhtsp(void) {
34828 #if defined(LIBXML_SCHEMAS_ENABLED)
34831 xmlSchemaValPtr x; /* a first value */
34833 xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34835 xmlSchemaValPtr y; /* a second value */
34837 xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34840 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34841 for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34842 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34843 for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34844 mem_base = xmlMemBlocks();
34845 x = gen_xmlSchemaValPtr(n_x, 0);
34846 xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34847 y = gen_xmlSchemaValPtr(n_y, 2);
34848 yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34850 ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34851 desret_int(ret_val);
34853 des_xmlSchemaValPtr(n_x, x, 0);
34854 des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34855 des_xmlSchemaValPtr(n_y, y, 2);
34856 des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34857 xmlResetLastError();
34858 if (mem_base != xmlMemBlocks()) {
34859 printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34860 xmlMemBlocks() - mem_base);
34862 printf(" %d", n_x);
34863 printf(" %d", n_xws);
34864 printf(" %d", n_y);
34865 printf(" %d", n_yws);
34880 test_xmlSchemaCopyValue(void) {
34884 /* missing type support */
34890 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34893 #if defined(LIBXML_SCHEMAS_ENABLED)
34895 xmlSchemaTypePtr ret_val;
34896 xmlSchemaTypePtr type; /* the built-in simple type. */
34899 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34900 mem_base = xmlMemBlocks();
34901 type = gen_xmlSchemaTypePtr(n_type, 0);
34903 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34904 desret_xmlSchemaTypePtr(ret_val);
34906 des_xmlSchemaTypePtr(n_type, type, 0);
34907 xmlResetLastError();
34908 if (mem_base != xmlMemBlocks()) {
34909 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34910 xmlMemBlocks() - mem_base);
34912 printf(" %d", n_type);
34924 test_xmlSchemaGetBuiltInType(void) {
34927 #if defined(LIBXML_SCHEMAS_ENABLED)
34928 xmlSchemaTypePtr ret_val;
34929 xmlSchemaValType type; /* the type of the built in type */
34932 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34933 type = gen_xmlSchemaValType(n_type, 0);
34935 ret_val = xmlSchemaGetBuiltInType(type);
34936 desret_xmlSchemaTypePtr(ret_val);
34938 des_xmlSchemaValType(n_type, type, 0);
34939 xmlResetLastError();
34949 test_xmlSchemaGetCanonValue(void) {
34952 #if defined(LIBXML_SCHEMAS_ENABLED)
34955 xmlSchemaValPtr val; /* the precomputed value */
34957 xmlChar ** retValue; /* the returned value */
34960 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34961 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34962 mem_base = xmlMemBlocks();
34963 val = gen_xmlSchemaValPtr(n_val, 0);
34964 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34966 ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34967 desret_int(ret_val);
34969 des_xmlSchemaValPtr(n_val, val, 0);
34970 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34971 xmlResetLastError();
34972 if (mem_base != xmlMemBlocks()) {
34973 printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34974 xmlMemBlocks() - mem_base);
34976 printf(" %d", n_val);
34977 printf(" %d", n_retValue);
34990 test_xmlSchemaGetCanonValueWhtsp(void) {
34993 #if defined(LIBXML_SCHEMAS_ENABLED)
34996 xmlSchemaValPtr val; /* the precomputed value */
34998 xmlChar ** retValue; /* the returned value */
35000 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35003 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35004 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35005 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35006 mem_base = xmlMemBlocks();
35007 val = gen_xmlSchemaValPtr(n_val, 0);
35008 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35009 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35011 ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35012 desret_int(ret_val);
35014 des_xmlSchemaValPtr(n_val, val, 0);
35015 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35016 des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35017 xmlResetLastError();
35018 if (mem_base != xmlMemBlocks()) {
35019 printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35020 xmlMemBlocks() - mem_base);
35022 printf(" %d", n_val);
35023 printf(" %d", n_retValue);
35024 printf(" %d", n_ws);
35038 test_xmlSchemaGetFacetValueAsULong(void) {
35041 #if defined(LIBXML_SCHEMAS_ENABLED)
35043 unsigned long ret_val;
35044 xmlSchemaFacetPtr facet; /* an schemas type facet */
35047 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35048 mem_base = xmlMemBlocks();
35049 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35051 ret_val = xmlSchemaGetFacetValueAsULong(facet);
35052 desret_unsigned_long(ret_val);
35054 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35055 xmlResetLastError();
35056 if (mem_base != xmlMemBlocks()) {
35057 printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35058 xmlMemBlocks() - mem_base);
35060 printf(" %d", n_facet);
35072 test_xmlSchemaGetPredefinedType(void) {
35075 #if defined(LIBXML_SCHEMAS_ENABLED)
35077 xmlSchemaTypePtr ret_val;
35078 xmlChar * name; /* the type name */
35080 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35083 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35084 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35085 mem_base = xmlMemBlocks();
35086 name = gen_const_xmlChar_ptr(n_name, 0);
35087 ns = gen_const_xmlChar_ptr(n_ns, 1);
35089 ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35090 desret_xmlSchemaTypePtr(ret_val);
35092 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35093 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35094 xmlResetLastError();
35095 if (mem_base != xmlMemBlocks()) {
35096 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35097 xmlMemBlocks() - mem_base);
35099 printf(" %d", n_name);
35100 printf(" %d", n_ns);
35113 test_xmlSchemaGetValType(void) {
35116 #if defined(LIBXML_SCHEMAS_ENABLED)
35118 xmlSchemaValType ret_val;
35119 xmlSchemaValPtr val; /* a schemas value */
35122 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35123 mem_base = xmlMemBlocks();
35124 val = gen_xmlSchemaValPtr(n_val, 0);
35126 ret_val = xmlSchemaGetValType(val);
35127 desret_xmlSchemaValType(ret_val);
35129 des_xmlSchemaValPtr(n_val, val, 0);
35130 xmlResetLastError();
35131 if (mem_base != xmlMemBlocks()) {
35132 printf("Leak of %d blocks found in xmlSchemaGetValType",
35133 xmlMemBlocks() - mem_base);
35135 printf(" %d", n_val);
35147 test_xmlSchemaInitTypes(void) {
35150 #if defined(LIBXML_SCHEMAS_ENABLED)
35153 xmlSchemaInitTypes();
35155 xmlResetLastError();
35164 test_xmlSchemaIsBuiltInTypeFacet(void) {
35167 #if defined(LIBXML_SCHEMAS_ENABLED)
35170 xmlSchemaTypePtr type; /* the built-in type */
35172 int facetType; /* the facet type */
35175 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35176 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35177 mem_base = xmlMemBlocks();
35178 type = gen_xmlSchemaTypePtr(n_type, 0);
35179 facetType = gen_int(n_facetType, 1);
35181 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35182 desret_int(ret_val);
35184 des_xmlSchemaTypePtr(n_type, type, 0);
35185 des_int(n_facetType, facetType, 1);
35186 xmlResetLastError();
35187 if (mem_base != xmlMemBlocks()) {
35188 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35189 xmlMemBlocks() - mem_base);
35191 printf(" %d", n_type);
35192 printf(" %d", n_facetType);
35205 test_xmlSchemaNewFacet(void) {
35209 /* missing type support */
35215 test_xmlSchemaNewNOTATIONValue(void) {
35219 /* missing type support */
35225 test_xmlSchemaNewQNameValue(void) {
35229 /* missing type support */
35235 test_xmlSchemaNewStringValue(void) {
35239 /* missing type support */
35243 #ifdef LIBXML_SCHEMAS_ENABLED
35245 #define gen_nb_xmlSchemaValPtr_ptr 1
35246 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35249 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35255 test_xmlSchemaValPredefTypeNode(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 = xmlSchemaValPredefTypeNode(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 xmlSchemaValPredefTypeNode",
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_xmlSchemaValPredefTypeNodeNoNorm(void) {
35313 #if defined(LIBXML_SCHEMAS_ENABLED)
35316 xmlSchemaTypePtr type; /* the predefined type */
35318 xmlChar * value; /* the value to check */
35320 xmlSchemaValPtr * val; /* the return computed value */
35322 xmlNodePtr node; /* the node containing the value */
35325 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35326 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35327 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35328 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35329 mem_base = xmlMemBlocks();
35330 type = gen_xmlSchemaTypePtr(n_type, 0);
35331 value = gen_const_xmlChar_ptr(n_value, 1);
35332 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35333 node = gen_xmlNodePtr(n_node, 3);
35335 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35336 desret_int(ret_val);
35338 des_xmlSchemaTypePtr(n_type, type, 0);
35339 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35340 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35341 des_xmlNodePtr(n_node, node, 3);
35342 xmlResetLastError();
35343 if (mem_base != xmlMemBlocks()) {
35344 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35345 xmlMemBlocks() - mem_base);
35347 printf(" %d", n_type);
35348 printf(" %d", n_value);
35349 printf(" %d", n_val);
35350 printf(" %d", n_node);
35365 test_xmlSchemaValidateFacet(void) {
35368 #if defined(LIBXML_SCHEMAS_ENABLED)
35371 xmlSchemaTypePtr base; /* the base type */
35373 xmlSchemaFacetPtr facet; /* the facet to check */
35375 xmlChar * value; /* the lexical repr of the value to validate */
35377 xmlSchemaValPtr val; /* the precomputed value */
35380 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35381 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35382 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35383 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35384 mem_base = xmlMemBlocks();
35385 base = gen_xmlSchemaTypePtr(n_base, 0);
35386 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35387 value = gen_const_xmlChar_ptr(n_value, 2);
35388 val = gen_xmlSchemaValPtr(n_val, 3);
35390 ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35391 desret_int(ret_val);
35393 des_xmlSchemaTypePtr(n_base, base, 0);
35394 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35395 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35396 des_xmlSchemaValPtr(n_val, val, 3);
35397 xmlResetLastError();
35398 if (mem_base != xmlMemBlocks()) {
35399 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35400 xmlMemBlocks() - mem_base);
35402 printf(" %d", n_base);
35403 printf(" %d", n_facet);
35404 printf(" %d", n_value);
35405 printf(" %d", n_val);
35420 test_xmlSchemaValidateFacetWhtsp(void) {
35423 #if defined(LIBXML_SCHEMAS_ENABLED)
35426 xmlSchemaFacetPtr facet; /* the facet to check */
35428 xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35430 xmlSchemaValType valType; /* the built-in type of the value */
35432 xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35434 xmlSchemaValPtr val; /* the precomputed value */
35436 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35439 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35440 for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35441 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35442 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35443 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35444 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35445 mem_base = xmlMemBlocks();
35446 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35447 fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35448 valType = gen_xmlSchemaValType(n_valType, 2);
35449 value = gen_const_xmlChar_ptr(n_value, 3);
35450 val = gen_xmlSchemaValPtr(n_val, 4);
35451 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35453 ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35454 desret_int(ret_val);
35456 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35457 des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35458 des_xmlSchemaValType(n_valType, valType, 2);
35459 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35460 des_xmlSchemaValPtr(n_val, val, 4);
35461 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35462 xmlResetLastError();
35463 if (mem_base != xmlMemBlocks()) {
35464 printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35465 xmlMemBlocks() - mem_base);
35467 printf(" %d", n_facet);
35468 printf(" %d", n_fws);
35469 printf(" %d", n_valType);
35470 printf(" %d", n_value);
35471 printf(" %d", n_val);
35472 printf(" %d", n_ws);
35489 test_xmlSchemaValidateLengthFacet(void) {
35492 #if defined(LIBXML_SCHEMAS_ENABLED)
35495 xmlSchemaTypePtr type; /* the built-in type */
35497 xmlSchemaFacetPtr facet; /* the facet to check */
35499 xmlChar * value; /* the lexical repr. of the value to be validated */
35501 xmlSchemaValPtr val; /* the precomputed value */
35503 unsigned long * length; /* the actual length of the value */
35506 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35507 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35508 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35509 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35510 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35511 mem_base = xmlMemBlocks();
35512 type = gen_xmlSchemaTypePtr(n_type, 0);
35513 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35514 value = gen_const_xmlChar_ptr(n_value, 2);
35515 val = gen_xmlSchemaValPtr(n_val, 3);
35516 length = gen_unsigned_long_ptr(n_length, 4);
35518 ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35519 desret_int(ret_val);
35521 des_xmlSchemaTypePtr(n_type, type, 0);
35522 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35523 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35524 des_xmlSchemaValPtr(n_val, val, 3);
35525 des_unsigned_long_ptr(n_length, length, 4);
35526 xmlResetLastError();
35527 if (mem_base != xmlMemBlocks()) {
35528 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35529 xmlMemBlocks() - mem_base);
35531 printf(" %d", n_type);
35532 printf(" %d", n_facet);
35533 printf(" %d", n_value);
35534 printf(" %d", n_val);
35535 printf(" %d", n_length);
35551 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35554 #if defined(LIBXML_SCHEMAS_ENABLED)
35557 xmlSchemaFacetPtr facet; /* the facet to check */
35559 xmlSchemaValType valType; /* the built-in type */
35561 xmlChar * value; /* the lexical repr. of the value to be validated */
35563 xmlSchemaValPtr val; /* the precomputed value */
35565 unsigned long * length; /* the actual length of the value */
35567 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35570 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35571 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35572 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35573 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35574 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35575 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35576 mem_base = xmlMemBlocks();
35577 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35578 valType = gen_xmlSchemaValType(n_valType, 1);
35579 value = gen_const_xmlChar_ptr(n_value, 2);
35580 val = gen_xmlSchemaValPtr(n_val, 3);
35581 length = gen_unsigned_long_ptr(n_length, 4);
35582 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35584 ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35585 desret_int(ret_val);
35587 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35588 des_xmlSchemaValType(n_valType, valType, 1);
35589 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35590 des_xmlSchemaValPtr(n_val, val, 3);
35591 des_unsigned_long_ptr(n_length, length, 4);
35592 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35593 xmlResetLastError();
35594 if (mem_base != xmlMemBlocks()) {
35595 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35596 xmlMemBlocks() - mem_base);
35598 printf(" %d", n_facet);
35599 printf(" %d", n_valType);
35600 printf(" %d", n_value);
35601 printf(" %d", n_val);
35602 printf(" %d", n_length);
35603 printf(" %d", n_ws);
35620 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35623 #if defined(LIBXML_SCHEMAS_ENABLED)
35626 xmlSchemaFacetPtr facet; /* the facet to check */
35628 xmlChar * value; /* the lexical repr of the value to validate */
35630 unsigned long actualLen; /* the number of list items */
35632 unsigned long * expectedLen; /* the resulting expected number of list items */
35635 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35636 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35637 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35638 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35639 mem_base = xmlMemBlocks();
35640 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35641 value = gen_const_xmlChar_ptr(n_value, 1);
35642 actualLen = gen_unsigned_long(n_actualLen, 2);
35643 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35645 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35646 desret_int(ret_val);
35648 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35649 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35650 des_unsigned_long(n_actualLen, actualLen, 2);
35651 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35652 xmlResetLastError();
35653 if (mem_base != xmlMemBlocks()) {
35654 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35655 xmlMemBlocks() - mem_base);
35657 printf(" %d", n_facet);
35658 printf(" %d", n_value);
35659 printf(" %d", n_actualLen);
35660 printf(" %d", n_expectedLen);
35675 test_xmlSchemaValidatePredefinedType(void) {
35678 #if defined(LIBXML_SCHEMAS_ENABLED)
35681 xmlSchemaTypePtr type; /* the predefined type */
35683 xmlChar * value; /* the value to check */
35685 xmlSchemaValPtr * val; /* the return computed value */
35688 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35689 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35690 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35691 mem_base = xmlMemBlocks();
35692 type = gen_xmlSchemaTypePtr(n_type, 0);
35693 value = gen_const_xmlChar_ptr(n_value, 1);
35694 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35696 ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35697 desret_int(ret_val);
35699 des_xmlSchemaTypePtr(n_type, type, 0);
35700 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35701 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35702 xmlResetLastError();
35703 if (mem_base != xmlMemBlocks()) {
35704 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35705 xmlMemBlocks() - mem_base);
35707 printf(" %d", n_type);
35708 printf(" %d", n_value);
35709 printf(" %d", n_val);
35723 test_xmlSchemaValueAppend(void) {
35726 #if defined(LIBXML_SCHEMAS_ENABLED)
35729 xmlSchemaValPtr prev; /* the value */
35731 xmlSchemaValPtr cur; /* the value to be appended */
35734 for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35735 for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35736 mem_base = xmlMemBlocks();
35737 prev = gen_xmlSchemaValPtr(n_prev, 0);
35738 cur = gen_xmlSchemaValPtr(n_cur, 1);
35740 ret_val = xmlSchemaValueAppend(prev, cur);
35741 desret_int(ret_val);
35743 des_xmlSchemaValPtr(n_prev, prev, 0);
35744 des_xmlSchemaValPtr(n_cur, cur, 1);
35745 xmlResetLastError();
35746 if (mem_base != xmlMemBlocks()) {
35747 printf("Leak of %d blocks found in xmlSchemaValueAppend",
35748 xmlMemBlocks() - mem_base);
35750 printf(" %d", n_prev);
35751 printf(" %d", n_cur);
35764 test_xmlSchemaValueGetAsBoolean(void) {
35767 #if defined(LIBXML_SCHEMAS_ENABLED)
35770 xmlSchemaValPtr val; /* the value */
35773 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35774 mem_base = xmlMemBlocks();
35775 val = gen_xmlSchemaValPtr(n_val, 0);
35777 ret_val = xmlSchemaValueGetAsBoolean(val);
35778 desret_int(ret_val);
35780 des_xmlSchemaValPtr(n_val, val, 0);
35781 xmlResetLastError();
35782 if (mem_base != xmlMemBlocks()) {
35783 printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35784 xmlMemBlocks() - mem_base);
35786 printf(" %d", n_val);
35798 test_xmlSchemaValueGetAsString(void) {
35801 #if defined(LIBXML_SCHEMAS_ENABLED)
35803 const xmlChar * ret_val;
35804 xmlSchemaValPtr val; /* the value */
35807 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35808 mem_base = xmlMemBlocks();
35809 val = gen_xmlSchemaValPtr(n_val, 0);
35811 ret_val = xmlSchemaValueGetAsString(val);
35812 desret_const_xmlChar_ptr(ret_val);
35814 des_xmlSchemaValPtr(n_val, val, 0);
35815 xmlResetLastError();
35816 if (mem_base != xmlMemBlocks()) {
35817 printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35818 xmlMemBlocks() - mem_base);
35820 printf(" %d", n_val);
35832 test_xmlSchemaValueGetNext(void) {
35836 /* missing type support */
35842 test_xmlSchemaWhiteSpaceReplace(void) {
35845 #if defined(LIBXML_SCHEMAS_ENABLED)
35848 xmlChar * value; /* a value */
35851 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35852 mem_base = xmlMemBlocks();
35853 value = gen_const_xmlChar_ptr(n_value, 0);
35855 ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35856 desret_xmlChar_ptr(ret_val);
35858 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35859 xmlResetLastError();
35860 if (mem_base != xmlMemBlocks()) {
35861 printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35862 xmlMemBlocks() - mem_base);
35864 printf(" %d", n_value);
35875 test_xmlschemastypes(void) {
35878 if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35879 test_ret += test_xmlSchemaCheckFacet();
35880 test_ret += test_xmlSchemaCleanupTypes();
35881 test_ret += test_xmlSchemaCollapseString();
35882 test_ret += test_xmlSchemaCompareValues();
35883 test_ret += test_xmlSchemaCompareValuesWhtsp();
35884 test_ret += test_xmlSchemaCopyValue();
35885 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35886 test_ret += test_xmlSchemaGetBuiltInType();
35887 test_ret += test_xmlSchemaGetCanonValue();
35888 test_ret += test_xmlSchemaGetCanonValueWhtsp();
35889 test_ret += test_xmlSchemaGetFacetValueAsULong();
35890 test_ret += test_xmlSchemaGetPredefinedType();
35891 test_ret += test_xmlSchemaGetValType();
35892 test_ret += test_xmlSchemaInitTypes();
35893 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35894 test_ret += test_xmlSchemaNewFacet();
35895 test_ret += test_xmlSchemaNewNOTATIONValue();
35896 test_ret += test_xmlSchemaNewQNameValue();
35897 test_ret += test_xmlSchemaNewStringValue();
35898 test_ret += test_xmlSchemaValPredefTypeNode();
35899 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35900 test_ret += test_xmlSchemaValidateFacet();
35901 test_ret += test_xmlSchemaValidateFacetWhtsp();
35902 test_ret += test_xmlSchemaValidateLengthFacet();
35903 test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35904 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35905 test_ret += test_xmlSchemaValidatePredefinedType();
35906 test_ret += test_xmlSchemaValueAppend();
35907 test_ret += test_xmlSchemaValueGetAsBoolean();
35908 test_ret += test_xmlSchemaValueGetAsString();
35909 test_ret += test_xmlSchemaValueGetNext();
35910 test_ret += test_xmlSchemaWhiteSpaceReplace();
35913 printf("Module xmlschemastypes: %d errors\n", test_ret);
35918 test_xmlCharStrdup(void) {
35923 char * cur; /* the input char * */
35926 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35927 mem_base = xmlMemBlocks();
35928 cur = gen_const_char_ptr(n_cur, 0);
35930 ret_val = xmlCharStrdup((const char *)cur);
35931 desret_xmlChar_ptr(ret_val);
35933 des_const_char_ptr(n_cur, (const char *)cur, 0);
35934 xmlResetLastError();
35935 if (mem_base != xmlMemBlocks()) {
35936 printf("Leak of %d blocks found in xmlCharStrdup",
35937 xmlMemBlocks() - mem_base);
35939 printf(" %d", n_cur);
35950 test_xmlCharStrndup(void) {
35955 char * cur; /* the input char * */
35957 int len; /* the len of @cur */
35960 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35961 for (n_len = 0;n_len < gen_nb_int;n_len++) {
35962 mem_base = xmlMemBlocks();
35963 cur = gen_const_char_ptr(n_cur, 0);
35964 len = gen_int(n_len, 1);
35966 ret_val = xmlCharStrndup((const char *)cur, len);
35967 desret_xmlChar_ptr(ret_val);
35969 des_const_char_ptr(n_cur, (const char *)cur, 0);
35970 des_int(n_len, len, 1);
35971 xmlResetLastError();
35972 if (mem_base != xmlMemBlocks()) {
35973 printf("Leak of %d blocks found in xmlCharStrndup",
35974 xmlMemBlocks() - mem_base);
35976 printf(" %d", n_cur);
35977 printf(" %d", n_len);
35989 test_xmlCheckUTF8(void) {
35994 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35997 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35998 mem_base = xmlMemBlocks();
35999 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36001 ret_val = xmlCheckUTF8((const unsigned char *)utf);
36002 desret_int(ret_val);
36004 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36005 xmlResetLastError();
36006 if (mem_base != xmlMemBlocks()) {
36007 printf("Leak of %d blocks found in xmlCheckUTF8",
36008 xmlMemBlocks() - mem_base);
36010 printf(" %d", n_utf);
36021 test_xmlGetUTF8Char(void) {
36026 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36028 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. */
36031 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36032 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36033 mem_base = xmlMemBlocks();
36034 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36035 len = gen_int_ptr(n_len, 1);
36037 ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36038 desret_int(ret_val);
36040 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36041 des_int_ptr(n_len, len, 1);
36042 xmlResetLastError();
36043 if (mem_base != xmlMemBlocks()) {
36044 printf("Leak of %d blocks found in xmlGetUTF8Char",
36045 xmlMemBlocks() - mem_base);
36047 printf(" %d", n_utf);
36048 printf(" %d", n_len);
36060 test_xmlStrEqual(void) {
36065 xmlChar * str1; /* the first xmlChar * */
36067 xmlChar * str2; /* the second xmlChar * */
36070 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36071 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36072 mem_base = xmlMemBlocks();
36073 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36074 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36076 ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36077 desret_int(ret_val);
36079 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36080 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36081 xmlResetLastError();
36082 if (mem_base != xmlMemBlocks()) {
36083 printf("Leak of %d blocks found in xmlStrEqual",
36084 xmlMemBlocks() - mem_base);
36086 printf(" %d", n_str1);
36087 printf(" %d", n_str2);
36099 test_xmlStrPrintf(void) {
36103 /* missing type support */
36109 test_xmlStrQEqual(void) {
36114 xmlChar * pref; /* the prefix of the QName */
36116 xmlChar * name; /* the localname of the QName */
36118 xmlChar * str; /* the second xmlChar * */
36121 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36122 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36123 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36124 mem_base = xmlMemBlocks();
36125 pref = gen_const_xmlChar_ptr(n_pref, 0);
36126 name = gen_const_xmlChar_ptr(n_name, 1);
36127 str = gen_const_xmlChar_ptr(n_str, 2);
36129 ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36130 desret_int(ret_val);
36132 des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36133 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36134 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36135 xmlResetLastError();
36136 if (mem_base != xmlMemBlocks()) {
36137 printf("Leak of %d blocks found in xmlStrQEqual",
36138 xmlMemBlocks() - mem_base);
36140 printf(" %d", n_pref);
36141 printf(" %d", n_name);
36142 printf(" %d", n_str);
36155 test_xmlStrVPrintf(void) {
36159 /* missing type support */
36165 test_xmlStrcasecmp(void) {
36170 xmlChar * str1; /* the first xmlChar * */
36172 xmlChar * str2; /* the second xmlChar * */
36175 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36176 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36177 mem_base = xmlMemBlocks();
36178 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36179 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36181 ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36182 desret_int(ret_val);
36184 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36185 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36186 xmlResetLastError();
36187 if (mem_base != xmlMemBlocks()) {
36188 printf("Leak of %d blocks found in xmlStrcasecmp",
36189 xmlMemBlocks() - mem_base);
36191 printf(" %d", n_str1);
36192 printf(" %d", n_str2);
36204 test_xmlStrcasestr(void) {
36208 const xmlChar * ret_val;
36209 xmlChar * str; /* the xmlChar * array (haystack) */
36211 xmlChar * val; /* the xmlChar to search (needle) */
36214 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36215 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36216 mem_base = xmlMemBlocks();
36217 str = gen_const_xmlChar_ptr(n_str, 0);
36218 val = gen_const_xmlChar_ptr(n_val, 1);
36220 ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36221 desret_const_xmlChar_ptr(ret_val);
36223 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36224 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36225 xmlResetLastError();
36226 if (mem_base != xmlMemBlocks()) {
36227 printf("Leak of %d blocks found in xmlStrcasestr",
36228 xmlMemBlocks() - mem_base);
36230 printf(" %d", n_str);
36231 printf(" %d", n_val);
36243 test_xmlStrchr(void) {
36247 const xmlChar * ret_val;
36248 xmlChar * str; /* the xmlChar * array */
36250 xmlChar val; /* the xmlChar to search */
36253 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36254 for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36255 mem_base = xmlMemBlocks();
36256 str = gen_const_xmlChar_ptr(n_str, 0);
36257 val = gen_xmlChar(n_val, 1);
36259 ret_val = xmlStrchr((const xmlChar *)str, val);
36260 desret_const_xmlChar_ptr(ret_val);
36262 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36263 des_xmlChar(n_val, val, 1);
36264 xmlResetLastError();
36265 if (mem_base != xmlMemBlocks()) {
36266 printf("Leak of %d blocks found in xmlStrchr",
36267 xmlMemBlocks() - mem_base);
36269 printf(" %d", n_str);
36270 printf(" %d", n_val);
36282 test_xmlStrcmp(void) {
36287 xmlChar * str1; /* the first xmlChar * */
36289 xmlChar * str2; /* the second xmlChar * */
36292 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36293 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36294 mem_base = xmlMemBlocks();
36295 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36296 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36298 ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36299 desret_int(ret_val);
36301 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36302 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36303 xmlResetLastError();
36304 if (mem_base != xmlMemBlocks()) {
36305 printf("Leak of %d blocks found in xmlStrcmp",
36306 xmlMemBlocks() - mem_base);
36308 printf(" %d", n_str1);
36309 printf(" %d", n_str2);
36321 test_xmlStrdup(void) {
36326 xmlChar * cur; /* the input xmlChar * */
36329 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36330 mem_base = xmlMemBlocks();
36331 cur = gen_const_xmlChar_ptr(n_cur, 0);
36333 ret_val = xmlStrdup((const xmlChar *)cur);
36334 desret_xmlChar_ptr(ret_val);
36336 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36337 xmlResetLastError();
36338 if (mem_base != xmlMemBlocks()) {
36339 printf("Leak of %d blocks found in xmlStrdup",
36340 xmlMemBlocks() - mem_base);
36342 printf(" %d", n_cur);
36353 test_xmlStrlen(void) {
36358 xmlChar * str; /* the xmlChar * array */
36361 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36362 mem_base = xmlMemBlocks();
36363 str = gen_const_xmlChar_ptr(n_str, 0);
36365 ret_val = xmlStrlen((const xmlChar *)str);
36366 desret_int(ret_val);
36368 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36369 xmlResetLastError();
36370 if (mem_base != xmlMemBlocks()) {
36371 printf("Leak of %d blocks found in xmlStrlen",
36372 xmlMemBlocks() - mem_base);
36374 printf(" %d", n_str);
36385 test_xmlStrncasecmp(void) {
36390 xmlChar * str1; /* the first xmlChar * */
36392 xmlChar * str2; /* the second xmlChar * */
36394 int len; /* the max comparison length */
36397 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36398 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36399 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36400 mem_base = xmlMemBlocks();
36401 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36402 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36403 len = gen_int(n_len, 2);
36405 ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36406 desret_int(ret_val);
36408 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36409 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36410 des_int(n_len, len, 2);
36411 xmlResetLastError();
36412 if (mem_base != xmlMemBlocks()) {
36413 printf("Leak of %d blocks found in xmlStrncasecmp",
36414 xmlMemBlocks() - mem_base);
36416 printf(" %d", n_str1);
36417 printf(" %d", n_str2);
36418 printf(" %d", n_len);
36431 test_xmlStrncatNew(void) {
36436 xmlChar * str1; /* first xmlChar string */
36438 xmlChar * str2; /* second xmlChar string */
36440 int len; /* the len of @str2 or < 0 */
36443 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36444 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36445 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36446 mem_base = xmlMemBlocks();
36447 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36448 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36449 len = gen_int(n_len, 2);
36451 ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36452 desret_xmlChar_ptr(ret_val);
36454 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36455 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36456 des_int(n_len, len, 2);
36457 xmlResetLastError();
36458 if (mem_base != xmlMemBlocks()) {
36459 printf("Leak of %d blocks found in xmlStrncatNew",
36460 xmlMemBlocks() - mem_base);
36462 printf(" %d", n_str1);
36463 printf(" %d", n_str2);
36464 printf(" %d", n_len);
36477 test_xmlStrncmp(void) {
36482 xmlChar * str1; /* the first xmlChar * */
36484 xmlChar * str2; /* the second xmlChar * */
36486 int len; /* the max comparison length */
36489 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36490 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36491 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36492 mem_base = xmlMemBlocks();
36493 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36494 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36495 len = gen_int(n_len, 2);
36497 ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36498 desret_int(ret_val);
36500 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36501 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36502 des_int(n_len, len, 2);
36503 xmlResetLastError();
36504 if (mem_base != xmlMemBlocks()) {
36505 printf("Leak of %d blocks found in xmlStrncmp",
36506 xmlMemBlocks() - mem_base);
36508 printf(" %d", n_str1);
36509 printf(" %d", n_str2);
36510 printf(" %d", n_len);
36523 test_xmlStrndup(void) {
36528 xmlChar * cur; /* the input xmlChar * */
36530 int len; /* the len of @cur */
36533 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36534 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36535 mem_base = xmlMemBlocks();
36536 cur = gen_const_xmlChar_ptr(n_cur, 0);
36537 len = gen_int(n_len, 1);
36539 ret_val = xmlStrndup((const xmlChar *)cur, len);
36540 desret_xmlChar_ptr(ret_val);
36542 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36543 des_int(n_len, len, 1);
36544 xmlResetLastError();
36545 if (mem_base != xmlMemBlocks()) {
36546 printf("Leak of %d blocks found in xmlStrndup",
36547 xmlMemBlocks() - mem_base);
36549 printf(" %d", n_cur);
36550 printf(" %d", n_len);
36562 test_xmlStrstr(void) {
36566 const xmlChar * ret_val;
36567 xmlChar * str; /* the xmlChar * array (haystack) */
36569 xmlChar * val; /* the xmlChar to search (needle) */
36572 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36573 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36574 mem_base = xmlMemBlocks();
36575 str = gen_const_xmlChar_ptr(n_str, 0);
36576 val = gen_const_xmlChar_ptr(n_val, 1);
36578 ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36579 desret_const_xmlChar_ptr(ret_val);
36581 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36582 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36583 xmlResetLastError();
36584 if (mem_base != xmlMemBlocks()) {
36585 printf("Leak of %d blocks found in xmlStrstr",
36586 xmlMemBlocks() - mem_base);
36588 printf(" %d", n_str);
36589 printf(" %d", n_val);
36601 test_xmlStrsub(void) {
36606 xmlChar * str; /* the xmlChar * array (haystack) */
36608 int start; /* the index of the first char (zero based) */
36610 int len; /* the length of the substring */
36613 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36614 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36615 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36616 mem_base = xmlMemBlocks();
36617 str = gen_const_xmlChar_ptr(n_str, 0);
36618 start = gen_int(n_start, 1);
36619 len = gen_int(n_len, 2);
36621 ret_val = xmlStrsub((const xmlChar *)str, start, len);
36622 desret_xmlChar_ptr(ret_val);
36624 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36625 des_int(n_start, start, 1);
36626 des_int(n_len, len, 2);
36627 xmlResetLastError();
36628 if (mem_base != xmlMemBlocks()) {
36629 printf("Leak of %d blocks found in xmlStrsub",
36630 xmlMemBlocks() - mem_base);
36632 printf(" %d", n_str);
36633 printf(" %d", n_start);
36634 printf(" %d", n_len);
36647 test_xmlUTF8Charcmp(void) {
36652 xmlChar * utf1; /* pointer to first UTF8 char */
36654 xmlChar * utf2; /* pointer to second UTF8 char */
36657 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36658 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36659 mem_base = xmlMemBlocks();
36660 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36661 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36663 ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36664 desret_int(ret_val);
36666 des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36667 des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36668 xmlResetLastError();
36669 if (mem_base != xmlMemBlocks()) {
36670 printf("Leak of %d blocks found in xmlUTF8Charcmp",
36671 xmlMemBlocks() - mem_base);
36673 printf(" %d", n_utf1);
36674 printf(" %d", n_utf2);
36686 test_xmlUTF8Size(void) {
36691 xmlChar * utf; /* pointer to the UTF8 character */
36694 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36695 mem_base = xmlMemBlocks();
36696 utf = gen_const_xmlChar_ptr(n_utf, 0);
36698 ret_val = xmlUTF8Size((const xmlChar *)utf);
36699 desret_int(ret_val);
36701 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36702 xmlResetLastError();
36703 if (mem_base != xmlMemBlocks()) {
36704 printf("Leak of %d blocks found in xmlUTF8Size",
36705 xmlMemBlocks() - mem_base);
36707 printf(" %d", n_utf);
36718 test_xmlUTF8Strlen(void) {
36723 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36726 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36727 mem_base = xmlMemBlocks();
36728 utf = gen_const_xmlChar_ptr(n_utf, 0);
36730 ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36731 desret_int(ret_val);
36733 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36734 xmlResetLastError();
36735 if (mem_base != xmlMemBlocks()) {
36736 printf("Leak of %d blocks found in xmlUTF8Strlen",
36737 xmlMemBlocks() - mem_base);
36739 printf(" %d", n_utf);
36750 test_xmlUTF8Strloc(void) {
36755 xmlChar * utf; /* the input UTF8 * */
36757 xmlChar * utfchar; /* the UTF8 character to be found */
36760 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36761 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36762 mem_base = xmlMemBlocks();
36763 utf = gen_const_xmlChar_ptr(n_utf, 0);
36764 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36766 ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36767 desret_int(ret_val);
36769 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36770 des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36771 xmlResetLastError();
36772 if (mem_base != xmlMemBlocks()) {
36773 printf("Leak of %d blocks found in xmlUTF8Strloc",
36774 xmlMemBlocks() - mem_base);
36776 printf(" %d", n_utf);
36777 printf(" %d", n_utfchar);
36789 test_xmlUTF8Strndup(void) {
36794 xmlChar * utf; /* the input UTF8 * */
36796 int len; /* the len of @utf (in chars) */
36799 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36800 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36801 mem_base = xmlMemBlocks();
36802 utf = gen_const_xmlChar_ptr(n_utf, 0);
36803 len = gen_int(n_len, 1);
36805 ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36806 desret_xmlChar_ptr(ret_val);
36808 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36809 des_int(n_len, len, 1);
36810 xmlResetLastError();
36811 if (mem_base != xmlMemBlocks()) {
36812 printf("Leak of %d blocks found in xmlUTF8Strndup",
36813 xmlMemBlocks() - mem_base);
36815 printf(" %d", n_utf);
36816 printf(" %d", n_len);
36828 test_xmlUTF8Strpos(void) {
36832 const xmlChar * ret_val;
36833 xmlChar * utf; /* the input UTF8 * */
36835 int pos; /* the position of the desired UTF8 char (in chars) */
36838 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36839 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36840 mem_base = xmlMemBlocks();
36841 utf = gen_const_xmlChar_ptr(n_utf, 0);
36842 pos = gen_int(n_pos, 1);
36844 ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36845 desret_const_xmlChar_ptr(ret_val);
36847 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36848 des_int(n_pos, pos, 1);
36849 xmlResetLastError();
36850 if (mem_base != xmlMemBlocks()) {
36851 printf("Leak of %d blocks found in xmlUTF8Strpos",
36852 xmlMemBlocks() - mem_base);
36854 printf(" %d", n_utf);
36855 printf(" %d", n_pos);
36867 test_xmlUTF8Strsize(void) {
36872 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36874 int len; /* the number of characters in the array */
36877 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36878 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36879 mem_base = xmlMemBlocks();
36880 utf = gen_const_xmlChar_ptr(n_utf, 0);
36881 len = gen_int(n_len, 1);
36883 ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36884 desret_int(ret_val);
36886 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36887 des_int(n_len, len, 1);
36888 xmlResetLastError();
36889 if (mem_base != xmlMemBlocks()) {
36890 printf("Leak of %d blocks found in xmlUTF8Strsize",
36891 xmlMemBlocks() - mem_base);
36893 printf(" %d", n_utf);
36894 printf(" %d", n_len);
36906 test_xmlUTF8Strsub(void) {
36911 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36913 int start; /* relative pos of first char */
36915 int len; /* total number to copy */
36918 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36919 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36920 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36921 mem_base = xmlMemBlocks();
36922 utf = gen_const_xmlChar_ptr(n_utf, 0);
36923 start = gen_int(n_start, 1);
36924 len = gen_int(n_len, 2);
36926 ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36927 desret_xmlChar_ptr(ret_val);
36929 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36930 des_int(n_start, start, 1);
36931 des_int(n_len, len, 2);
36932 xmlResetLastError();
36933 if (mem_base != xmlMemBlocks()) {
36934 printf("Leak of %d blocks found in xmlUTF8Strsub",
36935 xmlMemBlocks() - mem_base);
36937 printf(" %d", n_utf);
36938 printf(" %d", n_start);
36939 printf(" %d", n_len);
36951 test_xmlstring(void) {
36954 if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36955 test_ret += test_xmlCharStrdup();
36956 test_ret += test_xmlCharStrndup();
36957 test_ret += test_xmlCheckUTF8();
36958 test_ret += test_xmlGetUTF8Char();
36959 test_ret += test_xmlStrEqual();
36960 test_ret += test_xmlStrPrintf();
36961 test_ret += test_xmlStrQEqual();
36962 test_ret += test_xmlStrVPrintf();
36963 test_ret += test_xmlStrcasecmp();
36964 test_ret += test_xmlStrcasestr();
36965 test_ret += test_xmlStrchr();
36966 test_ret += test_xmlStrcmp();
36967 test_ret += test_xmlStrdup();
36968 test_ret += test_xmlStrlen();
36969 test_ret += test_xmlStrncasecmp();
36970 test_ret += test_xmlStrncatNew();
36971 test_ret += test_xmlStrncmp();
36972 test_ret += test_xmlStrndup();
36973 test_ret += test_xmlStrstr();
36974 test_ret += test_xmlStrsub();
36975 test_ret += test_xmlUTF8Charcmp();
36976 test_ret += test_xmlUTF8Size();
36977 test_ret += test_xmlUTF8Strlen();
36978 test_ret += test_xmlUTF8Strloc();
36979 test_ret += test_xmlUTF8Strndup();
36980 test_ret += test_xmlUTF8Strpos();
36981 test_ret += test_xmlUTF8Strsize();
36982 test_ret += test_xmlUTF8Strsub();
36985 printf("Module xmlstring: %d errors\n", test_ret);
36990 test_xmlUCSIsAegeanNumbers(void) {
36993 #if defined(LIBXML_UNICODE_ENABLED)
36996 int code; /* UCS code point */
36999 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37000 mem_base = xmlMemBlocks();
37001 code = gen_int(n_code, 0);
37003 ret_val = xmlUCSIsAegeanNumbers(code);
37004 desret_int(ret_val);
37006 des_int(n_code, code, 0);
37007 xmlResetLastError();
37008 if (mem_base != xmlMemBlocks()) {
37009 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37010 xmlMemBlocks() - mem_base);
37012 printf(" %d", n_code);
37024 test_xmlUCSIsAlphabeticPresentationForms(void) {
37027 #if defined(LIBXML_UNICODE_ENABLED)
37030 int code; /* UCS code point */
37033 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37034 mem_base = xmlMemBlocks();
37035 code = gen_int(n_code, 0);
37037 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37038 desret_int(ret_val);
37040 des_int(n_code, code, 0);
37041 xmlResetLastError();
37042 if (mem_base != xmlMemBlocks()) {
37043 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37044 xmlMemBlocks() - mem_base);
37046 printf(" %d", n_code);
37058 test_xmlUCSIsArabic(void) {
37061 #if defined(LIBXML_UNICODE_ENABLED)
37064 int code; /* UCS code point */
37067 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37068 mem_base = xmlMemBlocks();
37069 code = gen_int(n_code, 0);
37071 ret_val = xmlUCSIsArabic(code);
37072 desret_int(ret_val);
37074 des_int(n_code, code, 0);
37075 xmlResetLastError();
37076 if (mem_base != xmlMemBlocks()) {
37077 printf("Leak of %d blocks found in xmlUCSIsArabic",
37078 xmlMemBlocks() - mem_base);
37080 printf(" %d", n_code);
37092 test_xmlUCSIsArabicPresentationFormsA(void) {
37095 #if defined(LIBXML_UNICODE_ENABLED)
37098 int code; /* UCS code point */
37101 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37102 mem_base = xmlMemBlocks();
37103 code = gen_int(n_code, 0);
37105 ret_val = xmlUCSIsArabicPresentationFormsA(code);
37106 desret_int(ret_val);
37108 des_int(n_code, code, 0);
37109 xmlResetLastError();
37110 if (mem_base != xmlMemBlocks()) {
37111 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37112 xmlMemBlocks() - mem_base);
37114 printf(" %d", n_code);
37126 test_xmlUCSIsArabicPresentationFormsB(void) {
37129 #if defined(LIBXML_UNICODE_ENABLED)
37132 int code; /* UCS code point */
37135 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37136 mem_base = xmlMemBlocks();
37137 code = gen_int(n_code, 0);
37139 ret_val = xmlUCSIsArabicPresentationFormsB(code);
37140 desret_int(ret_val);
37142 des_int(n_code, code, 0);
37143 xmlResetLastError();
37144 if (mem_base != xmlMemBlocks()) {
37145 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37146 xmlMemBlocks() - mem_base);
37148 printf(" %d", n_code);
37160 test_xmlUCSIsArmenian(void) {
37163 #if defined(LIBXML_UNICODE_ENABLED)
37166 int code; /* UCS code point */
37169 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37170 mem_base = xmlMemBlocks();
37171 code = gen_int(n_code, 0);
37173 ret_val = xmlUCSIsArmenian(code);
37174 desret_int(ret_val);
37176 des_int(n_code, code, 0);
37177 xmlResetLastError();
37178 if (mem_base != xmlMemBlocks()) {
37179 printf("Leak of %d blocks found in xmlUCSIsArmenian",
37180 xmlMemBlocks() - mem_base);
37182 printf(" %d", n_code);
37194 test_xmlUCSIsArrows(void) {
37197 #if defined(LIBXML_UNICODE_ENABLED)
37200 int code; /* UCS code point */
37203 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37204 mem_base = xmlMemBlocks();
37205 code = gen_int(n_code, 0);
37207 ret_val = xmlUCSIsArrows(code);
37208 desret_int(ret_val);
37210 des_int(n_code, code, 0);
37211 xmlResetLastError();
37212 if (mem_base != xmlMemBlocks()) {
37213 printf("Leak of %d blocks found in xmlUCSIsArrows",
37214 xmlMemBlocks() - mem_base);
37216 printf(" %d", n_code);
37228 test_xmlUCSIsBasicLatin(void) {
37231 #if defined(LIBXML_UNICODE_ENABLED)
37234 int code; /* UCS code point */
37237 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37238 mem_base = xmlMemBlocks();
37239 code = gen_int(n_code, 0);
37241 ret_val = xmlUCSIsBasicLatin(code);
37242 desret_int(ret_val);
37244 des_int(n_code, code, 0);
37245 xmlResetLastError();
37246 if (mem_base != xmlMemBlocks()) {
37247 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37248 xmlMemBlocks() - mem_base);
37250 printf(" %d", n_code);
37262 test_xmlUCSIsBengali(void) {
37265 #if defined(LIBXML_UNICODE_ENABLED)
37268 int code; /* UCS code point */
37271 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37272 mem_base = xmlMemBlocks();
37273 code = gen_int(n_code, 0);
37275 ret_val = xmlUCSIsBengali(code);
37276 desret_int(ret_val);
37278 des_int(n_code, code, 0);
37279 xmlResetLastError();
37280 if (mem_base != xmlMemBlocks()) {
37281 printf("Leak of %d blocks found in xmlUCSIsBengali",
37282 xmlMemBlocks() - mem_base);
37284 printf(" %d", n_code);
37296 test_xmlUCSIsBlock(void) {
37299 #if defined(LIBXML_UNICODE_ENABLED)
37302 int code; /* UCS code point */
37304 char * block; /* UCS block name */
37307 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37308 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37309 mem_base = xmlMemBlocks();
37310 code = gen_int(n_code, 0);
37311 block = gen_const_char_ptr(n_block, 1);
37313 ret_val = xmlUCSIsBlock(code, (const char *)block);
37314 desret_int(ret_val);
37316 des_int(n_code, code, 0);
37317 des_const_char_ptr(n_block, (const char *)block, 1);
37318 xmlResetLastError();
37319 if (mem_base != xmlMemBlocks()) {
37320 printf("Leak of %d blocks found in xmlUCSIsBlock",
37321 xmlMemBlocks() - mem_base);
37323 printf(" %d", n_code);
37324 printf(" %d", n_block);
37337 test_xmlUCSIsBlockElements(void) {
37340 #if defined(LIBXML_UNICODE_ENABLED)
37343 int code; /* UCS code point */
37346 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37347 mem_base = xmlMemBlocks();
37348 code = gen_int(n_code, 0);
37350 ret_val = xmlUCSIsBlockElements(code);
37351 desret_int(ret_val);
37353 des_int(n_code, code, 0);
37354 xmlResetLastError();
37355 if (mem_base != xmlMemBlocks()) {
37356 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37357 xmlMemBlocks() - mem_base);
37359 printf(" %d", n_code);
37371 test_xmlUCSIsBopomofo(void) {
37374 #if defined(LIBXML_UNICODE_ENABLED)
37377 int code; /* UCS code point */
37380 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37381 mem_base = xmlMemBlocks();
37382 code = gen_int(n_code, 0);
37384 ret_val = xmlUCSIsBopomofo(code);
37385 desret_int(ret_val);
37387 des_int(n_code, code, 0);
37388 xmlResetLastError();
37389 if (mem_base != xmlMemBlocks()) {
37390 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37391 xmlMemBlocks() - mem_base);
37393 printf(" %d", n_code);
37405 test_xmlUCSIsBopomofoExtended(void) {
37408 #if defined(LIBXML_UNICODE_ENABLED)
37411 int code; /* UCS code point */
37414 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37415 mem_base = xmlMemBlocks();
37416 code = gen_int(n_code, 0);
37418 ret_val = xmlUCSIsBopomofoExtended(code);
37419 desret_int(ret_val);
37421 des_int(n_code, code, 0);
37422 xmlResetLastError();
37423 if (mem_base != xmlMemBlocks()) {
37424 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37425 xmlMemBlocks() - mem_base);
37427 printf(" %d", n_code);
37439 test_xmlUCSIsBoxDrawing(void) {
37442 #if defined(LIBXML_UNICODE_ENABLED)
37445 int code; /* UCS code point */
37448 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37449 mem_base = xmlMemBlocks();
37450 code = gen_int(n_code, 0);
37452 ret_val = xmlUCSIsBoxDrawing(code);
37453 desret_int(ret_val);
37455 des_int(n_code, code, 0);
37456 xmlResetLastError();
37457 if (mem_base != xmlMemBlocks()) {
37458 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37459 xmlMemBlocks() - mem_base);
37461 printf(" %d", n_code);
37473 test_xmlUCSIsBraillePatterns(void) {
37476 #if defined(LIBXML_UNICODE_ENABLED)
37479 int code; /* UCS code point */
37482 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37483 mem_base = xmlMemBlocks();
37484 code = gen_int(n_code, 0);
37486 ret_val = xmlUCSIsBraillePatterns(code);
37487 desret_int(ret_val);
37489 des_int(n_code, code, 0);
37490 xmlResetLastError();
37491 if (mem_base != xmlMemBlocks()) {
37492 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37493 xmlMemBlocks() - mem_base);
37495 printf(" %d", n_code);
37507 test_xmlUCSIsBuhid(void) {
37510 #if defined(LIBXML_UNICODE_ENABLED)
37513 int code; /* UCS code point */
37516 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37517 mem_base = xmlMemBlocks();
37518 code = gen_int(n_code, 0);
37520 ret_val = xmlUCSIsBuhid(code);
37521 desret_int(ret_val);
37523 des_int(n_code, code, 0);
37524 xmlResetLastError();
37525 if (mem_base != xmlMemBlocks()) {
37526 printf("Leak of %d blocks found in xmlUCSIsBuhid",
37527 xmlMemBlocks() - mem_base);
37529 printf(" %d", n_code);
37541 test_xmlUCSIsByzantineMusicalSymbols(void) {
37544 #if defined(LIBXML_UNICODE_ENABLED)
37547 int code; /* UCS code point */
37550 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37551 mem_base = xmlMemBlocks();
37552 code = gen_int(n_code, 0);
37554 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37555 desret_int(ret_val);
37557 des_int(n_code, code, 0);
37558 xmlResetLastError();
37559 if (mem_base != xmlMemBlocks()) {
37560 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37561 xmlMemBlocks() - mem_base);
37563 printf(" %d", n_code);
37575 test_xmlUCSIsCJKCompatibility(void) {
37578 #if defined(LIBXML_UNICODE_ENABLED)
37581 int code; /* UCS code point */
37584 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37585 mem_base = xmlMemBlocks();
37586 code = gen_int(n_code, 0);
37588 ret_val = xmlUCSIsCJKCompatibility(code);
37589 desret_int(ret_val);
37591 des_int(n_code, code, 0);
37592 xmlResetLastError();
37593 if (mem_base != xmlMemBlocks()) {
37594 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37595 xmlMemBlocks() - mem_base);
37597 printf(" %d", n_code);
37609 test_xmlUCSIsCJKCompatibilityForms(void) {
37612 #if defined(LIBXML_UNICODE_ENABLED)
37615 int code; /* UCS code point */
37618 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37619 mem_base = xmlMemBlocks();
37620 code = gen_int(n_code, 0);
37622 ret_val = xmlUCSIsCJKCompatibilityForms(code);
37623 desret_int(ret_val);
37625 des_int(n_code, code, 0);
37626 xmlResetLastError();
37627 if (mem_base != xmlMemBlocks()) {
37628 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37629 xmlMemBlocks() - mem_base);
37631 printf(" %d", n_code);
37643 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37646 #if defined(LIBXML_UNICODE_ENABLED)
37649 int code; /* UCS code point */
37652 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37653 mem_base = xmlMemBlocks();
37654 code = gen_int(n_code, 0);
37656 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37657 desret_int(ret_val);
37659 des_int(n_code, code, 0);
37660 xmlResetLastError();
37661 if (mem_base != xmlMemBlocks()) {
37662 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37663 xmlMemBlocks() - mem_base);
37665 printf(" %d", n_code);
37677 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37680 #if defined(LIBXML_UNICODE_ENABLED)
37683 int code; /* UCS code point */
37686 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37687 mem_base = xmlMemBlocks();
37688 code = gen_int(n_code, 0);
37690 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37691 desret_int(ret_val);
37693 des_int(n_code, code, 0);
37694 xmlResetLastError();
37695 if (mem_base != xmlMemBlocks()) {
37696 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37697 xmlMemBlocks() - mem_base);
37699 printf(" %d", n_code);
37711 test_xmlUCSIsCJKRadicalsSupplement(void) {
37714 #if defined(LIBXML_UNICODE_ENABLED)
37717 int code; /* UCS code point */
37720 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37721 mem_base = xmlMemBlocks();
37722 code = gen_int(n_code, 0);
37724 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37725 desret_int(ret_val);
37727 des_int(n_code, code, 0);
37728 xmlResetLastError();
37729 if (mem_base != xmlMemBlocks()) {
37730 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37731 xmlMemBlocks() - mem_base);
37733 printf(" %d", n_code);
37745 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37748 #if defined(LIBXML_UNICODE_ENABLED)
37751 int code; /* UCS code point */
37754 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37755 mem_base = xmlMemBlocks();
37756 code = gen_int(n_code, 0);
37758 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37759 desret_int(ret_val);
37761 des_int(n_code, code, 0);
37762 xmlResetLastError();
37763 if (mem_base != xmlMemBlocks()) {
37764 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37765 xmlMemBlocks() - mem_base);
37767 printf(" %d", n_code);
37779 test_xmlUCSIsCJKUnifiedIdeographs(void) {
37782 #if defined(LIBXML_UNICODE_ENABLED)
37785 int code; /* UCS code point */
37788 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37789 mem_base = xmlMemBlocks();
37790 code = gen_int(n_code, 0);
37792 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37793 desret_int(ret_val);
37795 des_int(n_code, code, 0);
37796 xmlResetLastError();
37797 if (mem_base != xmlMemBlocks()) {
37798 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37799 xmlMemBlocks() - mem_base);
37801 printf(" %d", n_code);
37813 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37816 #if defined(LIBXML_UNICODE_ENABLED)
37819 int code; /* UCS code point */
37822 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37823 mem_base = xmlMemBlocks();
37824 code = gen_int(n_code, 0);
37826 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37827 desret_int(ret_val);
37829 des_int(n_code, code, 0);
37830 xmlResetLastError();
37831 if (mem_base != xmlMemBlocks()) {
37832 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37833 xmlMemBlocks() - mem_base);
37835 printf(" %d", n_code);
37847 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37850 #if defined(LIBXML_UNICODE_ENABLED)
37853 int code; /* UCS code point */
37856 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37857 mem_base = xmlMemBlocks();
37858 code = gen_int(n_code, 0);
37860 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37861 desret_int(ret_val);
37863 des_int(n_code, code, 0);
37864 xmlResetLastError();
37865 if (mem_base != xmlMemBlocks()) {
37866 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37867 xmlMemBlocks() - mem_base);
37869 printf(" %d", n_code);
37881 test_xmlUCSIsCat(void) {
37884 #if defined(LIBXML_UNICODE_ENABLED)
37887 int code; /* UCS code point */
37889 char * cat; /* UCS Category name */
37892 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37893 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37894 mem_base = xmlMemBlocks();
37895 code = gen_int(n_code, 0);
37896 cat = gen_const_char_ptr(n_cat, 1);
37898 ret_val = xmlUCSIsCat(code, (const char *)cat);
37899 desret_int(ret_val);
37901 des_int(n_code, code, 0);
37902 des_const_char_ptr(n_cat, (const char *)cat, 1);
37903 xmlResetLastError();
37904 if (mem_base != xmlMemBlocks()) {
37905 printf("Leak of %d blocks found in xmlUCSIsCat",
37906 xmlMemBlocks() - mem_base);
37908 printf(" %d", n_code);
37909 printf(" %d", n_cat);
37922 test_xmlUCSIsCatC(void) {
37925 #if defined(LIBXML_UNICODE_ENABLED)
37928 int code; /* UCS code point */
37931 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37932 mem_base = xmlMemBlocks();
37933 code = gen_int(n_code, 0);
37935 ret_val = xmlUCSIsCatC(code);
37936 desret_int(ret_val);
37938 des_int(n_code, code, 0);
37939 xmlResetLastError();
37940 if (mem_base != xmlMemBlocks()) {
37941 printf("Leak of %d blocks found in xmlUCSIsCatC",
37942 xmlMemBlocks() - mem_base);
37944 printf(" %d", n_code);
37956 test_xmlUCSIsCatCc(void) {
37959 #if defined(LIBXML_UNICODE_ENABLED)
37962 int code; /* UCS code point */
37965 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37966 mem_base = xmlMemBlocks();
37967 code = gen_int(n_code, 0);
37969 ret_val = xmlUCSIsCatCc(code);
37970 desret_int(ret_val);
37972 des_int(n_code, code, 0);
37973 xmlResetLastError();
37974 if (mem_base != xmlMemBlocks()) {
37975 printf("Leak of %d blocks found in xmlUCSIsCatCc",
37976 xmlMemBlocks() - mem_base);
37978 printf(" %d", n_code);
37990 test_xmlUCSIsCatCf(void) {
37993 #if defined(LIBXML_UNICODE_ENABLED)
37996 int code; /* UCS code point */
37999 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38000 mem_base = xmlMemBlocks();
38001 code = gen_int(n_code, 0);
38003 ret_val = xmlUCSIsCatCf(code);
38004 desret_int(ret_val);
38006 des_int(n_code, code, 0);
38007 xmlResetLastError();
38008 if (mem_base != xmlMemBlocks()) {
38009 printf("Leak of %d blocks found in xmlUCSIsCatCf",
38010 xmlMemBlocks() - mem_base);
38012 printf(" %d", n_code);
38024 test_xmlUCSIsCatCo(void) {
38027 #if defined(LIBXML_UNICODE_ENABLED)
38030 int code; /* UCS code point */
38033 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38034 mem_base = xmlMemBlocks();
38035 code = gen_int(n_code, 0);
38037 ret_val = xmlUCSIsCatCo(code);
38038 desret_int(ret_val);
38040 des_int(n_code, code, 0);
38041 xmlResetLastError();
38042 if (mem_base != xmlMemBlocks()) {
38043 printf("Leak of %d blocks found in xmlUCSIsCatCo",
38044 xmlMemBlocks() - mem_base);
38046 printf(" %d", n_code);
38058 test_xmlUCSIsCatCs(void) {
38061 #if defined(LIBXML_UNICODE_ENABLED)
38064 int code; /* UCS code point */
38067 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38068 mem_base = xmlMemBlocks();
38069 code = gen_int(n_code, 0);
38071 ret_val = xmlUCSIsCatCs(code);
38072 desret_int(ret_val);
38074 des_int(n_code, code, 0);
38075 xmlResetLastError();
38076 if (mem_base != xmlMemBlocks()) {
38077 printf("Leak of %d blocks found in xmlUCSIsCatCs",
38078 xmlMemBlocks() - mem_base);
38080 printf(" %d", n_code);
38092 test_xmlUCSIsCatL(void) {
38095 #if defined(LIBXML_UNICODE_ENABLED)
38098 int code; /* UCS code point */
38101 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38102 mem_base = xmlMemBlocks();
38103 code = gen_int(n_code, 0);
38105 ret_val = xmlUCSIsCatL(code);
38106 desret_int(ret_val);
38108 des_int(n_code, code, 0);
38109 xmlResetLastError();
38110 if (mem_base != xmlMemBlocks()) {
38111 printf("Leak of %d blocks found in xmlUCSIsCatL",
38112 xmlMemBlocks() - mem_base);
38114 printf(" %d", n_code);
38126 test_xmlUCSIsCatLl(void) {
38129 #if defined(LIBXML_UNICODE_ENABLED)
38132 int code; /* UCS code point */
38135 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38136 mem_base = xmlMemBlocks();
38137 code = gen_int(n_code, 0);
38139 ret_val = xmlUCSIsCatLl(code);
38140 desret_int(ret_val);
38142 des_int(n_code, code, 0);
38143 xmlResetLastError();
38144 if (mem_base != xmlMemBlocks()) {
38145 printf("Leak of %d blocks found in xmlUCSIsCatLl",
38146 xmlMemBlocks() - mem_base);
38148 printf(" %d", n_code);
38160 test_xmlUCSIsCatLm(void) {
38163 #if defined(LIBXML_UNICODE_ENABLED)
38166 int code; /* UCS code point */
38169 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38170 mem_base = xmlMemBlocks();
38171 code = gen_int(n_code, 0);
38173 ret_val = xmlUCSIsCatLm(code);
38174 desret_int(ret_val);
38176 des_int(n_code, code, 0);
38177 xmlResetLastError();
38178 if (mem_base != xmlMemBlocks()) {
38179 printf("Leak of %d blocks found in xmlUCSIsCatLm",
38180 xmlMemBlocks() - mem_base);
38182 printf(" %d", n_code);
38194 test_xmlUCSIsCatLo(void) {
38197 #if defined(LIBXML_UNICODE_ENABLED)
38200 int code; /* UCS code point */
38203 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38204 mem_base = xmlMemBlocks();
38205 code = gen_int(n_code, 0);
38207 ret_val = xmlUCSIsCatLo(code);
38208 desret_int(ret_val);
38210 des_int(n_code, code, 0);
38211 xmlResetLastError();
38212 if (mem_base != xmlMemBlocks()) {
38213 printf("Leak of %d blocks found in xmlUCSIsCatLo",
38214 xmlMemBlocks() - mem_base);
38216 printf(" %d", n_code);
38228 test_xmlUCSIsCatLt(void) {
38231 #if defined(LIBXML_UNICODE_ENABLED)
38234 int code; /* UCS code point */
38237 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38238 mem_base = xmlMemBlocks();
38239 code = gen_int(n_code, 0);
38241 ret_val = xmlUCSIsCatLt(code);
38242 desret_int(ret_val);
38244 des_int(n_code, code, 0);
38245 xmlResetLastError();
38246 if (mem_base != xmlMemBlocks()) {
38247 printf("Leak of %d blocks found in xmlUCSIsCatLt",
38248 xmlMemBlocks() - mem_base);
38250 printf(" %d", n_code);
38262 test_xmlUCSIsCatLu(void) {
38265 #if defined(LIBXML_UNICODE_ENABLED)
38268 int code; /* UCS code point */
38271 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38272 mem_base = xmlMemBlocks();
38273 code = gen_int(n_code, 0);
38275 ret_val = xmlUCSIsCatLu(code);
38276 desret_int(ret_val);
38278 des_int(n_code, code, 0);
38279 xmlResetLastError();
38280 if (mem_base != xmlMemBlocks()) {
38281 printf("Leak of %d blocks found in xmlUCSIsCatLu",
38282 xmlMemBlocks() - mem_base);
38284 printf(" %d", n_code);
38296 test_xmlUCSIsCatM(void) {
38299 #if defined(LIBXML_UNICODE_ENABLED)
38302 int code; /* UCS code point */
38305 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38306 mem_base = xmlMemBlocks();
38307 code = gen_int(n_code, 0);
38309 ret_val = xmlUCSIsCatM(code);
38310 desret_int(ret_val);
38312 des_int(n_code, code, 0);
38313 xmlResetLastError();
38314 if (mem_base != xmlMemBlocks()) {
38315 printf("Leak of %d blocks found in xmlUCSIsCatM",
38316 xmlMemBlocks() - mem_base);
38318 printf(" %d", n_code);
38330 test_xmlUCSIsCatMc(void) {
38333 #if defined(LIBXML_UNICODE_ENABLED)
38336 int code; /* UCS code point */
38339 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38340 mem_base = xmlMemBlocks();
38341 code = gen_int(n_code, 0);
38343 ret_val = xmlUCSIsCatMc(code);
38344 desret_int(ret_val);
38346 des_int(n_code, code, 0);
38347 xmlResetLastError();
38348 if (mem_base != xmlMemBlocks()) {
38349 printf("Leak of %d blocks found in xmlUCSIsCatMc",
38350 xmlMemBlocks() - mem_base);
38352 printf(" %d", n_code);
38364 test_xmlUCSIsCatMe(void) {
38367 #if defined(LIBXML_UNICODE_ENABLED)
38370 int code; /* UCS code point */
38373 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38374 mem_base = xmlMemBlocks();
38375 code = gen_int(n_code, 0);
38377 ret_val = xmlUCSIsCatMe(code);
38378 desret_int(ret_val);
38380 des_int(n_code, code, 0);
38381 xmlResetLastError();
38382 if (mem_base != xmlMemBlocks()) {
38383 printf("Leak of %d blocks found in xmlUCSIsCatMe",
38384 xmlMemBlocks() - mem_base);
38386 printf(" %d", n_code);
38398 test_xmlUCSIsCatMn(void) {
38401 #if defined(LIBXML_UNICODE_ENABLED)
38404 int code; /* UCS code point */
38407 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38408 mem_base = xmlMemBlocks();
38409 code = gen_int(n_code, 0);
38411 ret_val = xmlUCSIsCatMn(code);
38412 desret_int(ret_val);
38414 des_int(n_code, code, 0);
38415 xmlResetLastError();
38416 if (mem_base != xmlMemBlocks()) {
38417 printf("Leak of %d blocks found in xmlUCSIsCatMn",
38418 xmlMemBlocks() - mem_base);
38420 printf(" %d", n_code);
38432 test_xmlUCSIsCatN(void) {
38435 #if defined(LIBXML_UNICODE_ENABLED)
38438 int code; /* UCS code point */
38441 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38442 mem_base = xmlMemBlocks();
38443 code = gen_int(n_code, 0);
38445 ret_val = xmlUCSIsCatN(code);
38446 desret_int(ret_val);
38448 des_int(n_code, code, 0);
38449 xmlResetLastError();
38450 if (mem_base != xmlMemBlocks()) {
38451 printf("Leak of %d blocks found in xmlUCSIsCatN",
38452 xmlMemBlocks() - mem_base);
38454 printf(" %d", n_code);
38466 test_xmlUCSIsCatNd(void) {
38469 #if defined(LIBXML_UNICODE_ENABLED)
38472 int code; /* UCS code point */
38475 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38476 mem_base = xmlMemBlocks();
38477 code = gen_int(n_code, 0);
38479 ret_val = xmlUCSIsCatNd(code);
38480 desret_int(ret_val);
38482 des_int(n_code, code, 0);
38483 xmlResetLastError();
38484 if (mem_base != xmlMemBlocks()) {
38485 printf("Leak of %d blocks found in xmlUCSIsCatNd",
38486 xmlMemBlocks() - mem_base);
38488 printf(" %d", n_code);
38500 test_xmlUCSIsCatNl(void) {
38503 #if defined(LIBXML_UNICODE_ENABLED)
38506 int code; /* UCS code point */
38509 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38510 mem_base = xmlMemBlocks();
38511 code = gen_int(n_code, 0);
38513 ret_val = xmlUCSIsCatNl(code);
38514 desret_int(ret_val);
38516 des_int(n_code, code, 0);
38517 xmlResetLastError();
38518 if (mem_base != xmlMemBlocks()) {
38519 printf("Leak of %d blocks found in xmlUCSIsCatNl",
38520 xmlMemBlocks() - mem_base);
38522 printf(" %d", n_code);
38534 test_xmlUCSIsCatNo(void) {
38537 #if defined(LIBXML_UNICODE_ENABLED)
38540 int code; /* UCS code point */
38543 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38544 mem_base = xmlMemBlocks();
38545 code = gen_int(n_code, 0);
38547 ret_val = xmlUCSIsCatNo(code);
38548 desret_int(ret_val);
38550 des_int(n_code, code, 0);
38551 xmlResetLastError();
38552 if (mem_base != xmlMemBlocks()) {
38553 printf("Leak of %d blocks found in xmlUCSIsCatNo",
38554 xmlMemBlocks() - mem_base);
38556 printf(" %d", n_code);
38568 test_xmlUCSIsCatP(void) {
38571 #if defined(LIBXML_UNICODE_ENABLED)
38574 int code; /* UCS code point */
38577 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38578 mem_base = xmlMemBlocks();
38579 code = gen_int(n_code, 0);
38581 ret_val = xmlUCSIsCatP(code);
38582 desret_int(ret_val);
38584 des_int(n_code, code, 0);
38585 xmlResetLastError();
38586 if (mem_base != xmlMemBlocks()) {
38587 printf("Leak of %d blocks found in xmlUCSIsCatP",
38588 xmlMemBlocks() - mem_base);
38590 printf(" %d", n_code);
38602 test_xmlUCSIsCatPc(void) {
38605 #if defined(LIBXML_UNICODE_ENABLED)
38608 int code; /* UCS code point */
38611 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38612 mem_base = xmlMemBlocks();
38613 code = gen_int(n_code, 0);
38615 ret_val = xmlUCSIsCatPc(code);
38616 desret_int(ret_val);
38618 des_int(n_code, code, 0);
38619 xmlResetLastError();
38620 if (mem_base != xmlMemBlocks()) {
38621 printf("Leak of %d blocks found in xmlUCSIsCatPc",
38622 xmlMemBlocks() - mem_base);
38624 printf(" %d", n_code);
38636 test_xmlUCSIsCatPd(void) {
38639 #if defined(LIBXML_UNICODE_ENABLED)
38642 int code; /* UCS code point */
38645 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38646 mem_base = xmlMemBlocks();
38647 code = gen_int(n_code, 0);
38649 ret_val = xmlUCSIsCatPd(code);
38650 desret_int(ret_val);
38652 des_int(n_code, code, 0);
38653 xmlResetLastError();
38654 if (mem_base != xmlMemBlocks()) {
38655 printf("Leak of %d blocks found in xmlUCSIsCatPd",
38656 xmlMemBlocks() - mem_base);
38658 printf(" %d", n_code);
38670 test_xmlUCSIsCatPe(void) {
38673 #if defined(LIBXML_UNICODE_ENABLED)
38676 int code; /* UCS code point */
38679 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38680 mem_base = xmlMemBlocks();
38681 code = gen_int(n_code, 0);
38683 ret_val = xmlUCSIsCatPe(code);
38684 desret_int(ret_val);
38686 des_int(n_code, code, 0);
38687 xmlResetLastError();
38688 if (mem_base != xmlMemBlocks()) {
38689 printf("Leak of %d blocks found in xmlUCSIsCatPe",
38690 xmlMemBlocks() - mem_base);
38692 printf(" %d", n_code);
38704 test_xmlUCSIsCatPf(void) {
38707 #if defined(LIBXML_UNICODE_ENABLED)
38710 int code; /* UCS code point */
38713 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38714 mem_base = xmlMemBlocks();
38715 code = gen_int(n_code, 0);
38717 ret_val = xmlUCSIsCatPf(code);
38718 desret_int(ret_val);
38720 des_int(n_code, code, 0);
38721 xmlResetLastError();
38722 if (mem_base != xmlMemBlocks()) {
38723 printf("Leak of %d blocks found in xmlUCSIsCatPf",
38724 xmlMemBlocks() - mem_base);
38726 printf(" %d", n_code);
38738 test_xmlUCSIsCatPi(void) {
38741 #if defined(LIBXML_UNICODE_ENABLED)
38744 int code; /* UCS code point */
38747 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38748 mem_base = xmlMemBlocks();
38749 code = gen_int(n_code, 0);
38751 ret_val = xmlUCSIsCatPi(code);
38752 desret_int(ret_val);
38754 des_int(n_code, code, 0);
38755 xmlResetLastError();
38756 if (mem_base != xmlMemBlocks()) {
38757 printf("Leak of %d blocks found in xmlUCSIsCatPi",
38758 xmlMemBlocks() - mem_base);
38760 printf(" %d", n_code);
38772 test_xmlUCSIsCatPo(void) {
38775 #if defined(LIBXML_UNICODE_ENABLED)
38778 int code; /* UCS code point */
38781 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38782 mem_base = xmlMemBlocks();
38783 code = gen_int(n_code, 0);
38785 ret_val = xmlUCSIsCatPo(code);
38786 desret_int(ret_val);
38788 des_int(n_code, code, 0);
38789 xmlResetLastError();
38790 if (mem_base != xmlMemBlocks()) {
38791 printf("Leak of %d blocks found in xmlUCSIsCatPo",
38792 xmlMemBlocks() - mem_base);
38794 printf(" %d", n_code);
38806 test_xmlUCSIsCatPs(void) {
38809 #if defined(LIBXML_UNICODE_ENABLED)
38812 int code; /* UCS code point */
38815 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38816 mem_base = xmlMemBlocks();
38817 code = gen_int(n_code, 0);
38819 ret_val = xmlUCSIsCatPs(code);
38820 desret_int(ret_val);
38822 des_int(n_code, code, 0);
38823 xmlResetLastError();
38824 if (mem_base != xmlMemBlocks()) {
38825 printf("Leak of %d blocks found in xmlUCSIsCatPs",
38826 xmlMemBlocks() - mem_base);
38828 printf(" %d", n_code);
38840 test_xmlUCSIsCatS(void) {
38843 #if defined(LIBXML_UNICODE_ENABLED)
38846 int code; /* UCS code point */
38849 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38850 mem_base = xmlMemBlocks();
38851 code = gen_int(n_code, 0);
38853 ret_val = xmlUCSIsCatS(code);
38854 desret_int(ret_val);
38856 des_int(n_code, code, 0);
38857 xmlResetLastError();
38858 if (mem_base != xmlMemBlocks()) {
38859 printf("Leak of %d blocks found in xmlUCSIsCatS",
38860 xmlMemBlocks() - mem_base);
38862 printf(" %d", n_code);
38874 test_xmlUCSIsCatSc(void) {
38877 #if defined(LIBXML_UNICODE_ENABLED)
38880 int code; /* UCS code point */
38883 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38884 mem_base = xmlMemBlocks();
38885 code = gen_int(n_code, 0);
38887 ret_val = xmlUCSIsCatSc(code);
38888 desret_int(ret_val);
38890 des_int(n_code, code, 0);
38891 xmlResetLastError();
38892 if (mem_base != xmlMemBlocks()) {
38893 printf("Leak of %d blocks found in xmlUCSIsCatSc",
38894 xmlMemBlocks() - mem_base);
38896 printf(" %d", n_code);
38908 test_xmlUCSIsCatSk(void) {
38911 #if defined(LIBXML_UNICODE_ENABLED)
38914 int code; /* UCS code point */
38917 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38918 mem_base = xmlMemBlocks();
38919 code = gen_int(n_code, 0);
38921 ret_val = xmlUCSIsCatSk(code);
38922 desret_int(ret_val);
38924 des_int(n_code, code, 0);
38925 xmlResetLastError();
38926 if (mem_base != xmlMemBlocks()) {
38927 printf("Leak of %d blocks found in xmlUCSIsCatSk",
38928 xmlMemBlocks() - mem_base);
38930 printf(" %d", n_code);
38942 test_xmlUCSIsCatSm(void) {
38945 #if defined(LIBXML_UNICODE_ENABLED)
38948 int code; /* UCS code point */
38951 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38952 mem_base = xmlMemBlocks();
38953 code = gen_int(n_code, 0);
38955 ret_val = xmlUCSIsCatSm(code);
38956 desret_int(ret_val);
38958 des_int(n_code, code, 0);
38959 xmlResetLastError();
38960 if (mem_base != xmlMemBlocks()) {
38961 printf("Leak of %d blocks found in xmlUCSIsCatSm",
38962 xmlMemBlocks() - mem_base);
38964 printf(" %d", n_code);
38976 test_xmlUCSIsCatSo(void) {
38979 #if defined(LIBXML_UNICODE_ENABLED)
38982 int code; /* UCS code point */
38985 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38986 mem_base = xmlMemBlocks();
38987 code = gen_int(n_code, 0);
38989 ret_val = xmlUCSIsCatSo(code);
38990 desret_int(ret_val);
38992 des_int(n_code, code, 0);
38993 xmlResetLastError();
38994 if (mem_base != xmlMemBlocks()) {
38995 printf("Leak of %d blocks found in xmlUCSIsCatSo",
38996 xmlMemBlocks() - mem_base);
38998 printf(" %d", n_code);
39010 test_xmlUCSIsCatZ(void) {
39013 #if defined(LIBXML_UNICODE_ENABLED)
39016 int code; /* UCS code point */
39019 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39020 mem_base = xmlMemBlocks();
39021 code = gen_int(n_code, 0);
39023 ret_val = xmlUCSIsCatZ(code);
39024 desret_int(ret_val);
39026 des_int(n_code, code, 0);
39027 xmlResetLastError();
39028 if (mem_base != xmlMemBlocks()) {
39029 printf("Leak of %d blocks found in xmlUCSIsCatZ",
39030 xmlMemBlocks() - mem_base);
39032 printf(" %d", n_code);
39044 test_xmlUCSIsCatZl(void) {
39047 #if defined(LIBXML_UNICODE_ENABLED)
39050 int code; /* UCS code point */
39053 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39054 mem_base = xmlMemBlocks();
39055 code = gen_int(n_code, 0);
39057 ret_val = xmlUCSIsCatZl(code);
39058 desret_int(ret_val);
39060 des_int(n_code, code, 0);
39061 xmlResetLastError();
39062 if (mem_base != xmlMemBlocks()) {
39063 printf("Leak of %d blocks found in xmlUCSIsCatZl",
39064 xmlMemBlocks() - mem_base);
39066 printf(" %d", n_code);
39078 test_xmlUCSIsCatZp(void) {
39081 #if defined(LIBXML_UNICODE_ENABLED)
39084 int code; /* UCS code point */
39087 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39088 mem_base = xmlMemBlocks();
39089 code = gen_int(n_code, 0);
39091 ret_val = xmlUCSIsCatZp(code);
39092 desret_int(ret_val);
39094 des_int(n_code, code, 0);
39095 xmlResetLastError();
39096 if (mem_base != xmlMemBlocks()) {
39097 printf("Leak of %d blocks found in xmlUCSIsCatZp",
39098 xmlMemBlocks() - mem_base);
39100 printf(" %d", n_code);
39112 test_xmlUCSIsCatZs(void) {
39115 #if defined(LIBXML_UNICODE_ENABLED)
39118 int code; /* UCS code point */
39121 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39122 mem_base = xmlMemBlocks();
39123 code = gen_int(n_code, 0);
39125 ret_val = xmlUCSIsCatZs(code);
39126 desret_int(ret_val);
39128 des_int(n_code, code, 0);
39129 xmlResetLastError();
39130 if (mem_base != xmlMemBlocks()) {
39131 printf("Leak of %d blocks found in xmlUCSIsCatZs",
39132 xmlMemBlocks() - mem_base);
39134 printf(" %d", n_code);
39146 test_xmlUCSIsCherokee(void) {
39149 #if defined(LIBXML_UNICODE_ENABLED)
39152 int code; /* UCS code point */
39155 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39156 mem_base = xmlMemBlocks();
39157 code = gen_int(n_code, 0);
39159 ret_val = xmlUCSIsCherokee(code);
39160 desret_int(ret_val);
39162 des_int(n_code, code, 0);
39163 xmlResetLastError();
39164 if (mem_base != xmlMemBlocks()) {
39165 printf("Leak of %d blocks found in xmlUCSIsCherokee",
39166 xmlMemBlocks() - mem_base);
39168 printf(" %d", n_code);
39180 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39183 #if defined(LIBXML_UNICODE_ENABLED)
39186 int code; /* UCS code point */
39189 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39190 mem_base = xmlMemBlocks();
39191 code = gen_int(n_code, 0);
39193 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39194 desret_int(ret_val);
39196 des_int(n_code, code, 0);
39197 xmlResetLastError();
39198 if (mem_base != xmlMemBlocks()) {
39199 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39200 xmlMemBlocks() - mem_base);
39202 printf(" %d", n_code);
39214 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39217 #if defined(LIBXML_UNICODE_ENABLED)
39220 int code; /* UCS code point */
39223 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39224 mem_base = xmlMemBlocks();
39225 code = gen_int(n_code, 0);
39227 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39228 desret_int(ret_val);
39230 des_int(n_code, code, 0);
39231 xmlResetLastError();
39232 if (mem_base != xmlMemBlocks()) {
39233 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39234 xmlMemBlocks() - mem_base);
39236 printf(" %d", n_code);
39248 test_xmlUCSIsCombiningHalfMarks(void) {
39251 #if defined(LIBXML_UNICODE_ENABLED)
39254 int code; /* UCS code point */
39257 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39258 mem_base = xmlMemBlocks();
39259 code = gen_int(n_code, 0);
39261 ret_val = xmlUCSIsCombiningHalfMarks(code);
39262 desret_int(ret_val);
39264 des_int(n_code, code, 0);
39265 xmlResetLastError();
39266 if (mem_base != xmlMemBlocks()) {
39267 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39268 xmlMemBlocks() - mem_base);
39270 printf(" %d", n_code);
39282 test_xmlUCSIsCombiningMarksforSymbols(void) {
39285 #if defined(LIBXML_UNICODE_ENABLED)
39288 int code; /* UCS code point */
39291 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39292 mem_base = xmlMemBlocks();
39293 code = gen_int(n_code, 0);
39295 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39296 desret_int(ret_val);
39298 des_int(n_code, code, 0);
39299 xmlResetLastError();
39300 if (mem_base != xmlMemBlocks()) {
39301 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39302 xmlMemBlocks() - mem_base);
39304 printf(" %d", n_code);
39316 test_xmlUCSIsControlPictures(void) {
39319 #if defined(LIBXML_UNICODE_ENABLED)
39322 int code; /* UCS code point */
39325 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39326 mem_base = xmlMemBlocks();
39327 code = gen_int(n_code, 0);
39329 ret_val = xmlUCSIsControlPictures(code);
39330 desret_int(ret_val);
39332 des_int(n_code, code, 0);
39333 xmlResetLastError();
39334 if (mem_base != xmlMemBlocks()) {
39335 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39336 xmlMemBlocks() - mem_base);
39338 printf(" %d", n_code);
39350 test_xmlUCSIsCurrencySymbols(void) {
39353 #if defined(LIBXML_UNICODE_ENABLED)
39356 int code; /* UCS code point */
39359 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39360 mem_base = xmlMemBlocks();
39361 code = gen_int(n_code, 0);
39363 ret_val = xmlUCSIsCurrencySymbols(code);
39364 desret_int(ret_val);
39366 des_int(n_code, code, 0);
39367 xmlResetLastError();
39368 if (mem_base != xmlMemBlocks()) {
39369 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39370 xmlMemBlocks() - mem_base);
39372 printf(" %d", n_code);
39384 test_xmlUCSIsCypriotSyllabary(void) {
39387 #if defined(LIBXML_UNICODE_ENABLED)
39390 int code; /* UCS code point */
39393 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39394 mem_base = xmlMemBlocks();
39395 code = gen_int(n_code, 0);
39397 ret_val = xmlUCSIsCypriotSyllabary(code);
39398 desret_int(ret_val);
39400 des_int(n_code, code, 0);
39401 xmlResetLastError();
39402 if (mem_base != xmlMemBlocks()) {
39403 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39404 xmlMemBlocks() - mem_base);
39406 printf(" %d", n_code);
39418 test_xmlUCSIsCyrillic(void) {
39421 #if defined(LIBXML_UNICODE_ENABLED)
39424 int code; /* UCS code point */
39427 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39428 mem_base = xmlMemBlocks();
39429 code = gen_int(n_code, 0);
39431 ret_val = xmlUCSIsCyrillic(code);
39432 desret_int(ret_val);
39434 des_int(n_code, code, 0);
39435 xmlResetLastError();
39436 if (mem_base != xmlMemBlocks()) {
39437 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39438 xmlMemBlocks() - mem_base);
39440 printf(" %d", n_code);
39452 test_xmlUCSIsCyrillicSupplement(void) {
39455 #if defined(LIBXML_UNICODE_ENABLED)
39458 int code; /* UCS code point */
39461 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39462 mem_base = xmlMemBlocks();
39463 code = gen_int(n_code, 0);
39465 ret_val = xmlUCSIsCyrillicSupplement(code);
39466 desret_int(ret_val);
39468 des_int(n_code, code, 0);
39469 xmlResetLastError();
39470 if (mem_base != xmlMemBlocks()) {
39471 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39472 xmlMemBlocks() - mem_base);
39474 printf(" %d", n_code);
39486 test_xmlUCSIsDeseret(void) {
39489 #if defined(LIBXML_UNICODE_ENABLED)
39492 int code; /* UCS code point */
39495 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39496 mem_base = xmlMemBlocks();
39497 code = gen_int(n_code, 0);
39499 ret_val = xmlUCSIsDeseret(code);
39500 desret_int(ret_val);
39502 des_int(n_code, code, 0);
39503 xmlResetLastError();
39504 if (mem_base != xmlMemBlocks()) {
39505 printf("Leak of %d blocks found in xmlUCSIsDeseret",
39506 xmlMemBlocks() - mem_base);
39508 printf(" %d", n_code);
39520 test_xmlUCSIsDevanagari(void) {
39523 #if defined(LIBXML_UNICODE_ENABLED)
39526 int code; /* UCS code point */
39529 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39530 mem_base = xmlMemBlocks();
39531 code = gen_int(n_code, 0);
39533 ret_val = xmlUCSIsDevanagari(code);
39534 desret_int(ret_val);
39536 des_int(n_code, code, 0);
39537 xmlResetLastError();
39538 if (mem_base != xmlMemBlocks()) {
39539 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39540 xmlMemBlocks() - mem_base);
39542 printf(" %d", n_code);
39554 test_xmlUCSIsDingbats(void) {
39557 #if defined(LIBXML_UNICODE_ENABLED)
39560 int code; /* UCS code point */
39563 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39564 mem_base = xmlMemBlocks();
39565 code = gen_int(n_code, 0);
39567 ret_val = xmlUCSIsDingbats(code);
39568 desret_int(ret_val);
39570 des_int(n_code, code, 0);
39571 xmlResetLastError();
39572 if (mem_base != xmlMemBlocks()) {
39573 printf("Leak of %d blocks found in xmlUCSIsDingbats",
39574 xmlMemBlocks() - mem_base);
39576 printf(" %d", n_code);
39588 test_xmlUCSIsEnclosedAlphanumerics(void) {
39591 #if defined(LIBXML_UNICODE_ENABLED)
39594 int code; /* UCS code point */
39597 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39598 mem_base = xmlMemBlocks();
39599 code = gen_int(n_code, 0);
39601 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39602 desret_int(ret_val);
39604 des_int(n_code, code, 0);
39605 xmlResetLastError();
39606 if (mem_base != xmlMemBlocks()) {
39607 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39608 xmlMemBlocks() - mem_base);
39610 printf(" %d", n_code);
39622 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39625 #if defined(LIBXML_UNICODE_ENABLED)
39628 int code; /* UCS code point */
39631 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39632 mem_base = xmlMemBlocks();
39633 code = gen_int(n_code, 0);
39635 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39636 desret_int(ret_val);
39638 des_int(n_code, code, 0);
39639 xmlResetLastError();
39640 if (mem_base != xmlMemBlocks()) {
39641 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39642 xmlMemBlocks() - mem_base);
39644 printf(" %d", n_code);
39656 test_xmlUCSIsEthiopic(void) {
39659 #if defined(LIBXML_UNICODE_ENABLED)
39662 int code; /* UCS code point */
39665 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39666 mem_base = xmlMemBlocks();
39667 code = gen_int(n_code, 0);
39669 ret_val = xmlUCSIsEthiopic(code);
39670 desret_int(ret_val);
39672 des_int(n_code, code, 0);
39673 xmlResetLastError();
39674 if (mem_base != xmlMemBlocks()) {
39675 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39676 xmlMemBlocks() - mem_base);
39678 printf(" %d", n_code);
39690 test_xmlUCSIsGeneralPunctuation(void) {
39693 #if defined(LIBXML_UNICODE_ENABLED)
39696 int code; /* UCS code point */
39699 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39700 mem_base = xmlMemBlocks();
39701 code = gen_int(n_code, 0);
39703 ret_val = xmlUCSIsGeneralPunctuation(code);
39704 desret_int(ret_val);
39706 des_int(n_code, code, 0);
39707 xmlResetLastError();
39708 if (mem_base != xmlMemBlocks()) {
39709 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39710 xmlMemBlocks() - mem_base);
39712 printf(" %d", n_code);
39724 test_xmlUCSIsGeometricShapes(void) {
39727 #if defined(LIBXML_UNICODE_ENABLED)
39730 int code; /* UCS code point */
39733 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39734 mem_base = xmlMemBlocks();
39735 code = gen_int(n_code, 0);
39737 ret_val = xmlUCSIsGeometricShapes(code);
39738 desret_int(ret_val);
39740 des_int(n_code, code, 0);
39741 xmlResetLastError();
39742 if (mem_base != xmlMemBlocks()) {
39743 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39744 xmlMemBlocks() - mem_base);
39746 printf(" %d", n_code);
39758 test_xmlUCSIsGeorgian(void) {
39761 #if defined(LIBXML_UNICODE_ENABLED)
39764 int code; /* UCS code point */
39767 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39768 mem_base = xmlMemBlocks();
39769 code = gen_int(n_code, 0);
39771 ret_val = xmlUCSIsGeorgian(code);
39772 desret_int(ret_val);
39774 des_int(n_code, code, 0);
39775 xmlResetLastError();
39776 if (mem_base != xmlMemBlocks()) {
39777 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39778 xmlMemBlocks() - mem_base);
39780 printf(" %d", n_code);
39792 test_xmlUCSIsGothic(void) {
39795 #if defined(LIBXML_UNICODE_ENABLED)
39798 int code; /* UCS code point */
39801 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39802 mem_base = xmlMemBlocks();
39803 code = gen_int(n_code, 0);
39805 ret_val = xmlUCSIsGothic(code);
39806 desret_int(ret_val);
39808 des_int(n_code, code, 0);
39809 xmlResetLastError();
39810 if (mem_base != xmlMemBlocks()) {
39811 printf("Leak of %d blocks found in xmlUCSIsGothic",
39812 xmlMemBlocks() - mem_base);
39814 printf(" %d", n_code);
39826 test_xmlUCSIsGreek(void) {
39829 #if defined(LIBXML_UNICODE_ENABLED)
39832 int code; /* UCS code point */
39835 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39836 mem_base = xmlMemBlocks();
39837 code = gen_int(n_code, 0);
39839 ret_val = xmlUCSIsGreek(code);
39840 desret_int(ret_val);
39842 des_int(n_code, code, 0);
39843 xmlResetLastError();
39844 if (mem_base != xmlMemBlocks()) {
39845 printf("Leak of %d blocks found in xmlUCSIsGreek",
39846 xmlMemBlocks() - mem_base);
39848 printf(" %d", n_code);
39860 test_xmlUCSIsGreekExtended(void) {
39863 #if defined(LIBXML_UNICODE_ENABLED)
39866 int code; /* UCS code point */
39869 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39870 mem_base = xmlMemBlocks();
39871 code = gen_int(n_code, 0);
39873 ret_val = xmlUCSIsGreekExtended(code);
39874 desret_int(ret_val);
39876 des_int(n_code, code, 0);
39877 xmlResetLastError();
39878 if (mem_base != xmlMemBlocks()) {
39879 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39880 xmlMemBlocks() - mem_base);
39882 printf(" %d", n_code);
39894 test_xmlUCSIsGreekandCoptic(void) {
39897 #if defined(LIBXML_UNICODE_ENABLED)
39900 int code; /* UCS code point */
39903 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39904 mem_base = xmlMemBlocks();
39905 code = gen_int(n_code, 0);
39907 ret_val = xmlUCSIsGreekandCoptic(code);
39908 desret_int(ret_val);
39910 des_int(n_code, code, 0);
39911 xmlResetLastError();
39912 if (mem_base != xmlMemBlocks()) {
39913 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39914 xmlMemBlocks() - mem_base);
39916 printf(" %d", n_code);
39928 test_xmlUCSIsGujarati(void) {
39931 #if defined(LIBXML_UNICODE_ENABLED)
39934 int code; /* UCS code point */
39937 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39938 mem_base = xmlMemBlocks();
39939 code = gen_int(n_code, 0);
39941 ret_val = xmlUCSIsGujarati(code);
39942 desret_int(ret_val);
39944 des_int(n_code, code, 0);
39945 xmlResetLastError();
39946 if (mem_base != xmlMemBlocks()) {
39947 printf("Leak of %d blocks found in xmlUCSIsGujarati",
39948 xmlMemBlocks() - mem_base);
39950 printf(" %d", n_code);
39962 test_xmlUCSIsGurmukhi(void) {
39965 #if defined(LIBXML_UNICODE_ENABLED)
39968 int code; /* UCS code point */
39971 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39972 mem_base = xmlMemBlocks();
39973 code = gen_int(n_code, 0);
39975 ret_val = xmlUCSIsGurmukhi(code);
39976 desret_int(ret_val);
39978 des_int(n_code, code, 0);
39979 xmlResetLastError();
39980 if (mem_base != xmlMemBlocks()) {
39981 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39982 xmlMemBlocks() - mem_base);
39984 printf(" %d", n_code);
39996 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39999 #if defined(LIBXML_UNICODE_ENABLED)
40002 int code; /* UCS code point */
40005 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40006 mem_base = xmlMemBlocks();
40007 code = gen_int(n_code, 0);
40009 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40010 desret_int(ret_val);
40012 des_int(n_code, code, 0);
40013 xmlResetLastError();
40014 if (mem_base != xmlMemBlocks()) {
40015 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40016 xmlMemBlocks() - mem_base);
40018 printf(" %d", n_code);
40030 test_xmlUCSIsHangulCompatibilityJamo(void) {
40033 #if defined(LIBXML_UNICODE_ENABLED)
40036 int code; /* UCS code point */
40039 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40040 mem_base = xmlMemBlocks();
40041 code = gen_int(n_code, 0);
40043 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40044 desret_int(ret_val);
40046 des_int(n_code, code, 0);
40047 xmlResetLastError();
40048 if (mem_base != xmlMemBlocks()) {
40049 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40050 xmlMemBlocks() - mem_base);
40052 printf(" %d", n_code);
40064 test_xmlUCSIsHangulJamo(void) {
40067 #if defined(LIBXML_UNICODE_ENABLED)
40070 int code; /* UCS code point */
40073 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40074 mem_base = xmlMemBlocks();
40075 code = gen_int(n_code, 0);
40077 ret_val = xmlUCSIsHangulJamo(code);
40078 desret_int(ret_val);
40080 des_int(n_code, code, 0);
40081 xmlResetLastError();
40082 if (mem_base != xmlMemBlocks()) {
40083 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40084 xmlMemBlocks() - mem_base);
40086 printf(" %d", n_code);
40098 test_xmlUCSIsHangulSyllables(void) {
40101 #if defined(LIBXML_UNICODE_ENABLED)
40104 int code; /* UCS code point */
40107 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40108 mem_base = xmlMemBlocks();
40109 code = gen_int(n_code, 0);
40111 ret_val = xmlUCSIsHangulSyllables(code);
40112 desret_int(ret_val);
40114 des_int(n_code, code, 0);
40115 xmlResetLastError();
40116 if (mem_base != xmlMemBlocks()) {
40117 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40118 xmlMemBlocks() - mem_base);
40120 printf(" %d", n_code);
40132 test_xmlUCSIsHanunoo(void) {
40135 #if defined(LIBXML_UNICODE_ENABLED)
40138 int code; /* UCS code point */
40141 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40142 mem_base = xmlMemBlocks();
40143 code = gen_int(n_code, 0);
40145 ret_val = xmlUCSIsHanunoo(code);
40146 desret_int(ret_val);
40148 des_int(n_code, code, 0);
40149 xmlResetLastError();
40150 if (mem_base != xmlMemBlocks()) {
40151 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40152 xmlMemBlocks() - mem_base);
40154 printf(" %d", n_code);
40166 test_xmlUCSIsHebrew(void) {
40169 #if defined(LIBXML_UNICODE_ENABLED)
40172 int code; /* UCS code point */
40175 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40176 mem_base = xmlMemBlocks();
40177 code = gen_int(n_code, 0);
40179 ret_val = xmlUCSIsHebrew(code);
40180 desret_int(ret_val);
40182 des_int(n_code, code, 0);
40183 xmlResetLastError();
40184 if (mem_base != xmlMemBlocks()) {
40185 printf("Leak of %d blocks found in xmlUCSIsHebrew",
40186 xmlMemBlocks() - mem_base);
40188 printf(" %d", n_code);
40200 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40203 #if defined(LIBXML_UNICODE_ENABLED)
40206 int code; /* UCS code point */
40209 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40210 mem_base = xmlMemBlocks();
40211 code = gen_int(n_code, 0);
40213 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40214 desret_int(ret_val);
40216 des_int(n_code, code, 0);
40217 xmlResetLastError();
40218 if (mem_base != xmlMemBlocks()) {
40219 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40220 xmlMemBlocks() - mem_base);
40222 printf(" %d", n_code);
40234 test_xmlUCSIsHighSurrogates(void) {
40237 #if defined(LIBXML_UNICODE_ENABLED)
40240 int code; /* UCS code point */
40243 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40244 mem_base = xmlMemBlocks();
40245 code = gen_int(n_code, 0);
40247 ret_val = xmlUCSIsHighSurrogates(code);
40248 desret_int(ret_val);
40250 des_int(n_code, code, 0);
40251 xmlResetLastError();
40252 if (mem_base != xmlMemBlocks()) {
40253 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40254 xmlMemBlocks() - mem_base);
40256 printf(" %d", n_code);
40268 test_xmlUCSIsHiragana(void) {
40271 #if defined(LIBXML_UNICODE_ENABLED)
40274 int code; /* UCS code point */
40277 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40278 mem_base = xmlMemBlocks();
40279 code = gen_int(n_code, 0);
40281 ret_val = xmlUCSIsHiragana(code);
40282 desret_int(ret_val);
40284 des_int(n_code, code, 0);
40285 xmlResetLastError();
40286 if (mem_base != xmlMemBlocks()) {
40287 printf("Leak of %d blocks found in xmlUCSIsHiragana",
40288 xmlMemBlocks() - mem_base);
40290 printf(" %d", n_code);
40302 test_xmlUCSIsIPAExtensions(void) {
40305 #if defined(LIBXML_UNICODE_ENABLED)
40308 int code; /* UCS code point */
40311 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40312 mem_base = xmlMemBlocks();
40313 code = gen_int(n_code, 0);
40315 ret_val = xmlUCSIsIPAExtensions(code);
40316 desret_int(ret_val);
40318 des_int(n_code, code, 0);
40319 xmlResetLastError();
40320 if (mem_base != xmlMemBlocks()) {
40321 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40322 xmlMemBlocks() - mem_base);
40324 printf(" %d", n_code);
40336 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40339 #if defined(LIBXML_UNICODE_ENABLED)
40342 int code; /* UCS code point */
40345 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40346 mem_base = xmlMemBlocks();
40347 code = gen_int(n_code, 0);
40349 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40350 desret_int(ret_val);
40352 des_int(n_code, code, 0);
40353 xmlResetLastError();
40354 if (mem_base != xmlMemBlocks()) {
40355 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40356 xmlMemBlocks() - mem_base);
40358 printf(" %d", n_code);
40370 test_xmlUCSIsKanbun(void) {
40373 #if defined(LIBXML_UNICODE_ENABLED)
40376 int code; /* UCS code point */
40379 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40380 mem_base = xmlMemBlocks();
40381 code = gen_int(n_code, 0);
40383 ret_val = xmlUCSIsKanbun(code);
40384 desret_int(ret_val);
40386 des_int(n_code, code, 0);
40387 xmlResetLastError();
40388 if (mem_base != xmlMemBlocks()) {
40389 printf("Leak of %d blocks found in xmlUCSIsKanbun",
40390 xmlMemBlocks() - mem_base);
40392 printf(" %d", n_code);
40404 test_xmlUCSIsKangxiRadicals(void) {
40407 #if defined(LIBXML_UNICODE_ENABLED)
40410 int code; /* UCS code point */
40413 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40414 mem_base = xmlMemBlocks();
40415 code = gen_int(n_code, 0);
40417 ret_val = xmlUCSIsKangxiRadicals(code);
40418 desret_int(ret_val);
40420 des_int(n_code, code, 0);
40421 xmlResetLastError();
40422 if (mem_base != xmlMemBlocks()) {
40423 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40424 xmlMemBlocks() - mem_base);
40426 printf(" %d", n_code);
40438 test_xmlUCSIsKannada(void) {
40441 #if defined(LIBXML_UNICODE_ENABLED)
40444 int code; /* UCS code point */
40447 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40448 mem_base = xmlMemBlocks();
40449 code = gen_int(n_code, 0);
40451 ret_val = xmlUCSIsKannada(code);
40452 desret_int(ret_val);
40454 des_int(n_code, code, 0);
40455 xmlResetLastError();
40456 if (mem_base != xmlMemBlocks()) {
40457 printf("Leak of %d blocks found in xmlUCSIsKannada",
40458 xmlMemBlocks() - mem_base);
40460 printf(" %d", n_code);
40472 test_xmlUCSIsKatakana(void) {
40475 #if defined(LIBXML_UNICODE_ENABLED)
40478 int code; /* UCS code point */
40481 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40482 mem_base = xmlMemBlocks();
40483 code = gen_int(n_code, 0);
40485 ret_val = xmlUCSIsKatakana(code);
40486 desret_int(ret_val);
40488 des_int(n_code, code, 0);
40489 xmlResetLastError();
40490 if (mem_base != xmlMemBlocks()) {
40491 printf("Leak of %d blocks found in xmlUCSIsKatakana",
40492 xmlMemBlocks() - mem_base);
40494 printf(" %d", n_code);
40506 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40509 #if defined(LIBXML_UNICODE_ENABLED)
40512 int code; /* UCS code point */
40515 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40516 mem_base = xmlMemBlocks();
40517 code = gen_int(n_code, 0);
40519 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40520 desret_int(ret_val);
40522 des_int(n_code, code, 0);
40523 xmlResetLastError();
40524 if (mem_base != xmlMemBlocks()) {
40525 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40526 xmlMemBlocks() - mem_base);
40528 printf(" %d", n_code);
40540 test_xmlUCSIsKhmer(void) {
40543 #if defined(LIBXML_UNICODE_ENABLED)
40546 int code; /* UCS code point */
40549 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40550 mem_base = xmlMemBlocks();
40551 code = gen_int(n_code, 0);
40553 ret_val = xmlUCSIsKhmer(code);
40554 desret_int(ret_val);
40556 des_int(n_code, code, 0);
40557 xmlResetLastError();
40558 if (mem_base != xmlMemBlocks()) {
40559 printf("Leak of %d blocks found in xmlUCSIsKhmer",
40560 xmlMemBlocks() - mem_base);
40562 printf(" %d", n_code);
40574 test_xmlUCSIsKhmerSymbols(void) {
40577 #if defined(LIBXML_UNICODE_ENABLED)
40580 int code; /* UCS code point */
40583 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40584 mem_base = xmlMemBlocks();
40585 code = gen_int(n_code, 0);
40587 ret_val = xmlUCSIsKhmerSymbols(code);
40588 desret_int(ret_val);
40590 des_int(n_code, code, 0);
40591 xmlResetLastError();
40592 if (mem_base != xmlMemBlocks()) {
40593 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40594 xmlMemBlocks() - mem_base);
40596 printf(" %d", n_code);
40608 test_xmlUCSIsLao(void) {
40611 #if defined(LIBXML_UNICODE_ENABLED)
40614 int code; /* UCS code point */
40617 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40618 mem_base = xmlMemBlocks();
40619 code = gen_int(n_code, 0);
40621 ret_val = xmlUCSIsLao(code);
40622 desret_int(ret_val);
40624 des_int(n_code, code, 0);
40625 xmlResetLastError();
40626 if (mem_base != xmlMemBlocks()) {
40627 printf("Leak of %d blocks found in xmlUCSIsLao",
40628 xmlMemBlocks() - mem_base);
40630 printf(" %d", n_code);
40642 test_xmlUCSIsLatin1Supplement(void) {
40645 #if defined(LIBXML_UNICODE_ENABLED)
40648 int code; /* UCS code point */
40651 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40652 mem_base = xmlMemBlocks();
40653 code = gen_int(n_code, 0);
40655 ret_val = xmlUCSIsLatin1Supplement(code);
40656 desret_int(ret_val);
40658 des_int(n_code, code, 0);
40659 xmlResetLastError();
40660 if (mem_base != xmlMemBlocks()) {
40661 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40662 xmlMemBlocks() - mem_base);
40664 printf(" %d", n_code);
40676 test_xmlUCSIsLatinExtendedA(void) {
40679 #if defined(LIBXML_UNICODE_ENABLED)
40682 int code; /* UCS code point */
40685 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40686 mem_base = xmlMemBlocks();
40687 code = gen_int(n_code, 0);
40689 ret_val = xmlUCSIsLatinExtendedA(code);
40690 desret_int(ret_val);
40692 des_int(n_code, code, 0);
40693 xmlResetLastError();
40694 if (mem_base != xmlMemBlocks()) {
40695 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40696 xmlMemBlocks() - mem_base);
40698 printf(" %d", n_code);
40710 test_xmlUCSIsLatinExtendedAdditional(void) {
40713 #if defined(LIBXML_UNICODE_ENABLED)
40716 int code; /* UCS code point */
40719 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40720 mem_base = xmlMemBlocks();
40721 code = gen_int(n_code, 0);
40723 ret_val = xmlUCSIsLatinExtendedAdditional(code);
40724 desret_int(ret_val);
40726 des_int(n_code, code, 0);
40727 xmlResetLastError();
40728 if (mem_base != xmlMemBlocks()) {
40729 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40730 xmlMemBlocks() - mem_base);
40732 printf(" %d", n_code);
40744 test_xmlUCSIsLatinExtendedB(void) {
40747 #if defined(LIBXML_UNICODE_ENABLED)
40750 int code; /* UCS code point */
40753 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40754 mem_base = xmlMemBlocks();
40755 code = gen_int(n_code, 0);
40757 ret_val = xmlUCSIsLatinExtendedB(code);
40758 desret_int(ret_val);
40760 des_int(n_code, code, 0);
40761 xmlResetLastError();
40762 if (mem_base != xmlMemBlocks()) {
40763 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40764 xmlMemBlocks() - mem_base);
40766 printf(" %d", n_code);
40778 test_xmlUCSIsLetterlikeSymbols(void) {
40781 #if defined(LIBXML_UNICODE_ENABLED)
40784 int code; /* UCS code point */
40787 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40788 mem_base = xmlMemBlocks();
40789 code = gen_int(n_code, 0);
40791 ret_val = xmlUCSIsLetterlikeSymbols(code);
40792 desret_int(ret_val);
40794 des_int(n_code, code, 0);
40795 xmlResetLastError();
40796 if (mem_base != xmlMemBlocks()) {
40797 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40798 xmlMemBlocks() - mem_base);
40800 printf(" %d", n_code);
40812 test_xmlUCSIsLimbu(void) {
40815 #if defined(LIBXML_UNICODE_ENABLED)
40818 int code; /* UCS code point */
40821 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40822 mem_base = xmlMemBlocks();
40823 code = gen_int(n_code, 0);
40825 ret_val = xmlUCSIsLimbu(code);
40826 desret_int(ret_val);
40828 des_int(n_code, code, 0);
40829 xmlResetLastError();
40830 if (mem_base != xmlMemBlocks()) {
40831 printf("Leak of %d blocks found in xmlUCSIsLimbu",
40832 xmlMemBlocks() - mem_base);
40834 printf(" %d", n_code);
40846 test_xmlUCSIsLinearBIdeograms(void) {
40849 #if defined(LIBXML_UNICODE_ENABLED)
40852 int code; /* UCS code point */
40855 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40856 mem_base = xmlMemBlocks();
40857 code = gen_int(n_code, 0);
40859 ret_val = xmlUCSIsLinearBIdeograms(code);
40860 desret_int(ret_val);
40862 des_int(n_code, code, 0);
40863 xmlResetLastError();
40864 if (mem_base != xmlMemBlocks()) {
40865 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40866 xmlMemBlocks() - mem_base);
40868 printf(" %d", n_code);
40880 test_xmlUCSIsLinearBSyllabary(void) {
40883 #if defined(LIBXML_UNICODE_ENABLED)
40886 int code; /* UCS code point */
40889 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40890 mem_base = xmlMemBlocks();
40891 code = gen_int(n_code, 0);
40893 ret_val = xmlUCSIsLinearBSyllabary(code);
40894 desret_int(ret_val);
40896 des_int(n_code, code, 0);
40897 xmlResetLastError();
40898 if (mem_base != xmlMemBlocks()) {
40899 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40900 xmlMemBlocks() - mem_base);
40902 printf(" %d", n_code);
40914 test_xmlUCSIsLowSurrogates(void) {
40917 #if defined(LIBXML_UNICODE_ENABLED)
40920 int code; /* UCS code point */
40923 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40924 mem_base = xmlMemBlocks();
40925 code = gen_int(n_code, 0);
40927 ret_val = xmlUCSIsLowSurrogates(code);
40928 desret_int(ret_val);
40930 des_int(n_code, code, 0);
40931 xmlResetLastError();
40932 if (mem_base != xmlMemBlocks()) {
40933 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40934 xmlMemBlocks() - mem_base);
40936 printf(" %d", n_code);
40948 test_xmlUCSIsMalayalam(void) {
40951 #if defined(LIBXML_UNICODE_ENABLED)
40954 int code; /* UCS code point */
40957 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40958 mem_base = xmlMemBlocks();
40959 code = gen_int(n_code, 0);
40961 ret_val = xmlUCSIsMalayalam(code);
40962 desret_int(ret_val);
40964 des_int(n_code, code, 0);
40965 xmlResetLastError();
40966 if (mem_base != xmlMemBlocks()) {
40967 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40968 xmlMemBlocks() - mem_base);
40970 printf(" %d", n_code);
40982 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40985 #if defined(LIBXML_UNICODE_ENABLED)
40988 int code; /* UCS code point */
40991 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40992 mem_base = xmlMemBlocks();
40993 code = gen_int(n_code, 0);
40995 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40996 desret_int(ret_val);
40998 des_int(n_code, code, 0);
40999 xmlResetLastError();
41000 if (mem_base != xmlMemBlocks()) {
41001 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41002 xmlMemBlocks() - mem_base);
41004 printf(" %d", n_code);
41016 test_xmlUCSIsMathematicalOperators(void) {
41019 #if defined(LIBXML_UNICODE_ENABLED)
41022 int code; /* UCS code point */
41025 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41026 mem_base = xmlMemBlocks();
41027 code = gen_int(n_code, 0);
41029 ret_val = xmlUCSIsMathematicalOperators(code);
41030 desret_int(ret_val);
41032 des_int(n_code, code, 0);
41033 xmlResetLastError();
41034 if (mem_base != xmlMemBlocks()) {
41035 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41036 xmlMemBlocks() - mem_base);
41038 printf(" %d", n_code);
41050 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41053 #if defined(LIBXML_UNICODE_ENABLED)
41056 int code; /* UCS code point */
41059 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41060 mem_base = xmlMemBlocks();
41061 code = gen_int(n_code, 0);
41063 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41064 desret_int(ret_val);
41066 des_int(n_code, code, 0);
41067 xmlResetLastError();
41068 if (mem_base != xmlMemBlocks()) {
41069 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41070 xmlMemBlocks() - mem_base);
41072 printf(" %d", n_code);
41084 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41087 #if defined(LIBXML_UNICODE_ENABLED)
41090 int code; /* UCS code point */
41093 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41094 mem_base = xmlMemBlocks();
41095 code = gen_int(n_code, 0);
41097 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41098 desret_int(ret_val);
41100 des_int(n_code, code, 0);
41101 xmlResetLastError();
41102 if (mem_base != xmlMemBlocks()) {
41103 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41104 xmlMemBlocks() - mem_base);
41106 printf(" %d", n_code);
41118 test_xmlUCSIsMiscellaneousSymbols(void) {
41121 #if defined(LIBXML_UNICODE_ENABLED)
41124 int code; /* UCS code point */
41127 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41128 mem_base = xmlMemBlocks();
41129 code = gen_int(n_code, 0);
41131 ret_val = xmlUCSIsMiscellaneousSymbols(code);
41132 desret_int(ret_val);
41134 des_int(n_code, code, 0);
41135 xmlResetLastError();
41136 if (mem_base != xmlMemBlocks()) {
41137 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41138 xmlMemBlocks() - mem_base);
41140 printf(" %d", n_code);
41152 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41155 #if defined(LIBXML_UNICODE_ENABLED)
41158 int code; /* UCS code point */
41161 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41162 mem_base = xmlMemBlocks();
41163 code = gen_int(n_code, 0);
41165 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41166 desret_int(ret_val);
41168 des_int(n_code, code, 0);
41169 xmlResetLastError();
41170 if (mem_base != xmlMemBlocks()) {
41171 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41172 xmlMemBlocks() - mem_base);
41174 printf(" %d", n_code);
41186 test_xmlUCSIsMiscellaneousTechnical(void) {
41189 #if defined(LIBXML_UNICODE_ENABLED)
41192 int code; /* UCS code point */
41195 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41196 mem_base = xmlMemBlocks();
41197 code = gen_int(n_code, 0);
41199 ret_val = xmlUCSIsMiscellaneousTechnical(code);
41200 desret_int(ret_val);
41202 des_int(n_code, code, 0);
41203 xmlResetLastError();
41204 if (mem_base != xmlMemBlocks()) {
41205 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41206 xmlMemBlocks() - mem_base);
41208 printf(" %d", n_code);
41220 test_xmlUCSIsMongolian(void) {
41223 #if defined(LIBXML_UNICODE_ENABLED)
41226 int code; /* UCS code point */
41229 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41230 mem_base = xmlMemBlocks();
41231 code = gen_int(n_code, 0);
41233 ret_val = xmlUCSIsMongolian(code);
41234 desret_int(ret_val);
41236 des_int(n_code, code, 0);
41237 xmlResetLastError();
41238 if (mem_base != xmlMemBlocks()) {
41239 printf("Leak of %d blocks found in xmlUCSIsMongolian",
41240 xmlMemBlocks() - mem_base);
41242 printf(" %d", n_code);
41254 test_xmlUCSIsMusicalSymbols(void) {
41257 #if defined(LIBXML_UNICODE_ENABLED)
41260 int code; /* UCS code point */
41263 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41264 mem_base = xmlMemBlocks();
41265 code = gen_int(n_code, 0);
41267 ret_val = xmlUCSIsMusicalSymbols(code);
41268 desret_int(ret_val);
41270 des_int(n_code, code, 0);
41271 xmlResetLastError();
41272 if (mem_base != xmlMemBlocks()) {
41273 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41274 xmlMemBlocks() - mem_base);
41276 printf(" %d", n_code);
41288 test_xmlUCSIsMyanmar(void) {
41291 #if defined(LIBXML_UNICODE_ENABLED)
41294 int code; /* UCS code point */
41297 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41298 mem_base = xmlMemBlocks();
41299 code = gen_int(n_code, 0);
41301 ret_val = xmlUCSIsMyanmar(code);
41302 desret_int(ret_val);
41304 des_int(n_code, code, 0);
41305 xmlResetLastError();
41306 if (mem_base != xmlMemBlocks()) {
41307 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41308 xmlMemBlocks() - mem_base);
41310 printf(" %d", n_code);
41322 test_xmlUCSIsNumberForms(void) {
41325 #if defined(LIBXML_UNICODE_ENABLED)
41328 int code; /* UCS code point */
41331 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41332 mem_base = xmlMemBlocks();
41333 code = gen_int(n_code, 0);
41335 ret_val = xmlUCSIsNumberForms(code);
41336 desret_int(ret_val);
41338 des_int(n_code, code, 0);
41339 xmlResetLastError();
41340 if (mem_base != xmlMemBlocks()) {
41341 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41342 xmlMemBlocks() - mem_base);
41344 printf(" %d", n_code);
41356 test_xmlUCSIsOgham(void) {
41359 #if defined(LIBXML_UNICODE_ENABLED)
41362 int code; /* UCS code point */
41365 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41366 mem_base = xmlMemBlocks();
41367 code = gen_int(n_code, 0);
41369 ret_val = xmlUCSIsOgham(code);
41370 desret_int(ret_val);
41372 des_int(n_code, code, 0);
41373 xmlResetLastError();
41374 if (mem_base != xmlMemBlocks()) {
41375 printf("Leak of %d blocks found in xmlUCSIsOgham",
41376 xmlMemBlocks() - mem_base);
41378 printf(" %d", n_code);
41390 test_xmlUCSIsOldItalic(void) {
41393 #if defined(LIBXML_UNICODE_ENABLED)
41396 int code; /* UCS code point */
41399 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41400 mem_base = xmlMemBlocks();
41401 code = gen_int(n_code, 0);
41403 ret_val = xmlUCSIsOldItalic(code);
41404 desret_int(ret_val);
41406 des_int(n_code, code, 0);
41407 xmlResetLastError();
41408 if (mem_base != xmlMemBlocks()) {
41409 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41410 xmlMemBlocks() - mem_base);
41412 printf(" %d", n_code);
41424 test_xmlUCSIsOpticalCharacterRecognition(void) {
41427 #if defined(LIBXML_UNICODE_ENABLED)
41430 int code; /* UCS code point */
41433 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41434 mem_base = xmlMemBlocks();
41435 code = gen_int(n_code, 0);
41437 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41438 desret_int(ret_val);
41440 des_int(n_code, code, 0);
41441 xmlResetLastError();
41442 if (mem_base != xmlMemBlocks()) {
41443 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41444 xmlMemBlocks() - mem_base);
41446 printf(" %d", n_code);
41458 test_xmlUCSIsOriya(void) {
41461 #if defined(LIBXML_UNICODE_ENABLED)
41464 int code; /* UCS code point */
41467 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41468 mem_base = xmlMemBlocks();
41469 code = gen_int(n_code, 0);
41471 ret_val = xmlUCSIsOriya(code);
41472 desret_int(ret_val);
41474 des_int(n_code, code, 0);
41475 xmlResetLastError();
41476 if (mem_base != xmlMemBlocks()) {
41477 printf("Leak of %d blocks found in xmlUCSIsOriya",
41478 xmlMemBlocks() - mem_base);
41480 printf(" %d", n_code);
41492 test_xmlUCSIsOsmanya(void) {
41495 #if defined(LIBXML_UNICODE_ENABLED)
41498 int code; /* UCS code point */
41501 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41502 mem_base = xmlMemBlocks();
41503 code = gen_int(n_code, 0);
41505 ret_val = xmlUCSIsOsmanya(code);
41506 desret_int(ret_val);
41508 des_int(n_code, code, 0);
41509 xmlResetLastError();
41510 if (mem_base != xmlMemBlocks()) {
41511 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41512 xmlMemBlocks() - mem_base);
41514 printf(" %d", n_code);
41526 test_xmlUCSIsPhoneticExtensions(void) {
41529 #if defined(LIBXML_UNICODE_ENABLED)
41532 int code; /* UCS code point */
41535 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41536 mem_base = xmlMemBlocks();
41537 code = gen_int(n_code, 0);
41539 ret_val = xmlUCSIsPhoneticExtensions(code);
41540 desret_int(ret_val);
41542 des_int(n_code, code, 0);
41543 xmlResetLastError();
41544 if (mem_base != xmlMemBlocks()) {
41545 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41546 xmlMemBlocks() - mem_base);
41548 printf(" %d", n_code);
41560 test_xmlUCSIsPrivateUse(void) {
41563 #if defined(LIBXML_UNICODE_ENABLED)
41566 int code; /* UCS code point */
41569 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41570 mem_base = xmlMemBlocks();
41571 code = gen_int(n_code, 0);
41573 ret_val = xmlUCSIsPrivateUse(code);
41574 desret_int(ret_val);
41576 des_int(n_code, code, 0);
41577 xmlResetLastError();
41578 if (mem_base != xmlMemBlocks()) {
41579 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41580 xmlMemBlocks() - mem_base);
41582 printf(" %d", n_code);
41594 test_xmlUCSIsPrivateUseArea(void) {
41597 #if defined(LIBXML_UNICODE_ENABLED)
41600 int code; /* UCS code point */
41603 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41604 mem_base = xmlMemBlocks();
41605 code = gen_int(n_code, 0);
41607 ret_val = xmlUCSIsPrivateUseArea(code);
41608 desret_int(ret_val);
41610 des_int(n_code, code, 0);
41611 xmlResetLastError();
41612 if (mem_base != xmlMemBlocks()) {
41613 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41614 xmlMemBlocks() - mem_base);
41616 printf(" %d", n_code);
41628 test_xmlUCSIsRunic(void) {
41631 #if defined(LIBXML_UNICODE_ENABLED)
41634 int code; /* UCS code point */
41637 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41638 mem_base = xmlMemBlocks();
41639 code = gen_int(n_code, 0);
41641 ret_val = xmlUCSIsRunic(code);
41642 desret_int(ret_val);
41644 des_int(n_code, code, 0);
41645 xmlResetLastError();
41646 if (mem_base != xmlMemBlocks()) {
41647 printf("Leak of %d blocks found in xmlUCSIsRunic",
41648 xmlMemBlocks() - mem_base);
41650 printf(" %d", n_code);
41662 test_xmlUCSIsShavian(void) {
41665 #if defined(LIBXML_UNICODE_ENABLED)
41668 int code; /* UCS code point */
41671 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41672 mem_base = xmlMemBlocks();
41673 code = gen_int(n_code, 0);
41675 ret_val = xmlUCSIsShavian(code);
41676 desret_int(ret_val);
41678 des_int(n_code, code, 0);
41679 xmlResetLastError();
41680 if (mem_base != xmlMemBlocks()) {
41681 printf("Leak of %d blocks found in xmlUCSIsShavian",
41682 xmlMemBlocks() - mem_base);
41684 printf(" %d", n_code);
41696 test_xmlUCSIsSinhala(void) {
41699 #if defined(LIBXML_UNICODE_ENABLED)
41702 int code; /* UCS code point */
41705 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41706 mem_base = xmlMemBlocks();
41707 code = gen_int(n_code, 0);
41709 ret_val = xmlUCSIsSinhala(code);
41710 desret_int(ret_val);
41712 des_int(n_code, code, 0);
41713 xmlResetLastError();
41714 if (mem_base != xmlMemBlocks()) {
41715 printf("Leak of %d blocks found in xmlUCSIsSinhala",
41716 xmlMemBlocks() - mem_base);
41718 printf(" %d", n_code);
41730 test_xmlUCSIsSmallFormVariants(void) {
41733 #if defined(LIBXML_UNICODE_ENABLED)
41736 int code; /* UCS code point */
41739 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41740 mem_base = xmlMemBlocks();
41741 code = gen_int(n_code, 0);
41743 ret_val = xmlUCSIsSmallFormVariants(code);
41744 desret_int(ret_val);
41746 des_int(n_code, code, 0);
41747 xmlResetLastError();
41748 if (mem_base != xmlMemBlocks()) {
41749 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41750 xmlMemBlocks() - mem_base);
41752 printf(" %d", n_code);
41764 test_xmlUCSIsSpacingModifierLetters(void) {
41767 #if defined(LIBXML_UNICODE_ENABLED)
41770 int code; /* UCS code point */
41773 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41774 mem_base = xmlMemBlocks();
41775 code = gen_int(n_code, 0);
41777 ret_val = xmlUCSIsSpacingModifierLetters(code);
41778 desret_int(ret_val);
41780 des_int(n_code, code, 0);
41781 xmlResetLastError();
41782 if (mem_base != xmlMemBlocks()) {
41783 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41784 xmlMemBlocks() - mem_base);
41786 printf(" %d", n_code);
41798 test_xmlUCSIsSpecials(void) {
41801 #if defined(LIBXML_UNICODE_ENABLED)
41804 int code; /* UCS code point */
41807 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41808 mem_base = xmlMemBlocks();
41809 code = gen_int(n_code, 0);
41811 ret_val = xmlUCSIsSpecials(code);
41812 desret_int(ret_val);
41814 des_int(n_code, code, 0);
41815 xmlResetLastError();
41816 if (mem_base != xmlMemBlocks()) {
41817 printf("Leak of %d blocks found in xmlUCSIsSpecials",
41818 xmlMemBlocks() - mem_base);
41820 printf(" %d", n_code);
41832 test_xmlUCSIsSuperscriptsandSubscripts(void) {
41835 #if defined(LIBXML_UNICODE_ENABLED)
41838 int code; /* UCS code point */
41841 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41842 mem_base = xmlMemBlocks();
41843 code = gen_int(n_code, 0);
41845 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41846 desret_int(ret_val);
41848 des_int(n_code, code, 0);
41849 xmlResetLastError();
41850 if (mem_base != xmlMemBlocks()) {
41851 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41852 xmlMemBlocks() - mem_base);
41854 printf(" %d", n_code);
41866 test_xmlUCSIsSupplementalArrowsA(void) {
41869 #if defined(LIBXML_UNICODE_ENABLED)
41872 int code; /* UCS code point */
41875 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41876 mem_base = xmlMemBlocks();
41877 code = gen_int(n_code, 0);
41879 ret_val = xmlUCSIsSupplementalArrowsA(code);
41880 desret_int(ret_val);
41882 des_int(n_code, code, 0);
41883 xmlResetLastError();
41884 if (mem_base != xmlMemBlocks()) {
41885 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41886 xmlMemBlocks() - mem_base);
41888 printf(" %d", n_code);
41900 test_xmlUCSIsSupplementalArrowsB(void) {
41903 #if defined(LIBXML_UNICODE_ENABLED)
41906 int code; /* UCS code point */
41909 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41910 mem_base = xmlMemBlocks();
41911 code = gen_int(n_code, 0);
41913 ret_val = xmlUCSIsSupplementalArrowsB(code);
41914 desret_int(ret_val);
41916 des_int(n_code, code, 0);
41917 xmlResetLastError();
41918 if (mem_base != xmlMemBlocks()) {
41919 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41920 xmlMemBlocks() - mem_base);
41922 printf(" %d", n_code);
41934 test_xmlUCSIsSupplementalMathematicalOperators(void) {
41937 #if defined(LIBXML_UNICODE_ENABLED)
41940 int code; /* UCS code point */
41943 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41944 mem_base = xmlMemBlocks();
41945 code = gen_int(n_code, 0);
41947 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41948 desret_int(ret_val);
41950 des_int(n_code, code, 0);
41951 xmlResetLastError();
41952 if (mem_base != xmlMemBlocks()) {
41953 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41954 xmlMemBlocks() - mem_base);
41956 printf(" %d", n_code);
41968 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41971 #if defined(LIBXML_UNICODE_ENABLED)
41974 int code; /* UCS code point */
41977 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41978 mem_base = xmlMemBlocks();
41979 code = gen_int(n_code, 0);
41981 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41982 desret_int(ret_val);
41984 des_int(n_code, code, 0);
41985 xmlResetLastError();
41986 if (mem_base != xmlMemBlocks()) {
41987 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41988 xmlMemBlocks() - mem_base);
41990 printf(" %d", n_code);
42002 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42005 #if defined(LIBXML_UNICODE_ENABLED)
42008 int code; /* UCS code point */
42011 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42012 mem_base = xmlMemBlocks();
42013 code = gen_int(n_code, 0);
42015 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42016 desret_int(ret_val);
42018 des_int(n_code, code, 0);
42019 xmlResetLastError();
42020 if (mem_base != xmlMemBlocks()) {
42021 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42022 xmlMemBlocks() - mem_base);
42024 printf(" %d", n_code);
42036 test_xmlUCSIsSyriac(void) {
42039 #if defined(LIBXML_UNICODE_ENABLED)
42042 int code; /* UCS code point */
42045 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42046 mem_base = xmlMemBlocks();
42047 code = gen_int(n_code, 0);
42049 ret_val = xmlUCSIsSyriac(code);
42050 desret_int(ret_val);
42052 des_int(n_code, code, 0);
42053 xmlResetLastError();
42054 if (mem_base != xmlMemBlocks()) {
42055 printf("Leak of %d blocks found in xmlUCSIsSyriac",
42056 xmlMemBlocks() - mem_base);
42058 printf(" %d", n_code);
42070 test_xmlUCSIsTagalog(void) {
42073 #if defined(LIBXML_UNICODE_ENABLED)
42076 int code; /* UCS code point */
42079 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42080 mem_base = xmlMemBlocks();
42081 code = gen_int(n_code, 0);
42083 ret_val = xmlUCSIsTagalog(code);
42084 desret_int(ret_val);
42086 des_int(n_code, code, 0);
42087 xmlResetLastError();
42088 if (mem_base != xmlMemBlocks()) {
42089 printf("Leak of %d blocks found in xmlUCSIsTagalog",
42090 xmlMemBlocks() - mem_base);
42092 printf(" %d", n_code);
42104 test_xmlUCSIsTagbanwa(void) {
42107 #if defined(LIBXML_UNICODE_ENABLED)
42110 int code; /* UCS code point */
42113 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42114 mem_base = xmlMemBlocks();
42115 code = gen_int(n_code, 0);
42117 ret_val = xmlUCSIsTagbanwa(code);
42118 desret_int(ret_val);
42120 des_int(n_code, code, 0);
42121 xmlResetLastError();
42122 if (mem_base != xmlMemBlocks()) {
42123 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42124 xmlMemBlocks() - mem_base);
42126 printf(" %d", n_code);
42138 test_xmlUCSIsTags(void) {
42141 #if defined(LIBXML_UNICODE_ENABLED)
42144 int code; /* UCS code point */
42147 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42148 mem_base = xmlMemBlocks();
42149 code = gen_int(n_code, 0);
42151 ret_val = xmlUCSIsTags(code);
42152 desret_int(ret_val);
42154 des_int(n_code, code, 0);
42155 xmlResetLastError();
42156 if (mem_base != xmlMemBlocks()) {
42157 printf("Leak of %d blocks found in xmlUCSIsTags",
42158 xmlMemBlocks() - mem_base);
42160 printf(" %d", n_code);
42172 test_xmlUCSIsTaiLe(void) {
42175 #if defined(LIBXML_UNICODE_ENABLED)
42178 int code; /* UCS code point */
42181 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42182 mem_base = xmlMemBlocks();
42183 code = gen_int(n_code, 0);
42185 ret_val = xmlUCSIsTaiLe(code);
42186 desret_int(ret_val);
42188 des_int(n_code, code, 0);
42189 xmlResetLastError();
42190 if (mem_base != xmlMemBlocks()) {
42191 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42192 xmlMemBlocks() - mem_base);
42194 printf(" %d", n_code);
42206 test_xmlUCSIsTaiXuanJingSymbols(void) {
42209 #if defined(LIBXML_UNICODE_ENABLED)
42212 int code; /* UCS code point */
42215 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42216 mem_base = xmlMemBlocks();
42217 code = gen_int(n_code, 0);
42219 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42220 desret_int(ret_val);
42222 des_int(n_code, code, 0);
42223 xmlResetLastError();
42224 if (mem_base != xmlMemBlocks()) {
42225 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42226 xmlMemBlocks() - mem_base);
42228 printf(" %d", n_code);
42240 test_xmlUCSIsTamil(void) {
42243 #if defined(LIBXML_UNICODE_ENABLED)
42246 int code; /* UCS code point */
42249 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42250 mem_base = xmlMemBlocks();
42251 code = gen_int(n_code, 0);
42253 ret_val = xmlUCSIsTamil(code);
42254 desret_int(ret_val);
42256 des_int(n_code, code, 0);
42257 xmlResetLastError();
42258 if (mem_base != xmlMemBlocks()) {
42259 printf("Leak of %d blocks found in xmlUCSIsTamil",
42260 xmlMemBlocks() - mem_base);
42262 printf(" %d", n_code);
42274 test_xmlUCSIsTelugu(void) {
42277 #if defined(LIBXML_UNICODE_ENABLED)
42280 int code; /* UCS code point */
42283 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42284 mem_base = xmlMemBlocks();
42285 code = gen_int(n_code, 0);
42287 ret_val = xmlUCSIsTelugu(code);
42288 desret_int(ret_val);
42290 des_int(n_code, code, 0);
42291 xmlResetLastError();
42292 if (mem_base != xmlMemBlocks()) {
42293 printf("Leak of %d blocks found in xmlUCSIsTelugu",
42294 xmlMemBlocks() - mem_base);
42296 printf(" %d", n_code);
42308 test_xmlUCSIsThaana(void) {
42311 #if defined(LIBXML_UNICODE_ENABLED)
42314 int code; /* UCS code point */
42317 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42318 mem_base = xmlMemBlocks();
42319 code = gen_int(n_code, 0);
42321 ret_val = xmlUCSIsThaana(code);
42322 desret_int(ret_val);
42324 des_int(n_code, code, 0);
42325 xmlResetLastError();
42326 if (mem_base != xmlMemBlocks()) {
42327 printf("Leak of %d blocks found in xmlUCSIsThaana",
42328 xmlMemBlocks() - mem_base);
42330 printf(" %d", n_code);
42342 test_xmlUCSIsThai(void) {
42345 #if defined(LIBXML_UNICODE_ENABLED)
42348 int code; /* UCS code point */
42351 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42352 mem_base = xmlMemBlocks();
42353 code = gen_int(n_code, 0);
42355 ret_val = xmlUCSIsThai(code);
42356 desret_int(ret_val);
42358 des_int(n_code, code, 0);
42359 xmlResetLastError();
42360 if (mem_base != xmlMemBlocks()) {
42361 printf("Leak of %d blocks found in xmlUCSIsThai",
42362 xmlMemBlocks() - mem_base);
42364 printf(" %d", n_code);
42376 test_xmlUCSIsTibetan(void) {
42379 #if defined(LIBXML_UNICODE_ENABLED)
42382 int code; /* UCS code point */
42385 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42386 mem_base = xmlMemBlocks();
42387 code = gen_int(n_code, 0);
42389 ret_val = xmlUCSIsTibetan(code);
42390 desret_int(ret_val);
42392 des_int(n_code, code, 0);
42393 xmlResetLastError();
42394 if (mem_base != xmlMemBlocks()) {
42395 printf("Leak of %d blocks found in xmlUCSIsTibetan",
42396 xmlMemBlocks() - mem_base);
42398 printf(" %d", n_code);
42410 test_xmlUCSIsUgaritic(void) {
42413 #if defined(LIBXML_UNICODE_ENABLED)
42416 int code; /* UCS code point */
42419 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42420 mem_base = xmlMemBlocks();
42421 code = gen_int(n_code, 0);
42423 ret_val = xmlUCSIsUgaritic(code);
42424 desret_int(ret_val);
42426 des_int(n_code, code, 0);
42427 xmlResetLastError();
42428 if (mem_base != xmlMemBlocks()) {
42429 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42430 xmlMemBlocks() - mem_base);
42432 printf(" %d", n_code);
42444 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42447 #if defined(LIBXML_UNICODE_ENABLED)
42450 int code; /* UCS code point */
42453 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42454 mem_base = xmlMemBlocks();
42455 code = gen_int(n_code, 0);
42457 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42458 desret_int(ret_val);
42460 des_int(n_code, code, 0);
42461 xmlResetLastError();
42462 if (mem_base != xmlMemBlocks()) {
42463 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42464 xmlMemBlocks() - mem_base);
42466 printf(" %d", n_code);
42478 test_xmlUCSIsVariationSelectors(void) {
42481 #if defined(LIBXML_UNICODE_ENABLED)
42484 int code; /* UCS code point */
42487 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42488 mem_base = xmlMemBlocks();
42489 code = gen_int(n_code, 0);
42491 ret_val = xmlUCSIsVariationSelectors(code);
42492 desret_int(ret_val);
42494 des_int(n_code, code, 0);
42495 xmlResetLastError();
42496 if (mem_base != xmlMemBlocks()) {
42497 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42498 xmlMemBlocks() - mem_base);
42500 printf(" %d", n_code);
42512 test_xmlUCSIsVariationSelectorsSupplement(void) {
42515 #if defined(LIBXML_UNICODE_ENABLED)
42518 int code; /* UCS code point */
42521 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42522 mem_base = xmlMemBlocks();
42523 code = gen_int(n_code, 0);
42525 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42526 desret_int(ret_val);
42528 des_int(n_code, code, 0);
42529 xmlResetLastError();
42530 if (mem_base != xmlMemBlocks()) {
42531 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42532 xmlMemBlocks() - mem_base);
42534 printf(" %d", n_code);
42546 test_xmlUCSIsYiRadicals(void) {
42549 #if defined(LIBXML_UNICODE_ENABLED)
42552 int code; /* UCS code point */
42555 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42556 mem_base = xmlMemBlocks();
42557 code = gen_int(n_code, 0);
42559 ret_val = xmlUCSIsYiRadicals(code);
42560 desret_int(ret_val);
42562 des_int(n_code, code, 0);
42563 xmlResetLastError();
42564 if (mem_base != xmlMemBlocks()) {
42565 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42566 xmlMemBlocks() - mem_base);
42568 printf(" %d", n_code);
42580 test_xmlUCSIsYiSyllables(void) {
42583 #if defined(LIBXML_UNICODE_ENABLED)
42586 int code; /* UCS code point */
42589 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42590 mem_base = xmlMemBlocks();
42591 code = gen_int(n_code, 0);
42593 ret_val = xmlUCSIsYiSyllables(code);
42594 desret_int(ret_val);
42596 des_int(n_code, code, 0);
42597 xmlResetLastError();
42598 if (mem_base != xmlMemBlocks()) {
42599 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42600 xmlMemBlocks() - mem_base);
42602 printf(" %d", n_code);
42614 test_xmlUCSIsYijingHexagramSymbols(void) {
42617 #if defined(LIBXML_UNICODE_ENABLED)
42620 int code; /* UCS code point */
42623 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42624 mem_base = xmlMemBlocks();
42625 code = gen_int(n_code, 0);
42627 ret_val = xmlUCSIsYijingHexagramSymbols(code);
42628 desret_int(ret_val);
42630 des_int(n_code, code, 0);
42631 xmlResetLastError();
42632 if (mem_base != xmlMemBlocks()) {
42633 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42634 xmlMemBlocks() - mem_base);
42636 printf(" %d", n_code);
42647 test_xmlunicode(void) {
42650 if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42651 test_ret += test_xmlUCSIsAegeanNumbers();
42652 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42653 test_ret += test_xmlUCSIsArabic();
42654 test_ret += test_xmlUCSIsArabicPresentationFormsA();
42655 test_ret += test_xmlUCSIsArabicPresentationFormsB();
42656 test_ret += test_xmlUCSIsArmenian();
42657 test_ret += test_xmlUCSIsArrows();
42658 test_ret += test_xmlUCSIsBasicLatin();
42659 test_ret += test_xmlUCSIsBengali();
42660 test_ret += test_xmlUCSIsBlock();
42661 test_ret += test_xmlUCSIsBlockElements();
42662 test_ret += test_xmlUCSIsBopomofo();
42663 test_ret += test_xmlUCSIsBopomofoExtended();
42664 test_ret += test_xmlUCSIsBoxDrawing();
42665 test_ret += test_xmlUCSIsBraillePatterns();
42666 test_ret += test_xmlUCSIsBuhid();
42667 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42668 test_ret += test_xmlUCSIsCJKCompatibility();
42669 test_ret += test_xmlUCSIsCJKCompatibilityForms();
42670 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42671 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42672 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42673 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42674 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42675 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42676 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42677 test_ret += test_xmlUCSIsCat();
42678 test_ret += test_xmlUCSIsCatC();
42679 test_ret += test_xmlUCSIsCatCc();
42680 test_ret += test_xmlUCSIsCatCf();
42681 test_ret += test_xmlUCSIsCatCo();
42682 test_ret += test_xmlUCSIsCatCs();
42683 test_ret += test_xmlUCSIsCatL();
42684 test_ret += test_xmlUCSIsCatLl();
42685 test_ret += test_xmlUCSIsCatLm();
42686 test_ret += test_xmlUCSIsCatLo();
42687 test_ret += test_xmlUCSIsCatLt();
42688 test_ret += test_xmlUCSIsCatLu();
42689 test_ret += test_xmlUCSIsCatM();
42690 test_ret += test_xmlUCSIsCatMc();
42691 test_ret += test_xmlUCSIsCatMe();
42692 test_ret += test_xmlUCSIsCatMn();
42693 test_ret += test_xmlUCSIsCatN();
42694 test_ret += test_xmlUCSIsCatNd();
42695 test_ret += test_xmlUCSIsCatNl();
42696 test_ret += test_xmlUCSIsCatNo();
42697 test_ret += test_xmlUCSIsCatP();
42698 test_ret += test_xmlUCSIsCatPc();
42699 test_ret += test_xmlUCSIsCatPd();
42700 test_ret += test_xmlUCSIsCatPe();
42701 test_ret += test_xmlUCSIsCatPf();
42702 test_ret += test_xmlUCSIsCatPi();
42703 test_ret += test_xmlUCSIsCatPo();
42704 test_ret += test_xmlUCSIsCatPs();
42705 test_ret += test_xmlUCSIsCatS();
42706 test_ret += test_xmlUCSIsCatSc();
42707 test_ret += test_xmlUCSIsCatSk();
42708 test_ret += test_xmlUCSIsCatSm();
42709 test_ret += test_xmlUCSIsCatSo();
42710 test_ret += test_xmlUCSIsCatZ();
42711 test_ret += test_xmlUCSIsCatZl();
42712 test_ret += test_xmlUCSIsCatZp();
42713 test_ret += test_xmlUCSIsCatZs();
42714 test_ret += test_xmlUCSIsCherokee();
42715 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42716 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42717 test_ret += test_xmlUCSIsCombiningHalfMarks();
42718 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42719 test_ret += test_xmlUCSIsControlPictures();
42720 test_ret += test_xmlUCSIsCurrencySymbols();
42721 test_ret += test_xmlUCSIsCypriotSyllabary();
42722 test_ret += test_xmlUCSIsCyrillic();
42723 test_ret += test_xmlUCSIsCyrillicSupplement();
42724 test_ret += test_xmlUCSIsDeseret();
42725 test_ret += test_xmlUCSIsDevanagari();
42726 test_ret += test_xmlUCSIsDingbats();
42727 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42728 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42729 test_ret += test_xmlUCSIsEthiopic();
42730 test_ret += test_xmlUCSIsGeneralPunctuation();
42731 test_ret += test_xmlUCSIsGeometricShapes();
42732 test_ret += test_xmlUCSIsGeorgian();
42733 test_ret += test_xmlUCSIsGothic();
42734 test_ret += test_xmlUCSIsGreek();
42735 test_ret += test_xmlUCSIsGreekExtended();
42736 test_ret += test_xmlUCSIsGreekandCoptic();
42737 test_ret += test_xmlUCSIsGujarati();
42738 test_ret += test_xmlUCSIsGurmukhi();
42739 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42740 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42741 test_ret += test_xmlUCSIsHangulJamo();
42742 test_ret += test_xmlUCSIsHangulSyllables();
42743 test_ret += test_xmlUCSIsHanunoo();
42744 test_ret += test_xmlUCSIsHebrew();
42745 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42746 test_ret += test_xmlUCSIsHighSurrogates();
42747 test_ret += test_xmlUCSIsHiragana();
42748 test_ret += test_xmlUCSIsIPAExtensions();
42749 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42750 test_ret += test_xmlUCSIsKanbun();
42751 test_ret += test_xmlUCSIsKangxiRadicals();
42752 test_ret += test_xmlUCSIsKannada();
42753 test_ret += test_xmlUCSIsKatakana();
42754 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42755 test_ret += test_xmlUCSIsKhmer();
42756 test_ret += test_xmlUCSIsKhmerSymbols();
42757 test_ret += test_xmlUCSIsLao();
42758 test_ret += test_xmlUCSIsLatin1Supplement();
42759 test_ret += test_xmlUCSIsLatinExtendedA();
42760 test_ret += test_xmlUCSIsLatinExtendedAdditional();
42761 test_ret += test_xmlUCSIsLatinExtendedB();
42762 test_ret += test_xmlUCSIsLetterlikeSymbols();
42763 test_ret += test_xmlUCSIsLimbu();
42764 test_ret += test_xmlUCSIsLinearBIdeograms();
42765 test_ret += test_xmlUCSIsLinearBSyllabary();
42766 test_ret += test_xmlUCSIsLowSurrogates();
42767 test_ret += test_xmlUCSIsMalayalam();
42768 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42769 test_ret += test_xmlUCSIsMathematicalOperators();
42770 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42771 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42772 test_ret += test_xmlUCSIsMiscellaneousSymbols();
42773 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42774 test_ret += test_xmlUCSIsMiscellaneousTechnical();
42775 test_ret += test_xmlUCSIsMongolian();
42776 test_ret += test_xmlUCSIsMusicalSymbols();
42777 test_ret += test_xmlUCSIsMyanmar();
42778 test_ret += test_xmlUCSIsNumberForms();
42779 test_ret += test_xmlUCSIsOgham();
42780 test_ret += test_xmlUCSIsOldItalic();
42781 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42782 test_ret += test_xmlUCSIsOriya();
42783 test_ret += test_xmlUCSIsOsmanya();
42784 test_ret += test_xmlUCSIsPhoneticExtensions();
42785 test_ret += test_xmlUCSIsPrivateUse();
42786 test_ret += test_xmlUCSIsPrivateUseArea();
42787 test_ret += test_xmlUCSIsRunic();
42788 test_ret += test_xmlUCSIsShavian();
42789 test_ret += test_xmlUCSIsSinhala();
42790 test_ret += test_xmlUCSIsSmallFormVariants();
42791 test_ret += test_xmlUCSIsSpacingModifierLetters();
42792 test_ret += test_xmlUCSIsSpecials();
42793 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42794 test_ret += test_xmlUCSIsSupplementalArrowsA();
42795 test_ret += test_xmlUCSIsSupplementalArrowsB();
42796 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42797 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42798 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42799 test_ret += test_xmlUCSIsSyriac();
42800 test_ret += test_xmlUCSIsTagalog();
42801 test_ret += test_xmlUCSIsTagbanwa();
42802 test_ret += test_xmlUCSIsTags();
42803 test_ret += test_xmlUCSIsTaiLe();
42804 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42805 test_ret += test_xmlUCSIsTamil();
42806 test_ret += test_xmlUCSIsTelugu();
42807 test_ret += test_xmlUCSIsThaana();
42808 test_ret += test_xmlUCSIsThai();
42809 test_ret += test_xmlUCSIsTibetan();
42810 test_ret += test_xmlUCSIsUgaritic();
42811 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42812 test_ret += test_xmlUCSIsVariationSelectors();
42813 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42814 test_ret += test_xmlUCSIsYiRadicals();
42815 test_ret += test_xmlUCSIsYiSyllables();
42816 test_ret += test_xmlUCSIsYijingHexagramSymbols();
42819 printf("Module xmlunicode: %d errors\n", test_ret);
42824 test_xmlNewTextWriter(void) {
42827 #if defined(LIBXML_WRITER_ENABLED)
42829 xmlTextWriterPtr ret_val;
42830 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42833 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42834 mem_base = xmlMemBlocks();
42835 out = gen_xmlOutputBufferPtr(n_out, 0);
42837 ret_val = xmlNewTextWriter(out);
42838 if (ret_val != NULL) out = NULL;
42839 desret_xmlTextWriterPtr(ret_val);
42841 des_xmlOutputBufferPtr(n_out, out, 0);
42842 xmlResetLastError();
42843 if (mem_base != xmlMemBlocks()) {
42844 printf("Leak of %d blocks found in xmlNewTextWriter",
42845 xmlMemBlocks() - mem_base);
42847 printf(" %d", n_out);
42859 test_xmlNewTextWriterFilename(void) {
42862 #if defined(LIBXML_WRITER_ENABLED)
42864 xmlTextWriterPtr ret_val;
42865 const char * uri; /* the URI of the resource for the output */
42867 int compression; /* compress the output? */
42870 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42871 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42872 mem_base = xmlMemBlocks();
42873 uri = gen_fileoutput(n_uri, 0);
42874 compression = gen_int(n_compression, 1);
42876 ret_val = xmlNewTextWriterFilename(uri, compression);
42877 desret_xmlTextWriterPtr(ret_val);
42879 des_fileoutput(n_uri, uri, 0);
42880 des_int(n_compression, compression, 1);
42881 xmlResetLastError();
42882 if (mem_base != xmlMemBlocks()) {
42883 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42884 xmlMemBlocks() - mem_base);
42886 printf(" %d", n_uri);
42887 printf(" %d", n_compression);
42900 test_xmlNewTextWriterMemory(void) {
42903 #if defined(LIBXML_WRITER_ENABLED)
42905 xmlTextWriterPtr ret_val;
42906 xmlBufferPtr buf; /* xmlBufferPtr */
42908 int compression; /* compress the output? */
42911 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42912 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42913 mem_base = xmlMemBlocks();
42914 buf = gen_xmlBufferPtr(n_buf, 0);
42915 compression = gen_int(n_compression, 1);
42917 ret_val = xmlNewTextWriterMemory(buf, compression);
42918 desret_xmlTextWriterPtr(ret_val);
42920 des_xmlBufferPtr(n_buf, buf, 0);
42921 des_int(n_compression, compression, 1);
42922 xmlResetLastError();
42923 if (mem_base != xmlMemBlocks()) {
42924 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42925 xmlMemBlocks() - mem_base);
42927 printf(" %d", n_buf);
42928 printf(" %d", n_compression);
42941 test_xmlNewTextWriterPushParser(void) {
42944 #if defined(LIBXML_WRITER_ENABLED)
42946 xmlTextWriterPtr ret_val;
42947 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42949 int compression; /* compress the output? */
42952 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42953 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42954 mem_base = xmlMemBlocks();
42955 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42956 compression = gen_int(n_compression, 1);
42958 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42959 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42960 desret_xmlTextWriterPtr(ret_val);
42962 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42963 des_int(n_compression, compression, 1);
42964 xmlResetLastError();
42965 if (mem_base != xmlMemBlocks()) {
42966 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42967 xmlMemBlocks() - mem_base);
42969 printf(" %d", n_ctxt);
42970 printf(" %d", n_compression);
42983 test_xmlNewTextWriterTree(void) {
42986 #if defined(LIBXML_WRITER_ENABLED)
42988 xmlTextWriterPtr ret_val;
42989 xmlDocPtr doc; /* xmlDocPtr */
42991 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42993 int compression; /* compress the output? */
42996 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42997 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42998 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42999 mem_base = xmlMemBlocks();
43000 doc = gen_xmlDocPtr(n_doc, 0);
43001 node = gen_xmlNodePtr(n_node, 1);
43002 compression = gen_int(n_compression, 2);
43004 ret_val = xmlNewTextWriterTree(doc, node, compression);
43005 desret_xmlTextWriterPtr(ret_val);
43007 des_xmlDocPtr(n_doc, doc, 0);
43008 des_xmlNodePtr(n_node, node, 1);
43009 des_int(n_compression, compression, 2);
43010 xmlResetLastError();
43011 if (mem_base != xmlMemBlocks()) {
43012 printf("Leak of %d blocks found in xmlNewTextWriterTree",
43013 xmlMemBlocks() - mem_base);
43015 printf(" %d", n_doc);
43016 printf(" %d", n_node);
43017 printf(" %d", n_compression);
43031 test_xmlTextWriterEndAttribute(void) {
43034 #if defined(LIBXML_WRITER_ENABLED)
43037 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43040 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43041 mem_base = xmlMemBlocks();
43042 writer = gen_xmlTextWriterPtr(n_writer, 0);
43044 ret_val = xmlTextWriterEndAttribute(writer);
43045 desret_int(ret_val);
43047 des_xmlTextWriterPtr(n_writer, writer, 0);
43048 xmlResetLastError();
43049 if (mem_base != xmlMemBlocks()) {
43050 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43051 xmlMemBlocks() - mem_base);
43053 printf(" %d", n_writer);
43065 test_xmlTextWriterEndCDATA(void) {
43068 #if defined(LIBXML_WRITER_ENABLED)
43071 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43074 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43075 mem_base = xmlMemBlocks();
43076 writer = gen_xmlTextWriterPtr(n_writer, 0);
43078 ret_val = xmlTextWriterEndCDATA(writer);
43079 desret_int(ret_val);
43081 des_xmlTextWriterPtr(n_writer, writer, 0);
43082 xmlResetLastError();
43083 if (mem_base != xmlMemBlocks()) {
43084 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43085 xmlMemBlocks() - mem_base);
43087 printf(" %d", n_writer);
43099 test_xmlTextWriterEndComment(void) {
43102 #if defined(LIBXML_WRITER_ENABLED)
43105 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43108 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43109 mem_base = xmlMemBlocks();
43110 writer = gen_xmlTextWriterPtr(n_writer, 0);
43112 ret_val = xmlTextWriterEndComment(writer);
43113 desret_int(ret_val);
43115 des_xmlTextWriterPtr(n_writer, writer, 0);
43116 xmlResetLastError();
43117 if (mem_base != xmlMemBlocks()) {
43118 printf("Leak of %d blocks found in xmlTextWriterEndComment",
43119 xmlMemBlocks() - mem_base);
43121 printf(" %d", n_writer);
43133 test_xmlTextWriterEndDTD(void) {
43136 #if defined(LIBXML_WRITER_ENABLED)
43139 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43142 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43143 mem_base = xmlMemBlocks();
43144 writer = gen_xmlTextWriterPtr(n_writer, 0);
43146 ret_val = xmlTextWriterEndDTD(writer);
43147 desret_int(ret_val);
43149 des_xmlTextWriterPtr(n_writer, writer, 0);
43150 xmlResetLastError();
43151 if (mem_base != xmlMemBlocks()) {
43152 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43153 xmlMemBlocks() - mem_base);
43155 printf(" %d", n_writer);
43167 test_xmlTextWriterEndDTDAttlist(void) {
43170 #if defined(LIBXML_WRITER_ENABLED)
43173 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43176 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43177 mem_base = xmlMemBlocks();
43178 writer = gen_xmlTextWriterPtr(n_writer, 0);
43180 ret_val = xmlTextWriterEndDTDAttlist(writer);
43181 desret_int(ret_val);
43183 des_xmlTextWriterPtr(n_writer, writer, 0);
43184 xmlResetLastError();
43185 if (mem_base != xmlMemBlocks()) {
43186 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43187 xmlMemBlocks() - mem_base);
43189 printf(" %d", n_writer);
43201 test_xmlTextWriterEndDTDElement(void) {
43204 #if defined(LIBXML_WRITER_ENABLED)
43207 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43210 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43211 mem_base = xmlMemBlocks();
43212 writer = gen_xmlTextWriterPtr(n_writer, 0);
43214 ret_val = xmlTextWriterEndDTDElement(writer);
43215 desret_int(ret_val);
43217 des_xmlTextWriterPtr(n_writer, writer, 0);
43218 xmlResetLastError();
43219 if (mem_base != xmlMemBlocks()) {
43220 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43221 xmlMemBlocks() - mem_base);
43223 printf(" %d", n_writer);
43235 test_xmlTextWriterEndDTDEntity(void) {
43238 #if defined(LIBXML_WRITER_ENABLED)
43241 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43244 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43245 mem_base = xmlMemBlocks();
43246 writer = gen_xmlTextWriterPtr(n_writer, 0);
43248 ret_val = xmlTextWriterEndDTDEntity(writer);
43249 desret_int(ret_val);
43251 des_xmlTextWriterPtr(n_writer, writer, 0);
43252 xmlResetLastError();
43253 if (mem_base != xmlMemBlocks()) {
43254 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43255 xmlMemBlocks() - mem_base);
43257 printf(" %d", n_writer);
43269 test_xmlTextWriterEndDocument(void) {
43272 #if defined(LIBXML_WRITER_ENABLED)
43275 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43278 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43279 mem_base = xmlMemBlocks();
43280 writer = gen_xmlTextWriterPtr(n_writer, 0);
43282 ret_val = xmlTextWriterEndDocument(writer);
43283 desret_int(ret_val);
43285 des_xmlTextWriterPtr(n_writer, writer, 0);
43286 xmlResetLastError();
43287 if (mem_base != xmlMemBlocks()) {
43288 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43289 xmlMemBlocks() - mem_base);
43291 printf(" %d", n_writer);
43303 test_xmlTextWriterEndElement(void) {
43306 #if defined(LIBXML_WRITER_ENABLED)
43309 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43312 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43313 mem_base = xmlMemBlocks();
43314 writer = gen_xmlTextWriterPtr(n_writer, 0);
43316 ret_val = xmlTextWriterEndElement(writer);
43317 desret_int(ret_val);
43319 des_xmlTextWriterPtr(n_writer, writer, 0);
43320 xmlResetLastError();
43321 if (mem_base != xmlMemBlocks()) {
43322 printf("Leak of %d blocks found in xmlTextWriterEndElement",
43323 xmlMemBlocks() - mem_base);
43325 printf(" %d", n_writer);
43337 test_xmlTextWriterEndPI(void) {
43340 #if defined(LIBXML_WRITER_ENABLED)
43343 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43346 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43347 mem_base = xmlMemBlocks();
43348 writer = gen_xmlTextWriterPtr(n_writer, 0);
43350 ret_val = xmlTextWriterEndPI(writer);
43351 desret_int(ret_val);
43353 des_xmlTextWriterPtr(n_writer, writer, 0);
43354 xmlResetLastError();
43355 if (mem_base != xmlMemBlocks()) {
43356 printf("Leak of %d blocks found in xmlTextWriterEndPI",
43357 xmlMemBlocks() - mem_base);
43359 printf(" %d", n_writer);
43371 test_xmlTextWriterFlush(void) {
43374 #if defined(LIBXML_WRITER_ENABLED)
43377 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43380 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43381 mem_base = xmlMemBlocks();
43382 writer = gen_xmlTextWriterPtr(n_writer, 0);
43384 ret_val = xmlTextWriterFlush(writer);
43385 desret_int(ret_val);
43387 des_xmlTextWriterPtr(n_writer, writer, 0);
43388 xmlResetLastError();
43389 if (mem_base != xmlMemBlocks()) {
43390 printf("Leak of %d blocks found in xmlTextWriterFlush",
43391 xmlMemBlocks() - mem_base);
43393 printf(" %d", n_writer);
43405 test_xmlTextWriterFullEndElement(void) {
43408 #if defined(LIBXML_WRITER_ENABLED)
43411 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43414 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43415 mem_base = xmlMemBlocks();
43416 writer = gen_xmlTextWriterPtr(n_writer, 0);
43418 ret_val = xmlTextWriterFullEndElement(writer);
43419 desret_int(ret_val);
43421 des_xmlTextWriterPtr(n_writer, writer, 0);
43422 xmlResetLastError();
43423 if (mem_base != xmlMemBlocks()) {
43424 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43425 xmlMemBlocks() - mem_base);
43427 printf(" %d", n_writer);
43439 test_xmlTextWriterSetIndent(void) {
43442 #if defined(LIBXML_WRITER_ENABLED)
43445 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43447 int indent; /* do indentation? */
43450 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43451 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43452 mem_base = xmlMemBlocks();
43453 writer = gen_xmlTextWriterPtr(n_writer, 0);
43454 indent = gen_int(n_indent, 1);
43456 ret_val = xmlTextWriterSetIndent(writer, indent);
43457 desret_int(ret_val);
43459 des_xmlTextWriterPtr(n_writer, writer, 0);
43460 des_int(n_indent, indent, 1);
43461 xmlResetLastError();
43462 if (mem_base != xmlMemBlocks()) {
43463 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43464 xmlMemBlocks() - mem_base);
43466 printf(" %d", n_writer);
43467 printf(" %d", n_indent);
43480 test_xmlTextWriterSetIndentString(void) {
43483 #if defined(LIBXML_WRITER_ENABLED)
43486 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43488 xmlChar * str; /* the xmlChar string */
43491 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43492 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43493 mem_base = xmlMemBlocks();
43494 writer = gen_xmlTextWriterPtr(n_writer, 0);
43495 str = gen_const_xmlChar_ptr(n_str, 1);
43497 ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43498 desret_int(ret_val);
43500 des_xmlTextWriterPtr(n_writer, writer, 0);
43501 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43502 xmlResetLastError();
43503 if (mem_base != xmlMemBlocks()) {
43504 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43505 xmlMemBlocks() - mem_base);
43507 printf(" %d", n_writer);
43508 printf(" %d", n_str);
43521 test_xmlTextWriterStartAttribute(void) {
43524 #if defined(LIBXML_WRITER_ENABLED)
43527 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43529 xmlChar * name; /* element name */
43532 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43533 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43534 mem_base = xmlMemBlocks();
43535 writer = gen_xmlTextWriterPtr(n_writer, 0);
43536 name = gen_const_xmlChar_ptr(n_name, 1);
43538 ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43539 desret_int(ret_val);
43541 des_xmlTextWriterPtr(n_writer, writer, 0);
43542 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43543 xmlResetLastError();
43544 if (mem_base != xmlMemBlocks()) {
43545 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43546 xmlMemBlocks() - mem_base);
43548 printf(" %d", n_writer);
43549 printf(" %d", n_name);
43562 test_xmlTextWriterStartAttributeNS(void) {
43565 #if defined(LIBXML_WRITER_ENABLED)
43568 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43570 xmlChar * prefix; /* namespace prefix or NULL */
43572 xmlChar * name; /* element local name */
43574 xmlChar * namespaceURI; /* namespace URI or NULL */
43575 int n_namespaceURI;
43577 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43578 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43579 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43580 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43581 mem_base = xmlMemBlocks();
43582 writer = gen_xmlTextWriterPtr(n_writer, 0);
43583 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43584 name = gen_const_xmlChar_ptr(n_name, 2);
43585 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43587 ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43588 desret_int(ret_val);
43590 des_xmlTextWriterPtr(n_writer, writer, 0);
43591 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43592 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43593 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43594 xmlResetLastError();
43595 if (mem_base != xmlMemBlocks()) {
43596 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43597 xmlMemBlocks() - mem_base);
43599 printf(" %d", n_writer);
43600 printf(" %d", n_prefix);
43601 printf(" %d", n_name);
43602 printf(" %d", n_namespaceURI);
43617 test_xmlTextWriterStartCDATA(void) {
43620 #if defined(LIBXML_WRITER_ENABLED)
43623 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43626 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43627 mem_base = xmlMemBlocks();
43628 writer = gen_xmlTextWriterPtr(n_writer, 0);
43630 ret_val = xmlTextWriterStartCDATA(writer);
43631 desret_int(ret_val);
43633 des_xmlTextWriterPtr(n_writer, writer, 0);
43634 xmlResetLastError();
43635 if (mem_base != xmlMemBlocks()) {
43636 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43637 xmlMemBlocks() - mem_base);
43639 printf(" %d", n_writer);
43651 test_xmlTextWriterStartComment(void) {
43654 #if defined(LIBXML_WRITER_ENABLED)
43657 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43660 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43661 mem_base = xmlMemBlocks();
43662 writer = gen_xmlTextWriterPtr(n_writer, 0);
43664 ret_val = xmlTextWriterStartComment(writer);
43665 desret_int(ret_val);
43667 des_xmlTextWriterPtr(n_writer, writer, 0);
43668 xmlResetLastError();
43669 if (mem_base != xmlMemBlocks()) {
43670 printf("Leak of %d blocks found in xmlTextWriterStartComment",
43671 xmlMemBlocks() - mem_base);
43673 printf(" %d", n_writer);
43685 test_xmlTextWriterStartDTD(void) {
43688 #if defined(LIBXML_WRITER_ENABLED)
43691 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43693 xmlChar * name; /* the name of the DTD */
43695 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43697 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43700 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43701 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43702 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43703 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43704 mem_base = xmlMemBlocks();
43705 writer = gen_xmlTextWriterPtr(n_writer, 0);
43706 name = gen_const_xmlChar_ptr(n_name, 1);
43707 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43708 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43710 ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43711 desret_int(ret_val);
43713 des_xmlTextWriterPtr(n_writer, writer, 0);
43714 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43715 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43716 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43717 xmlResetLastError();
43718 if (mem_base != xmlMemBlocks()) {
43719 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43720 xmlMemBlocks() - mem_base);
43722 printf(" %d", n_writer);
43723 printf(" %d", n_name);
43724 printf(" %d", n_pubid);
43725 printf(" %d", n_sysid);
43740 test_xmlTextWriterStartDTDAttlist(void) {
43743 #if defined(LIBXML_WRITER_ENABLED)
43746 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43748 xmlChar * name; /* the name of the DTD ATTLIST */
43751 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43752 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43753 mem_base = xmlMemBlocks();
43754 writer = gen_xmlTextWriterPtr(n_writer, 0);
43755 name = gen_const_xmlChar_ptr(n_name, 1);
43757 ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43758 desret_int(ret_val);
43760 des_xmlTextWriterPtr(n_writer, writer, 0);
43761 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43762 xmlResetLastError();
43763 if (mem_base != xmlMemBlocks()) {
43764 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43765 xmlMemBlocks() - mem_base);
43767 printf(" %d", n_writer);
43768 printf(" %d", n_name);
43781 test_xmlTextWriterStartDTDElement(void) {
43784 #if defined(LIBXML_WRITER_ENABLED)
43787 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43789 xmlChar * name; /* the name of the DTD element */
43792 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43793 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43794 mem_base = xmlMemBlocks();
43795 writer = gen_xmlTextWriterPtr(n_writer, 0);
43796 name = gen_const_xmlChar_ptr(n_name, 1);
43798 ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43799 desret_int(ret_val);
43801 des_xmlTextWriterPtr(n_writer, writer, 0);
43802 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43803 xmlResetLastError();
43804 if (mem_base != xmlMemBlocks()) {
43805 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43806 xmlMemBlocks() - mem_base);
43808 printf(" %d", n_writer);
43809 printf(" %d", n_name);
43822 test_xmlTextWriterStartDTDEntity(void) {
43825 #if defined(LIBXML_WRITER_ENABLED)
43828 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43830 int pe; /* TRUE if this is a parameter entity, FALSE if not */
43832 xmlChar * name; /* the name of the DTD ATTLIST */
43835 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43836 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43837 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43838 mem_base = xmlMemBlocks();
43839 writer = gen_xmlTextWriterPtr(n_writer, 0);
43840 pe = gen_int(n_pe, 1);
43841 name = gen_const_xmlChar_ptr(n_name, 2);
43843 ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43844 desret_int(ret_val);
43846 des_xmlTextWriterPtr(n_writer, writer, 0);
43847 des_int(n_pe, pe, 1);
43848 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43849 xmlResetLastError();
43850 if (mem_base != xmlMemBlocks()) {
43851 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43852 xmlMemBlocks() - mem_base);
43854 printf(" %d", n_writer);
43855 printf(" %d", n_pe);
43856 printf(" %d", n_name);
43870 test_xmlTextWriterStartDocument(void) {
43873 #if defined(LIBXML_WRITER_ENABLED)
43876 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43878 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43880 char * encoding; /* the encoding or NULL for default */
43882 char * standalone; /* "yes" or "no" or NULL for default */
43885 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43886 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43887 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43888 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43889 mem_base = xmlMemBlocks();
43890 writer = gen_xmlTextWriterPtr(n_writer, 0);
43891 version = gen_const_char_ptr(n_version, 1);
43892 encoding = gen_const_char_ptr(n_encoding, 2);
43893 standalone = gen_const_char_ptr(n_standalone, 3);
43895 ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43896 desret_int(ret_val);
43898 des_xmlTextWriterPtr(n_writer, writer, 0);
43899 des_const_char_ptr(n_version, (const char *)version, 1);
43900 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43901 des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43902 xmlResetLastError();
43903 if (mem_base != xmlMemBlocks()) {
43904 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43905 xmlMemBlocks() - mem_base);
43907 printf(" %d", n_writer);
43908 printf(" %d", n_version);
43909 printf(" %d", n_encoding);
43910 printf(" %d", n_standalone);
43925 test_xmlTextWriterStartElement(void) {
43928 #if defined(LIBXML_WRITER_ENABLED)
43931 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43933 xmlChar * name; /* element name */
43936 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43937 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43938 mem_base = xmlMemBlocks();
43939 writer = gen_xmlTextWriterPtr(n_writer, 0);
43940 name = gen_const_xmlChar_ptr(n_name, 1);
43942 ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43943 desret_int(ret_val);
43945 des_xmlTextWriterPtr(n_writer, writer, 0);
43946 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43947 xmlResetLastError();
43948 if (mem_base != xmlMemBlocks()) {
43949 printf("Leak of %d blocks found in xmlTextWriterStartElement",
43950 xmlMemBlocks() - mem_base);
43952 printf(" %d", n_writer);
43953 printf(" %d", n_name);
43966 test_xmlTextWriterStartElementNS(void) {
43969 #if defined(LIBXML_WRITER_ENABLED)
43972 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43974 xmlChar * prefix; /* namespace prefix or NULL */
43976 xmlChar * name; /* element local name */
43978 xmlChar * namespaceURI; /* namespace URI or NULL */
43979 int n_namespaceURI;
43981 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43982 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43983 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43984 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43985 mem_base = xmlMemBlocks();
43986 writer = gen_xmlTextWriterPtr(n_writer, 0);
43987 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43988 name = gen_const_xmlChar_ptr(n_name, 2);
43989 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43991 ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43992 desret_int(ret_val);
43994 des_xmlTextWriterPtr(n_writer, writer, 0);
43995 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43996 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43997 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43998 xmlResetLastError();
43999 if (mem_base != xmlMemBlocks()) {
44000 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44001 xmlMemBlocks() - mem_base);
44003 printf(" %d", n_writer);
44004 printf(" %d", n_prefix);
44005 printf(" %d", n_name);
44006 printf(" %d", n_namespaceURI);
44021 test_xmlTextWriterStartPI(void) {
44024 #if defined(LIBXML_WRITER_ENABLED)
44027 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44029 xmlChar * target; /* PI target */
44032 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44033 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44034 mem_base = xmlMemBlocks();
44035 writer = gen_xmlTextWriterPtr(n_writer, 0);
44036 target = gen_const_xmlChar_ptr(n_target, 1);
44038 ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44039 desret_int(ret_val);
44041 des_xmlTextWriterPtr(n_writer, writer, 0);
44042 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44043 xmlResetLastError();
44044 if (mem_base != xmlMemBlocks()) {
44045 printf("Leak of %d blocks found in xmlTextWriterStartPI",
44046 xmlMemBlocks() - mem_base);
44048 printf(" %d", n_writer);
44049 printf(" %d", n_target);
44062 test_xmlTextWriterWriteAttribute(void) {
44065 #if defined(LIBXML_WRITER_ENABLED)
44068 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44070 xmlChar * name; /* attribute name */
44072 xmlChar * content; /* attribute content */
44075 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44076 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44077 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44078 mem_base = xmlMemBlocks();
44079 writer = gen_xmlTextWriterPtr(n_writer, 0);
44080 name = gen_const_xmlChar_ptr(n_name, 1);
44081 content = gen_const_xmlChar_ptr(n_content, 2);
44083 ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44084 desret_int(ret_val);
44086 des_xmlTextWriterPtr(n_writer, writer, 0);
44087 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44088 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44089 xmlResetLastError();
44090 if (mem_base != xmlMemBlocks()) {
44091 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44092 xmlMemBlocks() - mem_base);
44094 printf(" %d", n_writer);
44095 printf(" %d", n_name);
44096 printf(" %d", n_content);
44110 test_xmlTextWriterWriteAttributeNS(void) {
44113 #if defined(LIBXML_WRITER_ENABLED)
44116 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44118 xmlChar * prefix; /* namespace prefix */
44120 xmlChar * name; /* attribute local name */
44122 xmlChar * namespaceURI; /* namespace URI */
44123 int n_namespaceURI;
44124 xmlChar * content; /* attribute content */
44127 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44128 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44129 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44130 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44131 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44132 mem_base = xmlMemBlocks();
44133 writer = gen_xmlTextWriterPtr(n_writer, 0);
44134 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44135 name = gen_const_xmlChar_ptr(n_name, 2);
44136 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44137 content = gen_const_xmlChar_ptr(n_content, 4);
44139 ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44140 desret_int(ret_val);
44142 des_xmlTextWriterPtr(n_writer, writer, 0);
44143 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44144 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44145 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44146 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44147 xmlResetLastError();
44148 if (mem_base != xmlMemBlocks()) {
44149 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44150 xmlMemBlocks() - mem_base);
44152 printf(" %d", n_writer);
44153 printf(" %d", n_prefix);
44154 printf(" %d", n_name);
44155 printf(" %d", n_namespaceURI);
44156 printf(" %d", n_content);
44172 test_xmlTextWriterWriteBase64(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 = xmlTextWriterWriteBase64(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 xmlTextWriterWriteBase64",
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_xmlTextWriterWriteBinHex(void) {
44230 #if defined(LIBXML_WRITER_ENABLED)
44233 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44235 char * data; /* binary data */
44237 int start; /* the position within the data of the first byte to encode */
44239 int len; /* the number of bytes to encode */
44242 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44243 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44244 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44245 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44246 mem_base = xmlMemBlocks();
44247 writer = gen_xmlTextWriterPtr(n_writer, 0);
44248 data = gen_const_char_ptr(n_data, 1);
44249 start = gen_int(n_start, 2);
44250 len = gen_int(n_len, 3);
44252 ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44253 desret_int(ret_val);
44255 des_xmlTextWriterPtr(n_writer, writer, 0);
44256 des_const_char_ptr(n_data, (const char *)data, 1);
44257 des_int(n_start, start, 2);
44258 des_int(n_len, len, 3);
44259 xmlResetLastError();
44260 if (mem_base != xmlMemBlocks()) {
44261 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44262 xmlMemBlocks() - mem_base);
44264 printf(" %d", n_writer);
44265 printf(" %d", n_data);
44266 printf(" %d", n_start);
44267 printf(" %d", n_len);
44282 test_xmlTextWriterWriteCDATA(void) {
44285 #if defined(LIBXML_WRITER_ENABLED)
44288 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44290 xmlChar * content; /* CDATA content */
44293 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44294 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44295 mem_base = xmlMemBlocks();
44296 writer = gen_xmlTextWriterPtr(n_writer, 0);
44297 content = gen_const_xmlChar_ptr(n_content, 1);
44299 ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44300 desret_int(ret_val);
44302 des_xmlTextWriterPtr(n_writer, writer, 0);
44303 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44304 xmlResetLastError();
44305 if (mem_base != xmlMemBlocks()) {
44306 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44307 xmlMemBlocks() - mem_base);
44309 printf(" %d", n_writer);
44310 printf(" %d", n_content);
44323 test_xmlTextWriterWriteComment(void) {
44326 #if defined(LIBXML_WRITER_ENABLED)
44329 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44331 xmlChar * content; /* comment string */
44334 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44335 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44336 mem_base = xmlMemBlocks();
44337 writer = gen_xmlTextWriterPtr(n_writer, 0);
44338 content = gen_const_xmlChar_ptr(n_content, 1);
44340 ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44341 desret_int(ret_val);
44343 des_xmlTextWriterPtr(n_writer, writer, 0);
44344 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44345 xmlResetLastError();
44346 if (mem_base != xmlMemBlocks()) {
44347 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44348 xmlMemBlocks() - mem_base);
44350 printf(" %d", n_writer);
44351 printf(" %d", n_content);
44364 test_xmlTextWriterWriteDTD(void) {
44367 #if defined(LIBXML_WRITER_ENABLED)
44370 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44372 xmlChar * name; /* the name of the DTD */
44374 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44376 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44378 xmlChar * subset; /* string content of the DTD */
44381 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44382 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44383 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44384 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44385 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44386 mem_base = xmlMemBlocks();
44387 writer = gen_xmlTextWriterPtr(n_writer, 0);
44388 name = gen_const_xmlChar_ptr(n_name, 1);
44389 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44390 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44391 subset = gen_const_xmlChar_ptr(n_subset, 4);
44393 ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44394 desret_int(ret_val);
44396 des_xmlTextWriterPtr(n_writer, writer, 0);
44397 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44398 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44399 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44400 des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44401 xmlResetLastError();
44402 if (mem_base != xmlMemBlocks()) {
44403 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44404 xmlMemBlocks() - mem_base);
44406 printf(" %d", n_writer);
44407 printf(" %d", n_name);
44408 printf(" %d", n_pubid);
44409 printf(" %d", n_sysid);
44410 printf(" %d", n_subset);
44426 test_xmlTextWriterWriteDTDAttlist(void) {
44429 #if defined(LIBXML_WRITER_ENABLED)
44432 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44434 xmlChar * name; /* the name of the DTD ATTLIST */
44436 xmlChar * content; /* content of the ATTLIST */
44439 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44440 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44441 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44442 mem_base = xmlMemBlocks();
44443 writer = gen_xmlTextWriterPtr(n_writer, 0);
44444 name = gen_const_xmlChar_ptr(n_name, 1);
44445 content = gen_const_xmlChar_ptr(n_content, 2);
44447 ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44448 desret_int(ret_val);
44450 des_xmlTextWriterPtr(n_writer, writer, 0);
44451 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44452 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44453 xmlResetLastError();
44454 if (mem_base != xmlMemBlocks()) {
44455 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44456 xmlMemBlocks() - mem_base);
44458 printf(" %d", n_writer);
44459 printf(" %d", n_name);
44460 printf(" %d", n_content);
44474 test_xmlTextWriterWriteDTDElement(void) {
44477 #if defined(LIBXML_WRITER_ENABLED)
44480 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44482 xmlChar * name; /* the name of the DTD element */
44484 xmlChar * content; /* content of the element */
44487 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44488 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44489 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44490 mem_base = xmlMemBlocks();
44491 writer = gen_xmlTextWriterPtr(n_writer, 0);
44492 name = gen_const_xmlChar_ptr(n_name, 1);
44493 content = gen_const_xmlChar_ptr(n_content, 2);
44495 ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44496 desret_int(ret_val);
44498 des_xmlTextWriterPtr(n_writer, writer, 0);
44499 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44500 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44501 xmlResetLastError();
44502 if (mem_base != xmlMemBlocks()) {
44503 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44504 xmlMemBlocks() - mem_base);
44506 printf(" %d", n_writer);
44507 printf(" %d", n_name);
44508 printf(" %d", n_content);
44522 test_xmlTextWriterWriteDTDEntity(void) {
44525 #if defined(LIBXML_WRITER_ENABLED)
44528 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44530 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44532 xmlChar * name; /* the name of the DTD entity */
44534 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44536 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44538 xmlChar * ndataid; /* the xml notation name. */
44540 xmlChar * content; /* content of the entity */
44543 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44544 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44545 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44546 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44547 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44548 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44549 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44550 mem_base = xmlMemBlocks();
44551 writer = gen_xmlTextWriterPtr(n_writer, 0);
44552 pe = gen_int(n_pe, 1);
44553 name = gen_const_xmlChar_ptr(n_name, 2);
44554 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44555 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44556 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44557 content = gen_const_xmlChar_ptr(n_content, 6);
44559 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44560 desret_int(ret_val);
44562 des_xmlTextWriterPtr(n_writer, writer, 0);
44563 des_int(n_pe, pe, 1);
44564 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44565 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44566 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44567 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44568 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44569 xmlResetLastError();
44570 if (mem_base != xmlMemBlocks()) {
44571 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44572 xmlMemBlocks() - mem_base);
44574 printf(" %d", n_writer);
44575 printf(" %d", n_pe);
44576 printf(" %d", n_name);
44577 printf(" %d", n_pubid);
44578 printf(" %d", n_sysid);
44579 printf(" %d", n_ndataid);
44580 printf(" %d", n_content);
44598 test_xmlTextWriterWriteDTDExternalEntity(void) {
44601 #if defined(LIBXML_WRITER_ENABLED)
44604 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44606 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44608 xmlChar * name; /* the name of the DTD entity */
44610 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44612 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44614 xmlChar * ndataid; /* the xml notation name. */
44617 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44618 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44619 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44620 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44621 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44622 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44623 mem_base = xmlMemBlocks();
44624 writer = gen_xmlTextWriterPtr(n_writer, 0);
44625 pe = gen_int(n_pe, 1);
44626 name = gen_const_xmlChar_ptr(n_name, 2);
44627 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44628 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44629 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44631 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44632 desret_int(ret_val);
44634 des_xmlTextWriterPtr(n_writer, writer, 0);
44635 des_int(n_pe, pe, 1);
44636 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44637 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44638 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44639 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44640 xmlResetLastError();
44641 if (mem_base != xmlMemBlocks()) {
44642 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44643 xmlMemBlocks() - mem_base);
44645 printf(" %d", n_writer);
44646 printf(" %d", n_pe);
44647 printf(" %d", n_name);
44648 printf(" %d", n_pubid);
44649 printf(" %d", n_sysid);
44650 printf(" %d", n_ndataid);
44667 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44670 #if defined(LIBXML_WRITER_ENABLED)
44673 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44675 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44677 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44679 xmlChar * ndataid; /* the xml notation name. */
44682 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44683 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44684 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44685 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44686 mem_base = xmlMemBlocks();
44687 writer = gen_xmlTextWriterPtr(n_writer, 0);
44688 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44689 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44690 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44692 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44693 desret_int(ret_val);
44695 des_xmlTextWriterPtr(n_writer, writer, 0);
44696 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44697 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44698 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44699 xmlResetLastError();
44700 if (mem_base != xmlMemBlocks()) {
44701 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44702 xmlMemBlocks() - mem_base);
44704 printf(" %d", n_writer);
44705 printf(" %d", n_pubid);
44706 printf(" %d", n_sysid);
44707 printf(" %d", n_ndataid);
44722 test_xmlTextWriterWriteDTDInternalEntity(void) {
44725 #if defined(LIBXML_WRITER_ENABLED)
44728 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44730 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44732 xmlChar * name; /* the name of the DTD entity */
44734 xmlChar * content; /* content of the entity */
44737 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44738 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44739 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44740 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44741 mem_base = xmlMemBlocks();
44742 writer = gen_xmlTextWriterPtr(n_writer, 0);
44743 pe = gen_int(n_pe, 1);
44744 name = gen_const_xmlChar_ptr(n_name, 2);
44745 content = gen_const_xmlChar_ptr(n_content, 3);
44747 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44748 desret_int(ret_val);
44750 des_xmlTextWriterPtr(n_writer, writer, 0);
44751 des_int(n_pe, pe, 1);
44752 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44753 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44754 xmlResetLastError();
44755 if (mem_base != xmlMemBlocks()) {
44756 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44757 xmlMemBlocks() - mem_base);
44759 printf(" %d", n_writer);
44760 printf(" %d", n_pe);
44761 printf(" %d", n_name);
44762 printf(" %d", n_content);
44777 test_xmlTextWriterWriteDTDNotation(void) {
44780 #if defined(LIBXML_WRITER_ENABLED)
44783 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44785 xmlChar * name; /* the name of the xml notation */
44787 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44789 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44792 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44793 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44794 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44795 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44796 mem_base = xmlMemBlocks();
44797 writer = gen_xmlTextWriterPtr(n_writer, 0);
44798 name = gen_const_xmlChar_ptr(n_name, 1);
44799 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44800 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44802 ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44803 desret_int(ret_val);
44805 des_xmlTextWriterPtr(n_writer, writer, 0);
44806 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44807 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44808 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44809 xmlResetLastError();
44810 if (mem_base != xmlMemBlocks()) {
44811 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44812 xmlMemBlocks() - mem_base);
44814 printf(" %d", n_writer);
44815 printf(" %d", n_name);
44816 printf(" %d", n_pubid);
44817 printf(" %d", n_sysid);
44832 test_xmlTextWriterWriteElement(void) {
44835 #if defined(LIBXML_WRITER_ENABLED)
44838 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44840 xmlChar * name; /* element name */
44842 xmlChar * content; /* element content */
44845 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44846 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44847 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44848 mem_base = xmlMemBlocks();
44849 writer = gen_xmlTextWriterPtr(n_writer, 0);
44850 name = gen_const_xmlChar_ptr(n_name, 1);
44851 content = gen_const_xmlChar_ptr(n_content, 2);
44853 ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44854 desret_int(ret_val);
44856 des_xmlTextWriterPtr(n_writer, writer, 0);
44857 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44858 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44859 xmlResetLastError();
44860 if (mem_base != xmlMemBlocks()) {
44861 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44862 xmlMemBlocks() - mem_base);
44864 printf(" %d", n_writer);
44865 printf(" %d", n_name);
44866 printf(" %d", n_content);
44880 test_xmlTextWriterWriteElementNS(void) {
44883 #if defined(LIBXML_WRITER_ENABLED)
44886 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44888 xmlChar * prefix; /* namespace prefix */
44890 xmlChar * name; /* element local name */
44892 xmlChar * namespaceURI; /* namespace URI */
44893 int n_namespaceURI;
44894 xmlChar * content; /* element content */
44897 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44898 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44899 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44900 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44901 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44902 mem_base = xmlMemBlocks();
44903 writer = gen_xmlTextWriterPtr(n_writer, 0);
44904 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44905 name = gen_const_xmlChar_ptr(n_name, 2);
44906 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44907 content = gen_const_xmlChar_ptr(n_content, 4);
44909 ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44910 desret_int(ret_val);
44912 des_xmlTextWriterPtr(n_writer, writer, 0);
44913 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44914 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44915 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44916 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44917 xmlResetLastError();
44918 if (mem_base != xmlMemBlocks()) {
44919 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44920 xmlMemBlocks() - mem_base);
44922 printf(" %d", n_writer);
44923 printf(" %d", n_prefix);
44924 printf(" %d", n_name);
44925 printf(" %d", n_namespaceURI);
44926 printf(" %d", n_content);
44942 test_xmlTextWriterWriteFormatAttribute(void) {
44946 /* missing type support */
44952 test_xmlTextWriterWriteFormatAttributeNS(void) {
44956 /* missing type support */
44962 test_xmlTextWriterWriteFormatCDATA(void) {
44966 /* missing type support */
44972 test_xmlTextWriterWriteFormatComment(void) {
44976 /* missing type support */
44982 test_xmlTextWriterWriteFormatDTD(void) {
44986 /* missing type support */
44992 test_xmlTextWriterWriteFormatDTDAttlist(void) {
44996 /* missing type support */
45002 test_xmlTextWriterWriteFormatDTDElement(void) {
45006 /* missing type support */
45012 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45016 /* missing type support */
45022 test_xmlTextWriterWriteFormatElement(void) {
45026 /* missing type support */
45032 test_xmlTextWriterWriteFormatElementNS(void) {
45036 /* missing type support */
45042 test_xmlTextWriterWriteFormatPI(void) {
45046 /* missing type support */
45052 test_xmlTextWriterWriteFormatRaw(void) {
45056 /* missing type support */
45062 test_xmlTextWriterWriteFormatString(void) {
45066 /* missing type support */
45072 test_xmlTextWriterWritePI(void) {
45075 #if defined(LIBXML_WRITER_ENABLED)
45078 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45080 xmlChar * target; /* PI target */
45082 xmlChar * content; /* PI content */
45085 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45086 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45087 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45088 mem_base = xmlMemBlocks();
45089 writer = gen_xmlTextWriterPtr(n_writer, 0);
45090 target = gen_const_xmlChar_ptr(n_target, 1);
45091 content = gen_const_xmlChar_ptr(n_content, 2);
45093 ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45094 desret_int(ret_val);
45096 des_xmlTextWriterPtr(n_writer, writer, 0);
45097 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45098 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45099 xmlResetLastError();
45100 if (mem_base != xmlMemBlocks()) {
45101 printf("Leak of %d blocks found in xmlTextWriterWritePI",
45102 xmlMemBlocks() - mem_base);
45104 printf(" %d", n_writer);
45105 printf(" %d", n_target);
45106 printf(" %d", n_content);
45120 test_xmlTextWriterWriteRaw(void) {
45123 #if defined(LIBXML_WRITER_ENABLED)
45126 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45128 xmlChar * content; /* text string */
45131 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45132 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45133 mem_base = xmlMemBlocks();
45134 writer = gen_xmlTextWriterPtr(n_writer, 0);
45135 content = gen_const_xmlChar_ptr(n_content, 1);
45137 ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45138 desret_int(ret_val);
45140 des_xmlTextWriterPtr(n_writer, writer, 0);
45141 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45142 xmlResetLastError();
45143 if (mem_base != xmlMemBlocks()) {
45144 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45145 xmlMemBlocks() - mem_base);
45147 printf(" %d", n_writer);
45148 printf(" %d", n_content);
45161 test_xmlTextWriterWriteRawLen(void) {
45164 #if defined(LIBXML_WRITER_ENABLED)
45167 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45169 xmlChar * content; /* text string */
45171 int len; /* length of the text string */
45174 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45175 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45176 for (n_len = 0;n_len < gen_nb_int;n_len++) {
45177 mem_base = xmlMemBlocks();
45178 writer = gen_xmlTextWriterPtr(n_writer, 0);
45179 content = gen_const_xmlChar_ptr(n_content, 1);
45180 len = gen_int(n_len, 2);
45182 ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45183 desret_int(ret_val);
45185 des_xmlTextWriterPtr(n_writer, writer, 0);
45186 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45187 des_int(n_len, len, 2);
45188 xmlResetLastError();
45189 if (mem_base != xmlMemBlocks()) {
45190 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45191 xmlMemBlocks() - mem_base);
45193 printf(" %d", n_writer);
45194 printf(" %d", n_content);
45195 printf(" %d", n_len);
45209 test_xmlTextWriterWriteString(void) {
45212 #if defined(LIBXML_WRITER_ENABLED)
45215 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45217 xmlChar * content; /* text string */
45220 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45221 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45222 mem_base = xmlMemBlocks();
45223 writer = gen_xmlTextWriterPtr(n_writer, 0);
45224 content = gen_const_xmlChar_ptr(n_content, 1);
45226 ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45227 desret_int(ret_val);
45229 des_xmlTextWriterPtr(n_writer, writer, 0);
45230 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45231 xmlResetLastError();
45232 if (mem_base != xmlMemBlocks()) {
45233 printf("Leak of %d blocks found in xmlTextWriterWriteString",
45234 xmlMemBlocks() - mem_base);
45236 printf(" %d", n_writer);
45237 printf(" %d", n_content);
45250 test_xmlTextWriterWriteVFormatAttribute(void) {
45254 /* missing type support */
45260 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45264 /* missing type support */
45270 test_xmlTextWriterWriteVFormatCDATA(void) {
45274 /* missing type support */
45280 test_xmlTextWriterWriteVFormatComment(void) {
45284 /* missing type support */
45290 test_xmlTextWriterWriteVFormatDTD(void) {
45294 /* missing type support */
45300 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45304 /* missing type support */
45310 test_xmlTextWriterWriteVFormatDTDElement(void) {
45314 /* missing type support */
45320 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45324 /* missing type support */
45330 test_xmlTextWriterWriteVFormatElement(void) {
45334 /* missing type support */
45340 test_xmlTextWriterWriteVFormatElementNS(void) {
45344 /* missing type support */
45350 test_xmlTextWriterWriteVFormatPI(void) {
45354 /* missing type support */
45360 test_xmlTextWriterWriteVFormatRaw(void) {
45364 /* missing type support */
45370 test_xmlTextWriterWriteVFormatString(void) {
45374 /* missing type support */
45379 test_xmlwriter(void) {
45382 if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45383 test_ret += test_xmlNewTextWriter();
45384 test_ret += test_xmlNewTextWriterFilename();
45385 test_ret += test_xmlNewTextWriterMemory();
45386 test_ret += test_xmlNewTextWriterPushParser();
45387 test_ret += test_xmlNewTextWriterTree();
45388 test_ret += test_xmlTextWriterEndAttribute();
45389 test_ret += test_xmlTextWriterEndCDATA();
45390 test_ret += test_xmlTextWriterEndComment();
45391 test_ret += test_xmlTextWriterEndDTD();
45392 test_ret += test_xmlTextWriterEndDTDAttlist();
45393 test_ret += test_xmlTextWriterEndDTDElement();
45394 test_ret += test_xmlTextWriterEndDTDEntity();
45395 test_ret += test_xmlTextWriterEndDocument();
45396 test_ret += test_xmlTextWriterEndElement();
45397 test_ret += test_xmlTextWriterEndPI();
45398 test_ret += test_xmlTextWriterFlush();
45399 test_ret += test_xmlTextWriterFullEndElement();
45400 test_ret += test_xmlTextWriterSetIndent();
45401 test_ret += test_xmlTextWriterSetIndentString();
45402 test_ret += test_xmlTextWriterStartAttribute();
45403 test_ret += test_xmlTextWriterStartAttributeNS();
45404 test_ret += test_xmlTextWriterStartCDATA();
45405 test_ret += test_xmlTextWriterStartComment();
45406 test_ret += test_xmlTextWriterStartDTD();
45407 test_ret += test_xmlTextWriterStartDTDAttlist();
45408 test_ret += test_xmlTextWriterStartDTDElement();
45409 test_ret += test_xmlTextWriterStartDTDEntity();
45410 test_ret += test_xmlTextWriterStartDocument();
45411 test_ret += test_xmlTextWriterStartElement();
45412 test_ret += test_xmlTextWriterStartElementNS();
45413 test_ret += test_xmlTextWriterStartPI();
45414 test_ret += test_xmlTextWriterWriteAttribute();
45415 test_ret += test_xmlTextWriterWriteAttributeNS();
45416 test_ret += test_xmlTextWriterWriteBase64();
45417 test_ret += test_xmlTextWriterWriteBinHex();
45418 test_ret += test_xmlTextWriterWriteCDATA();
45419 test_ret += test_xmlTextWriterWriteComment();
45420 test_ret += test_xmlTextWriterWriteDTD();
45421 test_ret += test_xmlTextWriterWriteDTDAttlist();
45422 test_ret += test_xmlTextWriterWriteDTDElement();
45423 test_ret += test_xmlTextWriterWriteDTDEntity();
45424 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45425 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45426 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45427 test_ret += test_xmlTextWriterWriteDTDNotation();
45428 test_ret += test_xmlTextWriterWriteElement();
45429 test_ret += test_xmlTextWriterWriteElementNS();
45430 test_ret += test_xmlTextWriterWriteFormatAttribute();
45431 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45432 test_ret += test_xmlTextWriterWriteFormatCDATA();
45433 test_ret += test_xmlTextWriterWriteFormatComment();
45434 test_ret += test_xmlTextWriterWriteFormatDTD();
45435 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45436 test_ret += test_xmlTextWriterWriteFormatDTDElement();
45437 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45438 test_ret += test_xmlTextWriterWriteFormatElement();
45439 test_ret += test_xmlTextWriterWriteFormatElementNS();
45440 test_ret += test_xmlTextWriterWriteFormatPI();
45441 test_ret += test_xmlTextWriterWriteFormatRaw();
45442 test_ret += test_xmlTextWriterWriteFormatString();
45443 test_ret += test_xmlTextWriterWritePI();
45444 test_ret += test_xmlTextWriterWriteRaw();
45445 test_ret += test_xmlTextWriterWriteRawLen();
45446 test_ret += test_xmlTextWriterWriteString();
45447 test_ret += test_xmlTextWriterWriteVFormatAttribute();
45448 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45449 test_ret += test_xmlTextWriterWriteVFormatCDATA();
45450 test_ret += test_xmlTextWriterWriteVFormatComment();
45451 test_ret += test_xmlTextWriterWriteVFormatDTD();
45452 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45453 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45454 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45455 test_ret += test_xmlTextWriterWriteVFormatElement();
45456 test_ret += test_xmlTextWriterWriteVFormatElementNS();
45457 test_ret += test_xmlTextWriterWriteVFormatPI();
45458 test_ret += test_xmlTextWriterWriteVFormatRaw();
45459 test_ret += test_xmlTextWriterWriteVFormatString();
45462 printf("Module xmlwriter: %d errors\n", test_ret);
45467 test_xmlXPathCastBooleanToNumber(void) {
45470 #if defined(LIBXML_XPATH_ENABLED)
45473 int val; /* a boolean */
45476 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45477 mem_base = xmlMemBlocks();
45478 val = gen_int(n_val, 0);
45480 ret_val = xmlXPathCastBooleanToNumber(val);
45481 desret_double(ret_val);
45483 des_int(n_val, val, 0);
45484 xmlResetLastError();
45485 if (mem_base != xmlMemBlocks()) {
45486 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45487 xmlMemBlocks() - mem_base);
45489 printf(" %d", n_val);
45501 test_xmlXPathCastBooleanToString(void) {
45504 #if defined(LIBXML_XPATH_ENABLED)
45507 int val; /* a boolean */
45510 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45511 mem_base = xmlMemBlocks();
45512 val = gen_int(n_val, 0);
45514 ret_val = xmlXPathCastBooleanToString(val);
45515 desret_xmlChar_ptr(ret_val);
45517 des_int(n_val, val, 0);
45518 xmlResetLastError();
45519 if (mem_base != xmlMemBlocks()) {
45520 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45521 xmlMemBlocks() - mem_base);
45523 printf(" %d", n_val);
45535 test_xmlXPathCastNodeSetToBoolean(void) {
45538 #if defined(LIBXML_XPATH_ENABLED)
45541 xmlNodeSetPtr ns; /* a node-set */
45544 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45545 mem_base = xmlMemBlocks();
45546 ns = gen_xmlNodeSetPtr(n_ns, 0);
45548 ret_val = xmlXPathCastNodeSetToBoolean(ns);
45549 desret_int(ret_val);
45551 des_xmlNodeSetPtr(n_ns, ns, 0);
45552 xmlResetLastError();
45553 if (mem_base != xmlMemBlocks()) {
45554 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45555 xmlMemBlocks() - mem_base);
45557 printf(" %d", n_ns);
45569 test_xmlXPathCastNodeSetToNumber(void) {
45572 #if defined(LIBXML_XPATH_ENABLED)
45575 xmlNodeSetPtr ns; /* a node-set */
45578 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45579 mem_base = xmlMemBlocks();
45580 ns = gen_xmlNodeSetPtr(n_ns, 0);
45582 ret_val = xmlXPathCastNodeSetToNumber(ns);
45583 desret_double(ret_val);
45585 des_xmlNodeSetPtr(n_ns, ns, 0);
45586 xmlResetLastError();
45587 if (mem_base != xmlMemBlocks()) {
45588 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45589 xmlMemBlocks() - mem_base);
45591 printf(" %d", n_ns);
45603 test_xmlXPathCastNodeSetToString(void) {
45606 #if defined(LIBXML_XPATH_ENABLED)
45609 xmlNodeSetPtr ns; /* a node-set */
45612 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45613 mem_base = xmlMemBlocks();
45614 ns = gen_xmlNodeSetPtr(n_ns, 0);
45616 ret_val = xmlXPathCastNodeSetToString(ns);
45617 desret_xmlChar_ptr(ret_val);
45619 des_xmlNodeSetPtr(n_ns, ns, 0);
45620 xmlResetLastError();
45621 if (mem_base != xmlMemBlocks()) {
45622 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45623 xmlMemBlocks() - mem_base);
45625 printf(" %d", n_ns);
45637 test_xmlXPathCastNodeToNumber(void) {
45640 #if defined(LIBXML_XPATH_ENABLED)
45643 xmlNodePtr node; /* a node */
45646 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45647 mem_base = xmlMemBlocks();
45648 node = gen_xmlNodePtr(n_node, 0);
45650 ret_val = xmlXPathCastNodeToNumber(node);
45651 desret_double(ret_val);
45653 des_xmlNodePtr(n_node, node, 0);
45654 xmlResetLastError();
45655 if (mem_base != xmlMemBlocks()) {
45656 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45657 xmlMemBlocks() - mem_base);
45659 printf(" %d", n_node);
45671 test_xmlXPathCastNodeToString(void) {
45674 #if defined(LIBXML_XPATH_ENABLED)
45677 xmlNodePtr node; /* a node */
45680 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45681 mem_base = xmlMemBlocks();
45682 node = gen_xmlNodePtr(n_node, 0);
45684 ret_val = xmlXPathCastNodeToString(node);
45685 desret_xmlChar_ptr(ret_val);
45687 des_xmlNodePtr(n_node, node, 0);
45688 xmlResetLastError();
45689 if (mem_base != xmlMemBlocks()) {
45690 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45691 xmlMemBlocks() - mem_base);
45693 printf(" %d", n_node);
45705 test_xmlXPathCastNumberToBoolean(void) {
45708 #if defined(LIBXML_XPATH_ENABLED)
45711 double val; /* a number */
45714 for (n_val = 0;n_val < gen_nb_double;n_val++) {
45715 mem_base = xmlMemBlocks();
45716 val = gen_double(n_val, 0);
45718 ret_val = xmlXPathCastNumberToBoolean(val);
45719 desret_int(ret_val);
45721 des_double(n_val, val, 0);
45722 xmlResetLastError();
45723 if (mem_base != xmlMemBlocks()) {
45724 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45725 xmlMemBlocks() - mem_base);
45727 printf(" %d", n_val);
45739 test_xmlXPathCastNumberToString(void) {
45742 #if defined(LIBXML_XPATH_ENABLED)
45745 double val; /* a number */
45748 for (n_val = 0;n_val < gen_nb_double;n_val++) {
45749 mem_base = xmlMemBlocks();
45750 val = gen_double(n_val, 0);
45752 ret_val = xmlXPathCastNumberToString(val);
45753 desret_xmlChar_ptr(ret_val);
45755 des_double(n_val, val, 0);
45756 xmlResetLastError();
45757 if (mem_base != xmlMemBlocks()) {
45758 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45759 xmlMemBlocks() - mem_base);
45761 printf(" %d", n_val);
45773 test_xmlXPathCastStringToBoolean(void) {
45776 #if defined(LIBXML_XPATH_ENABLED)
45779 xmlChar * val; /* a string */
45782 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45783 mem_base = xmlMemBlocks();
45784 val = gen_const_xmlChar_ptr(n_val, 0);
45786 ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45787 desret_int(ret_val);
45789 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45790 xmlResetLastError();
45791 if (mem_base != xmlMemBlocks()) {
45792 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45793 xmlMemBlocks() - mem_base);
45795 printf(" %d", n_val);
45807 test_xmlXPathCastStringToNumber(void) {
45810 #if defined(LIBXML_XPATH_ENABLED)
45813 xmlChar * val; /* a string */
45816 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45817 mem_base = xmlMemBlocks();
45818 val = gen_const_xmlChar_ptr(n_val, 0);
45820 ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45821 desret_double(ret_val);
45823 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45824 xmlResetLastError();
45825 if (mem_base != xmlMemBlocks()) {
45826 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45827 xmlMemBlocks() - mem_base);
45829 printf(" %d", n_val);
45841 test_xmlXPathCastToBoolean(void) {
45844 #if defined(LIBXML_XPATH_ENABLED)
45847 xmlXPathObjectPtr val; /* an XPath object */
45850 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45851 mem_base = xmlMemBlocks();
45852 val = gen_xmlXPathObjectPtr(n_val, 0);
45854 ret_val = xmlXPathCastToBoolean(val);
45855 desret_int(ret_val);
45857 des_xmlXPathObjectPtr(n_val, val, 0);
45858 xmlResetLastError();
45859 if (mem_base != xmlMemBlocks()) {
45860 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45861 xmlMemBlocks() - mem_base);
45863 printf(" %d", n_val);
45875 test_xmlXPathCastToNumber(void) {
45878 #if defined(LIBXML_XPATH_ENABLED)
45881 xmlXPathObjectPtr val; /* an XPath object */
45884 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45885 mem_base = xmlMemBlocks();
45886 val = gen_xmlXPathObjectPtr(n_val, 0);
45888 ret_val = xmlXPathCastToNumber(val);
45889 desret_double(ret_val);
45891 des_xmlXPathObjectPtr(n_val, val, 0);
45892 xmlResetLastError();
45893 if (mem_base != xmlMemBlocks()) {
45894 printf("Leak of %d blocks found in xmlXPathCastToNumber",
45895 xmlMemBlocks() - mem_base);
45897 printf(" %d", n_val);
45909 test_xmlXPathCastToString(void) {
45912 #if defined(LIBXML_XPATH_ENABLED)
45915 xmlXPathObjectPtr val; /* an XPath object */
45918 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45919 mem_base = xmlMemBlocks();
45920 val = gen_xmlXPathObjectPtr(n_val, 0);
45922 ret_val = xmlXPathCastToString(val);
45923 desret_xmlChar_ptr(ret_val);
45925 des_xmlXPathObjectPtr(n_val, val, 0);
45926 xmlResetLastError();
45927 if (mem_base != xmlMemBlocks()) {
45928 printf("Leak of %d blocks found in xmlXPathCastToString",
45929 xmlMemBlocks() - mem_base);
45931 printf(" %d", n_val);
45943 test_xmlXPathCmpNodes(void) {
45946 #if defined(LIBXML_XPATH_ENABLED)
45949 xmlNodePtr node1; /* the first node */
45951 xmlNodePtr node2; /* the second node */
45954 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45955 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45956 mem_base = xmlMemBlocks();
45957 node1 = gen_xmlNodePtr(n_node1, 0);
45958 node2 = gen_xmlNodePtr(n_node2, 1);
45960 ret_val = xmlXPathCmpNodes(node1, node2);
45961 desret_int(ret_val);
45963 des_xmlNodePtr(n_node1, node1, 0);
45964 des_xmlNodePtr(n_node2, node2, 1);
45965 xmlResetLastError();
45966 if (mem_base != xmlMemBlocks()) {
45967 printf("Leak of %d blocks found in xmlXPathCmpNodes",
45968 xmlMemBlocks() - mem_base);
45970 printf(" %d", n_node1);
45971 printf(" %d", n_node2);
45984 test_xmlXPathCompile(void) {
45988 /* missing type support */
45992 #ifdef LIBXML_XPATH_ENABLED
45994 #define gen_nb_xmlXPathCompExprPtr 1
45995 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45998 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46002 #ifdef LIBXML_XPATH_ENABLED
46004 #define gen_nb_xmlXPathContextPtr 1
46005 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46008 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46014 test_xmlXPathCompiledEval(void) {
46017 #if defined(LIBXML_XPATH_ENABLED)
46019 xmlXPathObjectPtr ret_val;
46020 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46022 xmlXPathContextPtr ctx; /* the XPath context */
46025 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46026 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46027 mem_base = xmlMemBlocks();
46028 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46029 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46031 ret_val = xmlXPathCompiledEval(comp, ctx);
46032 desret_xmlXPathObjectPtr(ret_val);
46034 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46035 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46036 xmlResetLastError();
46037 if (mem_base != xmlMemBlocks()) {
46038 printf("Leak of %d blocks found in xmlXPathCompiledEval",
46039 xmlMemBlocks() - mem_base);
46041 printf(" %d", n_comp);
46042 printf(" %d", n_ctx);
46055 test_xmlXPathCompiledEvalToBoolean(void) {
46058 #if defined(LIBXML_XPATH_ENABLED)
46061 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46063 xmlXPathContextPtr ctxt; /* the XPath context */
46066 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46067 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46068 mem_base = xmlMemBlocks();
46069 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46070 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46072 ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46073 desret_int(ret_val);
46075 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46076 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46077 xmlResetLastError();
46078 if (mem_base != xmlMemBlocks()) {
46079 printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46080 xmlMemBlocks() - mem_base);
46082 printf(" %d", n_comp);
46083 printf(" %d", n_ctxt);
46096 test_xmlXPathContextSetCache(void) {
46099 #if defined(LIBXML_XPATH_ENABLED)
46102 xmlXPathContextPtr ctxt; /* the XPath context */
46104 int active; /* enables/disables (creates/frees) the cache */
46106 int value; /* a value with semantics dependant on @options */
46108 int options; /* options (currently only the value 0 is used) */
46111 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46112 for (n_active = 0;n_active < gen_nb_int;n_active++) {
46113 for (n_value = 0;n_value < gen_nb_int;n_value++) {
46114 for (n_options = 0;n_options < gen_nb_int;n_options++) {
46115 mem_base = xmlMemBlocks();
46116 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46117 active = gen_int(n_active, 1);
46118 value = gen_int(n_value, 2);
46119 options = gen_int(n_options, 3);
46121 ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46122 desret_int(ret_val);
46124 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46125 des_int(n_active, active, 1);
46126 des_int(n_value, value, 2);
46127 des_int(n_options, options, 3);
46128 xmlResetLastError();
46129 if (mem_base != xmlMemBlocks()) {
46130 printf("Leak of %d blocks found in xmlXPathContextSetCache",
46131 xmlMemBlocks() - mem_base);
46133 printf(" %d", n_ctxt);
46134 printf(" %d", n_active);
46135 printf(" %d", n_value);
46136 printf(" %d", n_options);
46151 test_xmlXPathConvertBoolean(void) {
46154 #if defined(LIBXML_XPATH_ENABLED)
46156 xmlXPathObjectPtr ret_val;
46157 xmlXPathObjectPtr val; /* an XPath object */
46160 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46161 mem_base = xmlMemBlocks();
46162 val = gen_xmlXPathObjectPtr(n_val, 0);
46164 ret_val = xmlXPathConvertBoolean(val);
46166 desret_xmlXPathObjectPtr(ret_val);
46168 des_xmlXPathObjectPtr(n_val, val, 0);
46169 xmlResetLastError();
46170 if (mem_base != xmlMemBlocks()) {
46171 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46172 xmlMemBlocks() - mem_base);
46174 printf(" %d", n_val);
46186 test_xmlXPathConvertNumber(void) {
46189 #if defined(LIBXML_XPATH_ENABLED)
46191 xmlXPathObjectPtr ret_val;
46192 xmlXPathObjectPtr val; /* an XPath object */
46195 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46196 mem_base = xmlMemBlocks();
46197 val = gen_xmlXPathObjectPtr(n_val, 0);
46199 ret_val = xmlXPathConvertNumber(val);
46201 desret_xmlXPathObjectPtr(ret_val);
46203 des_xmlXPathObjectPtr(n_val, val, 0);
46204 xmlResetLastError();
46205 if (mem_base != xmlMemBlocks()) {
46206 printf("Leak of %d blocks found in xmlXPathConvertNumber",
46207 xmlMemBlocks() - mem_base);
46209 printf(" %d", n_val);
46221 test_xmlXPathConvertString(void) {
46224 #if defined(LIBXML_XPATH_ENABLED)
46226 xmlXPathObjectPtr ret_val;
46227 xmlXPathObjectPtr val; /* an XPath object */
46230 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46231 mem_base = xmlMemBlocks();
46232 val = gen_xmlXPathObjectPtr(n_val, 0);
46234 ret_val = xmlXPathConvertString(val);
46236 desret_xmlXPathObjectPtr(ret_val);
46238 des_xmlXPathObjectPtr(n_val, val, 0);
46239 xmlResetLastError();
46240 if (mem_base != xmlMemBlocks()) {
46241 printf("Leak of %d blocks found in xmlXPathConvertString",
46242 xmlMemBlocks() - mem_base);
46244 printf(" %d", n_val);
46256 test_xmlXPathCtxtCompile(void) {
46260 /* missing type support */
46266 test_xmlXPathEval(void) {
46269 #if defined(LIBXML_XPATH_ENABLED)
46271 xmlXPathObjectPtr ret_val;
46272 xmlChar * str; /* the XPath expression */
46274 xmlXPathContextPtr ctx; /* the XPath context */
46277 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46278 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46279 mem_base = xmlMemBlocks();
46280 str = gen_const_xmlChar_ptr(n_str, 0);
46281 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46283 ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46284 desret_xmlXPathObjectPtr(ret_val);
46286 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46287 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46288 xmlResetLastError();
46289 if (mem_base != xmlMemBlocks()) {
46290 printf("Leak of %d blocks found in xmlXPathEval",
46291 xmlMemBlocks() - mem_base);
46293 printf(" %d", n_str);
46294 printf(" %d", n_ctx);
46307 test_xmlXPathEvalExpression(void) {
46310 #if defined(LIBXML_XPATH_ENABLED)
46312 xmlXPathObjectPtr ret_val;
46313 xmlChar * str; /* the XPath expression */
46315 xmlXPathContextPtr ctxt; /* the XPath context */
46318 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46319 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46320 mem_base = xmlMemBlocks();
46321 str = gen_const_xmlChar_ptr(n_str, 0);
46322 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46324 ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46325 desret_xmlXPathObjectPtr(ret_val);
46327 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46328 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46329 xmlResetLastError();
46330 if (mem_base != xmlMemBlocks()) {
46331 printf("Leak of %d blocks found in xmlXPathEvalExpression",
46332 xmlMemBlocks() - mem_base);
46334 printf(" %d", n_str);
46335 printf(" %d", n_ctxt);
46348 test_xmlXPathEvalPredicate(void) {
46351 #if defined(LIBXML_XPATH_ENABLED)
46354 xmlXPathContextPtr ctxt; /* the XPath context */
46356 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46359 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46360 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46361 mem_base = xmlMemBlocks();
46362 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46363 res = gen_xmlXPathObjectPtr(n_res, 1);
46365 ret_val = xmlXPathEvalPredicate(ctxt, res);
46366 desret_int(ret_val);
46368 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46369 des_xmlXPathObjectPtr(n_res, res, 1);
46370 xmlResetLastError();
46371 if (mem_base != xmlMemBlocks()) {
46372 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46373 xmlMemBlocks() - mem_base);
46375 printf(" %d", n_ctxt);
46376 printf(" %d", n_res);
46389 test_xmlXPathInit(void) {
46392 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46395 mem_base = xmlMemBlocks();
46399 xmlResetLastError();
46400 if (mem_base != xmlMemBlocks()) {
46401 printf("Leak of %d blocks found in xmlXPathInit",
46402 xmlMemBlocks() - mem_base);
46414 test_xmlXPathIsInf(void) {
46417 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46420 double val; /* a double value */
46423 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46424 mem_base = xmlMemBlocks();
46425 val = gen_double(n_val, 0);
46427 ret_val = xmlXPathIsInf(val);
46428 desret_int(ret_val);
46430 des_double(n_val, val, 0);
46431 xmlResetLastError();
46432 if (mem_base != xmlMemBlocks()) {
46433 printf("Leak of %d blocks found in xmlXPathIsInf",
46434 xmlMemBlocks() - mem_base);
46436 printf(" %d", n_val);
46448 test_xmlXPathIsNaN(void) {
46451 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46454 double val; /* a double value */
46457 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46458 mem_base = xmlMemBlocks();
46459 val = gen_double(n_val, 0);
46461 ret_val = xmlXPathIsNaN(val);
46462 desret_int(ret_val);
46464 des_double(n_val, val, 0);
46465 xmlResetLastError();
46466 if (mem_base != xmlMemBlocks()) {
46467 printf("Leak of %d blocks found in xmlXPathIsNaN",
46468 xmlMemBlocks() - mem_base);
46470 printf(" %d", n_val);
46482 test_xmlXPathNewContext(void) {
46486 /* missing type support */
46492 test_xmlXPathNodeSetCreate(void) {
46495 #if defined(LIBXML_XPATH_ENABLED)
46497 xmlNodeSetPtr ret_val;
46498 xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46501 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46502 mem_base = xmlMemBlocks();
46503 val = gen_xmlNodePtr(n_val, 0);
46505 ret_val = xmlXPathNodeSetCreate(val);
46506 desret_xmlNodeSetPtr(ret_val);
46508 des_xmlNodePtr(n_val, val, 0);
46509 xmlResetLastError();
46510 if (mem_base != xmlMemBlocks()) {
46511 printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46512 xmlMemBlocks() - mem_base);
46514 printf(" %d", n_val);
46526 test_xmlXPathObjectCopy(void) {
46529 #if defined(LIBXML_XPATH_ENABLED)
46531 xmlXPathObjectPtr ret_val;
46532 xmlXPathObjectPtr val; /* the original object */
46535 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46536 mem_base = xmlMemBlocks();
46537 val = gen_xmlXPathObjectPtr(n_val, 0);
46539 ret_val = xmlXPathObjectCopy(val);
46540 desret_xmlXPathObjectPtr(ret_val);
46542 des_xmlXPathObjectPtr(n_val, val, 0);
46543 xmlResetLastError();
46544 if (mem_base != xmlMemBlocks()) {
46545 printf("Leak of %d blocks found in xmlXPathObjectCopy",
46546 xmlMemBlocks() - mem_base);
46548 printf(" %d", n_val);
46560 test_xmlXPathOrderDocElems(void) {
46563 #if defined(LIBXML_XPATH_ENABLED)
46566 xmlDocPtr doc; /* an input document */
46569 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46570 mem_base = xmlMemBlocks();
46571 doc = gen_xmlDocPtr(n_doc, 0);
46573 ret_val = xmlXPathOrderDocElems(doc);
46574 desret_long(ret_val);
46576 des_xmlDocPtr(n_doc, doc, 0);
46577 xmlResetLastError();
46578 if (mem_base != xmlMemBlocks()) {
46579 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46580 xmlMemBlocks() - mem_base);
46582 printf(" %d", n_doc);
46596 if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46597 test_ret += test_xmlXPathCastBooleanToNumber();
46598 test_ret += test_xmlXPathCastBooleanToString();
46599 test_ret += test_xmlXPathCastNodeSetToBoolean();
46600 test_ret += test_xmlXPathCastNodeSetToNumber();
46601 test_ret += test_xmlXPathCastNodeSetToString();
46602 test_ret += test_xmlXPathCastNodeToNumber();
46603 test_ret += test_xmlXPathCastNodeToString();
46604 test_ret += test_xmlXPathCastNumberToBoolean();
46605 test_ret += test_xmlXPathCastNumberToString();
46606 test_ret += test_xmlXPathCastStringToBoolean();
46607 test_ret += test_xmlXPathCastStringToNumber();
46608 test_ret += test_xmlXPathCastToBoolean();
46609 test_ret += test_xmlXPathCastToNumber();
46610 test_ret += test_xmlXPathCastToString();
46611 test_ret += test_xmlXPathCmpNodes();
46612 test_ret += test_xmlXPathCompile();
46613 test_ret += test_xmlXPathCompiledEval();
46614 test_ret += test_xmlXPathCompiledEvalToBoolean();
46615 test_ret += test_xmlXPathContextSetCache();
46616 test_ret += test_xmlXPathConvertBoolean();
46617 test_ret += test_xmlXPathConvertNumber();
46618 test_ret += test_xmlXPathConvertString();
46619 test_ret += test_xmlXPathCtxtCompile();
46620 test_ret += test_xmlXPathEval();
46621 test_ret += test_xmlXPathEvalExpression();
46622 test_ret += test_xmlXPathEvalPredicate();
46623 test_ret += test_xmlXPathInit();
46624 test_ret += test_xmlXPathIsInf();
46625 test_ret += test_xmlXPathIsNaN();
46626 test_ret += test_xmlXPathNewContext();
46627 test_ret += test_xmlXPathNodeSetCreate();
46628 test_ret += test_xmlXPathObjectCopy();
46629 test_ret += test_xmlXPathOrderDocElems();
46632 printf("Module xpath: %d errors\n", test_ret);
46635 #ifdef LIBXML_XPATH_ENABLED
46637 #define gen_nb_xmlXPathParserContextPtr 1
46638 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46641 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46647 test_valuePop(void) {
46650 #if defined(LIBXML_XPATH_ENABLED)
46652 xmlXPathObjectPtr ret_val;
46653 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46656 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46657 mem_base = xmlMemBlocks();
46658 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46660 ret_val = valuePop(ctxt);
46661 desret_xmlXPathObjectPtr(ret_val);
46663 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46664 xmlResetLastError();
46665 if (mem_base != xmlMemBlocks()) {
46666 printf("Leak of %d blocks found in valuePop",
46667 xmlMemBlocks() - mem_base);
46669 printf(" %d", n_ctxt);
46681 test_valuePush(void) {
46684 #if defined(LIBXML_XPATH_ENABLED)
46687 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46689 xmlXPathObjectPtr value; /* the XPath object */
46692 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46693 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46694 mem_base = xmlMemBlocks();
46695 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46696 value = gen_xmlXPathObjectPtr(n_value, 1);
46698 ret_val = valuePush(ctxt, value);
46699 desret_int(ret_val);
46701 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46702 des_xmlXPathObjectPtr(n_value, value, 1);
46703 xmlResetLastError();
46704 if (mem_base != xmlMemBlocks()) {
46705 printf("Leak of %d blocks found in valuePush",
46706 xmlMemBlocks() - mem_base);
46708 printf(" %d", n_ctxt);
46709 printf(" %d", n_value);
46722 test_xmlXPathAddValues(void) {
46725 #if defined(LIBXML_XPATH_ENABLED)
46727 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46730 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46731 mem_base = xmlMemBlocks();
46732 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46734 xmlXPathAddValues(ctxt);
46736 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46737 xmlResetLastError();
46738 if (mem_base != xmlMemBlocks()) {
46739 printf("Leak of %d blocks found in xmlXPathAddValues",
46740 xmlMemBlocks() - mem_base);
46742 printf(" %d", n_ctxt);
46754 test_xmlXPathBooleanFunction(void) {
46757 #if defined(LIBXML_XPATH_ENABLED)
46759 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46761 int nargs; /* the number of arguments */
46764 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46765 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46766 mem_base = xmlMemBlocks();
46767 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46768 nargs = gen_int(n_nargs, 1);
46770 xmlXPathBooleanFunction(ctxt, nargs);
46772 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46773 des_int(n_nargs, nargs, 1);
46774 xmlResetLastError();
46775 if (mem_base != xmlMemBlocks()) {
46776 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46777 xmlMemBlocks() - mem_base);
46779 printf(" %d", n_ctxt);
46780 printf(" %d", n_nargs);
46793 test_xmlXPathCeilingFunction(void) {
46796 #if defined(LIBXML_XPATH_ENABLED)
46798 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46800 int nargs; /* the number of arguments */
46803 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46804 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46805 mem_base = xmlMemBlocks();
46806 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46807 nargs = gen_int(n_nargs, 1);
46809 xmlXPathCeilingFunction(ctxt, nargs);
46811 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46812 des_int(n_nargs, nargs, 1);
46813 xmlResetLastError();
46814 if (mem_base != xmlMemBlocks()) {
46815 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46816 xmlMemBlocks() - mem_base);
46818 printf(" %d", n_ctxt);
46819 printf(" %d", n_nargs);
46832 test_xmlXPathCompareValues(void) {
46835 #if defined(LIBXML_XPATH_ENABLED)
46838 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46840 int inf; /* less than (1) or greater than (0) */
46842 int strict; /* is the comparison strict */
46845 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46846 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46847 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46848 mem_base = xmlMemBlocks();
46849 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46850 inf = gen_int(n_inf, 1);
46851 strict = gen_int(n_strict, 2);
46853 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46854 desret_int(ret_val);
46856 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46857 des_int(n_inf, inf, 1);
46858 des_int(n_strict, strict, 2);
46859 xmlResetLastError();
46860 if (mem_base != xmlMemBlocks()) {
46861 printf("Leak of %d blocks found in xmlXPathCompareValues",
46862 xmlMemBlocks() - mem_base);
46864 printf(" %d", n_ctxt);
46865 printf(" %d", n_inf);
46866 printf(" %d", n_strict);
46880 test_xmlXPathConcatFunction(void) {
46883 #if defined(LIBXML_XPATH_ENABLED)
46885 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46887 int nargs; /* the number of arguments */
46890 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46891 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46892 mem_base = xmlMemBlocks();
46893 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46894 nargs = gen_int(n_nargs, 1);
46896 xmlXPathConcatFunction(ctxt, nargs);
46898 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46899 des_int(n_nargs, nargs, 1);
46900 xmlResetLastError();
46901 if (mem_base != xmlMemBlocks()) {
46902 printf("Leak of %d blocks found in xmlXPathConcatFunction",
46903 xmlMemBlocks() - mem_base);
46905 printf(" %d", n_ctxt);
46906 printf(" %d", n_nargs);
46919 test_xmlXPathContainsFunction(void) {
46922 #if defined(LIBXML_XPATH_ENABLED)
46924 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46926 int nargs; /* the number of arguments */
46929 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46930 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46931 mem_base = xmlMemBlocks();
46932 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46933 nargs = gen_int(n_nargs, 1);
46935 xmlXPathContainsFunction(ctxt, nargs);
46937 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46938 des_int(n_nargs, nargs, 1);
46939 xmlResetLastError();
46940 if (mem_base != xmlMemBlocks()) {
46941 printf("Leak of %d blocks found in xmlXPathContainsFunction",
46942 xmlMemBlocks() - mem_base);
46944 printf(" %d", n_ctxt);
46945 printf(" %d", n_nargs);
46958 test_xmlXPathCountFunction(void) {
46961 #if defined(LIBXML_XPATH_ENABLED)
46963 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46965 int nargs; /* the number of arguments */
46968 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46969 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46970 mem_base = xmlMemBlocks();
46971 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46972 nargs = gen_int(n_nargs, 1);
46974 xmlXPathCountFunction(ctxt, nargs);
46976 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46977 des_int(n_nargs, nargs, 1);
46978 xmlResetLastError();
46979 if (mem_base != xmlMemBlocks()) {
46980 printf("Leak of %d blocks found in xmlXPathCountFunction",
46981 xmlMemBlocks() - mem_base);
46983 printf(" %d", n_ctxt);
46984 printf(" %d", n_nargs);
46997 test_xmlXPathDebugDumpCompExpr(void) {
47000 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47002 FILE * output; /* the FILE * for the output */
47004 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47006 int depth; /* the indentation level. */
47009 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47010 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47011 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47012 mem_base = xmlMemBlocks();
47013 output = gen_FILE_ptr(n_output, 0);
47014 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47015 depth = gen_int(n_depth, 2);
47017 xmlXPathDebugDumpCompExpr(output, comp, depth);
47019 des_FILE_ptr(n_output, output, 0);
47020 des_xmlXPathCompExprPtr(n_comp, comp, 1);
47021 des_int(n_depth, depth, 2);
47022 xmlResetLastError();
47023 if (mem_base != xmlMemBlocks()) {
47024 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47025 xmlMemBlocks() - mem_base);
47027 printf(" %d", n_output);
47028 printf(" %d", n_comp);
47029 printf(" %d", n_depth);
47043 test_xmlXPathDebugDumpObject(void) {
47046 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47048 FILE * output; /* the FILE * to dump the output */
47050 xmlXPathObjectPtr cur; /* the object to inspect */
47052 int depth; /* indentation level */
47055 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47056 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47057 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47058 mem_base = xmlMemBlocks();
47059 output = gen_FILE_ptr(n_output, 0);
47060 cur = gen_xmlXPathObjectPtr(n_cur, 1);
47061 depth = gen_int(n_depth, 2);
47063 xmlXPathDebugDumpObject(output, cur, depth);
47065 des_FILE_ptr(n_output, output, 0);
47066 des_xmlXPathObjectPtr(n_cur, cur, 1);
47067 des_int(n_depth, depth, 2);
47068 xmlResetLastError();
47069 if (mem_base != xmlMemBlocks()) {
47070 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47071 xmlMemBlocks() - mem_base);
47073 printf(" %d", n_output);
47074 printf(" %d", n_cur);
47075 printf(" %d", n_depth);
47089 test_xmlXPathDifference(void) {
47092 #if defined(LIBXML_XPATH_ENABLED)
47094 xmlNodeSetPtr ret_val;
47095 xmlNodeSetPtr nodes1; /* a node-set */
47097 xmlNodeSetPtr nodes2; /* a node-set */
47100 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47101 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47102 mem_base = xmlMemBlocks();
47103 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47104 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47106 ret_val = xmlXPathDifference(nodes1, nodes2);
47107 desret_xmlNodeSetPtr(ret_val);
47109 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47110 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47111 xmlResetLastError();
47112 if (mem_base != xmlMemBlocks()) {
47113 printf("Leak of %d blocks found in xmlXPathDifference",
47114 xmlMemBlocks() - mem_base);
47116 printf(" %d", n_nodes1);
47117 printf(" %d", n_nodes2);
47130 test_xmlXPathDistinct(void) {
47133 #if defined(LIBXML_XPATH_ENABLED)
47135 xmlNodeSetPtr ret_val;
47136 xmlNodeSetPtr nodes; /* a node-set */
47139 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47140 mem_base = xmlMemBlocks();
47141 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47143 ret_val = xmlXPathDistinct(nodes);
47144 desret_xmlNodeSetPtr(ret_val);
47146 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47147 xmlResetLastError();
47148 if (mem_base != xmlMemBlocks()) {
47149 printf("Leak of %d blocks found in xmlXPathDistinct",
47150 xmlMemBlocks() - mem_base);
47152 printf(" %d", n_nodes);
47164 test_xmlXPathDistinctSorted(void) {
47167 #if defined(LIBXML_XPATH_ENABLED)
47169 xmlNodeSetPtr ret_val;
47170 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47173 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47174 mem_base = xmlMemBlocks();
47175 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47177 ret_val = xmlXPathDistinctSorted(nodes);
47178 desret_xmlNodeSetPtr(ret_val);
47180 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47181 xmlResetLastError();
47182 if (mem_base != xmlMemBlocks()) {
47183 printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47184 xmlMemBlocks() - mem_base);
47186 printf(" %d", n_nodes);
47198 test_xmlXPathDivValues(void) {
47201 #if defined(LIBXML_XPATH_ENABLED)
47203 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47206 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47207 mem_base = xmlMemBlocks();
47208 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47210 xmlXPathDivValues(ctxt);
47212 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47213 xmlResetLastError();
47214 if (mem_base != xmlMemBlocks()) {
47215 printf("Leak of %d blocks found in xmlXPathDivValues",
47216 xmlMemBlocks() - mem_base);
47218 printf(" %d", n_ctxt);
47230 test_xmlXPathEqualValues(void) {
47233 #if defined(LIBXML_XPATH_ENABLED)
47236 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47239 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47240 mem_base = xmlMemBlocks();
47241 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47243 ret_val = xmlXPathEqualValues(ctxt);
47244 desret_int(ret_val);
47246 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47247 xmlResetLastError();
47248 if (mem_base != xmlMemBlocks()) {
47249 printf("Leak of %d blocks found in xmlXPathEqualValues",
47250 xmlMemBlocks() - mem_base);
47252 printf(" %d", n_ctxt);
47264 test_xmlXPathErr(void) {
47267 #if defined(LIBXML_XPATH_ENABLED)
47269 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47271 int error; /* the error code */
47274 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47275 for (n_error = 0;n_error < gen_nb_int;n_error++) {
47276 mem_base = xmlMemBlocks();
47277 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47278 error = gen_int(n_error, 1);
47280 xmlXPathErr(ctxt, error);
47282 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47283 des_int(n_error, error, 1);
47284 xmlResetLastError();
47285 if (mem_base != xmlMemBlocks()) {
47286 printf("Leak of %d blocks found in xmlXPathErr",
47287 xmlMemBlocks() - mem_base);
47289 printf(" %d", n_ctxt);
47290 printf(" %d", n_error);
47303 test_xmlXPathEvalExpr(void) {
47306 #if defined(LIBXML_XPATH_ENABLED)
47308 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47311 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47312 mem_base = xmlMemBlocks();
47313 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47315 xmlXPathEvalExpr(ctxt);
47317 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47318 xmlResetLastError();
47319 if (mem_base != xmlMemBlocks()) {
47320 printf("Leak of %d blocks found in xmlXPathEvalExpr",
47321 xmlMemBlocks() - mem_base);
47323 printf(" %d", n_ctxt);
47335 test_xmlXPathEvaluatePredicateResult(void) {
47338 #if defined(LIBXML_XPATH_ENABLED)
47341 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47343 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47346 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47347 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47348 mem_base = xmlMemBlocks();
47349 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47350 res = gen_xmlXPathObjectPtr(n_res, 1);
47352 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47353 desret_int(ret_val);
47355 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47356 des_xmlXPathObjectPtr(n_res, res, 1);
47357 xmlResetLastError();
47358 if (mem_base != xmlMemBlocks()) {
47359 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47360 xmlMemBlocks() - mem_base);
47362 printf(" %d", n_ctxt);
47363 printf(" %d", n_res);
47376 test_xmlXPathFalseFunction(void) {
47379 #if defined(LIBXML_XPATH_ENABLED)
47381 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47383 int nargs; /* the number of arguments */
47386 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47387 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47388 mem_base = xmlMemBlocks();
47389 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47390 nargs = gen_int(n_nargs, 1);
47392 xmlXPathFalseFunction(ctxt, nargs);
47394 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47395 des_int(n_nargs, nargs, 1);
47396 xmlResetLastError();
47397 if (mem_base != xmlMemBlocks()) {
47398 printf("Leak of %d blocks found in xmlXPathFalseFunction",
47399 xmlMemBlocks() - mem_base);
47401 printf(" %d", n_ctxt);
47402 printf(" %d", n_nargs);
47415 test_xmlXPathFloorFunction(void) {
47418 #if defined(LIBXML_XPATH_ENABLED)
47420 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47422 int nargs; /* the number of arguments */
47425 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47426 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47427 mem_base = xmlMemBlocks();
47428 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47429 nargs = gen_int(n_nargs, 1);
47431 xmlXPathFloorFunction(ctxt, nargs);
47433 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47434 des_int(n_nargs, nargs, 1);
47435 xmlResetLastError();
47436 if (mem_base != xmlMemBlocks()) {
47437 printf("Leak of %d blocks found in xmlXPathFloorFunction",
47438 xmlMemBlocks() - mem_base);
47440 printf(" %d", n_ctxt);
47441 printf(" %d", n_nargs);
47454 test_xmlXPathFunctionLookup(void) {
47458 /* missing type support */
47464 test_xmlXPathFunctionLookupNS(void) {
47468 /* missing type support */
47474 test_xmlXPathHasSameNodes(void) {
47477 #if defined(LIBXML_XPATH_ENABLED)
47480 xmlNodeSetPtr nodes1; /* a node-set */
47482 xmlNodeSetPtr nodes2; /* a node-set */
47485 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47486 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47487 mem_base = xmlMemBlocks();
47488 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47489 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47491 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47492 desret_int(ret_val);
47494 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47495 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47496 xmlResetLastError();
47497 if (mem_base != xmlMemBlocks()) {
47498 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47499 xmlMemBlocks() - mem_base);
47501 printf(" %d", n_nodes1);
47502 printf(" %d", n_nodes2);
47515 test_xmlXPathIdFunction(void) {
47518 #if defined(LIBXML_XPATH_ENABLED)
47520 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47522 int nargs; /* the number of arguments */
47525 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47526 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47527 mem_base = xmlMemBlocks();
47528 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47529 nargs = gen_int(n_nargs, 1);
47531 xmlXPathIdFunction(ctxt, nargs);
47533 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47534 des_int(n_nargs, nargs, 1);
47535 xmlResetLastError();
47536 if (mem_base != xmlMemBlocks()) {
47537 printf("Leak of %d blocks found in xmlXPathIdFunction",
47538 xmlMemBlocks() - mem_base);
47540 printf(" %d", n_ctxt);
47541 printf(" %d", n_nargs);
47554 test_xmlXPathIntersection(void) {
47557 #if defined(LIBXML_XPATH_ENABLED)
47559 xmlNodeSetPtr ret_val;
47560 xmlNodeSetPtr nodes1; /* a node-set */
47562 xmlNodeSetPtr nodes2; /* a node-set */
47565 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47566 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47567 mem_base = xmlMemBlocks();
47568 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47569 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47571 ret_val = xmlXPathIntersection(nodes1, nodes2);
47572 desret_xmlNodeSetPtr(ret_val);
47574 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47575 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47576 xmlResetLastError();
47577 if (mem_base != xmlMemBlocks()) {
47578 printf("Leak of %d blocks found in xmlXPathIntersection",
47579 xmlMemBlocks() - mem_base);
47581 printf(" %d", n_nodes1);
47582 printf(" %d", n_nodes2);
47595 test_xmlXPathIsNodeType(void) {
47598 #if defined(LIBXML_XPATH_ENABLED)
47601 xmlChar * name; /* a name string */
47604 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47605 mem_base = xmlMemBlocks();
47606 name = gen_const_xmlChar_ptr(n_name, 0);
47608 ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47609 desret_int(ret_val);
47611 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47612 xmlResetLastError();
47613 if (mem_base != xmlMemBlocks()) {
47614 printf("Leak of %d blocks found in xmlXPathIsNodeType",
47615 xmlMemBlocks() - mem_base);
47617 printf(" %d", n_name);
47629 test_xmlXPathLangFunction(void) {
47632 #if defined(LIBXML_XPATH_ENABLED)
47634 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47636 int nargs; /* the number of arguments */
47639 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47640 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47641 mem_base = xmlMemBlocks();
47642 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47643 nargs = gen_int(n_nargs, 1);
47645 xmlXPathLangFunction(ctxt, nargs);
47647 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47648 des_int(n_nargs, nargs, 1);
47649 xmlResetLastError();
47650 if (mem_base != xmlMemBlocks()) {
47651 printf("Leak of %d blocks found in xmlXPathLangFunction",
47652 xmlMemBlocks() - mem_base);
47654 printf(" %d", n_ctxt);
47655 printf(" %d", n_nargs);
47668 test_xmlXPathLastFunction(void) {
47671 #if defined(LIBXML_XPATH_ENABLED)
47673 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47675 int nargs; /* the number of arguments */
47678 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47679 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47680 mem_base = xmlMemBlocks();
47681 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47682 nargs = gen_int(n_nargs, 1);
47684 xmlXPathLastFunction(ctxt, nargs);
47686 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47687 des_int(n_nargs, nargs, 1);
47688 xmlResetLastError();
47689 if (mem_base != xmlMemBlocks()) {
47690 printf("Leak of %d blocks found in xmlXPathLastFunction",
47691 xmlMemBlocks() - mem_base);
47693 printf(" %d", n_ctxt);
47694 printf(" %d", n_nargs);
47707 test_xmlXPathLeading(void) {
47710 #if defined(LIBXML_XPATH_ENABLED)
47712 xmlNodeSetPtr ret_val;
47713 xmlNodeSetPtr nodes1; /* a node-set */
47715 xmlNodeSetPtr nodes2; /* a node-set */
47718 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47719 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47720 mem_base = xmlMemBlocks();
47721 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47722 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47724 ret_val = xmlXPathLeading(nodes1, nodes2);
47725 desret_xmlNodeSetPtr(ret_val);
47727 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47728 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47729 xmlResetLastError();
47730 if (mem_base != xmlMemBlocks()) {
47731 printf("Leak of %d blocks found in xmlXPathLeading",
47732 xmlMemBlocks() - mem_base);
47734 printf(" %d", n_nodes1);
47735 printf(" %d", n_nodes2);
47748 test_xmlXPathLeadingSorted(void) {
47751 #if defined(LIBXML_XPATH_ENABLED)
47753 xmlNodeSetPtr ret_val;
47754 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47756 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47759 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47760 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47761 mem_base = xmlMemBlocks();
47762 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47763 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47765 ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47766 desret_xmlNodeSetPtr(ret_val);
47768 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47769 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47770 xmlResetLastError();
47771 if (mem_base != xmlMemBlocks()) {
47772 printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47773 xmlMemBlocks() - mem_base);
47775 printf(" %d", n_nodes1);
47776 printf(" %d", n_nodes2);
47789 test_xmlXPathLocalNameFunction(void) {
47792 #if defined(LIBXML_XPATH_ENABLED)
47794 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47796 int nargs; /* the number of arguments */
47799 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47800 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47801 mem_base = xmlMemBlocks();
47802 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47803 nargs = gen_int(n_nargs, 1);
47805 xmlXPathLocalNameFunction(ctxt, nargs);
47807 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47808 des_int(n_nargs, nargs, 1);
47809 xmlResetLastError();
47810 if (mem_base != xmlMemBlocks()) {
47811 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47812 xmlMemBlocks() - mem_base);
47814 printf(" %d", n_ctxt);
47815 printf(" %d", n_nargs);
47828 test_xmlXPathModValues(void) {
47831 #if defined(LIBXML_XPATH_ENABLED)
47833 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47836 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47837 mem_base = xmlMemBlocks();
47838 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47840 xmlXPathModValues(ctxt);
47842 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47843 xmlResetLastError();
47844 if (mem_base != xmlMemBlocks()) {
47845 printf("Leak of %d blocks found in xmlXPathModValues",
47846 xmlMemBlocks() - mem_base);
47848 printf(" %d", n_ctxt);
47860 test_xmlXPathMultValues(void) {
47863 #if defined(LIBXML_XPATH_ENABLED)
47865 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47868 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47869 mem_base = xmlMemBlocks();
47870 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47872 xmlXPathMultValues(ctxt);
47874 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47875 xmlResetLastError();
47876 if (mem_base != xmlMemBlocks()) {
47877 printf("Leak of %d blocks found in xmlXPathMultValues",
47878 xmlMemBlocks() - mem_base);
47880 printf(" %d", n_ctxt);
47892 test_xmlXPathNamespaceURIFunction(void) {
47895 #if defined(LIBXML_XPATH_ENABLED)
47897 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47899 int nargs; /* the number of arguments */
47902 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47903 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47904 mem_base = xmlMemBlocks();
47905 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47906 nargs = gen_int(n_nargs, 1);
47908 xmlXPathNamespaceURIFunction(ctxt, nargs);
47910 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47911 des_int(n_nargs, nargs, 1);
47912 xmlResetLastError();
47913 if (mem_base != xmlMemBlocks()) {
47914 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47915 xmlMemBlocks() - mem_base);
47917 printf(" %d", n_ctxt);
47918 printf(" %d", n_nargs);
47931 test_xmlXPathNewBoolean(void) {
47934 #if defined(LIBXML_XPATH_ENABLED)
47936 xmlXPathObjectPtr ret_val;
47937 int val; /* the boolean value */
47940 for (n_val = 0;n_val < gen_nb_int;n_val++) {
47941 mem_base = xmlMemBlocks();
47942 val = gen_int(n_val, 0);
47944 ret_val = xmlXPathNewBoolean(val);
47945 desret_xmlXPathObjectPtr(ret_val);
47947 des_int(n_val, val, 0);
47948 xmlResetLastError();
47949 if (mem_base != xmlMemBlocks()) {
47950 printf("Leak of %d blocks found in xmlXPathNewBoolean",
47951 xmlMemBlocks() - mem_base);
47953 printf(" %d", n_val);
47965 test_xmlXPathNewCString(void) {
47968 #if defined(LIBXML_XPATH_ENABLED)
47970 xmlXPathObjectPtr ret_val;
47971 char * val; /* the char * value */
47974 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47975 mem_base = xmlMemBlocks();
47976 val = gen_const_char_ptr(n_val, 0);
47978 ret_val = xmlXPathNewCString((const char *)val);
47979 desret_xmlXPathObjectPtr(ret_val);
47981 des_const_char_ptr(n_val, (const char *)val, 0);
47982 xmlResetLastError();
47983 if (mem_base != xmlMemBlocks()) {
47984 printf("Leak of %d blocks found in xmlXPathNewCString",
47985 xmlMemBlocks() - mem_base);
47987 printf(" %d", n_val);
47999 test_xmlXPathNewFloat(void) {
48002 #if defined(LIBXML_XPATH_ENABLED)
48004 xmlXPathObjectPtr ret_val;
48005 double val; /* the double value */
48008 for (n_val = 0;n_val < gen_nb_double;n_val++) {
48009 mem_base = xmlMemBlocks();
48010 val = gen_double(n_val, 0);
48012 ret_val = xmlXPathNewFloat(val);
48013 desret_xmlXPathObjectPtr(ret_val);
48015 des_double(n_val, val, 0);
48016 xmlResetLastError();
48017 if (mem_base != xmlMemBlocks()) {
48018 printf("Leak of %d blocks found in xmlXPathNewFloat",
48019 xmlMemBlocks() - mem_base);
48021 printf(" %d", n_val);
48033 test_xmlXPathNewNodeSet(void) {
48036 #if defined(LIBXML_XPATH_ENABLED)
48038 xmlXPathObjectPtr ret_val;
48039 xmlNodePtr val; /* the NodePtr value */
48042 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48043 mem_base = xmlMemBlocks();
48044 val = gen_xmlNodePtr(n_val, 0);
48046 ret_val = xmlXPathNewNodeSet(val);
48047 desret_xmlXPathObjectPtr(ret_val);
48049 des_xmlNodePtr(n_val, val, 0);
48050 xmlResetLastError();
48051 if (mem_base != xmlMemBlocks()) {
48052 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48053 xmlMemBlocks() - mem_base);
48055 printf(" %d", n_val);
48067 test_xmlXPathNewNodeSetList(void) {
48070 #if defined(LIBXML_XPATH_ENABLED)
48072 xmlXPathObjectPtr ret_val;
48073 xmlNodeSetPtr val; /* an existing NodeSet */
48076 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48077 mem_base = xmlMemBlocks();
48078 val = gen_xmlNodeSetPtr(n_val, 0);
48080 ret_val = xmlXPathNewNodeSetList(val);
48081 desret_xmlXPathObjectPtr(ret_val);
48083 des_xmlNodeSetPtr(n_val, val, 0);
48084 xmlResetLastError();
48085 if (mem_base != xmlMemBlocks()) {
48086 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48087 xmlMemBlocks() - mem_base);
48089 printf(" %d", n_val);
48101 test_xmlXPathNewParserContext(void) {
48105 /* missing type support */
48111 test_xmlXPathNewString(void) {
48114 #if defined(LIBXML_XPATH_ENABLED)
48116 xmlXPathObjectPtr ret_val;
48117 xmlChar * val; /* the xmlChar * value */
48120 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48121 mem_base = xmlMemBlocks();
48122 val = gen_const_xmlChar_ptr(n_val, 0);
48124 ret_val = xmlXPathNewString((const xmlChar *)val);
48125 desret_xmlXPathObjectPtr(ret_val);
48127 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48128 xmlResetLastError();
48129 if (mem_base != xmlMemBlocks()) {
48130 printf("Leak of %d blocks found in xmlXPathNewString",
48131 xmlMemBlocks() - mem_base);
48133 printf(" %d", n_val);
48145 test_xmlXPathNextAncestor(void) {
48148 #if defined(LIBXML_XPATH_ENABLED)
48150 xmlNodePtr ret_val;
48151 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48153 xmlNodePtr cur; /* the current node in the traversal */
48156 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48157 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48158 mem_base = xmlMemBlocks();
48159 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48160 cur = gen_xmlNodePtr(n_cur, 1);
48162 ret_val = xmlXPathNextAncestor(ctxt, cur);
48163 desret_xmlNodePtr(ret_val);
48165 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48166 des_xmlNodePtr(n_cur, cur, 1);
48167 xmlResetLastError();
48168 if (mem_base != xmlMemBlocks()) {
48169 printf("Leak of %d blocks found in xmlXPathNextAncestor",
48170 xmlMemBlocks() - mem_base);
48172 printf(" %d", n_ctxt);
48173 printf(" %d", n_cur);
48186 test_xmlXPathNextAncestorOrSelf(void) {
48189 #if defined(LIBXML_XPATH_ENABLED)
48191 xmlNodePtr ret_val;
48192 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48194 xmlNodePtr cur; /* the current node in the traversal */
48197 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48198 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48199 mem_base = xmlMemBlocks();
48200 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48201 cur = gen_xmlNodePtr(n_cur, 1);
48203 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48204 desret_xmlNodePtr(ret_val);
48206 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48207 des_xmlNodePtr(n_cur, cur, 1);
48208 xmlResetLastError();
48209 if (mem_base != xmlMemBlocks()) {
48210 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48211 xmlMemBlocks() - mem_base);
48213 printf(" %d", n_ctxt);
48214 printf(" %d", n_cur);
48227 test_xmlXPathNextAttribute(void) {
48230 #if defined(LIBXML_XPATH_ENABLED)
48232 xmlNodePtr ret_val;
48233 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48235 xmlNodePtr cur; /* the current attribute in the traversal */
48238 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48239 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48240 mem_base = xmlMemBlocks();
48241 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48242 cur = gen_xmlNodePtr(n_cur, 1);
48244 ret_val = xmlXPathNextAttribute(ctxt, cur);
48245 desret_xmlNodePtr(ret_val);
48247 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48248 des_xmlNodePtr(n_cur, cur, 1);
48249 xmlResetLastError();
48250 if (mem_base != xmlMemBlocks()) {
48251 printf("Leak of %d blocks found in xmlXPathNextAttribute",
48252 xmlMemBlocks() - mem_base);
48254 printf(" %d", n_ctxt);
48255 printf(" %d", n_cur);
48268 test_xmlXPathNextChild(void) {
48271 #if defined(LIBXML_XPATH_ENABLED)
48273 xmlNodePtr ret_val;
48274 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48276 xmlNodePtr cur; /* the current node in the traversal */
48279 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48280 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48281 mem_base = xmlMemBlocks();
48282 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48283 cur = gen_xmlNodePtr(n_cur, 1);
48285 ret_val = xmlXPathNextChild(ctxt, cur);
48286 desret_xmlNodePtr(ret_val);
48288 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48289 des_xmlNodePtr(n_cur, cur, 1);
48290 xmlResetLastError();
48291 if (mem_base != xmlMemBlocks()) {
48292 printf("Leak of %d blocks found in xmlXPathNextChild",
48293 xmlMemBlocks() - mem_base);
48295 printf(" %d", n_ctxt);
48296 printf(" %d", n_cur);
48309 test_xmlXPathNextDescendant(void) {
48312 #if defined(LIBXML_XPATH_ENABLED)
48314 xmlNodePtr ret_val;
48315 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48317 xmlNodePtr cur; /* the current node in the traversal */
48320 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48321 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48322 mem_base = xmlMemBlocks();
48323 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48324 cur = gen_xmlNodePtr(n_cur, 1);
48326 ret_val = xmlXPathNextDescendant(ctxt, cur);
48327 desret_xmlNodePtr(ret_val);
48329 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48330 des_xmlNodePtr(n_cur, cur, 1);
48331 xmlResetLastError();
48332 if (mem_base != xmlMemBlocks()) {
48333 printf("Leak of %d blocks found in xmlXPathNextDescendant",
48334 xmlMemBlocks() - mem_base);
48336 printf(" %d", n_ctxt);
48337 printf(" %d", n_cur);
48350 test_xmlXPathNextDescendantOrSelf(void) {
48353 #if defined(LIBXML_XPATH_ENABLED)
48355 xmlNodePtr ret_val;
48356 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48358 xmlNodePtr cur; /* the current node in the traversal */
48361 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48362 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48363 mem_base = xmlMemBlocks();
48364 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48365 cur = gen_xmlNodePtr(n_cur, 1);
48367 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48368 desret_xmlNodePtr(ret_val);
48370 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48371 des_xmlNodePtr(n_cur, cur, 1);
48372 xmlResetLastError();
48373 if (mem_base != xmlMemBlocks()) {
48374 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48375 xmlMemBlocks() - mem_base);
48377 printf(" %d", n_ctxt);
48378 printf(" %d", n_cur);
48391 test_xmlXPathNextFollowing(void) {
48394 #if defined(LIBXML_XPATH_ENABLED)
48396 xmlNodePtr ret_val;
48397 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48399 xmlNodePtr cur; /* the current node in the traversal */
48402 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48403 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48404 mem_base = xmlMemBlocks();
48405 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48406 cur = gen_xmlNodePtr(n_cur, 1);
48408 ret_val = xmlXPathNextFollowing(ctxt, cur);
48409 desret_xmlNodePtr(ret_val);
48411 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48412 des_xmlNodePtr(n_cur, cur, 1);
48413 xmlResetLastError();
48414 if (mem_base != xmlMemBlocks()) {
48415 printf("Leak of %d blocks found in xmlXPathNextFollowing",
48416 xmlMemBlocks() - mem_base);
48418 printf(" %d", n_ctxt);
48419 printf(" %d", n_cur);
48432 test_xmlXPathNextFollowingSibling(void) {
48435 #if defined(LIBXML_XPATH_ENABLED)
48437 xmlNodePtr ret_val;
48438 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48440 xmlNodePtr cur; /* the current node in the traversal */
48443 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48444 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48445 mem_base = xmlMemBlocks();
48446 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48447 cur = gen_xmlNodePtr(n_cur, 1);
48449 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48450 desret_xmlNodePtr(ret_val);
48452 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48453 des_xmlNodePtr(n_cur, cur, 1);
48454 xmlResetLastError();
48455 if (mem_base != xmlMemBlocks()) {
48456 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48457 xmlMemBlocks() - mem_base);
48459 printf(" %d", n_ctxt);
48460 printf(" %d", n_cur);
48473 test_xmlXPathNextNamespace(void) {
48476 #if defined(LIBXML_XPATH_ENABLED)
48478 xmlNodePtr ret_val;
48479 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48481 xmlNodePtr cur; /* the current attribute in the traversal */
48484 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48485 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48486 mem_base = xmlMemBlocks();
48487 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48488 cur = gen_xmlNodePtr(n_cur, 1);
48490 ret_val = xmlXPathNextNamespace(ctxt, cur);
48491 desret_xmlNodePtr(ret_val);
48493 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48494 des_xmlNodePtr(n_cur, cur, 1);
48495 xmlResetLastError();
48496 if (mem_base != xmlMemBlocks()) {
48497 printf("Leak of %d blocks found in xmlXPathNextNamespace",
48498 xmlMemBlocks() - mem_base);
48500 printf(" %d", n_ctxt);
48501 printf(" %d", n_cur);
48514 test_xmlXPathNextParent(void) {
48517 #if defined(LIBXML_XPATH_ENABLED)
48519 xmlNodePtr ret_val;
48520 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48522 xmlNodePtr cur; /* the current node in the traversal */
48525 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48526 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48527 mem_base = xmlMemBlocks();
48528 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48529 cur = gen_xmlNodePtr(n_cur, 1);
48531 ret_val = xmlXPathNextParent(ctxt, cur);
48532 desret_xmlNodePtr(ret_val);
48534 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48535 des_xmlNodePtr(n_cur, cur, 1);
48536 xmlResetLastError();
48537 if (mem_base != xmlMemBlocks()) {
48538 printf("Leak of %d blocks found in xmlXPathNextParent",
48539 xmlMemBlocks() - mem_base);
48541 printf(" %d", n_ctxt);
48542 printf(" %d", n_cur);
48555 test_xmlXPathNextPreceding(void) {
48558 #if defined(LIBXML_XPATH_ENABLED)
48560 xmlNodePtr ret_val;
48561 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48563 xmlNodePtr cur; /* the current node in the traversal */
48566 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48567 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48568 mem_base = xmlMemBlocks();
48569 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48570 cur = gen_xmlNodePtr(n_cur, 1);
48572 ret_val = xmlXPathNextPreceding(ctxt, cur);
48573 desret_xmlNodePtr(ret_val);
48575 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48576 des_xmlNodePtr(n_cur, cur, 1);
48577 xmlResetLastError();
48578 if (mem_base != xmlMemBlocks()) {
48579 printf("Leak of %d blocks found in xmlXPathNextPreceding",
48580 xmlMemBlocks() - mem_base);
48582 printf(" %d", n_ctxt);
48583 printf(" %d", n_cur);
48596 test_xmlXPathNextPrecedingSibling(void) {
48599 #if defined(LIBXML_XPATH_ENABLED)
48601 xmlNodePtr ret_val;
48602 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48604 xmlNodePtr cur; /* the current node in the traversal */
48607 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48608 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48609 mem_base = xmlMemBlocks();
48610 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48611 cur = gen_xmlNodePtr(n_cur, 1);
48613 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48614 desret_xmlNodePtr(ret_val);
48616 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48617 des_xmlNodePtr(n_cur, cur, 1);
48618 xmlResetLastError();
48619 if (mem_base != xmlMemBlocks()) {
48620 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48621 xmlMemBlocks() - mem_base);
48623 printf(" %d", n_ctxt);
48624 printf(" %d", n_cur);
48637 test_xmlXPathNextSelf(void) {
48640 #if defined(LIBXML_XPATH_ENABLED)
48642 xmlNodePtr ret_val;
48643 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48645 xmlNodePtr cur; /* the current node in the traversal */
48648 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48649 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48650 mem_base = xmlMemBlocks();
48651 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48652 cur = gen_xmlNodePtr(n_cur, 1);
48654 ret_val = xmlXPathNextSelf(ctxt, cur);
48655 desret_xmlNodePtr(ret_val);
48657 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48658 des_xmlNodePtr(n_cur, cur, 1);
48659 xmlResetLastError();
48660 if (mem_base != xmlMemBlocks()) {
48661 printf("Leak of %d blocks found in xmlXPathNextSelf",
48662 xmlMemBlocks() - mem_base);
48664 printf(" %d", n_ctxt);
48665 printf(" %d", n_cur);
48678 test_xmlXPathNodeLeading(void) {
48681 #if defined(LIBXML_XPATH_ENABLED)
48683 xmlNodeSetPtr ret_val;
48684 xmlNodeSetPtr nodes; /* a node-set */
48686 xmlNodePtr node; /* a node */
48689 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48690 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48691 mem_base = xmlMemBlocks();
48692 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48693 node = gen_xmlNodePtr(n_node, 1);
48695 ret_val = xmlXPathNodeLeading(nodes, node);
48696 desret_xmlNodeSetPtr(ret_val);
48698 des_xmlNodeSetPtr(n_nodes, nodes, 0);
48699 des_xmlNodePtr(n_node, node, 1);
48700 xmlResetLastError();
48701 if (mem_base != xmlMemBlocks()) {
48702 printf("Leak of %d blocks found in xmlXPathNodeLeading",
48703 xmlMemBlocks() - mem_base);
48705 printf(" %d", n_nodes);
48706 printf(" %d", n_node);
48719 test_xmlXPathNodeLeadingSorted(void) {
48722 #if defined(LIBXML_XPATH_ENABLED)
48724 xmlNodeSetPtr ret_val;
48725 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48727 xmlNodePtr node; /* a node */
48730 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48731 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48732 mem_base = xmlMemBlocks();
48733 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48734 node = gen_xmlNodePtr(n_node, 1);
48736 ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48737 desret_xmlNodeSetPtr(ret_val);
48739 des_xmlNodeSetPtr(n_nodes, nodes, 0);
48740 des_xmlNodePtr(n_node, node, 1);
48741 xmlResetLastError();
48742 if (mem_base != xmlMemBlocks()) {
48743 printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48744 xmlMemBlocks() - mem_base);
48746 printf(" %d", n_nodes);
48747 printf(" %d", n_node);
48760 test_xmlXPathNodeSetAdd(void) {
48763 #if defined(LIBXML_XPATH_ENABLED)
48765 xmlNodeSetPtr cur; /* the initial node set */
48767 xmlNodePtr val; /* a new xmlNodePtr */
48770 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48771 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48772 mem_base = xmlMemBlocks();
48773 cur = gen_xmlNodeSetPtr(n_cur, 0);
48774 val = gen_xmlNodePtr(n_val, 1);
48776 xmlXPathNodeSetAdd(cur, val);
48778 des_xmlNodeSetPtr(n_cur, cur, 0);
48779 des_xmlNodePtr(n_val, val, 1);
48780 xmlResetLastError();
48781 if (mem_base != xmlMemBlocks()) {
48782 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48783 xmlMemBlocks() - mem_base);
48785 printf(" %d", n_cur);
48786 printf(" %d", n_val);
48799 test_xmlXPathNodeSetAddNs(void) {
48802 #if defined(LIBXML_XPATH_ENABLED)
48804 xmlNodeSetPtr cur; /* the initial node set */
48806 xmlNodePtr node; /* the hosting node */
48808 xmlNsPtr ns; /* a the namespace node */
48811 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48812 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48813 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48814 mem_base = xmlMemBlocks();
48815 cur = gen_xmlNodeSetPtr(n_cur, 0);
48816 node = gen_xmlNodePtr(n_node, 1);
48817 ns = gen_xmlNsPtr(n_ns, 2);
48819 xmlXPathNodeSetAddNs(cur, node, ns);
48821 des_xmlNodeSetPtr(n_cur, cur, 0);
48822 des_xmlNodePtr(n_node, node, 1);
48823 des_xmlNsPtr(n_ns, ns, 2);
48824 xmlResetLastError();
48825 if (mem_base != xmlMemBlocks()) {
48826 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48827 xmlMemBlocks() - mem_base);
48829 printf(" %d", n_cur);
48830 printf(" %d", n_node);
48831 printf(" %d", n_ns);
48845 test_xmlXPathNodeSetAddUnique(void) {
48848 #if defined(LIBXML_XPATH_ENABLED)
48850 xmlNodeSetPtr cur; /* the initial node set */
48852 xmlNodePtr val; /* a new xmlNodePtr */
48855 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48856 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48857 mem_base = xmlMemBlocks();
48858 cur = gen_xmlNodeSetPtr(n_cur, 0);
48859 val = gen_xmlNodePtr(n_val, 1);
48861 xmlXPathNodeSetAddUnique(cur, val);
48863 des_xmlNodeSetPtr(n_cur, cur, 0);
48864 des_xmlNodePtr(n_val, val, 1);
48865 xmlResetLastError();
48866 if (mem_base != xmlMemBlocks()) {
48867 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48868 xmlMemBlocks() - mem_base);
48870 printf(" %d", n_cur);
48871 printf(" %d", n_val);
48884 test_xmlXPathNodeSetContains(void) {
48887 #if defined(LIBXML_XPATH_ENABLED)
48890 xmlNodeSetPtr cur; /* the node-set */
48892 xmlNodePtr val; /* the node */
48895 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48896 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48897 mem_base = xmlMemBlocks();
48898 cur = gen_xmlNodeSetPtr(n_cur, 0);
48899 val = gen_xmlNodePtr(n_val, 1);
48901 ret_val = xmlXPathNodeSetContains(cur, val);
48902 desret_int(ret_val);
48904 des_xmlNodeSetPtr(n_cur, cur, 0);
48905 des_xmlNodePtr(n_val, val, 1);
48906 xmlResetLastError();
48907 if (mem_base != xmlMemBlocks()) {
48908 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48909 xmlMemBlocks() - mem_base);
48911 printf(" %d", n_cur);
48912 printf(" %d", n_val);
48925 test_xmlXPathNodeSetDel(void) {
48928 #if defined(LIBXML_XPATH_ENABLED)
48930 xmlNodeSetPtr cur; /* the initial node set */
48932 xmlNodePtr val; /* an xmlNodePtr */
48935 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48936 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48937 mem_base = xmlMemBlocks();
48938 cur = gen_xmlNodeSetPtr(n_cur, 0);
48939 val = gen_xmlNodePtr(n_val, 1);
48941 xmlXPathNodeSetDel(cur, val);
48943 des_xmlNodeSetPtr(n_cur, cur, 0);
48944 des_xmlNodePtr(n_val, val, 1);
48945 xmlResetLastError();
48946 if (mem_base != xmlMemBlocks()) {
48947 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48948 xmlMemBlocks() - mem_base);
48950 printf(" %d", n_cur);
48951 printf(" %d", n_val);
48964 test_xmlXPathNodeSetMerge(void) {
48967 #if defined(LIBXML_XPATH_ENABLED)
48969 xmlNodeSetPtr ret_val;
48970 xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48972 xmlNodeSetPtr val2; /* the second NodeSet */
48975 for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48976 for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48977 mem_base = xmlMemBlocks();
48978 val1 = gen_xmlNodeSetPtr(n_val1, 0);
48979 val2 = gen_xmlNodeSetPtr(n_val2, 1);
48981 ret_val = xmlXPathNodeSetMerge(val1, val2);
48982 desret_xmlNodeSetPtr(ret_val);
48984 des_xmlNodeSetPtr(n_val1, val1, 0);
48985 des_xmlNodeSetPtr(n_val2, val2, 1);
48986 xmlResetLastError();
48987 if (mem_base != xmlMemBlocks()) {
48988 printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48989 xmlMemBlocks() - mem_base);
48991 printf(" %d", n_val1);
48992 printf(" %d", n_val2);
49005 test_xmlXPathNodeSetRemove(void) {
49008 #if defined(LIBXML_XPATH_ENABLED)
49010 xmlNodeSetPtr cur; /* the initial node set */
49012 int val; /* the index to remove */
49015 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49016 for (n_val = 0;n_val < gen_nb_int;n_val++) {
49017 mem_base = xmlMemBlocks();
49018 cur = gen_xmlNodeSetPtr(n_cur, 0);
49019 val = gen_int(n_val, 1);
49021 xmlXPathNodeSetRemove(cur, val);
49023 des_xmlNodeSetPtr(n_cur, cur, 0);
49024 des_int(n_val, val, 1);
49025 xmlResetLastError();
49026 if (mem_base != xmlMemBlocks()) {
49027 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49028 xmlMemBlocks() - mem_base);
49030 printf(" %d", n_cur);
49031 printf(" %d", n_val);
49044 test_xmlXPathNodeSetSort(void) {
49047 #if defined(LIBXML_XPATH_ENABLED)
49049 xmlNodeSetPtr set; /* the node set */
49052 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49053 mem_base = xmlMemBlocks();
49054 set = gen_xmlNodeSetPtr(n_set, 0);
49056 xmlXPathNodeSetSort(set);
49058 des_xmlNodeSetPtr(n_set, set, 0);
49059 xmlResetLastError();
49060 if (mem_base != xmlMemBlocks()) {
49061 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49062 xmlMemBlocks() - mem_base);
49064 printf(" %d", n_set);
49076 test_xmlXPathNodeTrailing(void) {
49079 #if defined(LIBXML_XPATH_ENABLED)
49081 xmlNodeSetPtr ret_val;
49082 xmlNodeSetPtr nodes; /* a node-set */
49084 xmlNodePtr node; /* a node */
49087 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49088 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49089 mem_base = xmlMemBlocks();
49090 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49091 node = gen_xmlNodePtr(n_node, 1);
49093 ret_val = xmlXPathNodeTrailing(nodes, node);
49094 desret_xmlNodeSetPtr(ret_val);
49096 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49097 des_xmlNodePtr(n_node, node, 1);
49098 xmlResetLastError();
49099 if (mem_base != xmlMemBlocks()) {
49100 printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49101 xmlMemBlocks() - mem_base);
49103 printf(" %d", n_nodes);
49104 printf(" %d", n_node);
49117 test_xmlXPathNodeTrailingSorted(void) {
49120 #if defined(LIBXML_XPATH_ENABLED)
49122 xmlNodeSetPtr ret_val;
49123 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49125 xmlNodePtr node; /* a node */
49128 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49129 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49130 mem_base = xmlMemBlocks();
49131 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49132 node = gen_xmlNodePtr(n_node, 1);
49134 ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49135 desret_xmlNodeSetPtr(ret_val);
49137 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49138 des_xmlNodePtr(n_node, node, 1);
49139 xmlResetLastError();
49140 if (mem_base != xmlMemBlocks()) {
49141 printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49142 xmlMemBlocks() - mem_base);
49144 printf(" %d", n_nodes);
49145 printf(" %d", n_node);
49158 test_xmlXPathNormalizeFunction(void) {
49161 #if defined(LIBXML_XPATH_ENABLED)
49163 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49165 int nargs; /* the number of arguments */
49168 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49169 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49170 mem_base = xmlMemBlocks();
49171 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49172 nargs = gen_int(n_nargs, 1);
49174 xmlXPathNormalizeFunction(ctxt, nargs);
49176 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49177 des_int(n_nargs, nargs, 1);
49178 xmlResetLastError();
49179 if (mem_base != xmlMemBlocks()) {
49180 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49181 xmlMemBlocks() - mem_base);
49183 printf(" %d", n_ctxt);
49184 printf(" %d", n_nargs);
49197 test_xmlXPathNotEqualValues(void) {
49200 #if defined(LIBXML_XPATH_ENABLED)
49203 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49206 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49207 mem_base = xmlMemBlocks();
49208 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49210 ret_val = xmlXPathNotEqualValues(ctxt);
49211 desret_int(ret_val);
49213 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49214 xmlResetLastError();
49215 if (mem_base != xmlMemBlocks()) {
49216 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49217 xmlMemBlocks() - mem_base);
49219 printf(" %d", n_ctxt);
49231 test_xmlXPathNotFunction(void) {
49234 #if defined(LIBXML_XPATH_ENABLED)
49236 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49238 int nargs; /* the number of arguments */
49241 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49242 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49243 mem_base = xmlMemBlocks();
49244 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49245 nargs = gen_int(n_nargs, 1);
49247 xmlXPathNotFunction(ctxt, nargs);
49249 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49250 des_int(n_nargs, nargs, 1);
49251 xmlResetLastError();
49252 if (mem_base != xmlMemBlocks()) {
49253 printf("Leak of %d blocks found in xmlXPathNotFunction",
49254 xmlMemBlocks() - mem_base);
49256 printf(" %d", n_ctxt);
49257 printf(" %d", n_nargs);
49270 test_xmlXPathNsLookup(void) {
49273 #if defined(LIBXML_XPATH_ENABLED)
49275 const xmlChar * ret_val;
49276 xmlXPathContextPtr ctxt; /* the XPath context */
49278 xmlChar * prefix; /* the namespace prefix value */
49281 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49282 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49283 mem_base = xmlMemBlocks();
49284 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49285 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49287 ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49288 desret_const_xmlChar_ptr(ret_val);
49290 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49291 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49292 xmlResetLastError();
49293 if (mem_base != xmlMemBlocks()) {
49294 printf("Leak of %d blocks found in xmlXPathNsLookup",
49295 xmlMemBlocks() - mem_base);
49297 printf(" %d", n_ctxt);
49298 printf(" %d", n_prefix);
49311 test_xmlXPathNumberFunction(void) {
49314 #if defined(LIBXML_XPATH_ENABLED)
49316 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49318 int nargs; /* the number of arguments */
49321 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49322 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49323 mem_base = xmlMemBlocks();
49324 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49325 nargs = gen_int(n_nargs, 1);
49327 xmlXPathNumberFunction(ctxt, nargs);
49329 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49330 des_int(n_nargs, nargs, 1);
49331 xmlResetLastError();
49332 if (mem_base != xmlMemBlocks()) {
49333 printf("Leak of %d blocks found in xmlXPathNumberFunction",
49334 xmlMemBlocks() - mem_base);
49336 printf(" %d", n_ctxt);
49337 printf(" %d", n_nargs);
49350 test_xmlXPathParseNCName(void) {
49353 #if defined(LIBXML_XPATH_ENABLED)
49356 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49359 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49360 mem_base = xmlMemBlocks();
49361 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49363 ret_val = xmlXPathParseNCName(ctxt);
49364 desret_xmlChar_ptr(ret_val);
49366 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49367 xmlResetLastError();
49368 if (mem_base != xmlMemBlocks()) {
49369 printf("Leak of %d blocks found in xmlXPathParseNCName",
49370 xmlMemBlocks() - mem_base);
49372 printf(" %d", n_ctxt);
49384 test_xmlXPathParseName(void) {
49387 #if defined(LIBXML_XPATH_ENABLED)
49390 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49393 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49394 mem_base = xmlMemBlocks();
49395 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49397 ret_val = xmlXPathParseName(ctxt);
49398 desret_xmlChar_ptr(ret_val);
49400 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49401 xmlResetLastError();
49402 if (mem_base != xmlMemBlocks()) {
49403 printf("Leak of %d blocks found in xmlXPathParseName",
49404 xmlMemBlocks() - mem_base);
49406 printf(" %d", n_ctxt);
49418 test_xmlXPathPopBoolean(void) {
49421 #if defined(LIBXML_XPATH_ENABLED)
49424 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49427 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49428 mem_base = xmlMemBlocks();
49429 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49431 ret_val = xmlXPathPopBoolean(ctxt);
49432 desret_int(ret_val);
49434 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49435 xmlResetLastError();
49436 if (mem_base != xmlMemBlocks()) {
49437 printf("Leak of %d blocks found in xmlXPathPopBoolean",
49438 xmlMemBlocks() - mem_base);
49440 printf(" %d", n_ctxt);
49452 test_xmlXPathPopExternal(void) {
49455 #if defined(LIBXML_XPATH_ENABLED)
49458 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49461 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49462 mem_base = xmlMemBlocks();
49463 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49465 ret_val = xmlXPathPopExternal(ctxt);
49466 desret_void_ptr(ret_val);
49468 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49469 xmlResetLastError();
49470 if (mem_base != xmlMemBlocks()) {
49471 printf("Leak of %d blocks found in xmlXPathPopExternal",
49472 xmlMemBlocks() - mem_base);
49474 printf(" %d", n_ctxt);
49486 test_xmlXPathPopNodeSet(void) {
49489 #if defined(LIBXML_XPATH_ENABLED)
49491 xmlNodeSetPtr ret_val;
49492 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49495 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49496 mem_base = xmlMemBlocks();
49497 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49499 ret_val = xmlXPathPopNodeSet(ctxt);
49500 desret_xmlNodeSetPtr(ret_val);
49502 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49503 xmlResetLastError();
49504 if (mem_base != xmlMemBlocks()) {
49505 printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49506 xmlMemBlocks() - mem_base);
49508 printf(" %d", n_ctxt);
49520 test_xmlXPathPopNumber(void) {
49523 #if defined(LIBXML_XPATH_ENABLED)
49526 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49529 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49530 mem_base = xmlMemBlocks();
49531 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49533 ret_val = xmlXPathPopNumber(ctxt);
49534 desret_double(ret_val);
49536 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49537 xmlResetLastError();
49538 if (mem_base != xmlMemBlocks()) {
49539 printf("Leak of %d blocks found in xmlXPathPopNumber",
49540 xmlMemBlocks() - mem_base);
49542 printf(" %d", n_ctxt);
49554 test_xmlXPathPopString(void) {
49557 #if defined(LIBXML_XPATH_ENABLED)
49560 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49563 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49564 mem_base = xmlMemBlocks();
49565 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49567 ret_val = xmlXPathPopString(ctxt);
49568 desret_xmlChar_ptr(ret_val);
49570 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49571 xmlResetLastError();
49572 if (mem_base != xmlMemBlocks()) {
49573 printf("Leak of %d blocks found in xmlXPathPopString",
49574 xmlMemBlocks() - mem_base);
49576 printf(" %d", n_ctxt);
49588 test_xmlXPathPositionFunction(void) {
49591 #if defined(LIBXML_XPATH_ENABLED)
49593 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49595 int nargs; /* the number of arguments */
49598 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49599 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49600 mem_base = xmlMemBlocks();
49601 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49602 nargs = gen_int(n_nargs, 1);
49604 xmlXPathPositionFunction(ctxt, nargs);
49606 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49607 des_int(n_nargs, nargs, 1);
49608 xmlResetLastError();
49609 if (mem_base != xmlMemBlocks()) {
49610 printf("Leak of %d blocks found in xmlXPathPositionFunction",
49611 xmlMemBlocks() - mem_base);
49613 printf(" %d", n_ctxt);
49614 printf(" %d", n_nargs);
49627 test_xmlXPathRegisterAllFunctions(void) {
49630 #if defined(LIBXML_XPATH_ENABLED)
49632 xmlXPathContextPtr ctxt; /* the XPath context */
49635 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49636 mem_base = xmlMemBlocks();
49637 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49639 xmlXPathRegisterAllFunctions(ctxt);
49641 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49642 xmlResetLastError();
49643 if (mem_base != xmlMemBlocks()) {
49644 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49645 xmlMemBlocks() - mem_base);
49647 printf(" %d", n_ctxt);
49659 test_xmlXPathRegisterFunc(void) {
49663 /* missing type support */
49669 test_xmlXPathRegisterFuncLookup(void) {
49673 /* missing type support */
49679 test_xmlXPathRegisterFuncNS(void) {
49683 /* missing type support */
49689 test_xmlXPathRegisterNs(void) {
49692 #if defined(LIBXML_XPATH_ENABLED)
49695 xmlXPathContextPtr ctxt; /* the XPath context */
49697 xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49699 xmlChar * ns_uri; /* the namespace name */
49702 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49703 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49704 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49705 mem_base = xmlMemBlocks();
49706 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49707 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49708 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49710 ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49711 desret_int(ret_val);
49713 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49714 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49715 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49716 xmlResetLastError();
49717 if (mem_base != xmlMemBlocks()) {
49718 printf("Leak of %d blocks found in xmlXPathRegisterNs",
49719 xmlMemBlocks() - mem_base);
49721 printf(" %d", n_ctxt);
49722 printf(" %d", n_prefix);
49723 printf(" %d", n_ns_uri);
49737 test_xmlXPathRegisterVariable(void) {
49740 #if defined(LIBXML_XPATH_ENABLED)
49743 xmlXPathContextPtr ctxt; /* the XPath context */
49745 xmlChar * name; /* the variable name */
49747 xmlXPathObjectPtr value; /* the variable value or NULL */
49750 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49751 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49752 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49753 mem_base = xmlMemBlocks();
49754 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49755 name = gen_const_xmlChar_ptr(n_name, 1);
49756 value = gen_xmlXPathObjectPtr(n_value, 2);
49758 ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49759 desret_int(ret_val);
49761 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49762 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49763 des_xmlXPathObjectPtr(n_value, value, 2);
49764 xmlResetLastError();
49765 if (mem_base != xmlMemBlocks()) {
49766 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49767 xmlMemBlocks() - mem_base);
49769 printf(" %d", n_ctxt);
49770 printf(" %d", n_name);
49771 printf(" %d", n_value);
49785 test_xmlXPathRegisterVariableLookup(void) {
49789 /* missing type support */
49795 test_xmlXPathRegisterVariableNS(void) {
49798 #if defined(LIBXML_XPATH_ENABLED)
49801 xmlXPathContextPtr ctxt; /* the XPath context */
49803 xmlChar * name; /* the variable name */
49805 xmlChar * ns_uri; /* the variable namespace URI */
49807 xmlXPathObjectPtr value; /* the variable value or NULL */
49810 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49811 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49812 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49813 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49814 mem_base = xmlMemBlocks();
49815 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49816 name = gen_const_xmlChar_ptr(n_name, 1);
49817 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49818 value = gen_xmlXPathObjectPtr(n_value, 3);
49820 ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49821 desret_int(ret_val);
49823 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49824 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49825 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49826 des_xmlXPathObjectPtr(n_value, value, 3);
49827 xmlResetLastError();
49828 if (mem_base != xmlMemBlocks()) {
49829 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49830 xmlMemBlocks() - mem_base);
49832 printf(" %d", n_ctxt);
49833 printf(" %d", n_name);
49834 printf(" %d", n_ns_uri);
49835 printf(" %d", n_value);
49850 test_xmlXPathRegisteredFuncsCleanup(void) {
49853 #if defined(LIBXML_XPATH_ENABLED)
49855 xmlXPathContextPtr ctxt; /* the XPath context */
49858 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49859 mem_base = xmlMemBlocks();
49860 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49862 xmlXPathRegisteredFuncsCleanup(ctxt);
49864 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49865 xmlResetLastError();
49866 if (mem_base != xmlMemBlocks()) {
49867 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49868 xmlMemBlocks() - mem_base);
49870 printf(" %d", n_ctxt);
49882 test_xmlXPathRegisteredNsCleanup(void) {
49885 #if defined(LIBXML_XPATH_ENABLED)
49887 xmlXPathContextPtr ctxt; /* the XPath context */
49890 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49891 mem_base = xmlMemBlocks();
49892 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49894 xmlXPathRegisteredNsCleanup(ctxt);
49896 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49897 xmlResetLastError();
49898 if (mem_base != xmlMemBlocks()) {
49899 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49900 xmlMemBlocks() - mem_base);
49902 printf(" %d", n_ctxt);
49914 test_xmlXPathRegisteredVariablesCleanup(void) {
49917 #if defined(LIBXML_XPATH_ENABLED)
49919 xmlXPathContextPtr ctxt; /* the XPath context */
49922 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49923 mem_base = xmlMemBlocks();
49924 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49926 xmlXPathRegisteredVariablesCleanup(ctxt);
49928 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49929 xmlResetLastError();
49930 if (mem_base != xmlMemBlocks()) {
49931 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49932 xmlMemBlocks() - mem_base);
49934 printf(" %d", n_ctxt);
49946 test_xmlXPathRoot(void) {
49949 #if defined(LIBXML_XPATH_ENABLED)
49951 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49954 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49955 mem_base = xmlMemBlocks();
49956 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49958 xmlXPathRoot(ctxt);
49960 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49961 xmlResetLastError();
49962 if (mem_base != xmlMemBlocks()) {
49963 printf("Leak of %d blocks found in xmlXPathRoot",
49964 xmlMemBlocks() - mem_base);
49966 printf(" %d", n_ctxt);
49978 test_xmlXPathRoundFunction(void) {
49981 #if defined(LIBXML_XPATH_ENABLED)
49983 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49985 int nargs; /* the number of arguments */
49988 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49989 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49990 mem_base = xmlMemBlocks();
49991 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49992 nargs = gen_int(n_nargs, 1);
49994 xmlXPathRoundFunction(ctxt, nargs);
49996 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49997 des_int(n_nargs, nargs, 1);
49998 xmlResetLastError();
49999 if (mem_base != xmlMemBlocks()) {
50000 printf("Leak of %d blocks found in xmlXPathRoundFunction",
50001 xmlMemBlocks() - mem_base);
50003 printf(" %d", n_ctxt);
50004 printf(" %d", n_nargs);
50017 test_xmlXPathStartsWithFunction(void) {
50020 #if defined(LIBXML_XPATH_ENABLED)
50022 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50024 int nargs; /* the number of arguments */
50027 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50028 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50029 mem_base = xmlMemBlocks();
50030 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50031 nargs = gen_int(n_nargs, 1);
50033 xmlXPathStartsWithFunction(ctxt, nargs);
50035 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50036 des_int(n_nargs, nargs, 1);
50037 xmlResetLastError();
50038 if (mem_base != xmlMemBlocks()) {
50039 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50040 xmlMemBlocks() - mem_base);
50042 printf(" %d", n_ctxt);
50043 printf(" %d", n_nargs);
50056 test_xmlXPathStringEvalNumber(void) {
50059 #if defined(LIBXML_XPATH_ENABLED)
50062 xmlChar * str; /* A string to scan */
50065 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50066 mem_base = xmlMemBlocks();
50067 str = gen_const_xmlChar_ptr(n_str, 0);
50069 ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50070 desret_double(ret_val);
50072 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50073 xmlResetLastError();
50074 if (mem_base != xmlMemBlocks()) {
50075 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50076 xmlMemBlocks() - mem_base);
50078 printf(" %d", n_str);
50090 test_xmlXPathStringFunction(void) {
50093 #if defined(LIBXML_XPATH_ENABLED)
50095 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50097 int nargs; /* the number of arguments */
50100 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50101 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50102 mem_base = xmlMemBlocks();
50103 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50104 nargs = gen_int(n_nargs, 1);
50106 xmlXPathStringFunction(ctxt, nargs);
50108 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50109 des_int(n_nargs, nargs, 1);
50110 xmlResetLastError();
50111 if (mem_base != xmlMemBlocks()) {
50112 printf("Leak of %d blocks found in xmlXPathStringFunction",
50113 xmlMemBlocks() - mem_base);
50115 printf(" %d", n_ctxt);
50116 printf(" %d", n_nargs);
50129 test_xmlXPathStringLengthFunction(void) {
50132 #if defined(LIBXML_XPATH_ENABLED)
50134 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50136 int nargs; /* the number of arguments */
50139 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50140 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50141 mem_base = xmlMemBlocks();
50142 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50143 nargs = gen_int(n_nargs, 1);
50145 xmlXPathStringLengthFunction(ctxt, nargs);
50147 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50148 des_int(n_nargs, nargs, 1);
50149 xmlResetLastError();
50150 if (mem_base != xmlMemBlocks()) {
50151 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50152 xmlMemBlocks() - mem_base);
50154 printf(" %d", n_ctxt);
50155 printf(" %d", n_nargs);
50168 test_xmlXPathSubValues(void) {
50171 #if defined(LIBXML_XPATH_ENABLED)
50173 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50176 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50177 mem_base = xmlMemBlocks();
50178 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50180 xmlXPathSubValues(ctxt);
50182 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50183 xmlResetLastError();
50184 if (mem_base != xmlMemBlocks()) {
50185 printf("Leak of %d blocks found in xmlXPathSubValues",
50186 xmlMemBlocks() - mem_base);
50188 printf(" %d", n_ctxt);
50200 test_xmlXPathSubstringAfterFunction(void) {
50203 #if defined(LIBXML_XPATH_ENABLED)
50205 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50207 int nargs; /* the number of arguments */
50210 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50211 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50212 mem_base = xmlMemBlocks();
50213 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50214 nargs = gen_int(n_nargs, 1);
50216 xmlXPathSubstringAfterFunction(ctxt, nargs);
50218 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50219 des_int(n_nargs, nargs, 1);
50220 xmlResetLastError();
50221 if (mem_base != xmlMemBlocks()) {
50222 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50223 xmlMemBlocks() - mem_base);
50225 printf(" %d", n_ctxt);
50226 printf(" %d", n_nargs);
50239 test_xmlXPathSubstringBeforeFunction(void) {
50242 #if defined(LIBXML_XPATH_ENABLED)
50244 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50246 int nargs; /* the number of arguments */
50249 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50250 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50251 mem_base = xmlMemBlocks();
50252 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50253 nargs = gen_int(n_nargs, 1);
50255 xmlXPathSubstringBeforeFunction(ctxt, nargs);
50257 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50258 des_int(n_nargs, nargs, 1);
50259 xmlResetLastError();
50260 if (mem_base != xmlMemBlocks()) {
50261 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50262 xmlMemBlocks() - mem_base);
50264 printf(" %d", n_ctxt);
50265 printf(" %d", n_nargs);
50278 test_xmlXPathSubstringFunction(void) {
50281 #if defined(LIBXML_XPATH_ENABLED)
50283 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50285 int nargs; /* the number of arguments */
50288 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50289 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50290 mem_base = xmlMemBlocks();
50291 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50292 nargs = gen_int(n_nargs, 1);
50294 xmlXPathSubstringFunction(ctxt, nargs);
50296 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50297 des_int(n_nargs, nargs, 1);
50298 xmlResetLastError();
50299 if (mem_base != xmlMemBlocks()) {
50300 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50301 xmlMemBlocks() - mem_base);
50303 printf(" %d", n_ctxt);
50304 printf(" %d", n_nargs);
50317 test_xmlXPathSumFunction(void) {
50320 #if defined(LIBXML_XPATH_ENABLED)
50322 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50324 int nargs; /* the number of arguments */
50327 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50328 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50329 mem_base = xmlMemBlocks();
50330 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50331 nargs = gen_int(n_nargs, 1);
50333 xmlXPathSumFunction(ctxt, nargs);
50335 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50336 des_int(n_nargs, nargs, 1);
50337 xmlResetLastError();
50338 if (mem_base != xmlMemBlocks()) {
50339 printf("Leak of %d blocks found in xmlXPathSumFunction",
50340 xmlMemBlocks() - mem_base);
50342 printf(" %d", n_ctxt);
50343 printf(" %d", n_nargs);
50356 test_xmlXPathTrailing(void) {
50359 #if defined(LIBXML_XPATH_ENABLED)
50361 xmlNodeSetPtr ret_val;
50362 xmlNodeSetPtr nodes1; /* a node-set */
50364 xmlNodeSetPtr nodes2; /* a node-set */
50367 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50368 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50369 mem_base = xmlMemBlocks();
50370 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50371 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50373 ret_val = xmlXPathTrailing(nodes1, nodes2);
50374 desret_xmlNodeSetPtr(ret_val);
50376 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50377 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50378 xmlResetLastError();
50379 if (mem_base != xmlMemBlocks()) {
50380 printf("Leak of %d blocks found in xmlXPathTrailing",
50381 xmlMemBlocks() - mem_base);
50383 printf(" %d", n_nodes1);
50384 printf(" %d", n_nodes2);
50397 test_xmlXPathTrailingSorted(void) {
50400 #if defined(LIBXML_XPATH_ENABLED)
50402 xmlNodeSetPtr ret_val;
50403 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50405 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50408 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50409 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50410 mem_base = xmlMemBlocks();
50411 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50412 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50414 ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50415 desret_xmlNodeSetPtr(ret_val);
50417 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50418 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50419 xmlResetLastError();
50420 if (mem_base != xmlMemBlocks()) {
50421 printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50422 xmlMemBlocks() - mem_base);
50424 printf(" %d", n_nodes1);
50425 printf(" %d", n_nodes2);
50438 test_xmlXPathTranslateFunction(void) {
50441 #if defined(LIBXML_XPATH_ENABLED)
50443 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50445 int nargs; /* the number of arguments */
50448 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50449 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50450 mem_base = xmlMemBlocks();
50451 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50452 nargs = gen_int(n_nargs, 1);
50454 xmlXPathTranslateFunction(ctxt, nargs);
50456 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50457 des_int(n_nargs, nargs, 1);
50458 xmlResetLastError();
50459 if (mem_base != xmlMemBlocks()) {
50460 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50461 xmlMemBlocks() - mem_base);
50463 printf(" %d", n_ctxt);
50464 printf(" %d", n_nargs);
50477 test_xmlXPathTrueFunction(void) {
50480 #if defined(LIBXML_XPATH_ENABLED)
50482 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50484 int nargs; /* the number of arguments */
50487 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50488 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50489 mem_base = xmlMemBlocks();
50490 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50491 nargs = gen_int(n_nargs, 1);
50493 xmlXPathTrueFunction(ctxt, nargs);
50495 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50496 des_int(n_nargs, nargs, 1);
50497 xmlResetLastError();
50498 if (mem_base != xmlMemBlocks()) {
50499 printf("Leak of %d blocks found in xmlXPathTrueFunction",
50500 xmlMemBlocks() - mem_base);
50502 printf(" %d", n_ctxt);
50503 printf(" %d", n_nargs);
50516 test_xmlXPathValueFlipSign(void) {
50519 #if defined(LIBXML_XPATH_ENABLED)
50521 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50524 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50525 mem_base = xmlMemBlocks();
50526 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50528 xmlXPathValueFlipSign(ctxt);
50530 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50531 xmlResetLastError();
50532 if (mem_base != xmlMemBlocks()) {
50533 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50534 xmlMemBlocks() - mem_base);
50536 printf(" %d", n_ctxt);
50548 test_xmlXPathVariableLookup(void) {
50551 #if defined(LIBXML_XPATH_ENABLED)
50553 xmlXPathObjectPtr ret_val;
50554 xmlXPathContextPtr ctxt; /* the XPath context */
50556 xmlChar * name; /* the variable name */
50559 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50560 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50561 mem_base = xmlMemBlocks();
50562 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50563 name = gen_const_xmlChar_ptr(n_name, 1);
50565 ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50566 desret_xmlXPathObjectPtr(ret_val);
50568 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50569 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50570 xmlResetLastError();
50571 if (mem_base != xmlMemBlocks()) {
50572 printf("Leak of %d blocks found in xmlXPathVariableLookup",
50573 xmlMemBlocks() - mem_base);
50575 printf(" %d", n_ctxt);
50576 printf(" %d", n_name);
50589 test_xmlXPathVariableLookupNS(void) {
50592 #if defined(LIBXML_XPATH_ENABLED)
50594 xmlXPathObjectPtr ret_val;
50595 xmlXPathContextPtr ctxt; /* the XPath context */
50597 xmlChar * name; /* the variable name */
50599 xmlChar * ns_uri; /* the variable namespace URI */
50602 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50603 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50604 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50605 mem_base = xmlMemBlocks();
50606 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50607 name = gen_const_xmlChar_ptr(n_name, 1);
50608 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50610 ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50611 desret_xmlXPathObjectPtr(ret_val);
50613 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50614 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50615 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50616 xmlResetLastError();
50617 if (mem_base != xmlMemBlocks()) {
50618 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50619 xmlMemBlocks() - mem_base);
50621 printf(" %d", n_ctxt);
50622 printf(" %d", n_name);
50623 printf(" %d", n_ns_uri);
50637 test_xmlXPathWrapCString(void) {
50640 #if defined(LIBXML_XPATH_ENABLED)
50642 xmlXPathObjectPtr ret_val;
50643 char * val; /* the char * value */
50646 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50647 mem_base = xmlMemBlocks();
50648 val = gen_char_ptr(n_val, 0);
50650 ret_val = xmlXPathWrapCString(val);
50651 desret_xmlXPathObjectPtr(ret_val);
50653 des_char_ptr(n_val, val, 0);
50654 xmlResetLastError();
50655 if (mem_base != xmlMemBlocks()) {
50656 printf("Leak of %d blocks found in xmlXPathWrapCString",
50657 xmlMemBlocks() - mem_base);
50659 printf(" %d", n_val);
50671 test_xmlXPathWrapExternal(void) {
50674 #if defined(LIBXML_XPATH_ENABLED)
50676 xmlXPathObjectPtr ret_val;
50677 void * val; /* the user data */
50680 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50681 mem_base = xmlMemBlocks();
50682 val = gen_void_ptr(n_val, 0);
50684 ret_val = xmlXPathWrapExternal(val);
50685 desret_xmlXPathObjectPtr(ret_val);
50687 des_void_ptr(n_val, val, 0);
50688 xmlResetLastError();
50689 if (mem_base != xmlMemBlocks()) {
50690 printf("Leak of %d blocks found in xmlXPathWrapExternal",
50691 xmlMemBlocks() - mem_base);
50693 printf(" %d", n_val);
50705 test_xmlXPathWrapNodeSet(void) {
50708 #if defined(LIBXML_XPATH_ENABLED)
50710 xmlXPathObjectPtr ret_val;
50711 xmlNodeSetPtr val; /* the NodePtr value */
50714 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50715 mem_base = xmlMemBlocks();
50716 val = gen_xmlNodeSetPtr(n_val, 0);
50718 ret_val = xmlXPathWrapNodeSet(val);
50719 desret_xmlXPathObjectPtr(ret_val);
50721 des_xmlNodeSetPtr(n_val, val, 0);
50722 xmlResetLastError();
50723 if (mem_base != xmlMemBlocks()) {
50724 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50725 xmlMemBlocks() - mem_base);
50727 printf(" %d", n_val);
50739 test_xmlXPatherror(void) {
50742 #if defined(LIBXML_XPATH_ENABLED)
50744 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50746 const char * file; /* the file name */
50748 int line; /* the line number */
50750 int no; /* the error number */
50753 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50754 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50755 for (n_line = 0;n_line < gen_nb_int;n_line++) {
50756 for (n_no = 0;n_no < gen_nb_int;n_no++) {
50757 mem_base = xmlMemBlocks();
50758 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50759 file = gen_filepath(n_file, 1);
50760 line = gen_int(n_line, 2);
50761 no = gen_int(n_no, 3);
50763 xmlXPatherror(ctxt, file, line, no);
50765 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50766 des_filepath(n_file, file, 1);
50767 des_int(n_line, line, 2);
50768 des_int(n_no, no, 3);
50769 xmlResetLastError();
50770 if (mem_base != xmlMemBlocks()) {
50771 printf("Leak of %d blocks found in xmlXPatherror",
50772 xmlMemBlocks() - mem_base);
50774 printf(" %d", n_ctxt);
50775 printf(" %d", n_file);
50776 printf(" %d", n_line);
50777 printf(" %d", n_no);
50791 test_xpathInternals(void) {
50794 if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50795 test_ret += test_valuePop();
50796 test_ret += test_valuePush();
50797 test_ret += test_xmlXPathAddValues();
50798 test_ret += test_xmlXPathBooleanFunction();
50799 test_ret += test_xmlXPathCeilingFunction();
50800 test_ret += test_xmlXPathCompareValues();
50801 test_ret += test_xmlXPathConcatFunction();
50802 test_ret += test_xmlXPathContainsFunction();
50803 test_ret += test_xmlXPathCountFunction();
50804 test_ret += test_xmlXPathDebugDumpCompExpr();
50805 test_ret += test_xmlXPathDebugDumpObject();
50806 test_ret += test_xmlXPathDifference();
50807 test_ret += test_xmlXPathDistinct();
50808 test_ret += test_xmlXPathDistinctSorted();
50809 test_ret += test_xmlXPathDivValues();
50810 test_ret += test_xmlXPathEqualValues();
50811 test_ret += test_xmlXPathErr();
50812 test_ret += test_xmlXPathEvalExpr();
50813 test_ret += test_xmlXPathEvaluatePredicateResult();
50814 test_ret += test_xmlXPathFalseFunction();
50815 test_ret += test_xmlXPathFloorFunction();
50816 test_ret += test_xmlXPathFunctionLookup();
50817 test_ret += test_xmlXPathFunctionLookupNS();
50818 test_ret += test_xmlXPathHasSameNodes();
50819 test_ret += test_xmlXPathIdFunction();
50820 test_ret += test_xmlXPathIntersection();
50821 test_ret += test_xmlXPathIsNodeType();
50822 test_ret += test_xmlXPathLangFunction();
50823 test_ret += test_xmlXPathLastFunction();
50824 test_ret += test_xmlXPathLeading();
50825 test_ret += test_xmlXPathLeadingSorted();
50826 test_ret += test_xmlXPathLocalNameFunction();
50827 test_ret += test_xmlXPathModValues();
50828 test_ret += test_xmlXPathMultValues();
50829 test_ret += test_xmlXPathNamespaceURIFunction();
50830 test_ret += test_xmlXPathNewBoolean();
50831 test_ret += test_xmlXPathNewCString();
50832 test_ret += test_xmlXPathNewFloat();
50833 test_ret += test_xmlXPathNewNodeSet();
50834 test_ret += test_xmlXPathNewNodeSetList();
50835 test_ret += test_xmlXPathNewParserContext();
50836 test_ret += test_xmlXPathNewString();
50837 test_ret += test_xmlXPathNextAncestor();
50838 test_ret += test_xmlXPathNextAncestorOrSelf();
50839 test_ret += test_xmlXPathNextAttribute();
50840 test_ret += test_xmlXPathNextChild();
50841 test_ret += test_xmlXPathNextDescendant();
50842 test_ret += test_xmlXPathNextDescendantOrSelf();
50843 test_ret += test_xmlXPathNextFollowing();
50844 test_ret += test_xmlXPathNextFollowingSibling();
50845 test_ret += test_xmlXPathNextNamespace();
50846 test_ret += test_xmlXPathNextParent();
50847 test_ret += test_xmlXPathNextPreceding();
50848 test_ret += test_xmlXPathNextPrecedingSibling();
50849 test_ret += test_xmlXPathNextSelf();
50850 test_ret += test_xmlXPathNodeLeading();
50851 test_ret += test_xmlXPathNodeLeadingSorted();
50852 test_ret += test_xmlXPathNodeSetAdd();
50853 test_ret += test_xmlXPathNodeSetAddNs();
50854 test_ret += test_xmlXPathNodeSetAddUnique();
50855 test_ret += test_xmlXPathNodeSetContains();
50856 test_ret += test_xmlXPathNodeSetDel();
50857 test_ret += test_xmlXPathNodeSetMerge();
50858 test_ret += test_xmlXPathNodeSetRemove();
50859 test_ret += test_xmlXPathNodeSetSort();
50860 test_ret += test_xmlXPathNodeTrailing();
50861 test_ret += test_xmlXPathNodeTrailingSorted();
50862 test_ret += test_xmlXPathNormalizeFunction();
50863 test_ret += test_xmlXPathNotEqualValues();
50864 test_ret += test_xmlXPathNotFunction();
50865 test_ret += test_xmlXPathNsLookup();
50866 test_ret += test_xmlXPathNumberFunction();
50867 test_ret += test_xmlXPathParseNCName();
50868 test_ret += test_xmlXPathParseName();
50869 test_ret += test_xmlXPathPopBoolean();
50870 test_ret += test_xmlXPathPopExternal();
50871 test_ret += test_xmlXPathPopNodeSet();
50872 test_ret += test_xmlXPathPopNumber();
50873 test_ret += test_xmlXPathPopString();
50874 test_ret += test_xmlXPathPositionFunction();
50875 test_ret += test_xmlXPathRegisterAllFunctions();
50876 test_ret += test_xmlXPathRegisterFunc();
50877 test_ret += test_xmlXPathRegisterFuncLookup();
50878 test_ret += test_xmlXPathRegisterFuncNS();
50879 test_ret += test_xmlXPathRegisterNs();
50880 test_ret += test_xmlXPathRegisterVariable();
50881 test_ret += test_xmlXPathRegisterVariableLookup();
50882 test_ret += test_xmlXPathRegisterVariableNS();
50883 test_ret += test_xmlXPathRegisteredFuncsCleanup();
50884 test_ret += test_xmlXPathRegisteredNsCleanup();
50885 test_ret += test_xmlXPathRegisteredVariablesCleanup();
50886 test_ret += test_xmlXPathRoot();
50887 test_ret += test_xmlXPathRoundFunction();
50888 test_ret += test_xmlXPathStartsWithFunction();
50889 test_ret += test_xmlXPathStringEvalNumber();
50890 test_ret += test_xmlXPathStringFunction();
50891 test_ret += test_xmlXPathStringLengthFunction();
50892 test_ret += test_xmlXPathSubValues();
50893 test_ret += test_xmlXPathSubstringAfterFunction();
50894 test_ret += test_xmlXPathSubstringBeforeFunction();
50895 test_ret += test_xmlXPathSubstringFunction();
50896 test_ret += test_xmlXPathSumFunction();
50897 test_ret += test_xmlXPathTrailing();
50898 test_ret += test_xmlXPathTrailingSorted();
50899 test_ret += test_xmlXPathTranslateFunction();
50900 test_ret += test_xmlXPathTrueFunction();
50901 test_ret += test_xmlXPathValueFlipSign();
50902 test_ret += test_xmlXPathVariableLookup();
50903 test_ret += test_xmlXPathVariableLookupNS();
50904 test_ret += test_xmlXPathWrapCString();
50905 test_ret += test_xmlXPathWrapExternal();
50906 test_ret += test_xmlXPathWrapNodeSet();
50907 test_ret += test_xmlXPatherror();
50910 printf("Module xpathInternals: %d errors\n", test_ret);
50915 test_xmlXPtrBuildNodeList(void) {
50918 #if defined(LIBXML_XPTR_ENABLED)
50920 xmlNodePtr ret_val;
50921 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50924 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50925 mem_base = xmlMemBlocks();
50926 obj = gen_xmlXPathObjectPtr(n_obj, 0);
50928 ret_val = xmlXPtrBuildNodeList(obj);
50929 desret_xmlNodePtr(ret_val);
50931 des_xmlXPathObjectPtr(n_obj, obj, 0);
50932 xmlResetLastError();
50933 if (mem_base != xmlMemBlocks()) {
50934 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50935 xmlMemBlocks() - mem_base);
50937 printf(" %d", n_obj);
50949 test_xmlXPtrEval(void) {
50952 #if defined(LIBXML_XPTR_ENABLED)
50954 xmlXPathObjectPtr ret_val;
50955 xmlChar * str; /* the XPointer expression */
50957 xmlXPathContextPtr ctx; /* the XPointer context */
50960 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50961 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50962 mem_base = xmlMemBlocks();
50963 str = gen_const_xmlChar_ptr(n_str, 0);
50964 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50966 ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50967 desret_xmlXPathObjectPtr(ret_val);
50969 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50970 des_xmlXPathContextPtr(n_ctx, ctx, 1);
50971 xmlResetLastError();
50972 if (mem_base != xmlMemBlocks()) {
50973 printf("Leak of %d blocks found in xmlXPtrEval",
50974 xmlMemBlocks() - mem_base);
50976 printf(" %d", n_str);
50977 printf(" %d", n_ctx);
50990 test_xmlXPtrEvalRangePredicate(void) {
50993 #if defined(LIBXML_XPTR_ENABLED)
50995 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50998 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50999 mem_base = xmlMemBlocks();
51000 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51002 xmlXPtrEvalRangePredicate(ctxt);
51004 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51005 xmlResetLastError();
51006 if (mem_base != xmlMemBlocks()) {
51007 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51008 xmlMemBlocks() - mem_base);
51010 printf(" %d", n_ctxt);
51020 #ifdef LIBXML_XPTR_ENABLED
51022 #define gen_nb_xmlLocationSetPtr 1
51023 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51026 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51032 test_xmlXPtrLocationSetAdd(void) {
51035 #if defined(LIBXML_XPTR_ENABLED)
51037 xmlLocationSetPtr cur; /* the initial range set */
51039 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51042 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51043 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51044 mem_base = xmlMemBlocks();
51045 cur = gen_xmlLocationSetPtr(n_cur, 0);
51046 val = gen_xmlXPathObjectPtr(n_val, 1);
51048 xmlXPtrLocationSetAdd(cur, val);
51050 des_xmlLocationSetPtr(n_cur, cur, 0);
51051 des_xmlXPathObjectPtr(n_val, val, 1);
51052 xmlResetLastError();
51053 if (mem_base != xmlMemBlocks()) {
51054 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51055 xmlMemBlocks() - mem_base);
51057 printf(" %d", n_cur);
51058 printf(" %d", n_val);
51071 test_xmlXPtrLocationSetCreate(void) {
51075 /* missing type support */
51081 test_xmlXPtrLocationSetDel(void) {
51084 #if defined(LIBXML_XPTR_ENABLED)
51086 xmlLocationSetPtr cur; /* the initial range set */
51088 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51091 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51092 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51093 mem_base = xmlMemBlocks();
51094 cur = gen_xmlLocationSetPtr(n_cur, 0);
51095 val = gen_xmlXPathObjectPtr(n_val, 1);
51097 xmlXPtrLocationSetDel(cur, val);
51099 des_xmlLocationSetPtr(n_cur, cur, 0);
51100 des_xmlXPathObjectPtr(n_val, val, 1);
51101 xmlResetLastError();
51102 if (mem_base != xmlMemBlocks()) {
51103 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51104 xmlMemBlocks() - mem_base);
51106 printf(" %d", n_cur);
51107 printf(" %d", n_val);
51120 test_xmlXPtrLocationSetMerge(void) {
51124 /* missing type support */
51130 test_xmlXPtrLocationSetRemove(void) {
51133 #if defined(LIBXML_XPTR_ENABLED)
51135 xmlLocationSetPtr cur; /* the initial range set */
51137 int val; /* the index to remove */
51140 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51141 for (n_val = 0;n_val < gen_nb_int;n_val++) {
51142 mem_base = xmlMemBlocks();
51143 cur = gen_xmlLocationSetPtr(n_cur, 0);
51144 val = gen_int(n_val, 1);
51146 xmlXPtrLocationSetRemove(cur, val);
51148 des_xmlLocationSetPtr(n_cur, cur, 0);
51149 des_int(n_val, val, 1);
51150 xmlResetLastError();
51151 if (mem_base != xmlMemBlocks()) {
51152 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51153 xmlMemBlocks() - mem_base);
51155 printf(" %d", n_cur);
51156 printf(" %d", n_val);
51169 test_xmlXPtrNewCollapsedRange(void) {
51172 #if defined(LIBXML_XPTR_ENABLED)
51174 xmlXPathObjectPtr ret_val;
51175 xmlNodePtr start; /* the starting and ending node */
51178 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51179 mem_base = xmlMemBlocks();
51180 start = gen_xmlNodePtr(n_start, 0);
51182 ret_val = xmlXPtrNewCollapsedRange(start);
51183 desret_xmlXPathObjectPtr(ret_val);
51185 des_xmlNodePtr(n_start, start, 0);
51186 xmlResetLastError();
51187 if (mem_base != xmlMemBlocks()) {
51188 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51189 xmlMemBlocks() - mem_base);
51191 printf(" %d", n_start);
51203 test_xmlXPtrNewContext(void) {
51207 /* missing type support */
51213 test_xmlXPtrNewLocationSetNodeSet(void) {
51216 #if defined(LIBXML_XPTR_ENABLED)
51218 xmlXPathObjectPtr ret_val;
51219 xmlNodeSetPtr set; /* a node set */
51222 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51223 mem_base = xmlMemBlocks();
51224 set = gen_xmlNodeSetPtr(n_set, 0);
51226 ret_val = xmlXPtrNewLocationSetNodeSet(set);
51227 desret_xmlXPathObjectPtr(ret_val);
51229 des_xmlNodeSetPtr(n_set, set, 0);
51230 xmlResetLastError();
51231 if (mem_base != xmlMemBlocks()) {
51232 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51233 xmlMemBlocks() - mem_base);
51235 printf(" %d", n_set);
51247 test_xmlXPtrNewLocationSetNodes(void) {
51250 #if defined(LIBXML_XPTR_ENABLED)
51252 xmlXPathObjectPtr ret_val;
51253 xmlNodePtr start; /* the start NodePtr value */
51255 xmlNodePtr end; /* the end NodePtr value or NULL */
51258 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51259 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51260 mem_base = xmlMemBlocks();
51261 start = gen_xmlNodePtr(n_start, 0);
51262 end = gen_xmlNodePtr(n_end, 1);
51264 ret_val = xmlXPtrNewLocationSetNodes(start, end);
51265 desret_xmlXPathObjectPtr(ret_val);
51267 des_xmlNodePtr(n_start, start, 0);
51268 des_xmlNodePtr(n_end, end, 1);
51269 xmlResetLastError();
51270 if (mem_base != xmlMemBlocks()) {
51271 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51272 xmlMemBlocks() - mem_base);
51274 printf(" %d", n_start);
51275 printf(" %d", n_end);
51288 test_xmlXPtrNewRange(void) {
51291 #if defined(LIBXML_XPTR_ENABLED)
51293 xmlXPathObjectPtr ret_val;
51294 xmlNodePtr start; /* the starting node */
51296 int startindex; /* the start index */
51298 xmlNodePtr end; /* the ending point */
51300 int endindex; /* the ending index */
51303 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51304 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51305 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51306 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51307 mem_base = xmlMemBlocks();
51308 start = gen_xmlNodePtr(n_start, 0);
51309 startindex = gen_int(n_startindex, 1);
51310 end = gen_xmlNodePtr(n_end, 2);
51311 endindex = gen_int(n_endindex, 3);
51313 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51314 desret_xmlXPathObjectPtr(ret_val);
51316 des_xmlNodePtr(n_start, start, 0);
51317 des_int(n_startindex, startindex, 1);
51318 des_xmlNodePtr(n_end, end, 2);
51319 des_int(n_endindex, endindex, 3);
51320 xmlResetLastError();
51321 if (mem_base != xmlMemBlocks()) {
51322 printf("Leak of %d blocks found in xmlXPtrNewRange",
51323 xmlMemBlocks() - mem_base);
51325 printf(" %d", n_start);
51326 printf(" %d", n_startindex);
51327 printf(" %d", n_end);
51328 printf(" %d", n_endindex);
51343 test_xmlXPtrNewRangeNodeObject(void) {
51346 #if defined(LIBXML_XPTR_ENABLED)
51348 xmlXPathObjectPtr ret_val;
51349 xmlNodePtr start; /* the starting node */
51351 xmlXPathObjectPtr end; /* the ending object */
51354 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51355 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51356 mem_base = xmlMemBlocks();
51357 start = gen_xmlNodePtr(n_start, 0);
51358 end = gen_xmlXPathObjectPtr(n_end, 1);
51360 ret_val = xmlXPtrNewRangeNodeObject(start, end);
51361 desret_xmlXPathObjectPtr(ret_val);
51363 des_xmlNodePtr(n_start, start, 0);
51364 des_xmlXPathObjectPtr(n_end, end, 1);
51365 xmlResetLastError();
51366 if (mem_base != xmlMemBlocks()) {
51367 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51368 xmlMemBlocks() - mem_base);
51370 printf(" %d", n_start);
51371 printf(" %d", n_end);
51384 test_xmlXPtrNewRangeNodePoint(void) {
51387 #if defined(LIBXML_XPTR_ENABLED)
51389 xmlXPathObjectPtr ret_val;
51390 xmlNodePtr start; /* the starting node */
51392 xmlXPathObjectPtr end; /* the ending point */
51395 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51396 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51397 mem_base = xmlMemBlocks();
51398 start = gen_xmlNodePtr(n_start, 0);
51399 end = gen_xmlXPathObjectPtr(n_end, 1);
51401 ret_val = xmlXPtrNewRangeNodePoint(start, end);
51402 desret_xmlXPathObjectPtr(ret_val);
51404 des_xmlNodePtr(n_start, start, 0);
51405 des_xmlXPathObjectPtr(n_end, end, 1);
51406 xmlResetLastError();
51407 if (mem_base != xmlMemBlocks()) {
51408 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51409 xmlMemBlocks() - mem_base);
51411 printf(" %d", n_start);
51412 printf(" %d", n_end);
51425 test_xmlXPtrNewRangeNodes(void) {
51428 #if defined(LIBXML_XPTR_ENABLED)
51430 xmlXPathObjectPtr ret_val;
51431 xmlNodePtr start; /* the starting node */
51433 xmlNodePtr end; /* the ending node */
51436 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51437 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51438 mem_base = xmlMemBlocks();
51439 start = gen_xmlNodePtr(n_start, 0);
51440 end = gen_xmlNodePtr(n_end, 1);
51442 ret_val = xmlXPtrNewRangeNodes(start, end);
51443 desret_xmlXPathObjectPtr(ret_val);
51445 des_xmlNodePtr(n_start, start, 0);
51446 des_xmlNodePtr(n_end, end, 1);
51447 xmlResetLastError();
51448 if (mem_base != xmlMemBlocks()) {
51449 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51450 xmlMemBlocks() - mem_base);
51452 printf(" %d", n_start);
51453 printf(" %d", n_end);
51466 test_xmlXPtrNewRangePointNode(void) {
51469 #if defined(LIBXML_XPTR_ENABLED)
51471 xmlXPathObjectPtr ret_val;
51472 xmlXPathObjectPtr start; /* the starting point */
51474 xmlNodePtr end; /* the ending node */
51477 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51478 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51479 mem_base = xmlMemBlocks();
51480 start = gen_xmlXPathObjectPtr(n_start, 0);
51481 end = gen_xmlNodePtr(n_end, 1);
51483 ret_val = xmlXPtrNewRangePointNode(start, end);
51484 desret_xmlXPathObjectPtr(ret_val);
51486 des_xmlXPathObjectPtr(n_start, start, 0);
51487 des_xmlNodePtr(n_end, end, 1);
51488 xmlResetLastError();
51489 if (mem_base != xmlMemBlocks()) {
51490 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51491 xmlMemBlocks() - mem_base);
51493 printf(" %d", n_start);
51494 printf(" %d", n_end);
51507 test_xmlXPtrNewRangePoints(void) {
51510 #if defined(LIBXML_XPTR_ENABLED)
51512 xmlXPathObjectPtr ret_val;
51513 xmlXPathObjectPtr start; /* the starting point */
51515 xmlXPathObjectPtr end; /* the ending point */
51518 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51519 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51520 mem_base = xmlMemBlocks();
51521 start = gen_xmlXPathObjectPtr(n_start, 0);
51522 end = gen_xmlXPathObjectPtr(n_end, 1);
51524 ret_val = xmlXPtrNewRangePoints(start, end);
51525 desret_xmlXPathObjectPtr(ret_val);
51527 des_xmlXPathObjectPtr(n_start, start, 0);
51528 des_xmlXPathObjectPtr(n_end, end, 1);
51529 xmlResetLastError();
51530 if (mem_base != xmlMemBlocks()) {
51531 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51532 xmlMemBlocks() - mem_base);
51534 printf(" %d", n_start);
51535 printf(" %d", n_end);
51548 test_xmlXPtrRangeToFunction(void) {
51551 #if defined(LIBXML_XPTR_ENABLED)
51553 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51555 int nargs; /* the number of args */
51558 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51559 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51560 mem_base = xmlMemBlocks();
51561 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51562 nargs = gen_int(n_nargs, 1);
51564 xmlXPtrRangeToFunction(ctxt, nargs);
51566 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51567 des_int(n_nargs, nargs, 1);
51568 xmlResetLastError();
51569 if (mem_base != xmlMemBlocks()) {
51570 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51571 xmlMemBlocks() - mem_base);
51573 printf(" %d", n_ctxt);
51574 printf(" %d", n_nargs);
51587 test_xmlXPtrWrapLocationSet(void) {
51590 #if defined(LIBXML_XPTR_ENABLED)
51592 xmlXPathObjectPtr ret_val;
51593 xmlLocationSetPtr val; /* the LocationSet value */
51596 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51597 mem_base = xmlMemBlocks();
51598 val = gen_xmlLocationSetPtr(n_val, 0);
51600 ret_val = xmlXPtrWrapLocationSet(val);
51601 desret_xmlXPathObjectPtr(ret_val);
51603 des_xmlLocationSetPtr(n_val, val, 0);
51604 xmlResetLastError();
51605 if (mem_base != xmlMemBlocks()) {
51606 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51607 xmlMemBlocks() - mem_base);
51609 printf(" %d", n_val);
51620 test_xpointer(void) {
51623 if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51624 test_ret += test_xmlXPtrBuildNodeList();
51625 test_ret += test_xmlXPtrEval();
51626 test_ret += test_xmlXPtrEvalRangePredicate();
51627 test_ret += test_xmlXPtrLocationSetAdd();
51628 test_ret += test_xmlXPtrLocationSetCreate();
51629 test_ret += test_xmlXPtrLocationSetDel();
51630 test_ret += test_xmlXPtrLocationSetMerge();
51631 test_ret += test_xmlXPtrLocationSetRemove();
51632 test_ret += test_xmlXPtrNewCollapsedRange();
51633 test_ret += test_xmlXPtrNewContext();
51634 test_ret += test_xmlXPtrNewLocationSetNodeSet();
51635 test_ret += test_xmlXPtrNewLocationSetNodes();
51636 test_ret += test_xmlXPtrNewRange();
51637 test_ret += test_xmlXPtrNewRangeNodeObject();
51638 test_ret += test_xmlXPtrNewRangeNodePoint();
51639 test_ret += test_xmlXPtrNewRangeNodes();
51640 test_ret += test_xmlXPtrNewRangePointNode();
51641 test_ret += test_xmlXPtrNewRangePoints();
51642 test_ret += test_xmlXPtrRangeToFunction();
51643 test_ret += test_xmlXPtrWrapLocationSet();
51646 printf("Module xpointer: %d errors\n", test_ret);
51650 test_module(const char *module) {
51651 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51652 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51653 if (!strcmp(module, "SAX2")) return(test_SAX2());
51654 if (!strcmp(module, "c14n")) return(test_c14n());
51655 if (!strcmp(module, "catalog")) return(test_catalog());
51656 if (!strcmp(module, "chvalid")) return(test_chvalid());
51657 if (!strcmp(module, "debugXML")) return(test_debugXML());
51658 if (!strcmp(module, "dict")) return(test_dict());
51659 if (!strcmp(module, "encoding")) return(test_encoding());
51660 if (!strcmp(module, "entities")) return(test_entities());
51661 if (!strcmp(module, "hash")) return(test_hash());
51662 if (!strcmp(module, "list")) return(test_list());
51663 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51664 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51665 if (!strcmp(module, "parser")) return(test_parser());
51666 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51667 if (!strcmp(module, "pattern")) return(test_pattern());
51668 if (!strcmp(module, "relaxng")) return(test_relaxng());
51669 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51670 if (!strcmp(module, "schematron")) return(test_schematron());
51671 if (!strcmp(module, "tree")) return(test_tree());
51672 if (!strcmp(module, "uri")) return(test_uri());
51673 if (!strcmp(module, "valid")) return(test_valid());
51674 if (!strcmp(module, "xinclude")) return(test_xinclude());
51675 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51676 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51677 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51678 if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51679 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51680 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51681 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51682 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51683 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51684 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51685 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51686 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51687 if (!strcmp(module, "xpath")) return(test_xpath());
51688 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51689 if (!strcmp(module, "xpointer")) return(test_xpointer());